annotate Game/GameMenu.cpp @ 2568:f2f2595fe308

rename Decals[], DecalCount
author Ritor1
date Thu, 21 May 2015 18:32:45 +0600
parents f2a8ed07e921
children d87bfbd3bb3b
rev   line source
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
1 #include "Engine/Engine.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
2 #include "Engine/Timer.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
3 #include "Engine/LOD.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
4 #include "Engine/Party.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
5 #include "Engine/SaveLoad.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
6 #include "Engine/Registry.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
7 #include "Engine/texts.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
8 #include "Engine/Graphics/IRender.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
9 #include "Engine/Graphics/Viewport.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
10
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
11 #include "IO/Keyboard.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
12 #include "IO/Mouse.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
13
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
14 #include "GUI/UI/UIGame.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
15 #include "GUI/UI/UISaveLoad.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
16 #include "GUI/UI/UIModal.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
17
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
18 #include "Media/Audio/AudioPlayer.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
19 #include "Media/Audio/AIL.h"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
20
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
21
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
22
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
23 extern void DoThatMessageThing();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
24
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
25
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
26 void Game_StartNewGameWhilePlaying(bool force_start)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
27 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
28 if (dword_6BE138 == 124 || force_start)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
29 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
30 pIcons_LOD->SyncLoadedFilesCount();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
31 pIcons_LOD->RemoveTexturesPackFromTextureList();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
32 DoThatMessageThing();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
33 //pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
34 uGameState = GAME_STATE_NEWGAME_OUT_GAMEMENU;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
35 current_screen_type = SCREEN_GAME;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
36 viewparams->bRedrawGameUI = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
37 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
38 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
39 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
40 ShowStatusBarString(pGlobalTXT_LocalizationStrings[201], 2);// "Are you sure? Click again to start a New Game"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
41 pAudioPlayer->PlaySound(SOUND_quest, 0, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
42 dword_6BE138 = 124;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
43 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
44 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
45
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
46 void Game_QuitGameWhilePlaying(bool force_quit)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
47 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
48 if (dword_6BE138 == 132 || force_quit)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
49 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
50 pIcons_LOD->SyncLoadedFilesCount();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
51 pIcons_LOD->RemoveTexturesPackFromTextureList();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
52 DoThatMessageThing();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
53 //pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
54 current_screen_type = SCREEN_GAME;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
55 viewparams->bRedrawGameUI = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
56 pAudioPlayer->PlaySound(SOUND_WoodDoorClosing, 0, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
57 uGameState = GAME_STATE_GAME_QUITTING_TO_MAIN_MENU;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
58 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
59 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
60 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
61 ShowStatusBarString(pGlobalTXT_LocalizationStrings[82], 2);// "Are you sure? Click again to quit"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
62 pAudioPlayer->PlaySound(SOUND_quest, 0, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
63 dword_6BE138 = 132;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
64 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
65 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
66
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
67 void Game_OpenLoadGameDialog()
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
68 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
69 pIcons_LOD->SyncLoadedFilesCount();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
70 pIcons_LOD->RemoveTexturesPackFromTextureList();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
71
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
72 DoThatMessageThing();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
73 pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
74 pGUIWindow_CurrentMenu = nullptr;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
75
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
76 //LoadUI_Load(1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
77 current_screen_type = SCREEN_LOADGAME;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
78 pGUIWindow_CurrentMenu = new GUIWindow_Load(true);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
79 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
80
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
81
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
82
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
83
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
84 void GameMenu_EventLoop()
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
85 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
86 while (pMessageQueue_50CBD0->uNumMessages)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
87 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
88 UIMessageType msg;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
89 int param, param2;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
90 pMessageQueue_50CBD0->PopMessage(&msg, &param, &param2);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
91
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
92 switch (msg)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
93 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
94 case UIMSG_StartNewGame: Game_StartNewGameWhilePlaying(param); continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
95 case UIMSG_Quit: Game_QuitGameWhilePlaying(param); continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
96 case UIMSG_Game_OpenLoadGameDialog: Game_OpenLoadGameDialog(); continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
97
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
98 case UIMSG_ArrowUp:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
99 --pSaveListPosition;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
100 if (pSaveListPosition < 0)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
101 pSaveListPosition = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
102 new OnButtonClick2(215, 199, 17, 17, (int)pBtnArrowUp, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
103 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
104
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
105 case UIMSG_DownArrow:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
106 ++pSaveListPosition;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
107 if (pSaveListPosition >= param)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
108 pSaveListPosition = param - 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
109 new OnButtonClick2(215, 323, 17, 17, (int)pBtnDownArrow, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
110 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
111
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
112 case UIMSG_Cancel:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
113 new OnCancel(350, 302, 106, 42, (int)pBtnCancel, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
114 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
115
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
116 case UIMSG_SaveLoadBtn:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
117 new OnSaveLoad(241, 302, 106, 42, (int)pBtnLoadSlot, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
118 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
119 case UIMSG_SelectLoadSlot:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
120 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
121 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
122 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
123
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
124 int v10 = pSaveListPosition + param;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
125 if (current_screen_type != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != v10)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
126 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
127 if (dword_6BE138 == pSaveListPosition + param)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
128 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
129 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_SaveLoadBtn, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
130 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_LoadGame, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
131 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
132 uLoadGameUI_SelectedSlot = v10;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
133 dword_6BE138 = v10;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
134 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
135 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
136 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
137 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
138 if (strcmp(pSavegameHeader[uLoadGameUI_SelectedSlot].pName, pGlobalTXT_LocalizationStrings[72]))// "Empty"
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
139 strcpy(pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
140 pKeyActionMap->uNumKeysPressed = strlen(pKeyActionMap->pPressedKeysBuffer);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
141 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
142 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
143 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
144 case UIMSG_LoadGame:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
145 if (pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
146 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
147 LoadGame(uLoadGameUI_SelectedSlot);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
148 uGameState = GAME_STATE_LOADING_GAME;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
149 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
150 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
151 case UIMSG_SaveGame:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
152 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
153 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
154 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
155 strcpy((char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], pKeyActionMap->pPressedKeysBuffer);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
156 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
157 DoSavegame(uLoadGameUI_SelectedSlot);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
158 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
159 case UIMSG_Game_OpenSaveGameDialog:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
160 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
161 pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
162
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
163 current_screen_type = SCREEN_SAVEGAME;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
164 pGUIWindow_CurrentMenu = new GUIWindow_Save(); //SaveUI_Load(current_screen_type = SCREEN_SAVEGAME);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
165 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
166 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
167 case UIMSG_Game_OpenOptionsDialog://Open
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
168 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
169 DoThatMessageThing();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
170
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
171 pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
172 pGUIWindow_CurrentMenu = new GUIWindow_GameOptions();//GameMenuUI_Options_Load();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
173
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
174 viewparams->field_48 = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
175 current_screen_type = SCREEN_OPTIONS;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
176
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
177 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
178 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
179
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
180 case UIMSG_OpenKeyMappingOptions://Open
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
181 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
182 DoThatMessageThing();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
183
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
184 pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
185 pGUIWindow_CurrentMenu = new GUIWindow_GameKeyBindings();//GameMenuUI_OptionsKeymapping_Load();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
186
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
187 viewparams->field_48 = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
188 current_screen_type = SCREEN_KEYBOARD_OPTIONS;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
189
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
190 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
191 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
192
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
193 case UIMSG_ChangeKeyButton:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
194 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
195 if (uGameMenuUI_CurentlySelectedKeyIdx != -1)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
196 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
197 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
198 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
199 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
200 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
201 uGameMenuUI_CurentlySelectedKeyIdx = param;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
202 if (KeyboardPageNum != 1)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
203 uGameMenuUI_CurentlySelectedKeyIdx += 14;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
204 pKeyActionMap->EnterText(0, 1, pGUIWindow_CurrentMenu);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
205 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
206 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
207 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
208
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
209 case UIMSG_ResetKeyMapping:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
210 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
211 int v197 = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
212 pKeyActionMap->SetDefaultMapping();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
213 for (uint i = 0; i < 28; i++)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
214 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
215 if (pKeyActionMap->GetActionVKey((enum InputAction)i) != pPrevVirtualCidesMapping[i])
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
216 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
217 if (v197)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
218 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
219 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[i]), pKeyActionMap->GetActionVKey((enum InputAction)i), 1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
220 v197 = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
221 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
222 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
223 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[i]), pKeyActionMap->GetActionVKey((enum InputAction)i), 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
224 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
225 pPrevVirtualCidesMapping[i] = pKeyActionMap->GetActionVKey((enum InputAction)i);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
226 GameMenuUI_InvaligKeyBindingsFlags[i] = false;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
227 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
228 pAudioPlayer->PlaySound(SOUND_chimes, 0, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
229 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
230 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
231
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
232 case UIMSG_SelectKeyPage1:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
233 KeyboardPageNum = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
234 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
235 case UIMSG_SelectKeyPage2:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
236 KeyboardPageNum = 2;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
237 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
238
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
239 case UIMSG_OpenVideoOptions:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
240 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
241 DoThatMessageThing();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
242
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
243 pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
244 pGUIWindow_CurrentMenu = new GUIWindow_GameVideoOptions();//GameMenuUI_OptionsVideo_Load();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
245 viewparams->field_48 = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
246 current_screen_type = SCREEN_VIDEO_OPTIONS;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
247
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
248 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
249 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
250
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
251 case UIMSG_1A9:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
252 __debugbreak();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
253 if (param == 4)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
254 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
255 //--uGammaPos;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
256 if ((uGammaPos-- - 1) < 0)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
257 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
258 uGammaPos = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
259 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
260 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
261 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
262 double v19 = (double)(signed int)uGammaPos * 0.1 + 0.6;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
263 //pEngine->pGammaController->Initialize(v19);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
264 new OnButtonClick2(21, 161, 0, 0, (int)pBtn_SliderLeft, (char *)1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
265 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
266 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
267 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
268 if (param == 5)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
269 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
270 ++uGammaPos;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
271 if ((signed int)uGammaPos <= 9)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
272 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
273 double v21 = (double)(signed int)uGammaPos * 0.1 + 0.6;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
274 //pEngine->pGammaController->Initialize(v21);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
275 new OnButtonClick2(213, 161, 0, 0, (int)pBtn_SliderRight, (char *)1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
276 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
277 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
278 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
279 uGammaPos = 9;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
280 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
281 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
282 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
283 POINT a2;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
284 uGammaPos = (pMouse->GetCursorPos(&a2)->x - 42) / 17;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
285 double v22 = (double)(signed int)uGammaPos * 0.1 + 0.6;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
286 //pEngine->pGammaController->Initialize(v22);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
287 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
288 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
289 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
290 case UIMSG_ToggleBloodsplats:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
291 pEngine->ToggleFlags2(0x20u);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
292 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
293 case UIMSG_ToggleColoredLights:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
294 pRenderer->ToggleColoredLights();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
295 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
296 case UIMSG_ToggleTint:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
297 pRenderer->ToggleTint();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
298 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
299 case UIMSG_ChangeMusicVolume:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
300 extern bool use_music_folder;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
301 if (param == 4)//-
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
302 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
303 --uMusicVolimeMultiplier;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
304 if ((char)uMusicVolimeMultiplier < 1)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
305 uMusicVolimeMultiplier = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
306 new OnButtonClick2(243, 216, 0, 0, (int)pBtn_SliderLeft, (char *)1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
307 if (uMusicVolimeMultiplier)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
308 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
309
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
310 if (use_music_folder)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
311 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
312 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
313 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
314
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
315 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
316 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
317 if (param == 5)//+
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
318 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
319 ++uMusicVolimeMultiplier;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
320 if ((char)uMusicVolimeMultiplier > 9)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
321 uMusicVolimeMultiplier = 9;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
322 new OnButtonClick2(435, 216, 0, 0, (int)pBtn_SliderRight, (char *)1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
323 if (uMusicVolimeMultiplier)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
324 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
325 if (use_music_folder)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
326 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
327 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
328 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
329 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
330 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
331
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
332 POINT v202;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
333 uMusicVolimeMultiplier = (pMouse->GetCursorPos(&v202)->x - 263) / 17;//for mouse
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
334 if ((char)uMusicVolimeMultiplier > 9)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
335 uMusicVolimeMultiplier = 9;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
336 if (uMusicVolimeMultiplier)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
337 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
338 if (use_music_folder)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
339 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
340 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
341 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
342 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
343 case UIMSG_ChangeSoundVolume:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
344 if (param == 4)//reduce sound level button left
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
345 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
346 --uSoundVolumeMultiplier;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
347 if ((char)uSoundVolumeMultiplier < 1)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
348 uSoundVolumeMultiplier = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
349 new OnButtonClick2(243, 162, 0, 0, (int)pBtn_SliderLeft, (char *)1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
350 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
351 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
352 int v = AIL_redbook_volume(pAudioPlayer->hAILRedbook);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
353 //v = v+1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
354 if (v)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
355 __debugbreak();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
356 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
357 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
358 if (param == 5)//Increase sound level button right
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
359 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
360 ++uSoundVolumeMultiplier;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
361 if ((char)uSoundVolumeMultiplier > 8)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
362 uSoundVolumeMultiplier = 9;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
363 //v168 = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
364 //v154 = (int)pBtn_SliderRight;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
365 new OnButtonClick2(435, 162, 0, 0, (int)pBtn_SliderRight, (char *)1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
366 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
367 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
368 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
369 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
370
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
371 POINT v207;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
372 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
373 if ((char)uSoundVolumeMultiplier > 8)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
374 uSoundVolumeMultiplier = 9;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
375 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
376 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
377 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
378 case UIMSG_ToggleFlipOnExit:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
379 bFlipOnExit = bFlipOnExit == 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
380 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
381 case UIMSG_ToggleAlwaysRun:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
382 bAlwaysRun = bAlwaysRun == 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
383 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
384 case UIMSG_ToggleWalkSound:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
385 bWalkSound = bWalkSound == 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
386 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
387 case UIMSG_ToggleShowDamage:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
388 bShowDamage = bShowDamage == 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
389 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
390 case UIMSG_ChangeVoiceVolume:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
391 if (param == 4)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
392 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
393 --uVoicesVolumeMultiplier;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
394 if ((char)uVoicesVolumeMultiplier < 1)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
395 uVoicesVolumeMultiplier = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
396 new OnButtonClick2(243, 270, 0, 0, (int)pBtn_SliderLeft, (char *)1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
397 if (!uVoicesVolumeMultiplier)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
398 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
399 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
400 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
401 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
402 if (param == 5)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
403 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
404 ++uVoicesVolumeMultiplier;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
405 if ((char)uVoicesVolumeMultiplier > 8)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
406 uVoicesVolumeMultiplier = 9;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
407 new OnButtonClick2(435, 270, 0, 0, (int)pBtn_SliderRight, (char *)1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
408 if (!uVoicesVolumeMultiplier)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
409 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
410 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
411 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
412 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
413
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
414 POINT v205;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
415 uVoicesVolumeMultiplier = (pMouse->GetCursorPos(&v205)->x - 263) / 17;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
416 if ((char)uVoicesVolumeMultiplier > 8)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
417 uVoicesVolumeMultiplier = 9;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
418 if (!uVoicesVolumeMultiplier)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
419 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
420 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
421 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
422 case UIMSG_SetTurnSpeed:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
423 if (param)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
424 pParty->sRotationY = param * pParty->sRotationY / param;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
425 uTurnSpeed = param;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
426 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
427
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
428 case UIMSG_SetGraphicsMode:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
429 //if ( !bUseLoResSprites )
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
430 //{
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
431 // byte_6BE388_graphicsmode = uMessageParam;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
432 // MM7Initialization();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
433 // continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
434 //}
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
435 //if ( uMessageParam )
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
436 //{
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
437 // if ( uMessageParam == 1 )
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
438 // {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
439 // byte_6BE388_graphicsmode = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
440 // }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
441 // else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
442 // {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
443 // if ( uMessageParam != 2 )
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
444 // continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
445 // byte_6BE388_graphicsmode = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
446 // }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
447 // MM7Initialization();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
448 // continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
449 //}
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
450 pModalWindow = new GUIWindow_Modal(pNPCTopics[453].pText, UIMSG_0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
451 __debugbreak(); // Nomad: graphicsmode as it was now removed
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
452 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
453
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
454 case UIMSG_GameMenu_ReturnToGame:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
455 //pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
456 pEventTimer->Resume();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
457 current_screen_type = SCREEN_GAME;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
458 viewparams->bRedrawGameUI = true;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
459 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
460
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
461
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
462
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
463
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
464 case UIMSG_Escape:
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
465 if (pModalWindow)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
466 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
467 pModalWindow->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
468 pModalWindow = nullptr;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
469 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
470 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
471 pRenderer->ClearZBuffer(0, 479);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
472 viewparams->bRedrawGameUI = true;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
473 viewparams->field_48 = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
474
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
475 if (current_screen_type == SCREEN_MENU)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
476 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
477 pIcons_LOD->SyncLoadedFilesCount();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
478 pIcons_LOD->RemoveTexturesPackFromTextureList();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
479 pIcons_LOD->SyncLoadedFilesCount();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
480 pIcons_LOD->RemoveTexturesPackFromTextureList();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
481
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
482 current_screen_type = SCREEN_GAME;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
483 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
484 else if (current_screen_type == SCREEN_SAVEGAME || current_screen_type == SCREEN_LOADGAME)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
485 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
486 pIcons_LOD->RemoveTexturesPackFromTextureList();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
487 //crt_deconstruct_ptr_6A0118();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
488
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
489 pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
490 current_screen_type = SCREEN_MENU;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
491 pGUIWindow_CurrentMenu = new GUIWindow_GameMenu();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
492 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
493 else if (current_screen_type == SCREEN_OPTIONS)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
494 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
495 options_menu_skin.Relaease();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
496 pIcons_LOD->SyncLoadedFilesCount();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
497 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
498 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
499 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
500 WriteWindowsRegistryInt("WalkSound", bWalkSound);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
501 WriteWindowsRegistryInt("ShowDamage", bShowDamage);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
502 //WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
503 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
504 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
505 if (!uTurnSpeed)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
506 WriteWindowsRegistryInt("TurnDelta", 3);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
507 else if (uTurnSpeed == 64)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
508 WriteWindowsRegistryInt("TurnDelta", 2);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
509 else if (uTurnSpeed == 128)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
510 WriteWindowsRegistryInt("TurnDelta", 1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
511
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
512 pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
513 current_screen_type = SCREEN_MENU;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
514 pGUIWindow_CurrentMenu = new GUIWindow_GameMenu();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
515 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
516 else if (current_screen_type == SCREEN_VIDEO_OPTIONS)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
517 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
518 //if ( pRenderer->pRenderD3D )
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
519 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
520 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
521 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
522 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pEngine->uFlags2) >> 5) & 1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
523 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
524
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
525 pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
526 current_screen_type = SCREEN_MENU;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
527 pGUIWindow_CurrentMenu = new GUIWindow_GameMenu();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
528 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
529 else if (current_screen_type == SCREEN_KEYBOARD_OPTIONS)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
530 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
531 KeyToggleType pKeyToggleType; // [sp+0h] [bp-5FCh]@287
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
532 int v197 = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
533 bool pKeyBindingFlag = false;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
534
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
535 for (uint i = 0; i < 28; ++i)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
536 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
537 if (GameMenuUI_InvaligKeyBindingsFlags[i])
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
538 pKeyBindingFlag = true;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
539 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
540 if (!pKeyBindingFlag)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
541 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
542 for (uint i = 0; i < 5; i++)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
543 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
544 if (uTextureID_Optkb[i])
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
545 pIcons_LOD->pTextures[uTextureID_Optkb[i]].Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
546 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
547 memset(uTextureID_Optkb.data(), 0, 20);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
548 pIcons_LOD->SyncLoadedFilesCount();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
549 for (uint i = 0; i < 28; ++i)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
550 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
551 if (pKeyActionMap->GetActionVKey((enum InputAction)i) != pPrevVirtualCidesMapping[i])
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
552 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
553 if (v197)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
554 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
555 GUI_ReplaceHotkey(pKeyActionMap->GetActionVKey((enum InputAction)i), LOBYTE(pPrevVirtualCidesMapping[i]), 1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
556 v197 = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
557 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
558 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
559 GUI_ReplaceHotkey(pKeyActionMap->GetActionVKey((enum InputAction)i), LOBYTE(pPrevVirtualCidesMapping[i]), 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
560 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
561 if (i > 3 && i != 25 && i != 26)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
562 pKeyToggleType = TOGGLE_OneTimePress;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
563 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
564 pKeyToggleType = TOGGLE_Continuously;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
565 pKeyActionMap->SetKeyMapping(i, pPrevVirtualCidesMapping[i], pKeyToggleType);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
566 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
567 pKeyActionMap->StoreMappings();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
568 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
569 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
570 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
571
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
572 pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
573 current_screen_type = SCREEN_MENU;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
574 pGUIWindow_CurrentMenu = new GUIWindow_GameMenu();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
575 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
576 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
577 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
578 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
579 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
580
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
581 void GameMenu_Loop()
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
582 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
583 pEventTimer->Pause();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
584 pAudioPlayer->StopChannels(-1, -1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
585 current_screen_type = SCREEN_MENU;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
586
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
587 ++pIcons_LOD->uTexturePacksCount;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
588 if (!pIcons_LOD->uNumPrevLoadedFiles)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
589 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
590
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
591 pGUIWindow_CurrentMenu = new GUIWindow_GameMenu();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
592
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
593 viewparams->field_48 = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
594
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
595 stru_506E40.Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
596 pRenderer->SaveScreenshot("gamma.pcx", 155, 117);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
597 stru_506E40.LoadPCXFile("gamma.pcx", 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
598
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
599 while (uGameState == GAME_STATE_PLAYING
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
600 && (
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
601 current_screen_type == SCREEN_MENU
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
602 || current_screen_type == SCREEN_SAVEGAME
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
603 || current_screen_type == SCREEN_LOADGAME
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
604 || current_screen_type == SCREEN_OPTIONS
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
605 || current_screen_type == SCREEN_VIDEO_OPTIONS
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
606 || current_screen_type == SCREEN_KEYBOARD_OPTIONS
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
607 )
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
608 )
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
609 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
610 MSG msg;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
611 while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE))
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
612 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
613 if (msg.message == WM_QUIT)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
614 Engine_DeinitializeAndTerminate(0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
615 TranslateMessage(&msg);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
616 DispatchMessageW(&msg);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
617 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
618 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
619 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
620 WaitMessage();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
621 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
622 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
623
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
624 pRenderer->BeginScene();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
625 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
626 GameMenu_EventLoop();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
627 GUI_UpdateWindows();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
628 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
629 pRenderer->EndScene();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
630 pRenderer->Present();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
631 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
632
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
633 pGUIWindow_CurrentMenu->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
634 pGUIWindow_CurrentMenu = nullptr;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
635
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
636 stru_506E40.Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents:
diff changeset
637 }