Setting speed now works. Added ability to set 4x and 8x using "speed4" and "speed8" cheat codes respectively.
parent
2414861175
commit
7818d5d096
|
@ -1956,6 +1956,17 @@ void CRobotMain::ExecuteCmd(char *cmd)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strcmp(cmd, "speed4") == 0) {
|
||||||
|
SetSpeed(4.0f);
|
||||||
|
UpdateSpeedLabel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (strcmp(cmd, "speed8") == 0) {
|
||||||
|
SetSpeed(8.0f);
|
||||||
|
UpdateSpeedLabel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_phase == PHASE_SIMUL)
|
if (m_phase == PHASE_SIMUL)
|
||||||
m_displayText->DisplayError(ERR_CMD, Math::Vector(0.0f,0.0f,0.0f));
|
m_displayText->DisplayError(ERR_CMD, Math::Vector(0.0f,0.0f,0.0f));
|
||||||
}
|
}
|
||||||
|
@ -6615,9 +6626,20 @@ void CRobotMain::ChangePause(bool pause)
|
||||||
//! Changes game speed
|
//! Changes game speed
|
||||||
void CRobotMain::SetSpeed(float speed)
|
void CRobotMain::SetSpeed(float speed)
|
||||||
{
|
{
|
||||||
// TODO: m_app->SetSimulationSpeed(speed);
|
m_app->SetSimulationSpeed(speed);
|
||||||
|
UpdateSpeedLabel();
|
||||||
|
}
|
||||||
|
|
||||||
|
float CRobotMain::GetSpeed()
|
||||||
|
{
|
||||||
|
return m_app->GetSimulationSpeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CRobotMain::UpdateSpeedLabel()
|
||||||
|
{
|
||||||
Ui::CButton* pb = dynamic_cast<Ui::CButton*>(m_interface->SearchControl(EVENT_SPEED));
|
Ui::CButton* pb = dynamic_cast<Ui::CButton*>(m_interface->SearchControl(EVENT_SPEED));
|
||||||
|
float speed = m_app->GetSimulationSpeed();
|
||||||
|
|
||||||
if (pb != nullptr)
|
if (pb != nullptr)
|
||||||
{
|
{
|
||||||
if (speed == 1.0f)
|
if (speed == 1.0f)
|
||||||
|
@ -6632,11 +6654,7 @@ void CRobotMain::SetSpeed(float speed)
|
||||||
pb->SetState(Ui::STATE_VISIBLE);
|
pb->SetState(Ui::STATE_VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
float CRobotMain::GetSpeed()
|
|
||||||
{
|
|
||||||
return m_app->GetSimulationSpeed();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -383,6 +383,7 @@ protected:
|
||||||
void StopDisplayVisit();
|
void StopDisplayVisit();
|
||||||
void ExecuteCmd(char *cmd);
|
void ExecuteCmd(char *cmd);
|
||||||
bool TestGadgetQuantity(int rank);
|
bool TestGadgetQuantity(int rank);
|
||||||
|
void UpdateSpeedLabel();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CInstanceManager* m_iMan;
|
CInstanceManager* m_iMan;
|
||||||
|
|
Loading…
Reference in New Issue