Skip to content
Browse files

Changed MessageListClass to use the static Instance approach, changed…

… color schemes from defines to enum.

git-svn-id: svn://svn.renegadeprojects.com/yrpp/trunk@347 bbc44d77-a14d-0410-bbfb-905795908d03
  • Loading branch information...
1 parent b91ae80 commit 5eaded2b9d90c71105ccf688e7679898b355d030 @DCoderLT DCoderLT committed Jun 28, 2010
Showing with 32 additions and 25 deletions.
  1. +13 −11 ColorScheme.h
  2. +16 −14 MessageListClass.h
  3. +3 −0 StaticInits.cpp
View
24 ColorScheme.h
@@ -13,6 +13,19 @@ class LightConvertClass;
class ColorScheme
{
public:
+ enum {
+ //ColorScheme indices, since they are hardcoded all over the exe, why shan't we do it as well?
+ Yellow = 3,
+ White = 5,
+ Grey = 7,
+ Red = 11,
+ Orange = 13,
+ Pink = 15,
+ Purple = 17,
+ Blue = 21,
+ Green = 29,
+ };
+
//global array
static DynamicVectorClass<ColorScheme*>* Array;
/*
@@ -72,15 +85,4 @@ class ColorScheme
PROTECTED_PROPERTY(BYTE, unknown_334[0x8]);
};
-//ColorScheme indices, since they are hardcoded all over the exe, why shan't we do it as well?
-#define CS_YELLOW 3
-#define CS_WHITE 5
-#define CS_GREY 7
-#define CS_RED 11
-#define CS_ORANGE 13
-#define CS_PINK 15
-#define CS_PURPLE 17
-#define CS_BLUE 21
-#define CS_GREEN 29
-
#endif
View
30 MessageListClass.h
@@ -7,24 +7,26 @@
#include <wchar.h>
#include <ASMMacros.h>
+#include <ColorScheme.h>
class MessageListClass
{
public:
- static void PrintMessage(const wchar_t* pMessage, int nColorSchemeIndex)
- {
- PUSH_IMM(0);
- PUSH_IMM(0x96);
- PUSH_IMM(0x4046);
- PUSH_VAR32(nColorSchemeIndex);
- PUSH_VAR32(pMessage);
- PUSH_IMM(0);
- PUSH_IMM(0);
- THISCALL_EX(0xA8BC60,0x5D3BA0);
- }
-
- static void PrintMessage(const wchar_t* pMessage)
- { PrintMessage(pMessage, 3); }
+ static MessageListClass * Instance;
+
+ // if pLabel is given, the message will be {$pLabel}:{$pMessage}
+ // else it will be just {$pMessage}
+
+ void PrintMessage(const wchar_t * pLabel, DWORD dwUnk1, const wchar_t* pMessage, int nColorSchemeIndex = 3,
+ DWORD dwUnk2 = 0x4046, DWORD dwUnk3 = 0x96, DWORD dwUnk4 = 0)
+ { JMP_THIS(0x5D3BA0); };
+
+ void PrintMessage(const wchar_t* pLabel, const wchar_t* pMessage, int nColorSchemeIndex = ColorScheme::White)
+ { this->PrintMessage(pLabel, 0, pMessage, nColorSchemeIndex); }
+
+ void PrintMessage(const wchar_t* pMessage, int nColorSchemeIndex = ColorScheme::White)
+ { this->PrintMessage(NULL, 0, pMessage, nColorSchemeIndex); }
+
};
#endif
View
3 StaticInits.cpp
@@ -140,6 +140,9 @@ DECL(InfantryTypeClass, 0xA8E348);
#include <IsometricTileTypeClass.h>
DECL(IsometricTileTypeClass, 0xA8ED28);
+#include <MessageListClass.h>
+ALIAS_O(MessageListClass *, MessageListClass::Instance, 0xA8BC60);
+
#include <MixFileClass.h>
List<MixFileClass*>* MixFileClass::MIXes = (List<MixFileClass*>* )0xABEFD8;
DECL(MixFileClass, 0x884D90);

0 comments on commit 5eaded2

Please sign in to comment.
Something went wrong with that request. Please try again.