bool FormationEditor::StopSimulation() { D_CHECK(IsSimulating()); m_SimulatedCanvas->Stop(); m_Mode = EEditorMode_Edit; m_SimulatedRefCanvas = NULL; return true; }
void FormationEditor::Tick(f32 _fDeltaTime) { if(IsEditor()) { if(m_CurrentCanvas) m_CurrentCanvas->Tick(_fDeltaTime); } else if(IsSimulating()) { m_SimulatedCanvas->Tick(_fDeltaTime); } else if(IsInRealGame()) { m_RealGameCanvas->Tick(_fDeltaTime); } }
void FormationEditor::Deselect(const Vec2& pos) { if(IsEditor()) { if(m_CurrentCanvas) { m_CurrentCanvas->Deselect(pos); } } else if(IsSimulating()) { m_SimulatedCanvas->Deselect(pos); } else if(IsInRealGame()) { m_RealGameCanvas->Deselect(pos); } }
void FLevelCollectionModel::Tick( float DeltaTime ) { if (bRequestedUpdateAllLevels) { UpdateAllLevels(); } if (bRequestedRedrawAllLevels) { RedrawAllLevels(); } if (bRequestedUpdateActorsCount) { UpdateLevelActorsCount(); } if (IsSimulating()) { // Reset simulation status for all levels for (TSharedPtr<FLevelModel>& LevelModel : AllLevelsList) { LevelModel->UpdateSimulationStatus(nullptr); } // Traverse streaming levels and update simulation status for corresponding level models for (ULevelStreaming* StreamingLevel : GetSimulationWorld()->StreamingLevels) { // Rebuild the original NonPrefixedPackageName so we can find it const FString PrefixedPackageName = StreamingLevel->GetWorldAssetPackageName(); const FString NonPrefixedPackageName = FPackageName::GetLongPackagePath(PrefixedPackageName) + "/" + FPackageName::GetLongPackageAssetName(PrefixedPackageName).RightChop(GetSimulationWorld()->StreamingLevelsPrefix.Len()); TSharedPtr<FLevelModel> LevelModel = FindLevelModel(FName(*NonPrefixedPackageName)); if (LevelModel.IsValid()) { LevelModel->UpdateSimulationStatus(StreamingLevel); } } } }
void FormationEditor::Draw() { if(IsEditor()) { if(m_CurrentRefCanvas) m_CurrentRefCanvas->DrawWithColor(D_Color(192, 192, 192)); if(m_CurrentCanvas) m_CurrentCanvas->Draw(); } else if(IsSimulating()) { if(m_SimulatedRefCanvas) m_SimulatedRefCanvas->DrawWithColor(D_Color(192, 192, 192)); m_SimulatedCanvas->Draw(); } else if(IsInRealGame()) { if(m_SimulatedRefCanvas) m_SimulatedRefCanvas->DrawWithColor(D_Color(192, 192, 192)); m_RealGameCanvas->Draw(); } }
bool FLevelCollectionModel::IsReadOnly() const { // read only in PIE/SIE return IsSimulating(); }