about summary refs log tree commit diff stats
path: root/AnodyneArchipelago/Menu
diff options
context:
space:
mode:
Diffstat (limited to 'AnodyneArchipelago/Menu')
-rw-r--r--AnodyneArchipelago/Menu/BoxedConfigState.cs31
-rw-r--r--AnodyneArchipelago/Menu/MenuState.cs35
2 files changed, 53 insertions, 13 deletions
diff --git a/AnodyneArchipelago/Menu/BoxedConfigState.cs b/AnodyneArchipelago/Menu/BoxedConfigState.cs new file mode 100644 index 0000000..229b82c --- /dev/null +++ b/AnodyneArchipelago/Menu/BoxedConfigState.cs
@@ -0,0 +1,31 @@
1using AnodyneSharp.States;
2using AnodyneSharp.States.MenuSubstates;
3
4namespace AnodyneArchipelago.Menu
5{
6 internal class BoxedConfigState : State
7 {
8 private ConfigSubstate _substate = new(true);
9
10 public BoxedConfigState()
11 {
12 _substate.GetControl();
13 }
14
15 public override void Update()
16 {
17 if (_substate.Exit)
18 {
19 Exit = true;
20 }
21
22 _substate.Update();
23 _substate.HandleInput();
24 }
25
26 public override void DrawUI()
27 {
28 _substate.DrawUI();
29 }
30 }
31}
diff --git a/AnodyneArchipelago/Menu/MenuState.cs b/AnodyneArchipelago/Menu/MenuState.cs index 59a4fdf..c7be02a 100644 --- a/AnodyneArchipelago/Menu/MenuState.cs +++ b/AnodyneArchipelago/Menu/MenuState.cs
@@ -26,6 +26,7 @@ namespace AnodyneArchipelago.Menu
26 private UILabel _quitLabel; 26 private UILabel _quitLabel;
27 27
28 private State _substate = null; 28 private State _substate = null;
29 private bool _hide = false;
29 30
30 private string _apServer = ""; 31 private string _apServer = "";
31 private string _apSlot = ""; 32 private string _apSlot = "";
@@ -109,6 +110,7 @@ namespace AnodyneArchipelago.Menu
109 if (_substate.Exit) 110 if (_substate.Exit)
110 { 111 {
111 _substate = null; 112 _substate = null;
113 _hide = false;
112 } 114 }
113 115
114 return; 116 return;
@@ -131,19 +133,22 @@ namespace AnodyneArchipelago.Menu
131 133
132 public override void DrawUI() 134 public override void DrawUI()
133 { 135 {
134 _selector.Draw(); 136 if (!_hide)
135 _versionLabel1.Draw(); 137 {
136 _versionLabel2.Draw(); 138 _selector.Draw();
137 _serverLabel.Draw(); 139 _versionLabel1.Draw();
138 _serverValue.Draw(); 140 _versionLabel2.Draw();
139 _slotLabel.Draw(); 141 _serverLabel.Draw();
140 _slotValue.Draw(); 142 _serverValue.Draw();
141 _passwordLabel.Draw(); 143 _slotLabel.Draw();
142 _passwordValue.Draw(); 144 _slotValue.Draw();
143 _connectionSwitcher.Draw(); 145 _passwordLabel.Draw();
144 _connectLabel.Draw(); 146 _passwordValue.Draw();
145 _settingsLabel.Draw(); 147 _connectionSwitcher.Draw();
146 _quitLabel.Draw(); 148 _connectLabel.Draw();
149 _settingsLabel.Draw();
150 _quitLabel.Draw();
151 }
147 152
148 if (_substate != null) 153 if (_substate != null)
149 { 154 {
@@ -257,6 +262,10 @@ namespace AnodyneArchipelago.Menu
257 case 4: 262 case 4:
258 _substate = new ConnectionState(_apServer, _apSlot, _apPassword, OnConnected); 263 _substate = new ConnectionState(_apServer, _apSlot, _apPassword, OnConnected);
259 break; 264 break;
265 case 5:
266 _substate = new BoxedConfigState();
267 _hide = true;
268 break;
260 case 6: 269 case 6:
261 GlobalState.ClosingGame = true; 270 GlobalState.ClosingGame = true;
262 break; 271 break;