From 3c487c5cd69c53d6fea948643c0a76df03516605 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 1 Apr 2022 21:23:39 +0200 Subject: Moved Stars45 to StarsEx --- Stars45/PlanScreen.cpp | 392 ------------------------------------------------- 1 file changed, 392 deletions(-) delete mode 100644 Stars45/PlanScreen.cpp (limited to 'Stars45/PlanScreen.cpp') diff --git a/Stars45/PlanScreen.cpp b/Stars45/PlanScreen.cpp deleted file mode 100644 index e560be4..0000000 --- a/Stars45/PlanScreen.cpp +++ /dev/null @@ -1,392 +0,0 @@ -/* Starshatter: The Open Source Project - Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors - Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors - Copyright (c) 1997-2006, Destroyer Studios LLC. - - AUTHOR: John DiCamillo - -*/ - -#include "PlanScreen.h" -#include "FormDef.h" -#include "MsnObjDlg.h" -#include "MsnPkgDlg.h" -#include "MsnWepDlg.h" -#include "MsnNavDlg.h" -#include "DebriefDlg.h" -#include "AwardDlg.h" -#include "Campaign.h" -#include "Mission.h" -#include "Sim.h" -#include "Starshatter.h" -#include "StarSystem.h" - -#include "GameWinDX9.h" -#include "Video.h" -#include "Screen.h" -#include "ActiveWindow.h" -#include "Mouse.h" -#include "Keyboard.h" -#include "FadeView.h" -#include "Color.h" -#include "Bitmap.h" -#include "Font.h" -#include "FontMgr.h" -#include "EventDispatch.h" -#include "DataLoader.h" - -// +--------------------------------------------------------------------+ - -PlanScreen::PlanScreen() -: screen(0), navdlg(0), award_dlg(0), debrief_dlg(0), -objdlg(0), pkgdlg(0), wepdlg(0), isShown(false) -{ - loader = DataLoader::GetLoader(); -} - -PlanScreen::~PlanScreen() -{ - TearDown(); -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::Setup(Screen* s) -{ - if (!s) - return; - - screen = s; - - // create windows - loader->UseFileSystem(true); - - FormDef msn_obj_def("MsnObjDlg", 0); - msn_obj_def.Load("MsnObjDlg"); - objdlg = new MsnObjDlg(screen, msn_obj_def, this); - - FormDef msn_pkg_def("MsnPkgDlg", 0); - msn_pkg_def.Load("MsnPkgDlg"); - pkgdlg = new MsnPkgDlg(screen, msn_pkg_def, this); - - FormDef msn_nav_def("MsnNavDlg", 0); - msn_nav_def.Load("MsnNavDlg"); - navdlg = new MsnNavDlg(screen, msn_nav_def, this); - - FormDef msn_wep_def("MsnWepDlg", 0); - msn_wep_def.Load("MsnWepDlg"); - wepdlg = new MsnWepDlg(screen, msn_wep_def, this); - - FormDef award_def("AwardDlg", 0); - award_def.Load("AwardDlg"); - award_dlg = new AwardDlg(screen, award_def, this); - - FormDef debrief_def("DebriefDlg", 0); - debrief_def.Load("DebriefDlg"); - debrief_dlg = new DebriefDlg(screen, debrief_def, this); - - loader->UseFileSystem(Starshatter::UseFileSystem()); - ShowMsnDlg(); -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::TearDown() -{ - if (screen) { - screen->DelWindow(objdlg); - screen->DelWindow(pkgdlg); - screen->DelWindow(wepdlg); - screen->DelWindow(navdlg); - screen->DelWindow(debrief_dlg); - screen->DelWindow(award_dlg); - } - - delete objdlg; - delete pkgdlg; - delete wepdlg; - delete navdlg; - delete debrief_dlg; - delete award_dlg; - - objdlg = 0; - pkgdlg = 0; - wepdlg = 0; - navdlg = 0; - debrief_dlg = 0; - award_dlg = 0; - screen = 0; -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::ExecFrame() -{ - GameWinDX9::GetInstance()->SetScreenColor(Color::Black); - - Mission* mission = 0; - Campaign* campaign = Campaign::GetCampaign(); - - if (campaign) - mission = campaign->GetMission(); - - if (navdlg) { - navdlg->SetMission(mission); - - if (navdlg->IsShown()) - navdlg->ExecFrame(); - } - - if (objdlg && objdlg->IsShown()) { - objdlg->ExecFrame(); - } - - if (pkgdlg && pkgdlg->IsShown()) { - pkgdlg->ExecFrame(); - } - - if (wepdlg && wepdlg->IsShown()) { - wepdlg->ExecFrame(); - } - - if (award_dlg && award_dlg->IsShown()) { - award_dlg->ExecFrame(); - } - - if (debrief_dlg && debrief_dlg->IsShown()) { - debrief_dlg->ExecFrame(); - } -} - -// +--------------------------------------------------------------------+ - -bool -PlanScreen::CloseTopmost() -{ - if (debrief_dlg->IsShown()) { - debrief_dlg->OnClose(0); - } - - if (award_dlg->IsShown()) { - return true; - } - - return false; -} - -void -PlanScreen::Show() -{ - if (!isShown) { - ShowMsnDlg(); - isShown = true; - } -} - -void -PlanScreen::Hide() -{ - HideAll(); - isShown = false; -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::ShowMsnDlg() -{ - HideAll(); - Mouse::Show(true); - objdlg->Show(); -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::HideMsnDlg() -{ - HideAll(); - Mouse::Show(true); - objdlg->Show(); -} - -bool -PlanScreen::IsMsnShown() -{ - return IsMsnObjShown() || IsMsnPkgShown() || IsMsnWepShown(); -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::ShowMsnObjDlg() -{ - HideAll(); - Mouse::Show(true); - objdlg->Show(); -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::HideMsnObjDlg() -{ - HideAll(); - Mouse::Show(true); -} - -// +--------------------------------------------------------------------+ - -bool -PlanScreen::IsMsnObjShown() -{ - return objdlg && objdlg->IsShown(); -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::ShowMsnPkgDlg() -{ - HideAll(); - Mouse::Show(true); - pkgdlg->Show(); -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::HideMsnPkgDlg() -{ - HideAll(); - Mouse::Show(true); -} - -// +--------------------------------------------------------------------+ - -bool -PlanScreen::IsMsnPkgShown() -{ - return pkgdlg && pkgdlg->IsShown(); -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::ShowMsnWepDlg() -{ - HideAll(); - Mouse::Show(true); - wepdlg->Show(); -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::HideMsnWepDlg() -{ - HideAll(); - Mouse::Show(true); -} - -// +--------------------------------------------------------------------+ - -bool -PlanScreen::IsMsnWepShown() -{ - return wepdlg && wepdlg->IsShown(); -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::ShowNavDlg() -{ - if (navdlg && !navdlg->IsShown()) { - HideAll(); - Mouse::Show(true); - navdlg->Show(); - } -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::HideNavDlg() -{ - if (navdlg && navdlg->IsShown()) { - HideAll(); - Mouse::Show(true); - } -} - -// +--------------------------------------------------------------------+ - -bool -PlanScreen::IsNavShown() -{ - return navdlg && navdlg->IsShown(); -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::ShowDebriefDlg() -{ - HideAll(); - Mouse::Show(true); - debrief_dlg->Show(); -} - -void -PlanScreen::HideDebriefDlg() -{ - HideAll(); - Mouse::Show(true); -} - -bool -PlanScreen::IsDebriefShown() -{ - return debrief_dlg && debrief_dlg->IsShown(); -} - -// +--------------------------------------------------------------------+ - -void -PlanScreen::ShowAwardDlg() -{ - HideAll(); - Mouse::Show(true); - award_dlg->Show(); -} - -void -PlanScreen::HideAwardDlg() -{ - HideAll(); - Mouse::Show(true); -} - -bool -PlanScreen::IsAwardShown() -{ - return award_dlg && award_dlg->IsShown(); -} - - -// +--------------------------------------------------------------------+ - -void -PlanScreen::HideAll() -{ - if (objdlg) objdlg->Hide(); - if (pkgdlg) pkgdlg->Hide(); - if (wepdlg) wepdlg->Hide(); - if (navdlg) navdlg->Hide(); - if (award_dlg) award_dlg->Hide(); - if (debrief_dlg) debrief_dlg->Hide(); -} \ No newline at end of file -- cgit v1.1