diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-05-25 10:37:59 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-05-25 10:37:59 -0400 |
| commit | ca34b22c8dbeecda5ac5f66ca24fbe69a617b4dd (patch) | |
| tree | a1d183b82a4e3a5c6f588d9a65385aeca759055c /AnodyneArchipelago/Menu/MenuState.cs | |
| parent | 1ec73259768c9d8ecdf89a9968188d28c9e52808 (diff) | |
| download | anodyne-archipelago-ca34b22c8dbeecda5ac5f66ca24fbe69a617b4dd.tar.gz anodyne-archipelago-ca34b22c8dbeecda5ac5f66ca24fbe69a617b4dd.tar.bz2 anodyne-archipelago-ca34b22c8dbeecda5ac5f66ca24fbe69a617b4dd.zip | |
Added text entry
Diffstat (limited to 'AnodyneArchipelago/Menu/MenuState.cs')
| -rw-r--r-- | AnodyneArchipelago/Menu/MenuState.cs | 33 |
1 files changed, 32 insertions, 1 deletions
| diff --git a/AnodyneArchipelago/Menu/MenuState.cs b/AnodyneArchipelago/Menu/MenuState.cs index 08aa366..b9ee0dd 100644 --- a/AnodyneArchipelago/Menu/MenuState.cs +++ b/AnodyneArchipelago/Menu/MenuState.cs | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | using AnodyneSharp.Input; | 1 | using AnodyneSharp.Input; |
| 2 | using AnodyneSharp.Registry; | 2 | using AnodyneSharp.Registry; |
| 3 | using AnodyneSharp.Sounds; | 3 | using AnodyneSharp.Sounds; |
| 4 | using AnodyneSharp.States; | ||
| 4 | using AnodyneSharp.UI; | 5 | using AnodyneSharp.UI; |
| 5 | using AnodyneSharp.UI.PauseMenu; | 6 | using AnodyneSharp.UI.PauseMenu; |
| 6 | using AnodyneSharp.UI.PauseMenu.Config; | 7 | using AnodyneSharp.UI.PauseMenu.Config; |
| @@ -24,6 +25,8 @@ namespace AnodyneArchipelago.Menu | |||
| 24 | private UILabel _settingsLabel; | 25 | private UILabel _settingsLabel; |
| 25 | private UILabel _quitLabel; | 26 | private UILabel _quitLabel; |
| 26 | 27 | ||
| 28 | private State _substate = null; | ||
| 29 | |||
| 27 | private string _apServer = ""; | 30 | private string _apServer = ""; |
| 28 | private string _apSlot = ""; | 31 | private string _apSlot = ""; |
| 29 | private string _apPassword = ""; | 32 | private string _apPassword = ""; |
| @@ -62,6 +65,18 @@ namespace AnodyneArchipelago.Menu | |||
| 62 | 65 | ||
| 63 | public override void Update() | 66 | public override void Update() |
| 64 | { | 67 | { |
| 68 | if (_substate != null) | ||
| 69 | { | ||
| 70 | _substate.Update(); | ||
| 71 | |||
| 72 | if (_substate.Exit) | ||
| 73 | { | ||
| 74 | _substate = null; | ||
| 75 | } | ||
| 76 | |||
| 77 | return; | ||
| 78 | } | ||
| 79 | |||
| 65 | _selector.Update(); | 80 | _selector.Update(); |
| 66 | _selector.PostUpdate(); | 81 | _selector.PostUpdate(); |
| 67 | 82 | ||
| @@ -92,6 +107,11 @@ namespace AnodyneArchipelago.Menu | |||
| 92 | _connectLabel.Draw(); | 107 | _connectLabel.Draw(); |
| 93 | _settingsLabel.Draw(); | 108 | _settingsLabel.Draw(); |
| 94 | _quitLabel.Draw(); | 109 | _quitLabel.Draw(); |
| 110 | |||
| 111 | if (_substate != null) | ||
| 112 | { | ||
| 113 | _substate.DrawUI(); | ||
| 114 | } | ||
| 95 | } | 115 | } |
| 96 | 116 | ||
| 97 | private void SetCursorPosition(int i) | 117 | private void SetCursorPosition(int i) |
| @@ -159,7 +179,7 @@ namespace AnodyneArchipelago.Menu | |||
| 159 | { | 179 | { |
| 160 | label.SetText(text); | 180 | label.SetText(text); |
| 161 | } | 181 | } |
| 162 | 182 | ||
| 163 | label.Color = new Color(184, 32, 0); | 183 | label.Color = new Color(184, 32, 0); |
| 164 | } | 184 | } |
| 165 | } | 185 | } |
| @@ -184,8 +204,19 @@ namespace AnodyneArchipelago.Menu | |||
| 184 | } | 204 | } |
| 185 | else if (KeyInput.JustPressedRebindableKey(KeyFunctions.Accept)) | 205 | else if (KeyInput.JustPressedRebindableKey(KeyFunctions.Accept)) |
| 186 | { | 206 | { |
| 207 | SoundManager.PlaySoundEffect("menu_select"); | ||
| 208 | |||
| 187 | switch (_selectorIndex) | 209 | switch (_selectorIndex) |
| 188 | { | 210 | { |
| 211 | case 0: | ||
| 212 | _substate = new TextEntry("Server:", _apServer, (string value) => { _apServer = value; UpdateLabels(); }); | ||
| 213 | break; | ||
| 214 | case 1: | ||
| 215 | _substate = new TextEntry("Slot:", _apSlot, (string value) => { _apSlot = value; UpdateLabels(); }); | ||
| 216 | break; | ||
| 217 | case 2: | ||
| 218 | _substate = new TextEntry("Password:", _apPassword, (string value) => { _apPassword = value; UpdateLabels(); }); | ||
| 219 | break; | ||
| 189 | case 6: | 220 | case 6: |
| 190 | GlobalState.ClosingGame = true; | 221 | GlobalState.ClosingGame = true; |
| 191 | break; | 222 | break; |
