-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
CharacterNamingScreen.c
586 lines (460 loc) · 19.8 KB
/
CharacterNamingScreen.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
// Filename: CharacterNamingScreen.c
// Contains code for the functions that are specific to the character naming screen.
//
// Project Codename: GameB
// TODO: Come up with a better name later.
// 2020 Joseph Ryan Ries <ryanries09@gmail.com>
// My YouTube series where we program an entire video game from scratch in C.
// Watch it on YouTube: https://www.youtube.com/watch?v=3zFFrBSdBvA
// Follow along on GitHub: https://github.com/ryanries/GameB
// Find me on Twitter @JosephRyanRies
// # License
// ----------
// The source code in this project is licensed under the MIT license.
// The media assets such as artwork, custom fonts, music and sound effects are licensed under a separate license.
// A copy of that license can be found in the 'Assets' directory.
// stb_vorbis by Sean Barrett is public domain and a copy of its license can be found in the stb_vorbis.c file.
#include "CommonMain.h"
#include "Platform.h"
#include "CharacterNamingScreen.h"
// The character naming screen looks like this:
// A B C D E F G H I J K L M
// N O P Q R S T U V W X Y Z
// a b c d e f g h i j k l m
// n o p q r s t u v w x y z
// Back OK
// (12 * 8) + (13 * 6) 12 spaces at 8 pixels each, plus 13 letters at 6 pixels wide each
MENUITEM gMI_CharacterNaming_A = { "A", 118, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_B = { "B", 130, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_C = { "C", 142, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_D = { "D", 154, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_E = { "E", 166, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_F = { "F", 178, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_G = { "G", 190, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_H = { "H", 202, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_I = { "I", 214, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_J = { "J", 226, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_K = { "K", 238, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_L = { "L", 250, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_M = { "M", 262, 134, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_N = { "N", 118, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_O = { "O", 130, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_P = { "P", 142, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_Q = { "Q", 154, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_R = { "R", 166, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_S = { "S", 178, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_T = { "T", 190, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_U = { "U", 202, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_V = { "V", 214, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_W = { "W", 226, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_X = { "X", 238, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_Y = { "Y", 250, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_Z = { "Z", 262, 144, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_a = { "a", 118, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_b = { "b", 130, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_c = { "c", 142, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_d = { "d", 154, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_e = { "e", 166, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_f = { "f", 178, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_g = { "g", 190, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_h = { "h", 202, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_i = { "i", 214, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_j = { "j", 226, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_k = { "k", 238, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_l = { "l", 250, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_m = { "m", 262, 154, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_n = { "n", 118, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_o = { "o", 130, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_p = { "p", 142, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_q = { "q", 154, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_r = { "r", 166, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_s = { "s", 178, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_t = { "t", 190, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_u = { "u", 202, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_v = { "v", 214, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_w = { "w", 226, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_x = { "x", 238, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_y = { "y", 250, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_z = { "z", 262, 164, true, MenuItem_CharacterNaming_Add };
MENUITEM gMI_CharacterNaming_Back = { "Back", 118, 174, true, MenuItem_CharacterNaming_Back };
MENUITEM gMI_CharacterNaming_OK = { "OK", 256, 174, true, MenuItem_CharacterNaming_OK };
MENUITEM* gMI_CharacterNamingItems[] = {
&gMI_CharacterNaming_A, &gMI_CharacterNaming_B, &gMI_CharacterNaming_C, &gMI_CharacterNaming_D, &gMI_CharacterNaming_E, &gMI_CharacterNaming_F,
&gMI_CharacterNaming_G, &gMI_CharacterNaming_H, &gMI_CharacterNaming_I, &gMI_CharacterNaming_J, &gMI_CharacterNaming_K, &gMI_CharacterNaming_L,
&gMI_CharacterNaming_M, &gMI_CharacterNaming_N, &gMI_CharacterNaming_O, &gMI_CharacterNaming_P, &gMI_CharacterNaming_Q, &gMI_CharacterNaming_R,
&gMI_CharacterNaming_S, &gMI_CharacterNaming_T, &gMI_CharacterNaming_U, &gMI_CharacterNaming_V, &gMI_CharacterNaming_W, &gMI_CharacterNaming_X,
&gMI_CharacterNaming_Y, &gMI_CharacterNaming_Z,
&gMI_CharacterNaming_a, &gMI_CharacterNaming_b, &gMI_CharacterNaming_c, &gMI_CharacterNaming_d, &gMI_CharacterNaming_e, &gMI_CharacterNaming_f,
&gMI_CharacterNaming_g, &gMI_CharacterNaming_h, &gMI_CharacterNaming_i, &gMI_CharacterNaming_j, &gMI_CharacterNaming_k, &gMI_CharacterNaming_l,
&gMI_CharacterNaming_m, &gMI_CharacterNaming_n, &gMI_CharacterNaming_o, &gMI_CharacterNaming_p, &gMI_CharacterNaming_q, &gMI_CharacterNaming_r,
&gMI_CharacterNaming_s, &gMI_CharacterNaming_t, &gMI_CharacterNaming_u, &gMI_CharacterNaming_v, &gMI_CharacterNaming_w, &gMI_CharacterNaming_x,
&gMI_CharacterNaming_y, &gMI_CharacterNaming_z, &gMI_CharacterNaming_Back, &gMI_CharacterNaming_OK };
MENU gMenu_CharacterNaming = { "What's your name, hero?", 0, _countof(gMI_CharacterNamingItems), gMI_CharacterNamingItems };
void DrawCharacterNaming(void)
{
static uint64_t LocalFrameCounter;
static uint64_t LastFrameSeen = 0;
static int AlphaAdjust = -256;
// If global TotalFramesRendered is greater than LastFrameSeen,
// that means we have either just entered this gamestate for the first time,
// or we have left this gamestate previously and have just come back to it.
// For example we may have gone from the title screen, to the options screen,
// and then back to the title screen again. In that case, we want to reset all
// of the "local state," i.e., things that are local to this game state. Such
// as text animation, selected menu item, etc.
if (gPerformanceData.TotalFramesRendered > (LastFrameSeen + 1))
{
LocalFrameCounter = 0;
AlphaAdjust = -256;
gMenu_CharacterNaming.SelectedItem = 0;
gInputEnabled = false;
}
memset(gBackBuffer.Memory, 0, GAME_DRAWING_AREA_MEMORY_SIZE);
#ifdef SMOOTH_FADES
// Here is a smoother fade in that looks nicer, but the original NES was not capable of such smooth gradients and fade
// effects. We will have to decide which we prefer later - looks better, or is more faithful to the original hardware?
if (AlphaAdjust < 0)
{
AlphaAdjust += 4;
}
#else
// Here is an easy, "chunky" fade-in from black in 4 steps, that sort of has a similar feel
// to the kind of fade-in you might have seen on the classic NES. AlphaAdjust starts at -256 and ends at 0.
switch (LocalFrameCounter)
{
case 15:
case 30:
case 45:
case 60:
{
AlphaAdjust += 64;
}
}
#endif
// It doesn't feel very nice to have to wait the full 60 frames for the fade-in to complete in order for
// input to be enabled again. We should enable it sooner so the kids with fast reflexes can work the menus quickly.
if (LocalFrameCounter == REENABLE_INPUT_AFTER_X_FRAMES_DELAY)
{
gInputEnabled = true;
}
DrawWindow(
108,
24,
166,
18,
&(PIXEL32) { .Colors.Alpha = (uint8_t)(min(255, max((256 + AlphaAdjust), 0))), .Colors.Red = 0xFC, .Colors.Green = 0xFC, .Colors.Blue = 0xFC },
NULL,
&(PIXEL32) { .Colors.Alpha = (uint8_t)(min(255, max((256 + AlphaAdjust), 0))), .Colors.Red = 0x40, .Colors.Green = 0x40, .Colors.Blue = 0x40 },
WINDOW_FLAG_BORDERED | WINDOW_FLAG_SHADOW | WINDOW_FLAG_ROUNDED_CORNERS | WINDOW_FLAG_THICK | WINDOW_FLAG_ALPHABLEND);
DrawWindow(
108,
128,
166,
60,
&(PIXEL32) {.Colors.Alpha = (uint8_t)(min(255, max((256 + AlphaAdjust), 0))), .Colors.Red = 0xFC, .Colors.Green = 0xFC, .Colors.Blue = 0xFC },
NULL,
&(PIXEL32) {.Colors.Alpha = (uint8_t)(min(255, max((256 + AlphaAdjust), 0))), .Colors.Red = 0x40, .Colors.Green = 0x40, .Colors.Blue = 0x40 },
WINDOW_FLAG_BORDERED | WINDOW_FLAG_SHADOW | WINDOW_FLAG_ROUNDED_CORNERS | WINDOW_FLAG_THICK | WINDOW_FLAG_ALPHABLEND);
BlitStringEx(
gMenu_CharacterNaming.Name,
&g6x7Font,
(GAME_RES_WIDTH / 2) - ((int)(strlen(gMenu_CharacterNaming.Name) * 6) / 2),
29,
255,
255,
255,
AlphaAdjust,
BLIT_FLAG_ALPHABLEND | BLIT_FLAG_TEXT_SHADOW);
Blit32BppBitmapEx(
&gPlayer.Sprite[SUIT_0][FACING_DOWN_0],
153,
80,
0,
0,
0,
AlphaAdjust,
BLIT_FLAG_ALPHABLEND);
for (int Letter = 0; Letter < _countof(gPlayer.Name) - 1; Letter++)
{
if (gPlayer.Name[Letter] == '\0')
{
BlitStringEx(
"_",
&g6x7Font,
173 + (Letter * 6),
89,
255,
255,
255,
AlphaAdjust,
BLIT_FLAG_ALPHABLEND | BLIT_FLAG_TEXT_SHADOW);
}
else
{
// There was a bug here. Try just gPlayer.Name[Letter], watch what happens with the alpha blending
BlitStringEx(
(char[2]) { gPlayer.Name[Letter], '\0' },
&g6x7Font,
173 + (Letter * 6),
89,
255,
255,
255,
AlphaAdjust,
BLIT_FLAG_ALPHABLEND | BLIT_FLAG_TEXT_SHADOW);
}
}
for (int Counter = 0; Counter < gMenu_CharacterNaming.ItemCount; Counter++)
{
BlitStringEx(
gMenu_CharacterNaming.Items[Counter]->Name,
&g6x7Font,
gMenu_CharacterNaming.Items[Counter]->x,
gMenu_CharacterNaming.Items[Counter]->y,
255,
255,
255,
AlphaAdjust,
BLIT_FLAG_ALPHABLEND | BLIT_FLAG_TEXT_SHADOW);
}
BlitStringEx(
"\xBB",
&g6x7Font,
gMenu_CharacterNaming.Items[gMenu_CharacterNaming.SelectedItem]->x - 6,
gMenu_CharacterNaming.Items[gMenu_CharacterNaming.SelectedItem]->y,
255,
255,
255,
AlphaAdjust,
BLIT_FLAG_ALPHABLEND | BLIT_FLAG_TEXT_SHADOW);
LocalFrameCounter++;
LastFrameSeen = gPerformanceData.TotalFramesRendered;
}
// Complex menu, cursor should be able to wrap around both axes,
// while treating the Back and OK buttons as special. The Back
// button is included as part of the first two columns of characters,
// while the OK button is included in the last two columns of characters.
void PPI_CharacterNaming(void)
{
// Character Naming Menu
// A B C D E F G H I J K L M
// N O P Q R S T U V W X Y Z
// a b c d e f g h i j k l m
// n o p q r s t u v w x y z
// Back OK
#define ROW_WIDTH 13
#define BACK_BUTTON 52
#define OK_BUTTON 53
#define SELECTED_TEXT(Text) strcmp(Text, gMenu_CharacterNaming.Items[gMenu_CharacterNaming.SelectedItem]->Name) == 0 ? true : false
if (gGameInput.UpKeyIsDown && !gGameInput.UpKeyWasDown)
{
if (SELECTED_TEXT("Back"))
{
gMenu_CharacterNaming.SelectedItem -= ROW_WIDTH;
}
else if (SELECTED_TEXT("OK"))
{
gMenu_CharacterNaming.SelectedItem -= 2;
}
else
{
switch ((char)gMenu_CharacterNaming.Items[gMenu_CharacterNaming.SelectedItem]->Name[0])
{
case 'A':
case 'B':
case 'C':
{
gMenu_CharacterNaming.SelectedItem = BACK_BUTTON;
break;
}
case 'L':
case 'M':
case 'K':
{
gMenu_CharacterNaming.SelectedItem = OK_BUTTON;
break;
}
case 'D':
case 'E':
case 'F':
case 'G':
case 'H':
case 'I':
case 'J':
{
gMenu_CharacterNaming.SelectedItem += (ROW_WIDTH * 3);
break;
}
default:
{
gMenu_CharacterNaming.SelectedItem -= ROW_WIDTH;
break;
}
}
}
PlayGameSound(&gSoundMenuNavigate);
}
if (gGameInput.DownKeyIsDown && !gGameInput.DownKeyWasDown)
{
if (SELECTED_TEXT("Back"))
{
gMenu_CharacterNaming.SelectedItem = 0;
}
else if (SELECTED_TEXT("OK"))
{
gMenu_CharacterNaming.SelectedItem = ROW_WIDTH - 1;
}
else
{
switch ((char)gMenu_CharacterNaming.Items[gMenu_CharacterNaming.SelectedItem]->Name[0])
{
case 'n':
case 'o':
case 'p':
{
gMenu_CharacterNaming.SelectedItem = BACK_BUTTON;
break;
}
case 'x':
case 'y':
case 'z':
{
gMenu_CharacterNaming.SelectedItem = OK_BUTTON;
break;
}
case 'q':
case 'r':
case 's':
case 't':
case 'u':
case 'v':
case 'w':
{
gMenu_CharacterNaming.SelectedItem -= (ROW_WIDTH * 3);
break;
}
default:
{
gMenu_CharacterNaming.SelectedItem += ROW_WIDTH;
break;
}
}
}
PlayGameSound(&gSoundMenuNavigate);
}
if (gGameInput.LeftKeyIsDown && !gGameInput.LeftKeyWasDown)
{
if (SELECTED_TEXT("Back"))
{
gMenu_CharacterNaming.SelectedItem = OK_BUTTON;
}
else if (SELECTED_TEXT("OK"))
{
gMenu_CharacterNaming.SelectedItem = BACK_BUTTON;
}
else
{
switch ((char)gMenu_CharacterNaming.Items[gMenu_CharacterNaming.SelectedItem]->Name[0])
{
case 'A':
case 'N':
case 'a':
case 'n':
{
gMenu_CharacterNaming.SelectedItem += ROW_WIDTH - 1;
break;
}
default:
{
gMenu_CharacterNaming.SelectedItem--;
break;
}
}
}
PlayGameSound(&gSoundMenuNavigate);
}
if (gGameInput.RightKeyIsDown && !gGameInput.RightKeyWasDown)
{
if (SELECTED_TEXT("Back"))
{
gMenu_CharacterNaming.SelectedItem = OK_BUTTON;
}
else if (SELECTED_TEXT("OK"))
{
gMenu_CharacterNaming.SelectedItem = BACK_BUTTON;
}
else
{
switch ((char)gMenu_CharacterNaming.Items[gMenu_CharacterNaming.SelectedItem]->Name[0])
{
case 'M':
case 'Z':
case 'm':
case 'z':
{
gMenu_CharacterNaming.SelectedItem -= ROW_WIDTH - 1;
break;
}
default:
{
gMenu_CharacterNaming.SelectedItem++;
break;
}
}
}
PlayGameSound(&gSoundMenuNavigate);
}
if (gGameInput.ChooseKeyIsDown && !gGameInput.ChooseKeyWasDown)
{
gMenu_CharacterNaming.Items[gMenu_CharacterNaming.SelectedItem]->Action();
}
if (gGameInput.EscapeKeyIsDown && !gGameInput.EscapeKeyWasDown)
{
MenuItem_CharacterNaming_Back();
}
}
void MenuItem_CharacterNaming_Add(void)
{
if (strlen(gPlayer.Name) < 8)
{
gPlayer.Name[strlen(gPlayer.Name)] = gMenu_CharacterNaming.Items[gMenu_CharacterNaming.SelectedItem]->Name[0];
PlayGameSound(&gSoundMenuChoose);
}
}
void MenuItem_CharacterNaming_Back(void)
{
if (strlen(gPlayer.Name) < 1)
{
ASSERT(gCurrentGameState == GAMESTATE_CHARACTERNAMING, "Invalid game state!");
gPreviousGameState = gCurrentGameState;
gCurrentGameState = GAMESTATE_TITLESCREEN;
LogMessageA(LL_INFO, "[%s] Transitioning from game state %d to %d. Player selected '%s' from '%s' menu.",
__FUNCTION__,
gPreviousGameState,
gCurrentGameState,
gMenu_CharacterNaming.Items[gMenu_CharacterNaming.SelectedItem]->Name,
gMenu_CharacterNaming.Name);
}
else
{
gPlayer.Name[strlen(gPlayer.Name) - 1] = '\0';
}
PlayGameSound(&gSoundMenuChoose);
}
void MenuItem_CharacterNaming_OK(void)
{
if (strlen(gPlayer.Name) > 0)
{
ASSERT(gCurrentGameState == GAMESTATE_CHARACTERNAMING, "Invalid game state!");
gPreviousGameState = gCurrentGameState;
gCurrentGameState = GAMESTATE_OVERWORLD;
LogMessageA(LL_INFO, "[%s] Transitioning from game state %d to %d. Player selected '%s' from '%s' menu.",
__FUNCTION__,
gPreviousGameState,
gCurrentGameState,
gMenu_CharacterNaming.Items[gMenu_CharacterNaming.SelectedItem]->Name,
gMenu_CharacterNaming.Name);
gPlayer.Active = true;
PlayGameSound(&gSoundMenuChoose);
}
}