annotate GUIButton.cpp @ 793:290afbd48b6b

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