if (event_action == ANIM_EVENT_ACTION_NONE)
return FALSE;
- PushUserEvent(USEREVENT_ANIM_EVENT_ACTION, event_action, 0);
+ if (event_action < MAX_IMAGE_FILES)
+ PushUserEvent(USEREVENT_ANIM_EVENT_ACTION, event_action, 0);
+ else
+ OpenURLFromHash(anim_url_hash, event_action);
// check if further actions are allowed to be executed
if (part->control_info.style & STYLE_MULTIPLE_ACTIONS)
result = -(int)key;
}
+ if (result == -1)
+ {
+ if (isURL(token))
+ {
+ result = get_hash_from_key(token); // unsigned int => int
+ result = ABS(result); // may be negative now
+ result += (result < MAX_IMAGE_FILES ? MAX_IMAGE_FILES : 0);
+
+ setHashEntry(anim_url_hash, int2str(result, 0), token);
+ }
+ }
+
if (result == -1)
result = ANIM_EVENT_ACTION_NONE;
global_anim_info[i].token_name = global_anim_name_info[i].token_name;
}
+ // create hash to store URLs for global animations
+ anim_url_hash = newSetupFileHash();
+
// create hash from image config list
image_config_hash = newSetupFileHash();
for (i = 0; image_config[i].token != NULL; i++)
// this bitmap pointer points to the bitmap with default image size
#define IMG_BITMAP_STANDARD IMG_BITMAP_32x32
+// maximum number of statically and dynamically defined image files
+#define MAX_IMAGE_FILES 1000000
+
#define GET_BITMAP_ID_FROM_TILESIZE(x) ((x) == 1 ? IMG_BITMAP_1x1 : \
(x) == 2 ? IMG_BITMAP_2x2 : \
SetupFileHash *graphic_token_hash = NULL;
SetupFileHash *font_token_hash = NULL;
SetupFileHash *hide_setup_hash = NULL;
+SetupFileHash *anim_url_hash = NULL;
// ----------------------------------------------------------------------------
extern SetupFileHash *graphic_token_hash;
extern SetupFileHash *font_token_hash;
extern SetupFileHash *hide_setup_hash;
+extern SetupFileHash *anim_url_hash;
extern struct ConfigTypeInfo image_config_suffix[];
extern struct ConfigTypeInfo sound_config_suffix[];
extern struct ConfigTypeInfo music_config_suffix[];