diff UI/UIRest.cpp @ 1713:e013b92030e3

UIRest cleared
author Ritor1
date Tue, 24 Sep 2013 23:40:33 +0600
parents 69efd5d1ab5c
children 28cb79ae2f6f
line wrap: on
line diff
--- a/UI/UIRest.cpp	Tue Sep 24 23:18:57 2013 +0600
+++ b/UI/UIRest.cpp	Tue Sep 24 23:40:33 2013 +0600
@@ -80,17 +80,10 @@
 {
   int live_characters; // esi@1
   unsigned int v3; // eax@15
-  bool v5; // eax@21
   GUIButton tmp_button; // [sp+8h] [bp-DCh]@19
-  float v8; // [sp+CCh] [bp-18h]@17
-  //__int64 v9; // [sp+D0h] [bp-14h]@17
   unsigned int am_pm_hours; // [sp+D8h] [bp-Ch]@9
-  __int16 shadow_color; // [sp+DCh] [bp-8h]@1
-  int text_color; // [sp+E0h] [bp-4h]@1
 
   live_characters = 0;
-  text_color =   TargetColor(10, 0, 0);
-  shadow_color = TargetColor(230, 214, 193);
   for( int i = 1; i < 5; ++i )
     if ( !pPlayers[i]->IsDead() && !pPlayers[i]->IsEradicated() && pPlayers[i]->sHealth > 0 )
       ++live_characters;
@@ -120,12 +113,7 @@
       v3 = 0;
       _507CD4_RestUI_hourglass_anim_controller = 0;
     }
-    //v9 = v3;
-    v8 = (double)v3 / 512.0 * 120.0;
-    //v7 = v8 + 6.7553994e15;
-    //HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7);
-    hourglass_icon_idx = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1;
-    //hourglass_icon_idx = v4;
+    hourglass_icon_idx = (int)floorf(((double)v3 / 512.0 * 120.0) + 0.5f) % 256 + 1;
     if (hourglass_icon_idx >= 120 )
       hourglass_icon_idx = 1;
 
@@ -140,16 +128,16 @@
     tmp_button.uWidth = 171;
     tmp_button.uHeight = 37;
     tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent;
-    tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, text_color, shadow_color);//Отдых и лечение 8 часов
+    tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, TargetColor(10, 0, 0), TargetColor(230, 214, 193));//Отдых и лечение 8 часов
     tmp_button.pParent = 0;
 
     sprintf(pTmpBuf.data(), "\r408%d", uRestUI_FoodRequiredToRest);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, text_color, pTmpBuf.data(), 0, 0, shadow_color);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, TargetColor(10, 0, 0), pTmpBuf.data(), 0, 0, TargetColor(230, 214, 193));
 
-    pButton_RestUI_WaitUntilDawn->DrawLabel(pGlobalTXT_LocalizationStrings[237], pFontCreate, text_color, shadow_color);//Ждать до рассвета
-    pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, text_color, shadow_color);//Ждать 1 час
-    pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, text_color, shadow_color);//Ждать 5 минут
-    pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, text_color, shadow_color);//Закончить отдыхать
+    pButton_RestUI_WaitUntilDawn->DrawLabel(pGlobalTXT_LocalizationStrings[237], pFontCreate, TargetColor(10, 0, 0), TargetColor(230, 214, 193));//Ждать до рассвета
+    pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, TargetColor(10, 0, 0), TargetColor(230, 214, 193));//Ждать 1 час
+    pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, TargetColor(10, 0, 0), TargetColor(230, 214, 193));//Ждать 5 минут
+    pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, TargetColor(10, 0, 0), TargetColor(230, 214, 193));//Закончить отдыхать
     memset(&tmp_button, 0, sizeof(GUIButton));
     tmp_button.uX = 45;
     tmp_button.uY = 199;
@@ -161,17 +149,16 @@
     tmp_button.uHeight = 30;
 
     tmp_button.pParent = pButton_RestUI_WaitUntilDawn->pParent;
-    tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, text_color, shadow_color);//Ждать без лечения
+    tmp_button.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, TargetColor(10, 0, 0), TargetColor(230, 214, 193));//Ждать без лечения
     tmp_button.pParent = 0;
-    v5 = (pParty->uCurrentHour >= 12 && pParty->uCurrentHour < 24)? 1:0;
-    sprintf(pTmpBuf.data(), "%d:%02d %s", am_pm_hours, pParty->uCurrentMinute, aAMPMNames[v5]);
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, text_color, pTmpBuf.data(), 0, 0, shadow_color);
+    sprintf(pTmpBuf.data(), "%d:%02d %s", am_pm_hours, pParty->uCurrentMinute, aAMPMNames[(pParty->uCurrentHour >= 12 && pParty->uCurrentHour < 24)? 1:0]);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, TargetColor(10, 0, 0), pTmpBuf.data(), 0, 0, TargetColor(230, 214, 193));
     sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1);//День
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, text_color, pTmpBuf.data(), 0, 0, shadow_color);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, TargetColor(10, 0, 0), pTmpBuf.data(), 0, 0, TargetColor(230, 214, 193));
     sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1);//Месяц
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, text_color, pTmpBuf.data(), 0, 0, shadow_color);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, TargetColor(10, 0, 0), pTmpBuf.data(), 0, 0, TargetColor(230, 214, 193));
     sprintf(pTmpBuf.data(), "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear);//Год
-    pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, text_color, pTmpBuf.data(), 0, 0, shadow_color);
+    pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, TargetColor(10, 0, 0), pTmpBuf.data(), 0, 0, TargetColor(230, 214, 193));
     if ( dword_506F14 )
       Sleep6Hours();
   }