changeset 273:e5afd6848268

GetSkillColor
author Ritor1
date Mon, 18 Feb 2013 16:37:04 +0600
parents d5c41d5e01e0
children a9f58ca01454
files mm7_5.cpp mm7_data.h
diffstat 2 files changed, 24 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/mm7_5.cpp	Mon Feb 18 16:02:32 2013 +0600
+++ b/mm7_5.cpp	Mon Feb 18 16:37:04 2013 +0600
@@ -16764,65 +16764,49 @@
 }
 
 //----- (00417AD4) --------------------------------------------------------
-unsigned int __fastcall sub_417AD4(unsigned int uPlayerClass, enum PLAYER_SKILL_TYPE uPlayerSkillType, signed int a3)
-{
-  //enum PLAYER_SKILL_TYPE v3; // ebx@1
-  //signed int v4; // edi@1
-  unsigned int v5; // ecx@1
+unsigned int __fastcall GetSkillColor(unsigned int uPlayerClass, enum PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level)
+{
   int v6; // edx@1
   int v7; // eax@7
   int v8; // eax@10
   unsigned __int8 v9; // sf@10
   unsigned __int8 v10; // of@10
-  //int v11; // eax@11
   int v12; // eax@14
   unsigned int yellow; // [sp+Ch] [bp-Ch]@1
   unsigned int red; // [sp+10h] [bp-8h]@1
   unsigned int white; // [sp+14h] [bp-4h]@1
 
-  //v3 = uPlayerSkillType;
-  //v4 = uPlayerClass;
   white = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
   red = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0);
   yellow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0);
-  v5 = 0;
-  //v6 = uPlayerClass % 4;
   if ( !(uPlayerClass % 4) )
   {
-    //v11 = 37 * uPlayerClass + uPlayerSkillType;
-    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= a3 )
+    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level )
       return white;
-    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < a3
-      && byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < a3 )
+    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level
+      && byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level )
     {
       v12 = byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 3][uPlayerSkillType];
-      //v10 = __OFSUB__(v12, a3);
-      //v9 = v12 - a3 < 0;
-//LABEL_15:
-      //v5 = red;
-      if ( v12 < a3 )
+      if ( v12 < skill_level )
         return red;
     }
     return yellow;
   }
-  if ( v6 == 1 )
-  {
-    //v7 = 37 * uPlayerClass + uPlayerSkillType;
-    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= a3 )
+  if ( (uPlayerClass % 4) == 1 )
+  {
+    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level )
       return white;
-    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < a3 )
+    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level )
     {
       v8 = byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType];
-      //v10 = __OFSUB__(v8, a3);
-      //v9 = v8 - a3 < 0;
-      if ( v8 < a3)
-		  return red;
+      if ( v8 < skill_level)
+        return red;
     }
     return yellow;
   }
-  if ( v6 == 2 || v6 == 3 )
-  {
-    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < a3 )
+  if ( (uPlayerClass % 4) == 2 || (uPlayerClass % 4) == 3 )
+  {
+    if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level )
       return red;
   }
   return white;
@@ -16889,21 +16873,21 @@
   if ( (v8 & 0x3F) == (v7 & 0x3F) )
   {
     strcpy(a2, "%s\n\n");
-    v24 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 1);
+    v24 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1);
     sprintf(Source, format_4E2DC8, v24);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
-    v25 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 2);
+    v25 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2);
     sprintf(Source, format_4E2DC8, v25);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
-    v26 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 3);
+    v26 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3);
     sprintf(Source, format_4E2DC8, v26);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
     v27 = pPlayer->classType;
     v28 = uPlayerSkillType;
-    v29 = sub_417AD4(v27, uPlayerSkillType, 4);
+    v29 = GetSkillColor(v27, uPlayerSkillType, 4);
     sprintf(Source, format_4E2DC8, v29);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
@@ -16918,20 +16902,20 @@
   else
   {
     strcpy(a2, "%s\n\n");
-    v9 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 1);
+    v9 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1);
     sprintf(Source, format_4E2DC8, v9);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
-    v10 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 2);
+    v10 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2);
     sprintf(Source, format_4E2DC8, v10);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
-    v11 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 3);
+    v11 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3);
     sprintf(Source, format_4E2DC8, v11);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
     v12 = uPlayerSkillType;
-    v13 = sub_417AD4(pPlayer->classType, uPlayerSkillType, 4);
+    v13 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 4);
     sprintf(Source, format_4E2DC8, v13);
     strcat(a2, Source);
     strcat(a2, "%s\t%03d:\t%03d%s\t000\n\n");
--- a/mm7_data.h	Mon Feb 18 16:02:32 2013 +0600
+++ b/mm7_data.h	Mon Feb 18 16:37:04 2013 +0600
@@ -1863,7 +1863,7 @@
 unsigned int __fastcall UI_GetHealthManaStringColor(signed int a1, signed int a2);
 signed int __thiscall GetConditionDrawColor(unsigned int uConditionIdx); // idb
 char __fastcall sub_4179BC_draw_tooltip(const char *a1, const char *a2); // idb
-unsigned int __fastcall sub_417AD4(unsigned int uPlayerClass, enum PLAYER_SKILL_TYPE uPlayerSkillType, signed int a3);
+unsigned int __fastcall GetSkillColor(unsigned int uPlayerClass, enum PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level);
 const char *__fastcall CharacterUI_GetSkillDescText(unsigned int uPlayerID, enum PLAYER_SKILL_TYPE uPlayerSkillType);
 char __cdecl CharacterUI_SkillsTab_ShowHint();
 char __cdecl CharacterUI_StatsTab_ShowHint();