diff UiGame.cpp @ 1018:9ac94d00012e

Merge
author Grumpy7
date Tue, 21 May 2013 02:24:31 +0200
parents c45d51b3f4f4 eac5af72b614
children c94d6a37d298
line wrap: on
line diff
--- a/UiGame.cpp	Sun May 19 20:41:19 2013 +0200
+++ b/UiGame.cpp	Tue May 21 02:24:31 2013 +0200
@@ -67,6 +67,126 @@
 int uTextureID_GameUI_CharSelectionFrame; // 50C98C
 
 
+//----- (0041D3B7) --------------------------------------------------------
+void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player)
+{
+  //Player *pPlayer; // esi@1
+  int v6; // eax@5
+  int v7; // ebx@5
+  //unsigned int v8; // ecx@5
+  int v9; // ebx@5
+  //unsigned int v10; // eax@5
+  //int v11; // eax@5
+  //unsigned int v12; // ecx@5
+  Texture *v13; // eax@6
+  unsigned int v14; // eax@12
+  PlayerFrame *v15; // eax@12
+  //unsigned int v16; // eax@15
+  unsigned int v20; // eax@15
+  unsigned int v24; // eax@15
+  unsigned int v25; // eax@15
+  unsigned __int8 v28; // al@15
+  char *v29; // eax@16
+  __int64 v35; // ST38_8@22
+  int v36; // esi@22
+  unsigned int v38; // eax@22
+  char *v39; // eax@24
+  signed int uFramesetID; // [sp+20h] [bp-8h]@9
+  int uFramesetIDa; // [sp+20h] [bp-8h]@18
+
+  uint numActivePlayerBuffs = 0;
+  for (uint i = 0; i < 24; ++i)
+    if (player->pPlayerBuffs[i].uExpireTime > 0)
+      ++numActivePlayerBuffs;
+
+  v6 = pFontArrus->uFontHeight + 162;
+  v7 = (numActivePlayerBuffs - 1) * pFontArrus->uFontHeight;
+  v9 = v6 + v7;
+  window->uFrameHeight = v9;
+  window->uFrameZ = window->uFrameWidth + window->uFrameX - 1;
+  window->uFrameW = v9 + window->uFrameY - 1;
+  window->DrawMessageBox(0);
+
+  if (player->Eradicated())
+    v13 = pTexture_PlayerFaceEradicated;
+  else if (player->Dead())
+    v13 = pTexture_PlayerFaceDead;
+  else
+  {
+      uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression);
+      if ( !uFramesetID )
+        uFramesetID = 1;
+      if ( player->expression == CHARACTER_EXPRESSION_21)
+      {
+        v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed);
+      }
+      else
+      {
+        v14 = pMiscTimer->Time();
+        v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14);
+      }
+      player->field_1AA2 = v15->uTextureID - 1;
+      v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1];
+  }
+
+  pRenderer->DrawTextureTransparent(window->uFrameX + 24, window->uFrameY + 24, v13);
+
+  sprintfex(pTmpBuf, "\f%05d", ui_character_header_text_color);
+  sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s"
+  strcat(pTmpBuf, pTmpBuf2);
+  strcat(pTmpBuf, "\f00000\n");
+
+  v20 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth());
+  sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n",
+          pGlobalTXT_LocalizationStrings[108], // "Hit Points"
+          v20, player->sHealth, player->GetMaxHealth());
+  strcat(pTmpBuf, pTmpBuf2);
+
+  v24 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana());
+  sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n",
+          pGlobalTXT_LocalizationStrings[212], // "Spell Points"
+          v24, player->sMana, player->GetMaxMana());
+  strcat(pTmpBuf, pTmpBuf2);
+
+  v25 = player->GetMajorConditionIdx();
+  sprintf(pTmpBuf2, "%s: \f%05d%s\f00000\n",
+          pGlobalTXT_LocalizationStrings[47], // "Condition
+          GetConditionDrawColor(v25), aCharacterConditionNames[v25]);
+  strcat(pTmpBuf, pTmpBuf2);
+
+  v28 = player->uQuickSpell;
+  if ( v28 )
+    v29 = pSpellStats->pInfos[v28].pShortName;
+  else
+    v29 = pGlobalTXT_LocalizationStrings[153];
+  sprintfex(pTmpBuf2, "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell"
+  strcat(pTmpBuf, pTmpBuf2);
+
+  window->DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0);
+
+  uFramesetIDa = 0;
+  for (uint i = 0; i < 24; ++i)
+  {
+    auto buff = player->pPlayerBuffs + i;
+    if (buff->uExpireTime > 0)
+    {
+      v35 = buff->uExpireTime - pParty->uTimePlayed;
+      v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134;
+      v38 = ui_game_character_record_playerbuff_colors[i];
+      window->DrawText(pFontComic, 52, v36, v38, aSpellNames[20 + i], 0, 0, 0);
+      sub_41D20D_buff_remaining_time_string(v36, window, v35, pFontComic);
+    }
+  }
+
+  v39 = "";
+  if ( uFramesetIDa == 0 )
+    v39 = pGlobalTXT_LocalizationStrings[153]; // "None"
+  sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s"
+  window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf, 0, 0, 0);
+}
+
+
+
 //----- (0041A57E) --------------------------------------------------------
 void GameUI_QuickRef_Draw()
 {