Skip to content

Commit 215173e

Browse files
committed
Update splash window
1 parent df32899 commit 215173e

File tree

15 files changed

+669
-327
lines changed

15 files changed

+669
-327
lines changed

Client/core/CCore.cpp

Lines changed: 29 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,71 +1233,51 @@ void CCore::DoPostFramePulse()
12331233
m_pGUI->SelectInputHandlers(INPUT_CORE);
12341234
}
12351235

1236-
if (m_pGame->GetSystemState() == 5) // GS_INIT_ONCE
1237-
{
1238-
WatchDogCompletedSection("L2"); // gta_sa.set seems ok
1239-
WatchDogCompletedSection("L3"); // No hang on startup
1240-
}
1241-
12421236
// This is the first frame in the menu?
12431237
if (m_pGame->GetSystemState() == 7) // GS_FRONTEND
12441238
{
1245-
// Wait 250 frames more than the time it took to get status 7 (fade-out time)
1246-
static short WaitForMenu = 0;
1239+
if (m_bFirstFrame)
1240+
{
1241+
m_bFirstFrame = false;
12471242

1248-
// Do crash dump encryption while the credit screen is displayed
1249-
if (WaitForMenu == 0)
1243+
WatchDogCompletedSection("L2"); // gta_sa.set seems ok
1244+
WatchDogCompletedSection("L3"); // No hang on startup
12501245
HandleCrashDumpEncryption();
12511246

1252-
// Cope with early finish
1253-
if (m_pGame->HasCreditScreenFadedOut())
1254-
WaitForMenu = 250;
1247+
// Disable vsync while it's all dark
1248+
m_pGame->DisableVSync();
12551249

1256-
if (WaitForMenu >= 250)
1257-
{
1258-
if (m_bFirstFrame)
1250+
// Parse the command line
1251+
// Does it begin with mtasa://?
1252+
if (m_szCommandLineArgs && strnicmp(m_szCommandLineArgs, "mtasa://", 8) == 0)
12591253
{
1260-
m_bFirstFrame = false;
1261-
1262-
// Disable vsync while it's all dark
1263-
m_pGame->DisableVSync();
1264-
1265-
// Parse the command line
1266-
// Does it begin with mtasa://?
1267-
if (m_szCommandLineArgs && strnicmp(m_szCommandLineArgs, "mtasa://", 8) == 0)
1254+
SString strArguments = GetConnectCommandFromURI(m_szCommandLineArgs);
1255+
// Run the connect command
1256+
if (strArguments.length() > 0 && !m_pCommands->Execute(strArguments))
12681257
{
1269-
SString strArguments = GetConnectCommandFromURI(m_szCommandLineArgs);
1270-
// Run the connect command
1271-
if (strArguments.length() > 0 && !m_pCommands->Execute(strArguments))
1272-
{
1273-
ShowMessageBox(_("Error") + _E("CC41"), _("Error executing URL"), MB_BUTTON_OK | MB_ICON_ERROR);
1274-
}
1258+
ShowMessageBox(_("Error") + _E("CC41"), _("Error executing URL"), MB_BUTTON_OK | MB_ICON_ERROR);
12751259
}
1276-
else
1260+
}
1261+
else
1262+
{
1263+
// We want to load a mod?
1264+
const char* szOptionValue;
1265+
if (szOptionValue = GetCommandLineOption("l"))
12771266
{
1278-
// We want to load a mod?
1279-
const char* szOptionValue;
1280-
if (szOptionValue = GetCommandLineOption("l"))
1281-
{
1282-
// Try to load the mod
1283-
if (!m_pModManager->Load(szOptionValue, m_szCommandLineArgs))
1284-
{
1285-
SString strTemp(_("Error running mod specified in command line ('%s')"), szOptionValue);
1286-
ShowMessageBox(_("Error") + _E("CC42"), strTemp, MB_BUTTON_OK | MB_ICON_ERROR); // Command line Mod load failed
1287-
}
1288-
}
1289-
// We want to connect to a server?
1290-
else if (szOptionValue = GetCommandLineOption("c"))
1267+
// Try to load the mod
1268+
if (!m_pModManager->Load(szOptionValue, m_szCommandLineArgs))
12911269
{
1292-
CCommandFuncs::Connect(szOptionValue);
1270+
SString strTemp(_("Error running mod specified in command line ('%s')"), szOptionValue);
1271+
ShowMessageBox(_("Error") + _E("CC42"), strTemp, MB_BUTTON_OK | MB_ICON_ERROR); // Command line Mod load failed
12931272
}
12941273
}
1274+
// We want to connect to a server?
1275+
else if (szOptionValue = GetCommandLineOption("c"))
1276+
{
1277+
CCommandFuncs::Connect(szOptionValue);
1278+
}
12951279
}
12961280
}
1297-
else
1298-
{
1299-
WaitForMenu++;
1300-
}
13011281

13021282
if (m_bWaitToSetNick && GetLocalGUI()->GetMainMenu()->IsVisible() && !GetLocalGUI()->GetMainMenu()->IsFading())
13031283
{

Client/core/CGUI.cpp

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ void CLocalGUI::CreateWindows(bool bGameIsAlreadyLoaded)
158158
m_pLabelVersionTag->SetTextColor(255, 255, 255);
159159
m_pLabelVersionTag->SetZOrderingEnabled(false);
160160
m_pLabelVersionTag->MoveToBack();
161-
m_pLabelVersionTag->SetVisible(false);
161+
if (MTASA_VERSION_TYPE < VERSION_TYPE_RELEASE)
162+
m_pLabelVersionTag->SetAlwaysOnTop(true);
162163

163164
// Create mainmenu
164165
m_pMainMenu = new CMainMenu(pGUI);
@@ -286,27 +287,6 @@ void CLocalGUI::Draw()
286287
// Update mainmenu stuff
287288
m_pMainMenu->Update();
288289

289-
// Make sure our version labels are always visible
290-
static short WaitForMenu = 0;
291-
292-
// Cope with early finish
293-
if (pGame->HasCreditScreenFadedOut())
294-
WaitForMenu = 250;
295-
296-
if (SystemState == 7 || SystemState == 9)
297-
{
298-
if (WaitForMenu < 250)
299-
{
300-
WaitForMenu++;
301-
}
302-
else
303-
{
304-
m_pLabelVersionTag->SetVisible(true);
305-
if (MTASA_VERSION_TYPE < VERSION_TYPE_RELEASE)
306-
m_pLabelVersionTag->SetAlwaysOnTop(true);
307-
}
308-
}
309-
310290
// If we're ingame, make sure the chatbox is drawn
311291
bool bChatVisible = (SystemState == 9 /* GS_INGAME */ && m_pMainMenu->GetIsIngame() && m_bChatboxVisible && !CCore::GetSingleton().IsOfflineMod());
312292
if (m_pChat->IsVisible() != bChatVisible)

Client/core/CMainMenu.cpp

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#define CORE_MTA_FILLER "cgui\\images\\mta_filler.png"
4949
#define CORE_MTA_VERSION "cgui\\images\\version.png"
5050

51-
static int WaitForMenu = 0;
5251
static const SColor headlineColors[] = {SColorRGBA(233, 234, 106, 255), SColorRGBA(233 / 6 * 4, 234 / 6 * 4, 106 / 6 * 4, 255),
5352
SColorRGBA(233 / 7 * 3, 234 / 7 * 3, 106 / 7 * 3, 255)};
5453

@@ -70,11 +69,10 @@ CMainMenu::CMainMenu(CGUI* pManager)
7069

7170
// Initialize
7271
m_pManager = pManager;
73-
m_bIsVisible = false;
72+
m_bIsVisible = true;
7473
m_bIsFullyVisible = false;
7574
m_bIsIngame = true;
7675
// m_bIsInSubWindow = false;
77-
m_bStarted = false;
7876
m_fFader = 0;
7977
m_ucFade = FADE_INVISIBLE;
8078
m_bCursorAlphaReset = false;
@@ -656,47 +654,22 @@ void CMainMenu::Update()
656654
// Force the mainmenu on if we're at GTA's mainmenu or not ingame
657655
if ((SystemState == 7 || SystemState == 9) && !m_bIsIngame)
658656
{
659-
// Cope with early finish
660-
if (pGame->HasCreditScreenFadedOut())
661-
WaitForMenu = std::max(WaitForMenu, 250);
662-
663-
// Fade up
664-
if (WaitForMenu >= 250)
657+
if (!m_bStarted)
665658
{
666-
m_bIsVisible = true;
667659
m_bStarted = true;
668-
}
669660

670-
// Create headlines while the screen is still black
671-
if (WaitForMenu == 250)
672661
m_pNewsBrowser->CreateHeadlines();
673-
674-
// Start updater after fade up is complete
675-
if (WaitForMenu == 275)
676662
GetVersionUpdater()->EnableChecking(true);
677663

678-
#if _WIN32_WINNT <= _WIN32_WINNT_WINXP
679-
if (WaitForMenu == 275)
680-
{
681-
CCore::GetSingletonPtr()->ShowErrorMessageBox("", XP_VISTA_WARNING, "au-revoir-xp-vista");
682-
}
683-
#endif
684-
685-
if (WaitForMenu == 299)
686-
{
687-
if (!g_pCore->GetCVars()->GetValue("discord_rpc_share_data_firsttime", false)
688-
&& g_pCore->GetCVars()->GetValue("allow_discord_rpc", false)
689-
&& !g_pCore->GetCVars()->GetValue("discord_rpc_share_data", false))
664+
if (!g_pCore->GetCVars()->GetValue("discord_rpc_share_data_firsttime", false) && g_pCore->GetCVars()->GetValue("allow_discord_rpc", false) &&
665+
!g_pCore->GetCVars()->GetValue("discord_rpc_share_data", false))
690666
{
691667
m_Settings.ShowRichPresenceShareDataQuestionBox();
692668
CVARS_SET("discord_rpc_share_data_firsttime", true);
693669
}
694670
else
695671
CVARS_SET("discord_rpc_share_data_firsttime", true);
696672
}
697-
698-
if (WaitForMenu < 300)
699-
WaitForMenu++;
700673
}
701674

702675
// If we're visible

Client/core/CMainMenu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class CMainMenu
144144
int m_menuBY;
145145

146146
CGraphics* m_pGraphics;
147-
bool m_bStarted;
147+
bool m_bStarted{false};
148148
CVector2D m_ScreenSize;
149149

150150
// Fade variables

Client/game_sa/CGameSA.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,14 +1041,6 @@ void CGameSA::SetupBrokenModels()
10411041
FixModelCol(3553, 3554);
10421042
}
10431043

1044-
// Well, has it?
1045-
bool CGameSA::HasCreditScreenFadedOut()
1046-
{
1047-
BYTE ucAlpha = *(BYTE*)0xBAB320; // CLoadingScreen::m_FadeAlpha
1048-
bool bCreditScreenFadedOut = (GetSystemState() >= 7) && (ucAlpha < 6);
1049-
return bCreditScreenFadedOut;
1050-
}
1051-
10521044
// Ensure replaced/restored textures for models in the GTA map are correct
10531045
void CGameSA::FlushPendingRestreamIPL()
10541046
{

Client/game_sa/CGameSA.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ class CGameSA : public CGame
280280
void SuspendASyncLoading(bool bSuspend, uint uiAutoUnsuspendDelay = 0);
281281
bool IsASyncLoadingEnabled(bool bIgnoreSuspend = false);
282282

283-
bool HasCreditScreenFadedOut();
284-
285283
void SetupSpecialCharacters();
286284
void FixModelCol(uint iFixModel, uint iFromModel);
287285
void SetupBrokenModels();

0 commit comments

Comments
 (0)