diff mm7_1.cpp @ 437:0a1ea44b4a0a

ui mesages & spellcasting
author Nomad
date Sun, 24 Feb 2013 09:51:42 +0200
parents 8c45cac1c5e1
children 20d96ec810c8
line wrap: on
line diff
--- a/mm7_1.cpp	Sun Feb 24 03:07:03 2013 +0200
+++ b/mm7_1.cpp	Sun Feb 24 09:51:42 2013 +0200
@@ -1520,13 +1520,14 @@
         if ( result->uHotkey == v3 )
         {
           v6 = result->uControlParam;
-          if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
+          pMessageQueue_50CBD0->AddMessage((UIMessageType)result->uControlID, v6, 0);
+          /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
           {
             pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)result->uControlID;
             pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6;
             *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
             ++pMessageQueue_50CBD0->uNumMessages;
-          }
+          }*/
           return result;
         }
       }
@@ -2025,14 +2026,15 @@
     }
 LABEL_26:
     v11 = v9->uControlParam;
-    if ( (signed int)v2 < 40 )
+    /*if ( (signed int)v2 < 40 )
     {
       pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v9->uControlID;
       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v11;
       *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
       v2 = pMessageQueue_50CBD0->uNumMessages + 1;
       ++pMessageQueue_50CBD0->uNumMessages;
-    }
+    }*/
+    pMessageQueue_50CBD0->AddMessage((UIMessageType)v9->uControlID, v11, v1);
     goto LABEL_47;
   }
   if ( v26 != 38 )
@@ -2150,13 +2152,14 @@
   }
 LABEL_56:
   v21 = v19->uControlParam;
-  if ( (signed int)v2 < 40 )
+  /*if ( (signed int)v2 < 40 )
   {
     pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v19->uControlID;
     pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v21;
     *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
     ++pMessageQueue_50CBD0->uNumMessages;
-  }
+  }*/
+  pMessageQueue_50CBD0->AddMessage((UIMessageType)v19->uControlID, v21, v1);
   return 1;
 }
 
@@ -4542,13 +4545,14 @@
               return;
             }
             v38 = pButton->uControlParam;
-            if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
+            /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
             {
               pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType3;
               pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38;
               *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
               ++pMessageQueue_50CBD0->uNumMessages;
-            }
+            }*/
+            pMessageQueue_50CBD0->AddMessage(pMessageType3, v38, 0);
             //goto LABEL_131;
             uLastPointedObjectID = 1;
             return;
@@ -4576,11 +4580,12 @@
                     v36 = pButton->uControlParam;
                     if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
                     {
-                      pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType2;
+                      pMessageQueue_50CBD0->AddMessage(pMessageType2, v36, 0);
+                      /*pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType2;
                       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36;
                       *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
                       //goto LABEL_27;
-                      ++pMessageQueue_50CBD0->uNumMessages;
+                      ++pMessageQueue_50CBD0->uNumMessages;*/
                       v13 = pButton->pButtonName;
                       sub_41C0B8_set_status_string(v13);
                       uLastPointedObjectID = 1;
@@ -4667,14 +4672,15 @@
             if ( pMessageType1 )
             {
               v12 = pButton->uControlParam;
-              if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
+              pMessageQueue_50CBD0->AddMessage(pMessageType1, v12, 0);
+              /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
               {
                 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1;
                 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
                 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
 //LABEL_27:
                 ++pMessageQueue_50CBD0->uNumMessages;
-              }
+              }*/
             }
 //LABEL_28:
             v13 = pButton->pButtonName;
@@ -4703,13 +4709,14 @@
                   if ( pMessageType1 )
                   {
                     v12 = pButton->uControlParam;
-                    if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
+                    pMessageQueue_50CBD0->AddMessage(pMessageType1, v12, 0);
+                    /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
                     {
                       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1;
                       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12;
                       *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
                       ++pMessageQueue_50CBD0->uNumMessages;
-                    }
+                    }*/
                   }
                   v13 = pButton->pButtonName;
                   sub_41C0B8_set_status_string(v13);
@@ -5394,13 +5401,15 @@
         }
         return;
       }
-      if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
+      /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
         return;
       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)161;
       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v18;
 LABEL_42:
       *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
       ++pMessageQueue_50CBD0->uNumMessages;
+      return;*/
+      pMessageQueue_50CBD0->AddMessage(UIMSG_StartNPCDialogue, v18, 0);
       return;
     }
     if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
@@ -5408,11 +5417,12 @@
       pTurnEngine->field_18 |= 8u;
       return;
     }
-    if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
+    /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
     {
       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23;
       goto LABEL_41;
-    }
+    }*/
+    pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0);
   }
   else
   {
@@ -5422,13 +5432,14 @@
       return;
     }
     if ( uActiveCharacter
-      && sub_427769_spell(pPlayers[uActiveCharacter]->uQuickSpell)
-      && (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
+      && sub_427769_spell(pPlayers[uActiveCharacter]->uQuickSpell))
     {
+      pMessageQueue_50CBD0->AddMessage(UIMSG_19, 0, 0);
+      /*&& (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)25;
 LABEL_41:
       pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
-      goto LABEL_42;
+      goto LABEL_42;*/
     }
   }
 }