annotate GUI/UI/UiGame.cpp @ 2572:d87bfbd3bb3b

Step towards unification of Texture and RGBTexture (class Image)
author a.parshin
date Sat, 05 Mar 2016 01:51:54 +0200
parents 30eb6dcac768
children 0c67be4ec900
rev   line source
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1 #define _CRTDBG_MAP_ALLOC
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
3 #include <stdlib.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
4 #include <crtdbg.h>
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
5
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
6 #include "Engine/Engine.h"
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
7 #include "Engine/Events.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
8 #include "Engine/Graphics/Texture.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
9 #include "Engine/Graphics/Vis.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
10 #include "Engine/MapInfo.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
11 #include "Engine/Party.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
12 #include "Engine/Graphics/Outdoor.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
13 #include "Engine/LOD.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
14 #include "Engine/Objects/Actor.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
15 #include "Engine/Graphics/Viewport.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
16 #include "Engine/Objects/SpriteObject.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
17 #include "Engine/Objects/ObjectList.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
18 #include "Engine/Graphics/DecorationList.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
19 #include "Engine/Tables/PlayerFrameTable.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
20 #include "Engine/stru123.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
21 #include "Engine/Timer.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
22 #include "Engine/Tables/IconFrameTable.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
23 #include "Engine/TurnEngine/TurnEngine.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
24 #include "Engine/texts.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
25 #include "Engine/Graphics/Sprites.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
26 #include "Engine/Graphics/PaletteManager.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
27 #include "Engine/Graphics/BSPModel.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
28 #include "Engine/OurMath.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
29 #include "Engine/Graphics/Level/Decoration.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
30 #include "Engine/Objects/Chest.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
31 #include "Engine/Graphics/Overlays.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
32
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
33 #include "Game/Game.h"
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
34
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
35 #include "IO/Mouse.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
36 #include "IO/Keyboard.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
37
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
38 #include "GUI/GUIWindow.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
39 #include "GUI/GUIFont.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
40 #include "GUI/UI/UIHouses.h"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
41 #include "GUI/UI/UIGame.h"
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
42 #include "GUI/UI/UICharacter.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
43
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
44 #include "Media/Audio/AudioPlayer.h"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
45
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
46 int uTextureID_GameUI_CharSelectionFrame; // 50C98C
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
47
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
48
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
49 Image *game_ui_statusbar = nullptr;
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
50 Image *game_ui_rightframe = nullptr;
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
51 Image *game_ui_topframe = nullptr;
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
52 Image *game_ui_leftframe = nullptr;
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
53 Image *game_ui_bottomframe = nullptr;
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
54
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
55
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
56 GUIWindow_GameMenu::GUIWindow_GameMenu() :
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
57 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
58 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
59 // -----------------------
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
60 // GameMenuUI_Load -- part
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
61 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
62 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
63 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
64 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
65 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
66 uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
67 uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
68
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
69 pBtn_NewGame = CreateButton(
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
70 0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
71 pGlobalTXT_LocalizationStrings[614],// "New Game"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
72 pIcons_LOD->GetTexture(uTextureID_New1),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
73 0
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
74 );
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
75 pBtn_SaveGame = CreateButton(
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
76 0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
77 pGlobalTXT_LocalizationStrings[615],// "Save Game"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
78 pIcons_LOD->GetTexture(uTextureID_Save1),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
79 0
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
80 );
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
81 pBtn_LoadGame = CreateButton(
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
82 19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
83 pGlobalTXT_LocalizationStrings[616],// "Load Game"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
84 pIcons_LOD->GetTexture(uTextureID_Load1),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
85 0
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
86 );
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
87 pBtn_GameControls = CreateButton(
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
88 241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
89 pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:""
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
90 pIcons_LOD->GetTexture(uTextureID_Controls1),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
91 0
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
92 );
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
93 pBtn_QuitGame = CreateButton(
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
94 241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
95 pGlobalTXT_LocalizationStrings[618],// "Quit"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
96 pIcons_LOD->GetTexture(uTextureID_Quit1),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
97 0
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
98 );
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
99 pBtn_Resume = CreateButton(
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
100 241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
101 pGlobalTXT_LocalizationStrings[619],// "Return to Game"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
102 pIcons_LOD->GetTexture(uTextureID_Resume1),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
103 0
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
104 );
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
105 _41D08F_set_keyboard_control_group(6, 1, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
106 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
107
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
108 void GUIWindow_GameMenu::Update()
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
109 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
110 // -----------------------------------
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
111 // 004156F0 GUI_UpdateWindows --- part
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
112 pRenderer->DrawTextureIndexed(
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
113 pViewport->uViewportTL_Y,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
114 pViewport->uViewportTL_X,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
115 pIcons_LOD->GetTexture(uTextureID_Options)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
116 );
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
117 viewparams->bRedrawGameUI = 1;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
118 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
119
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
120
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
121
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
122
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
123
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
124
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
125 std::array<bool, 28> GameMenuUI_InvaligKeyBindingsFlags; // 506E6C
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
126 //----- (00414D24) --------------------------------------------------------
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
127 static unsigned int GameMenuUI_GetKeyBindingColor(int key_index)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
128 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
129 if (uGameMenuUI_CurentlySelectedKeyIdx == key_index)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
130 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
131 if (GetTickCount() % 1000 < 500)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
132 return ui_gamemenu_keys_key_selection_blink_color_1;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
133 else
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
134 return ui_gamemenu_keys_key_selection_blink_color_2;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
135 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
136 else if (GameMenuUI_InvaligKeyBindingsFlags[key_index])
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
137 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
138 int intensity;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
139
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
140 int time = GetTickCount() % 800;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
141 if (time < 400)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
142 intensity = -70 + 70 * time / 400;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
143 else
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
144 intensity = +70 - 70 * time / 800;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
145
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
146 return Color16(185 + intensity, 40 + intensity / 4, 40 + intensity / 4);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
147 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
148
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
149 return ui_gamemenu_keys_key_default_color;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
150 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
151
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
152
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
153
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
154 GUIWindow_GameKeyBindings::GUIWindow_GameKeyBindings():
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
155 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
156 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
157 // ------------------------------------------
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
158 // GameMenuUI_OptionsKeymapping_Load --- part
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
159 uTextureID_Optkb[0] = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
160 uTextureID_Optkb[1] = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
161 uTextureID_Optkb[2] = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
162 uTextureID_Optkb[3] = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
163 uTextureID_Optkb[4] = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
164
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
165 CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
166
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
167 CreateButton(19, 302, 108, 20, 1, 0, UIMSG_SelectKeyPage1, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
168 CreateButton(127, 302, 108, 20, 1, 0, UIMSG_SelectKeyPage2, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
169 CreateButton(127, 324, 108, 20, 1, 0, UIMSG_ResetKeyMapping, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
170 CreateButton(19, 324, 108, 20, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
171
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
172 CreateButton(129, 148, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
173 CreateButton(129, 167, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 1, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
174 CreateButton(129, 186, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 2, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
175 CreateButton(129, 205, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 3, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
176 CreateButton(129, 224, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 4, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
177 CreateButton(129, 243, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 5, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
178 CreateButton(129, 262, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 6, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
179
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
180 CreateButton(350, 148, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 7, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
181 CreateButton(350, 167, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 8, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
182 CreateButton(350, 186, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 9, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
183 CreateButton(350, 205, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 10, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
184 CreateButton(350, 224, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 11, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
185 CreateButton(350, 243, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 12, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
186 CreateButton(350, 262, 70, 19, 1, 0, UIMSG_ChangeKeyButton, 13, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
187
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
188 uGameMenuUI_CurentlySelectedKeyIdx = -1;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
189 KeyboardPageNum = 1;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
190 memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
191 memcpy(pPrevVirtualCidesMapping.data(), pKeyActionMap->pVirtualKeyCodesMapping, 0x78u);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
192 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
193
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
194 //----- (004142D3) --------------------------------------------------------
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
195 void GUIWindow_GameKeyBindings::Update()
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
196 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
197 // -----------------------------------
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
198 // 004156F0 GUI_UpdateWindows --- part
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
199 signed int v4; // ecx@7
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
200 signed int v5; // eax@8
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
201
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
202 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
203 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
204 pPrevVirtualCidesMapping[uGameMenuUI_CurentlySelectedKeyIdx] = pKeyActionMap->pPressedKeysBuffer[0];
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
205 memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
206 v4 = 0;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
207 do
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
208 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
209 v5 = 0;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
210 do
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
211 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
212 if (v4 != v5 && pPrevVirtualCidesMapping[v4] == pPrevVirtualCidesMapping[v5])
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
213 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
214 GameMenuUI_InvaligKeyBindingsFlags[v4] = true;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
215 GameMenuUI_InvaligKeyBindingsFlags[v5] = true;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
216 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
217 ++v5;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
218 } while (v5 < 28);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
219 ++v4;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
220 } while (v4 < 28);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
221 uGameMenuUI_CurentlySelectedKeyIdx = -1;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
222 pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
223 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
224 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Optkb[0]));//draw base texture
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
225 if (KeyboardPageNum == 1)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
226 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
227 pRenderer->DrawTextureIndexed(19, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[3]));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
228
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
229 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, ui_gamemenu_keys_action_name_color, "ÂÏÅШÄ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
230 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, GameMenuUI_GetKeyBindingColor(0), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[0]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
231 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, ui_gamemenu_keys_action_name_color, "ÍÀÇÀÄ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
232 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 163, GameMenuUI_GetKeyBindingColor(1), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[1]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
233 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 184, ui_gamemenu_keys_action_name_color, "ÂËÅÂÎ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
234 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 184, GameMenuUI_GetKeyBindingColor(2), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[2]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
235 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 205, ui_gamemenu_keys_action_name_color, "ÂÏÐÀÂÎ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
236 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 205, GameMenuUI_GetKeyBindingColor(3), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[3]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
237 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 226, ui_gamemenu_keys_action_name_color, "ÊÐÈÊ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
238 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 226, GameMenuUI_GetKeyBindingColor(4), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[4]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
239 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 247, ui_gamemenu_keys_action_name_color, "ÏÐÛÆÎÊ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
240 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 247, GameMenuUI_GetKeyBindingColor(5), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[5]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
241 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 268, ui_gamemenu_keys_action_name_color, "Ï.ÐÅÆÈÌ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
242 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 268, GameMenuUI_GetKeyBindingColor(6), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[6]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
243 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 142, ui_gamemenu_keys_action_name_color, "ÏÐÈÌ. ÇÀÊË.", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
244 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 142, GameMenuUI_GetKeyBindingColor(7), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[7]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
245 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 163, ui_gamemenu_keys_action_name_color, "ÀÒÀÊÀ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
246 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 163, GameMenuUI_GetKeyBindingColor(8), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[8]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
247 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 184, ui_gamemenu_keys_action_name_color, "ÄÅÉÑÒÂ.", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
248 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 184, GameMenuUI_GetKeyBindingColor(9), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[9]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
249 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 205, ui_gamemenu_keys_action_name_color, "ÇÀÊËÈÍ.", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
250 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 205, GameMenuUI_GetKeyBindingColor(10), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[10]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
251 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 226, ui_gamemenu_keys_action_name_color, "ÈÃÐÎÊ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
252 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 226, GameMenuUI_GetKeyBindingColor(11), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[11]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
253 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 247, ui_gamemenu_keys_action_name_color, "ÑËÅÄ. ÈÃÐÎÊ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
254 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 247, GameMenuUI_GetKeyBindingColor(12), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[12]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
255 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 268, ui_gamemenu_keys_action_name_color, "ÇÀÄÀÍÈß", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
256 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 268, GameMenuUI_GetKeyBindingColor(13), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[13]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
257 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
258 else
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
259 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
260 pRenderer->DrawTextureIndexed(127, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[4]));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
261
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
262 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, ui_gamemenu_keys_action_name_color, "Á. ÑÏÐÀÂÊÀ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
263 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, GameMenuUI_GetKeyBindingColor(14), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[14]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
264 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, ui_gamemenu_keys_action_name_color, "ÎÒÄÛÕ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
265 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 163, GameMenuUI_GetKeyBindingColor(15), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[15]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
266 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 184, ui_gamemenu_keys_action_name_color, "ÒÅÊ. ÂÐÅÌß", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
267 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 184, GameMenuUI_GetKeyBindingColor(16), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[16]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
268 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 205, ui_gamemenu_keys_action_name_color, "ÀÂÒÎÇÀÌÅÒÊÈ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
269 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 205, GameMenuUI_GetKeyBindingColor(17), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[17]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
270 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 226, ui_gamemenu_keys_action_name_color, "ÊÀÐÒÀ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
271 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 226, GameMenuUI_GetKeyBindingColor(18), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[18]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
272 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 247, ui_gamemenu_keys_action_name_color, "ÁÅÆÀÒÜ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
273 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 247, GameMenuUI_GetKeyBindingColor(19), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[19]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
274 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 268, ui_gamemenu_keys_action_name_color, "ÑÌ. ÂÂÅÐÕ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
275 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 268, GameMenuUI_GetKeyBindingColor(20), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[20]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
276 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 142, ui_gamemenu_keys_action_name_color, "ÑÌ. ÂÍÈÇ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
277 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 142, GameMenuUI_GetKeyBindingColor(21), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[21]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
278 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 163, ui_gamemenu_keys_action_name_color, "ÑÌ. ÂÏÅШÄ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
279 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 163, GameMenuUI_GetKeyBindingColor(22), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[22]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
280 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 184, ui_gamemenu_keys_action_name_color, "ÏÐÈÁËÈÇ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
281 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 184, GameMenuUI_GetKeyBindingColor(23), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[23]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
282 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 205, ui_gamemenu_keys_action_name_color, "ÎÒÄÀËÈÒÜ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
283 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 205, GameMenuUI_GetKeyBindingColor(24), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[24]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
284 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 226, ui_gamemenu_keys_action_name_color, "Ï. ÂÂÅÐÕ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
285 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 226, GameMenuUI_GetKeyBindingColor(25), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[25]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
286 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 247, ui_gamemenu_keys_action_name_color, "Ï. ÂÍÈÇ", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
287 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 247, GameMenuUI_GetKeyBindingColor(26), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[26]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
288 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 268, ui_gamemenu_keys_action_name_color, "ÏÐÈÇÅÌË", 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
289 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 268, GameMenuUI_GetKeyBindingColor(27), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[27]), 0, 0, 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
290 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
291 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
292
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
293
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
294
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
295 GUIWindow_GameVideoOptions::GUIWindow_GameVideoOptions() :
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
296 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
297 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
298 // -------------------------------------
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
299 // GameMenuUI_OptionsVideo_Load --- part
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
300 optvid_base_texture_id = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
301 bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
302 us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
303 tinting_texture_id = pIcons_LOD->LoadTexture("opvdH-tn", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
304 uTextureID_507C20 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
305 uTextureID_507C24 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
306 pTextureIDs_GammaPositions[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
307 pTextureIDs_GammaPositions[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
308 pTextureIDs_GammaPositions[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
309 pTextureIDs_GammaPositions[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
310 pTextureIDs_GammaPositions[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
311 pTextureIDs_GammaPositions[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
312 pTextureIDs_GammaPositions[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
313 pTextureIDs_GammaPositions[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
314 pTextureIDs_GammaPositions[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
315 pTextureIDs_GammaPositions[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
316 not_available_bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
317 not_available_us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
318 not_available_tinting_texture_id = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
319
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
320 CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
321 //if ( pRenderer->pRenderD3D )
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
322 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
323 CreateButton(0x13u, 0x118u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleBloodsplats, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
324 CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
325 CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
326 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
327 /*if ( !pRenderer->bWindowMode )
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
328 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
329 //v0 = 1;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
330 if ( pRenderer->IsGammaSupported() )
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
331 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
332 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 4u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C20), 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
333 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 5u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C24), 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
334 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
335 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
336 }*/
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
337 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
338
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
339
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
340
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
341 //----- (00414D9A) --------------------------------------------------------
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
342 void GUIWindow_GameVideoOptions::Update()
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
343 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
344 // -----------------------------------
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
345 // 004156F0 GUI_UpdateWindows --- part
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
346 GUIWindow msg_window; // [sp+8h] [bp-54h]@3
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
347
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
348 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(optvid_base_texture_id));//draw base texture
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
349 //if ( !pRenderer->bWindowMode && pRenderer->IsGammaSupported() )
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
350 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
351 pRenderer->DrawTextureIndexed(17 * uGammaPos + 42, 162, pIcons_LOD->GetTexture(pTextureIDs_GammaPositions[uGammaPos]));
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
352 pRenderer->DrawTextureNew(274/640.0f, 169/480.0f, gamma_preview_image);
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
353 msg_window.uFrameX = 22;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
354 msg_window.uFrameY = 190;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
355 msg_window.uFrameWidth = 211;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
356 msg_window.uFrameHeight = 79;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
357 msg_window.uFrameZ = 232;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
358 msg_window.uFrameW = 268;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
359 msg_window.DrawTitleText(pFontSmallnum, 0, 0, ui_gamemenu_video_gamma_title_color, pGlobalTXT_LocalizationStrings[226], 3); // "Gamma controls the relative ""brightness"" of the game. May vary depending on your monitor."
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
360 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
361
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
362 /*if (!pRenderer->pRenderD3D)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
363 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
364 pRenderer->DrawTextureIndexed(20, 281, pIcons_LOD->GetTexture(not_available_bloodsplats_texture_id));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
365 pRenderer->DrawTextureIndexed(20, 303, pIcons_LOD->GetTexture(not_available_us_colored_lights_texture_id));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
366 pRenderer->DrawTextureIndexed(20, 325, pIcons_LOD->GetTexture(not_available_tinting_texture_id));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
367 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
368 else*/
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
369 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
370 if (pEngine->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
371 pRenderer->DrawTextureIndexed(20, 281, pIcons_LOD->GetTexture(bloodsplats_texture_id));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
372 if (pRenderer->bUseColoredLights)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
373 pRenderer->DrawTextureIndexed(20, 303, pIcons_LOD->GetTexture(us_colored_lights_texture_id));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
374 if (pRenderer->bTinting)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
375 pRenderer->DrawTextureIndexed(20, 325, pIcons_LOD->GetTexture(tinting_texture_id));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
376 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
377 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
378
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
379
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
380
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
381
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
382
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
383
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
384
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
385
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
386
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
387
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
388
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
389
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
390
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
391
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
392 OptionsMenuSkin options_menu_skin; // 507C60
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
393 OptionsMenuSkin::OptionsMenuSkin() :
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
394 uTextureID_Background(0),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
395 uTextureID_ArrowLeft(0),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
396 uTextureID_ArrowRight(0),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
397 uTextureID_unused_0(0), uTextureID_unused_1(0), uTextureID_unused_2(0),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
398 uTextureID_FlipOnExit(0),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
399 uTextureID_AlwaysRun(0),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
400 uTextureID_WalkSound(0),
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
401 uTextureID_ShowDamage(0)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
402 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
403 for (uint i = 0; i < 3; ++i) uTextureID_TurnSpeed[i] = 0;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
404 for (uint i = 0; i < 10; ++i) uTextureID_SoundLevels[i] = 0;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
405 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
406
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
407 void OptionsMenuSkin::Relaease()
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
408 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
409 #define RELEASE(id) \
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
410 {\
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
411 if (id)\
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
412 pIcons_LOD->GetTexture(id)->Release();\
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
413 id = 0;\
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
414 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
415
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
416 RELEASE(uTextureID_Background);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
417 for (uint i = 0; i < 3; ++i)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
418 RELEASE(uTextureID_TurnSpeed[i]);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
419 RELEASE(uTextureID_ArrowLeft);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
420 RELEASE(uTextureID_ArrowRight);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
421 RELEASE(uTextureID_FlipOnExit);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
422 for (uint i = 0; i < 10; ++i)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
423 RELEASE(uTextureID_SoundLevels[i]);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
424 RELEASE(uTextureID_AlwaysRun);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
425 RELEASE(uTextureID_WalkSound);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
426 RELEASE(uTextureID_ShowDamage);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
427
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
428 #undef RELEASE
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
429 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
430
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
431
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
432 GUIWindow_GameOptions::GUIWindow_GameOptions() :
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
433 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
434 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
435 // GameMenuUI_Options_Load -- part
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
436 options_menu_skin.uTextureID_Background = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
437 options_menu_skin.uTextureID_TurnSpeed[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
438 options_menu_skin.uTextureID_TurnSpeed[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
439 options_menu_skin.uTextureID_TurnSpeed[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
440 options_menu_skin.uTextureID_ArrowLeft = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
441 options_menu_skin.uTextureID_ArrowRight = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
442 options_menu_skin.uTextureID_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
443 options_menu_skin.uTextureID_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
444 options_menu_skin.uTextureID_SoundLevels[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
445 options_menu_skin.uTextureID_SoundLevels[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
446 options_menu_skin.uTextureID_SoundLevels[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
447 options_menu_skin.uTextureID_SoundLevels[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
448 options_menu_skin.uTextureID_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
449 options_menu_skin.uTextureID_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
450 options_menu_skin.uTextureID_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
451 options_menu_skin.uTextureID_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
452 options_menu_skin.uTextureID_FlipOnExit = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
453 options_menu_skin.uTextureID_AlwaysRun = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
454 options_menu_skin.uTextureID_ShowDamage = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
455 options_menu_skin.uTextureID_WalkSound = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
456
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
457 CreateButton(22, 270,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
458 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
459 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
460 1, 0, UIMSG_SetTurnSpeed, 0x80, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
461 CreateButton(93, 270,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
462 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
463 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
464 1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
465 CreateButton(164, 270,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
466 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
467 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
468 1, 0, UIMSG_SetTurnSpeed, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
469
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
470 CreateButton(20, 303,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
471 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
472 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
473 1, 0, UIMSG_ToggleWalkSound, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
474 CreateButton(128, 303,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
475 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
476 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
477 1, 0, UIMSG_ToggleShowDamage, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
478 CreateButton(20, 325,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
479 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
480 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
481 1, 0, UIMSG_ToggleAlwaysRun, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
482 CreateButton(128, 325,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
483 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
484 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight,
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
485 1, 0, UIMSG_ToggleFlipOnExit, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
486
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
487 pBtn_SliderLeft = CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
488 pBtn_SliderRight = CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
489 CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
490
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
491 pBtn_SliderLeft = CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
492 pBtn_SliderRight = CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
493 CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
494
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
495 pBtn_SliderLeft = CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
496 pBtn_SliderRight = CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
497 CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
498
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
499 CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game"
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
500 CreateButton(19, 140, 214, 40, 1, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
501 CreateButton(19, 194, 214, 40, 1, 0, UIMSG_OpenVideoOptions, 0, 86, "", 0);
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
502 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
503
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
504
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
505
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
506
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
507 //----- (00414F82) --------------------------------------------------------
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
508 void GUIWindow_GameOptions::Update()
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
509 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
510 // -----------------------------------
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
511 // 004156F0 GUI_UpdateWindows --- part
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
512 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Options));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
513 pRenderer->DrawTextureIndexed(8, 132, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_Background));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
514
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
515 switch (uTurnSpeed)
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
516 {
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
517 case 64: pRenderer->DrawTextureIndexed(BtnTurnCoord[1], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])); break;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
518 case 128: pRenderer->DrawTextureIndexed(BtnTurnCoord[2], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])); break;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
519 default: pRenderer->DrawTextureIndexed(BtnTurnCoord[0], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])); break;
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
520 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
521
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
522 if (bWalkSound) pRenderer->DrawTextureIndexed(20, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
523 if (bShowDamage) pRenderer->DrawTextureIndexed(128, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
524 if (bFlipOnExit) pRenderer->DrawTextureIndexed(128, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
525 if (bAlwaysRun) pRenderer->DrawTextureIndexed(20, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
526
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
527 pRenderer->DrawTextureIndexed(265 + 17 * uSoundVolumeMultiplier, 162, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uSoundVolumeMultiplier]));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
528 pRenderer->DrawTextureIndexed(265 + 17 * uMusicVolimeMultiplier, 216, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uMusicVolimeMultiplier]));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
529 pRenderer->DrawTextureIndexed(265 + 17 * uVoicesVolumeMultiplier, 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uVoicesVolumeMultiplier]));
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
530 }
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
531
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
532
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
533
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
534
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
535
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
536
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
537
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
538
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
539
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
540
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
541 //----- (00421D00) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
542 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
543 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
544 Player* player = &pParty->pPlayers[uPlayerID - 1];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
545 if (pParty->pPickedItem.uItemID)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
546 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
547 if (int slot = player->AddItem(-1, pParty->pPickedItem.uItemID))
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
548 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
549 memcpy(&player->pInventoryItemList[slot-1], &pParty->pPickedItem, 0x24u);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
550 viewparams->bRedrawGameUI = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
551 pMouse->RemoveHoldingItem();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
552 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
553 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
554
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
555 if (!player->CanAct())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
556 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
557 player = pPlayers[uActiveCharacter];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
558 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
559 if( player->CanAct() || !pPlayers[uActiveCharacter]->CanAct() )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
560 player->PlaySound(SPEECH_NoRoom, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
561 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
562
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
563 if (current_screen_type == SCREEN_GAME)
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
564 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
565 viewparams->bRedrawGameUI = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
566 if ( uActiveCharacter != uPlayerID )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
567 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
568 if ( pPlayers[uPlayerID]->uTimeToRecovery )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
569 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
570
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
571 uActiveCharacter = uPlayerID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
572 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
573 }
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
574 pGUIWindow_CurrentMenu = new GUIWindow_CharacterRecord(uActiveCharacter, SCREEN_CHARACTERS);//CharacterUI_Initialize(SCREEN_CHARACTERS);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
575 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
576 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
577 if ( current_screen_type == SCREEN_SPELL_BOOK )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
578 return;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
579 if ( current_screen_type == SCREEN_CHEST )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
580 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
581 viewparams->bRedrawGameUI = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
582 if ( uActiveCharacter == uPlayerID )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
583 {
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
584 current_character_screen_window = WINDOW_CharacterWindow_Inventory;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
585 current_screen_type = SCREEN_CHEST_INVENTORY;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
586 uActiveCharacter = uPlayerID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
587 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
588 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
589 if ( pPlayers[uPlayerID]->uTimeToRecovery )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
590 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
591 uActiveCharacter = uPlayerID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
592 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
593 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
594 if ( current_screen_type != SCREEN_HOUSE )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
595 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
596 if ( current_screen_type == SCREEN_E )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
597 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
598 uActiveCharacter = uPlayerID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
599 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
600 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
601 if ( current_screen_type != SCREEN_CHEST_INVENTORY )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
602 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
603 viewparams->bRedrawGameUI = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
604 uActiveCharacter = uPlayerID;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
605 if (current_character_screen_window == WINDOW_CharacterWindow_Awards)
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
606 FillAwardsData();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
607 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
608 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
609 viewparams->bRedrawGameUI = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
610 if ( uActiveCharacter == uPlayerID )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
611 {
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
612 current_character_screen_window = WINDOW_CharacterWindow_Inventory;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
613 current_screen_type = SCREEN_CHEST_INVENTORY;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
614 uActiveCharacter = uPlayerID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
615 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
616 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
617 if ( pPlayers[uPlayerID]->uTimeToRecovery )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
618 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
619 uActiveCharacter = uPlayerID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
620 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
621 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
622 if ( window_SpeakInHouse->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
623 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
624 viewparams->bRedrawGameUI = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
625 if ( uActiveCharacter != uPlayerID )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
626 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
627 uActiveCharacter = uPlayerID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
628 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
629 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
630 if (dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD || dialog_menu_id == HOUSE_DIALOGUE_SHOP_6)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
631 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
632 __debugbreak(); // fix indexing
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
633 current_character_screen_window = WINDOW_CharacterWindow_Inventory;
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
634 pGUIWindow_CurrentMenu = new GUIWindow_CharacterRecord(uActiveCharacter, SCREEN_E);//CharacterUI_Initialize(SCREEN_E);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
635 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
636 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
637 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
638
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
639 //----- (00416B01) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
640 void GameUI_DrawNPCPopup(void *_this)//PopupWindowForBenefitAndJoinText
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
641 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
642 int v1; // edi@2
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
643 NPCData *pNPC; // eax@16
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
644 const CHAR *pText; // eax@18
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
645 char *v11; // esi@26
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
646 GUIWindow popup_window; // [sp+Ch] [bp-60h]@23
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
647 int a2; // [sp+60h] [bp-Ch]@16
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
648 LPCSTR lpsz; // [sp+68h] [bp-4h]@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
649
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
650 if ( bNoNPCHiring != 1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
651 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
652 v1 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
653 /*do
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
654 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
655 if ( v3->pName )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
656 pTmpBuf[v1++] = v2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
657 ++v3;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
658 ++v2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
659 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
660 while ( (signed int)v3 < (signed int)&pParty->pPickedItem );*/
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
661 for (int i = 0; i < 2; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
662 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
663 if (pParty->pHirelings[i].pName)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
664 pTmpBuf[v1++] = i;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
665 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
666 lpsz = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
667 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
668 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
669 /*v4 = pNPCStats->pNewNPCData;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
670 do
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
671 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
672 if ( v4->uFlags & 0x80
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
673 && (!pParty->pHirelings[0].pName || strcmp(v4->pName, pParty->pHirelings[0].pName))
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
674 && (!pParty->pHirelings[1].pName || strcmp(v4->pName, pParty->pHirelings[1].pName)) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
675 pTmpBuf[v1++] = (char)lpsz + 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
676 ++lpsz;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
677 ++v4;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
678 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
679 while ( (signed int)lpsz < (signed int)pNPCStats->uNumNewNPCs );*/
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
680 for ( uint i = 0; i < pNPCStats->uNumNewNPCs; ++i )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
681 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
682 if (pNPCStats->pNewNPCData[i].Hired())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
683 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
684 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName))
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
685 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
686 if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName))
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
687 pTmpBuf[v1++] = i + 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
688 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
689 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
690 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
691 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
692 if ( (signed int)((char *)_this + pParty->hirelingScrollPosition) < v1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
693 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
694 sDialogue_SpeakingActorNPC_ID = -1 - pParty->hirelingScrollPosition - (int)_this;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
695 pNPC = GetNewNPCData(sDialogue_SpeakingActorNPC_ID, &a2);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
696 if ( pNPC )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
697 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
698 if ( a2 == 57 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
699 pText = pNPCTopics[512].pText; // Baby dragon
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
700 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
701 pText = (const CHAR *)pNPCStats->pProfessions[pNPC->uProfession].pBenefits;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
702 lpsz = pText;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
703 if ( !pText )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
704 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
705 lpsz = (LPCSTR)pNPCStats->pProfessions[pNPC->uProfession].pJoinText;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
706 if ( !lpsz )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
707 lpsz = "";
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
708 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
709 popup_window.Hint = nullptr;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
710 popup_window.uFrameX = 38;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
711 popup_window.uFrameY = 60;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
712 popup_window.uFrameWidth = 276;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
713 popup_window.uFrameZ = 313;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
714 popup_window.uFrameHeight = pFontArrus->CalcTextHeight(lpsz, &popup_window, 0, 0) + 2 * LOBYTE(pFontArrus->uFontHeight) + 24;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
715 if ( (signed int)popup_window.uFrameHeight < 130 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
716 popup_window.uFrameHeight = 130;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
717 popup_window.uFrameWidth = 400;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
718 popup_window.uFrameZ = popup_window.uFrameX + 399;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
719 popup_window.DrawMessageBox(0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
720 sprintfex(pTmpBuf2.data(), "NPC%03d", pNPC->uPortraitID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
721 pRenderer->DrawTextureIndexed(popup_window.uFrameX + 22, popup_window.uFrameY + 36,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
722 (Texture *)(pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE) != -1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
723 ? &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE)] : 0));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
724 if ( pNPC->uProfession )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
725 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
726 v11 = pTmpBuf.data();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
727 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
728 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
729 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
730 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
731 v11 = pTmpBuf.data();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
732 strcpy(pTmpBuf.data(), pNPC->pName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
733 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
734 popup_window.DrawTitleText(pFontArrus, 0, 12, Color16(0xFFu, 0xFFu, 0x9Bu), v11, 3);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
735 popup_window.uFrameWidth -= 24;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
736 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
737 popup_window.DrawText(pFontArrus, 100, 36, 0, BuildDialogueString((char *)lpsz, uActiveCharacter - 1, 0, 0, 0, 0), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
738 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
739 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
740 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
741 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
742
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
743 //----- (00445D4A) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
744 void GameUI_InitializeDialogue(Actor *actor, int bPlayerSaysHello)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
745 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
746 NPCData *pNPCInfo; // ebp@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
747 int v9; // esi@8
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
748 int pNumberContacts; // eax@11
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
749 char pContainer[32]; // [sp+14h] [bp-28h]@3
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
750
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
751 dword_A74CDC = -1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
752 pNPCStats->dword_AE336C_LastMispronouncedNameFirstLetter = -1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
753 pEventTimer->Pause();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
754 pMiscTimer->Pause();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
755 pAudioPlayer->StopChannels(-1, -1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
756 uDialogueType = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
757 sDialogue_SpeakingActorNPC_ID = actor->sNPC_ID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
758 pDialogue_SpeakingActor = actor;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
759 pNPCInfo = GetNPCData(actor->sNPC_ID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
760 if ( (pNPCInfo->uFlags & 3) != 2 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
761 pNPCInfo->uFlags = pNPCInfo->uFlags + 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
762
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
763 switch (pParty->alignment)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
764 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
765 case PartyAlignment_Good: sprintfex(pContainer, "evt%02d-b", const_2()); break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
766 case PartyAlignment_Neutral: sprintfex(pContainer, "evt%02d", const_2()); break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
767 case PartyAlignment_Evil: sprintfex(pContainer, "evt%02d-c", const_2()); break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
768 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
769
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
770 pDialogueNPCCount = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
771 uNumDialogueNPCPortraits = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
772 pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
773 sprintfex(pContainer, "npc%03u", pNPCInfo->uPortraitID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
774 v9 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
775 pDialogueNPCPortraits[0] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
776 dword_591084 = areWeLoadingTexture;
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
777 right_panel_loop = right_panel;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
778 if ( !pNPCInfo->Hired() && pNPCInfo->Location2D >= 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
779 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
780 if ( (signed int)pParty->GetPartyFame() <= pNPCInfo->fame
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
781 || (pNumberContacts = pNPCInfo->uFlags & 0xFFFFFF7F, (pNumberContacts & 0x80000000u) != 0) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
782 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
783 v9 = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
784 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
785 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
786 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
787 if ( pNumberContacts > 1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
788 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
789 if ( pNumberContacts == 2 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
790 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
791 v9 = 3;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
792 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
793 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
794 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
795 if ( pNumberContacts != 3 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
796 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
797 if ( pNumberContacts != 4 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
798 v9 = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
799 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
800 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
801 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
802 v9 = 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
803 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
804 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
805 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
806 else if ( pNPCInfo->rep )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
807 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
808 v9 = 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
809 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
810 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
811 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
812 if (sDialogue_SpeakingActorNPC_ID < 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
813 v9 = 4;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
814 pDialogueWindow = new GUIWindow_Dialogue(0, 0, window->GetWidth(), window->GetHeight(), 3, 0);//pNumberContacts = 1, v9 = 0; pNumberContacts = 2, v9 = 3;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
815 if (pNPCInfo->Hired() && !pNPCInfo->bHasUsedTheAbility)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
816 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
817 if (pNPCInfo->uProfession == 10 || //Healer
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
818 pNPCInfo->uProfession == 11 || //Expert Healer
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
819 pNPCInfo->uProfession == 12 || //Master Healer
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
820 pNPCInfo->uProfession == 33 || //Cook
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
821 pNPCInfo->uProfession == 34 || //Chef
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
822 pNPCInfo->uProfession == 39 || //Wind Master
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
823 pNPCInfo->uProfession == 40 || //Water Master
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
824 pNPCInfo->uProfession == 41 || //Gate Master
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
825 pNPCInfo->uProfession == 42 || //Chaplain
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
826 pNPCInfo->uProfession == 43 || //Piper
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
827 pNPCInfo->uProfession == 52 //Fallen Wizard
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
828 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
829 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
830 pDialogueWindow->CreateButton(480, 250, 140, LOBYTE(pFontArrus->uFontHeight) - 3, 1, 0, UIMSG_SelectNPCDialogueOption, 9, 0, "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
831 pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
832 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
833 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
834
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
835 pDialogueWindow->CreateButton( 61, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 1, '1', "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
836 pDialogueWindow->CreateButton(177, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 2, '2', "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
837 pDialogueWindow->CreateButton(292, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 3, '3', "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
838 pDialogueWindow->CreateButton(407, 424, 31, 40, 2, 94, UIMSG_SelectCharacter, 4, '4', "", 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
839
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
840 if (bPlayerSaysHello && uActiveCharacter && !pNPCInfo->Hired())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
841 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
842 if (pParty->uCurrentHour < 5 || pParty->uCurrentHour > 21)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
843 pPlayers[uActiveCharacter]->PlaySound(SPEECH_GoodEvening, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
844 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
845 pPlayers[uActiveCharacter]->PlaySound(SPEECH_GoodDay, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
846 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
847 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
848
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
849 //----- (00445350) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
850 void GameUI_DrawDialogue()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
851 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
852 NPCData *pNPC; // ebx@2
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
853 int pGreetType; // eax@2
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
854 int pTextHeight; // esi@39
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
855 GUIButton *pButton; // eax@43
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
856 int all_text_height; // ebx@93
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
857 signed int index; // esi@99
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
858 int v42; // edi@102
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
859 int v45;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
860 unsigned __int16 pTextColor; // ax@104
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
861 GUIWindow window; // [sp+ACh] [bp-68h]@42
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
862 // GUIFont *pOutString; // [sp+10Ch] [bp-8h]@39
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
863 const char *pInString=nullptr; // [sp+110h] [bp-4h]@32
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
864
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
865 if ( !pDialogueWindow )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
866 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
867
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
868 // Window title(Çàãîëîâîê îêíà)----
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
869 memcpy(&window, pDialogueWindow, sizeof(window));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
870 pNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
871 pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
872 window.uFrameWidth -= 10;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
873 window.uFrameZ -= 10;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
874 pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
875 pRenderer->DrawTextureIndexedAlpha(468, 0, right_panel_loop);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
876 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
877 pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
878
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
879 if (pNPC->uProfession)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
880 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
881 assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames.data())); // sometimes buffer overflows; errors emerge both here and in dialogue text
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
882 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
883 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
884 else if (pNPC->pName)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
885 strcpy(pTmpBuf.data(), pNPC->pName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
886
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
887 window.DrawTitleText(pFontArrus, 483, 112, ui_game_dialogue_npc_name_color, pTmpBuf.data(), 3);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
888 pParty->GetPartyFame();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
889
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
890 pInString = nullptr;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
891 switch (uDialogueType)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
892 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
893 case DIALOGUE_13:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
894 pInString = BuildDialogueString(pNPCStats->pProfessions[pNPC->uProfession].pJoinText, uActiveCharacter - 1, 0, 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
895 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
896
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
897 case DIALOGUE_PROFESSION_DETAILS:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
898 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
899 //auto prof = pNPCStats->pProfessions[pNPC->uProfession];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
900
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
901 if (dialogue_show_profession_details)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
902 pInString = BuildDialogueString(pNPCStats->pProfessions[pNPC->uProfession].pBenefits, uActiveCharacter - 1, 0, 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
903 else if (pNPC->Hired())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
904 pInString = BuildDialogueString(pNPCStats->pProfessions[pNPC->uProfession].pDismissText, uActiveCharacter - 1, 0, 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
905 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
906 pInString = BuildDialogueString(pNPCStats->pProfessions[pNPC->uProfession].pJoinText, uActiveCharacter - 1, 0, 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
907 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
908 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
909
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
910
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
911 case DIALOGUE_ARENA_WELCOME:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
912 pInString = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death. Remember, you are only allowed one arena combat per visit. To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
913 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
914
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
915 case DIALOGUE_ARENA_FIGHT_NOT_OVER_YET:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
916 pInString = pGlobalTXT_LocalizationStrings[577]; //"Get back in there you wimps:"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
917 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
918
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
919 case DIALOGUE_ARENA_REWARD:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
920 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[576], gold_transaction_amount);// "Congratulations on your win: here's your stuff: %u gold."
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
921 pInString = pTmpBuf.data();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
922 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
923
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
924 case DIALOGUE_ARENA_ALREADY_WON:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
925 pInString = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
926 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
927
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
928 default:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
929 if (uDialogueType > DIALOGUE_18 && uDialogueType < DIALOGUE_EVT_E && !byte_5B0938[0])
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
930 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
931 pInString = (char *)current_npc_text;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
932 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
933 else if (pGreetType == 1)//QuestNPC_greet
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
934 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
935 if (pNPC->greet)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
936 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
937 if ((pNPC->uFlags & 3) == 2)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
938 pInString = pNPCStats->pNPCGreetings[pNPC->greet].pGreeting2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
939 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
940 pInString = pNPCStats->pNPCGreetings[pNPC->greet].pGreeting1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
941 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
942 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
943 else if (pGreetType == 2)//HiredNPC_greet
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
944 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
945 NPCProfession* prof = &pNPCStats->pProfessions[pNPC->uProfession];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
946
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
947 if (pNPC->Hired())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
948 pInString = BuildDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
949 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
950 pInString = BuildDialogueString(prof->pJoinText, uActiveCharacter - 1, 0, 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
951 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
952 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
953 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
954
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
955 // Message window(Îêíî ñîîáùåíèÿ)----
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
956 if (pInString)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
957 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
958 window.uFrameWidth = game_viewport_width;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
959 window.uFrameZ = 452;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
960 GUIFont* font = pFontArrus;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
961 pTextHeight = pFontArrus->CalcTextHeight(pInString, &window, 13, 0) + 7;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
962 if ( 352 - pTextHeight < 8 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
963 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
964 font = pFontCreate;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
965 pTextHeight = pFontCreate->CalcTextHeight(pInString, &window, 13, 0) + 7;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
966 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
967 if (uTextureID_Leather != -1)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
968 pRenderer->GetLeather(8, 352 - pTextHeight, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - pTextHeight);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
969 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
970 pDialogueWindow->DrawText(font, 13, 354 - pTextHeight, 0, FitTextInAWindow(pInString, font, &window, 13, 0), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
971 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
972 // Right panel(Ïðàâàÿ ïàíåëü)-------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
973 memcpy(&window, pDialogueWindow, sizeof(window));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
974 window.uFrameX = 483;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
975 window.uFrameWidth = 148;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
976 window.uFrameZ = 334;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
977 for (int i = window.pStartingPosActiveItem; i < window.pStartingPosActiveItem + window.pNumPresenceButton; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
978 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
979 pButton = window.GetControl(i);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
980 if ( !pButton )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
981 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
982
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
983 if ( pButton->msg_param > 88 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
984 pButton->pButtonName[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
985 else if (pButton->msg_param == 88)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
986 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[581]); // Lord
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
987 else if (pButton->msg_param == 87)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
988 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[580]); // Knight
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
989 else if (pButton->msg_param == 86)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
990 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[579]); // Squire
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
991 else if (pButton->msg_param == 85)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
992 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[578]); // Page
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
993 else if (pButton->msg_param == 77)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
994 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[407]); // Details
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
995 else if (pButton->msg_param == 76)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
996 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
997 if (pNPC->Hired())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
998 sprintf(pButton->pButtonName, (const char*)pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
999 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1000 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[406]); // Hire
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1001 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1002 else if (pButton->msg_param == 24)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1003 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1004 __debugbreak(); // learn conditions of this event
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1005 if (!pNPC->evt_F)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1006 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1007 pButton->pButtonName[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1008 pButton->msg_param = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1009 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1010 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1011 strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_F].pTopic);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1012 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1013 else if (pButton->msg_param == 9)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1014 strcpy(pButton->pButtonName, GetProfessionActionText(pNPC->uProfession));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1015 else if (pButton->msg_param == 19) // Scavenger Hunt
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1016 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1017 if (!pNPC->evt_A)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1018 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1019 pButton->pButtonName[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1020 pButton->msg_param = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1021 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1022 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1023 strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_A].pTopic);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1024 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1025 else if (pButton->msg_param == 20) // Scavenger Hunt
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1026 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1027 if (!pNPC->evt_B)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1028 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1029 pButton->pButtonName[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1030 pButton->msg_param = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1031 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1032 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_B].pTopic);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1033 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1034 else if (pButton->msg_param == 21)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1035 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1036 //__debugbreak(); // learn conditions of this event
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1037 if (!pNPC->evt_C)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1038 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1039 pButton->pButtonName[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1040 pButton->msg_param = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1041 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1042 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_C].pTopic);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1043 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1044 else if (pButton->msg_param == 22)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1045 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1046 //__debugbreak(); // learn conditions of this event
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1047 if (!pNPC->evt_D)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1048 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1049 pButton->pButtonName[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1050 pButton->msg_param = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1051 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1052 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_D].pTopic);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1053 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1054 else if (pButton->msg_param == 23)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1055 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1056 //__debugbreak(); // learn conditions of this event
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1057 if (!pNPC->evt_E)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1058 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1059 pButton->pButtonName[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1060 pButton->msg_param = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1061 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1062 else strcpy(pButton->pButtonName, pNPCTopics[pNPC->evt_E].pTopic);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1063 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1064 else if (pButton->msg_param == 13)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1065 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1066 if (pNPC->Hired())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1067 sprintf(pButton->pButtonName, pGlobalTXT_LocalizationStrings[408], pNPC->pName); // Release %s
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1068 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1069 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[122]); // Join
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1070 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1071 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1072 pButton->pButtonName[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1073
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1074 if (pParty->field_7B5_in_arena_quest && pParty->field_7B5_in_arena_quest != -1)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1075 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1076 int num_dead_actors = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1077 pInString = nullptr;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1078 for ( uint i = 0; i < uNumActors; ++i )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1079 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1080 if (pActors[i].uAIState == Dead || pActors[i].uAIState == Removed || pActors[i].uAIState == Disabled)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1081 ++num_dead_actors;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1082 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1083 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1084 int sumonner_type = PID_TYPE(pActors[i].uSummonerID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1085 if (sumonner_type == OBJECT_Player)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1086 ++num_dead_actors;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1087 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1088 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1089 if (num_dead_actors == uNumActors)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1090 strcpy(pButton->pButtonName, pGlobalTXT_LocalizationStrings[658]); // Collect Prize
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1091 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1092 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1093
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1094 // Install Buttons(Óñòàíîâêà êíîïîê)--------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1095 index = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1096 all_text_height = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1097 for ( int i = pDialogueWindow->pStartingPosActiveItem;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1098 i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++i )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1099 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1100 pButton = pDialogueWindow->GetControl(i);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1101 if ( !pButton )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1102 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1103 all_text_height += pFontArrus->CalcTextHeight(pButton->pButtonName, &window, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1104 index++;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1105 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1106 if ( index )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1107 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1108 v45 = (174 - all_text_height) / index;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1109 if ( v45 > 32 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1110 v45 = 32;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1111 v42 = (174 - v45 * index - all_text_height)/ 2 - v45 / 2 + 138;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1112 for ( int i = pDialogueWindow->pStartingPosActiveItem;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1113 i < pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem; ++i )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1114 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1115 pButton = pDialogueWindow->GetControl(i);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1116 if ( !pButton )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1117 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1118 pButton->uY = (unsigned int)(v45 + v42);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1119 pTextHeight = pFontArrus->CalcTextHeight(pButton->pButtonName, &window, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1120 pButton->uHeight = pTextHeight;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1121 v42 = pButton->uY + pTextHeight - 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1122 pButton->uW = v42;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1123 pTextColor = ui_game_dialogue_option_normal_color;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1124 if ( pDialogueWindow->pCurrentPosActiveItem == i )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1125 pTextColor = ui_game_dialogue_option_highlight_color;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1126 window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pButton->pButtonName, 3);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1127 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1128 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1129 pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1130 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1131
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1132 //----- (00444FBE) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1133 void GameUI_DrawBranchlessDialogue()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1134 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1135 int pTextHeight; // esi@4
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1136 char Str[200]; // [sp+Ch] [bp-120h]@12
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1137 GUIWindow BranchlessDlg_window; // [sp+D4h] [bp-58h]@4
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1138 GUIFont *pFont; // [sp+128h] [bp-4h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1139
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1140 pFont = pFontArrus;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1141 if ( current_npc_text && !byte_5B0938[0] )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1142 strcpy(byte_5B0938.data(), current_npc_text);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1143 BranchlessDlg_window.uFrameWidth = game_viewport_width;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1144 BranchlessDlg_window.uFrameZ = 452;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1145 pTextHeight = pFontArrus->CalcTextHeight(byte_5B0938.data(), &BranchlessDlg_window, 12, 0) + 7;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1146 if ( 352 - pTextHeight < 8 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1147 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1148 pFont = pFontCreate;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1149 pTextHeight = pFontCreate->CalcTextHeight(byte_5B0938.data(), &BranchlessDlg_window, 12, 0) + 7;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1150 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1151 pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1152 pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1153 pGUIWindow2->DrawText(pFont, 12, 354 - pTextHeight, 0, FitTextInAWindow(byte_5B0938.data(), pFont, &BranchlessDlg_window, 12, 0), 0, 0, 0);
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1154 pRenderer->DrawTextureNew(0, 352/480.0f, game_ui_statusbar);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1155 if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1156 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1157 if ( pGUIWindow2->receives_keyboard_input_2 == WINDOW_INPUT_CONFIRMED)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1158 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1159 pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1160 strcpy(GameUI_Footer_TimedString.data(), pKeyActionMap->pPressedKeysBuffer);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1161 sub_4452BB();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1162 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1163 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1164 if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_CANCELLED)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1165 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1166 pGUIWindow2->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1167 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1168 sub_4452BB();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1169 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1170 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1171 if ( pGUIWindow2->ptr_1C == (void *)26 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1172 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1173 sprintf(Str, "%s %s", GameUI_Footer_TimedString, pKeyActionMap->pPressedKeysBuffer);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1174 pGUIWindow2->DrawText(pFontLucida, 13, 357, 0, Str, 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1175 pGUIWindow2->DrawFlashingInputCursor(pFontLucida->GetLineWidth(Str) + 13, 357, pFontLucida);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1176 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1177 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1178 if ( pKeyActionMap->pPressedKeysBuffer[0] )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1179 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1180 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1181 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1182 sub_4452BB();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1183 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1184 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1185 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1186
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1187 //----- (004443D5) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1188 const char *GameUI_GetMinimapHintText()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1189 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1190 double v3; // st7@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1191 int v7; // eax@4
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1192 const char *v14; // eax@8
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1193 char *result; // eax@12
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1194 unsigned int pMapID; // eax@14
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1195 int global_coord_X; // [sp+10h] [bp-1Ch]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1196 int global_coord_Y; // [sp+14h] [bp-18h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1197 unsigned int pY; // [sp+1Ch] [bp-10h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1198 unsigned int pX; // [sp+28h] [bp-4h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1199
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1200 result = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1201 pMouse->GetClickPos(&pX, &pY);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1202 v3 = 1.0 / (float)((signed int)viewparams->uMinimapZoom * 0.000015258789);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1203 global_coord_X = (signed __int64)((double)(pX - 557) * v3 + (double)pParty->vPosition.x);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1204 global_coord_Y = (signed __int64)((double)pParty->vPosition.y - (double)(pY - 74) * v3);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1205 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor || pOutdoor->uNumBModels <= 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1206 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1207 pMapID = pMapStats->GetMapInfo(pCurrentMapName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1208 if ( pMapID == 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1209 result = "No Maze Info for this maze on file!";
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1210 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1211 result = pMapStats->pInfos[pMapID].pName;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1212 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1213 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1214 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1215 for ( uint j = 0; j < (uint)pOutdoor->uNumBModels; ++j )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1216 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1217 v7 = int_get_vector_length(abs((signed)pOutdoor->pBModels[j].vBoundingCenter.x - global_coord_X),
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1218 abs((signed)pOutdoor->pBModels[j].vBoundingCenter.y - global_coord_Y), 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1219 if ( v7 < 2 * pOutdoor->pBModels[j].sBoundingRadius )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1220 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1221 if ( pOutdoor->pBModels[j].uNumFaces )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1222 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1223 for ( uint i = 0; i < (uint)pOutdoor->pBModels[j].uNumFaces; ++i )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1224 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1225 if ( pOutdoor->pBModels[j].pFaces[i].sCogTriggeredID )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1226 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1227 if ( !(pOutdoor->pBModels[j].pFaces[i].uAttributes & FACE_HAS_EVENT) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1228 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1229 v14 = GetEventHintString(pOutdoor->pBModels[j].pFaces[i].sCogTriggeredID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1230 if ( v14 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1231 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1232 if ( _stricmp(v14, "") )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1233 result = (char *)v14;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1234 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1235 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1236 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1237 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1238 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1239 if ( result )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1240 return result;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1241 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1242 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1243 pMapID = pMapStats->GetMapInfo(pCurrentMapName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1244 if ( pMapID == 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1245 result = "No Maze Info for this maze on file!";
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1246 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1247 result = pMapStats->pInfos[pMapID].pName;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1248 return result;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1249 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1250 return result;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1251 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1252
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1253 //----- (0041D3B7) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1254 void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1255 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1256 Texture *v13; // eax@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1257 PlayerFrame *v15; // eax@12
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1258 unsigned int pTextColor; // eax@15
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1259 const char *v29; // eax@16
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1260 int v36; // esi@22
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1261 const char *v39; // eax@24
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1262 signed int uFramesetID; // [sp+20h] [bp-8h]@9
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1263 int uFramesetIDa; // [sp+20h] [bp-8h]@18
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1264
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1265 uint numActivePlayerBuffs = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1266 for (uint i = 0; i < 24; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1267 if (player->pPlayerBuffs[i].uExpireTime > 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1268 ++numActivePlayerBuffs;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1269
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1270 window->uFrameHeight = ((pFontArrus->uFontHeight + 162) + ((numActivePlayerBuffs - 1) * pFontArrus->uFontHeight));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1271 window->uFrameZ = window->uFrameWidth + window->uFrameX - 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1272 window->uFrameW = ((pFontArrus->uFontHeight + 162) + ((numActivePlayerBuffs - 1) * pFontArrus->uFontHeight)) + window->uFrameY - 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1273 window->DrawMessageBox(0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1274
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1275 if (player->IsEradicated())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1276 v13 = pTexture_PlayerFaceEradicated;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1277 else if (player->IsDead())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1278 v13 = pTexture_PlayerFaceDead;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1279 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1280 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1281 uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1282 if ( !uFramesetID )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1283 uFramesetID = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1284 if ( player->expression == CHARACTER_EXPRESSION_21)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1285 v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1286 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1287 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, pMiscTimer->Time());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1288 player->field_1AA2 = v15->uTextureID - 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1289 v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1290 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1291
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
1292 pRenderer->DrawTextureIndexedAlpha(window->uFrameX + 24, window->uFrameY + 24, v13);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1293
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1294 sprintfex(pTmpBuf.data(), "\f%05d", ui_character_header_text_color);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1295 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1296 strcat(pTmpBuf.data(), pTmpBuf2.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1297 strcat(pTmpBuf.data(), "\f00000\n");
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1298
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1299 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sHealth, player->GetMaxHealth());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1300 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[108], // "Hit Points"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1301 pTextColor, player->sHealth, player->GetMaxHealth());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1302 strcat(pTmpBuf.data(), pTmpBuf2.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1303
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1304 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sMana, player->GetMaxMana());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1305 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[212], // "Spell Points"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1306 pTextColor, player->sMana, player->GetMaxMana());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1307 strcat(pTmpBuf.data(), pTmpBuf2.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1308
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1309 pTextColor = player->GetMajorConditionIdx();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1310 sprintfex(pTmpBuf2.data(), "%s: \f%05d%s\f00000\n", pGlobalTXT_LocalizationStrings[47], // "Condition
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1311 GetConditionDrawColor(pTextColor), aCharacterConditionNames[pTextColor]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1312 strcat(pTmpBuf.data(), pTmpBuf2.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1313
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1314 if ( player->uQuickSpell )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1315 v29 = pSpellStats->pInfos[player->uQuickSpell].pShortName;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1316 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1317 v29 = pGlobalTXT_LocalizationStrings[153];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1318 sprintfex(pTmpBuf2.data(), "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1319 strcat(pTmpBuf.data(), pTmpBuf2.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1320
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1321 window->DrawText(pFontArrus, 120, 22, 0, pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1322
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1323 uFramesetIDa = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1324 for (uint i = 0; i < 24; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1325 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1326 SpellBuff* buff = &player->pPlayerBuffs[i];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1327 if (buff->uExpireTime > 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1328 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1329 v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1330 window->DrawText(pFontComic, 52, v36, ui_game_character_record_playerbuff_colors[i], aSpellNames[20 + i], 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1331 DrawBuff_remaining_time_string(v36, window, buff->uExpireTime - pParty->uTimePlayed, pFontComic);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1332 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1333 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1334
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1335 v39 = "";
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1336 if ( uFramesetIDa == 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1337 v39 = pGlobalTXT_LocalizationStrings[153]; // "None"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1338 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1339 window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf.data(), 0, 0, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1340 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1341
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1342 //----- (0041AD6E) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1343 void GameUI_DrawRightPanelItems()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1344 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1345 if ( (unsigned long long)GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1346 GameUI_RightPanel_BookFlashTimer = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1347
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1348 if ( pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1349 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1350 GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1351
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1352 static bool _50697C_book_flasher = false; // 50697C
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1353 _50697C_book_flasher = !_50697C_book_flasher;
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1354 if (_50697C_book_flasher && current_screen_type != SCREEN_REST )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1355 {
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
1356 if (bFlashQuestBook) pRenderer->DrawTextureIndexedAlpha(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A));
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
1357 if (bFlashAutonotesBook) pRenderer->DrawTextureIndexedAlpha(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A));
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
1358 if (bFlashHistoryBook) pRenderer->DrawTextureIndexedAlpha(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A));
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1359 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1360 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1361 {
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1362 pRenderer->DrawTextureNew(468/640.0f, 0, game_ui_rightframe);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1363 GameUI_DrawHiredNPCs();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1364 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1365 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1366 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1367
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1368 //----- (0041AEBB) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1369 void GameUI_DrawFoodAndGold()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1370 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1371 int text_y; // esi@2
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1372
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1373 if ( uGameState != GAME_STATE_FINAL_WINDOW )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1374 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1375 text_y = _44100D_should_alter_right_panel() != 0 ? 381 : 322;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1376 sprintf(pTmpBuf.data(), "\r087%lu", pParty->uNumFoodRations);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1377 pPrimaryWindow->DrawText(pFontSmallnum, 0, text_y, uGameUIFontMain, pTmpBuf.data(), 0, 0, uGameUIFontShadow);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1378 sprintf(pTmpBuf.data(), "\r028%lu", pParty->uNumGold);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1379 pPrimaryWindow->DrawText(pFontSmallnum, 0, text_y, uGameUIFontMain, pTmpBuf.data(), 0, 0, uGameUIFontShadow);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1380 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1381 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1382
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1383 //----- (0041B0C9) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1384 void GameUI_DrawLifeManaBars()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1385 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1386 double v3; // st7@3
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1387 double v7; // st7@25
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1388 Texture *pTextureHealth; // [sp-4h] [bp-30h]@10
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1389 Texture *pTextureMana; // [sp+Ch] [bp-20h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1390
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1391 pTextureMana = pIcons_LOD->GetTexture(uTextureID_BarBlue);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1392 for (uint i = 0; i < 4; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1393 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1394 if (pParty->pPlayers[i].sHealth > 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1395 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1396 int v17 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1397 if (i == 2 || i == 3)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1398 v17 = 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1399 v3 = (double)pParty->pPlayers[i].sHealth / (double)pParty->pPlayers[i].GetMaxHealth();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1400 if( v3 > 0.5 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1401 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1402 if ( v3 > 1.0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1403 v3 = 1.0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1404 pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarGreen);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1405 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1406 else if ( v3 > 0.25 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1407 pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarYellow);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1408 else if ( v3 > 0.0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1409 pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarRed);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1410 if( v3 > 0.0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1411 {
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
1412 pRenderer->SetUIClipRect(v17 + pHealthBarPos[i], (signed __int64)((1.0 - v3) * pTextureHealth->uTextureHeight) + 402,
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1413 v17 + pHealthBarPos[i] + pTextureHealth->uTextureWidth, pTextureHealth->uTextureHeight + 402);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1414 pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[i], 402, pTextureHealth);
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
1415 pRenderer->ResetUIClipRect();
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1416 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1417 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1418 if (pParty->pPlayers[i].sMana > 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1419 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1420 v7 = pParty->pPlayers[i].sMana / (double)pParty->pPlayers[i].GetMaxMana();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1421 if ( v7 > 1.0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1422 v7 = 1.0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1423 int v17 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1424 if (i == 2)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1425 v17 = 1;
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
1426 pRenderer->SetUIClipRect(v17 + pManaBarPos[i], (signed __int64)((1.0 - v7) * pTextureMana->uTextureHeight) + 402,
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1427 v17 + pManaBarPos[i] + pTextureMana->uTextureWidth, pTextureMana->uTextureHeight + 402);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1428 pRenderer->DrawTextureIndexed(v17 + pManaBarPos[i], 402, pTextureMana);
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
1429 pRenderer->ResetUIClipRect();
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1430 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1431 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1432 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1433
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1434 //----- (0041B3B6) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1435 void GameUI_DrawRightPanel()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1436 {
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1437 pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportBR_X, 0, right_panel);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1438 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1439
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1440 //----- (0041B3E2) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1441 void GameUI_DrawRightPanelFrames()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1442 {
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1443 pRenderer->DrawTextureNew(0, 0, game_ui_topframe);
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1444 pRenderer->DrawTextureNew(0, 8/480.0f, game_ui_leftframe);
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1445 pRenderer->DrawTextureNew(468/640.0f, 0, game_ui_rightframe);
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1446 pRenderer->DrawTextureNew(0, 352 / 480.0f, game_ui_bottomframe);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1447 GameUI_DrawFoodAndGold();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1448 GameUI_DrawRightPanelItems();
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1449
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1450 //pRenderer->EndScene();
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1451 //pRenderer->Present();
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1452 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1453
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1454 //----- (0041C047) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1455 void GameUI_Footer_2()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1456 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1457 char *v1; // edx@2
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1458 int v5; // eax@5
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1459
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1460 pRenderer->DrawTextureNew(0, 352/480.0f, game_ui_statusbar);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1461 if (GameUI_Footer_TimeLeft)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1462 v1 = GameUI_Footer_TimedString.data();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1463 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1464 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1465 if (!pFooterString[0])
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1466 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1467 v1 = pFooterString.data();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1468 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1469
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1470 v5 = pFontLucida->AlignText_Center(450, v1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1471 pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1472 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1473
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1474 //----- (0041C0B8) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1475 void GameUI_SetFooterString(const char *pStr)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1476 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1477 const char *v1; // esi@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1478
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1479 v1 = pStr;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1480 if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(pStr, 1) && (*v1 || GameUI_Footer_TimeLeft) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1481 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1482 if ( GameUI_Footer_TimeLeft )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1483 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1484 for ( int i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()); i > 450; i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data()) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1485 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1486 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1487 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1488 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1489 strcpy(pFooterString.data(), v1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1490 for ( int j = pFontLucida->GetLineWidth(pFooterString.data()); j > 450; j = pFontLucida->GetLineWidth(pFooterString.data()) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1491 pFooterString[strlen(pFooterString.data()) - 1] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1492 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1493 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1494 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1495
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1496 //----- (0041C179) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1497 void GameUI_Footer()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1498 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1499 char *v1; // edi@5
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1500 int v2; // eax@5
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1501 int v6; // eax@9
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1502 char v9; // zf@12
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1503
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1504 if ( pFooterString[0] || GameUI_Footer_TimeLeft || bForceDrawFooter )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1505 {
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
1506 pRenderer->DrawTextureNew(0, 352/480.0f, game_ui_statusbar);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1507 if ( GameUI_Footer_TimeLeft )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1508 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1509 v1 = GameUI_Footer_TimedString.data();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1510 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1511 while ( v2 > 450 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1512 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1513 GameUI_Footer_TimedString[strlen(GameUI_Footer_TimedString.data()) - 1] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1514 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1515 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1516 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1517 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1518 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1519 v1 = pFooterString.data();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1520 v6 = pFontLucida->GetLineWidth(pFooterString.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1521 while ( v6 > 450 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1522 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1523 pFooterString[strlen(pFooterString.data()) - 1] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1524 v6 = pFontLucida->GetLineWidth(pFooterString.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1525 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1526 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1527 v9 = *v1 == 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1528 bForceDrawFooter = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1529 if ( !v9 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1530 pPrimaryWindow->DrawText(pFontLucida, pFontLucida->AlignText_Center(450, v1) + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1531 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1532 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1533 // 5C35BC: using guessed type int bForceDrawFooter;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1534 //----- (00420EFF) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1535 void GameUI_WritePointedObjectStatusString()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1536 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1537 GUIWindow *pWindow; // edi@7
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1538 GUIButton *pButton; // ecx@11
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1539 int requiredSkillpoints; // ecx@19
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1540 enum UIMessageType pMessageType1; // esi@24
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1541 int v14; // eax@41
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1542 ItemGen *pItemGen; // ecx@44
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1543 int v16; // ecx@46
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1544 signed int pickedObjectPID; // eax@55
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1545 signed int v18b;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1546 signed int pickedObjectID; // ecx@63
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1547 BLVFace *pFace; // eax@69
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1548 const char *pText; // ecx@79
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1549 enum UIMessageType pMessageType2; // esi@110
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1550 enum UIMessageType pMessageType3; // edx@117
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1551 char Str1[200]; // [sp+Ch] [bp-D4h]@129
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1552 unsigned int pX; // [sp+D4h] [bp-Ch]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1553 unsigned int pY; // [sp+D8h] [bp-8h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1554
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1555 pMouse->uPointingObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1556 pMouse->GetClickPos(&pX, &pY);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1557 if ( pX < 0 || pX > window->GetWidth() - 1 || pY < 0 || pY > window->GetHeight() - 1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1558 return;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
1559 if ( current_screen_type == SCREEN_GAME )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1560 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1561 if ( pX <= (window->GetWidth() - 1) * 0.73125 && pY <= (window->GetHeight() - 1) * 0.73125 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1562 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1563 //if ( pRenderer->pRenderD3D ) // inlined mm8::4C1E01
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1564 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
1565 pickedObjectPID = pEngine->pVisInstance->get_picked_object_zbuf_val();
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1566 if ( pX < (unsigned int)pViewport->uScreen_TL_X || pX > (unsigned int)pViewport->uScreen_BR_X
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1567 || pY < (unsigned int)pViewport->uScreen_TL_Y || pY > (unsigned int)pViewport->uScreen_BR_Y )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1568 pickedObjectPID = -1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1569 if ( pickedObjectPID == -1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1570 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1571 if ( uLastPointedObjectID != 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1572 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1573 pFooterString[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1574 bForceDrawFooter = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1575 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1576 uLastPointedObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1577 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1578 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1579 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1580 /*else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1581 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1582 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1583 }*/
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1584 pMouse->uPointingObjectID = (unsigned __int16)pickedObjectPID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1585 pickedObjectID = (signed)PID_ID(pickedObjectPID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1586 if ( PID_TYPE(pickedObjectPID) == OBJECT_Item )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1587 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1588 if ( pObjectList->pObjects[pSpriteObjects[pickedObjectID].uObjectDescID].uFlags & 0x10 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1589 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1590 pMouse->uPointingObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1591 pFooterString[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1592 bForceDrawFooter = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1593 uLastPointedObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1594 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1595 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1596 if ( pickedObjectPID >= 0x2000000u || pParty->pPickedItem.uItemID )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1597 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1598 GameUI_SetFooterString(pSpriteObjects[pickedObjectID].containing_item.GetDisplayName());
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1599 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1600 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1601 {
2566
30eb6dcac768 big spell fx overhaul
a.parshin
parents: 2554
diff changeset
1602 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[470], pSpriteObjects[pickedObjectID].containing_item.GetDisplayName());// "Get %s"
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1603 GameUI_SetFooterString(pTmpBuf.data());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1604 } //intentional fallthrough
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1605 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1606 else if ( PID_TYPE(pickedObjectPID) == OBJECT_Decoration )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1607 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1608 if ( !pLevelDecorations[pickedObjectID].uEventID )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1609 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1610 if ( pLevelDecorations[pickedObjectID].IsInteractive() )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1611 pText = pNPCTopics[stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[pickedObjectID]._idx_in_stru123 - 75] + 380].pTopic;//íåâåðíî äëÿ êîñòðà
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1612 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1613 pText = pDecorationList->pDecorations[pLevelDecorations[pickedObjectID].uDecorationDescID].field_20;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1614 GameUI_SetFooterString(pText);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1615 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1616 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1617 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1618 char* hintString = GetEventHintString(pLevelDecorations[pickedObjectID].uEventID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1619 if ( hintString != '\0' )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1620 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1621 GameUI_SetFooterString(hintString);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1622 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1623 } //intentional fallthrough
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1624 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1625 else if ( PID_TYPE(pickedObjectPID) == OBJECT_BModel )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1626 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1627 if ( pickedObjectPID < 0x2000000u )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1628 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1629 char* newString = nullptr;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1630 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1631 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1632 v18b = (signed int)(unsigned __int16)pickedObjectPID >> 9;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1633 short triggeredId = pOutdoor->pBModels[v18b].pFaces[pickedObjectID & 0x3F].sCogTriggeredID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1634 if (triggeredId != 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1635 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1636 newString = GetEventHintString(pOutdoor->pBModels[v18b].pFaces[pickedObjectID & 0x3F].sCogTriggeredID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1637 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1638 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1639 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1640 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1641 pFace = &pIndoor->pFaces[pickedObjectID];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1642 if ( pFace->uAttributes & FACE_INDICATE )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1643 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1644 unsigned short eventId = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1645 if (eventId != 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1646 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1647 newString = GetEventHintString(pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1648 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1649 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1650 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1651 if (newString)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1652 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1653 GameUI_SetFooterString(newString);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1654 if ( pMouse->uPointingObjectID == 0 && uLastPointedObjectID != 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1655 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1656 pFooterString[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1657 bForceDrawFooter = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1658 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1659 uLastPointedObjectID = pMouse->uPointingObjectID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1660 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1661 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1662 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1663 pMouse->uPointingObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1664 pFooterString[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1665 bForceDrawFooter = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1666 uLastPointedObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1667 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1668 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1669 else if ( PID_TYPE(pickedObjectPID) == OBJECT_Actor )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1670 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1671 if ( pickedObjectPID >= 0x2000000 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1672 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1673 pMouse->uPointingObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1674 if ( uLastPointedObjectID != 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1675 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1676 pFooterString[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1677 bForceDrawFooter = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1678 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1679 uLastPointedObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1680 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1681 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1682 if ( pActors[pickedObjectID].dword_000334_unique_name )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1683 pText = pMonsterStats->pPlaceStrings[pActors[pickedObjectID].dword_000334_unique_name];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1684 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1685 pText = pMonsterStats->pInfos[pActors[pickedObjectID].pMonsterInfo.uID].pName;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1686 GameUI_SetFooterString(pText); //intentional fallthrough
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1687 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1688 if ( pMouse->uPointingObjectID == 0 && uLastPointedObjectID != 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1689 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1690 pFooterString[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1691 bForceDrawFooter = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1692 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1693 uLastPointedObjectID = pMouse->uPointingObjectID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1694 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1695 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1696 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1697 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1698 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1699 for (int i = uNumVisibleWindows; i > 0; --i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1700 {
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
1701 pWindow = pWindowList[pVisibleWindowsIdxs[i] - 1];
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1702 if ( (signed int)pX >= (signed int)pWindow->uFrameX && (signed int)pX <= (signed int)pWindow->uFrameZ
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1703 && (signed int)pY >= (signed int)pWindow->uFrameY && (signed int)pY <= (signed int)pWindow->uFrameW )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1704 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1705 for ( pButton = pWindow->pControlsHead; pButton != nullptr; pButton = pButton->pNext )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1706 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1707 switch ( pButton->uButtonType )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1708 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1709 case 1://for dialogue window
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1710 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1711 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1712 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1713 pMessageType1 = (UIMessageType)pButton->field_1C;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1714 if ( pMessageType1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1715 pMessageQueue_50CBD0->AddGUIMessage(pMessageType1, pButton->msg_param, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1716 GameUI_SetFooterString(pButton->pButtonName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1717 uLastPointedObjectID = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1718 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1719 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1720 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1721 case 2://hovering over portraits
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1722 if (pButton->uWidth != 0 && pButton->uHeight != 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1723 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1724 uint distW = pX - pButton->uX;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1725 uint distY = pY - pButton->uY;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1726
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1727 double ratioX = 1.0 * (distW*distW) / (pButton->uWidth*pButton->uWidth);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1728 double ratioY = 1.0 * (distY*distY) / (pButton->uHeight*pButton->uHeight);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1729
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1730 if (ratioX + ratioY < 1.0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1731 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1732 pMessageType2 = (UIMessageType)pButton->field_1C;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1733 if ( pMessageType2 != 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1734 pMessageQueue_50CBD0->AddGUIMessage(pMessageType2, pButton->msg_param, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1735 GameUI_SetFooterString(pButton->pButtonName); // for character name
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1736 uLastPointedObjectID = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1737 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1738 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1739 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1740 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1741 case 3:// click on skill
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1742 if ( pX >= pButton->uX && pX <= pButton->uZ
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1743 && pY >= pButton->uY && pY <= pButton->uW )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1744 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1745 requiredSkillpoints = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1746 if ( pPlayers[uActiveCharacter]->uSkillPoints < requiredSkillpoints )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1747 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], requiredSkillpoints - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1748 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1749 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], requiredSkillpoints);// "Clicking here will spend %d Skill Points"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1750 GameUI_SetFooterString(Str1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1751 uLastPointedObjectID = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1752 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1753 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1754 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1755 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1756 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1757 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1758 if ( pWindow->uFrameHeight == 480 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1759 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1760 //DebugBreak(); //Why is this condition here (in the original too)? Might check fullscreen windows. Let Silvo know if you find out
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1761 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1762 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1763 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1764 //The game never gets to this point even in the original. It's also bugged(neither branch displays anything).
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1765 //TODO fix these and move them up before the window check loop.
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
1766 if ( current_screen_type == SCREEN_CHEST )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1767 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1768 Chest::ChestUI_WritePointedObjectStatusString();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1769 if ( uLastPointedObjectID != 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1770 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1771 pFooterString[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1772 bForceDrawFooter = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1773 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1774 uLastPointedObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1775 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1776 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
1777 else if ( current_screen_type == SCREEN_HOUSE )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1778 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1779 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1780 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1781 || v16 == -65536 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1782 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1783 if ( uLastPointedObjectID != 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1784 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1785 pFooterString[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1786 bForceDrawFooter = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1787 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1788 uLastPointedObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1789 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1790 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1791 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1792 GameUI_SetFooterString(pItemGen->GetDisplayName());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1793 pFooterString[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1794 bForceDrawFooter = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1795 uLastPointedObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1796 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1797 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1798 if ( pY < 350 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1799 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1800 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1801 if ( v14 == 0 || v14 == -65536 || v14 >= 5000 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1802 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1803 if ( pMouse->uPointingObjectID == 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1804 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1805 if ( uLastPointedObjectID != 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1806 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1807 pFooterString[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1808 bForceDrawFooter = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1809 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1810 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1811 uLastPointedObjectID = pMouse->uPointingObjectID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1812 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1813 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1814 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v14-1];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1815 GameUI_SetFooterString(pItemGen->GetDisplayName());
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1816 pFooterString[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1817 bForceDrawFooter = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1818 uLastPointedObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1819 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1820 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1821 }
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
1822 if ( (signed int)pX >= (signed int)pWindowList[0]->uFrameX && (signed int)pX <= (signed int)pWindowList[0]->uFrameZ
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
1823 && (signed int)pY >= (signed int)pWindowList[0]->uFrameY && (signed int)pY <= (signed int)pWindowList[0]->uFrameW )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1824 {
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2541
diff changeset
1825 for ( pButton = pWindowList[0]->pControlsHead; pButton != nullptr; pButton = pButton->pNext )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1826 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1827 switch (pButton->uButtonType)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1828 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1829 case 1:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1830 if ( (signed int)pX >= (signed int)pButton->uX && (signed int)pX <= (signed int)pButton->uZ
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1831 && (signed int)pY >= (signed int)pButton->uY && (signed int)pY <= (signed int)pButton->uW )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1832 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1833 pMessageType3 = (UIMessageType)pButton->field_1C;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1834 if ( pMessageType3 == 0 ) // For books
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1835 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1836 GameUI_SetFooterString(pButton->pButtonName);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1837 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1838 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1839 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1840 pMessageQueue_50CBD0->AddGUIMessage(pMessageType3, pButton->msg_param, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1841 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1842 uLastPointedObjectID = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1843 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1844 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1845 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1846 case 2://hovering over portraits
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1847 if (pButton->uWidth != 0 && pButton->uHeight != 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1848 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1849 uint distW = pX - pButton->uX;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1850 uint distY = pY - pButton->uY;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1851
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1852 double ratioX = 1.0 * (distW*distW) / (pButton->uWidth*pButton->uWidth);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1853 double ratioY = 1.0 * (distY*distY) / (pButton->uHeight*pButton->uHeight);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1854
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1855 if (ratioX + ratioY < 1.0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1856 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1857 pMessageType2 = (UIMessageType)pButton->field_1C;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1858 if ( pMessageType2 != 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1859 pMessageQueue_50CBD0->AddGUIMessage(pMessageType2, pButton->msg_param, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1860 GameUI_SetFooterString(pButton->pButtonName); // for character name
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1861 uLastPointedObjectID = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1862 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1863 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1864 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1865 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1866 case 3:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1867 if ( pX >= pButton->uX && pX <= pButton->uZ
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1868 && pY >= pButton->uY && pY <= pButton->uW )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1869 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1870 requiredSkillpoints = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1871 if ( pPlayers[uActiveCharacter]->uSkillPoints < requiredSkillpoints )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1872 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], requiredSkillpoints - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1873 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1874 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], requiredSkillpoints);// "Clicking here will spend %d Skill Points"
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1875 GameUI_SetFooterString(Str1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1876 uLastPointedObjectID = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1877 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1878 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1879 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1880 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1881 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1882 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1883 //pMouse->uPointingObjectID = sub_46A99B(); //for software
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1884 if ( uLastPointedObjectID != 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1885 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1886 pFooterString[0] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1887 bForceDrawFooter = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1888 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1889 uLastPointedObjectID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1890 return;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1891 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1892
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1893 //----- (0044158F) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1894 void GameUI_DrawCharacterSelectionFrame()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1895 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1896 if ( uActiveCharacter )
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
1897 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, 380,
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1898 pIcons_LOD->GetTexture(uTextureID_GameUI_CharSelectionFrame));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1899 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1900
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1901 //----- (0044162D) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1902 void GameUI_DrawPartySpells()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1903 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1904 unsigned int v0; // ebp@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1905 Texture *spell_texture; // [sp-4h] [bp-1Ch]@12
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1906 //Texture *v9; // [sp-4h] [bp-1Ch]@21
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1907
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1908 v0 = (signed __int64)((double)GetTickCount() * 0.050000001);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1909 //v1 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1910 for (uint i = 0; i < 14; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1911 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1912 //v2 = byte_4E5DD8[v1];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1913 if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1914 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1915 Texture* tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1916 //v3 = pTextureIDs_PartyBuffIcons[i];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1917 pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0],
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1918 pPartySpellbuffsUI_XYs[i][1], tex, tex,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1919 v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1920 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1921 //++v1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1922 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1923 //while ( v1 < 14 );
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
1924 if (current_screen_type == SCREEN_GAME || current_screen_type == SCREEN_NPC_DIALOGUE)
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1925 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1926 if (pParty->FlyActive())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1927 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1928 if ( pParty->bFlying )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1929 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1930 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1931 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1932 //if ( pRenderer->pRenderD3D )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1933 pRenderer->DrawTextureIndexed(8, 8, spell_texture);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1934 /*else
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
1935 pRenderer->DrawTextureIndexedAlpha(8, 8, v7);*/
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1936 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1937 if ( pParty->WaterWalkActive() )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1938 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1939 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1940 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1941 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1942 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1943 //if ( pRenderer->pRenderD3D )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1944 pRenderer->DrawTextureIndexed(396, 8, spell_texture);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1945 /*else
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
1946 pRenderer->DrawTextureIndexedAlpha(396, 8, v9);*/
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1947 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1948 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1949 for (uint i = 0; i < 4; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1950 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1951 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1952 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1953 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1954 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1955 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1956 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1957 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1958 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1959 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1960 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1961
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1962 //----- (004921C1) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1963 void GameUI_DrawPortraits(unsigned int _this)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1964 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1965 unsigned int face_expression_ID; // eax@17
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1966 PlayerFrame *pFrame; // eax@21
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1967 Texture *pPortrait; // [sp-4h] [bp-1Ch]@27
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1968
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1969 if ( _A750D8_player_speech_timer )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1970 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1971 _A750D8_player_speech_timer -= (signed int)pMiscTimer->uTimeElapsed;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1972 if ( _A750D8_player_speech_timer <= 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1973 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1974 if ( pPlayers[uSpeakingCharacter]->CanAct() )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1975 pPlayers[uSpeakingCharacter]->PlaySound(PlayerSpeechID, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1976 _A750D8_player_speech_timer = 0i64;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1977 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1978 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1979
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1980 for (uint i = 0; i < 4; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1981 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1982 Player* pPlayer = &pParty->pPlayers[i];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1983 if ( pPlayer->IsEradicated() )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1984 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1985 pPortrait = pTexture_PlayerFaceEradicated;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1986 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1987 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1988 else
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
1989 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1990 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1991 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1992 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1993 sub_441A4E(i);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1994 continue;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1995 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1996 if (pPlayer->IsDead())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1997 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1998 pPortrait = pTexture_PlayerFaceDead;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
1999 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2000 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2001 else
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
2002 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2003 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2004 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2005 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2006 sub_441A4E(i);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2007 continue;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2008 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2009 face_expression_ID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2010 for ( uint j = 0; j < pPlayerFrameTable->uNumFrames; ++j )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2011 if ( pPlayerFrameTable->pFrames[j].expression == pPlayer->expression )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2012 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2013 face_expression_ID = j;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2014 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2015 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2016 if ( face_expression_ID == 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2017 face_expression_ID = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2018 if (pPlayer->expression == CHARACTER_EXPRESSION_21)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2019 pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2020 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2021 pFrame = pPlayerFrameTable->GetFrameBy_x(face_expression_ID, pPlayer->uExpressionTimePassed);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2022 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || _this )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2023 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2024 pPlayer->field_1AA2 = pFrame->uTextureID - 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2025 pPortrait = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2026 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2027 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2028 else
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
2029 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2030 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2031 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2032 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2033 sub_441A4E(i);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2034 continue;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2035 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2036 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2037 if ( pParty->bTurnBasedModeOn == 1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2038 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2039 if ( pTurnEngine->turn_stage != TE_WAIT )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2040 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2041 if (PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2042 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2043 if ( pTurnEngine->uActorQueueSize > 0 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2044 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2045 for (uint i = 0; i < (uint)pTurnEngine->uActorQueueSize; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2046 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2047 if (PID_TYPE(pTurnEngine->pQueue[i].uPackedID) != OBJECT_Player)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2048 break;
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2049
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2050 auto tex = _5079D0_init_g;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2051 if ( pParty->uFlags & 0x10 )
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2052 tex = _5079CC_init_r;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2053 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2054 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2055 if ( pParty->uFlags & 0x20 )
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2056 tex = _5079C8_init_y;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2057 }
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2058 pRenderer->DrawTextureIndexedAlpha(
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2059 pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pTurnEngine->pQueue[i].uPackedID)] - 4,
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2060 385,
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2061 tex
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2062 );
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2063 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2064 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2065 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2066 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2067 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2068 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2069 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2070 for (uint i = 0; i < 4; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2071 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2072 if (pParty->pPlayers[i].CanAct() && !pParty->pPlayers[i].uTimeToRecovery)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2073 {
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2074 auto tex = _5079D0_init_g;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2075 if ( pParty->uFlags & 0x10 )
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2076 tex = _5079CC_init_r;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2077 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2078 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2079 if ( pParty->uFlags & 0x20 )
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2080 tex = _5079C8_init_y;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2081 }
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2082 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, 385, tex);
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2083 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2084 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2085 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2086 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2087
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2088 //----- (00441D38) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2089 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2090 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2091 int uHeight; // ebx@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2092 signed int pW; // ebx@23
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2093 int v15; // eax@23
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2094 double v20; // st7@30
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2095 signed int v27; // eax@37
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2096 //unsigned __int16 *v28; // ecx@37
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2097 signed int v29; // edi@40
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2098 int pPoint_X; // edi@72
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2099 int pPoint_Y; // ebx@72
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2100 unsigned int lPitch; // [sp+20h] [bp-34h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2101 signed int pY; // [sp+20h] [bp-34h]@23
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2102 signed int pX; // [sp+24h] [bp-30h]@23
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2103 signed int v70; // [sp+24h] [bp-30h]@37
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2104 signed int uBluea; // [sp+28h] [bp-2Ch]@37
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2105 int v73; // [sp+2Ch] [bp-28h]@30
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2106 signed int uCenterY; // [sp+48h] [bp-Ch]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2107 signed int uCenterX; // [sp+4Ch] [bp-8h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2108 signed int uWidth; // [sp+5Ch] [bp+8h]@30
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2109 signed int pZ; // [sp+60h] [bp+Ch]@23
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2110 float uWb; // [sp+60h] [bp+Ch]@30
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2111 unsigned int pColor;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2112
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2113 uCenterX = (uX + uZ) / 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2114 uCenterY = (uY + uW) / 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2115 lPitch = pRenderer->uTargetSurfacePitch;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2116 bool bWizardEyeActive = pParty->WizardEyeActive();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2117 int uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2118 if ( CheckHiredNPCSpeciality(Cartographer) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2119 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2120 bWizardEyeActive = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2121 uWizardEyeSkillLevel = 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2122 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2123
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2124 if ( wizard_eye )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2125 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2126 bWizardEyeActive = true;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2127 uWizardEyeSkillLevel = 3;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2128 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2129 pRenderer->SetRasterClipRect(uX, uY, uZ - 1, uW - 1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2130 uHeight = uW - uY;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2131 uWidth = uZ - uX;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2132
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2133 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2134 {
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2135 uchar* pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].paletted_pixels;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2136 ushort* pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2137 v73 = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / (signed int)uZoom;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2138 v20 = (double)(pParty->vPosition.x + 32768) / (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2139 uWb = (double)(32768 - pParty->vPosition.y) / (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2140 switch (uZoom)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2141 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2142 case 512:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2143 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2144 v20 = v20 - (double)(uWidth / 2);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2145 uWb = uWb - (double)(uHeight / 2);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2146 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2147 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2148 case 1024:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2149 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2150 v20 = v20 - (double)(uWidth / 4);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2151 uWb = uWb - (double)(uHeight / 4);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2152 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2153 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2154 case 2048:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2155 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2156 v20 = v20 - (double)(uWidth / 8);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2157 uWb = uWb - (double)(uHeight / 8);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2158 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2159 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2160 default: assert(false);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2161 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2162
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2163 static unsigned __int16 pOdmMinimap[117][137];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2164 assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2165
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2166 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2167 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2168 v27 = uBluea >> 16;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2169 //v28 = &pRenderer->pTargetSurface[uX + uY * lPitch];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2170
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2171 if (pMapLod0 && bRedrawOdmMinimap)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2172 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2173 assert(uWidth == 137 && uHeight == 117);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2174 //auto pMinimap = (unsigned __int16 *)pOdmMinimap;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2175
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2176 ushort mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2177
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2178 v29 = v70 >> 16;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2179 for (int y = 0; y < uHeight; ++y)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2180 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2181 uchar* pMapLod0Line = &pMapLod0[v27 * mapWidth];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2182 for (int x = 0; x < uWidth; ++x)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2183 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2184 //*pMinimap++ = pPal[pMapLod0Line[v29]];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2185 pRenderer->WritePixel16(uX + x, uY + y, pPal[pMapLod0Line[v29]]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2186 v29 = (v70 + x * v73) >> 16;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2187 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2188 uBluea += v73;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2189 v27 = uBluea >> 16;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2190 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2191
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2192 /*v29 = v70 >> 16;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2193 for (int y = 0; y < uHeight; ++y)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2194 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2195 uchar* pMapLod0Line = &pMapLod0[v27 * mapWidth];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2196 for (int x = 0; x < uWidth; ++x)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2197 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2198 //*pMinimap++ = pPal[pMapLod0Line[v29]];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2199 pOdmMinimap[y][x] = pPal[pMapLod0Line[v29]];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2200 v29 = (v70 + x * v73) >> 16;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2201 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2202 v29 = v70 >> 16;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2203 v28 += 137 - uWidth;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2204 uBluea += v73;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2205 v27 = uBluea >> 16;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2206 }*/
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2207 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2208
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2209 /*for (int y = 0; y < 117; ++y)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2210 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2211 for (int x = 0; x < 137; ++x)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2212 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2213 *v28++ = pOdmMinimap[y][x];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2214 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2215 v28 += lPitch - 137;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2216 }*/
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2217 uNumBlueFacesInBLVMinimap = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2218 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2219 else// uCurrentlyLoadedLevelType == LEVEL_Indoor
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2220 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2221 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2222 uNumBlueFacesInBLVMinimap = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2223
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2224 for (uint i = 0; i < (uint)pIndoor->pMapOutlines->uNumOutlines; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2225 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2226 BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[i];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2227 //BLVFace* pFace1 = &pIndoor->pFaces[pOutline->uFace1ID];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2228 //BLVFace* pFace2 = &pIndoor->pFaces[pOutline->uFace2ID];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2229 if (pIndoor->pFaces[pOutline->uFace1ID].Visible() && pIndoor->pFaces[pOutline->uFace2ID].Visible())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2230 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2231 if ( pOutline->uFlags & 1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2232 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2233 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 &&
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2234 (pIndoor->pFaces[pOutline->uFace1ID].Clickable() || pIndoor->pFaces[pOutline->uFace2ID].Clickable()) &&
2508
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
2235 (pIndoor->pFaceExtras[pIndoor->pFaces[pOutline->uFace1ID].uFaceExtraID].uEventID
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
2236 || pIndoor->pFaceExtras[pIndoor->pFaces[pOutline->uFace2ID].uFaceExtraID].uEventID))
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2237 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2238 if (uNumBlueFacesInBLVMinimap < 49)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2239 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2240 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2241 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2242 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2243 pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2244 pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2245 pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2246 pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2247 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2248 if ( v15 > 100 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2249 v15 = 100;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2250 pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2251 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2252 continue;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2253 }
2508
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
2254 if (pIndoor->pFaces[pOutline->uFace1ID].uAttributes & FACE_UNKNOW7
491f0babd563 use_music_folder
Ritor1
parents: 2502
diff changeset
2255 || pIndoor->pFaces[pOutline->uFace2ID].uAttributes & FACE_UNKNOW7)
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2256 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2257 pOutline->uFlags = pOutline->uFlags | 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2258 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2259 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 &&
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2260 (pIndoor->pFaces[pOutline->uFace1ID].Clickable() || pIndoor->pFaces[pOutline->uFace2ID].Clickable()) &&
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2261 (pIndoor->pFaceExtras[pIndoor->pFaces[pOutline->uFace1ID].uFaceExtraID].uEventID || pIndoor->pFaceExtras[pIndoor->pFaces[pOutline->uFace2ID].uFaceExtraID].uEventID))
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2262 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2263 if (uNumBlueFacesInBLVMinimap < 49)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2264 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2265 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2266 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2267 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2268 pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2269 pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2270 pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2271 pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2272 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2273 if ( v15 > 100 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2274 v15 = 100;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2275 pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2276 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2277 continue;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2278 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2279 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2280 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2281
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2282 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2283 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2284 BLVMapOutline* pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]];
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2285 pX = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2286 pY = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex1ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2287 pZ = uCenterX + ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].x)) << 16) - uZoom * pParty->vPosition.x) >> 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2288 pW = uCenterY - ((signed int)(((unsigned int)(fixpoint_mul(uZoom, pIndoor->pVertices[pOutline->uVertex2ID].y)) << 16) - uZoom * pParty->vPosition.y) >> 16);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2289 pRenderer->RasterLine2D(pX, pY, pZ, pW, ui_game_minimap_outline_color);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2290 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2291 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2292
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2293 //draw arrow on the minimap(include. Ritor1)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2294 uint arrow_idx;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2295 unsigned int rotate = pParty->sRotationY & stru_5C6E00->uDoublePiMask;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2296 if ( (signed int)rotate <= 1920 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2297 arrow_idx = 6;
2516
Ritor1
parents: 2508
diff changeset
2298 if ( (signed int)rotate < 1664 )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2299 arrow_idx = 5;
2516
Ritor1
parents: 2508
diff changeset
2300 if ( (signed int)rotate <= 1408 )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2301 arrow_idx = 4;
2516
Ritor1
parents: 2508
diff changeset
2302 if ( (signed int)rotate < 1152 )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2303 arrow_idx = 3;
2516
Ritor1
parents: 2508
diff changeset
2304 if ( (signed int)rotate <= 896 )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2305 arrow_idx = 2;
2516
Ritor1
parents: 2508
diff changeset
2306 if ( (signed int)rotate < 640 )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2307 arrow_idx = 1;
2516
Ritor1
parents: 2508
diff changeset
2308 if ( (signed int)rotate <= 384 )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2309 arrow_idx = 0;
2516
Ritor1
parents: 2508
diff changeset
2310 if ( (signed int)rotate < 128 || (signed int)rotate > 1920 )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2311 arrow_idx = 7;
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
2312 pRenderer->DrawTextureIndexedAlpha(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx]));//ñòðåëêà
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2313
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2314 //draw objects on the minimap
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2315 if ( bWizardEyeActive )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2316 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2317 if ( uWizardEyeSkillLevel >= 2 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2318 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2319 for ( uint i = 0; i < uNumSpriteObjects; ++i )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2320 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2321 if ( !pSpriteObjects[i].uType || !pSpriteObjects[i].uObjectDescID )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2322 continue;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2323 //if (uWizardEyeSkillLevel == 1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2324 pPoint_X = uCenterX + fixpoint_mul((pSpriteObjects[i].vPosition.x - pParty->vPosition.x), uZoom);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2325 pPoint_Y = uCenterY - fixpoint_mul((pSpriteObjects[i].vPosition.y - pParty->vPosition.y), uZoom);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2326 //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z &&
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2327 // pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2328 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2329 if (pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2330 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2331 pRenderer->RasterLine2D(pPoint_X, pPoint_Y, pPoint_X, pPoint_Y, ui_game_minimap_projectile_color);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2332 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2333 else if ( uZoom > 512 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2334 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2335 pRenderer->RasterLine2D(pPoint_X - 2, pPoint_Y, pPoint_X - 2, pPoint_Y + 1, ui_game_minimap_treasure_color);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2336 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y + 1, ui_game_minimap_treasure_color);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2337 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 2, pPoint_X, pPoint_Y + 1, ui_game_minimap_treasure_color);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2338 pRenderer->RasterLine2D(pPoint_X + 1, pPoint_Y - 1, pPoint_X + 1, pPoint_Y + 1, ui_game_minimap_treasure_color);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2339 pRenderer->RasterLine2D(pPoint_X + 2, pPoint_Y, pPoint_X + 2, pPoint_Y + 1, ui_game_minimap_treasure_color);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2340 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2341 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2342 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2343 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y, ui_game_minimap_treasure_color);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2344 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y, ui_game_minimap_treasure_color);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2345 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2346 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2347 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2348 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2349 for ( uint i = 0; i < uNumActors; ++i )//draw actors(îòðèñîâêà ìîíñòðîâ è íïñ)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2350 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2351 if ( pActors[i].uAIState != Removed && pActors[i].uAIState != Disabled
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2352 && (pActors[i].uAIState == Dead || pActors[i].ActorNearby()) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2353 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2354 pPoint_X = uCenterX + (fixpoint_mul((pActors[i].vPosition.x - pParty->vPosition.x), uZoom));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2355 pPoint_Y = uCenterY - (fixpoint_mul((pActors[i].vPosition.y - pParty->vPosition.y), uZoom));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2356 //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2357 // && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2358 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2359 pColor = ui_game_minimap_actor_friendly_color;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2360 if ( pActors[i].uAttributes & ACTOR_HOSTILE )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2361 pColor = ui_game_minimap_actor_hostile_color;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2362 if ( pActors[i].uAIState == Dead)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2363 pColor = ui_game_minimap_actor_corpse_color;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2364 if ( uZoom > 1024 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2365 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2366 pRenderer->RasterLine2D(pPoint_X - 2, pPoint_Y - 1, pPoint_X - 2, pPoint_Y + 1, pColor);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2367 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 2, pPoint_X - 1, pPoint_Y + 2, pColor);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2368 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 2, pPoint_X, pPoint_Y + 2, pColor);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2369 pRenderer->RasterLine2D(pPoint_X + 1, pPoint_Y - 2, pPoint_X + 1, pPoint_Y + 2, pColor);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2370 pRenderer->RasterLine2D(pPoint_X + 2, pPoint_Y - 1, pPoint_X + 2, pPoint_Y + 1, pColor);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2371 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2372 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2373 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2374 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y, pColor);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2375 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y, pColor);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2376 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2377 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2378 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2379 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2380 for ( uint i = 0; i < (signed int)uNumLevelDecorations; ++i )//draw items(îòðèñîâêà ïðåäìåòîâ)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2381 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2382 if ( pLevelDecorations[i].uFlags & 8 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2383 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2384 pPoint_X = uCenterX + (fixpoint_mul((pLevelDecorations[i].vPosition.x - pParty->vPosition.x), uZoom));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2385 pPoint_Y = uCenterY - (fixpoint_mul((pLevelDecorations[i].vPosition.y - pParty->vPosition.y), uZoom));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2386 //if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2387 // && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2388 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2389 if ( (signed int)uZoom > 512 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2390 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2391 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y + 1, ui_game_minimap_decoration_color_1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2392 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y + 1, ui_game_minimap_decoration_color_1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2393 pRenderer->RasterLine2D(pPoint_X + 1, pPoint_Y - 1, pPoint_X + 1, pPoint_Y + 1, ui_game_minimap_decoration_color_1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2394 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2395 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2396 pRenderer->RasterLine2D(pPoint_X, pPoint_Y, pPoint_X, pPoint_Y, ui_game_minimap_decoration_color_1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2397 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2398 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2399 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2400 }
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2401 pRenderer->DrawTextureIndexedAlpha(468, 0, minimap_loop);
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
2402 pRenderer->SetUIClipRect(541, 0, 567, 480);
2572
d87bfbd3bb3b Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents: 2566
diff changeset
2403 pRenderer->DrawTextureIndexed(floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285, 136, _5079B4_compass);
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
2404 pRenderer->ResetUIClipRect();
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2405 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2406
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2407 //----- (00441498) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2408 void GameUI_DrawTorchlightAndWizardEye()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2409 {
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
2410 if (current_screen_type == SCREEN_GAME
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
2411 || current_screen_type == SCREEN_MENU
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
2412 || current_screen_type == SCREEN_OPTIONS
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
2413 || current_screen_type == SCREEN_REST
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
2414 || current_screen_type == SCREEN_SPELL_BOOK
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
2415 || current_screen_type == SCREEN_CHEST
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
2416 || current_screen_type == SCREEN_SAVEGAME
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
2417 || current_screen_type == SCREEN_LOADGAME
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
2418 || current_screen_type == SCREEN_CHEST_INVENTORY
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
2419 || current_screen_type == SCREEN_BOOKS
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
2420 || current_screen_type == SCREEN_BRANCHLESS_NPC_DIALOG )
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2421 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2422 if (pParty->TorchlightActive())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2423 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2424 IconFrame* icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time());
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
2425 pRenderer->DrawTextureIndexedAlpha(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID));
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2426 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2427 if (pParty->WizardEyeActive())
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2428 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2429 IconFrame* icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time());
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
2430 pRenderer->DrawTextureIndexedAlpha(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID));
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2431 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2432 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2433 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2524
diff changeset
2434 // 4E28F8: using guessed type int current_screen_type;
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2435
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2436
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2437 //----- (00491F87) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2438 void GameUI_DrawHiredNPCs()
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2439 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2440 unsigned int v13; // eax@23
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2441 char pContainer[20]; // [sp+Ch] [bp-30h]@18
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2442 signed int uFrameID; // [sp+24h] [bp-18h]@19
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2443 int v22; // [sp+34h] [bp-8h]@2
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2444 unsigned __int8 pNPC_limit_ID; // [sp+3Bh] [bp-1h]@2
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2445
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2446 if ( bNoNPCHiring != 1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2447 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2448 pNPC_limit_ID = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2449 v22 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2450 if (pParty->pHirelings[0].pName)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2451 pTmpBuf[v22++] = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2452 if (pParty->pHirelings[1].pName)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2453 pTmpBuf[v22++] = 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2454
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2455 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2456 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2457 if (pNPCStats->pNewNPCData[i].uFlags & 128)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2458 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2459 if (!pParty->pHirelings[0].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[0].pName))
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2460 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2461 if (!pParty->pHirelings[1].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[1].pName))
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2462 pTmpBuf[v22++] = i + 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2463 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2464 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2465 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2466
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2467 for ( int i = pParty->hirelingScrollPosition; i < v22 && pNPC_limit_ID < 2; i++ )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2468 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2469 if ( (unsigned __int8)pTmpBuf[i] >= 2 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2470 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2471 sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[i] + 499].uPortraitID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2472 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2473 pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2474 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2475 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2476 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2477 sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].uPortraitID);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2478 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2479 pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)));
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2480 if ( pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_A == 1 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2481 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2482 uFrameID = pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_B;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2483 v13 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2484 if (pIconsFrameTable->uNumIcons)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2485 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2486 for ( v13 = 0; v13 < pIconsFrameTable->uNumIcons; ++v13 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2487 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2488 if ( !_stricmp("spell96", pIconsFrameTable->pIcons[v13].pAnimationName) )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2489 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2490 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2491 }
2524
c7264ab7132f Main menu rendered using d3d11
a.parshin
parents: 2516
diff changeset
2492 pRenderer->DrawTextureIndexedAlpha(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
2501
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2493 &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(v13, uFrameID)->uTextureID]);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2494 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2495 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2496 ++pNPC_limit_ID;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2497 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2498 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2499 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2500
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2501 //----- (004178FE) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2502 unsigned int UI_GetHealthManaAndOtherQualitiesStringColor(signed int current_pos, signed int base_pos)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2503 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2504 unsigned __int16 R, G, B;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2505
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2506 if ( current_pos <= base_pos )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2507 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2508 if ( current_pos == base_pos )//White
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2509 return 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2510 if ( 100 * current_pos / base_pos >= 25 )//Yellow( current_pos > 1/4 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2511 R = 255, G = 255, B = 100;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2512 else//Red( current_pos < 1/4 )
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2513 R = 255, G = 0, B = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2514 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2515 else//Green
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2516 R = 0, G = 255, B = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2517 return Color16(R, G, B);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2518 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2519
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2520 //----- (00417939) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2521 int GetConditionDrawColor(unsigned int uConditionIdx)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2522 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2523 switch (uConditionIdx)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2524 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2525 case Condition_Zombie:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2526 case Condition_Good:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2527 return ui_character_condition_normal_color;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2528
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2529 case Condition_Cursed:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2530 case Condition_Weak:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2531 case Condition_Fear:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2532 case Condition_Drunk:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2533 case Condition_Insane:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2534 case Condition_Poison_Weak:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2535 case Condition_Disease_Weak:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2536 return ui_character_condition_light_color;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2537
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2538 case Condition_Sleep:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2539 case Condition_Poison_Medium:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2540 case Condition_Disease_Medium:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2541 case Condition_Paralyzed:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2542 case Condition_Unconcious:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2543 return ui_character_condition_moderate_color;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2544
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2545 case Condition_Poison_Severe:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2546 case Condition_Disease_Severe:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2547 case Condition_Dead:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2548 case Condition_Pertified:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2549 case Condition_Eradicated:
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2550 return ui_character_condition_severe_color;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2551 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2552 Error("Invalid condition (%u)", uConditionIdx);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2553 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2554
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2555 //----- (00495430) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2556 const char * GetReputationString(signed int a1)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2557 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2558 if (a1 >= 25)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2559 return pGlobalTXT_LocalizationStrings[379]; // Hated
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2560 else if (a1 >= 6)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2561 return pGlobalTXT_LocalizationStrings[392]; // Unfriendly
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2562 else if (a1 >= -5)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2563 return pGlobalTXT_LocalizationStrings[399]; // Neutral;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2564 else if (a1 >= -24)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2565 return pGlobalTXT_LocalizationStrings[402]; // Friendly
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2566 else
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2567 return pGlobalTXT_LocalizationStrings[434]; // Respected;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2568 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2569
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2570 //----- (00441A4E) --------------------------------------------------------
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2571 __int16 __fastcall sub_441A4E(int a1)//for blessing
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2572 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2573 __int16 result; // ax@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2574 int v2; // ebx@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2575 // char *v3; // esi@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2576 // int v4; // edi@4
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2577 bool v5; // ecx@4
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2578 SpriteFrame *pFrame; // eax@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2579 //SpriteFrame *v7; // edi@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2580 int v8; // eax@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2581 // unsigned __int16 v9; // ax@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2582 RenderBillboardTransform_local0 v10; // [sp+Ch] [bp-5Ch]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2583 int v11; // [sp+5Ch] [bp-Ch]@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2584 int v12; // [sp+60h] [bp-8h]@1
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2585 //int v13; // [sp+64h] [bp-4h]@6
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2586
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2587 v10.sParentBillboardID = -1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2588 v10.pTarget = pRenderer->pTargetSurface;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2589 v10.pTargetZ = pRenderer->pActiveZBuffer;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2590 v10.uTargetPitch = pRenderer->GetRenderWidth();
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2591 result = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2592 v2 = a1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2593 v10.uViewportX = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2594 v10.uViewportY = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2595 v10.uViewportZ = window->GetWidth() - 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2596 v10.uViewportW = window->GetHeight() - 1;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2597 v12 = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2598 //v3 = (char *)&pOtherOverlayList->pOverlays[0].field_C;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2599 //do
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2600 for (uint i = 0; i < 50; ++i)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2601 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2602 if (pOtherOverlayList->pOverlays[i].field_6 > 0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2603 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2604 result = pOtherOverlayList->pOverlays[i].field_0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2605 if (pOtherOverlayList->pOverlays[i].field_0 >= 300)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2606 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2607 //v4 = result;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2608 v5 = pOtherOverlayList->pOverlays[i].field_0 == v2 + 320
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2609 || pOtherOverlayList->pOverlays[i].field_0 == v2 + 330
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2610 || pOtherOverlayList->pOverlays[i].field_0 == v2 + 340
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2611 || pOtherOverlayList->pOverlays[i].field_0 == v2 + 350;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2612 pOtherOverlayList->pOverlays[i].field_0 = v2 + 310;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2613 if (pOtherOverlayList->pOverlays[i].field_0 == v2 + 310 || v5)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2614 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2615 if (!pOtherOverlayList->pOverlays[i].field_0)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2616 {
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2617 pFrame = pSpriteFrameTable->GetFrame(pOverlayList->pOverlays[pOtherOverlayList->pOverlays[i].field_2].uSpriteFramesetID,
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2618 pOtherOverlayList->pOverlays[i].field_4);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2619 //v7 = v6;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2620 v11 = pOtherOverlayList->pOverlays[i].field_E;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2621 //v13 = pFrame->scale;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2622 //v13 = fixpoint_mul(v11, pFrame->scale);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2623 v10.uScreenSpaceX = pOtherOverlayList->pOverlays[i].field_8;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2624 v10.uScreenSpaceY = pOtherOverlayList->pOverlays[i].field_A;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2625 v10._screenspace_x_scaler_packedfloat = fixpoint_mul(v11, pFrame->scale);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2626 v10._screenspace_y_scaler_packedfloat = fixpoint_mul(v11, pFrame->scale);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2627 v10.pPalette = PaletteManager::Get_Dark_or_Red_LUT(pFrame->uPaletteIndex, 0, 1);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2628 v8 = pOtherOverlayList->pOverlays[i].field_2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2629 v10.sZValue = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2630 v10.uFlags = 0;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2631 //v9 = pOverlayList->pOverlays[v8].uOverlayType;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2632 if (!pOverlayList->pOverlays[v8].uOverlayType || pOverlayList->pOverlays[v8].uOverlayType == 2)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2633 v10.uScreenSpaceY += pSprites_LOD->pSpriteHeaders[pFrame->pHwSpriteIDs[0]].uHeight / 2;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2634 result = pSprites_LOD->pSpriteHeaders[pFrame->pHwSpriteIDs[0]]._4AD2D1(&v10, 0);
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2635 ++v12;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2636 if (v12 == 5)
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2637 break;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2638 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2639 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2640 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2641 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2642 //v3 += 20;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2643 }
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2644 //while ( (signed int)v3 < (signed int)&pOverlayList->pOverlays );
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2645 return result;
0ff6a9e9bf7f GUI folger
Ritor1
parents:
diff changeset
2646 }