Mercurial > mm7
annotate GUI/GUIWindow.cpp @ 2573:0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
Changing more class Texture to class Image.
author | a.parshin |
---|---|
date | Sat, 05 Mar 2016 16:25:53 +0200 |
parents | d87bfbd3bb3b |
children | dd36326a9994 |
rev | line source |
---|---|
2502 | 1 #define _CRTDBG_MAP_ALLOC |
2 #include <stdlib.h> | |
3 #include <crtdbg.h> | |
4 | |
5 #define _CRT_SECURE_NO_WARNINGS | |
2541 | 6 #include "Engine/Engine.h" |
2502 | 7 |
8 #include "GUIWindow.h" | |
9 #include "GUIFont.h" | |
10 #include "Engine/Party.h" | |
11 #include "Engine/LOD.h" | |
12 #include "IO/Keyboard.h" | |
13 #include "Engine/OurMath.h" | |
14 #include "Engine/Timer.h" | |
15 #include "Media/Audio/AudioPlayer.h" | |
16 #include "IO/Mouse.h" | |
17 #include "Engine/Graphics/Viewport.h" | |
18 #include "Engine/Tables/StorylineTextTable.h" | |
19 #include "GUI\UI\UIHouses.h" | |
20 #include "GUI\UI\UIBooks.h" | |
21 #include "Engine/texts.h" | |
22 #include "Engine/Autonotes.h" | |
23 #include "Engine/Awards.h" | |
24 #include "Engine/Objects/Chest.h" | |
25 #include "Engine/Graphics/Outdoor.h" | |
26 #include "Engine/Tables/IconFrameTable.h" | |
27 #include "Engine/Objects/Actor.h" | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
28 #include "Engine/AssetsManager.h" |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
29 #include "Engine/Events.h" |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
30 #include "Engine/Graphics/Level\Decoration.h" |
2502 | 31 |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
32 #include "GUI/UI/UIArena.h" |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
33 #include "GUI/UI/UIPopup.h" |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
34 #include "GUI/UI/UIGame.h" |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
35 #include "GUI/UI/UICharacter.h" |
2502 | 36 |
37 typedef struct _RGBColor | |
38 { | |
39 unsigned char R; | |
40 unsigned char B; | |
41 unsigned char G; | |
42 }RGBColor; | |
43 | |
44 | |
45 std::array<RGBColor, 20> spell_tooltip_colors={{ | |
46 {0x96, 0xD4, 0xFF}, | |
47 {0xFF, 0x80, 0x00}, | |
48 {0xFF, 0xFF, 0x9B}, | |
49 {0xE1, 0xE1, 0xE1}, | |
50 {0x80, 0x80, 0x80}, | |
51 {0x96, 0xD4, 0xFF}, | |
52 {0xFF, 0x55, 0x00}, | |
53 {0x96, 0xD4, 0xFF}, | |
54 {0xFF, 0x55, 0x00}, | |
55 {0xE1, 0xE1, 0xE1}, | |
56 {0xFF, 0x55, 0x00}, | |
57 {0x96, 0xD4, 0xFF}, | |
58 {0xEB, 0x0F, 0xFF}, | |
59 {0xFF, 0x80, 0x00}, | |
60 {0x96, 0xD4, 0xFF}, | |
61 {0x80, 0x80, 0x80}, | |
62 {0xFF, 0x55, 0x00}, | |
63 {0x00, 0x80, 0xFF}, | |
64 {0x00, 0x80, 0xFF}, | |
65 {0x96, 0xD4, 0xFF}}}; | |
66 | |
67 | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
68 enum WindowType current_character_screen_window; |
2502 | 69 struct GUIWindow *pWindow_MMT_MainMenu; |
70 struct GUIWindow *pWindow_MainMenu; | |
2552
ac16f4a3a91e
Load from MainMenu logic separated from MainMenu window
a.parshin
parents:
2551
diff
changeset
|
71 std::array<struct GUIWindow *, 50> pWindowList; |
2502 | 72 |
73 struct GUIMessageQueue *pMessageQueue_50CBD0 = new GUIMessageQueue; | |
74 struct GUIMessageQueue *pMessageQueue_50C9E8 = new GUIMessageQueue; | |
75 | |
76 | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
77 Image *ui_exit_cancel_button_background = nullptr; |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
78 Image *game_ui_right_panel_frame = nullptr; |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
79 unsigned int uExitCancelTextureId; |
2502 | 80 |
81 | |
82 | |
83 | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
84 GUIWindow_Inventory_CastSpell::GUIWindow_Inventory_CastSpell(unsigned int x, unsigned int y, unsigned int width, unsigned int height, int button, const char *hint) : |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
85 GUIWindow(x, y, width, height, button, hint) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
86 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
87 pMouse->SetCursorBitmap("MICON2"); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
88 pBtn_ExitCancel = CreateButton(392, 318, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],//Отмена |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
89 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
90 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2); // Choose target / Выбрать цель |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
91 ++pIcons_LOD->uTexturePacksCount; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
92 current_character_screen_window = WINDOW_CharacterWindow_Inventory; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
93 current_screen_type = SCREEN_CASTING; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
94 if (!pIcons_LOD->uNumPrevLoadedFiles) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
95 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
96 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
97 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
98 GUIWindow_House::GUIWindow_House(unsigned int x, unsigned int y, unsigned int width, unsigned int height, int button, const char *hint) : |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
99 GUIWindow(x, y, width, height, button, hint) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
100 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
101 current_screen_type = SCREEN_HOUSE; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
102 pBtn_ExitCancel = CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80], // Quit building / Выйти из здания |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
103 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
104 for (int v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
105 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
106 char *v29, *v30; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
107 if (v26 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
108 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
109 v30 = pMapStats->pInfos[uHouse_ExitPic].pName; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
110 v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S]; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
111 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
112 else |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
113 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
114 if (v26 || !dword_591080) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
115 v30 = HouseNPCData[v26 + 1 - ((dword_591080 != 0) ? 1 : 0)]->pName; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
116 else |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
117 v30 = (char*)p2DEvents[button - 1].pProprieterName; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
118 v29 = (char*)pGlobalTXT_LocalizationStrings[435]; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
119 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
120 sprintfex(byte_591180[v26].data(), v29, v30); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
121 HouseNPCPortraitsButtonsList[v26] = CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
122 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
123 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26].data(), 0, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
124 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
125 if (uNumDialogueNPCPortraits == 1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
126 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
127 window_SpeakInHouse = this; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
128 _4B4224_UpdateNPCTopics(0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
129 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
130 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
131 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
132 GUIWindow_Dialogue::GUIWindow_Dialogue(unsigned int x, unsigned int y, unsigned int width, unsigned int height, int button, const char *hint) : |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
133 GUIWindow(x, y, width, height, button, hint) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
134 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
135 prev_screen_type = current_screen_type; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
136 current_screen_type = SCREEN_NPC_DIALOGUE; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
137 pBtn_ExitCancel = CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], //"Exit" |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
138 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
139 if (par1C != 1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
140 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
141 int num_menu_buttons = 0; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
142 int v11 = LOBYTE(pFontArrus->uFontHeight) - 3; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
143 NPCData *speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
144 if (GetGreetType(sDialogue_SpeakingActorNPC_ID) == 1)//QuestsNPC_greet |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
145 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
146 if (speakingNPC->joins) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
147 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
148 CreateButton(480, 130, 140, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0xDu, 0, "", 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
149 num_menu_buttons = 1; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
150 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
151 if (speakingNPC->evt_A) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
152 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
153 if (num_menu_buttons < 4) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
154 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
155 int v14 = NPC_EventProcessor(speakingNPC->evt_A); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
156 if (v14 == 1 || v14 == 2) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
157 CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x13u, 0, "", 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
158 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
159 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
160 if (speakingNPC->evt_B) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
161 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
162 if (num_menu_buttons < 4) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
163 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
164 int v16 = NPC_EventProcessor(speakingNPC->evt_B); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
165 if (v16 == 1 || v16 == 2) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
166 CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x14u, 0, "", 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
167 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
168 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
169 if (speakingNPC->evt_C) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
170 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
171 if (num_menu_buttons < 4) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
172 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
173 int v18 = NPC_EventProcessor(speakingNPC->evt_C); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
174 if (v18 == 1 || v18 == 2) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
175 CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x15u, 0, "", 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
176 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
177 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
178 if (speakingNPC->evt_D) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
179 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
180 if (num_menu_buttons < 4) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
181 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
182 int v20 = NPC_EventProcessor(speakingNPC->evt_D); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
183 if (v20 == 1 || v20 == 2) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
184 CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x16u, 0, "", 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
185 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
186 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
187 if (speakingNPC->evt_E) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
188 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
189 if (num_menu_buttons < 4) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
190 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
191 int v22 = NPC_EventProcessor(speakingNPC->evt_E); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
192 if (v22 == 1 || v22 == 2) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
193 CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x17u, 0, "", 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
194 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
195 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
196 if (speakingNPC->evt_F) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
197 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
198 if (num_menu_buttons < 4) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
199 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
200 int v24 = NPC_EventProcessor(speakingNPC->evt_F); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
201 if (v24 == 1 || v24 == 2) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
202 CreateButton(0x1E0u, num_menu_buttons++ * v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x18u, 0, "", 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
203 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
204 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
205 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
206 else |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
207 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
208 if (speakingNPC->joins) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
209 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
210 CreateButton(0x1E0u, 0x82u, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Du, 0, pGlobalTXT_LocalizationStrings[407], 0);//Подробнее |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
211 if (speakingNPC->Hired()) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
212 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
213 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[408], speakingNPC->pName); //Отпустить |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
214 CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Cu, 0, pTmpBuf.data(), 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
215 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
216 else |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
217 CreateButton(0x1E0u, v11 + 130, 0x8Cu, v11, 1, 0, UIMSG_SelectNPCDialogueOption, 0x4Cu, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
218 num_menu_buttons = 2; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
219 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
220 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
221 _41D08F_set_keyboard_control_group(num_menu_buttons, 1, 0, 1); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
222 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
223 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
224 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
225 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
226 GUIWindow_GenericDialogue::GUIWindow_GenericDialogue(unsigned int x, unsigned int y, unsigned int width, unsigned int height, int button, const char *hint) : |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
227 GUIWindow(x, y, width, height, button, hint) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
228 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
229 prev_screen_type = current_screen_type; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
230 pKeyActionMap->EnterText(0, 15, this); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
231 current_screen_type = SCREEN_BRANCHLESS_NPC_DIALOG; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
232 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
233 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
234 OnCastTargetedSpell::OnCastTargetedSpell(unsigned int x, unsigned int y, unsigned int width, unsigned int height, int button, const char *hint) : |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
235 GUIWindow(x, y, width, height, button, hint) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
236 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
237 pEventTimer->Pause(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
238 pAudioPlayer->StopChannels(-1, -1); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
239 pMouse->SetCursorBitmap("MICON2"); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
240 ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2u); // ChooseTarget / Выберите цель |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
241 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
242 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
243 |
2502 | 244 // inlined |
245 //----- (mm6c::00420520) -------------------------------------------------- | |
246 void GUIMessageQueue::Flush() | |
247 { | |
248 if (uNumMessages) | |
249 uNumMessages = pMessages[0].field_8 != 0; | |
250 } | |
251 | |
252 //----- (004356B9) -------------------------------------------------------- | |
253 void GUIMessageQueue::PopMessage(enum UIMessageType *pType, int *pParam, int *a4) | |
254 { | |
255 if ( this->uNumMessages ) | |
256 { | |
257 *pType = this->pMessages[0].eType; | |
258 *pParam = this->pMessages[0].param; | |
259 *a4 = this->pMessages[0].field_8; | |
260 if ( (signed int)(this->uNumMessages - 1) > 0 ) | |
261 { | |
262 for ( uint i = 0; i < (signed int)(this->uNumMessages - 1); ++i ) | |
263 { | |
264 this->pMessages[i].eType = this->pMessages[i + 1].eType; | |
265 this->pMessages[i].param = this->pMessages[i + 1].param; | |
266 this->pMessages[i].field_8 = this->pMessages[i + 1].field_8; | |
267 } | |
268 } | |
269 --this->uNumMessages; | |
270 } | |
271 } | |
272 | |
273 //----- (0041B4E1) -------------------------------------------------------- | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
274 void GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall) |
2502 | 275 { |
276 int i; // edx@2 | |
277 GUIButton *j; // ecx@3 | |
278 int k; // edx@7 | |
279 GUIButton *l; // ecx@8 | |
280 unsigned __int8 v9; // [sp+4h] [bp-8h]@1 | |
281 char old_hot_key; // [sp+8h] [bp-4h]@1 | |
282 | |
283 //v3 = uNewHotkey; | |
284 old_hot_key = toupper(uOldHotkey); | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
285 v9 = toupper(uNewHotkey); |
2502 | 286 if ( bFirstCall ) |
287 { | |
288 for ( i = uNumVisibleWindows; i >= 0; --i ) | |
289 { | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
290 for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1]->pControlsHead; j; j = j->pNext ) |
2502 | 291 j->field_28 = 0; |
292 } | |
293 } | |
294 for ( k = uNumVisibleWindows; k >= 0; --k ) | |
295 { | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
296 for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1]->pControlsHead; l; l = l->pNext ) |
2502 | 297 { |
298 if ( l->uHotkey == old_hot_key ) | |
299 { | |
300 if ( !l->field_28 ) | |
301 { | |
302 l->field_28 = 1; | |
303 l->uHotkey = v9; | |
304 } | |
305 } | |
306 } | |
307 } | |
308 } | |
309 | |
310 //----- (0041B438) -------------------------------------------------------- | |
311 GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey) | |
312 { | |
313 char Hot_key_num; // al@1 | |
314 GUIWindow *current_window; // ecx@2 | |
315 GUIButton *result; // eax@2 | |
316 | |
317 Hot_key_num = toupper(uHotkey); | |
318 for( int i = uNumVisibleWindows; i >= 0 && pVisibleWindowsIdxs[i] > 0; i-- ) | |
319 { | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
320 current_window = pWindowList[pVisibleWindowsIdxs[i] - 1]; |
2502 | 321 for ( result = current_window->pControlsHead; result; result = result->pNext ) |
322 { | |
323 if ( result->uHotkey == Hot_key_num ) | |
324 { | |
325 pMessageQueue_50CBD0->AddGUIMessage(result->msg, result->msg_param, 0); | |
326 return result; | |
327 } | |
328 } | |
329 if ( !current_window->uFrameX && !current_window->uFrameY | |
330 && (current_window->uFrameWidth == window->GetWidth() && current_window->uFrameHeight == window->GetWidth()) ) | |
331 break; | |
332 } | |
333 return 0; | |
334 } | |
335 // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; | |
336 | |
337 //----- (0041D73D) -------------------------------------------------------- | |
338 void GUIWindow::_41D73D_draw_buff_tooltip() | |
339 { | |
340 __int64 remaing_time; // ST28_8@11 | |
341 unsigned short text_color; | |
342 int Y_pos; // esi@11 | |
343 int string_count; // [sp+20h] [bp-4h]@7 | |
344 | |
345 string_count = 0; | |
346 for (int i=0; i<20; ++i) | |
347 if ( pParty->pPartyBuffs[i].uExpireTime > 0i64 ) | |
348 ++string_count; | |
349 | |
350 uFrameHeight = pFontArrus->uFontHeight + 72; | |
351 uFrameHeight += (string_count - 1) * pFontArrus->uFontHeight; | |
352 uFrameZ = uFrameWidth + uFrameX - 1; | |
353 uFrameW = uFrameY + uFrameHeight - 1; | |
354 DrawMessageBox(0); | |
355 DrawTitleText(pFontArrus, 0, 12, 0, pGlobalTXT_LocalizationStrings[451], 3); | |
356 if ( !string_count ) | |
357 DrawTitleText(pFontComic, 0, 40, 0, pGlobalTXT_LocalizationStrings[153], 3); | |
358 | |
359 GetTickCount(); | |
360 string_count = 0; | |
361 for (int i=0; i<20; ++i) | |
362 { | |
363 if ( pParty->pPartyBuffs[i].uExpireTime>0i64 )//!!! | |
364 { | |
365 remaing_time = pParty->pPartyBuffs[i].uExpireTime- pParty->uTimePlayed;//!!! | |
366 Y_pos = string_count * pFontComic->uFontHeight + 40; | |
367 text_color = Color16(spell_tooltip_colors[i].R, spell_tooltip_colors[i].G, spell_tooltip_colors[i].B); | |
368 DrawText(pFontComic, 52, Y_pos, text_color, aSpellNames[i], 0, 0, 0); | |
369 DrawBuff_remaining_time_string(Y_pos, this, remaing_time, pFontComic); | |
370 ++string_count; | |
371 } | |
372 } | |
373 } | |
374 | |
375 | |
376 //----- (0041D08F) -------------------------------------------------------- | |
377 void GUIWindow::_41D08F_set_keyboard_control_group(int num_buttons, int a3, int a4, int a5) | |
378 { | |
379 if (num_buttons) | |
380 { | |
381 this->pNumPresenceButton = num_buttons; | |
382 this->field_30 = a3; | |
383 this->field_34 = a4; | |
384 this->pCurrentPosActiveItem = a5; | |
385 this->pStartingPosActiveItem = a5; | |
386 this->receives_keyboard_input = true; | |
387 } | |
388 else | |
389 { | |
390 this->pNumPresenceButton = 0; | |
391 this->field_30 = a3; | |
392 this->field_34 = a4; | |
393 this->pCurrentPosActiveItem = 0; | |
394 this->pStartingPosActiveItem = 0; | |
395 this->receives_keyboard_input = false; | |
396 } | |
397 } | |
398 | |
399 | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
400 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
401 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
402 void GUIWindow_Dialogue::Release() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
403 { |
2549 | 404 // ----------------------------------------- |
405 // 0041C26A void GUIWindow::Release --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
406 if (!dword_591084) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
407 pDialogueNPCPortraits[0]->Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
408 uNumDialogueNPCPortraits = 0; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
409 pTexture_Dialogue_Background->Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
410 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
411 pIcons_LOD->SyncLoadedFilesCount(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
412 current_screen_type = prev_screen_type; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
413 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
414 GUIWindow::Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
415 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
416 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
417 void GUIWindow_GenericDialogue::Release() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
418 { |
2549 | 419 // ----------------------------------------- |
420 // 0041C26A void GUIWindow::Release --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
421 pIcons_LOD->SyncLoadedFilesCount(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
422 current_screen_type = prev_screen_type; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
423 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
424 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
425 GUIWindow::Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
426 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
427 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
428 void GUIWindow_House::Release() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
429 { |
2549 | 430 // ----------------------------------------- |
431 // 0041C26A void GUIWindow::Release --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
432 for (int i = 0; i < uNumDialogueNPCPortraits; ++i) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
433 pDialogueNPCPortraits[i]->Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
434 uNumDialogueNPCPortraits = 0; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
435 pTexture_Dialogue_Background->Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
436 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
437 pIcons_LOD->SyncLoadedFilesCount(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
438 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
439 dword_5C35D4 = 0; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
440 if (bFlipOnExit) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
441 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
442 pParty->sRotationY = (stru_5C6E00->uIntegerDoublePi - 1) & (stru_5C6E00->uIntegerPi + pParty->sRotationY); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
443 pIndoorCameraD3D->sRotationY = pParty->sRotationY; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
444 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
445 pParty->uFlags |= 2u; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
446 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
447 GUIWindow::Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
448 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
449 |
2502 | 450 //----- (0041C26A) -------------------------------------------------------- |
451 void GUIWindow::Release() | |
452 { | |
453 //GUIWindow *v1; // esi@1 | |
454 int i; // edi@20 | |
455 //GUIButton *v8; // eax@26 | |
456 GUIButton *pNextBtn; // edi@27 | |
457 //int v10; // esi@28 | |
458 //int v11; // ecx@28 | |
459 int v12; // edx@29 | |
460 | |
461 //v1 = this; | |
462 if ( !this ) | |
463 return; | |
464 | |
465 //v8 = this->pControlsHead; | |
466 if ( this->pControlsHead ) | |
467 { | |
468 do | |
469 { | |
470 pNextBtn = this->pControlsHead->pNext; | |
471 free(this->pControlsHead); | |
472 this->pControlsHead = pNextBtn; | |
473 } | |
474 while ( pNextBtn ); | |
475 } | |
476 this->pControlsHead = 0; | |
477 this->pControlsTail = 0; | |
478 this->uNumControls = 0; | |
479 this->eWindowType = WINDOW_null; | |
480 while ( this->numVisibleWindows < uNumVisibleWindows ) | |
481 { | |
482 v12 = pVisibleWindowsIdxs[this->numVisibleWindows + 1]; | |
483 pVisibleWindowsIdxs[this->numVisibleWindows] = v12; | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
484 --pWindowList[v12 - 1]->numVisibleWindows; |
2502 | 485 ++this->numVisibleWindows; |
486 } | |
487 pVisibleWindowsIdxs[uNumVisibleWindows] = 0; | |
488 uNumVisibleWindows = uNumVisibleWindows - 1; | |
489 } | |
490 | |
491 //----- (0041CD3B) -------------------------------------------------------- | |
492 GUIButton *GUIWindow::GetControl(unsigned int uID) | |
493 { | |
494 GUIButton *result; // eax@1 | |
495 | |
496 result = this->pControlsHead; | |
497 for ( uID; uID; --uID ) | |
498 result = result->pNext; | |
499 return result; | |
500 } | |
501 | |
502 | |
503 //----- (00415551) -------------------------------------------------------- | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
504 void GUIWindow::DrawMessageBox(bool inside_game_viewport) |
2502 | 505 { |
506 unsigned int v16; // esi@19 | |
507 GUIWindow current_window; // [sp+Ch] [bp-60h]@18 | |
508 POINT cursor; // [sp+60h] [bp-Ch]@8 | |
509 unsigned int v22; // [sp+74h] [bp+8h]@2 | |
510 | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
511 int x = 0; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
512 int y = 0; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
513 int z, w; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
514 if (inside_game_viewport) |
2502 | 515 { |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
516 x = pViewport->uViewportTL_X; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
517 z = pViewport->uViewportBR_X; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
518 y = pViewport->uViewportTL_Y; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
519 w = pViewport->uViewportBR_Y; |
2502 | 520 } |
521 else | |
522 { | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
523 z = window->GetWidth(); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
524 w = window->GetHeight(); |
2502 | 525 } |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
526 |
2502 | 527 pMouse->GetCursorPos(&cursor); |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
528 if ( (signed int)this->uFrameX >= x ) |
2502 | 529 { |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
530 if ( (signed int)(this->uFrameWidth + this->uFrameX) > z ) |
2502 | 531 { |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
532 this->uFrameX = z - this->uFrameWidth; |
2502 | 533 this->uFrameY = cursor.y + 30; |
534 } | |
535 } | |
536 else | |
537 { | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
538 this->uFrameX = x; |
2502 | 539 this->uFrameY = cursor.y + 30; |
540 } | |
541 | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
542 if ( (signed int)this->uFrameY >= y ) |
2502 | 543 { |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
544 if ( (signed int)(this->uFrameY + this->uFrameHeight) > w) |
2502 | 545 this->uFrameY = cursor.y - this->uFrameHeight - 30; |
546 } | |
547 else | |
548 this->uFrameY = cursor.y + 30; | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
549 if ( (signed int)this->uFrameY < y ) |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
550 this->uFrameY = y; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
551 if ( (signed int)this->uFrameX < x ) |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
552 this->uFrameX = x; |
2502 | 553 this->uFrameZ = this->uFrameWidth + this->uFrameX - 1; |
554 this->uFrameW = this->uFrameHeight + this->uFrameY - 1; | |
555 memcpy(¤t_window, this, sizeof(current_window)); | |
556 current_window.uFrameX += 12; | |
557 current_window.uFrameWidth -= 24; | |
558 current_window.uFrameY += 12; | |
559 current_window.uFrameHeight -= 12; | |
560 current_window.uFrameZ = current_window.uFrameWidth + current_window.uFrameX - 1; | |
561 current_window.uFrameW = current_window.uFrameHeight + current_window.uFrameY - 1; | |
562 if ( this->Hint ) | |
563 v16 = pFontLucida->CalcTextHeight(this->Hint, ¤t_window, 0, 0) + 24; | |
564 else | |
565 v16 = this->uFrameHeight; | |
566 if ( (signed int)v16 < 64 ) | |
567 v16 = 64; | |
568 if ( (signed int)(v16 + this->uFrameY) > 479 ) | |
569 v16 = 479 - this->uFrameY; | |
570 DrawPopupWindow(this->uFrameX, this->uFrameY, this->uFrameWidth, v16); | |
571 if ( this->Hint ) | |
572 current_window.DrawTitleText(pFontLucida, 0, (signed int)(v16 - pFontLucida->CalcTextHeight(this->Hint, ¤t_window, 0, 0)) / 2 - 14, 0, this->Hint, 3); | |
573 } | |
574 | |
575 //----- (00411B59) -------------------------------------------------------- | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
576 void LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer) |
2502 | 577 { |
578 //unsigned int v2; // esi@1 | |
579 //unsigned int v3; // edi@1 | |
580 FILE *v4; // ebx@1 | |
581 FILE *v5; // eax@2 | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
582 //char pContainerName[64]; // [sp+Ch] [bp-44h]@1 |
2502 | 583 //unsigned int v7; // [sp+4Ch] [bp-4h]@1 |
584 | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
585 if (pSavegameThumbnails[uSlot]) |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
586 { |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
587 pSavegameThumbnails[uSlot]->Release(); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
588 pSavegameThumbnails[uSlot] = nullptr; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
589 } |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
590 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
591 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
592 wchar_t filename[1024]; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
593 swprintf(filename, L"data\\lloyd%d%d.pcx", uPlayer, uSlot + 1); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
594 pSavegameThumbnails[uSlot] = assets->GetImage_PCXFromFile(filename); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
595 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
596 if (!pSavegameThumbnails[uSlot]) |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
597 { |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
598 swprintf(filename, L"lloyd%d%d.pcx", uPlayer, uSlot + 1); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
599 pSavegameThumbnails[uSlot] = assets->GetImage_PCXFromNewLOD(filename); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
600 } |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
601 /*sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1); |
2502 | 602 v4 = fopen(pContainerName, "rb"); |
603 if ( v4 ) | |
604 { | |
605 pSavegameThumbnails[uSlot].LoadFromFILE(v4, 0, 1); | |
606 fclose(v4); | |
607 } | |
608 else | |
609 { | |
610 sprintf(pContainerName, "lloyd%d%d.pcx", uPlayer, uSlot + 1); | |
611 v5 = pNew_LOD->FindContainer(pContainerName, 1); | |
612 if ( v5 ) | |
613 pSavegameThumbnails[uSlot].LoadFromFILE(v5, 0, 0); | |
614 else | |
615 *((int *)&pSavegameThumbnails.data()->pPixels + 10 * uSlot) = 0; | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
616 }*/ |
2502 | 617 } |
618 | |
619 | |
620 //----- (004B3157) -------------------------------------------------------- | |
621 void GUIWindow::HouseDialogManager() | |
622 { | |
623 unsigned __int16 pWhiteColor; // di@2 | |
624 const char *pHouseName; // edx@4 | |
625 signed int v3; // edx@5 | |
626 char *v4; // edi@9 | |
627 int pTextHeight; // eax@45 | |
628 int v6; // edi@45 | |
629 char *v7; // eax@45 | |
630 int v8; // edi@46 | |
631 int v9; // eax@50 | |
632 unsigned int v10; // [sp-10h] [bp-C8h]@53 | |
633 char *pTitleText; // [sp-8h] [bp-C0h]@50 | |
634 GUIWindow pDialogWindow; // [sp+Ch] [bp-ACh]@4 | |
635 GUIWindow pWindow; // [sp+60h] [bp-58h]@2 | |
636 int pColor2; // [sp+B4h] [bp-4h]@2 | |
637 | |
638 if ( !window_SpeakInHouse ) | |
639 return; | |
640 memcpy(&pWindow, this, sizeof(pWindow)); | |
641 pWindow.uFrameWidth -= 18; | |
642 pWindow.uFrameZ -= 18; | |
643 pWhiteColor = Color16(0xFFu, 0xFFu, 0xFFu); | |
644 pColor2 = Color16(0x15u, 0x99u, 0xE9u); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
645 pRenderer->DrawTextureTransparentColorKey(0x1DDu, 0, pTexture_Dialogue_Background); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
646 pRenderer->DrawTextureAlphaNew(468, 0, game_ui_right_panel_frame); |
2502 | 647 if ( pDialogueNPCCount != uNumDialogueNPCPortraits || !uHouse_ExitPic ) |
648 { | |
649 pDialogWindow.uFrameWidth = 130; | |
650 pDialogWindow.uFrameHeight = 2 * LOBYTE(pFontCreate->uFontHeight); | |
651 pHouseName = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName; | |
652 if ( pHouseName ) | |
653 { | |
654 v3 = 2 * LOBYTE(pFontCreate->uFontHeight) - 6 - pFontCreate->CalcTextHeight(pHouseName, &pDialogWindow, 0, 0); | |
655 if ( v3 < 0 ) | |
656 v3 = 0; | |
657 pWindow.DrawTitleText(pFontCreate, 0x1EAu, v3 / 2 + 4, pWhiteColor, | |
658 //(const char *)p2DEvents_minus1_::04[13 * (unsigned int)ptr_507BC0->ptr_1C], | |
659 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pName, 3); | |
660 } | |
661 } | |
662 pWindow.uFrameWidth += 8; | |
663 pWindow.uFrameZ += 8; | |
664 if ( !pDialogueNPCCount ) | |
665 { | |
666 if ( in_current_building_type == BuildingType_Jail ) | |
667 { | |
668 JailDialog(); | |
669 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
670 { | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
671 pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
672 pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); |
2502 | 673 } |
674 else | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
675 pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background); |
2502 | 676 return; |
677 } | |
678 if ( current_npc_text ) | |
679 { | |
680 pDialogWindow.uFrameWidth = 458; | |
681 pDialogWindow.uFrameZ = 457; | |
682 pTextHeight = pFontArrus->CalcTextHeight(current_npc_text, &pDialogWindow, 13, 0); | |
683 v6 = pTextHeight + 7; | |
684 pRenderer->GetLeather(8, 352 - (pTextHeight + 7), &pIcons_LOD->pTextures[uTextureID_Leather], | |
685 pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - (pTextHeight + 7)); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
686 pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - v6)/480.0f, _591428_endcap); |
2502 | 687 v7 = FitTextInAWindow(current_npc_text, pFontArrus, &pDialogWindow, 0xDu, 0); |
688 window_SpeakInHouse->DrawText(pFontArrus, 13, 354 - v6, 0, v7, 0, 0, 0); | |
689 } | |
690 if ( uNumDialogueNPCPortraits <= 0 ) | |
691 { | |
692 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
693 { | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
694 pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
695 pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); |
2502 | 696 } |
697 else | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
698 pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background); |
2502 | 699 return; |
700 } | |
701 for ( v8 = 0; v8 < uNumDialogueNPCPortraits; ++v8 ) | |
702 { | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
703 pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4, |
2502 | 704 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
705 pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8], |
2502 | 706 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8], pDialogueNPCPortraits[v8]); |
707 if ( uNumDialogueNPCPortraits < 4 ) | |
708 { | |
709 if ( v8 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
710 { | |
711 pTitleText = pMapStats->pInfos[uHouse_ExitPic].pName; | |
712 v9 = 94 * v8 + 113; | |
713 } | |
714 else | |
715 { | |
716 if ( !v8 && dword_591080 ) | |
717 { | |
718 pTitleText = (char *)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle; | |
719 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 113, pColor2, pTitleText, 3); | |
720 continue; | |
721 } | |
722 pTitleText = HouseNPCData[v8 +1 - (dword_591080 != 0)]->pName; | |
723 v9 = pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2; | |
724 } | |
725 v10 = v9; | |
726 pWindow.DrawTitleText(pFontCreate, 483, v10, pColor2, pTitleText, 3); | |
727 } | |
728 } | |
729 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
730 { | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
731 pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
732 pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); |
2502 | 733 } |
734 else | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
735 pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background); |
2502 | 736 return; |
737 } | |
738 v4 = (char *)pDialogueNPCCount - 1; | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
739 pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
740 pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[(signed int)v4]); |
2541 | 741 if ( current_screen_type == SCREEN_E ) |
2502 | 742 { |
743 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | |
744 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
745 { | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
746 pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
747 pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); |
2502 | 748 } |
749 else | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
750 pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background); |
2502 | 751 return; |
752 } | |
753 if ( v4 || !dword_591080 )//на изумрудном острове заходит на корабле пока не выполнены квесты | |
754 SimpleHouseDialog(); | |
755 else | |
756 { | |
757 sprintfex( pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], | |
758 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterName, | |
759 p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].pProprieterTitle); | |
760 pWindow.DrawTitleText(pFontCreate, 0x1E3u, 0x71u, pColor2, pTmpBuf.data(), 3); | |
761 switch ( in_current_building_type ) | |
762 { | |
763 case BuildingType_WeaponShop: | |
764 WeaponShopDialog(); | |
765 break; | |
766 case BuildingType_ArmorShop: | |
767 ArmorShopDialog(); | |
768 break; | |
769 case BuildingType_MagicShop: | |
770 MagicShopDialog(); | |
771 break; | |
772 case BuildingType_AlchemistShop: | |
773 AlchemistDialog(); | |
774 break; | |
775 case BuildingType_FireGuild: | |
776 case BuildingType_AirGuild: | |
777 case BuildingType_WaterGuild: | |
778 case BuildingType_EarthGuild: | |
779 case BuildingType_SpiritGuild: | |
780 case BuildingType_MindGuild: | |
781 case BuildingType_BodyGuild: | |
782 case BuildingType_LightGuild: | |
783 case BuildingType_DarkGuild: | |
784 GuildDialog(); | |
785 break; | |
786 case BuildingType_18: | |
787 __debugbreak(); //What over the dialog? | |
788 sub_4B6478(); | |
789 break; | |
790 case BuildingType_TownHall: | |
791 TownHallDialog(); | |
792 break; | |
793 case BuildingType_Tavern: | |
794 TavernDialog(); | |
795 break; | |
796 case BuildingType_Bank: | |
797 BankDialog(); | |
798 break; | |
799 case BuildingType_Temple: | |
800 TempleDialog(); | |
801 break; | |
802 case BuildingType_Stables: | |
803 case BuildingType_Boats: | |
804 TravelByTransport(); | |
805 break; | |
806 case BuildingType_Training: | |
807 TrainingDialog(); | |
808 break; | |
809 case BuildingType_Jail: | |
810 JailDialog(); | |
811 break; | |
812 default: | |
813 //__debugbreak();//New BuildingType (if enter Boat) | |
814 break; | |
815 } | |
816 } | |
817 if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) | |
818 { | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
819 pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
820 pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]); |
2502 | 821 } |
822 else | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
823 pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background); |
2502 | 824 } |
825 | |
826 //----- (004B1854) -------------------------------------------------------- | |
827 void GUIWindow::DrawShops_next_generation_time_string( __int64 next_generation_time ) | |
828 { | |
829 unsigned int full_time; // esi@1 | |
830 signed __int64 hours; // kr00_8@1 | |
831 const char *text; // eax@2 | |
832 signed __int64 minutes; // [sp+Ch] [bp-10h]@1 | |
833 signed __int64 seconds; // [sp+14h] [bp-8h]@1 | |
834 unsigned int days; // [sp+20h] [bp+4h]@1 | |
835 | |
836 full_time = (signed __int64)((double)next_generation_time * 0.234375); | |
837 seconds = (signed __int64)full_time % 60; | |
838 minutes = (signed __int64)(full_time / 60) % 60; | |
839 hours = ((full_time / 60) / 60) % 24; | |
840 days = (unsigned int)((full_time / 60) / 60) / 24; | |
841 strcpy(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[532]); | |
842 if ( days ) | |
843 { | |
844 text = pGlobalTXT_LocalizationStrings[57];//Days | |
845 if ( days <= 1 ) | |
846 text = pGlobalTXT_LocalizationStrings[56];//Day | |
847 sprintfex(pTmpBuf2.data(), "%d %s ", days, text); | |
848 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
849 } | |
850 if ( hours ) | |
851 { | |
852 if ( hours <= 1 ) | |
853 text = pGlobalTXT_LocalizationStrings[109];//Hour | |
854 else | |
855 text = pGlobalTXT_LocalizationStrings[110];//Hours | |
856 sprintfex(pTmpBuf2.data(), "%d %s ", (int)hours, text); | |
857 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
858 } | |
859 if ( minutes && !days ) | |
860 { | |
861 if ( minutes <= 1 ) | |
862 text = pGlobalTXT_LocalizationStrings[437];//"Minute" | |
863 else | |
864 text = pGlobalTXT_LocalizationStrings[436]; //"Minutes" | |
865 sprintfex(pTmpBuf2.data(), "%d %s ", (int)minutes, text); | |
866 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
867 } | |
868 if ( seconds && !hours ) | |
869 { | |
870 if ( seconds <= 1 ) | |
871 text = pGlobalTXT_LocalizationStrings[439]; //"Second" | |
872 else | |
873 text = pGlobalTXT_LocalizationStrings[438]; //"Seconds" | |
874 sprintfex(pTmpBuf2.data(), "%d %s ", (int)seconds, text); | |
875 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
876 } | |
877 this->DrawTitleText(pFontArrus, 0, (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), this, 0, 0)) / 2 + 101, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); | |
878 } | |
879 | |
880 //----- (0044D406) -------------------------------------------------------- | |
881 void GUIWindow::DrawTitleText( GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, | |
882 const char *pInString, unsigned int uLineSpacing ) | |
883 { | |
884 //GUIWindow *pWindow; // esi@1 | |
885 unsigned int v8; // ebx@1 | |
886 char *v9; // eax@1 | |
887 unsigned int v11; // edi@1 | |
888 signed int v12; // esi@1 | |
889 int v13; // eax@2 | |
890 GUIFont *pFont; // [sp+Ch] [bp-4h]@1 | |
891 const char *Stra; // [sp+24h] [bp+14h]@5 | |
892 | |
893 //pWindow = this; | |
894 pFont = a2; | |
895 v8 = this->uFrameWidth - uHorizontalMargin; | |
896 ui_current_text_color = uDefaultColor; | |
897 v9 = FitTextInAWindow(pInString, a2, this, uHorizontalMargin, 0); | |
898 Stra = strtok(v9, "\n"); | |
899 v11 = uHorizontalMargin + this->uFrameX; | |
900 v12 = uVerticalMargin + this->uFrameY; | |
901 while ( 1 ) | |
902 { | |
903 if ( !Stra ) | |
904 break; | |
905 v13 = (signed int)(v8 - pFont->GetLineWidth(Stra)) >> 1; | |
906 if ( v13 < 0 ) | |
907 v13 = 0; | |
908 pFont->DrawTextLine(uDefaultColor, v11 + v13, v12, Stra, window->GetWidth()); | |
909 v12 += pFont->uFontHeight - uLineSpacing; | |
910 Stra = strtok(0, "\n"); | |
911 } | |
912 } | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
913 |
2502 | 914 |
915 //----- (0044CE08) -------------------------------------------------------- | |
2529 | 916 void GUIWindow::DrawText(GUIFont *font, signed int uX, int uY, unsigned short uFontColor, const char *Str, bool present_time_transparency, int max_text_height, signed int uFontShadowColor ) |
2532 | 917 { |
2502 | 918 int v14; // edx@9 |
919 char Dest[6]; // [sp+Ch] [bp-2Ch]@32 | |
920 size_t v30; // [sp+2Ch] [bp-Ch]@4 | |
2528 | 921 |
2529 | 922 int left_margin = 0; |
2502 | 923 if ( !Str ) |
924 { | |
925 MessageBoxW(nullptr, L"Invalid string passed!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Font.cpp:859", 0); | |
926 return; | |
927 } | |
2528 | 928 if (!strcmp(Str, "null")) |
929 return; | |
930 | |
2532 | 931 v30 = strlen(Str); |
932 if ( !uX ) | |
933 uX = 12; | |
2528 | 934 |
2532 | 935 const char *string_begin = Str; |
936 if ( max_text_height == 0 ) | |
937 string_begin = FitTextInAWindow(Str, font, this, uX, 0); | |
938 auto string_end = string_begin; | |
939 auto string_base = string_begin; | |
2528 | 940 |
2532 | 941 int out_x = uX + uFrameX; |
942 int out_y = uY + uFrameY; | |
943 v14 = 0; | |
944 | |
945 if (max_text_height != 0 && out_y + LOBYTE(font->uFontHeight) > max_text_height) | |
946 return; | |
2528 | 947 |
2532 | 948 if ( (signed int)v30 > 0 ) |
949 { | |
950 do | |
951 { | |
952 unsigned char c = string_base[v14]; | |
953 if ( c >= font->cFirstChar && c <= font->cLastChar | |
954 || c == '\f' | |
955 || c == '\r' | |
956 || c == '\t' | |
957 || c == '\n' ) | |
2502 | 958 { |
2532 | 959 switch ( c ) |
2502 | 960 { |
2532 | 961 case '\t': |
962 strncpy(Dest, &string_base[v14 + 1], 3); | |
963 Dest[3] = 0; | |
964 v14 += 3; | |
965 left_margin = atoi(Dest); | |
966 out_x = uX + uFrameX + left_margin; | |
967 break; | |
968 case '\n': | |
969 uY = uY + LOBYTE(font->uFontHeight) - 3; | |
970 out_y = uY + uFrameY; | |
971 out_x = uX + uFrameX + left_margin; | |
972 if ( max_text_height != 0 ) | |
2502 | 973 { |
2532 | 974 if (LOBYTE(font->uFontHeight) + out_y - 3 > max_text_height ) |
975 return; | |
976 } | |
977 break; | |
978 case '\f': | |
979 strncpy(Dest, &string_base[v14 + 1], 5); | |
980 Dest[5] = 0; | |
981 uFontColor = atoi(Dest); | |
982 v14 += 5; | |
983 break; | |
984 case '\r': | |
985 strncpy(Dest, &string_base[v14 + 1], 3); | |
986 Dest[3] = 0; | |
987 v14 += 3; | |
988 left_margin = atoi(Dest); | |
989 out_x = uFrameZ - font->GetLineWidth(&string_base[v14]) - left_margin; | |
990 out_y = uY + uFrameY; | |
991 if ( max_text_height != 0 ) | |
992 { | |
993 if (LOBYTE(font->uFontHeight) + out_y - 3 > max_text_height ) | |
994 return; | |
995 break; | |
996 } | |
997 break; | |
2529 | 998 |
2532 | 999 default: |
1000 if (c == '\"' && string_base[v14 + 1] == '\"') | |
1001 ++v14; | |
2529 | 1002 |
2532 | 1003 c = (unsigned __int8)string_base[v14]; |
1004 if ( v14 > 0 ) | |
1005 out_x += font->pMetrics[c].uLeftSpacing; | |
2529 | 1006 |
2532 | 1007 unsigned char *letter_pixels = &font->pFontData[font->font_pixels_offset[c]]; |
1008 if ( uFontColor ) | |
1009 pRenderer->DrawText(out_x, out_y, letter_pixels, font->pMetrics[c].uWidth, LOBYTE(font->uFontHeight), | |
1010 font->pFontPalettes[0], uFontColor, uFontShadowColor); | |
1011 else | |
1012 pRenderer->DrawTextAlpha(out_x, out_y, letter_pixels, font->pMetrics[c].uWidth, LOBYTE(font->uFontHeight), | |
1013 font->pFontPalettes[0], present_time_transparency); | |
2529 | 1014 |
2532 | 1015 out_x += font->pMetrics[c].uWidth; |
1016 if ( (signed int)v14 < (signed int)v30 ) | |
1017 out_x += font->pMetrics[c].uRightSpacing; | |
1018 break; | |
2502 | 1019 } |
1020 } | |
1021 } | |
2532 | 1022 while ( (signed int)++v14 < (signed int)v30 ); |
1023 } | |
2502 | 1024 } |
1025 | |
1026 //----- (0044CB4F) -------------------------------------------------------- | |
1027 int GUIWindow::DrawTextInRect( GUIFont *pFont, unsigned int uX, unsigned int uY, unsigned int uColor, const char *text, int rect_width, int reverse_text ) | |
1028 { | |
1029 int pLineWidth; // ebx@1 | |
1030 int text_width; // esi@3 | |
1031 unsigned __int8 v12; // cl@7 | |
1032 signed int v13; // esi@19 | |
1033 signed int v14; // ebx@19 | |
1034 unsigned __int8 v15; // cl@21 | |
1035 // int v16; // eax@22 | |
1036 // int v17; // ecx@22 | |
1037 // int v18; // ecx@23 | |
1038 // int v19; // ecx@24 | |
1039 unsigned int v20; // ecx@26 | |
1040 unsigned char* v21; // eax@28 | |
1041 // int v22; // ebx@34 | |
1042 int v23; // eax@34 | |
1043 int v24; // ebx@36 | |
1044 char Str[6]; // [sp+Ch] [bp-20h]@34 | |
1045 // char v26; // [sp+Fh] [bp-1Dh]@34 | |
1046 // char v27; // [sp+11h] [bp-1Bh]@35 | |
1047 int v28; // [sp+20h] [bp-Ch]@17 | |
1048 GUIWindow *pWindow; // [sp+24h] [bp-8h]@1 | |
1049 size_t pNumLen; // [sp+28h] [bp-4h]@1 | |
1050 size_t Str1a; // [sp+40h] [bp+14h]@5 | |
1051 // size_t Str1b; // [sp+40h] [bp+14h]@19 | |
1052 // const char *Sourcea; // [sp+44h] [bp+18h]@20 | |
1053 // int v34; // [sp+48h] [bp+1Ch]@26 | |
1054 int i; | |
1055 | |
1056 | |
1057 pWindow = this; | |
1058 pNumLen = strlen(text); | |
1059 pLineWidth = pFont->GetLineWidth(text); | |
1060 if ( pLineWidth < rect_width ) | |
1061 { | |
1062 pWindow->DrawText(pFont, uX, uY, uColor, text, 0, 0, 0); | |
1063 return pLineWidth; | |
1064 } | |
1065 strcpy(pTmpBuf2.data(), text); | |
1066 text_width = 0; | |
1067 if ( reverse_text ) | |
1068 _strrev(pTmpBuf2.data()); | |
1069 Str1a = 0; | |
1070 for ( i = 0; i < pNumLen; ++i ) | |
1071 { | |
1072 if ( text_width >= rect_width ) | |
1073 break; | |
1074 v12 = pTmpBuf2[i]; | |
1075 if ( pFont->IsCharValid(v12) ) | |
1076 { | |
1077 switch (v12) | |
1078 { | |
1079 case '\t':// Horizontal tab 09 | |
1080 case '\n': //Line Feed 0A 10 | |
1081 case '\r': //Form Feed, page eject 0C 12 | |
1082 break; | |
1083 case '\f': //Carriage Return 0D 13 | |
1084 i += 5; | |
1085 break; | |
1086 default: | |
1087 if ( i > 0 ) | |
1088 text_width += pFont->pMetrics[v12].uLeftSpacing; | |
1089 text_width += pFont->pMetrics[v12].uWidth; | |
1090 if ( i < pNumLen ) | |
1091 text_width += pFont->pMetrics[v12].uRightSpacing; | |
1092 } | |
1093 } | |
1094 } | |
1095 pTmpBuf2[i - 1] = 0; | |
1096 | |
1097 | |
1098 pNumLen = strlen(pTmpBuf2.data()); | |
1099 v28 = pFont->GetLineWidth(pTmpBuf2.data()); | |
1100 if ( reverse_text ) | |
1101 _strrev(pTmpBuf2.data()); | |
1102 | |
1103 v13 = uX + pWindow->uFrameX; | |
1104 v14 = uY + pWindow->uFrameY; | |
1105 for (i=0; i<pNumLen; ++i) | |
1106 { | |
1107 v15 = pTmpBuf2[i]; | |
1108 if ( pFont->IsCharValid(v15) ) | |
1109 { | |
1110 switch (v12) | |
1111 { | |
1112 case '\t':// Horizontal tab 09 | |
1113 { | |
1114 strncpy(Str, &pTmpBuf2[i+1], 3); | |
1115 Str[3] = 0; | |
1116 // atoi(Str); | |
1117 i += 3; | |
1118 break; | |
1119 } | |
1120 case '\n': //Line Feed 0A 10 | |
1121 { | |
1122 v24 = pFont->uFontHeight; | |
1123 v13 = uX; | |
1124 uY = uY + pFont->uFontHeight - 3; | |
1125 v14 = uY+pFont->uFontHeight - 3; | |
1126 break; | |
1127 } | |
1128 case '\r': //Form Feed, page eject 0C 12 | |
1129 { | |
1130 strncpy(Str, &pTmpBuf2[i+1], 5); | |
1131 Str[5] = 0; | |
1132 i += 5; | |
1133 uColor = atoi(Str); | |
1134 break; | |
1135 } | |
1136 case '\f': //Carriage Return 0D 13 | |
1137 { | |
1138 strncpy(Str, &pTmpBuf2[i+1], 3); | |
1139 Str[3] = 0; | |
1140 i += 3; | |
1141 v23 = pFont->GetLineWidth(&pTmpBuf2[i]); | |
1142 v13 = pWindow->uFrameZ - v23 - atoi(Str); | |
1143 v14 = uY; | |
1144 break; | |
1145 } | |
1146 default: | |
1147 v20 = pFont->pMetrics[v15].uWidth; | |
1148 if ( i > 0 ) | |
1149 v13 += pFont->pMetrics[v15].uLeftSpacing; | |
1150 v21 = &pFont->pFontData[pFont->font_pixels_offset[v15]]; | |
1151 if ( uColor ) | |
1152 pRenderer->DrawText(v13, v14, v21, v20, pFont->uFontHeight, pFont->pFontPalettes[0], uColor, 0); | |
1153 else | |
2525 | 1154 pRenderer->DrawTextAlpha(v13, v14, v21, v20, pFont->uFontHeight, pFont->pFontPalettes[0], false); |
2502 | 1155 v13 += v20; |
1156 if ( i < (signed int)pNumLen ) | |
1157 v13 += pFont->pMetrics[v15].uRightSpacing; | |
1158 } | |
1159 } | |
1160 } | |
1161 return v28; | |
1162 } | |
1163 | |
1164 //----- (0041D12F) -------------------------------------------------------- | |
1165 GUIButton *GUIWindow::CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, | |
1166 int a6, int a7, UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, Texture *pTextures, ...) | |
1167 { | |
1168 GUIButton *pButton; // esi@1 | |
1169 // unsigned int v13; // eax@1 | |
1170 // unsigned int v14; // ebx@4 | |
1171 // unsigned int v15; // eax@4 | |
1172 unsigned int TextureNum=0; // ebx@4 | |
1173 // unsigned int v17; // eax@4 | |
1174 // Texture *v18; // eax@4 | |
1175 // Texture **v19; // ecx@5 | |
1176 // Texture **v20; // edx@5 | |
1177 // GUIButton *v21; // eax@7 | |
1178 va_list texturs_ptr; | |
1179 | |
1180 pButton = (GUIButton *)malloc(0xBC); | |
1181 pButton->pParent = this; | |
1182 pButton->uWidth = uWidth; | |
1183 pButton->uHeight = uHeight; | |
1184 | |
1185 if ( a6 == 2 && !uHeight ) | |
1186 pButton->uHeight = uWidth; | |
1187 | |
1188 pButton->uButtonType = a6; | |
1189 pButton->uX = uX + this->uFrameX; | |
1190 pButton->uY = uY + this->uFrameY; | |
1191 pButton->uZ = pButton->uX + uWidth - 1; | |
1192 pButton->uW = pButton->uY + uHeight - 1; | |
1193 pButton->field_2C_is_pushed = 0; | |
1194 pButton->field_1C = a7; | |
1195 pButton->msg = msg; | |
1196 pButton->msg_param = msg_param; | |
1197 pButton->uHotkey = uHotkey; | |
1198 //strlen(pName); | |
1199 strcpy(pButton->pButtonName, pName); | |
1200 va_start(texturs_ptr, pName); | |
1201 while (NULL!=(pTextures=va_arg(texturs_ptr, Texture *))) | |
1202 { | |
1203 pButton->pTextures[TextureNum]=pTextures; | |
1204 ++TextureNum; | |
1205 } | |
1206 va_end(texturs_ptr); | |
1207 pButton->uNumTextures = TextureNum; | |
1208 if ( this->pControlsTail ) | |
1209 this->pControlsTail->pNext = pButton; | |
1210 else | |
1211 this->pControlsHead = pButton; | |
1212 pButton->pPrev = this->pControlsTail; | |
1213 this->pControlsTail = pButton; | |
1214 pButton->pNext = 0; | |
1215 ++this->uNumControls; | |
1216 return pButton; | |
1217 } | |
1218 | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1219 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1220 void GUIWindow::InitializeGUI() |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1221 { |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1222 SetUserInterface(PartyAlignment_Neutral, false); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1223 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1224 for (uint i = 0; i < 20; ++i) |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1225 pWindowList[i] = nullptr; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1226 uNumVisibleWindows = -1; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1227 memset(pVisibleWindowsIdxs.data(), 0, sizeof(pVisibleWindowsIdxs)); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1228 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1229 MainMenuUI_LoadFontsAndSomeStuff(); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1230 } |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1231 |
2502 | 1232 //----- (00459C2B) -------------------------------------------------------- |
1233 void GUIWindow::DrawFlashingInputCursor( signed int uX, int uY, struct GUIFont *a2 ) | |
1234 { | |
1235 if ( GetTickCount() % 1000 > 500 ) | |
1236 DrawText(a2, uX, uY, 0, "_", 0, 0, 0); | |
1237 } | |
1238 | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1239 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1240 GUIWindow::GUIWindow() : |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1241 uNumControls(0), |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1242 pControlsHead(nullptr), |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1243 pControlsTail(nullptr), |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1244 eWindowType(WINDOW_null) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1245 {} |
2502 | 1246 |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1247 //----- (0041C432) -------------------------------------------------------- |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1248 GUIWindow::GUIWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, int pButton, const char* hint) : |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1249 uNumControls(0), |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1250 pControlsHead(nullptr), |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1251 pControlsTail(nullptr), |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1252 eWindowType(WINDOW_MainMenu) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1253 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1254 unsigned int uNextFreeWindowID; // ebp@1 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1255 //int *v8; // eax@1 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1256 //GUIWindow *pWindow; // esi@4 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1257 //int v10; // eax@4 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1258 unsigned int v11; // ebx@15 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1259 NPCData *speakingNPC; // ebp@15 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1260 int v14; // eax@20 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1261 int v16; // eax@25 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1262 int v18; // eax@30 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1263 int v20; // eax@35 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1264 int v22; // eax@40 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1265 int v24; // eax@45 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1266 // int v25; // eax@65 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1267 unsigned int v26; // ebx@65 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1268 char *v27; // eax@71 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1269 const char *v29; // [sp-8h] [bp-18h]@68 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1270 char *v30; // [sp-4h] [bp-14h]@68 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1271 // int uWidtha; // [sp+14h] [bp+4h]@66 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1272 int num_menu_buttons; // [sp+20h] [bp+10h]@15 |
2502 | 1273 |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1274 for (uNextFreeWindowID = 0; uNextFreeWindowID < 20; ++uNextFreeWindowID) |
2502 | 1275 { |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1276 if (pWindowList[uNextFreeWindowID] == nullptr) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1277 break; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1278 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1279 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1280 //GUIWindow* pWindow = &pWindowList[uNextFreeWindowID]; |
2557 | 1281 pWindowList[uNextFreeWindowID] = this;//sometimes uNextFreeWindowID == 20. it's result crash |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1282 this->uFrameWidth = uWidth; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1283 this->uFrameHeight = uHeight; |
2502 | 1284 |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1285 this->uFrameX = uX; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1286 this->uFrameY = uY; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1287 this->uFrameZ = uX + uWidth - 1; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1288 this->uFrameW = uY + uHeight - 1; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1289 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1290 this->ptr_1C = (void *)pButton; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1291 this->Hint = hint; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1292 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1293 //this->eWindowType = eWindowType; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1294 this->receives_keyboard_input = false; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1295 ++uNumVisibleWindows; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1296 this->numVisibleWindows = uNumVisibleWindows; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1297 pVisibleWindowsIdxs[uNumVisibleWindows] = uNextFreeWindowID + 1; |
2502 | 1298 } |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1299 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1300 |
2502 | 1301 //----- (004B3EF0) -------------------------------------------------------- |
1302 void DrawJoinGuildWindow( int pEventCode ) | |
1303 { | |
1304 uDialogueType = 81;//enum JoinGuildDialog | |
1305 current_npc_text = (char *)pNPCTopics[pEventCode + 99].pText; | |
1306 ContractSelectText(pEventCode); | |
1307 pDialogueWindow->Release(); | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1308 pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 350, pEventCode, 0); |
2502 | 1309 pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); // Cancel |
1310 pDialogueWindow->CreateButton( 0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1311 pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_ClickNPCTopic, 82, 0, pGlobalTXT_LocalizationStrings[122], 0); |
2502 | 1312 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); |
1313 dialog_menu_id = HOUSE_DIALOGUE_OTHER; | |
1314 } | |
1315 //----- (0044603D) -------------------------------------------------------- | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1316 void DialogueEnding() |
2502 | 1317 { |
1318 sDialogue_SpeakingActorNPC_ID = 0; | |
1319 pDialogueWindow->Release(); | |
1320 pDialogueWindow = 0; | |
1321 pMiscTimer->Resume(); | |
1322 pEventTimer->Resume(); | |
1323 } | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1324 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1325 |
2548
87e5590d034b
All Books windows are refactored into respective classes
a.parshin
parents:
2547
diff
changeset
|
1326 void GUIWindow_BooksButtonOverlay::Update() |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1327 { |
2546 | 1328 // ----------------------------------- |
1329 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1330 auto pButton = (GUIButton *)ptr_1C; |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1331 pRenderer->DrawTextureTransparentColorKey(uFrameY, uFrameX, pButton->pTextures[0]); |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1332 viewparams->bRedrawGameUI = true; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1333 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1334 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1335 void GUIWindow_Dialogue::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1336 { |
2546 | 1337 // ----------------------------------- |
1338 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1339 GameUI_DrawDialogue(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1340 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1341 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1342 void GUIWindow_GenericDialogue::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1343 { |
2546 | 1344 // ----------------------------------- |
1345 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1346 GameUI_DrawBranchlessDialogue(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1347 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1348 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1349 void GUIWindow_House::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1350 { |
2546 | 1351 // ----------------------------------- |
1352 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1353 HouseDialogManager(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1354 if (!window_SpeakInHouse) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1355 return; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1356 if (window_SpeakInHouse->par1C >= 53) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1357 return; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1358 if (pParty->PartyTimes._shop_ban_times[window_SpeakInHouse->par1C] <= pParty->uTimePlayed) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1359 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1360 if (window_SpeakInHouse->par1C < 53) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1361 pParty->PartyTimes._shop_ban_times[window_SpeakInHouse->par1C] = 0; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1362 return; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1363 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1364 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1365 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1366 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1367 void GUIWindow_Scroll::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1368 { |
2546 | 1369 // ----------------------------------- |
1370 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1371 CreateScrollWindow(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1372 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1373 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1374 void GUIWindow_Inventory::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1375 { |
2546 | 1376 // ----------------------------------- |
1377 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1378 DrawMessageBox(0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1379 DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1380 DrawText(pFontLucida, 10, 40, 0, pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1381 if (!pKeyActionMap->field_204) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1382 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1383 ItemGen ItemGen2; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1384 ItemGen2.Reset(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1385 Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1386 pEventTimer->Resume(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1387 current_screen_type = SCREEN_GAME; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1388 viewparams->bRedrawGameUI = 1; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1389 int v39 = atoi(pKeyActionMap->pPressedKeysBuffer); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1390 if (v39 > 0 && v39 < 800) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1391 SpawnActor(v39); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1392 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1393 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1394 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1395 void GUIWindow_Inventory_CastSpell::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1396 { |
2546 | 1397 // ----------------------------------- |
1398 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1399 pRenderer->ClearZBuffer(0, 479); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1400 draw_leather(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1401 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1402 CharacterUI_DrawPaperdoll(pPlayers[uActiveCharacter]); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1403 pRenderer->DrawTextureIndexedAlpha(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u)); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1404 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1405 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1406 void OnButtonClick::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1407 { |
2546 | 1408 // ----------------------------------- |
1409 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1410 if (Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1411 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1412 GUIButton *pButton = (GUIButton *)ptr_1C; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1413 pRenderer->DrawTextureIndexedAlpha(uFrameX, uFrameY, pButton->pTextures[0]); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1414 viewparams->bRedrawGameUI = true; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1415 if (Hint && Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1416 pButton->DrawLabel(Hint, pFontCreate, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1417 Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1418 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1419 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1420 void OnButtonClick2::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1421 { |
2546 | 1422 // ----------------------------------- |
1423 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1424 if (Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1425 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1426 GUIButton *pButton = (GUIButton *)ptr_1C; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1427 if (pButton->uX >= 0 && pButton->uX <= window->GetWidth()) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1428 { |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1429 if (pButton->uY >= 0 && pButton->uY <= window->GetHeight()) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1430 { |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1431 pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[0]); |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1432 viewparams->bRedrawGameUI = true; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1433 if (Hint && Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1434 pButton->DrawLabel(Hint, pFontCreate, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1435 Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1436 return; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1437 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1438 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1439 viewparams->bRedrawGameUI = true; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1440 if (Hint && Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1441 pButton->DrawLabel(Hint, pFontCreate, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1442 Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1443 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1444 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1445 void OnButtonClick3::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1446 { |
2546 | 1447 // ----------------------------------- |
1448 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1449 if (Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1450 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1451 auto pButton = (GUIButton *)ptr_1C; |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1452 pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[1]); |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1453 viewparams->bRedrawGameUI = 1; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1454 if (Hint && Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1455 pButton->DrawLabel(Hint, pFontCreate, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1456 Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1457 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1458 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1459 void OnButtonClick4::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1460 { |
2546 | 1461 // ----------------------------------- |
1462 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1463 if (Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1464 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1465 auto pButton = (GUIButton *)ptr_1C; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1466 pRenderer->DrawTextureIndexedAlpha(uFrameX, uFrameY, pButton->pTextures[1]); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1467 viewparams->bRedrawGameUI = true; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1468 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1469 Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1470 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1471 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1472 void OnSaveLoad::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1473 { |
2546 | 1474 // ----------------------------------- |
1475 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1476 if (Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1477 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1478 auto pButton = (GUIButton *)ptr_1C; |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1479 pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[0]); |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1480 viewparams->bRedrawGameUI = true; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1481 if (Hint && Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1482 pButton->DrawLabel(Hint, pFontCreate, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1483 Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1484 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1485 if (current_screen_type == SCREEN_SAVEGAME) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1486 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_SaveGame, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1487 else |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1488 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_LoadGame, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1489 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1490 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1491 void OnCancel::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1492 { |
2546 | 1493 // ----------------------------------- |
1494 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1495 if (Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1496 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1497 auto pGUIButton = (GUIButton *)ptr_1C; |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1498 pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pGUIButton->pTextures[0]); |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1499 viewparams->bRedrawGameUI = true; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1500 if (Hint && Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1501 pGUIButton->DrawLabel(Hint, pFontCreate, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1502 Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1503 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1504 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1505 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1506 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1507 void OnCancel2::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1508 { |
2546 | 1509 // ----------------------------------- |
1510 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1511 if (Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1512 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1513 auto pButton = (GUIButton *)ptr_1C; |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1514 pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[1]); |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1515 viewparams->bRedrawGameUI = true; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1516 if (Hint && Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1517 pButton->DrawLabel(Hint, pFontCreate, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1518 Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1519 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1520 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1521 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1522 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1523 void OnCancel3::Update() |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1524 { |
2546 | 1525 // ----------------------------------- |
1526 // 004156F0 GUI_UpdateWindows --- part | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1527 if (Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1528 pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1529 auto pButton = (GUIButton *)ptr_1C; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1530 pRenderer->DrawTextureIndexedAlpha(uFrameX, uFrameY, pButton->pTextures[0]); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1531 viewparams->bRedrawGameUI = true; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1532 if (Hint && Hint != (char *)1) |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1533 pButton->DrawLabel(Hint, pFontCreate, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1534 Release(); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1535 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1536 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1537 } |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1538 |
2502 | 1539 //----- (004156F0) -------------------------------------------------------- |
1540 void GUI_UpdateWindows() | |
1541 { | |
1542 GUIWindow *pWindow; // esi@4 | |
1543 //unsigned int pWindowType; // eax@4 | |
1544 const char *pHint; // edx@66 | |
1545 // GUIButton *pButtonPtr_1C; // ebp@79 | |
1546 // char *pHint1; // edx@80 | |
1547 int v26; // eax@98 | |
1548 unsigned int v27; // ebp@106 | |
1549 GUIWindow *pGUIWindow2; // ecx@109 | |
1550 // GUIFont *pGUIFont; // ST1C_4@115 | |
1551 int v31; // eax@115 | |
1552 GUIButton *pButton; // ebp@118 | |
1553 int v39; // eax@129 | |
1554 GUIButton *pGUIButton; // ebp@146 | |
1555 //unsigned int pX; // [sp-1Ch] [bp-124h]@17 | |
1556 //unsigned int pY; // [sp-18h] [bp-120h]@17 | |
1557 //Texture *pTexture; // [sp-14h] [bp-11Ch]@17 | |
1558 //Texture *pTexture2; // [sp-14h] [bp-11Ch]@86 | |
1559 int i; // [sp+0h] [bp-108h]@3 | |
1560 // ItemGen pItemGen; // [sp+4h] [bp-104h]@98 | |
1561 GUIButton GUIButton2; // [sp+28h] [bp-E0h]@133 | |
1562 ItemGen ItemGen2; // [sp+E4h] [bp-24h]@129 | |
1563 | |
1564 if (GetCurrentMenuID() != MENU_CREATEPARTY) | |
1565 Mouse::UI_OnKeyDown(VK_NEXT); | |
1566 | |
1567 for ( i = 1; i <= uNumVisibleWindows; ++i ) | |
1568 { | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1569 pWindow = pWindowList[pVisibleWindowsIdxs[i] - 1]; |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1570 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1571 pWindow->Update(); |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1572 /*switch (pWindow->eWindowType) |
2502 | 1573 { |
1574 case WINDOW_50: | |
1575 { | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1576 __debugbreak(); // looks like debugging tools |
2502 | 1577 v27 = Color16(255, 255, 255); |
1578 if ( ptr_507BD0->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS) | |
1579 { | |
1580 ptr_507BD0->DrawMessageBox(0); | |
1581 ptr_507BD0->DrawText(pFontCreate, 30, 40, v27, pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | |
1582 v31 = pFontCreate->GetLineWidth(pKeyActionMap->pPressedKeysBuffer); | |
1583 ptr_507BD0->DrawFlashingInputCursor(v31 + 30, 40, pFontCreate); | |
1584 continue; | |
1585 } | |
1586 if ( ptr_507BD0->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED) | |
1587 { | |
1588 pWindow->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
1589 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)(int)ptr_507BD0->ptr_1C, 0, 0); | |
1590 pEventTimer->Resume(); | |
1591 ptr_507BD0->Release(); | |
2541 | 1592 current_screen_type = SCREEN_GAME; |
2502 | 1593 viewparams->bRedrawGameUI = true; |
1594 continue; | |
1595 } | |
1596 if ( ptr_507BD0->receives_keyboard_input_2 == WINDOW_INPUT_CANCELLED) | |
1597 { | |
1598 pWindow->receives_keyboard_input_2 = WINDOW_INPUT_NONE; | |
1599 pEventTimer->Resume(); | |
1600 ptr_507BD0->Release(); | |
1601 continue; | |
1602 } | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1603 |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1604 __debugbreak(); // switch pass-through |
2502 | 1605 } |
1606 case WINDOW_59: | |
1607 { | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1608 __debugbreak(); // looks like debugging tools |
2502 | 1609 pWindow->DrawMessageBox(0); |
1610 pWindow->DrawText(pFontLucida, 10, 20, 0, "Making item number", 0, 0, 0); | |
1611 pWindow->DrawText(pFontLucida, 10, 40, 0, pKeyActionMap->pPressedKeysBuffer, 0, 0, 0); | |
1612 if ( !pKeyActionMap->field_204 ) | |
1613 { | |
1614 ItemGen2.Reset(); | |
1615 pWindow->Release(); | |
1616 pEventTimer->Resume(); | |
2541 | 1617 current_screen_type = SCREEN_GAME; |
2502 | 1618 viewparams->bRedrawGameUI = true; |
1619 v26 = atoi(pKeyActionMap->pPressedKeysBuffer); | |
1620 if ( v26 > 0 ) | |
1621 { | |
1622 if ( v26 < 800 ) | |
1623 { | |
1624 ItemGen2.uAttributes |= 1; | |
1625 ItemGen2.uItemID = v26; | |
1626 if ( pItemsTable->pItems[v26].uEquipType == 12 ) | |
1627 { | |
1628 ItemGen2.uNumCharges = rand() % 6 + ItemGen2.GetDamageMod() + 1; | |
1629 ItemGen2.uMaxCharges = LOBYTE(ItemGen2.uNumCharges); | |
1630 } | |
1631 else | |
1632 { | |
1633 if ( v26 >= 221 && v26 < 271 ) | |
1634 ItemGen2.uEnchantmentType = rand() % 10 + 1; | |
1635 } | |
1636 pItemsTable->SetSpecialBonus(&ItemGen2); | |
1637 pParty->SetHoldingItem(&ItemGen2); | |
1638 } | |
1639 } | |
1640 } | |
1641 continue; | |
1642 } | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1643 case WINDOW_MainMenu: |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1644 case WINDOW_null: |
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1645 continue; |
2502 | 1646 default: |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1647 __debugbreak(); |
2502 | 1648 continue; |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1649 }*/ |
2502 | 1650 } |
1651 if ( GetCurrentMenuID() == -1 ) | |
1652 GameUI_DrawFoodAndGold(); | |
1653 if ( sub_4637E0_is_there_popup_onscreen() ) | |
1654 UI_OnMouseRightClick(0); | |
1655 } | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1656 |
2502 | 1657 |
1658 //----- (00467FB6) -------------------------------------------------------- | |
1659 void CreateScrollWindow() | |
1660 { | |
1661 unsigned int v0; // eax@1 | |
1662 char *v1; // ST18_4@3 | |
1663 GUIWindow a1; // [sp+Ch] [bp-54h]@1 | |
1664 | |
1665 memcpy(&a1, pGUIWindow_ScrollWindow, sizeof(a1)); | |
1666 a1.Hint = 0; | |
1667 a1.uFrameX = 1; | |
1668 a1.uFrameY = 1; | |
1669 a1.uFrameWidth = 468; | |
1670 v0 = pFontSmallnum->CalcTextHeight(pScrolls[pGUIWindow_ScrollWindow->par1C], &a1, 0, 0) | |
1671 + 2 * LOBYTE(pFontCreate->uFontHeight) + 24; | |
1672 a1.uFrameHeight = v0; | |
1673 if ( (signed int)(v0 + a1.uFrameY) > 479 ) | |
1674 { | |
1675 v0 = 479 - a1.uFrameY; | |
1676 a1.uFrameHeight = 479 - a1.uFrameY; | |
1677 } | |
1678 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1; | |
1679 a1.uFrameW = v0 + a1.uFrameY - 1; | |
1680 a1.DrawMessageBox(0); | |
1681 a1.uFrameX += 12; | |
1682 a1.uFrameWidth -= 24; | |
1683 a1.uFrameY += 12; | |
1684 a1.uFrameHeight -= 12; | |
1685 a1.uFrameZ = a1.uFrameWidth + a1.uFrameX - 1; | |
1686 a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; | |
1687 v1 = pItemsTable->pItems[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C + 700].pName; | |
1688 sprintf(pTmpBuf.data(), format_4E2D80, Color16(0xFFu, 0xFFu, 0x9Bu), v1); | |
1689 a1.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3); | |
1690 a1.DrawText(pFontSmallnum, 1, LOBYTE(pFontCreate->uFontHeight) - 3, 0, | |
1691 pScrolls[(unsigned int)pGUIWindow_ScrollWindow->ptr_1C], 0, 0, 0); | |
1692 } | |
1693 //----- (00467F48) -------------------------------------------------------- | |
1694 void CreateMsgScrollWindow( signed int mscroll_id ) | |
1695 { | |
1696 if ( !pGUIWindow_ScrollWindow && mscroll_id >= 700 ) | |
1697 { | |
1698 if ( mscroll_id <= 782 ) | |
1699 { | |
1700 uTextureID_720980 = pIcons_LOD->LoadTexture("leather", TEXTURE_16BIT_PALETTE); | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
1701 pGUIWindow_ScrollWindow = new GUIWindow_Scroll(0, 0, window->GetWidth(), window->GetHeight(), mscroll_id - 700, 0); |
2502 | 1702 } |
1703 } | |
1704 } | |
1705 //----- (00467F9F) -------------------------------------------------------- | |
2551
4008b2f34be0
MainMenu rendering moved from event loop to respective window class
a.parshin
parents:
2550
diff
changeset
|
1706 void free_book_subwindow() |
2502 | 1707 { |
1708 if ( pGUIWindow_ScrollWindow ) | |
1709 { | |
1710 pGUIWindow_ScrollWindow->Release(); | |
1711 pGUIWindow_ScrollWindow = 0; | |
1712 } | |
1713 } | |
1714 //----- (004226EF) -------------------------------------------------------- | |
1715 void SetUserInterface(PartyAlignment align, bool bReplace) | |
1716 { | |
1717 extern void set_default_ui_skin(); | |
1718 set_default_ui_skin(); | |
1719 | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1720 |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1721 if (!parchment) |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1722 parchment = assets->GetImage_16BitColorKey(L"parchment", 0x7FF); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1723 |
2502 | 1724 if (align == PartyAlignment_Evil) |
1725 { | |
1726 if ( bReplace ) | |
1727 { | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1728 game_ui_rightframe = assets->GetImage_PCXFromIconsLOD(L"ib-r-C.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1729 game_ui_bottomframe = assets->GetImage_PCXFromIconsLOD(L"ib-b-C.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1730 game_ui_topframe = assets->GetImage_PCXFromIconsLOD(L"ib-t-C.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1731 game_ui_leftframe = assets->GetImage_PCXFromIconsLOD(L"ib-l-C.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1732 game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-c.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1733 |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1734 game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-C"); |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1735 minimap_loop = assets->GetTexture("ib-autmask-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1736 _5079B4_compass = assets->GetTexture("IB-COMP-C"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1737 _5079D0_init_g = assets->GetTexture("IB-InitG-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1738 _5079C8_init_y = assets->GetTexture("IB-InitY-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1739 _5079CC_init_r = assets->GetTexture("IB-InitR-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1740 |
2502 | 1741 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2); |
1742 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2); | |
1743 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2); | |
1744 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2); | |
1745 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-C", 2); | |
1746 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); | |
1747 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); | |
1748 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); | |
1749 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); | |
1750 | |
1751 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2); | |
1752 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2); | |
1753 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2); | |
1754 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2); | |
1755 | |
1756 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); | |
1757 pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID); | |
1758 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
1759 pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID); | |
1760 | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1761 ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-c", 0x7FF); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1762 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); |
2502 | 1763 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1764 ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven-c", 0x7FF); |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1765 messagebox_corner_y = assets->GetImage_16BitAlpha(L"cornr_ll-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1766 messagebox_corner_w = assets->GetImage_16BitAlpha(L"cornr_lr-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1767 messagebox_corner_x = assets->GetImage_16BitAlpha(L"cornr_ul-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1768 messagebox_corner_z = assets->GetImage_16BitAlpha(L"cornr_ur-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1769 messagebox_border_bottom = assets->GetImage_16BitAlpha(L"edge_btm-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1770 messagebox_border_left = assets->GetImage_16BitAlpha(L"edge_lf-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1771 messagebox_border_right = assets->GetImage_16BitAlpha(L"edge_rt-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1772 messagebox_border_top = assets->GetImage_16BitAlpha(L"edge_top-c"); |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1773 _591428_endcap = assets->GetImage_16BitColorKey(L"endcap-c", 0x7FF); |
2502 | 1774 } |
1775 else | |
1776 { | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1777 game_ui_rightframe = assets->GetImage_PCXFromIconsLOD(L"ib-r-C.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1778 game_ui_bottomframe = assets->GetImage_PCXFromIconsLOD(L"ib-b-c.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1779 game_ui_topframe = assets->GetImage_PCXFromIconsLOD(L"ib-t-C.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1780 game_ui_leftframe = assets->GetImage_PCXFromIconsLOD(L"ib-l-C.pcx"); |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1781 game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-c.pcx"); |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1782 |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1783 game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-C"); |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1784 minimap_loop = assets->GetTexture("ib-autmask-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1785 _5079B4_compass = assets->GetTexture("IB-COMP-C"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1786 _5079D0_init_g = assets->GetTexture("IB-InitG-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1787 _5079C8_init_y = assets->GetTexture("IB-InitY-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1788 _5079CC_init_r = assets->GetTexture("IB-InitR-c"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1789 |
2502 | 1790 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE); |
1791 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE); | |
1792 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE); | |
1793 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE); | |
1794 uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); | |
1795 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); | |
1796 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); | |
1797 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); | |
1798 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1799 ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-c", 0x7FF); |
2502 | 1800 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); |
1801 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); | |
1802 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); | |
1803 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); | |
1804 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); | |
1805 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1806 ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven", 0x7FF); |
2502 | 1807 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); |
1808 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
1809 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
1810 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
1811 } | |
1812 uGameUIFontMain = Color16(0xC8u, 0, 0); | |
1813 uGameUIFontShadow = Color16(10, 0, 0); | |
1814 } | |
1815 else if (align == PartyAlignment_Neutral) | |
1816 { | |
1817 if ( bReplace ) | |
1818 { | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1819 game_ui_rightframe = assets->GetImage_PCXFromIconsLOD(L"ib-r-a.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1820 game_ui_bottomframe = assets->GetImage_PCXFromIconsLOD(L"ib-b-a.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1821 game_ui_topframe = assets->GetImage_PCXFromIconsLOD(L"ib-t-a.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1822 game_ui_leftframe = assets->GetImage_PCXFromIconsLOD(L"ib-l-a.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1823 game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-a.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1824 |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1825 game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-a"); |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1826 minimap_loop = assets->GetTexture("ib-autmask-a"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1827 _5079B4_compass = assets->GetTexture("IB-COMP-a"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1828 _5079D0_init_g = assets->GetTexture("IB-InitG-a"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1829 _5079C8_init_y = assets->GetTexture("IB-InitY-a"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1830 _5079CC_init_r = assets->GetTexture("IB-InitR-a"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1831 |
2502 | 1832 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2); |
1833 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2); | |
1834 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2); | |
1835 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2); | |
1836 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-a", 2); | |
1837 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); | |
1838 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); | |
1839 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); | |
1840 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); | |
1841 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2); | |
1842 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2); | |
1843 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2); | |
1844 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2); | |
1845 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); | |
1846 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
1847 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
1848 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1849 ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-a", 0x7FF); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1850 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); |
2502 | 1851 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2); |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1852 ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven", 0x7FF); |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1853 messagebox_corner_y = assets->GetImage_16BitAlpha(L"cornr_ll"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1854 messagebox_corner_w = assets->GetImage_16BitAlpha(L"cornr_lr"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1855 messagebox_corner_x = assets->GetImage_16BitAlpha(L"cornr_ul"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1856 messagebox_corner_z = assets->GetImage_16BitAlpha(L"cornr_ur"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1857 messagebox_border_bottom = assets->GetImage_16BitAlpha(L"edge_btm"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1858 messagebox_border_left = assets->GetImage_16BitAlpha(L"edge_lf"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1859 messagebox_border_right = assets->GetImage_16BitAlpha(L"edge_rt"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1860 messagebox_border_top = assets->GetImage_16BitAlpha(L"edge_top"); |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1861 _591428_endcap = assets->GetImage_16BitColorKey(L"endcap", 0x7FF); |
2502 | 1862 } |
1863 else | |
1864 { | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1865 game_ui_rightframe = assets->GetImage_PCXFromIconsLOD(L"ib-r-A.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1866 game_ui_bottomframe = assets->GetImage_PCXFromIconsLOD(L"ib-b-A.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1867 game_ui_topframe = assets->GetImage_PCXFromIconsLOD(L"ib-t-A.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1868 game_ui_leftframe = assets->GetImage_PCXFromIconsLOD(L"ib-l-A.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1869 game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-a.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1870 |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1871 game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-A"); |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1872 minimap_loop = assets->GetTexture("ib-autmask-a"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1873 _5079B4_compass = assets->GetTexture("IB-COMP-A"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1874 _5079D0_init_g = assets->GetTexture("IB-InitG-a"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1875 _5079C8_init_y = assets->GetTexture("IB-InitY-a"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1876 _5079CC_init_r = assets->GetTexture("IB-InitR-a"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1877 |
2502 | 1878 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE); |
1879 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE); | |
1880 uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); | |
1881 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE); | |
1882 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE); | |
1883 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); | |
1884 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE); | |
1885 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); | |
1886 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1887 ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-a", 0x7FF); |
2502 | 1888 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); |
1889 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); | |
1890 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); | |
1891 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); | |
1892 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); | |
1893 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1894 ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven", 0x7FF); |
2502 | 1895 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); |
1896 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
1897 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
1898 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1899 messagebox_corner_y = assets->GetImage_16BitAlpha(L"cornr_ll"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1900 messagebox_corner_w = assets->GetImage_16BitAlpha(L"cornr_lr"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1901 messagebox_corner_x = assets->GetImage_16BitAlpha(L"cornr_ul"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1902 messagebox_corner_z = assets->GetImage_16BitAlpha(L"cornr_ur"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1903 messagebox_border_bottom = assets->GetImage_16BitAlpha(L"edge_btm"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1904 messagebox_border_left = assets->GetImage_16BitAlpha(L"edge_lf"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1905 messagebox_border_right = assets->GetImage_16BitAlpha(L"edge_rt"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1906 messagebox_border_top = assets->GetImage_16BitAlpha(L"edge_top"); |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1907 _591428_endcap = assets->GetImage_16BitColorKey(L"endcap", 0x7FF); |
2502 | 1908 } |
1909 uGameUIFontMain = Color16(0xAu, 0, 0); | |
1910 uGameUIFontShadow = Color16(230, 214, 193); | |
1911 } | |
1912 else if (align == PartyAlignment_Good) | |
1913 { | |
1914 if ( bReplace ) | |
1915 { | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1916 game_ui_rightframe = assets->GetImage_PCXFromIconsLOD(L"ib-r-B.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1917 game_ui_bottomframe = assets->GetImage_PCXFromIconsLOD(L"ib-b-B.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1918 game_ui_topframe = assets->GetImage_PCXFromIconsLOD(L"ib-t-B.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1919 game_ui_leftframe = assets->GetImage_PCXFromIconsLOD(L"ib-l-B.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1920 game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-b.pcx"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1921 |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1922 game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-B"); |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1923 minimap_loop = assets->GetTexture("ib-autmask-b"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1924 _5079B4_compass = assets->GetTexture("IB-COMP-B"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1925 _5079D0_init_g = assets->GetTexture("IB-InitG-b"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1926 _5079C8_init_y = assets->GetTexture("IB-InitY-b"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1927 _5079CC_init_r = assets->GetTexture("IB-InitR-b"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1928 |
2502 | 1929 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2); |
1930 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2); | |
1931 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2); | |
1932 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2); | |
1933 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-B", 2); | |
1934 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); | |
1935 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); | |
1936 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); | |
1937 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); | |
1938 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2); | |
1939 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2); | |
1940 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2); | |
1941 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2); | |
1942 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB"); | |
1943 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
1944 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB"); | |
1945 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1946 ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-b", 0x7FF); |
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1947 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-b", TEXTURE_16BIT_PALETTE); |
2502 | 1948 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2); |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1949 ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven-b", 0x7FF); |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1950 messagebox_corner_y = assets->GetImage_16BitAlpha(L"cornr_ll-b"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1951 messagebox_corner_w = assets->GetImage_16BitAlpha(L"cornr_lr-b"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1952 messagebox_corner_x = assets->GetImage_16BitAlpha(L"cornr_ul-b"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1953 messagebox_corner_z = assets->GetImage_16BitAlpha(L"cornr_ur-b"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1954 messagebox_border_bottom = assets->GetImage_16BitAlpha(L"edge_btm-b"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1955 messagebox_border_left = assets->GetImage_16BitAlpha(L"edge_lf-b"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1956 messagebox_border_right = assets->GetImage_16BitAlpha(L"edge_rt-b"); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
1957 messagebox_border_top = assets->GetImage_16BitAlpha(L"edge_top-b"); |
2573
0c67be4ec900
DrawTextureIndexed renamed to DrawTextureTransparentColorKey
a.parshin
parents:
2572
diff
changeset
|
1958 _591428_endcap = assets->GetImage_16BitColorKey(L"endcap-b", 0x7FF); |
2502 | 1959 } |
1960 uGameUIFontMain = Color16(0, 0, 0xC8u); | |
1961 uGameUIFontShadow = Color16(255, 255, 255); | |
1962 } | |
1963 else Error("Invalid alignment type: %u", align); | |
1964 } | |
1965 //----- (0041D20D) -------------------------------------------------------- | |
1966 void DrawBuff_remaining_time_string( int uY, struct GUIWindow *window, __int64 remaining_time, struct GUIFont *Font ) | |
1967 { | |
1968 unsigned int full_time; // esi@1 | |
1969 signed __int64 hours; // kr00_8@1 | |
1970 const char *text; // eax@2 | |
1971 signed __int64 minutes; // [sp+10h] [bp-10h]@1 | |
1972 signed __int64 seconds; // [sp+18h] [bp-8h]@1 | |
1973 unsigned int day; // [sp+24h] [bp+4h]@1 | |
1974 | |
1975 full_time = (signed __int64)((double)remaining_time * 0.234375); | |
1976 day = (unsigned int)((full_time / 60) / 60) / 24; | |
1977 hours = ((full_time / 60) / 60) % 24; | |
1978 minutes = (signed __int64)(full_time / 60) % 60; | |
1979 seconds = (signed __int64)full_time % 60; | |
1980 strcpy(pTmpBuf.data(), "\r020"); | |
1981 if ( day ) | |
1982 { | |
1983 text = pGlobalTXT_LocalizationStrings[57]; // Days | |
1984 if ( day <= 1 ) | |
1985 text = pGlobalTXT_LocalizationStrings[56]; // Day | |
1986 sprintfex(pTmpBuf2.data(), "%d %s ", (int)day, text); | |
1987 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
1988 } | |
1989 if ( hours ) | |
1990 { | |
1991 if ( hours <= 1 ) | |
1992 text = pGlobalTXT_LocalizationStrings[109];// Hour | |
1993 else | |
1994 text = pGlobalTXT_LocalizationStrings[110];// Hours | |
1995 sprintfex(pTmpBuf2.data(), "%d %s ", (int)hours, text); | |
1996 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
1997 } | |
1998 if ( minutes && !day ) | |
1999 { | |
2000 if ( minutes <= 1 ) | |
2001 text = pGlobalTXT_LocalizationStrings[437];// Minute | |
2002 else | |
2003 text = pGlobalTXT_LocalizationStrings[436];// Minutes | |
2004 sprintfex(pTmpBuf2.data(), "%d %s ", (int)minutes, text); | |
2005 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2006 } | |
2007 if ( seconds && !hours ) | |
2008 { | |
2009 if ( seconds <= 1 ) | |
2010 text = pGlobalTXT_LocalizationStrings[439];// Second | |
2011 else | |
2012 text = pGlobalTXT_LocalizationStrings[438];// Seconds | |
2013 sprintfex(pTmpBuf2.data(), "%d %s ", (int)seconds, text); | |
2014 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
2015 } | |
2016 window->DrawText(Font, 32, uY, 0, pTmpBuf.data(), 0, 0, 0); | |
2017 } | |
2018 | |
2019 | |
2020 //----- (0042EB8D) -------------------------------------------------------- | |
2021 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line) | |
2022 { | |
2023 //Log::Warning(L"%s @ (%S %u)", UIMessage2String(msg), file, line); | |
2024 if (uNumMessages < 40) | |
2025 { | |
2026 files[uNumMessages] = file; | |
2027 lines[uNumMessages] = line; | |
2028 | |
2029 pMessages[uNumMessages].eType = msg; | |
2030 pMessages[uNumMessages].param = param; | |
2031 pMessages[uNumMessages++].field_8 = a4; | |
2032 } | |
2033 } | |
2034 | |
2035 //----- (004637E0) -------------------------------------------------------- | |
2036 char sub_4637E0_is_there_popup_onscreen() | |
2037 { | |
2038 return dword_507BF0_is_there_popup_onscreen == 1; | |
2039 } | |
2040 // 507BF0: using guessed type int dword_507BF0_is_there_popup_onscreen; | |
2041 | |
2042 //----- (00417AD4) -------------------------------------------------------- | |
2043 unsigned int GetSkillColor(unsigned int uPlayerClass, PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level) | |
2044 { | |
2045 switch (uPlayerClass % 4) | |
2046 { | |
2047 case 0: | |
2048 { | |
2049 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level) | |
2050 return ui_character_skillinfo_can_learn; | |
2051 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level && | |
2052 byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level) | |
2053 { | |
2054 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 3][uPlayerSkillType] < skill_level) | |
2055 return ui_character_skillinfo_cant_learn; | |
2056 } | |
2057 return ui_character_skillinfo_can_learn_gm; | |
2058 } | |
2059 break; | |
2060 | |
2061 case 1: | |
2062 { | |
2063 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level) | |
2064 return ui_character_skillinfo_can_learn; | |
2065 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level) | |
2066 { | |
2067 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level) | |
2068 return ui_character_skillinfo_cant_learn; | |
2069 } | |
2070 return ui_character_skillinfo_can_learn_gm; | |
2071 } | |
2072 break; | |
2073 | |
2074 case 2: | |
2075 case 3: | |
2076 { | |
2077 if (byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level) | |
2078 return ui_character_skillinfo_cant_learn; | |
2079 return ui_character_skillinfo_can_learn; | |
2080 } | |
2081 break; | |
2082 } | |
2083 Error("Invalid player class: %u", uPlayerClass); | |
2084 } | |
2085 | |
2086 //----- (0040F92A) -------------------------------------------------------- | |
2087 void __fastcall ZBuffer_DoFill2(int *pZBuffer, Texture *a2, int a3) | |
2088 {//срабатывает в покупке в магазине | |
2089 void *v4; // eax@3 | |
2090 //int *v5; // edi@5 | |
2091 // int v6; // ecx@6 | |
2092 // int v9; // [sp+18h] [bp-4h]@1 | |
2093 | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
2094 if (pIcons_LOD->_011BA4_debug_paletted_pixels_uncompressed && a2->uDecompressedSize) |
2502 | 2095 v4 = a2->UnzipPalette(); |
2096 else | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
2097 v4 = a2->paletted_pixels; |
2502 | 2098 //v5 = pZBuffer; |
2099 for (uint i = 0; i < a2->uTextureHeight; i++) | |
2100 { | |
2101 for (uint j = 0; j < a2->uTextureWidth; j++) | |
2102 { | |
2103 *pZBuffer = a3; | |
2104 ++pZBuffer; | |
2105 } | |
2106 pZBuffer += window->GetWidth() - a2->uTextureWidth; | |
2107 } | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
2108 if (pIcons_LOD->_011BA4_debug_paletted_pixels_uncompressed) |
2502 | 2109 { |
2110 if (a2->uDecompressedSize) | |
2111 free(v4); | |
2112 } | |
2113 } | |
2114 | |
2115 | |
2541 | 2116 // 4E28F8: using guessed type int current_screen_type; |
2502 | 2117 |
2118 //----- (0040F82D) -------------------------------------------------------- | |
2119 void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue) | |
2120 { | |
2121 assert(uTextureId != -1); | |
2122 ZBuffer_DoFill(pZBuffer, pIcons_LOD->GetTexture(uTextureId), iZValue); | |
2123 } | |
2124 | |
2125 //----- (0040F89C) -------------------------------------------------------- | |
2126 void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture *pTex, int uZValue) | |
2127 {//срабатывает при продаже в магазине | |
2128 void *v3; // eax@3 | |
2129 //void *v4; // esi@5 | |
2130 //int *v5; // edi@5 | |
2131 //int v6; // eax@5 | |
2132 // int v7; // ecx@6 | |
2133 // int v11; // [sp+18h] [bp-8h]@1 | |
2134 //void *v12; // [sp+1Ch] [bp-4h]@5 | |
2135 | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
2136 if (pIcons_LOD->_011BA4_debug_paletted_pixels_uncompressed && pTex->uDecompressedSize) |
2502 | 2137 v3 = pTex->UnzipPalette(); |
2138 else | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
2139 v3 = pTex->paletted_pixels; |
2502 | 2140 //v12 = v3; |
2141 //v4 = v3; | |
2142 //v5 = pZBuffer; | |
2143 //v6 = 0; | |
2144 for (uint i = 0; i < pTex->uTextureHeight; i++) | |
2145 { | |
2146 for (uint j = 0; j < pTex->uTextureWidth; j++) | |
2147 { | |
2148 //LOBYTE(v6) = *(char *)v4; | |
2149 //v4 = (char *)v4 + 1; | |
2150 //if ( v6 ) | |
2151 *pZBuffer = uZValue; | |
2152 ++pZBuffer; | |
2153 } | |
2154 pZBuffer += window->GetWidth() - pTex->uTextureWidth; | |
2155 } | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
2156 if (pIcons_LOD->_011BA4_debug_paletted_pixels_uncompressed) |
2502 | 2157 { |
2158 if (pTex->uDecompressedSize) | |
2159 free(v3); | |
2160 } | |
2161 } | |
2162 | |
2163 //----- (004BC49B) -------------------------------------------------------- | |
2164 void OnSelectNPCDialogueOption(DIALOGUE_TYPE newDialogueType) | |
2165 { | |
2166 NPCData *speakingNPC; // ebp@1 | |
2167 int npc_event_id; // ecx@10 | |
2168 char *v13; // [sp-8h] [bp-18h]@60 | |
2169 | |
2170 speakingNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); | |
2171 uDialogueType = newDialogueType; | |
2172 if (!speakingNPC->uFlags) | |
2173 speakingNPC->uFlags = 1; | |
2174 if (newDialogueType == DIALOGUE_PROFESSION_DETAILS) | |
2175 dialogue_show_profession_details = ~dialogue_show_profession_details; | |
2176 else if (newDialogueType == DIALOGUE_76) | |
2177 { | |
2178 if (speakingNPC->Hired()) | |
2179 { | |
2180 if ((signed int)pNPCStats->uNumNewNPCs > 0) | |
2181 { | |
2182 for (uint i = 0; i < (unsigned int)pNPCStats->uNumNewNPCs; ++i) | |
2183 { | |
2184 if (pNPCStats->pNewNPCData[i].uFlags & 0x80 && !strcmp(speakingNPC->pName, pNPCStats->pNewNPCData[i].pName)) | |
2185 pNPCStats->pNewNPCData[i].uFlags &= 0x7Fu; | |
2186 } | |
2187 } | |
2188 if (pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName)) | |
2189 memset(&pParty->pHirelings[0], 0, sizeof(NPCData)); | |
2190 else if (pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName)) | |
2191 memset(&pParty->pHirelings[1], 0, sizeof(NPCData)); | |
2192 pParty->hirelingScrollPosition = 0; | |
2193 pParty->CountHirelings(); | |
2194 dword_591084 = 0; | |
2195 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
2196 dword_7241C8 = 0; | |
2197 return; | |
2198 } | |
2199 if (pParty->pHirelings[0].pName && pParty->pHirelings[1].pName) | |
2200 ShowStatusBarString(pGlobalTXT_LocalizationStrings[533], 2);// ""I cannot join you, you're party is full"" | |
2201 else | |
2202 { | |
2203 if (speakingNPC->uProfession != 51) //burglars have no hiring price | |
2204 { | |
2205 if (pParty->uNumGold < pNPCStats->pProfessions[speakingNPC->uProfession].uHirePrice) | |
2206 { | |
2207 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold" | |
2208 dialogue_show_profession_details = false; | |
2209 uDialogueType = 13; | |
2210 if (uActiveCharacter) | |
2211 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); | |
2212 if (!dword_7241C8) | |
2541 | 2213 pEngine->Draw(); |
2502 | 2214 dword_7241C8 = 0; |
2215 return; | |
2216 } | |
2217 Party::TakeGold(pNPCStats->pProfessions[speakingNPC->uProfession].uHirePrice); | |
2218 } | |
2219 LOBYTE(speakingNPC->uFlags) |= 0x80u; | |
2220 if (pParty->pHirelings[0].pName) | |
2221 { | |
2222 memcpy(&pParty->pHirelings[1], speakingNPC, sizeof(pParty->pHirelings[1])); | |
2223 v13 = pParty->pHireling2Name; | |
2224 } | |
2225 else | |
2226 { | |
2227 memcpy(&pParty->pHirelings[0], speakingNPC, sizeof(pParty->pHirelings[0])); | |
2228 v13 = pParty->pHireling1Name; | |
2229 } | |
2230 strcpy(v13, speakingNPC->pName); | |
2231 pParty->hirelingScrollPosition = 0; | |
2232 pParty->CountHirelings(); | |
2233 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
2234 if (sDialogue_SpeakingActorNPC_ID >= 0) | |
2235 pDialogue_SpeakingActor->uAIState = Removed; | |
2236 if (uActiveCharacter) | |
2237 pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0); | |
2238 } | |
2239 } | |
2240 else if ((signed int)newDialogueType > DIALOGUE_84 && (signed int)newDialogueType <= DIALOGUE_ARENA_SELECT_CHAMPION) //выбор уровня сложности боя | |
2241 { | |
2242 ArenaFight(); | |
2243 return; | |
2244 } | |
2245 else if (newDialogueType == DIALOGUE_USE_NPC_ABILITY) | |
2246 { | |
2247 if (UseNPCSkill((NPCProf)speakingNPC->uProfession) == 0) | |
2248 { | |
2249 if (speakingNPC->uProfession != GateMaster) | |
2250 speakingNPC->bHasUsedTheAbility = 1; | |
2251 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
2252 } | |
2253 else | |
2254 ShowStatusBarString(pGlobalTXT_LocalizationStrings[140], 2); //"Your packs are already full!" | |
2255 } | |
2256 else if (newDialogueType == DIALOGUE_13) | |
2257 { | |
2258 if (!speakingNPC->Hired()) | |
2259 { | |
2260 sub_4B3E1E(); | |
2261 dialogue_show_profession_details = false; | |
2262 } | |
2263 else | |
2264 { | |
2265 for (uint i = 0; i < (signed int)pNPCStats->uNumNewNPCs; ++i) | |
2266 { | |
2267 if (pNPCStats->pNewNPCData[i].uFlags & 0x80 && !strcmp(speakingNPC->pName, pNPCStats->pNewNPCData[i].pName)) | |
2268 pNPCStats->pNewNPCData[i].uFlags &= 0x7Fu; | |
2269 } | |
2270 if (pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName)) | |
2271 memset(&pParty->pHirelings[0], 0, sizeof(NPCData)); | |
2272 else if (pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName)) | |
2273 memset(&pParty->pHirelings[1], 0, sizeof(NPCData)); | |
2274 pParty->hirelingScrollPosition = 0; | |
2275 pParty->CountHirelings(); | |
2276 dword_591084 = 0; | |
2277 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
2278 dword_7241C8 = 0; | |
2279 return; | |
2280 } | |
2281 } | |
2282 else if (newDialogueType >= DIALOGUE_EVT_A && newDialogueType <= DIALOGUE_EVT_F) | |
2283 { | |
2284 switch (newDialogueType) | |
2285 { | |
2286 case DIALOGUE_EVT_A: npc_event_id = speakingNPC->evt_A; break; | |
2287 case DIALOGUE_EVT_B: npc_event_id = speakingNPC->evt_B; break; | |
2288 case DIALOGUE_EVT_C: npc_event_id = speakingNPC->evt_C; break; | |
2289 case DIALOGUE_EVT_D: npc_event_id = speakingNPC->evt_D; break; | |
2290 case DIALOGUE_EVT_E: npc_event_id = speakingNPC->evt_E; break; | |
2291 case DIALOGUE_EVT_F: npc_event_id = speakingNPC->evt_F; break; | |
2292 } | |
2293 if ((npc_event_id >= 200) && (npc_event_id <= 310)) | |
2294 _4B3FE5_training_dialogue(npc_event_id); //200-310 | |
2295 else if ((npc_event_id >= 400) && (npc_event_id <= 410)) | |
2296 { //400-410 | |
2297 dword_F8B1D8 = newDialogueType; | |
2298 DrawJoinGuildWindow(npc_event_id - 400); | |
2299 } | |
2300 else | |
2301 { | |
2302 switch (npc_event_id) | |
2303 { | |
2304 case 139: | |
2305 OracleDialogue(); | |
2306 break; | |
2307 case 311: | |
2308 CheckBountyRespawnAndAward(); | |
2309 break; | |
2310 case 399: | |
2311 Arena_SelectionFightLevel(); | |
2312 break; | |
2313 default: | |
2314 activeLevelDecoration = (LevelDecoration*)1; | |
2315 current_npc_text = 0; | |
2316 EventProcessor(npc_event_id, 0, 1); | |
2317 activeLevelDecoration = nullptr; | |
2318 break; | |
2319 } | |
2320 } | |
2321 } | |
2322 if (!dword_7241C8) | |
2541 | 2323 pEngine->Draw(); |
2502 | 2324 dword_7241C8 = 0; |
2325 } | |
2326 | |
2327 //----- (004B3E1E) -------------------------------------------------------- | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
2328 void sub_4B3E1E() |
2502 | 2329 { |
2330 NPCData *v0; // ST40_4@1 | |
2331 signed int v1; // edi@1 | |
2332 //GUIWindow *v2; // ecx@1 | |
2333 | |
2334 __debugbreak(); | |
2335 v0 = GetNPCData(sDialogue_SpeakingActorNPC_ID); | |
2336 v1 = 0; | |
2337 pDialogueWindow->eWindowType = WINDOW_MainMenu; | |
2338 pDialogueWindow->Release(); | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
2339 pDialogueWindow = new GUIWindow_Dialogue(0, 0, window->GetWidth(), window->GetHeight(), 1, 0); |
2502 | 2340 if (pNPCStats->pProfessions[v0->uProfession].pBenefits)//*(&pNPCStats->field_13A5C + 5 * v0->uProfession) ) |
2341 { | |
2342 pDialogueWindow->CreateButton(480, 160, 140, 28, 1, 0, UIMSG_SelectNPCDialogueOption, 77, 0, pGlobalTXT_LocalizationStrings[407], 0);//Подробнее | |
2343 v1 = 1; | |
2344 } | |
2345 pDialogueWindow->CreateButton(480, 30 * v1 + 160, 140, 30, 1, 0, UIMSG_SelectNPCDialogueOption, 76, 0, pGlobalTXT_LocalizationStrings[406], 0);//Нанять | |
2346 pDialogueWindow->_41D08F_set_keyboard_control_group(v1 + 1, 1, 0, 1); | |
2347 } | |
2348 | |
2349 //----- (004B2001) -------------------------------------------------------- | |
2350 void __fastcall ClickNPCTopic(signed int uMessageParam) | |
2351 { | |
2352 //signed int v1; // eax@1 | |
2353 NPCData *pCurrentNPCInfo; // ebp@1 | |
2354 int pEventNumber; // ecx@8 | |
2355 Player *v4; // esi@20 | |
2356 //int v5; // eax@28 | |
2357 //int v6; // eax@31 | |
2358 //int v7; // eax@34 | |
2359 //int v8; // eax@37 | |
2360 //int v9; // eax@40 | |
2361 //unsigned int v10; // eax@43 | |
2362 char *v12; // eax@53 | |
2363 char *v13; // eax@56 | |
2364 char *v14; // eax@57 | |
2365 char *v15; // eax@58 | |
2366 //unsigned int v16; // ebp@62 | |
2367 char *v17; // ecx@63 | |
2368 char *v18; // eax@65 | |
2369 // const char *v19; // ecx@68 | |
2370 //unsigned int v20; // eax@69 | |
2371 signed int pPrice; // ecx@70 | |
2372 char *v22; // [sp-Ch] [bp-18h]@73 | |
2373 //int v23; // [sp-8h] [bp-14h]@49 | |
2374 char *v24; // [sp-8h] [bp-14h]@73 | |
2375 //int v25; // [sp-4h] [bp-10h]@49 | |
2376 | |
2377 uDialogueType = uMessageParam + 1; | |
2378 pCurrentNPCInfo = HouseNPCData[pDialogueNPCCount - ((dword_591080 != 0) ? 1 : 0)];//- 1 | |
2379 if (uMessageParam <= 24) | |
2380 { | |
2381 switch (uMessageParam) | |
2382 { | |
2383 case 13: | |
2384 current_npc_text = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); | |
2385 current_npc_text = BuildDialogueString(current_npc_text, uActiveCharacter - 1, 0, 0, 0, 0); | |
2386 NPCHireableDialogPrepare(); | |
2387 dialogue_show_profession_details = false; | |
2388 BackToHouseMenu(); | |
2389 return; | |
2390 case 19: | |
2391 pEventNumber = pCurrentNPCInfo->evt_A; | |
2392 break; | |
2393 case 20: | |
2394 pEventNumber = pCurrentNPCInfo->evt_B; | |
2395 break; | |
2396 case 21: | |
2397 pEventNumber = pCurrentNPCInfo->evt_C; | |
2398 break; | |
2399 case 22: | |
2400 pEventNumber = pCurrentNPCInfo->evt_D; | |
2401 break; | |
2402 case 23: | |
2403 pEventNumber = pCurrentNPCInfo->evt_E; | |
2404 break; | |
2405 case 24: | |
2406 pEventNumber = pCurrentNPCInfo->evt_F; | |
2407 break; | |
2408 default: | |
2409 BackToHouseMenu(); | |
2410 return; | |
2411 } | |
2412 /*switch ( pEventNumber ) | |
2413 { | |
2414 case 139: | |
2415 OracleDialogue(); | |
2416 goto _return; | |
2417 case 311: | |
2418 CheckBountyRespawnAndAward(); | |
2419 goto _return; | |
2420 }*/ | |
2421 if (pEventNumber < 200 || pEventNumber > 310) | |
2422 { | |
2423 if (pEventNumber < 400 || pEventNumber > 410) | |
2424 { | |
2425 if (pEventNumber == 139) | |
2426 { | |
2427 OracleDialogue(); | |
2428 } | |
2429 else | |
2430 { | |
2431 if (pEventNumber == 311) | |
2432 { | |
2433 CheckBountyRespawnAndAward(); | |
2434 } | |
2435 else | |
2436 { | |
2437 current_npc_text = 0; | |
2438 activeLevelDecoration = (LevelDecoration*)1; | |
2439 EventProcessor(pEventNumber, 0, 1); | |
2440 activeLevelDecoration = nullptr; | |
2441 } | |
2442 } | |
2443 } | |
2444 else | |
2445 { | |
2446 dword_F8B1D8 = uMessageParam; | |
2447 DrawJoinGuildWindow(pEventNumber - 400); | |
2448 } | |
2449 } | |
2450 else | |
2451 { | |
2452 _4B3FE5_training_dialogue(pEventNumber); | |
2453 } | |
2454 BackToHouseMenu(); | |
2455 return; | |
2456 } | |
2457 if (uMessageParam != 76) | |
2458 { | |
2459 if (uMessageParam == 77) | |
2460 { | |
2461 //v16 = pCurrentNPCInfo->uProfession; | |
2462 __debugbreak(); // probably hirelings found in buildings, not present in MM7, changed "pCurrentNPCInfo->uProfession - 1" to "pCurrentNPCInfo->uProfession", have to check in other versions whether it's ok | |
2463 if (dialogue_show_profession_details) | |
2464 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText; | |
2465 else | |
2466 v17 = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pBenefits; | |
2467 current_npc_text = v17; | |
2468 v18 = BuildDialogueString(v17, uActiveCharacter - 1, 0, 0, 0, 0); | |
2469 dialogue_show_profession_details = ~dialogue_show_profession_details; | |
2470 current_npc_text = v18; | |
2471 } | |
2472 else | |
2473 { | |
2474 if (uMessageParam == 79) | |
2475 { | |
2476 if (contract_approved) | |
2477 { | |
2478 Party::TakeGold(gold_transaction_amount); | |
2479 if (uActiveCharacter) | |
2480 { | |
2481 v12 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number]; | |
2482 *(short *)v12 &= 0x3Fu; | |
2483 switch (dword_F8B1B0_MasteryBeingTaught) | |
2484 { | |
2485 case 2: | |
2486 v15 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number]; | |
2487 *v15 |= 0x40u; | |
2488 break; | |
2489 case 3: | |
2490 v14 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number]; | |
2491 *v14 |= 0x80u; | |
2492 break; | |
2493 case 4: | |
2494 v13 = (char *)&pPlayers[uActiveCharacter]->pActiveSkills[dword_F8B1AC_award_bit_number]; | |
2495 v13[1] |= 1u; | |
2496 break; | |
2497 } | |
2498 pPlayers[uActiveCharacter]->PlaySound(SPEECH_85, 0); | |
2499 } | |
2500 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
2501 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
2502 { | |
2503 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
2504 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; | |
2505 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
2506 ++pMessageQueue_50CBD0->uNumMessages; | |
2507 }*/ | |
2508 } | |
2509 } | |
2510 else | |
2511 { | |
2512 if (uMessageParam == 82 && contract_approved) //join guild | |
2513 { | |
2514 Party::TakeGold(gold_transaction_amount); | |
2515 v4 = pParty->pPlayers.data(); | |
2516 do | |
2517 { | |
2518 v4->SetVariable(VAR_Award, dword_F8B1AC_award_bit_number); | |
2519 ++v4; | |
2520 } while ((signed int)v4 < (signed int)pParty->pHirelings.data()); | |
2521 switch (dword_F8B1D8) | |
2522 { | |
2523 case 19: | |
2524 pEventNumber = pCurrentNPCInfo->evt_A; | |
2525 if (pEventNumber >= 400 && pEventNumber <= 416) | |
2526 pCurrentNPCInfo->evt_A = 0; | |
2527 break; | |
2528 case 20: | |
2529 pEventNumber = pCurrentNPCInfo->evt_B; | |
2530 if (pEventNumber >= 400 && pEventNumber <= 416) | |
2531 pCurrentNPCInfo->evt_B = 0; | |
2532 break; | |
2533 case 21: | |
2534 pEventNumber = pCurrentNPCInfo->evt_C; | |
2535 if (pEventNumber >= 400 && pEventNumber <= 416) | |
2536 pCurrentNPCInfo->evt_C = 0; | |
2537 break; | |
2538 case 22: | |
2539 pEventNumber = pCurrentNPCInfo->evt_D; | |
2540 if (pEventNumber >= 400 && pEventNumber <= 416) | |
2541 pCurrentNPCInfo->evt_D = 0; | |
2542 break; | |
2543 case 23: | |
2544 pEventNumber = pCurrentNPCInfo->evt_E; | |
2545 if (pEventNumber >= 400 && pEventNumber <= 416) | |
2546 pCurrentNPCInfo->evt_E = 0; | |
2547 break; | |
2548 case 24: | |
2549 pEventNumber = pCurrentNPCInfo->evt_F; | |
2550 if (pEventNumber >= 400 && pEventNumber <= 416) | |
2551 pCurrentNPCInfo->evt_F = 0; | |
2552 break; | |
2553 } | |
2554 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
2555 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
2556 { | |
2557 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
2558 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; | |
2559 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
2560 ++pMessageQueue_50CBD0->uNumMessages; | |
2561 }*/ | |
2562 //v11 = uActiveCharacter; | |
2563 if (uActiveCharacter) | |
2564 { | |
2565 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_86, 0); | |
2566 BackToHouseMenu(); | |
2567 return; | |
2568 } | |
2569 } | |
2570 } | |
2571 } | |
2572 BackToHouseMenu(); | |
2573 return; | |
2574 } | |
2575 if (pParty->pHirelings[0].pName && pParty->pHirelings[1].pName) | |
2576 { | |
2577 ShowStatusBarString(pGlobalTXT_LocalizationStrings[533], 2);// ""I cannot join you, you're party is full"" | |
2578 BackToHouseMenu(); | |
2579 return; | |
2580 } | |
2581 | |
2582 | |
2583 if (pCurrentNPCInfo->uProfession != 51) //burglars have no hiring price | |
2584 { | |
2585 __debugbreak(); // probably hirelings found in buildings, not present in MM7, changed "pCurrentNPCInfo->uProfession - 1" to "pCurrentNPCInfo->uProfession", have to check in other versions whether it's ok | |
2586 pPrice = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].uHirePrice; | |
2587 if (pParty->uNumGold < (unsigned int)pPrice) | |
2588 { | |
2589 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); | |
2590 dialogue_show_profession_details = false; | |
2591 uDialogueType = 13; | |
2592 current_npc_text = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText; | |
2593 current_npc_text = BuildDialogueString(current_npc_text, uActiveCharacter - 1, 0, 0, 0, 0); | |
2594 if (uActiveCharacter) | |
2595 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); | |
2596 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); | |
2597 BackToHouseMenu(); | |
2598 return; | |
2599 } | |
2600 else | |
2601 Party::TakeGold(pPrice); | |
2602 } | |
2603 //LOBYTE(v2->uFlags) |= 0x80u; | |
2604 pCurrentNPCInfo->uFlags |= 128; | |
2605 pParty->hirelingScrollPosition = 0; | |
2606 pParty->CountHirelings(); | |
2607 if (pParty->pHirelings[0].pName) | |
2608 { | |
2609 memcpy(&pParty->pHirelings[1], pCurrentNPCInfo, sizeof(pParty->pHirelings[1])); | |
2610 v24 = pCurrentNPCInfo->pName; | |
2611 v22 = pParty->pHireling2Name; | |
2612 } | |
2613 else | |
2614 { | |
2615 memcpy(pParty->pHirelings.data(), pCurrentNPCInfo, 0x4Cu); | |
2616 v24 = pCurrentNPCInfo->pName; | |
2617 v22 = pParty->pHireling1Name; | |
2618 } | |
2619 strcpy(v22, v24); | |
2620 pParty->hirelingScrollPosition = 0; | |
2621 pParty->CountHirelings(); | |
2622 PrepareHouse((HOUSE_ID)(int)window_SpeakInHouse->ptr_1C); | |
2623 dialog_menu_id = HOUSE_DIALOGUE_MAIN; | |
2624 | |
2625 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0); | |
2626 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
2627 { | |
2628 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; | |
2629 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; | |
2630 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
2631 ++pMessageQueue_50CBD0->uNumMessages; | |
2632 }*/ | |
2633 if (uActiveCharacter) | |
2634 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)61, 0); | |
2635 | |
2636 _return: | |
2637 BackToHouseMenu(); | |
2638 } | |
2639 | |
2640 //----- (004B3FE5) -------------------------------------------------------- | |
2641 //Originally called _4B254D_SkillMasteryTeacher to have contract_approved assigned, to be able to set some button name. | |
2642 //But it the name gets immediately overwritten | |
2643 void _4B3FE5_training_dialogue(int a4) | |
2644 { | |
2645 const char *v2; // edi@1 | |
2646 | |
2647 //__debugbreak(); | |
2648 uDialogueType = DIALOGUE_SKILL_TRAINER; | |
2649 current_npc_text = (char *)pNPCTopics[a4 + 168].pText; | |
2650 _4B254D_SkillMasteryTeacher(a4); //might be needed because of contract_approved ? | |
2651 pDialogueWindow->Release(); | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
2652 pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 350, a4, 0); |
2502 | 2653 pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, |
2654 pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); | |
2655 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); | |
2656 v2 = ""; | |
2657 if (contract_approved) | |
2658 v2 = pGlobalTXT_LocalizationStrings[535]; | |
2659 pDialogueWindow->CreateButton(480, 160, 0x8Cu, 0x1Eu, 1, 0, UIMSG_ClickNPCTopic, 0x4Fu, 0, v2, 0); | |
2660 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); | |
2661 dialog_menu_id = HOUSE_DIALOGUE_OTHER; | |
2662 } | |
2528 | 2663 |
2502 | 2664 //----- (004B1ECE) -------------------------------------------------------- |
2665 void OracleDialogue() | |
2666 { | |
2667 __int16 *v0; // edi@1 | |
2668 signed int v4; // eax@9 | |
2669 int v5; // ebx@11 | |
2670 signed int v8; // edi@14 | |
2671 ItemGen *v9; // [sp+Ch] [bp-Ch]@11 | |
2672 signed int v10; // [sp+10h] [bp-8h]@13 | |
2673 int v11; // [sp+14h] [bp-4h]@1 | |
2674 | |
2675 contract_approved = 0; | |
2676 v11 = 0; | |
2677 uDialogueType = 84; | |
2678 current_npc_text = (char *)pNPCTopics[667].pText; | |
2679 v0 = _4F0882_evt_VAR_PlayerItemInHands_vals.data(); | |
2680 //while ( 1 ) | |
2681 for (uint i = 0; i <= 53; i++) | |
2682 { | |
2683 if ((unsigned __int16)_449B57_test_bit(pParty->_quest_bits, *v0)) | |
2684 { | |
2685 //v1 = 0; | |
2686 //v2 = pParty->pPlayers.data(); | |
2687 for (uint pl = 0; pl < 4; pl++) | |
2688 { | |
2689 //LOBYTE(v3) = pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0+1)); | |
2690 if (pParty->pPlayers[pl].CompareVariable(VAR_PlayerItemInHands, *(v0 + 1))) | |
2691 break; | |
2692 //++v2; | |
2693 //++v1; | |
2694 } | |
2695 //while ( (signed int)v2 < (signed int)pParty->pHirelings.data() ); | |
2696 //if ( v1 == 4 ) | |
2697 //break; | |
2698 } | |
2699 ++v11; | |
2700 //v0 += 2; | |
2701 //if ( v0 > &_4F0882_evt_VAR_PlayerItemInHands_vals[53] ) | |
2702 //break; | |
2703 } | |
2704 if (v0 <= &_4F0882_evt_VAR_PlayerItemInHands_vals[53]) | |
2705 { | |
2706 current_npc_text = (char *)pNPCTopics[666].pText; // Here's %s that you lost. Be careful | |
2707 v4 = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; | |
2708 contract_approved = _4F0882_evt_VAR_PlayerItemInHands_vals[2 * v11]; | |
2709 pParty->pPlayers[0].AddVariable(VAR_PlayerItemInHands, v4); | |
2710 } | |
2711 if (contract_approved == 601) | |
2712 { | |
2713 v5 = 0; | |
2714 //v12 = pParty->pPlayers.data();//[0].uClass; | |
2715 v9 = 0; | |
2716 //while ( 1 ) | |
2717 for (uint i = 0; i < 4; i++) | |
2718 { | |
2719 if (pParty->pPlayers[i].classType == PLAYER_CLASS_LICH) | |
2720 { | |
2721 v10 = 0; | |
2722 //v6 = pParty->pPlayers.data();//[0].pInventoryItems[0].field_1A; | |
2723 for (uint pl = 0; pl < 4; pl++) | |
2724 { | |
2725 for (v8 = 0; v8 < 126; v8++)//138 | |
2726 { | |
2727 if (pParty->pPlayers[pl].pInventoryItemList[v8].uItemID == ITEM_LICH_JAR_FULL) | |
2728 { | |
2729 if (!pParty->pPlayers[pl].pInventoryItemList[v8].uHolderPlayer) | |
2730 v9 = &pParty->pPlayers[pl].pInventoryItemList[v8]; | |
2731 if (pParty->pPlayers[pl].pInventoryItemList[v8].uHolderPlayer == v5) | |
2732 v10 = 1; | |
2733 } | |
2734 } | |
2735 } | |
2736 if (!v10) | |
2737 break; | |
2738 } | |
2739 // ++v12; | |
2740 ++v5; | |
2741 // if ( v12 > &pParty->pPlayers[3] ) | |
2742 // return; | |
2743 } | |
2744 if (v9) | |
2745 v9->uHolderPlayer = v5; | |
2746 } | |
2747 } | |
2748 | |
2749 //----- (004B46A5) -------------------------------------------------------- | |
2750 void __fastcall DrawTextAtStatusBar(const char *Str, int a5) | |
2751 { | |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2558
diff
changeset
|
2752 pRenderer->DrawTextureNew(0, 352/480.0f, game_ui_statusbar); |
2502 | 2753 pPrimaryWindow->DrawText(pFontLucida, pFontLucida->AlignText_Center(450, Str) + 11, 357, a5, Str, 0, 0, 0); |
2754 } | |
2755 | |
2756 //----- (004BBA85) -------------------------------------------------------- | |
2757 void CheckBountyRespawnAndAward() | |
2758 { | |
2759 int i; // eax@2 | |
2760 int rand_monster_id; // edx@3 | |
2761 | |
2762 uDialogueType = 83; | |
2763 pDialogueWindow->Release(); | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2543
diff
changeset
|
2764 pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 350, 0, 0); |
2502 | 2765 pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],// "Cancel" |
2766 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); | |
2767 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); | |
2768 pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_0, 83, 0, "", 0); | |
2769 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); | |
2770 dialog_menu_id = HOUSE_DIALOGUE_OTHER; | |
2771 //get new monster for hunting | |
2772 if (pParty->PartyTimes.bountyHunting_next_generation_time[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] < (signed __int64)pParty->uTimePlayed) | |
2773 { | |
2774 pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = false; | |
2775 pParty->PartyTimes.bountyHunting_next_generation_time[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = (signed __int64)((double)(0x12750000 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335); | |
2776 for (i = rand();; i = rand()) | |
2777 { | |
2778 rand_monster_id = i % 258 + 1; | |
2779 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = rand_monster_id; | |
2780 if ((unsigned __int16)rand_monster_id < 0x73u || (unsigned __int16)rand_monster_id > 0x84u) | |
2781 { | |
2782 if (((unsigned __int16)rand_monster_id < 0xEBu || (unsigned __int16)rand_monster_id > 0xFCu) | |
2783 && ((unsigned __int16)rand_monster_id < 0x85u || (unsigned __int16)rand_monster_id > 0x96u) | |
2784 && ((unsigned __int16)rand_monster_id < 0x97u || (unsigned __int16)rand_monster_id > 0xBAu) | |
2785 && ((unsigned __int16)rand_monster_id < 0xC4u || (unsigned __int16)rand_monster_id > 0xC6u)) | |
2786 break; | |
2787 } | |
2788 } | |
2789 } | |
2790 bountyHunting_monster_id_for_hunting = pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]; | |
2791 if (!pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]) | |
2792 { | |
2793 bountyHunting_text = pNPCTopics[351].pText; | |
2794 if (!pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]) | |
2795 bountyHunting_text = pNPCTopics[353].pText; | |
2796 } | |
2797 else//get prize | |
2798 { | |
2799 if (pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]) | |
2800 { | |
2801 pParty->PartyFindsGold(100 * pMonsterStats->pInfos[(unsigned __int16)pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]].uLevel, 0); | |
2802 for (uint i = 0; i < 4; ++i) | |
2803 pParty->pPlayers[i].SetVariable(VAR_Award, 86); | |
2804 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]].uLevel; | |
2805 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = 0; | |
2806 pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = false; | |
2807 } | |
2808 bountyHunting_text = pNPCTopics[352].pText; | |
2809 } | |
2810 } | |
2811 | |
2812 //----- (004B254D) -------------------------------------------------------- | |
2813 const char * _4B254D_SkillMasteryTeacher(int trainerInfo) | |
2814 { | |
2815 int teacherLevel; // edx@1 | |
2816 int skillBeingTaught; // ecx@1 | |
2817 int pClassType; // eax@7 | |
2818 int currClassMaxMastery; // eax@7 | |
2819 int pointsInSkillWOutMastery; // ebx@7 | |
2820 int classBaseId; // eax@8 | |
2821 unsigned int skillMastery; // eax@29 | |
2822 unsigned __int16 pointsInSkill; // [sp+1Ch] [bp-10h]@7 | |
2823 int masteryLevelBeingTaught; // [sp+24h] [bp-8h]@7 | |
2824 | |
2825 contract_approved = 0; | |
2826 teacherLevel = (trainerInfo - 200) % 3; | |
2827 skillBeingTaught = (trainerInfo - 200) / 3; | |
2828 Player* activePlayer = pPlayers[uActiveCharacter]; | |
2829 pClassType = activePlayer->classType; | |
2830 currClassMaxMastery = byte_4ED970_skill_learn_ability_by_class_table[pClassType][skillBeingTaught]; | |
2831 masteryLevelBeingTaught = teacherLevel + 2; | |
2832 dword_F8B1B0_MasteryBeingTaught = masteryLevelBeingTaught; | |
2833 if (currClassMaxMastery < masteryLevelBeingTaught) | |
2834 { | |
2835 classBaseId = pClassType - pClassType % 4; | |
2836 if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 1][skillBeingTaught] >= masteryLevelBeingTaught) | |
2837 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], pClassNames[classBaseId + 1]);//Вы должны достичь звания %s для обучения этому уровню навыка. You have to be promoted to %s to learn this skill level. | |
2838 else if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 2][skillBeingTaught] >= masteryLevelBeingTaught | |
2839 && byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 3][skillBeingTaught] >= masteryLevelBeingTaught) | |
2840 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[634], pClassNames[classBaseId + 2], pClassNames[classBaseId + 3]);//Вы должны достичь звания %s или %s для обучения этому уровню навыка. You have to be promoted to %s or %s to learn this skill level. | |
2841 else if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 2][skillBeingTaught] >= masteryLevelBeingTaught) | |
2842 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], pClassNames[classBaseId + 2]);//Вы должны достичь звания %s для обучения этому уровню навыка. You have to be promoted to %s to learn this skill level. | |
2843 else if (byte_4ED970_skill_learn_ability_by_class_table[classBaseId + 3][skillBeingTaught] >= masteryLevelBeingTaught) | |
2844 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[633], pClassNames[classBaseId + 3]);//Вы должны достичь звания %s для обучения этому уровню навыка. You have to be promoted to %s to learn this skill level. | |
2845 else | |
2846 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[632], pClassNames[pClassType]);//Этот уровень навыка не может быть постигнут классом %s. This skill level can not be learned by the %s class. | |
2847 return pTmpBuf.data(); | |
2848 } | |
2849 if (!activePlayer->CanAct()) | |
2850 return pNPCTopics[122].pText; //Not in your condition! | |
2851 pointsInSkill = activePlayer->pActiveSkills[skillBeingTaught]; | |
2852 pointsInSkillWOutMastery = pointsInSkill & 0x3F; | |
2853 if (!pointsInSkillWOutMastery) | |
2854 return pNPCTopics[131].pText; //You must know the skill before you can become an expert in it! | |
2855 skillMastery = SkillToMastery(pointsInSkill); | |
2856 if ((signed int)skillMastery > teacherLevel + 1) | |
2857 return pNPCTopics[teacherLevel + 128].pText; // You are already an SKILLLEVEL in this skill. | |
2858 dword_F8B1AC_award_bit_number = skillBeingTaught; | |
2859 if (masteryLevelBeingTaught == 2 && pointsInSkillWOutMastery < 4 | |
2860 || masteryLevelBeingTaught == 3 && pointsInSkillWOutMastery < 7 | |
2861 || masteryLevelBeingTaught == 4 && pointsInSkillWOutMastery < 10 | |
2862 ) | |
2863 return pNPCTopics[127].pText; //"You don't meet the requirements, and cannot be taught until you do." | |
2864 switch (dword_F8B1AC_award_bit_number) | |
2865 { | |
2866 case PLAYER_SKILL_STAFF: | |
2867 case PLAYER_SKILL_SWORD: | |
2868 case PLAYER_SKILL_DAGGER: | |
2869 case PLAYER_SKILL_AXE: | |
2870 case PLAYER_SKILL_SPEAR: | |
2871 case PLAYER_SKILL_BOW: | |
2872 case PLAYER_SKILL_MACE: | |
2873 case PLAYER_SKILL_ARMSMASTER: | |
2874 switch (masteryLevelBeingTaught) | |
2875 { | |
2876 case 2: | |
2877 gold_transaction_amount = 2000; | |
2878 break; | |
2879 case 3: | |
2880 gold_transaction_amount = 5000; | |
2881 break; | |
2882 case 4: | |
2883 gold_transaction_amount = 8000; | |
2884 break; | |
2885 } | |
2886 break; | |
2887 case PLAYER_SKILL_BLASTER: | |
2888 switch (masteryLevelBeingTaught) | |
2889 { | |
2890 case 2: | |
2891 gold_transaction_amount = 0; | |
2892 break; | |
2893 case 3: | |
2894 gold_transaction_amount = 0; | |
2895 break; | |
2896 case 4: | |
2897 gold_transaction_amount = 0; | |
2898 break; | |
2899 } | |
2900 break; | |
2901 case PLAYER_SKILL_SHIELD: | |
2902 case PLAYER_SKILL_LEATHER: | |
2903 case PLAYER_SKILL_CHAIN: | |
2904 case PLAYER_SKILL_PLATE: | |
2905 switch (masteryLevelBeingTaught) | |
2906 { | |
2907 case 2: | |
2908 gold_transaction_amount = 1000; | |
2909 break; | |
2910 case 3: | |
2911 gold_transaction_amount = 3000; | |
2912 break; | |
2913 case 4: | |
2914 gold_transaction_amount = 7000; | |
2915 break; | |
2916 } | |
2917 break; | |
2918 case PLAYER_SKILL_FIRE: | |
2919 case PLAYER_SKILL_AIR: | |
2920 case PLAYER_SKILL_WATER: | |
2921 case PLAYER_SKILL_EARTH: | |
2922 case PLAYER_SKILL_SPIRIT: | |
2923 case PLAYER_SKILL_MIND: | |
2924 case PLAYER_SKILL_BODY: | |
2925 switch (masteryLevelBeingTaught) | |
2926 { | |
2927 case 2: | |
2928 gold_transaction_amount = 1000; | |
2929 break; | |
2930 case 3: | |
2931 gold_transaction_amount = 4000; | |
2932 break; | |
2933 case 4: | |
2934 gold_transaction_amount = 8000; | |
2935 break; | |
2936 } | |
2937 break; | |
2938 case PLAYER_SKILL_LIGHT: | |
2939 switch (masteryLevelBeingTaught) | |
2940 { | |
2941 case 2: | |
2942 gold_transaction_amount = 2000; | |
2943 break; | |
2944 case 3: | |
2945 if (!(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 114)) | |
2946 return pNPCTopics[127].pText; | |
2947 gold_transaction_amount = 5000; | |
2948 break; | |
2949 case 4: | |
2950 if (!activePlayer->ProfessionOrGuildFlagsCorrect(0x22u, 1) || | |
2951 !activePlayer->ProfessionOrGuildFlagsCorrect(0x1Au, 1)) | |
2952 return pNPCTopics[127].pText; | |
2953 gold_transaction_amount = 8000; | |
2954 break; | |
2955 } | |
2956 break; | |
2957 case PLAYER_SKILL_DARK: | |
2958 switch (masteryLevelBeingTaught) | |
2959 { | |
2960 case 2: | |
2961 gold_transaction_amount = 2000; | |
2962 break; | |
2963 case 3: | |
2964 if (!(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 110)) | |
2965 return pNPCTopics[127].pText; | |
2966 gold_transaction_amount = 5000; | |
2967 break; | |
2968 case 4: | |
2969 if (!activePlayer->ProfessionOrGuildFlagsCorrect(0x23u, 1) | |
2970 || !activePlayer->ProfessionOrGuildFlagsCorrect(0x1Bu, 1)) | |
2971 return pNPCTopics[127].pText; | |
2972 gold_transaction_amount = 8000; | |
2973 break; | |
2974 } | |
2975 break; | |
2976 case PLAYER_SKILL_ITEM_ID: | |
2977 case PLAYER_SKILL_REPAIR: | |
2978 case PLAYER_SKILL_MEDITATION: | |
2979 case PLAYER_SKILL_PERCEPTION: | |
2980 case PLAYER_SKILL_TRAP_DISARM: | |
2981 case PLAYER_SKILL_MONSTER_ID: | |
2982 case PLAYER_SKILL_STEALING: | |
2983 case PLAYER_SKILL_ALCHEMY: | |
2984 switch (masteryLevelBeingTaught) | |
2985 { | |
2986 case 2: | |
2987 gold_transaction_amount = 500; | |
2988 break; | |
2989 case 3: | |
2990 gold_transaction_amount = 2500; | |
2991 break; | |
2992 case 4: | |
2993 gold_transaction_amount = 6000; | |
2994 break; | |
2995 } | |
2996 break; | |
2997 case PLAYER_SKILL_MERCHANT: | |
2998 switch (masteryLevelBeingTaught) | |
2999 { | |
3000 case 2: | |
3001 gold_transaction_amount = 2000; | |
3002 break; | |
3003 case 3: | |
3004 if (activePlayer->GetBaseWillpower() < 50) | |
3005 return pNPCTopics[127].pText; | |
3006 gold_transaction_amount = 5000; | |
3007 break; | |
3008 case 4: | |
3009 gold_transaction_amount = 8000; | |
3010 break; | |
3011 } | |
3012 break; | |
3013 case PLAYER_SKILL_BODYBUILDING: | |
3014 switch (masteryLevelBeingTaught) | |
3015 { | |
3016 case 2: | |
3017 gold_transaction_amount = 500; | |
3018 break; | |
3019 case 3: | |
3020 if (activePlayer->GetBaseEndurance() < 50) | |
3021 return pNPCTopics[127].pText; | |
3022 gold_transaction_amount = 2500; | |
3023 break; | |
3024 case 4: | |
3025 gold_transaction_amount = 6000; | |
3026 break; | |
3027 } | |
3028 break; | |
3029 case PLAYER_SKILL_DIPLOMACY: | |
3030 Error("Diplomacy not used"); | |
3031 break; | |
3032 case PLAYER_SKILL_TIEVERY: | |
3033 Error("Thievery not used"); | |
3034 break; | |
3035 case PLAYER_SKILL_DODGE: | |
3036 switch (masteryLevelBeingTaught) | |
3037 { | |
3038 case 2: | |
3039 gold_transaction_amount = 2000; | |
3040 break; | |
3041 case 3: | |
3042 gold_transaction_amount = 5000; | |
3043 break; | |
3044 case 4: | |
3045 if ((activePlayer->pActiveSkills[PLAYER_SKILL_UNARMED] & 63) < 0xA) | |
3046 return pNPCTopics[127].pText; | |
3047 gold_transaction_amount = 8000; | |
3048 break; | |
3049 } | |
3050 break; | |
3051 case PLAYER_SKILL_UNARMED: | |
3052 switch (masteryLevelBeingTaught) | |
3053 { | |
3054 case 2: | |
3055 gold_transaction_amount = 2000; | |
3056 break; | |
3057 case 3: | |
3058 gold_transaction_amount = 5000; | |
3059 break; | |
3060 case 4: | |
3061 if ((activePlayer->pActiveSkills[PLAYER_SKILL_DODGE] & 63) < 0xA) | |
3062 return pNPCTopics[127].pText; | |
3063 gold_transaction_amount = 8000; | |
3064 break; | |
3065 } | |
3066 break; | |
3067 case PLAYER_SKILL_LEARNING: | |
3068 switch (masteryLevelBeingTaught) | |
3069 { | |
3070 case 2: | |
3071 gold_transaction_amount = 2000; | |
3072 break; | |
3073 case 3: | |
3074 if (activePlayer->GetBaseIntelligence() < 50) | |
3075 return pNPCTopics[127].pText; | |
3076 gold_transaction_amount = 5000; | |
3077 break; | |
3078 case 4: | |
3079 gold_transaction_amount = 8000; | |
3080 break; | |
3081 } | |
3082 break; | |
3083 default: | |
3084 Error("Unknown skill"); | |
3085 } | |
3086 if (gold_transaction_amount > pParty->uNumGold) | |
3087 return pNPCTopics[124].pText; //You don't have enough gold! | |
3088 contract_approved = 1; | |
3089 if (masteryLevelBeingTaught == 2) | |
3090 { | |
3091 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534],//Получить степень ^Pr[%s] в навыке ^Pr[%s] за ^I[%lu] золот^L[ой;ых;ых] | |
3092 pGlobalTXT_LocalizationStrings[433], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Эксперт | |
3093 } | |
3094 else if (masteryLevelBeingTaught == 3) | |
3095 { | |
3096 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534], | |
3097 pGlobalTXT_LocalizationStrings[432], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Мастер | |
3098 } | |
3099 else if (masteryLevelBeingTaught == 4) | |
3100 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[534], | |
3101 pGlobalTXT_LocalizationStrings[225], pSkillNames[dword_F8B1AC_award_bit_number], gold_transaction_amount);//Великий Магистр | |
3102 return pTmpBuf2.data(); | |
3103 } | |
3104 | |
3105 //----- (00495461) -------------------------------------------------------- | |
3106 char *BuildDialogueString(const char *lpsz, unsigned __int8 uPlayerID, ItemGen *a3, char *a4, int a5, __int64 *a6) | |
3107 { | |
3108 Player *pPlayer; // ebx@3 | |
3109 const char *pText; // esi@7 | |
3110 int v17; // eax@10 | |
3111 signed __int64 v18; // qax@18 | |
3112 unsigned __int8 *v20; // ebx@32 | |
3113 int v21; // ecx@34 | |
3114 int pReputation; // eax@45 | |
3115 int v29; // eax@68 | |
3116 __int16 v55[56]; // [sp+10h] [bp-128h]@34 | |
3117 stru351_summoned_item v56; // [sp+80h] [bp-B8h]@107 | |
3118 char a1[100]; // [sp+B8h] [bp-80h]@3 | |
3119 int v63; // [sp+12Ch] [bp-Ch]@32 | |
3120 | |
3121 if (IsBadStringPtrA(lpsz, 1)) | |
3122 return "Invalid String Passed"; | |
3123 | |
3124 a1[0] = 0; | |
3125 pPlayer = &pParty->pPlayers[uPlayerID]; | |
3126 memset(pTmpBuf2.data(), 0, sizeof(pTmpBuf2)); | |
3127 | |
3128 NPCData *npc = nullptr; | |
3129 if (dword_5C35D4) | |
3130 npc = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0))]; //- 1 | |
3131 else | |
3132 npc = GetNPCData(sDialogue_SpeakingActorNPC_ID); | |
3133 | |
3134 //pText = a4; | |
3135 uint len = strlen(lpsz); | |
3136 for (int i = 0, dst = 0; i < len; ++i) | |
3137 { | |
3138 char c = lpsz[i]; | |
3139 if (c != '%') | |
3140 pTmpBuf2[dst++] = c; | |
3141 else | |
3142 { | |
3143 v17 = 10 * (int)(lpsz[i + 1] - '0') + lpsz[i + 2] - '0'; | |
3144 | |
3145 switch (v17) | |
3146 { | |
3147 case 1://Подробнее | |
3148 strcat(pTmpBuf2.data(), npc->pName); | |
3149 dst = strlen(pTmpBuf2.data()); | |
3150 i += 2; | |
3151 break; | |
3152 case 2: | |
3153 strcat(pTmpBuf2.data(), pPlayer->pName); | |
3154 dst = strlen(pTmpBuf2.data()); | |
3155 i += 2; | |
3156 break; | |
3157 case 3: | |
3158 case 4: | |
3159 strcat(pTmpBuf2.data(), a1); | |
3160 dst = strlen(pTmpBuf2.data()); | |
3161 i += 2; | |
3162 break; | |
3163 case 5: | |
3164 v18 = (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24; | |
3165 pText = pGlobalTXT_LocalizationStrings[397];// "evening" | |
3166 if (SHIDWORD(v18) <= 0 && SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 5 && SHIDWORD(v18) <= 0) | |
3167 { | |
3168 if (SHIDWORD(v18) >= 0 && (unsigned int)v18 >= 11) | |
3169 { | |
3170 if (v18 < 20) | |
3171 pText = pGlobalTXT_LocalizationStrings[396];// "day" | |
3172 } | |
3173 else | |
3174 { | |
3175 pText = pGlobalTXT_LocalizationStrings[395];// "morning" | |
3176 } | |
3177 } | |
3178 strcat(pTmpBuf2.data(), pText); | |
3179 dst = strlen(pTmpBuf2.data()); | |
3180 i += 2; | |
3181 break; | |
3182 case 6: | |
3183 if (pPlayer->uSex) | |
3184 pText = pGlobalTXT_LocalizationStrings[387];// "lady" | |
3185 else | |
3186 pText = pGlobalTXT_LocalizationStrings[385];// "sir" | |
3187 strcat(pTmpBuf2.data(), pText); | |
3188 dst = strlen(pTmpBuf2.data()); | |
3189 i += 2; | |
3190 break; | |
3191 case 7: | |
3192 if (pPlayer->uSex) | |
3193 pText = pGlobalTXT_LocalizationStrings[389];// "Lady" | |
3194 else | |
3195 pText = pGlobalTXT_LocalizationStrings[386];// "Sir" | |
3196 strcat(pTmpBuf2.data(), pText); | |
3197 dst = strlen(pTmpBuf2.data()); | |
3198 i += 2; | |
3199 break; | |
3200 case 8: | |
3201 v63 = 0; | |
3202 v20 = (unsigned __int8 *)pPlayer->_achieved_awards_bits; | |
3203 for (uint _i = 0; _i < 28; ++_i) | |
3204 { | |
3205 if ((unsigned __int16)_449B57_test_bit(v20, word_4EE150[i])) | |
3206 { | |
3207 v21 = v63; | |
3208 ++v63; | |
3209 v55[v63] = word_4EE150[i]; | |
3210 } | |
3211 } | |
3212 if (v63) | |
3213 { | |
3214 if (dword_A74CDC == -1) | |
3215 dword_A74CDC = rand() % v63; | |
3216 pText = (char *)pAwards[v55[dword_A74CDC]].pText;//(char *)dword_723E80_award_related[2 * v55[v24]]; | |
3217 } | |
3218 else | |
3219 pText = (char *)pNPCTopics[55].pText; | |
3220 strcat(pTmpBuf2.data(), pText); | |
3221 dst = strlen(pTmpBuf2.data()); | |
3222 i += 2; | |
3223 break; | |
3224 case 9: | |
3225 if (npc->uSex) | |
3226 pText = pGlobalTXT_LocalizationStrings[384];// "her" | |
3227 else | |
3228 pText = pGlobalTXT_LocalizationStrings[383];// "his" | |
3229 strcat(pTmpBuf2.data(), pText); | |
3230 dst = strlen(pTmpBuf2.data()); | |
3231 i += 2; | |
3232 break; | |
3233 case 10: | |
3234 if (pPlayer->uSex) | |
3235 pText = pGlobalTXT_LocalizationStrings[389];// "Lady" | |
3236 else | |
3237 pText = pGlobalTXT_LocalizationStrings[388];// "Lord" | |
3238 strcat(pTmpBuf2.data(), pText); | |
3239 dst = strlen(pTmpBuf2.data()); | |
3240 i += 2; | |
3241 break; | |
3242 case 11: | |
3243 pReputation = pParty->GetPartyReputation(); | |
3244 if (pReputation >= 25) | |
3245 pText = pGlobalTXT_LocalizationStrings[379]; | |
3246 else//v25 < 25 | |
3247 { | |
3248 if (pReputation < 6) | |
3249 { | |
3250 if (pReputation >= -5)//6 >= v25 >= -5 | |
3251 pText = pGlobalTXT_LocalizationStrings[399]; | |
3252 else// v25 < -5 | |
3253 { | |
3254 if (pReputation < -24)//-24 > v25 | |
3255 pText = pGlobalTXT_LocalizationStrings[434]; | |
3256 else// -5 > v25 > -24 | |
3257 pText = pGlobalTXT_LocalizationStrings[402]; | |
3258 } | |
3259 } | |
3260 else//25 > v25 > 6 | |
3261 pText = pGlobalTXT_LocalizationStrings[392]; | |
3262 } | |
3263 strcat(pTmpBuf2.data(), pText); | |
3264 dst = strlen(pTmpBuf2.data()); | |
3265 i += 2; | |
3266 break; | |
3267 case 12: | |
3268 pReputation = npc->rep; | |
3269 if (pReputation >= 25) | |
3270 pText = pGlobalTXT_LocalizationStrings[379];//Ненавистный | |
3271 else | |
3272 { | |
3273 if (pReputation < 6) | |
3274 { | |
3275 if (pReputation >= -5) | |
3276 pText = pGlobalTXT_LocalizationStrings[399];//Нейтральная | |
3277 else | |
3278 { | |
3279 if (pReputation < -24) | |
3280 pText = pGlobalTXT_LocalizationStrings[434];//Почтенная | |
3281 else | |
3282 pText = pGlobalTXT_LocalizationStrings[402];//Дружелюбный | |
3283 } | |
3284 } | |
3285 else | |
3286 pText = pGlobalTXT_LocalizationStrings[392];//Недружелюбный | |
3287 } | |
3288 strcat(pTmpBuf2.data(), pText); | |
3289 dst = strlen(pTmpBuf2.data()); | |
3290 i += 2; | |
3291 break; | |
3292 case 13: | |
3293 strcat(pTmpBuf2.data(), pNPCStats->sub_495366_MispronounceName(pPlayer->pName[0], pPlayer->uSex)); | |
3294 dst = strlen(pTmpBuf2.data()); | |
3295 i += 2; | |
3296 break; | |
3297 case 14: | |
3298 if (npc->uSex) | |
3299 pText = pGlobalTXT_LocalizationStrings[391];// "sister" | |
3300 else | |
3301 pText = pGlobalTXT_LocalizationStrings[390];// "brother" | |
3302 strcat(pTmpBuf2.data(), pText); | |
3303 dst = strlen(pTmpBuf2.data()); | |
3304 i += 2; | |
3305 break; | |
3306 case 15: | |
3307 strcat(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[393]);// "daughter" | |
3308 dst = strlen(pTmpBuf2.data()); | |
3309 i += 2; | |
3310 break; | |
3311 case 16: | |
3312 if (npc->uSex) | |
3313 pText = pGlobalTXT_LocalizationStrings[391];// "sister" | |
3314 else | |
3315 pText = pGlobalTXT_LocalizationStrings[390];// "brother" | |
3316 strcat(pTmpBuf2.data(), pText); | |
3317 dst = strlen(pTmpBuf2.data()); | |
3318 i += 2; | |
3319 break; | |
3320 case 17://текст наёмного НПС | |
3321 { | |
3322 uint pay_percentage = pNPCStats->pProfessions[npc->uProfession].uHirePrice / 100; | |
3323 if (!pay_percentage) | |
3324 pay_percentage = 1; | |
3325 sprintf(a1, "%lu", pay_percentage); | |
3326 strcat(pTmpBuf2.data(), a1); | |
3327 dst = strlen(pTmpBuf2.data()); | |
3328 i += 2; | |
3329 break; | |
3330 } | |
3331 case 18: | |
3332 case 19: | |
3333 case 20: | |
3334 case 21: | |
3335 case 22: | |
3336 case 26: | |
3337 strncpy(a1, lpsz + i + 1, 2); | |
3338 sprintf(a1, "%lu", atoi(a1)); | |
3339 strcat(pTmpBuf2.data(), a1); | |
3340 dst = strlen(pTmpBuf2.data()); | |
3341 i += 2; | |
3342 break; | |
3343 case 23: | |
3344 if (pMapStats->GetMapInfo(pCurrentMapName)) | |
3345 pText = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName; | |
3346 else | |
3347 pText = pGlobalTXT_LocalizationStrings[394];// "Unknown" | |
3348 strcat(pTmpBuf2.data(), pText); | |
3349 dst = strlen(pTmpBuf2.data()); | |
3350 i += 2; | |
3351 break; | |
3352 case 24://название товара в продаже | |
3353 sprintfex(a1, format_4E2D80, Color16(255, 255, 155), a3->GetDisplayName()); | |
3354 strcat(pTmpBuf2.data(), a1); | |
3355 dst = strlen(pTmpBuf2.data()); | |
3356 i += 2; | |
3357 break; | |
3358 case 25: | |
3359 v29 = pPlayer->GetBaseBuyingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3360 switch (a5) | |
3361 { | |
3362 case 3: | |
3363 v29 = pPlayer->GetBaseSellingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3364 break; | |
3365 case 4: | |
3366 v29 = pPlayer->GetBaseIdentifyPrice(p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3367 break; | |
3368 case 5: | |
3369 v29 = pPlayer->GetBaseRepairPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3370 break; | |
3371 case 6: | |
3372 v29 = pPlayer->GetBaseSellingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier) / 2; | |
3373 break; | |
3374 } | |
3375 sprintfex(a1, "%lu", v29); | |
3376 strcat(pTmpBuf2.data(), a1); | |
3377 dst = strlen(pTmpBuf2.data()); | |
3378 i += 2; | |
3379 break; | |
3380 case 27://текст продажи | |
3381 v29 = pPlayer->GetBuyingPrice(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3382 if (a5 == 3) | |
3383 { | |
3384 v29 = pPlayer->GetPriceSell(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3385 if (a3->IsBroken()) | |
3386 v29 = 1; | |
3387 sprintfex(a1, "%lu", v29); | |
3388 strcat(pTmpBuf2.data(), a1); | |
3389 dst = strlen(pTmpBuf2.data()); | |
3390 i += 2; | |
3391 break; | |
3392 } | |
3393 if (a5 != 4) | |
3394 { | |
3395 if (a5 == 5) | |
3396 v29 = pPlayer->GetPriceRepair(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier); | |
3397 else | |
3398 { | |
3399 if (a5 == 6) | |
3400 { | |
3401 v29 = pPlayer->GetPriceSell(a3->GetValue(), p2DEvents[(signed int)a4 - 1].fPriceMultiplier) / 2; | |
3402 if (a3->IsBroken()) | |
3403 v29 = 1; | |
3404 if (!v29) | |
3405 v29 = 1; | |
3406 sprintfex(a1, "%lu", v29); | |
3407 strcat(pTmpBuf2.data(), a1); | |
3408 dst = strlen(pTmpBuf2.data()); | |
3409 i += 2; | |
3410 break; | |
3411 } | |
3412 } | |
3413 sprintfex(a1, "%lu", v29); | |
3414 strcat(pTmpBuf2.data(), a1); | |
3415 dst = strlen(pTmpBuf2.data()); | |
3416 i += 2; | |
3417 break; | |
3418 } | |
3419 sprintfex(a1, "%lu", pPlayer->GetPriceIdentification(p2DEvents[(signed int)a4 - 1].fPriceMultiplier)); | |
3420 strcat(pTmpBuf2.data(), a1); | |
3421 dst = strlen(pTmpBuf2.data()); | |
3422 i += 2; | |
3423 break; | |
3424 case 28://профессия | |
3425 strcat(pTmpBuf2.data(), (char *)p2DEvents[(signed int)a4 - 1].pProprieterTitle); | |
3426 dst = strlen(pTmpBuf2.data()); | |
3427 i += 2; | |
3428 break; | |
3429 case 29: | |
3430 sprintfex(a1, "%lu", pPlayer->GetPriceIdentification(p2DEvents[(signed int)a4 - 1].fPriceMultiplier)); | |
3431 strcat(pTmpBuf2.data(), a1); | |
3432 dst = strlen(pTmpBuf2.data()); | |
3433 i += 2; | |
3434 break; | |
3435 case 30: | |
3436 if (!a6) | |
3437 { | |
3438 strcat(pTmpBuf2.data(), a4); | |
3439 dst = strlen(pTmpBuf2.data()); | |
3440 i += 2; | |
3441 break; | |
3442 } | |
3443 init_summoned_item(&v56, *a6); | |
3444 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year); | |
3445 strcat(pTmpBuf2.data(), a1); | |
3446 dst = strlen(pTmpBuf2.data()); | |
3447 i += 2; | |
3448 break; | |
3449 case 31: | |
3450 case 32: | |
3451 case 33: | |
3452 case 34: | |
3453 strcat(pTmpBuf2.data(), pParty->pPlayers[v17 - 31].pName); | |
3454 dst = strlen(pTmpBuf2.data()); | |
3455 i += 2; | |
3456 break; | |
3457 default: | |
3458 if (v17 <= 50 || v17 > 70) | |
3459 { | |
3460 strncpy(a1, lpsz + i + 1, 2); | |
3461 sprintf(a1, "%lu", atoi(a1)); | |
3462 strcat(pTmpBuf2.data(), a1); | |
3463 dst = strlen(pTmpBuf2.data()); | |
3464 i += 2; | |
3465 break; | |
3466 } | |
3467 if (v17 - 51 >= 20) | |
3468 { | |
3469 strcat(pTmpBuf2.data(), a4); | |
3470 dst = strlen(pTmpBuf2.data()); | |
3471 i += 2; | |
3472 break; | |
3473 } | |
3474 init_summoned_item(&v56, pParty->PartyTimes._s_times[v17 - 51]); | |
3475 sprintfex(a1, pGlobalTXT_LocalizationStrings[378], aMonthNames[v56.field_14_exprie_month], v56.field_C_expire_day + 1, v56.field_18_expire_year); | |
3476 strcat(pTmpBuf2.data(), a1); | |
3477 dst = strlen(pTmpBuf2.data()); | |
3478 i += 2; | |
3479 break; | |
3480 } | |
3481 } | |
3482 } | |
3483 return pTmpBuf2.data(); | |
3484 } | |
3485 | |
3486 //----- (0044C175) -------------------------------------------------------- | |
3487 void ShowStatusBarString(const char *pString, unsigned int uNumSeconds) | |
3488 { | |
3489 strcpy(GameUI_Footer_TimedString.data(), pString); | |
3490 GameUI_Footer_TimeLeft = 1000 * uNumSeconds + GetTickCount(); | |
3491 | |
3492 for (int i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); i > 450; | |
3493 i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data())) | |
3494 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0; | |
3495 } | |
3496 | |
3497 //----- (0044C1D0) -------------------------------------------------------- | |
3498 void ShowNothingHereStatus() | |
3499 { | |
3500 if (!GameUI_Footer_TimeLeft) | |
3501 ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2);// Nothing here | |
3502 } | |
3503 | |
3504 //----- (0044C28B) -------------------------------------------------------- | |
3505 int const_2() | |
3506 { | |
3507 return 2; | |
3508 } |