annotate Game/CreateParty.cpp @ 2568:f2f2595fe308

rename Decals[], DecalCount
author Ritor1
date Thu, 21 May 2015 18:32:45 +0600
parents 117c219bf913
children
rev   line source
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
1 #include "Engine/Engine.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
2 #include "Engine/Party.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
3 #include "Engine/Graphics/Viewport.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
4 #include "Engine/Graphics/Overlays.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
5
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
6 #include "IO/Keyboard.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
7
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
8 #include "GUI/UI/UIPartyCreation.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
9
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
10 #include "Media/Audio/AudioPlayer.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
11 #include "Media/Audio/AIL.h"
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
12
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
13 void CreateParty_EventLoop()
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
14 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
15 auto pPlayer = pParty->pPlayers.data();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
16 while (pMessageQueue_50CBD0->uNumMessages)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
17 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
18 UIMessageType msg;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
19 int param, param2;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
20 pMessageQueue_50CBD0->PopMessage(&msg, &param, &param2);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
21
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
22 switch (msg)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
23 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
24 case UIMSG_PlayerCreation_SelectAttribute:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
25 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
26 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
27 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * param;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
28 uPlayerCreationUI_SelectedCharacter = param;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
29 pAudioPlayer->PlaySound(SOUND_SelectingANewCharacter, 0, 0, -1, 0, 0, 0, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
30 }
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
31 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
32
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
33 case UIMSG_PlayerCreation_VoicePrev:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
34 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
35 int sex = pParty->pPlayers[param].GetSexByVoice();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
36 do
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
37 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
38 if (pParty->pPlayers[param].uVoiceID == 0)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
39 pParty->pPlayers[param].uVoiceID = 19;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
40 else --pParty->pPlayers[param].uVoiceID;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
41 } while (pParty->pPlayers[param].GetSexByVoice() != sex);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
42 auto pButton = pCreationUI_BtnPressLeft2[param];
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
43
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
44 new OnButtonClick(pButton->uX, pButton->uY, 0, 0, (int)pButton, (char *)1);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
45 pAudioPlayer->PlaySound(SOUND_SelectingANewCharacter, 0, 0, -1, 0, 0, 0, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
46 pParty->pPlayers[param].PlaySound(SPEECH_PickMe, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
47 }
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
48 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
49
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
50 case UIMSG_PlayerCreation_VoiceNext:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
51 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
52 int sex = pParty->pPlayers[param].GetSexByVoice();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
53 do
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
54 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
55 pParty->pPlayers[param].uVoiceID = (pParty->pPlayers[param].uVoiceID + 1) % 20;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
56 } while (pParty->pPlayers[param].GetSexByVoice() != sex);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
57 auto pButton = pCreationUI_BtnPressRight2[param];
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
58 new OnButtonClick(pButton->uX, pButton->uY, 0, 0, (int)pButton, (char *)1);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
59 pAudioPlayer->PlaySound(SOUND_SelectingANewCharacter, 0, 0, -1, 0, 0, 0, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
60 pParty->pPlayers[param].PlaySound(SPEECH_PickMe, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
61 }
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
62 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
63 case UIMSG_PlayerCreation_FacePrev:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
64 //pPlayer = &pParty->pPlayers[pParam];
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
65 if (!pParty->pPlayers[param].uCurrentFace)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
66 pParty->pPlayers[param].uCurrentFace = 19;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
67 else
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
68 pParty->pPlayers[param].uCurrentFace -= 1;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
69 pParty->pPlayers[param].uVoiceID = pParty->pPlayers[param].uCurrentFace;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
70 pParty->pPlayers[param].SetInitialStats();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
71 pParty->pPlayers[param].SetSexByVoice();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
72 pParty->pPlayers[param].RandomizeName();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
73 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
74 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * param;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
75 uPlayerCreationUI_SelectedCharacter = param;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
76 new OnButtonClick(pCreationUI_BtnPressLeft[param]->uX, pCreationUI_BtnPressLeft[param]->uY, 0, 0, (int)pCreationUI_BtnPressLeft[param], (char *)1);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
77 pAudioPlayer->PlaySound(SOUND_SelectingANewCharacter, 0, 0, -1, 0, 0, 0.0, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
78 pParty->pPlayers[param].PlaySound(SPEECH_PickMe, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
79 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
80 case UIMSG_PlayerCreation_FaceNext:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
81 //pPlayer = &pParty->pPlayers[pParam];
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
82 int v20; v20 = (char)((int)pParty->pPlayers[param].uCurrentFace + 1) % 20;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
83 pParty->pPlayers[param].uCurrentFace = v20;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
84 pParty->pPlayers[param].uVoiceID = v20;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
85 pParty->pPlayers[param].SetInitialStats();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
86 pParty->pPlayers[param].SetSexByVoice();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
87 pParty->pPlayers[param].RandomizeName();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
88 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
89 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * param;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
90 uPlayerCreationUI_SelectedCharacter = param;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
91 new OnButtonClick(pCreationUI_BtnPressRight[param]->uX, pCreationUI_BtnPressRight[param]->uY, 0, 0, (int)pCreationUI_BtnPressRight[param], (char *)1);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
92 pAudioPlayer->PlaySound(SOUND_SelectingANewCharacter, 0, 0, -1, 0, 0, 0, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
93 pParty->pPlayers[param].PlaySound(SPEECH_PickMe, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
94 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
95 case UIMSG_PlayerCreationClickPlus:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
96 new OnButtonClick2(613, 393, 0, 0, (int)pPlayerCreationUI_BtnPlus, (char *)1);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
97 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
98 pAudioPlayer->PlaySound(SOUND_ClickMinus, 0, 0, -1, 0, 0, 0, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
99 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
100 case UIMSG_PlayerCreationClickMinus:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
101 new OnButtonClick2(523, 393, 0, 0, (int)pPlayerCreationUI_BtnMinus, (char *)1);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
102 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
103 pAudioPlayer->PlaySound(SOUND_ClickPlus, 0, 0, -1, 0, 0, 0, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
104 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
105 case UIMSG_PlayerCreationSelectActiveSkill:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
106 if (pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(3) == 37)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
107 pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(param + 4)] = 1;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
108 pAudioPlayer->PlaySound(SOUND_ClickSkill, 0, 0, -1, 0, 0, 0, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
109 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
110 case UIMSG_PlayerCreationSelectClass:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
111 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)param);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
112 pAudioPlayer->PlaySound(SOUND_SelectingANewCharacter, 0, 0, -1, 0, 0, 0, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
113 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
114 case UIMSG_PlayerCreationClickOK:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
115 new OnButtonClick2(580, 431, 0, 0, (int)pPlayerCreationUI_BtnOK, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
116 if (PlayerCreation_GetUnspentAttributePointCount() || !PlayerCreation_Choose4Skills())
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
117 GameUI_Footer_TimeLeft = GetTickCount() + 4000;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
118 else
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
119 uGameState = GAME_STATE_STARTING_NEW_GAME;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
120 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
121 case UIMSG_PlayerCreationClickReset:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
122 new OnButtonClick2(527, 431, 0, 0, (int)pPlayerCreationUI_BtnReset, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
123 pParty->Reset();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
124 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
125 case UIMSG_PlayerCreationRemoveUpSkill:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
126 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
127 int v4; v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
128 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * param;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
129 if (pPlayer[param].GetSkillIdxByOrder(2) != 37)//37 - None(Νες)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
130 pParty->pPlayers[param].pActiveSkills[pPlayer[param].GetSkillIdxByOrder(2)] = 0;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
131 }
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
132 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
133 case UIMSG_PlayerCreationRemoveDownSkill:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
134 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
135 int v4; v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
136 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * param;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
137 if (pPlayer[param].GetSkillIdxByOrder(3) != 37)//37 - None(Νες)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
138 pParty->pPlayers[param].pActiveSkills[pPlayer[param].GetSkillIdxByOrder(3)] = 0;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
139 }
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
140 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
141 case UIMSG_PlayerCreationChangeName:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
142 pAudioPlayer->PlaySound(SOUND_ClickSkill, 0, 0, -1, 0, 0, 0, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
143 uPlayerCreationUI_SelectedCharacter = param;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
144 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
145 pGUIWindow_CurrentMenu->ptr_1C = (void *)param;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
146 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
147 case UIMSG_Escape:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
148 if (pModalWindow)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
149 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
150 pModalWindow->Release();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
151 pModalWindow = nullptr;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
152 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
153 }
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
154 if (!(dword_6BE364_game_settings_1 & GAME_SETTINGS_4000))
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
155 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
156 viewparams->bRedrawGameUI = true;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
157 viewparams->field_48 = 1;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
158 if (GetCurrentMenuID() == MENU_MAIN || GetCurrentMenuID() == MENU_MMT_MAIN_MENU
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
159 || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
160 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
161 //if ( current_screen_type == SCREEN_VIDEO )
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
162 //pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
163 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_ChangeGameState, 0, 0);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
164 }
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
165 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
166 case UIMSG_ChangeGameState:
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
167 uGameState = GAME_FINISHED;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
168 break;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
169 }
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
170 }
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
171 }
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
172
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
173 bool CreateParty_Loop()
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
174 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
175 // -------------------------------------------------------
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
176 // 00462C94 bool MM_Main(const wchar_t *pCmdLine) --- part
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
177 extern bool use_music_folder;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
178 if (use_music_folder)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
179 alSourceStop(mSourceID);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
180 else
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
181 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
182 if (pAudioPlayer->hAILRedbook)
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
183 AIL_redbook_stop(pAudioPlayer->hAILRedbook);
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
184 }
2565
117c219bf913 Party, items and stuff are abstracted from savegame file representation
a.parshin
parents: 2553
diff changeset
185
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
186 pParty->Reset();
2565
117c219bf913 Party, items and stuff are abstracted from savegame file representation
a.parshin
parents: 2553
diff changeset
187 pParty->CreateDefaultParty();
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
188
2565
117c219bf913 Party, items and stuff are abstracted from savegame file representation
a.parshin
parents: 2553
diff changeset
189 _449B7E_toggle_bit(pParty->_quest_bits, PARTY_QUEST_EMERALD_RED_POTION_ACTIVE, 1);
117c219bf913 Party, items and stuff are abstracted from savegame file representation
a.parshin
parents: 2553
diff changeset
190 _449B7E_toggle_bit(pParty->_quest_bits, PARTY_QUEST_EMERALD_SEASHELL_ACTIVE, 1);
117c219bf913 Party, items and stuff are abstracted from savegame file representation
a.parshin
parents: 2553
diff changeset
191 _449B7E_toggle_bit(pParty->_quest_bits, PARTY_QUEST_EMERALD_LONGBOW_ACTIVE, 1);
117c219bf913 Party, items and stuff are abstracted from savegame file representation
a.parshin
parents: 2553
diff changeset
192 _449B7E_toggle_bit(pParty->_quest_bits, PARTY_QUEST_EMERALD_PLATE_ACTIVE, 1);
117c219bf913 Party, items and stuff are abstracted from savegame file representation
a.parshin
parents: 2553
diff changeset
193 _449B7E_toggle_bit(pParty->_quest_bits, PARTY_QUEST_EMERALD_LUTE_ACTIVE, 1);
117c219bf913 Party, items and stuff are abstracted from savegame file representation
a.parshin
parents: 2553
diff changeset
194 _449B7E_toggle_bit(pParty->_quest_bits, PARTY_QUEST_EMERALD_HAT_ACTIVE, 1);
117c219bf913 Party, items and stuff are abstracted from savegame file representation
a.parshin
parents: 2553
diff changeset
195
117c219bf913 Party, items and stuff are abstracted from savegame file representation
a.parshin
parents: 2553
diff changeset
196 pGUIWindow_CurrentMenu = new GUIWindow_PartyCreation();
2553
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
197 if (PlayerCreationUI_Loop())
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
198 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
199 DeleteCCharFont();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
200 return false;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
201 }
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
202 else
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
203 {
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
204 DeleteCCharFont();
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
205 return true;
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
206 }
48708da03b7f Party Creation UI logic separated from MainMenu
a.parshin
parents:
diff changeset
207 }