0
|
1 #include "GUIWindow.h"
|
|
2 #include "GUIFont.h"
|
|
3
|
|
4 #include "mm7_data.h"
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11 struct GUIButton *pBtn_CloseBook;
|
|
12 struct GUIButton *pBtn_InstallRemoveSpell;
|
|
13 struct GUIButton *pBtn_Autonotes_Instructors;
|
|
14 struct GUIButton *pBtn_Autonotes_Misc;
|
|
15 struct GUIButton *pBtn_Book_6;
|
|
16 struct GUIButton *pBtn_Book_5;
|
|
17 struct GUIButton *pBtn_Book_4;
|
|
18 struct GUIButton *pBtn_Book_3;
|
|
19 struct GUIButton *pBtn_Book_2;
|
|
20 struct GUIButton *pBtn_Book_1;
|
|
21
|
|
22
|
|
23 struct GUIButton *pPlayerCreationUI_BtnReset;
|
|
24 struct GUIButton *pPlayerCreationUI_BtnOK;
|
|
25 struct GUIButton *pBtn_ExitCancel;
|
|
26 struct GUIButton *pBtn_YES;
|
|
27 struct GUIButton *pPlayerCreationUI_BtnPlus;
|
|
28 struct GUIButton *pPlayerCreationUI_BtnMinus;
|
|
29
|
|
30
|
|
31 struct GUIButton *pButton_RestUI_Main;
|
|
32 struct GUIButton *pButton_RestUI_Exit;
|
|
33 struct GUIButton *pButton_RestUI_Wait5Minutes;
|
|
34 struct GUIButton *pButton_RestUI_WaitUntilDawn;
|
|
35 struct GUIButton *pButton_RestUI_Wait1Hour;
|
|
36
|
|
37
|
|
38 struct GUIButton *pCharacterScreen_ExitBtn;
|
|
39 struct GUIButton *pCharacterScreen_AwardsBtn;
|
|
40 struct GUIButton *pCharacterScreen_InventoryBtn;
|
|
41 struct GUIButton *pCharacterScreen_SkillsBtn;
|
|
42 struct GUIButton *pCharacterScreen_StatsBtn;
|
|
43 struct GUIButton *pCharacterScreen_DollBtn;
|
|
44 struct GUIButton *pCharacterScreen_DetalizBtn;
|
|
45
|
|
46
|
|
47 struct GUIButton *pBtn_NPCRight;
|
|
48 struct GUIButton *pBtn_NPCLeft;
|
|
49 struct GUIButton *pBtn_GameSettings;
|
|
50 struct GUIButton *pBtn_QuickReference;
|
|
51 struct GUIButton *pBtn_CastSpell;
|
|
52 struct GUIButton *pBtn_Rest;
|
|
53 struct GUIButton *pBtn_History;
|
|
54 struct GUIButton *pBtn_Calendar;
|
|
55 struct GUIButton *pBtn_Maps;
|
|
56 struct GUIButton *pBtn_Autonotes;
|
|
57 struct GUIButton *pBtn_Quests;
|
|
58
|
|
59
|
|
60 struct GUIButton *pMainMenu_BtnExit;
|
|
61 struct GUIButton *pMainMenu_BtnCredits;
|
|
62 struct GUIButton *pMainMenu_BtnLoad;
|
|
63 struct GUIButton *pMainMenu_BtnNew;
|
|
64
|
|
65
|
|
66 struct GUIButton *pBtn_Up;
|
|
67 struct GUIButton *pBtn_Down;
|
|
68 struct GUIButton *ptr_507BA4;
|
|
69
|
|
70
|
|
71 struct GUIWindow *pPrimaryWindow;
|
|
72 struct GUIWindow *pChestWindow;
|
|
73 struct GUIWindow *pDialogueWindow;
|
336
|
74 struct GUIWindow *window_SpeakInHouse;
|
0
|
75 struct GUIWindow *pGUIWindow_ScrollWindow;
|
|
76 struct GUIWindow *ptr_507BC8;
|
|
77 struct GUIWindow *pGUIWindow_CurrentMenu;
|
|
78 struct GUIWindow *ptr_507BD0;
|
|
79 struct GUIWindow *pGUIWindow_Settings;
|
|
80 struct GUIWindow *ptr_507BDC;
|
|
81 struct GUIWindow *pGUIWindow_EscMessageWindow;
|
|
82 struct GUIWindow *pBooksWindow;
|
|
83 struct GUIWindow *pGUIWindow2;
|
|
84
|
|
85
|
|
86 struct GUIButton *pBtn_Resume;
|
|
87 struct GUIButton *pBtn_QuitGame;
|
|
88 struct GUIButton *pBtn_GameControls;
|
|
89 struct GUIButton *pBtn_LoadGame;
|
|
90 struct GUIButton *pBtn_SaveGame;
|
|
91 struct GUIButton *pBtn_NewGame;
|
|
92
|
|
93 struct GUIButton *pBtn_SliderRight;
|
|
94 struct GUIButton *pBtn_SliderLeft;
|
|
95
|
|
96
|
2
|
97 struct GUIButton *pBtnDownArrow;
|
|
98 struct GUIButton *pBtnArrowUp;
|
|
99 struct GUIButton *pBtnCancel;
|
|
100 struct GUIButton *pBtnLoadSlot;
|
0
|
101
|
|
102
|
|
103 GUIButton *pCreationUI_BtnPressRight2[4];
|
|
104 GUIButton *pCreationUI_BtnPressLeft2[4];
|
|
105 GUIButton *pCreationUI_BtnPressLeft[4];
|
|
106 GUIButton *pCreationUI_BtnPressRight[4];
|
|
107
|
|
108
|
|
109
|
|
110
|
|
111
|
|
112
|
|
113 //----- (0041D0D8) --------------------------------------------------------
|
697
|
114 void GUIButton::Release()
|
0
|
115 {
|
|
116 GUIWindow *v1; // eax@2
|
|
117 GUIButton *v2; // edx@2
|
|
118 GUIButton *v3; // eax@6
|
697
|
119 GUIButton *ptr;
|
0
|
120
|
697
|
121 ptr=this;
|
0
|
122 if ( ptr )
|
|
123 {
|
|
124 v1 = ptr->pParent;
|
|
125 v2 = ptr->pNext;
|
|
126 if ( ptr == v1->pControlsHead )
|
|
127 {
|
|
128 if ( v2 )
|
|
129 {
|
|
130 v1->pControlsHead = v2;
|
|
131 ptr->pNext->pPrev = 0;
|
|
132 }
|
|
133 else
|
|
134 {
|
|
135 v1->pControlsHead = 0;
|
|
136 ptr->pParent->pControlsTail = 0;
|
|
137 }
|
|
138 }
|
|
139 else
|
|
140 {
|
|
141 v3 = ptr->pPrev;
|
|
142 if ( v2 )
|
|
143 {
|
|
144 v3->pNext = v2;
|
|
145 ptr->pNext->pPrev = v3;
|
|
146 }
|
|
147 else
|
|
148 {
|
|
149 v3->pNext = 0;
|
|
150 ptr->pParent->pControlsTail = v3;
|
|
151 }
|
|
152 }
|
|
153 --ptr->pParent->uNumControls;
|
|
154 }
|
|
155 }
|
|
156
|
|
157
|
|
158 //----- (00415180) --------------------------------------------------------
|
1006
|
159 void GUIButton::DrawLabel( const char *label_text, struct GUIFont *pFont, int a5, int uFontShadowColor )
|
|
160 {
|
0
|
161 const char *v5; // ebx@1
|
|
162 GUIButton *v6; // esi@1
|
|
163 int v7; // eax@1
|
|
164
|
1006
|
165 v5 = label_text;
|
0
|
166 v6 = this;
|
|
167 //strlen(edx0);
|
1006
|
168 v7 = pFont->GetLineWidth(label_text);
|
0
|
169 return pParent->DrawText(
|
|
170 pFont,
|
|
171 v6->uX + (signed int)(v6->uWidth - v7) / 2,
|
1006
|
172 v6->uY + (signed int)(v6->uHeight - pFont->uFontHeight) / 2,
|
0
|
173 a5,
|
1006
|
174 label_text,
|
0
|
175 0,
|
|
176 0,
|
1006
|
177 uFontShadowColor);
|
0
|
178 }
|