Merge pull request #678
commit
1182dea692
|
@ -427,6 +427,12 @@ void CRobotMain::ChangePhase(Phase phase)
|
|||
|
||||
m_phase = phase;
|
||||
|
||||
if (m_phase != PHASE_SIMUL)
|
||||
{
|
||||
Ui::CWindow* pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
|
||||
if ( pw != nullptr ) pw->ClearState(Ui::STATE_VISIBLE | Ui::STATE_ENABLE);
|
||||
}
|
||||
|
||||
if (resetWorld)
|
||||
{
|
||||
m_winDelay = 0.0f;
|
||||
|
@ -5915,32 +5921,35 @@ void CRobotMain::StartDetectEffect(COldObject* object, CObject* target)
|
|||
|
||||
void CRobotMain::CreateCodeBattleInterface()
|
||||
{
|
||||
Math::Point pos, ddim;
|
||||
|
||||
ddim.x = 100.0f/640.0f;
|
||||
ddim.y = 100.0f/480.0f;
|
||||
pos.x = 540.0f/640.0f;
|
||||
pos.y = 100.0f/480.0f;
|
||||
Ui::CWindow* pw = m_interface->CreateWindows(pos, ddim, 3, EVENT_WINDOW6);
|
||||
|
||||
ddim.x = 100.0f/640.0f;
|
||||
ddim.y = 16.0f/480.0f;
|
||||
pos.x = 540.0f/640.0f;
|
||||
pos.y = 178.0f/480.0f;
|
||||
pw->CreateLabel(pos, ddim, 0, EVENT_LABEL0, "Code battle");
|
||||
|
||||
float titleBarSize = (11.0f/64.0f); // this is from the texture
|
||||
ddim.x = 80.0f/640.0f;
|
||||
ddim.y = ((1-titleBarSize)*100.0f-20.0f)/480.0f;
|
||||
pos.x = 550.0f/640.0f;
|
||||
pos.y = 110.0f/480.0f;
|
||||
if (!m_codeBattleStarted)
|
||||
if(m_phase == PHASE_SIMUL)
|
||||
{
|
||||
pw->CreateButton(pos, ddim, 21, EVENT_CODE_BATTLE_START);
|
||||
}
|
||||
else
|
||||
{
|
||||
pw->CreateButton(pos, ddim, 13, EVENT_CODE_BATTLE_SPECTATOR);
|
||||
Math::Point pos, ddim;
|
||||
|
||||
ddim.x = 100.0f/640.0f;
|
||||
ddim.y = 100.0f/480.0f;
|
||||
pos.x = 540.0f/640.0f;
|
||||
pos.y = 100.0f/480.0f;
|
||||
Ui::CWindow* pw = m_interface->CreateWindows(pos, ddim, 3, EVENT_WINDOW6);
|
||||
|
||||
ddim.x = 100.0f/640.0f;
|
||||
ddim.y = 16.0f/480.0f;
|
||||
pos.x = 540.0f/640.0f;
|
||||
pos.y = 178.0f/480.0f;
|
||||
pw->CreateLabel(pos, ddim, 0, EVENT_LABEL0, "Code battle");
|
||||
|
||||
float titleBarSize = (11.0f/64.0f); // this is from the texture
|
||||
ddim.x = 80.0f/640.0f;
|
||||
ddim.y = ((1-titleBarSize)*100.0f-20.0f)/480.0f;
|
||||
pos.x = 550.0f/640.0f;
|
||||
pos.y = 110.0f/480.0f;
|
||||
if (!m_codeBattleStarted)
|
||||
{
|
||||
pw->CreateButton(pos, ddim, 21, EVENT_CODE_BATTLE_START);
|
||||
}
|
||||
else
|
||||
{
|
||||
pw->CreateButton(pos, ddim, 13, EVENT_CODE_BATTLE_SPECTATOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -368,7 +368,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
|
|||
m_camera->SetType(Gfx::CAM_TYPE_INFO);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
|
||||
if (pw != nullptr) pw->ClearState(STATE_VISIBLE);
|
||||
if (pw != nullptr) pw->ClearState(STATE_VISIBLE | STATE_ENABLE);
|
||||
|
||||
pos = m_infoActualPos = m_infoFinalPos;
|
||||
dim = m_infoActualDim = m_infoFinalDim;
|
||||
|
@ -830,7 +830,7 @@ void CDisplayInfo::StopDisplayInfo()
|
|||
m_main->SetEditLock(false, false);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
|
||||
if (pw != nullptr) pw->SetState(STATE_VISIBLE);
|
||||
if (pw != nullptr) pw->SetState(STATE_VISIBLE | STATE_ENABLE);
|
||||
}
|
||||
m_pause->DeactivatePause(m_satcomPause);
|
||||
m_satcomPause = nullptr;
|
||||
|
|
|
@ -371,7 +371,7 @@ void CMainDialog::StartDialog(Math::Point dim, bool fireParticles)
|
|||
if ( pw != nullptr ) pw->ClearState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
|
||||
if ( pw != nullptr ) pw->ClearState(STATE_VISIBLE);
|
||||
if ( pw != nullptr ) pw->ClearState(STATE_VISIBLE | STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW7));
|
||||
if ( pw != nullptr ) pw->ClearState(STATE_ENABLE);
|
||||
|
@ -526,7 +526,7 @@ void CMainDialog::StopDialog()
|
|||
if ( pw != nullptr ) pw->SetState(STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
|
||||
if ( pw != nullptr ) pw->SetState(STATE_VISIBLE);
|
||||
if ( pw != nullptr ) pw->SetState(STATE_VISIBLE | STATE_ENABLE);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW7));
|
||||
if ( pw != nullptr ) pw->SetState(STATE_ENABLE);
|
||||
|
|
|
@ -585,7 +585,7 @@ void CStudio::StartEditScript(CScript *script, std::string name, Program* progra
|
|||
m_script->SetStepMode(!m_bRealTime);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
|
||||
if (pw != nullptr) pw->ClearState(STATE_VISIBLE);
|
||||
if (pw != nullptr) pw->ClearState(STATE_VISIBLE | STATE_ENABLE);
|
||||
|
||||
pos = m_editFinalPos = m_editActualPos = m_settings->GetWindowPos();
|
||||
dim = m_editFinalDim = m_editActualDim = m_settings->GetWindowDim();
|
||||
|
@ -911,7 +911,7 @@ bool CStudio::StopEditScript(bool bCancel)
|
|||
m_interface->DeleteControl(EVENT_WINDOW3);
|
||||
|
||||
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
|
||||
if (pw != nullptr) pw->SetState(STATE_VISIBLE);
|
||||
if (pw != nullptr) pw->SetState(STATE_VISIBLE | STATE_ENABLE);
|
||||
|
||||
m_pause->DeactivatePause(m_editorPause);
|
||||
m_editorPause = nullptr;
|
||||
|
|
Loading…
Reference in New Issue