diff GUIWindow.cpp @ 1760:a2ea57410b15

Merge
author Grumpy7
date Tue, 01 Oct 2013 06:19:58 +0200
parents 24e756a50073
children 633f81bb3ae7
line wrap: on
line diff
--- a/GUIWindow.cpp	Tue Oct 01 06:17:32 2013 +0200
+++ b/GUIWindow.cpp	Tue Oct 01 06:19:58 2013 +0200
@@ -230,7 +230,7 @@
       Y_pos = string_count * pFontComic->uFontHeight + 40; 
       text_color = TargetColor(spell_tooltip_colors[i].R, spell_tooltip_colors[i].G, spell_tooltip_colors[i].B);
       DrawText(pFontComic, 52, Y_pos, text_color, aSpellNames[i], 0, 0, 0);
-      sub_41D20D_buff_remaining_time_string(Y_pos, this, remaing_time, pFontComic); 
+      DrawBuff_remaining_time_string(Y_pos, this, remaing_time, pFontComic); 
       ++string_count;
         }
   }
@@ -1063,74 +1063,57 @@
 }
 
 //----- (004B1854) --------------------------------------------------------
-void GUIWindow::DrawCurrentTime( __int64 a2 )
-	{
-  unsigned int v2; // edi@1
-  unsigned int v3; // esi@1
-  unsigned int v4; // ebp@1
-  unsigned int v5; // ebx@1
-  signed __int64 v6; // ST2C_8@1
-  signed __int64 v7; // kr00_8@1
-  char *v8; // eax@2
-  char *v9; // eax@7
-  char *v10; // eax@13
-  char *v11; // eax@19
-  unsigned __int16 v12; // ST0C_2@22
-  int v13; // eax@22
-  GUIWindow *v15; // [sp+0h] [bp-1Ch]@1
-  signed __int64 v16; // [sp+Ch] [bp-10h]@1
-  signed __int64 v17; // [sp+14h] [bp-8h]@1
-  unsigned int v18; // [sp+20h] [bp+4h]@1
+void GUIWindow::DrawShops_next_generation_time_string( __int64 next_generation_time )
+{
+  unsigned int full_time; // esi@1
+  signed __int64 hours; // kr00_8@1
+  char *text; // eax@2
+  signed __int64 minutes; // [sp+Ch] [bp-10h]@1
+  signed __int64 seconds; // [sp+14h] [bp-8h]@1
+  unsigned int days; // [sp+20h] [bp+4h]@1
 
-  v15 = this;
-  v2 = (unsigned __int64)(signed __int64)((double)a2 * 0.234375) >> 32;
-  v3 = (signed __int64)((double)a2 * 0.234375);
-  v4 = (unsigned __int64)((signed __int64)((double)a2 * 0.234375) / 60) >> 32;
-  v5 = (signed __int64)((double)a2 * 0.234375) / 60;
-  v6 = (signed __int64)((double)a2 * 0.234375) / 60 / 60;
-  v18 = (unsigned int)v6 / 0x18;
-  v17 = (signed __int64)__PAIR__(v2, v3) % 60;
-  v16 = (signed __int64)__PAIR__(v4, v5) % 60;
-  v7 = v6 % 24;
+  full_time = (signed __int64)((double)next_generation_time * 0.234375);
+  seconds = (signed __int64)full_time % 60;
+  minutes = (signed __int64)(full_time / 60) % 60;
+  hours = ((full_time / 60) / 60) % 24;
+  days = (unsigned int)((full_time / 60) / 60) / 24;
   strcpy(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[532]);
-  if ( (unsigned int)v6 /24 )
+  if ( days )
   {
-    v8 = pGlobalTXT_LocalizationStrings[57];
-    if ( v18 <= 1 )
-      v8 = pGlobalTXT_LocalizationStrings[56];
-    sprintfex(pTmpBuf2.data(), "%d %s ", v18, v8);
+    text = pGlobalTXT_LocalizationStrings[57];//Days
+    if ( days <= 1 )
+      text = pGlobalTXT_LocalizationStrings[56];//Day
+    sprintfex(pTmpBuf2.data(), "%d %s ", days, text);
     strcat(pTmpBuf.data(), pTmpBuf2.data());
   }
-  if ( v7 )
+  if ( hours )
   {
-    if ( v7 <= 1 )
-      v9 = pGlobalTXT_LocalizationStrings[109];
+    if ( hours <= 1 )
+      text = pGlobalTXT_LocalizationStrings[109];//Hour
     else
-      v9 = pGlobalTXT_LocalizationStrings[110];
-    sprintfex(pTmpBuf2.data(), "%d %s ", v7, v9);
+      text = pGlobalTXT_LocalizationStrings[110];//Hours
+    sprintfex(pTmpBuf2.data(), "%d %s ", (int)hours, text);
     strcat(pTmpBuf.data(), pTmpBuf2.data());
   }
-  if ( v16 && !v18 )
+  if ( minutes && !days )
   {
-    if ( v16 <= 1 )
-      v10 = pGlobalTXT_LocalizationStrings[437];//"Minute"
+    if ( minutes <= 1 )
+      text = pGlobalTXT_LocalizationStrings[437];//"Minute"
     else
-      v10 = pGlobalTXT_LocalizationStrings[436]; //"Minutes"
-    sprintfex(pTmpBuf2.data(), "%d %s ", v16, v10);
+      text = pGlobalTXT_LocalizationStrings[436]; //"Minutes"
+    sprintfex(pTmpBuf2.data(), "%d %s ", (int)minutes, text);
     strcat(pTmpBuf.data(), pTmpBuf2.data());
   }
-  if ( v17 && !v7 )
+  if ( seconds && !hours )
   {
-    if ( v17 <= 1 )
-      v11 = pGlobalTXT_LocalizationStrings[439]; //"Second"	
+    if ( seconds <= 1 )
+      text = pGlobalTXT_LocalizationStrings[439]; //"Second"	
     else
-      v11 = pGlobalTXT_LocalizationStrings[438]; //"Seconds"
-    sprintfex(pTmpBuf2.data(), "%d %s ", v17, v11);
+      text = pGlobalTXT_LocalizationStrings[438]; //"Seconds"
+    sprintfex(pTmpBuf2.data(), "%d %s ", (int)seconds, text);
     strcat(pTmpBuf.data(), pTmpBuf2.data());
   }
-  v12 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-  v13 = pFontArrus->CalcTextHeight(pTmpBuf.data(), v15, 0, 0);
-  v15->DrawTitleText(pFontArrus, 0, (212 - v13) / 2 + 101, v12, pTmpBuf.data(), 3u);
+  this->DrawTitleText(pFontArrus, 0, (212 - pFontArrus->CalcTextHeight(pTmpBuf.data(), this, 0, 0)) / 2 + 101, TargetColor(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
 }