fix(touch): show the joystick and skill buttons only in the game phase
The controls keyed off CPythonBackground's warp map name, which the loading window sets before the game window exists, so the loading screen already showed them. Also require CPythonNetworkStream's phase to be "Game" (PORT_IsGamePhase, exposed as PythonBoot::InGamePhase). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5c8d583b31
commit
f9be09d2c2
@@ -588,7 +588,7 @@ public:
|
||||
private:
|
||||
bool gameplay_controls_visible() const {
|
||||
#ifdef MT_NATIVE_HAS_LIVE_CLIENT
|
||||
return !PythonBoot::CurrentMapName().empty();
|
||||
return PythonBoot::InGamePhase() && !PythonBoot::CurrentMapName().empty();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
||||
@@ -277,6 +277,11 @@ std::string CurrentMapName()
|
||||
return CPythonBackground::Instance().GetWarpMapName();
|
||||
}
|
||||
|
||||
bool InGamePhase()
|
||||
{
|
||||
return g_network_stream && g_network_stream->PORT_IsGamePhase();
|
||||
}
|
||||
|
||||
bool IsRunning()
|
||||
{
|
||||
return g_launcher != nullptr;
|
||||
|
||||
@@ -46,6 +46,8 @@ int ScriptThreadId();
|
||||
bool AppFrame();
|
||||
// Native CPythonBackground map selection, in the local coordinate frame of RenderGame.
|
||||
std::string CurrentMapName();
|
||||
// CPythonNetworkStream is in the game phase (SetGamePhase opened game.GameWindow); false while loading.
|
||||
bool InGamePhase();
|
||||
|
||||
// Used by the platform CPythonApplication: Loop() calls AppLoopWait() before each Process() and stops
|
||||
// when it returns false; Exit()/Abort() call AppRequestQuit() (40250: PostQuitMessage).
|
||||
|
||||
@@ -118,6 +118,8 @@ class CPythonNetworkStream : public CNetworkStream, public CSingleton<CPythonNet
|
||||
// END_OF_SUPPORT_BGM
|
||||
|
||||
bool IsSelectedEmpire();
|
||||
// PORT: the touch host shows its joystick and skill buttons only in the game phase.
|
||||
bool PORT_IsGamePhase() const { return m_strPhase == "Game"; }
|
||||
|
||||
void ToggleGameDebugInfo();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user