private void handleAction(Menu.Action action, int dir = 1) { switch (action.Type) { default: case Menu.ActionType.None: break; case Menu.ActionType.OpenMenu: _pastMenuStack.Add(_currentMenu.Name); configureForState(action.Param); break; case Menu.ActionType.SceneTransition: this.Hide(); _actionTimer = new Timer(this.SceneTransitionDelay, false, true, onDelayedAction); _timerParam = action.Param; _changingScene = true; LocalEventNotifier.Event e = new LocalEventNotifier.Event(); e.Name = this.EndSceneEvent; GlobalEvents.Notifier.SendEvent(e); break; case Menu.ActionType.CloseMenuWithEvent: this.Hide(); _actionTimer = new Timer(this.EventSendDelay, false, true, onDelayedAction); _timerParam = action.Param; break; case Menu.ActionType.ChangeValue: OptionsValues.ChangeValue(action.Param, dir); refreshState(); break; case Menu.ActionType.Reload: for (int i = 0; i < _pastMenuStack.Count; ++i) { menuByStateName(_pastMenuStack[i]).Reload(); } _currentMenu.Reload(); refreshState(); break; } }