Always use underscores in event names
Follow-up of 3cbf249b
. This commit changes event names to be written with
underscores everywhere where events are fired (or every place I found in a
quick search, anyway).
This commit is contained in:
parent
b295aab4ba
commit
a74f1054ca
20 changed files with 55 additions and 55 deletions
|
@ -229,7 +229,7 @@
|
|||
name=turn 8
|
||||
|
||||
[fire_event]
|
||||
name=spawn creatures
|
||||
name=spawn_creatures
|
||||
[/fire_event]
|
||||
[/event]
|
||||
|
||||
|
@ -249,7 +249,7 @@
|
|||
[/filter]
|
||||
|
||||
[fire_event]
|
||||
name=spawn creatures
|
||||
name=spawn_creatures
|
||||
[/fire_event]
|
||||
[/event]
|
||||
|
||||
|
|
|
@ -825,7 +825,7 @@
|
|||
[/message]
|
||||
|
||||
[fire_event]
|
||||
name=remove disguise
|
||||
name=remove_disguise
|
||||
|
||||
[primary_unit]
|
||||
x,y=$x1,$y1
|
||||
|
@ -915,7 +915,7 @@
|
|||
[/message]
|
||||
|
||||
[fire_event]
|
||||
name=free heroes
|
||||
name=free_heroes
|
||||
[/fire_event]
|
||||
[/event]
|
||||
|
||||
|
@ -937,7 +937,7 @@
|
|||
[/message]
|
||||
|
||||
[fire_event]
|
||||
name=free heroes
|
||||
name=free_heroes
|
||||
[/fire_event]
|
||||
[/event]
|
||||
|
||||
|
@ -959,7 +959,7 @@
|
|||
[/message]
|
||||
|
||||
[fire_event]
|
||||
name=free heroes
|
||||
name=free_heroes
|
||||
[/fire_event]
|
||||
[/event]
|
||||
|
||||
|
@ -972,7 +972,7 @@
|
|||
[/message]
|
||||
|
||||
[fire_event]
|
||||
name=remove disguise
|
||||
name=remove_disguise
|
||||
|
||||
[primary_unit]
|
||||
side=1
|
||||
|
|
|
@ -533,7 +533,7 @@
|
|||
time=500
|
||||
[/delay]
|
||||
[fire_event]
|
||||
name=home destroyed
|
||||
name=home_destroyed
|
||||
[/fire_event]
|
||||
[/event]
|
||||
|
||||
|
@ -567,7 +567,7 @@
|
|||
time=500
|
||||
[/delay]
|
||||
[fire_event]
|
||||
name=home destroyed
|
||||
name=home_destroyed
|
||||
[/fire_event]
|
||||
[/event]
|
||||
|
||||
|
|
|
@ -343,7 +343,7 @@ Chapter Two"
|
|||
[/filter]
|
||||
|
||||
[fire_event]
|
||||
name=free cleodil
|
||||
name=free_cleodil
|
||||
[/fire_event]
|
||||
|
||||
[objectives]
|
||||
|
@ -376,7 +376,7 @@ Chapter Two"
|
|||
[/message]
|
||||
|
||||
[fire_event]
|
||||
name=free cleodil
|
||||
name=free_cleodil
|
||||
[/fire_event]
|
||||
[/then]
|
||||
[/if]
|
||||
|
|
|
@ -387,7 +387,7 @@
|
|||
message= _ "She is right. Don’t let them lure you away from the Ka’lian, preparations for when more of them arrive must be made."
|
||||
[/message]
|
||||
[fire_event]
|
||||
name=enemies defeated
|
||||
name=enemies_defeated
|
||||
[/fire_event]
|
||||
[/then]
|
||||
[/if]
|
||||
|
|
|
@ -1032,7 +1032,7 @@ Uu, Uu, Chr, Uh, Re, Uu, Uu, Uh, Uu, Chr, Chr
|
|||
[/filter_second]
|
||||
|
||||
[fire_event]
|
||||
name=last breath
|
||||
name=last_breath
|
||||
|
||||
[primary_unit]
|
||||
id=Dommel
|
||||
|
|
|
@ -226,7 +226,7 @@
|
|||
name=time over
|
||||
|
||||
[fire_event]
|
||||
name=victory cutscene
|
||||
name=victory_cutscene
|
||||
[/fire_event]
|
||||
|
||||
[endlevel]
|
||||
|
@ -256,7 +256,7 @@
|
|||
[/unstore_unit]
|
||||
|
||||
[fire_event]
|
||||
name=victory cutscene
|
||||
name=victory_cutscene
|
||||
[/fire_event]
|
||||
|
||||
[endlevel]
|
||||
|
|
|
@ -509,7 +509,7 @@
|
|||
[/message]
|
||||
|
||||
[fire_event]
|
||||
name=bridge explode
|
||||
name=bridge_explode
|
||||
[/fire_event]
|
||||
|
||||
[endlevel]
|
||||
|
|
|
@ -1363,11 +1363,11 @@
|
|||
{JEVGOLD}
|
||||
|
||||
[fire_event]
|
||||
name=spawn corpses
|
||||
name=spawn_corpses
|
||||
[/fire_event]
|
||||
|
||||
[fire_event]
|
||||
name=spawn skeletons
|
||||
name=spawn_skeletons
|
||||
[/fire_event]
|
||||
|
||||
[message]
|
||||
|
@ -1565,7 +1565,7 @@
|
|||
[/filter_condition]
|
||||
|
||||
[fire_event]
|
||||
name=spawn corpses
|
||||
name=spawn_corpses
|
||||
[/fire_event]
|
||||
|
||||
{CLEAR_VARIABLE next_corpse_spawn_turn}
|
||||
|
@ -1599,7 +1599,7 @@
|
|||
[/filter_condition]
|
||||
|
||||
[fire_event]
|
||||
name=spawn skeletons
|
||||
name=spawn_skeletons
|
||||
[/fire_event]
|
||||
|
||||
{CLEAR_VARIABLE next_skeleton_spawn_turn}
|
||||
|
|
|
@ -799,7 +799,7 @@
|
|||
[/filter]
|
||||
|
||||
[fire_event]
|
||||
name=stable found
|
||||
name=stable_found
|
||||
[primary_unit]
|
||||
x=$x1
|
||||
y=$y1
|
||||
|
@ -1235,7 +1235,7 @@
|
|||
[event]
|
||||
name=turn 16
|
||||
[fire_event]
|
||||
name=hunting party
|
||||
name=hunting_party
|
||||
[/fire_event]
|
||||
[/event]
|
||||
|
||||
|
@ -1287,7 +1287,7 @@
|
|||
|
||||
# Elvish hunting party arrives if the necromancer died before turn 16.
|
||||
[fire_event]
|
||||
name=hunting party
|
||||
name=hunting_party
|
||||
[/fire_event]
|
||||
|
||||
[message]
|
||||
|
|
|
@ -1546,7 +1546,7 @@
|
|||
#at next turn create haunt trainer and ghost novices
|
||||
name=new turn
|
||||
[fire_event]
|
||||
name=start training
|
||||
name=start_training
|
||||
[/fire_event]
|
||||
[/event]
|
||||
[/event]
|
||||
|
|
|
@ -507,7 +507,7 @@
|
|||
[/print]
|
||||
|
||||
[fire_event]
|
||||
name=menu item ai_controller
|
||||
name=menu_item_ai_controller
|
||||
|
||||
[primary_unit]
|
||||
x=$ai_controller_{AFFIX}.defend_location.original_controller_invokation_x
|
||||
|
|
|
@ -1107,7 +1107,7 @@ namespace {
|
|||
dat.add_child("first", d_weapon_cfg);
|
||||
dat.add_child("second", a_weapon_cfg);
|
||||
|
||||
resources::game_events->pump().fire("last breath", death_loc, attacker_loc, dat);
|
||||
resources::game_events->pump().fire("last_breath", death_loc, attacker_loc, dat);
|
||||
refresh_bc();
|
||||
|
||||
if (!defender.valid() || defender.get_unit().hitpoints() > 0) {
|
||||
|
@ -1160,7 +1160,7 @@ namespace {
|
|||
units_.add(death_loc, newunit);
|
||||
|
||||
game_events::entity_location reanim_loc(defender.loc_, newunit.underlying_id());
|
||||
resources::game_events->pump().fire("unit placed", reanim_loc);
|
||||
resources::game_events->pump().fire("unit_placed", reanim_loc);
|
||||
|
||||
preferences::encountered_units().insert(newunit.type_id());
|
||||
if (update_display_) {
|
||||
|
@ -1490,7 +1490,7 @@ void advance_unit_at(const advance_unit_params& params)
|
|||
if(params.fire_events_)
|
||||
{
|
||||
LOG_NG << "Firing pre advance event at " << params.loc_ <<".\n";
|
||||
resources::game_events->pump().fire("pre advance", params.loc_);
|
||||
resources::game_events->pump().fire("pre_advance", params.loc_);
|
||||
//TODO: maybe use id instead of location here ?.
|
||||
u = resources::units->find(params.loc_);
|
||||
if(!unit_helper::will_certainly_advance(u))
|
||||
|
@ -1621,7 +1621,7 @@ void advance_unit(map_location loc, const std::string &advance_to,
|
|||
if(fire_event)
|
||||
{
|
||||
LOG_NG << "Firing post_advance event at " << loc << ".\n";
|
||||
resources::game_events->pump().fire("post advance",loc);
|
||||
resources::game_events->pump().fire("post_advance",loc);
|
||||
}
|
||||
|
||||
// "sighted" event(s).
|
||||
|
|
|
@ -636,7 +636,7 @@ place_recruit_result place_recruit(unit_ptr u, const map_location &recruit_locat
|
|||
recruit_checksums(*u, wml_triggered);
|
||||
resources::whiteboard->on_gamestate_change();
|
||||
|
||||
resources::game_events->pump().fire("unit placed", current_loc);
|
||||
resources::game_events->pump().fire("unit_placed", current_loc);
|
||||
|
||||
if ( fire_event ) {
|
||||
const std::string event_name = is_recall ? "prerecall" : "prerecruit";
|
||||
|
|
|
@ -217,7 +217,7 @@ void unit_creator::post_create(const map_location &loc, const unit &new_unit, bo
|
|||
|
||||
// Only fire the events if it's safe; it's not if we're in the middle of play_controller::reset_gamestate()
|
||||
if (resources::lua_kernel != nullptr) {
|
||||
resources::game_events->pump().fire("unit placed", loc);
|
||||
resources::game_events->pump().fire("unit_placed", loc);
|
||||
}
|
||||
|
||||
if (resources::screen!=nullptr) {
|
||||
|
|
|
@ -789,7 +789,7 @@ void manager::play_turn( side_number side ){
|
|||
/*hack. @todo 1.9 rework via extended event system*/
|
||||
get_ai_info().recent_attacks.clear();
|
||||
ai_composite& ai_obj = get_active_ai_for_side(side);
|
||||
resources::game_events->pump().fire("ai turn");
|
||||
resources::game_events->pump().fire("ai_turn");
|
||||
raise_turn_started();
|
||||
if (resources::tod_manager->has_tod_bonus_changed()) {
|
||||
raise_tod_changed();
|
||||
|
|
|
@ -369,7 +369,7 @@ void play_controller::fire_prestart()
|
|||
// Fire these right before prestart events, to catch only the units sides
|
||||
// have started with.
|
||||
for (const unit& u : gamestate().board_.units()) {
|
||||
pump().fire("unit placed", map_location(u.get_location()));
|
||||
pump().fire("unit_placed", map_location(u.get_location()));
|
||||
}
|
||||
|
||||
pump().fire("prestart");
|
||||
|
@ -448,15 +448,15 @@ void play_controller::do_init_side()
|
|||
// We might have skipped some sides because they were empty so it is not enough to check for side_num==1
|
||||
if(!gamestate().tod_manager_.has_turn_event_fired())
|
||||
{
|
||||
pump().fire("turn " + turn_num);
|
||||
pump().fire("new turn");
|
||||
pump().fire("turn_" + turn_num);
|
||||
pump().fire("new_turn");
|
||||
gamestate().tod_manager_.turn_event_fired();
|
||||
}
|
||||
|
||||
pump().fire("side turn");
|
||||
pump().fire("side " + side_num + " turn");
|
||||
pump().fire("side turn " + turn_num);
|
||||
pump().fire("side " + side_num + " turn " + turn_num);
|
||||
pump().fire("side_turn");
|
||||
pump().fire("side_" + side_num + "_turn");
|
||||
pump().fire("side_turn_" + turn_num);
|
||||
pump().fire("side_" + side_num + "_turn_" + turn_num);
|
||||
|
||||
// We want to work out if units for this player should get healed,
|
||||
// and the player should get income now.
|
||||
|
@ -481,10 +481,10 @@ void play_controller::do_init_side()
|
|||
// Prepare the undo stack.
|
||||
undo_stack().new_side_turn(current_side());
|
||||
|
||||
pump().fire("turn refresh");
|
||||
pump().fire("side " + side_num + " turn refresh");
|
||||
pump().fire("turn " + turn_num + " refresh");
|
||||
pump().fire("side " + side_num + " turn " + turn_num + " refresh");
|
||||
pump().fire("turn_refresh");
|
||||
pump().fire("side_" + side_num + "_turn_refresh");
|
||||
pump().fire("turn_" + turn_num + "_refresh");
|
||||
pump().fire("side_" + side_num + "_turn_" + turn_num + "_refresh");
|
||||
|
||||
// Make sure vision is accurate.
|
||||
actions::clear_shroud(current_side(), true);
|
||||
|
@ -543,10 +543,10 @@ void play_controller::finish_side_turn()
|
|||
// Clear shroud, in case units had been slowed for the turn.
|
||||
actions::clear_shroud(current_side());
|
||||
|
||||
pump().fire("side turn end");
|
||||
pump().fire("side "+ side_num + " turn end");
|
||||
pump().fire("side turn " + turn_num + " end");
|
||||
pump().fire("side " + side_num + " turn " + turn_num + " end");
|
||||
pump().fire("side_turn_end");
|
||||
pump().fire("side_"+ side_num + "_turn_end");
|
||||
pump().fire("side_turn_" + turn_num + "_end");
|
||||
pump().fire("side_" + side_num + "_turn_" + turn_num + "_end");
|
||||
// This is where we refog, after all of a side's events are done.
|
||||
actions::recalculate_fog(current_side());
|
||||
check_victory();
|
||||
|
@ -562,8 +562,8 @@ void play_controller::finish_turn()
|
|||
{
|
||||
set_scontext_synced sync(2);
|
||||
const std::string turn_num = std::to_string(turn());
|
||||
pump().fire("turn end");
|
||||
pump().fire("turn " + turn_num + " end");
|
||||
pump().fire("turn_end");
|
||||
pump().fire("turn_" + turn_num + "_end");
|
||||
sync.do_final_checkup();
|
||||
}
|
||||
|
||||
|
@ -1228,7 +1228,7 @@ void play_controller::check_time_over()
|
|||
if(!time_left) {
|
||||
LOG_NG << "firing time over event...\n";
|
||||
set_scontext_synced_base sync;
|
||||
pump().fire("time over");
|
||||
pump().fire("time_over");
|
||||
LOG_NG << "done firing time over event...\n";
|
||||
// If turns are added while handling 'time over' event.
|
||||
if (gamestate().tod_manager_.is_time_left()) {
|
||||
|
|
|
@ -289,7 +289,7 @@ LEVEL_RESULT playsingle_controller::play_scenario(const config& level)
|
|||
{ // Block for set_scontext_synced_base
|
||||
set_scontext_synced_base sync;
|
||||
pump().fire(end_level.proceed_to_next_level ? "victory" : "defeat");
|
||||
pump().fire("scenario end");
|
||||
pump().fire("scenario_end");
|
||||
}
|
||||
if(end_level.proceed_to_next_level) {
|
||||
gamestate().board_.heal_all_survivors();
|
||||
|
|
|
@ -2556,7 +2556,7 @@ int game_lua_kernel::intf_put_unit(lua_State *L)
|
|||
units().insert(u);
|
||||
}
|
||||
if(unit_arg != 1 || luaW_toboolean(L, 3)) {
|
||||
play_controller_.pump().fire("unit placed", loc);
|
||||
play_controller_.pump().fire("unit_placed", loc);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -3880,7 +3880,7 @@ int game_lua_kernel::intf_kill(lua_State *L)
|
|||
}
|
||||
}
|
||||
if (fire_event) {
|
||||
play_controller_.pump().fire("last breath", death_loc, killer_loc);
|
||||
play_controller_.pump().fire("last_breath", death_loc, killer_loc);
|
||||
}
|
||||
|
||||
// Visual consequences of the kill.
|
||||
|
|
|
@ -477,7 +477,7 @@ SYNCED_COMMAND_HANDLER_FUNCTION(debug_create_unit, child, use_undo, /*show*/, e
|
|||
// Add the unit to the board.
|
||||
std::pair<unit_map::iterator, bool> add_result = resources::units->replace(loc, created);
|
||||
resources::screen->invalidate_unit();
|
||||
resources::game_events->pump().fire("unit placed", loc);
|
||||
resources::game_events->pump().fire("unit_placed", loc);
|
||||
unit_display::unit_recruited(loc);
|
||||
|
||||
// Village capture?
|
||||
|
@ -517,7 +517,7 @@ SYNCED_COMMAND_HANDLER_FUNCTION(debug_kill, child, use_undo, /*show*/, /*error_h
|
|||
const unit_map::iterator i = resources::units->find(loc);
|
||||
if (i != resources::units->end()) {
|
||||
const int dying_side = i->side();
|
||||
resources::controller->pump().fire("last breath", loc, loc);
|
||||
resources::controller->pump().fire("last_breath", loc, loc);
|
||||
if (i.valid()) {
|
||||
unit_display::unit_die(loc, *i);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue