diff options
author | Fire_Head <Fire-Head@users.noreply.github.com> | 2019-06-17 12:37:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-17 12:37:59 +0200 |
commit | 0bb8bf9d1505792a0fd4f9872fd57fca8f197d13 (patch) | |
tree | cc2c85e0ccf486546de22074639d0e8fbe032f65 /src/control | |
parent | Merge pull request #7 from GTAmodding/master (diff) | |
parent | Merge pull request #20 from gennariarmando/master (diff) | |
download | re3-0bb8bf9d1505792a0fd4f9872fd57fca8f197d13.tar re3-0bb8bf9d1505792a0fd4f9872fd57fca8f197d13.tar.gz re3-0bb8bf9d1505792a0fd4f9872fd57fca8f197d13.tar.bz2 re3-0bb8bf9d1505792a0fd4f9872fd57fca8f197d13.tar.lz re3-0bb8bf9d1505792a0fd4f9872fd57fca8f197d13.tar.xz re3-0bb8bf9d1505792a0fd4f9872fd57fca8f197d13.tar.zst re3-0bb8bf9d1505792a0fd4f9872fd57fca8f197d13.zip |
Diffstat (limited to '')
-rw-r--r-- | src/control/Darkel.cpp | 7 | ||||
-rw-r--r-- | src/control/Darkel.h | 4 | ||||
-rw-r--r-- | src/control/Garages.cpp | 64 | ||||
-rw-r--r-- | src/control/Garages.h | 18 | ||||
-rw-r--r-- | src/control/Population.cpp | 2 | ||||
-rw-r--r-- | src/control/Population.h | 2 | ||||
-rw-r--r-- | src/control/Record.cpp | 4 | ||||
-rw-r--r-- | src/control/Record.h | 4 | ||||
-rw-r--r-- | src/control/Replay.cpp | 2 | ||||
-rw-r--r-- | src/control/Replay.h | 7 | ||||
-rw-r--r-- | src/control/Script.cpp | 3 | ||||
-rw-r--r-- | src/control/Script.h | 35 |
12 files changed, 141 insertions, 11 deletions
diff --git a/src/control/Darkel.cpp b/src/control/Darkel.cpp index 95f3e176..aece455d 100644 --- a/src/control/Darkel.cpp +++ b/src/control/Darkel.cpp @@ -3,3 +3,10 @@ #include "Darkel.h" WRAPPER void CDarkel::DrawMessages(void) { EAXJMP(0x420920); } + +bool CDarkel::Status = *(bool*)0x95CCB4; + +bool CDarkel::FrenzyOnGoing() +{ + return Status; +}
\ No newline at end of file diff --git a/src/control/Darkel.h b/src/control/Darkel.h index 41cc69f8..ed78d4e1 100644 --- a/src/control/Darkel.h +++ b/src/control/Darkel.h @@ -2,6 +2,10 @@ class CDarkel { +private: + static bool Status; + public: static void DrawMessages(void); + static bool FrenzyOnGoing(); }; diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp index effc13d8..2994eb49 100644 --- a/src/control/Garages.cpp +++ b/src/control/Garages.cpp @@ -2,8 +2,29 @@ #include "patcher.h" #include "ModelIndices.h" #include "Garages.h" +#include "Timer.h" +#include "Font.h" +#include "Messages.h" +#include "Text.h" -WRAPPER void CGarages::PrintMessages(void) { EAXJMP(0x426310); } +//WRAPPER void CGarages::PrintMessages(void) { EAXJMP(0x426310); } + +int32 &CGarages::BankVansCollected = *(int32 *)0x8F1B34; +bool &CGarages::BombsAreFree = *(bool *)0x95CD7A; +bool &CGarages::RespraysAreFree = *(bool *)0x95CD1D; +int32 &CGarages::CarsCollected = *(int32 *)0x880E18; +int32 &CGarages::CarTypesCollected = *(int32 *)0x8E286C; +int32 &CGarages::CrushedCarId = *(int32 *)0x943060; +uint32 &CGarages::LastTimeHelpMessage = *(uint32 *)0x8F1B58; +int32 &CGarages::MessageNumberInString = *(int32 *)0x885BA8; +const char *CGarages::MessageIDString = (const char *)0x878358; +int32 &CGarages::MessageNumberInString2 = *(int32 *)0x8E2C14; +uint32 &CGarages::MessageStartTime = *(uint32 *)0x8F2530; +uint32 &CGarages::MessageEndTime = *(uint32 *)0x8F597C; +uint32 &CGarages::NumGarages = *(uint32 *)0x8F29F4; +bool &CGarages::PlayerInGarage = *(bool *)0x95CD83; +int32 &CGarages::PoliceCarsCollected = *(int32 *)0x941444; +uint32 &CGarages::GarageToBeTidied = *(uint32 *)0x623570; bool CGarages::IsModelIndexADoor(uint32 id) @@ -42,3 +63,44 @@ CGarages::IsModelIndexADoor(uint32 id) id == MI_CRUSHERBODY || id == MI_CRUSHERLID; } + +void CGarages::PrintMessages() +{ + if (CTimer::GetTimeInMilliseconds() > CGarages::MessageStartTime && CTimer::GetTimeInMilliseconds() < CGarages::MessageEndTime) { + CFont::SetScale(HUD_STRETCH_X(1.2f / 2), HUD_STRETCH_Y(1.5f / 2)); // BUG: game doesn't use macro here. + CFont::SetPropOn(); + CFont::SetJustifyOff(); + CFont::SetBackgroundOff(); + CFont::SetCentreSize(HUD_FROM_RIGHT(50.0f)); + CFont::SetCentreOn(); + CFont::SetFontStyle(FONT_BANK); + + if (CGarages::MessageNumberInString2 < 0) { + if (CGarages::MessageNumberInString < 0) { + CFont::SetColor(CRGBA(0, 0, 0, 255)); + CFont::PrintString((SCREEN_WIDTH/ 2) + HUD_STRETCH_X(2.0f), (SCREEN_HEIGHT / 2) + HUD_STRETCH_Y(-84.0f), TheText.Get(CGarages::MessageIDString)); + + CFont::SetColor(CRGBA(89, 115, 150, 255)); + CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) + HUD_STRETCH_Y(-84.0f), TheText.Get(CGarages::MessageIDString)); + } + else { + CMessages::InsertNumberInString(TheText.Get(CGarages::MessageIDString), CGarages::MessageNumberInString, -1, -1, -1, -1, -1, gUString); + + CFont::SetColor(CRGBA(0, 0, 0, 255)); + CFont::PrintString((SCREEN_WIDTH / 2) + HUD_STRETCH_X(2.0f), (SCREEN_HEIGHT / 2) + HUD_STRETCH_Y(-84.0f + 2.0 - 40.0f), gUString); + + CFont::SetColor(CRGBA(89, 115, 150, 255)); + CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) + HUD_STRETCH_Y(-84.0f - 40.0f), gUString); + } + } + else { + CMessages::InsertNumberInString(TheText.Get(CGarages::MessageIDString), CGarages::MessageNumberInString2, -1, -1, -1, -1, -1, gUString); + + CFont::SetColor(CRGBA(0, 0, 0, 255)); + CFont::PrintString((SCREEN_WIDTH / 2) + HUD_STRETCH_X(2.0f), (SCREEN_HEIGHT / 2) + HUD_STRETCH_Y(-84.0f + 2.0 - 40.0f), gUString); + + CFont::SetColor(CRGBA(89, 115, 150, 255)); + CFont::PrintString((SCREEN_WIDTH / 2), (SCREEN_HEIGHT / 2) + HUD_STRETCH_Y(-84.0f - 40.0f), gUString); + } + } +}
\ No newline at end of file diff --git a/src/control/Garages.h b/src/control/Garages.h index 87cf47fa..f018401c 100644 --- a/src/control/Garages.h +++ b/src/control/Garages.h @@ -3,6 +3,24 @@ class CGarages { public: + static int32 &BankVansCollected; + static bool &BombsAreFree; + static bool &RespraysAreFree; + static int32 &CarsCollected; + static int32 &CarTypesCollected; + static int32 &CrushedCarId; + static uint32 &LastTimeHelpMessage; + static int32 &MessageNumberInString; + static const char *MessageIDString; + static int32 &MessageNumberInString2; + static uint32 &MessageStartTime; + static uint32 &MessageEndTime; + static uint32 &NumGarages; + static bool &PlayerInGarage; + static int32 &PoliceCarsCollected; + static uint32 &GarageToBeTidied; + +public: static bool IsModelIndexADoor(uint32 id); static void PrintMessages(void); }; diff --git a/src/control/Population.cpp b/src/control/Population.cpp index 3626381d..9327452b 100644 --- a/src/control/Population.cpp +++ b/src/control/Population.cpp @@ -1,4 +1,4 @@ #include "common.h" #include "Population.h" -Bool &CPopulation::ms_bGivePedsWeapons = *(Bool*)0x95CCF6;
\ No newline at end of file +bool &CPopulation::ms_bGivePedsWeapons = *(bool*)0x95CCF6;
\ No newline at end of file diff --git a/src/control/Population.h b/src/control/Population.h index e01d2712..ce27657a 100644 --- a/src/control/Population.h +++ b/src/control/Population.h @@ -3,5 +3,5 @@ class CPopulation { public: - static Bool &ms_bGivePedsWeapons; + static bool &ms_bGivePedsWeapons; };
\ No newline at end of file diff --git a/src/control/Record.cpp b/src/control/Record.cpp index 8949da5e..4cc2dccd 100644 --- a/src/control/Record.cpp +++ b/src/control/Record.cpp @@ -1,6 +1,6 @@ #include "common.h" #include "Record.h" -UInt16 &CRecordDataForGame::RecordingState = *(UInt16*)0x95CC24; +uint16 &CRecordDataForGame::RecordingState = *(uint16*)0x95CC24; -UInt8 &CRecordDataForChase::Status = *(UInt8*)0x95CDCE; +uint8 &CRecordDataForChase::Status = *(uint8*)0x95CDCE; diff --git a/src/control/Record.h b/src/control/Record.h index 97a9663d..2b904d1d 100644 --- a/src/control/Record.h +++ b/src/control/Record.h @@ -3,11 +3,11 @@ class CRecordDataForGame { public: - static UInt16 &RecordingState; + static uint16 &RecordingState; }; class CRecordDataForChase { public: - static UInt8 &Status; + static uint8 &Status; }; diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index b1bdc1bf..80edf097 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -3,6 +3,6 @@ #include "Replay.h" uint8 &CReplay::Mode = *(uint8*)0x95CD5B; -Bool &CReplay::bPlayingBackFromFile = *(Bool*)0x95CD58; +bool &CReplay::bPlayingBackFromFile = *(bool*)0x95CD58; WRAPPER void CReplay::Display(void) { EAXJMP(0x595EE0); } diff --git a/src/control/Replay.h b/src/control/Replay.h index 331cc44f..70835596 100644 --- a/src/control/Replay.h +++ b/src/control/Replay.h @@ -3,11 +3,12 @@ class CReplay { public: - static void Display(void); enum { - MODE_1 + MODE_1 = 1 }; static uint8 &Mode; - static Bool &bPlayingBackFromFile; + static bool &bPlayingBackFromFile; + + static void Display(void); }; diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 71fc7bcd..7cea978f 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -4,3 +4,6 @@ #include "Script.h" uint8 *CTheScripts::ScriptSpace = (uint8*)0x74B248; +CTextLine* CTheScripts::IntroTextLines = (CTextLine*)0x70EA74; +CScriptRectangle* CTheScripts::IntroRectangles = (CScriptRectangle*)0x72D109; +CSprite2d* CTheScripts::ScriptSprites = (CSprite2d*)0x72B090; diff --git a/src/control/Script.h b/src/control/Script.h index 6f329e1f..cdc33e97 100644 --- a/src/control/Script.h +++ b/src/control/Script.h @@ -1,7 +1,42 @@ #pragma once +#include "Sprite2d.h" + +struct CScriptRectangle +{ + bool m_bIsUsed; + bool m_bIsAntialiased; + uint16 m_wTextureId; + CRect m_sRect; + CRGBA m_sColor; +}; + +struct CTextLine +{ + float m_fScaleX; + float m_fScaleY; + CRGBA m_sColor; + bool m_bJustify; + bool m_bCentered; + bool m_bBackground; + bool m_bBackgroundOnly; + float m_fWrapX; + float m_fCenterSize; + CRGBA m_sBackgroundColor; + bool m_bTextProportional; + int32 field_29; + bool m_bRightJustify; + int32 field_31; + int32 m_nFont; + float field_36; + float field_40; + wchar m_awText[500]; +}; class CTheScripts { public: static uint8 *ScriptSpace;//[160*1024] + static CTextLine* IntroTextLines; + static CScriptRectangle* IntroRectangles; + static CSprite2d* ScriptSprites; }; |