Fix crash while loading mod and blank settings menu while paused game
parent
1b47cf76d3
commit
e823c209fa
|
@ -77,11 +77,11 @@ void CPathManager::AddMod(const std::string &modPath)
|
||||||
if (ON == std::string::npos)
|
if (ON == std::string::npos)
|
||||||
{
|
{
|
||||||
GetLogger()->Info("Loading mod: '%s'\n", modPath.c_str());
|
GetLogger()->Info("Loading mod: '%s'\n", modPath.c_str());
|
||||||
m_mods.push_back(modPath);
|
CResourceManager::AddLocation(modPath, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GetLogger()->Info("Found Excluded mod: '%s'\n", modPath.c_str());
|
GetLogger()->Info("Found excluded mod: '%s'\n", modPath.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,15 +171,33 @@ void CPathManager::InitPaths()
|
||||||
GetLogger()->Trace("Searching for mods in '%s'...\n", modAutoloadDir.c_str());
|
GetLogger()->Trace("Searching for mods in '%s'...\n", modAutoloadDir.c_str());
|
||||||
for (const std::string& modPath : FindModsInDir(modAutoloadDir))
|
for (const std::string& modPath : FindModsInDir(modAutoloadDir))
|
||||||
{
|
{
|
||||||
GetLogger()->Info("Autoloading mod: '%s'\n", modPath.c_str());
|
std::string::size_type ON;
|
||||||
CResourceManager::AddLocation(modPath);
|
ON = modPath.find('~');
|
||||||
|
if (ON == std::string::npos)
|
||||||
|
{
|
||||||
|
GetLogger()->Info("Autoloading mod: '%s'\n", modPath.c_str());
|
||||||
|
CResourceManager::AddLocation(modPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GetLogger()->Info("Found excluded mod: '%s'\n", modPath.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const std::string& modPath : m_mods)
|
for (const std::string& modPath : m_mods)
|
||||||
{
|
{
|
||||||
GetLogger()->Info("Loading mod: '%s'\n", modPath.c_str());
|
std::string::size_type ON;
|
||||||
CResourceManager::AddLocation(modPath);
|
ON = modPath.find('~');
|
||||||
|
if (ON == std::string::npos)
|
||||||
|
{
|
||||||
|
GetLogger()->Info("Loading mod: '%s'\n", modPath.c_str());
|
||||||
|
CResourceManager::AddLocation(modPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GetLogger()->Info("Found excluded mod: '%s'\n", modPath.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CResourceManager::SetSaveLocation(m_savePath);
|
CResourceManager::SetSaveLocation(m_savePath);
|
||||||
|
|
|
@ -327,6 +327,7 @@ std::string PhaseToString(Phase phase)
|
||||||
if (phase == PHASE_SETUPps) return "PHASE_SETUPps";
|
if (phase == PHASE_SETUPps) return "PHASE_SETUPps";
|
||||||
if (phase == PHASE_SETUPcs) return "PHASE_SETUPcs";
|
if (phase == PHASE_SETUPcs) return "PHASE_SETUPcs";
|
||||||
if (phase == PHASE_SETUPss) return "PHASE_SETUPss";
|
if (phase == PHASE_SETUPss) return "PHASE_SETUPss";
|
||||||
|
if (phase == PHASE_SETUPms) return "PHASE_SETUPms";
|
||||||
if (phase == PHASE_WRITEs) return "PHASE_WRITEs";
|
if (phase == PHASE_WRITEs) return "PHASE_WRITEs";
|
||||||
if (phase == PHASE_READ) return "PHASE_READ";
|
if (phase == PHASE_READ) return "PHASE_READ";
|
||||||
if (phase == PHASE_READs) return "PHASE_READs";
|
if (phase == PHASE_READs) return "PHASE_READs";
|
||||||
|
@ -339,7 +340,7 @@ std::string PhaseToString(Phase phase)
|
||||||
|
|
||||||
bool IsInSimulationConfigPhase(Phase phase)
|
bool IsInSimulationConfigPhase(Phase phase)
|
||||||
{
|
{
|
||||||
return (phase >= PHASE_SETUPds && phase <= PHASE_SETUPss) || phase == PHASE_READs || phase == PHASE_WRITEs;
|
return (phase >= PHASE_SETUPds && phase <= PHASE_SETUPms) || phase == PHASE_READs || phase == PHASE_WRITEs;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsPhaseWithWorld(Phase phase)
|
bool IsPhaseWithWorld(Phase phase)
|
||||||
|
@ -3865,6 +3866,7 @@ void CRobotMain::ChangeColor()
|
||||||
m_phase != PHASE_SETUPps &&
|
m_phase != PHASE_SETUPps &&
|
||||||
m_phase != PHASE_SETUPcs &&
|
m_phase != PHASE_SETUPcs &&
|
||||||
m_phase != PHASE_SETUPss &&
|
m_phase != PHASE_SETUPss &&
|
||||||
|
m_phase != PHASE_SETUPms &&
|
||||||
m_phase != PHASE_WIN &&
|
m_phase != PHASE_WIN &&
|
||||||
m_phase != PHASE_LOST &&
|
m_phase != PHASE_LOST &&
|
||||||
m_phase != PHASE_APPERANCE ) return;
|
m_phase != PHASE_APPERANCE ) return;
|
||||||
|
|
|
@ -67,6 +67,7 @@ enum Phase
|
||||||
PHASE_SETUPps,
|
PHASE_SETUPps,
|
||||||
PHASE_SETUPcs,
|
PHASE_SETUPcs,
|
||||||
PHASE_SETUPss,
|
PHASE_SETUPss,
|
||||||
|
PHASE_SETUPms,
|
||||||
PHASE_WRITEs,
|
PHASE_WRITEs,
|
||||||
PHASE_READ,
|
PHASE_READ,
|
||||||
PHASE_READs,
|
PHASE_READs,
|
||||||
|
|
|
@ -107,6 +107,7 @@ bool CMainDialog::EventProcess(const Event &event)
|
||||||
if ( CScreenSetup::GetTab() == PHASE_SETUPp ) m_main->ChangePhase(PHASE_SETUPps);
|
if ( CScreenSetup::GetTab() == PHASE_SETUPp ) m_main->ChangePhase(PHASE_SETUPps);
|
||||||
if ( CScreenSetup::GetTab() == PHASE_SETUPc ) m_main->ChangePhase(PHASE_SETUPcs);
|
if ( CScreenSetup::GetTab() == PHASE_SETUPc ) m_main->ChangePhase(PHASE_SETUPcs);
|
||||||
if ( CScreenSetup::GetTab() == PHASE_SETUPs ) m_main->ChangePhase(PHASE_SETUPss);
|
if ( CScreenSetup::GetTab() == PHASE_SETUPs ) m_main->ChangePhase(PHASE_SETUPss);
|
||||||
|
if ( CScreenSetup::GetTab() == PHASE_SETUPm ) m_main->ChangePhase(PHASE_SETUPss);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( pressedButton == EVENT_INTERFACE_WRITE )
|
if ( pressedButton == EVENT_INTERFACE_WRITE )
|
||||||
|
|
|
@ -192,7 +192,7 @@ void CMainUserInterface::ChangePhase(Phase phase)
|
||||||
screenSetup->SetActive();
|
screenSetup->SetActive();
|
||||||
m_currentScreen = screenSetup;
|
m_currentScreen = screenSetup;
|
||||||
}
|
}
|
||||||
if (m_phase >= PHASE_SETUPds && m_phase <= PHASE_SETUPss)
|
if (m_phase >= PHASE_SETUPds && m_phase <= PHASE_SETUPms)
|
||||||
{
|
{
|
||||||
CScreenSetup* screenSetup = GetSetupScreen(static_cast<Phase>(m_phase - PHASE_SETUPds + PHASE_SETUPd));
|
CScreenSetup* screenSetup = GetSetupScreen(static_cast<Phase>(m_phase - PHASE_SETUPds + PHASE_SETUPd));
|
||||||
screenSetup->SetInSimulation(true);
|
screenSetup->SetInSimulation(true);
|
||||||
|
|
|
@ -240,7 +240,6 @@ bool CScreenSetup::EventProcess(const Event &event)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case EVENT_INTERFACE_SETUPm:
|
case EVENT_INTERFACE_SETUPm:
|
||||||
m_main->ChangePhase(PHASE_SETUPm);
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue