Mercurial > mm7
comparison UI/UIRest.cpp @ 1713:e013b92030e3
UIRest cleared
author | Ritor1 |
---|---|
date | Tue, 24 Sep 2013 23:40:33 +0600 |
parents | 69efd5d1ab5c |
children | 28cb79ae2f6f |
comparison
equal
deleted
inserted
replaced
1712:c70d526669ec | 1713:e013b92030e3 |
---|---|
78 //----- (0041FA01) -------------------------------------------------------- | 78 //----- (0041FA01) -------------------------------------------------------- |
79 void RestUI_Draw() | 79 void RestUI_Draw() |
80 { | 80 { |
81 int live_characters; // esi@1 | 81 int live_characters; // esi@1 |
82 unsigned int v3; // eax@15 | 82 unsigned int v3; // eax@15 |
83 bool v5; // eax@21 | |
84 GUIButton tmp_button; // [sp+8h] [bp-DCh]@19 | 83 GUIButton tmp_button; // [sp+8h] [bp-DCh]@19 |
85 float v8; // [sp+CCh] [bp-18h]@17 | |
86 //__int64 v9; // [sp+D0h] [bp-14h]@17 | |
87 unsigned int am_pm_hours; // [sp+D8h] [bp-Ch]@9 | 84 unsigned int am_pm_hours; // [sp+D8h] [bp-Ch]@9 |
88 __int16 shadow_color; // [sp+DCh] [bp-8h]@1 | |
89 int text_color; // [sp+E0h] [bp-4h]@1 | |
90 | 85 |
91 live_characters = 0; | 86 live_characters = 0; |
92 text_color = TargetColor(10, 0, 0); | |
93 shadow_color = TargetColor(230, 214, 193); | |
94 for( int i = 1; i < 5; ++i ) | 87 for( int i = 1; i < 5; ++i ) |
95 if ( !pPlayers[i]->IsDead() && !pPlayers[i]->IsEradicated() && pPlayers[i]->sHealth > 0 ) | 88 if ( !pPlayers[i]->IsDead() && !pPlayers[i]->IsEradicated() && pPlayers[i]->sHealth > 0 ) |
96 ++live_characters; | 89 ++live_characters; |
97 | 90 |
98 if ( live_characters ) | 91 if ( live_characters ) |
118 if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 ) | 111 if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 ) |
119 { | 112 { |
120 v3 = 0; | 113 v3 = 0; |
121 _507CD4_RestUI_hourglass_anim_controller = 0; | 114 _507CD4_RestUI_hourglass_anim_controller = 0; |
122 } | 115 } |
123 //v9 = v3; | 116 hourglass_icon_idx = (int)floorf(((double)v3 / 512.0 * 120.0) + 0.5f) % 256 + 1; |
124 v8 = (double)v3 / 512.0 * 120.0; | |
125 //v7 = v8 + 6.7553994e15; | |
126 //HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7); | |
127 hourglass_icon_idx = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1; | |
128 //hourglass_icon_idx = v4; | |
129 if (hourglass_icon_idx >= 120 ) | 117 if (hourglass_icon_idx >= 120 ) |
130 hourglass_icon_idx = 1; | 118 hourglass_icon_idx = 1; |
131 | 119 |
132 sprintf(pTmpBuf.data(), "hglas%03d", hourglass_icon_idx); | 120 sprintf(pTmpBuf.data(), "hglas%03d", hourglass_icon_idx); |
133 pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); | 121 pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); |
138 tmp_button.uZ = 194; | 126 tmp_button.uZ = 194; |
139 tmp_button.uW = 190; | 127 tmp_button.uW = 190; |
140 tmp_button.uWidth = 171; | 128 tmp_button.uWidth = 171; |
141 tmp_button.uHeight = 37; | 129 tmp_button.uHeight = 37; |
142 tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent; | 130 tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent; |
143 tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, text_color, shadow_color);//Отдых и лечение 8 часов | 131 tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, TargetColor(10, 0, 0), TargetColor(230, 214, 193));//Отдых и лечение 8 часов |
144 tmp_button.pParent = 0; | 132 tmp_button.pParent = 0; |
145 | 133 |
146 sprintf(pTmpBuf.data(), "\r408%d", uRestUI_FoodRequiredToRest); | 134 sprintf(pTmpBuf.data(), "\r408%d", uRestUI_FoodRequiredToRest); |
147 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, text_color, pTmpBuf.data(), 0, 0, shadow_color); | 135 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, TargetColor(10, 0, 0), pTmpBuf.data(), 0, 0, TargetColor(230, 214, 193)); |
148 | 136 |
149 pButton_RestUI_WaitUntilDawn->DrawLabel(pGlobalTXT_LocalizationStrings[237], pFontCreate, text_color, shadow_color);//Ждать до рассвета | 137 pButton_RestUI_WaitUntilDawn->DrawLabel(pGlobalTXT_LocalizationStrings[237], pFontCreate, TargetColor(10, 0, 0), TargetColor(230, 214, 193));//Ждать до рассвета |
150 pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, text_color, shadow_color);//Ждать 1 час | 138 pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, TargetColor(10, 0, 0), TargetColor(230, 214, 193));//Ждать 1 час |
151 pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, text_color, shadow_color);//Ждать 5 минут | 139 pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, TargetColor(10, 0, 0), TargetColor(230, 214, 193));//Ждать 5 минут |
152 pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, text_color, shadow_color);//Закончить отдыхать | 140 pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, TargetColor(10, 0, 0), TargetColor(230, 214, 193));//Закончить отдыхать |
153 memset(&tmp_button, 0, sizeof(GUIButton)); | 141 memset(&tmp_button, 0, sizeof(GUIButton)); |
154 tmp_button.uX = 45; | 142 tmp_button.uX = 45; |
155 tmp_button.uY = 199; | 143 tmp_button.uY = 199; |
156 | 144 |
157 tmp_button.uZ = 229; | 145 tmp_button.uZ = 229; |
159 | 147 |
160 tmp_button.uWidth = 185; | 148 tmp_button.uWidth = 185; |
161 tmp_button.uHeight = 30; | 149 tmp_button.uHeight = 30; |
162 | 150 |
163 tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent; | 151 tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent; |
164 tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, text_color, shadow_color);//Ждать без лечения | 152 tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, TargetColor(10, 0, 0), TargetColor(230, 214, 193));//Ждать без лечения |
165 tmp_button.pParent = 0; | 153 tmp_button.pParent = 0; |
166 v5 = (pParty->uCurrentHour >= 12 && pParty->uCurrentHour < 24)? 1:0; | 154 sprintf(pTmpBuf.data(), "%d:%02d %s", am_pm_hours, pParty->uCurrentMinute, aAMPMNames[(pParty->uCurrentHour >= 12 && pParty->uCurrentHour < 24)? 1:0]); |
167 sprintf(pTmpBuf.data(), "%d:%02d %s", am_pm_hours, pParty->uCurrentMinute, aAMPMNames[v5]); | 155 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, TargetColor(10, 0, 0), pTmpBuf.data(), 0, 0, TargetColor(230, 214, 193)); |
168 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, text_color, pTmpBuf.data(), 0, 0, shadow_color); | |
169 sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1);//День | 156 sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1);//День |
170 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, text_color, pTmpBuf.data(), 0, 0, shadow_color); | 157 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, TargetColor(10, 0, 0), pTmpBuf.data(), 0, 0, TargetColor(230, 214, 193)); |
171 sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1);//Месяц | 158 sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1);//Месяц |
172 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, text_color, pTmpBuf.data(), 0, 0, shadow_color); | 159 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, TargetColor(10, 0, 0), pTmpBuf.data(), 0, 0, TargetColor(230, 214, 193)); |
173 sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear);//Год | 160 sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear);//Год |
174 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, text_color, pTmpBuf.data(), 0, 0, shadow_color); | 161 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, TargetColor(10, 0, 0), pTmpBuf.data(), 0, 0, TargetColor(230, 214, 193)); |
175 if ( dword_506F14 ) | 162 if ( dword_506F14 ) |
176 Sleep6Hours(); | 163 Sleep6Hours(); |
177 } | 164 } |
178 else | 165 else |
179 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, | 166 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, |