{
if (strEqual(setup.touch.control_type, TOUCH_CONTROL_FOLLOW_FINGER))
HandleButtonOrFinger_FollowFinger(mx, my, button);
- else if (level.has_mouse_events && valid_mouse_event)
+ else if (game.use_mouse_events && valid_mouse_event)
SetPlayerMouseAction(mx, my, button);
}
}
// set all bug compatibility flags to "false" => do not emulate this bug
level->use_action_after_change_bug = FALSE;
- // other flags that may be set due to certain level properties
- level->has_mouse_events = FALSE;
-
if (leveldir_current)
{
// try to determine better author name than 'anonymous'
element_info[element].ignition_delay = 8;
}
}
-
- // check for custom elements which have mouse click events defined
- for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
- {
- int element = EL_CUSTOM_START + i;
-
- if (HAS_CHANGE_EVENT(element, CE_CLICKED_BY_MOUSE) ||
- HAS_CHANGE_EVENT(element, CE_PRESSED_BY_MOUSE) ||
- HAS_CHANGE_EVENT(element, CE_MOUSE_CLICKED_ON_X) ||
- HAS_CHANGE_EVENT(element, CE_MOUSE_PRESSED_ON_X))
- level->has_mouse_events = TRUE;
- }
}
static void LoadLevel_InitElements(struct LevelInfo *level)
// Supaplex levels with time limit currently unsupported -- should be added
if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
level.time = 0;
+
+ // ----------initialize flag for handling mouse events ---------------------
+
+ // set flag to default value: do not handle mouse events
+ game.use_mouse_events = FALSE;
+
+ // now check for custom elements which have mouse click events defined
+ for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++)
+ {
+ int element = EL_CUSTOM_START + i;
+
+ if (HAS_CHANGE_EVENT(element, CE_CLICKED_BY_MOUSE) ||
+ HAS_CHANGE_EVENT(element, CE_PRESSED_BY_MOUSE) ||
+ HAS_CHANGE_EVENT(element, CE_MOUSE_CLICKED_ON_X) ||
+ HAS_CHANGE_EVENT(element, CE_MOUSE_PRESSED_ON_X))
+ game.use_mouse_events = TRUE;
+ }
}
static int get_num_special_action(int element, int action_first,
boolean max_num_changes_per_frame;
boolean use_reverse_scan_direction;
+ // flag to indicate if mouse events are processed by game engine
+ boolean use_mouse_events;
+
// variable within running game
int yamyam_content_nr;
boolean robot_wheel_active;
// runtime flags to handle bugs in old levels (not stored in level file)
boolean use_action_after_change_bug;
-
- // runtime flags to indicate level properties (not stored in level file)
- boolean has_mouse_events;
};
struct NetworkLevelInfo