diff --git a/rsrc/dialogs/edit-scenario-events.xml b/rsrc/dialogs/edit-scenario-events.xml index 6fad216d..3a7a9670 100644 --- a/rsrc/dialogs/edit-scenario-events.xml +++ b/rsrc/dialogs/edit-scenario-events.xml @@ -2,15 +2,24 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -21,8 +30,8 @@ - @@ -35,8 +44,9 @@ For more information on how this works, see the documentation. - Number of moves between each call. - Scenario special node to call. + Id + Number of moves between each call. + Scenario special node to call. Note: If you leave the time between calls at 0, no special node is called. Don't have special nodes called too often ... it slows the game down. diff --git a/src/scenedit/scen.core.cpp b/src/scenedit/scen.core.cpp index d1ff2bfa..8308d942 100644 --- a/src/scenedit/scen.core.cpp +++ b/src/scenedit/scen.core.cpp @@ -3113,6 +3113,7 @@ static void put_scenario_events(cDialog& me, ::cTimersState const &state) me["down"].show(); for(size_t i = 0; first_item+i < state.timers.size() && i < state.num_items; i++) { std::string id = std::to_string(i + 1); + me["id" + id].setText(std::to_string(first_item+i)); me["time" + id].setTextToNum(state.timers[first_item+i].time); me["node" + id].setTextToNum(state.timers[first_item+i].node); } @@ -3127,14 +3128,14 @@ static bool display_scenario_events(cDialog& me, ::cTimersState &state, std::str if (item=="up") { if (state.first_item<=0) return false; - --state.first_item; + state.first_item=std::max(state.num_items,state.first_item)-state.num_items; put_scenario_events(me, state); return true; } if (item=="down") { if (state.first_item+state.num_items>=state.timers.size()) return false; - ++state.first_item; + state.first_item=std::min(state.timers.size()-state.num_items,state.first_item+state.num_items); put_scenario_events(me, state); return true; }