protected override void UpdateMenu(bool active) { int index = Window.index; Window.update(active); if (index != Window.index) { OnIndexChanged(new EventArgs()); } if (CancelButton != null) { CancelButton.Update(active); } bool cancel = CanceledTriggered(active); if (cancel) { Global.game_system.play_se(System_Sounds.Cancel); Window.cancel(); OnCanceled(new EventArgs()); } else if (Window.is_selected()) { OnSelected(new EventArgs()); } }
protected override void UpdateMenu(bool active) { if (ModeSwitchTimer > 0) { ModeSwitchTimer--; } MenuData.Index = this.Redirect; CommandWindow.update(active && this.SelectingChapter); if (MenuData.Index != this.Redirect) { MenuData.Index = this.Redirect; Refresh(); } if (ChapterCommandWindow != null) { ChapterCommandWindow.update(active); } CancelButton.Update(active); DifficultyButton.Update(active && CanChangeDifficulty()); UpdateInput(active); DataWindow.update(); }
protected override void update_input(bool active) { StartButton.Update(active && input_ready); if (active && input_ready) { bool pressedStart = false; if (Global.Input.triggered(Inputs.Start) || this.start_ui_button_pressed) { pressedStart = true; } if (CommandWindow.is_selected()) { OnSelected(new EventArgs()); } else if (CommandWindow.is_canceled()) { command_window_canceled(); } else if (pressedStart) { OnStart(new EventArgs()); } } }
protected override void UpdateMenu(bool active) { if (this.HideCursorWhileInactive) { Window.active = active; } int index = Window.index; Window.update(active); if (index != Window.index) { OnIndexChanged(new EventArgs()); } if (CancelButton != null) { CancelButton.Update(active); } bool cancel = CanceledTriggered(active); if (cancel) { Cancel(); } else if (Window.is_selected()) { SelectItem(); } }
private void update_ui(bool input) { Start.Update(input); B_Button.Update(input); R_Button.Update(input); if (input) { SelectedIndex = Maybe <PrepCheckMapResults> .Nothing; if (Global.Input.triggered(Inputs.Start) || Start.consume_trigger(MouseButtons.Left) || Start.consume_trigger(TouchGestures.Tap)) { SelectedIndex = PrepCheckMapResults.StartChapter; OnSelected(new EventArgs()); } else if (B_Button.consume_trigger(MouseButtons.Left) || B_Button.consume_trigger(TouchGestures.Tap)) { SelectedIndex = PrepCheckMapResults.Cancel; OnSelected(new EventArgs()); } else if (R_Button.consume_trigger(MouseButtons.Left) || R_Button.consume_trigger(TouchGestures.Tap)) { SelectedIndex = PrepCheckMapResults.Info; OnSelected(new EventArgs()); } } }
protected override void UpdateStandardMenu(bool active) { // Needed to animate map sprites if (this.HidesParent) { Global.game_system.update_timers(); } Window.update(active); Background.update(); FaceWindow.update(); Face.update(); NameBanner.update(); Name.update(); // Switch field/base support mode if (FieldBaseButton != null) { FieldBaseButton.Update(active); } bool switchField = active && Window.FieldBaseDifference && Global.Input.triggered(Inputs.X); if (FieldBaseButton != null) { switchField |= FieldBaseButton.consume_trigger(MouseButtons.Left) || FieldBaseButton.consume_trigger(TouchGestures.Tap); } if (switchField) { OnFieldBaseSwitched(new EventArgs()); } }
protected override void UpdateMenu(bool active) { int index = StyleNodes.ActiveNodeIndex; StyleNodes.Update(active, -MenuLoc); if (index != StyleNodes.ActiveNodeIndex) { StylePanels[index].active = false; StyleNodes.ActiveNode.active = true; } CancelButton.Update(active); if (active) { var styleIndex = StyleNodes.consume_triggered( Inputs.A, MouseButtons.Left, TouchGestures.Tap); if (styleIndex.IsSomething) { Global.game_system.play_se(System_Sounds.Confirm); StyleNodes.set_active_node(StyleNodes[styleIndex]); OnSelected(new EventArgs()); } else if (Global.Input.triggered(Inputs.B) || Global.Input.KeyPressed(Keys.Escape) || CancelButton.consume_trigger(MouseButtons.Left) || CancelButton.consume_trigger(TouchGestures.Tap)) { Global.game_system.play_se(System_Sounds.Cancel); OnCanceled(new EventArgs()); } } }
protected override void update_input(bool active) { active &= DetailedRanking == null; CancelButton.Update(active); Nodes.Update(active, new Vector2((int)Scroll.X, (int)Scroll.Y)); Cursor.update(); update_scroll(active); if (active) { var selected = Nodes.consume_triggered( Inputs.A, MouseButtons.Left, TouchGestures.Tap); if (selected.IsSomething) { DetailedRanking = new Window_Ranking(Rankings[selected].Value); } else if (Global.Input.triggered(Inputs.B) || cancel_button_triggered) { Global.game_system.play_se(System_Sounds.Cancel); close(); } } }
private void update_ui(bool input) { if (input) { foreach (var arrow in LeftArrows.Keys) { arrow.UpdateInput(-Loc); } foreach (var arrow in RightArrows.Keys) { arrow.UpdateInput(-Loc); } } int index = Items.ActiveNodeIndex; Items.Update(input, -(Loc)); bool moved = index != Items.ActiveNodeIndex; UICursor.update(); if (CancelButton != null) { CancelButton.Update(input); } bool cancel = CanceledTriggered(input); if (cancel) { Global.game_system.play_se(System_Sounds.Cancel); OnCanceled(new EventArgs()); } else if (input) { if (Global.Input.triggered(Inputs.Left)) { change_index(-1); } else if (Global.Input.triggered(Inputs.Right)) { change_index(1); } var selected = Items.consume_triggered( Inputs.A, MouseButtons.Left, TouchGestures.Tap); // Select event if on Confirm if (selected.IsSomething && selected == ValidPreviousChapters.Count) { Global.game_system.play_se(System_Sounds.Confirm); OnSelected(new EventArgs()); } } }
protected override void update_input(bool active) { bool input = active && this.ready; CancelButton.Update(input); Select.Update(input); if (input) { // Close this window if (Global.Input.triggered(Inputs.B) || CancelButton.consume_trigger(MouseButtons.Left) || CancelButton.consume_trigger(TouchGestures.Tap)) { Global.game_system.play_se(System_Sounds.Cancel); if (this.unit_selected) { cancel_unit_selected(); } else { close(); } return; } else if (Global.Input.triggered(Inputs.Select) || Select.consume_trigger(MouseButtons.Left) || Select.consume_trigger(TouchGestures.Tap)) { Global.game_system.play_se(System_Sounds.Confirm); OnUnit(new EventArgs()); return; } // Select unit var selected_index = Unit_Window.consume_triggered( Inputs.A, MouseButtons.Left, TouchGestures.Tap); if (selected_index.IsSomething) { select_unit(selected_index); //Debug return; } // Status screen var status_index = Unit_Window.consume_triggered( Inputs.R, MouseButtons.Right, TouchGestures.LongPress); if (status_index.IsSomething) { Global.game_system.play_se(System_Sounds.Confirm); OnStatus(new EventArgs()); } } }
protected override void UpdateMenu(bool active) { TradeWindow.update(active); if (CancelButton != null) { CancelButton.Update(active); } bool cancel = CanceledTriggered(active); if (TradeWindow.is_help_active) { if (cancel) { TradeWindow.close_help(); } } else { if (TradeWindow.getting_help()) { TradeWindow.open_help(); } else if (cancel) { Global.game_system.play_se(System_Sounds.Cancel); // An item is selected, deselect it if (TradeWindow.mode > 0) { TradeWindow.cancel(); } // Nothing selected, close the menu else { TradeWindow.staff_fix(); OnClosed(new EventArgs()); } return; } else if (TradeWindow.is_selected()) { Traded |= TradeWindow.enter(); if (Traded) { OnTrade(new EventArgs()); if (CancelButton != null) { CancelButton.description = "Close"; } } } } }
protected override void UpdateMenu(bool active) { update_black_screen(); if (Delay > 0) { Delay--; // Does this do anything //Yeti } Background.update(); bool input = !Closing && Delay == 0 && Black_Screen_Timer == 0; Window.update(input && Trading && !Accepting && Message.text_end); CancelButton.Update(input && !Accepting && Message.text_end); if (Choices != null) { Choices.Update(input && Message.text_end); update_cursor_location(); } if (input) { if (Message_Active) { update_message(); } if (!Closing && Message.text_end) { if (Trading && !Accepting && !Window.active) { Window.active = true; } else if (!Trading) { update_main_selection(); } else if (!Accepting) { update_trading(); } else if (!Confirming_Send) { update_accepting(); } else { update_sending(); } } } Face.update(); }
protected override void UpdateMenu(bool active) { active = IsActive(active); UpdateStandardMenu(active); if (CancelButton != null) { CancelButton.Update(active); } if (CanceledTriggered(active)) { Cancel(); } else if (SelectedTriggered(active)) { SelectItem(); } }
protected override void update_graphics(bool activeNode) { Text.update(); Value.Update(); }
protected override void UpdateMenu(bool active) { SwitchButton.Update(active); base.UpdateMenu(active && this.ready); Face.update(); }
protected override void UpdateMenu(bool active) { update_map_sprite(); update_direction(); // Black Screen update_black_screen(); // Inputs bool input = active && Delay == 0 && !Closing && Black_Screen_Timer <= 0; #if DEBUG if (Help_Window != null && input && Global.Input.pressed(Inputs.X)) { DirectionFlags dir = Global.Input.dir_triggered(); if (dir != DirectionFlags.None) { StatusNodes[page].ActiveNode.cheat(this.unit, dir); move_to(Help_Index); Help_Window.add_remaining_text(); foreach (var status_page in Pages) { status_page.refresh(this.unit); } foreach (StatusUINode node in TopPanelNodes) { node.refresh(unit); } } input = false; } #endif // Cancel button CancelButton.Update(input); StatusNodes[page].Update(!input ? ControlSet.None : (Help_Window != null ? ControlSet.Movement : (ControlSet.Mouse | ControlSet.Touch))); if (input) { if (Help_Window == null) { update_input(); var help_index = StatusNodes[page].consume_triggered( MouseButtons.Left, TouchGestures.Tap); if (help_index.IsNothing) { help_index = StatusNodes[page].consume_triggered( TouchGestures.LongPress); } if (help_index.IsSomething) { Help_Index = StatusNodes[page][help_index].HelpLabel; open_help(); } } else { if (StatusNodes[page].ActiveNode.HelpLabel != Help_Index) { move_to(StatusNodes[page].ActiveNode.HelpLabel); } var help_index = StatusNodes[page].consume_triggered( MouseButtons.Left, TouchGestures.Tap); var help_cancel_index = StatusNodes[page].consume_triggered( TouchGestures.LongPress); if (Global.Input.triggered(Inputs.B) || Global.Input.triggered(Inputs.R) || Global.Input.mouse_click(MouseButtons.Right) || help_cancel_index.IsSomething || CancelButton.consume_trigger(MouseButtons.Left) || CancelButton.consume_trigger(TouchGestures.Tap)) { close_help(); } /* //Debug * if (Global.Input.repeated(Inputs.Down)) * { * if (move(2)) * { * * } * } * if (Global.Input.repeated(Inputs.Up)) * { * if (move(8)) * { * * } * } * if (Global.Input.repeated(Inputs.Right)) * { * if (move(6)) * { * * } * } * if (Global.Input.repeated(Inputs.Left)) * { * if (move(4)) * { * * } * } * else if (Global.Input.triggered(Inputs.R) || Global.Input.triggered(Inputs.B)) * { * close_help(); * }*/ } StatusCursors[page].update(); } if (Help_Window != null) { Help_Window.update(); } Background.update(); // Top Panel Top_Panel.update(); foreach (TextSprite label in Battle_Stat_Labels) { label.update(); } // Pages foreach (Status_Page status_page in Pages) { status_page.update(); } Left_Page_Arrow.update(); Right_Page_Arrow.update(); }
protected override void UpdateStandardMenu(bool active) { Background.update(); if (Scrollbar != null) { Scrollbar.update(); if (active) { Scrollbar.update_input(); } } bool holdDown = false, holdUp = false; if (Global.Input.pressed(Inputs.Down)) { holdDown = true; } else if (Global.Input.pressed(Inputs.Up)) { holdUp = true; } else if (Scrollbar != null) { if (Scrollbar.DownHeld) { holdDown = true; } else if (Scrollbar.UpHeld) { holdUp = true; } } if (holdDown) { ScrollSpeed = Math.Max(1, ScrollSpeed); ScrollSpeed = Math.Min(ScrollSpeed + 0.25f, +MAX_SCROLL); } else if (holdUp) { ScrollSpeed = Math.Min(-1, ScrollSpeed); ScrollSpeed = Math.Max(ScrollSpeed - 0.25f, -MAX_SCROLL); } else { ScrollSpeed = 0f; } ScrollOffset.Y = (int)MathHelper.Clamp( ScrollOffset.Y + ScrollSpeed, 0, this.MaxScroll); if (Scrollbar != null) { Scrollbar.scroll = (int)ScrollOffset.Y; } // Full credits link if (FullCreditsButton != null) { FullCreditsButton.Update(active); bool fullCredits = false; fullCredits |= FullCreditsButton.consume_trigger(MouseButtons.Left) || FullCreditsButton.consume_trigger(TouchGestures.Tap); if (active) { fullCredits |= Global.Input.triggered(Inputs.X); } if (fullCredits) { OnOpenFullCredits(new EventArgs()); } } }
protected void update_message_skip_buttons() { _EventSkip = false; bool no_convo = Message_Window == null || !Message_Window.active; bool skip_button_active = this.skip_convo_button_active; // Create buttons if needed if (SkipButton == null) { if (skip_button_active) { create_convo_skip_buttons(); SkipButtonOffset = new Vector2(0, 16); SkipButtonsOnScreen = false; } } if (SkipButton != null) { // Bring buttons onscreen if needed if (!SkipButtonsOnScreen) { SkipButtonOffset.Y = MathHelper.Min(16, SkipButtonOffset.Y + 2); if (skip_button_active && Global.Input.gesture_triggered(TouchGestures.SwipeUp)) { SkipButtonsOnScreen = true; TimeSinceSkipInteraction = 0; } } // Move buttons offscreen if needed else if (SkipButtonsOnScreen) { if (TimeSinceSkipInteraction < SKIP_INTERACTION_TIMEOUT) { TimeSinceSkipInteraction++; } SkipButtonOffset.Y = MathHelper.Max(0, SkipButtonOffset.Y - 2); if (!skip_button_active || TimeSinceSkipInteraction >= SKIP_INTERACTION_TIMEOUT || (skip_button_active && Global.Input.gesture_triggered(TouchGestures.SwipeDown))) { SkipButtonsOnScreen = false; } } skip_button_active &= SkipButtonsOnScreen && SkipButtonOffset.Y == 0; TextSkips skip = TextSkips.None; if (Input.ControlSchemeSwitched || (has_convo_scene_button && SceneButton == null)) { create_convo_skip_buttons(); } if (SceneButton != null && !has_convo_scene_button) { SceneButton = null; } // Update scene button and consume inputs if (SceneButton != null) { SceneButton.Update(skip_button_active && !no_convo, -SkipButtonOffset); if (no_convo) { SceneButton.tint = new Color(128, 128, 128, 255); } if (SceneButton.consume_trigger(MouseButtons.Left) || SceneButton.consume_trigger(TouchGestures.Tap)) { skip = TextSkips.NextScene; TimeSinceSkipInteraction = SKIP_INTERACTION_TIMEOUT - 60; } } // Update skip button and consume inputs SkipButton.Update(skip_button_active, -SkipButtonOffset); if (SkipButton.consume_trigger(MouseButtons.Left) || SkipButton.consume_trigger(TouchGestures.Tap)) { skip = TextSkips.SkipEvent; TimeSinceSkipInteraction = 0; } if (!no_convo) { Message_Window.ConvoSkip = skip; } else if (skip == TextSkips.SkipEvent) { _EventSkip = true; } } }
protected override void update_input(bool active) { bool input = active && this.ready_for_inputs; update_node_location(input); if (CancelButton != null) { CancelButton.Update(input); } if (input) { if (Global.Input.mouseScroll > 0) { Up_Page_Arrow_ArrowClicked(this, null); } else if (Global.Input.mouseScroll < 0) { Down_Page_Arrow_ArrowClicked(this, null); } else { Up_Page_Arrow.UpdateInput(); Down_Page_Arrow.UpdateInput(); } var settings_index = SettingsNodes.consume_triggered( MouseButtons.Left, TouchGestures.Tap); bool soloanim_node_clicked = false; if (settings_index.IsSomething) { var node = SettingsNodes[settings_index]; jump_to_option(SettingsNodes.ActiveNode); byte setting = setting_from_node(node); if (!this.active_option_data.Gauge && setting != this.current_setting) { Global.game_system.play_se(System_Sounds.Menu_Move2); change_setting(OptionsNodes.ActiveNode.Option, setting); return; } soloanim_node_clicked = this.active_option == (int)Constants.Options.Animation_Mode && SettingsGroups[OptionsNodes.ActiveNodeIndex].IndexOf(node) == (int)Constants.Animation_Modes.Solo; } var slider_index = SettingsNodes.consume_triggered(TouchGestures.Scrubbing); if (slider_index.IsSomething) { var node = SettingsNodes[slider_index]; jump_to_option(SettingsNodes.ActiveNode); byte setting = setting_from_node(node); if (setting != this.current_setting) { Global.game_system.play_se(System_Sounds.Menu_Move2); ManualScroll = false; } change_setting(OptionsNodes.ActiveNode.Option, setting); return; } if (Global.Input.repeated(Inputs.Left)) { if (can_move_left) { Global.game_system.play_se(System_Sounds.Menu_Move2); move_left(); } } else if (Global.Input.repeated(Inputs.Right)) { if (can_move_right) { Global.game_system.play_se(System_Sounds.Menu_Move2); move_right(); } } else if (Global.Input.triggered(Inputs.B) || CancelButton.consume_trigger(MouseButtons.Left) || CancelButton.consume_trigger(TouchGestures.Tap)) { Global.game_system.play_se(System_Sounds.Cancel); if (Map_Info_Changed && Global.scene.is_map_scene) { ((Scene_Map)Global.scene).create_info_windows(); } close(); } else if (this.on_soloanim && SoloAnim_Allowed && (Global.Input.triggered(Inputs.A) || soloanim_node_clicked)) { if (SoloAnim != null) { Global.game_system.play_se(System_Sounds.Confirm); SoloAnim(this, new EventArgs()); } } } }
protected virtual void update_ui(bool input) { int index = PanelNodes.ActiveNodeIndex; PanelNodes.Update(input, -MenuLoc); if (index != PanelNodes.ActiveNodeIndex) { Panels[index].active = false; PanelNodes.ActiveNode.active = true; refresh_panel_locations(); } CancelButton.Update(input); if (input) { if (Cursor.target_loc != PanelNodes.ActiveNode.loc) { Cursor.set_loc(PanelNodes.ActiveNode.loc); } var file_index = PanelNodes.consume_triggered( Inputs.A, MouseButtons.Left, TouchGestures.Tap); if (file_index.IsSomething) { int file_id = file_index + 1 + Page * Config.SAVES_PER_PAGE; if (this.file_id != file_id) { this.file_id = file_id; } if (Copying) { OnCopyFile(new EventArgs()); } else if (Moving) { OnMoveFile(new EventArgs()); } else { OnSelected(new EventArgs()); } } else if (Global.Input.triggered(Inputs.B) || Global.Input.KeyPressed(Keys.Escape) || CancelButton.consume_trigger(MouseButtons.Left) || CancelButton.consume_trigger(TouchGestures.Tap)) { Global.game_system.play_se(System_Sounds.Cancel); if (Copying) { this.copying = false; } else if (Moving) { this.moving_file = false; } else { OnCanceled(new EventArgs()); } } } }