From 0da933a0146a0689546b21231e14f2dfc2bc14e8 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 23 Feb 2022 23:36:37 +0100 Subject: Switched to use ContentBundle's GetText --- Stars45/Campaign.cpp | 19 +++-- Stars45/CampaignMissionFighter.cpp | 7 +- Stars45/CampaignMissionStarship.cpp | 7 +- Stars45/CmdIntelDlg.cpp | 5 +- Stars45/CmdMissionsDlg.cpp | 9 +- Stars45/CmdOrdersDlg.cpp | 5 +- Stars45/CmpSelectDlg.cpp | 25 +++--- Stars45/CmpnScreen.cpp | 5 +- Stars45/CombatGroup.cpp | 123 ++++++++++++++-------------- Stars45/CombatUnit.cpp | 5 +- Stars45/Computer.cpp | 3 +- Stars45/DebriefDlg.cpp | 11 +-- Stars45/Drive.cpp | 17 ++-- Stars45/EngDlg.cpp | 27 +++--- Stars45/Farcaster.cpp | 5 +- Stars45/FighterAI.cpp | 49 +++++------ Stars45/FighterTacticalAI.cpp | 13 +-- Stars45/FlightDeck.cpp | 5 +- Stars45/FltDlg.cpp | 13 +-- Stars45/FormDef.cpp | 11 +-- Stars45/HUDView.cpp | 87 ++++++++++---------- Stars45/Hangar.cpp | 25 +++--- Stars45/Instruction.cpp | 65 +++++++-------- Stars45/JoyDlg.cpp | 15 ++-- Stars45/LandingGear.cpp | 5 +- Stars45/LoadDlg.cpp | 7 +- Stars45/MapView.cpp | 103 +++++++++++------------ Stars45/Mfd.cpp | 77 ++++++++--------- Stars45/Mission.cpp | 51 ++++++------ Stars45/MsnDlg.cpp | 5 +- Stars45/MsnEditDlg.cpp | 3 +- Stars45/MsnElemDlg.cpp | 5 +- Stars45/MsnObjDlg.cpp | 9 +- Stars45/MsnPkgDlg.cpp | 5 +- Stars45/MsnSelectDlg.cpp | 23 +++--- Stars45/NavAI.cpp | 13 +-- Stars45/NavDlg.cpp | 83 +++++++++---------- Stars45/NavLight.cpp | 5 +- Stars45/NavSystem.cpp | 5 +- Stars45/NetClientDlg.cpp | 21 ++--- Stars45/NetGameClient.cpp | 25 +++--- Stars45/NetGameServer.cpp | 15 ++-- Stars45/NetUnitDlg.cpp | 5 +- Stars45/Player.cpp | 9 +- Stars45/PlayerDlg.cpp | 5 +- Stars45/Power.cpp | 5 +- Stars45/QuantumDrive.cpp | 5 +- Stars45/QuantumView.cpp | 3 +- Stars45/QuitView.cpp | 17 ++-- Stars45/RadioHandler.cpp | 15 ++-- Stars45/RadioTraffic.cpp | 3 +- Stars45/RadioView.cpp | 117 +++++++++++++------------- Stars45/Sensor.cpp | 5 +- Stars45/Shield.cpp | 5 +- Stars45/Ship.cpp | 15 ++-- Stars45/ShipAI.cpp | 27 +++--- Stars45/ShipDesign.cpp | 3 +- Stars45/Sim.cpp | 7 +- Stars45/SimEvent.cpp | 43 +++++----- Stars45/StarServer.cpp | 21 ++--- Stars45/Starshatter.cpp | 41 +++++----- Stars45/StarshipAI.cpp | 31 +++---- Stars45/TacRefDlg.cpp | 61 +++++++------- Stars45/TacticalView.cpp | 159 ++++++++++++++++++------------------ Stars45/Thruster.cpp | 5 +- Stars45/Weapon.cpp | 5 +- Stars45/WeaponDesign.cpp | 3 +- Stars45/Weather.cpp | 13 +-- 68 files changed, 856 insertions(+), 788 deletions(-) diff --git a/Stars45/Campaign.cpp b/Stars45/Campaign.cpp index ab65bbe..7572ea5 100644 --- a/Stars45/Campaign.cpp +++ b/Stars45/Campaign.cpp @@ -33,6 +33,7 @@ #include "Starshatter.h" #include "Player.h" +#include "ContentBundle.h" #include "Game.h" #include "Bitmap.h" #include "DataLoader.h" @@ -459,7 +460,7 @@ Campaign::LoadCampaign(DataLoader* loader, bool full) } else { name = def->term()->isText()->value(); - name = Game::GetInstance()->GetText(name); + name = ContentBundle::GetInstance()->GetText(name); } } else if (def->name()->value() == "desc") { @@ -468,7 +469,7 @@ Campaign::LoadCampaign(DataLoader* loader, bool full) } else { description = def->term()->isText()->value(); - description = Game::GetInstance()->GetText(description); + description = ContentBundle::GetInstance()->GetText(description); } } else if (def->name()->value() == "situation") { @@ -477,7 +478,7 @@ Campaign::LoadCampaign(DataLoader* loader, bool full) } else { situation = def->term()->isText()->value(); - situation = Game::GetInstance()->GetText(situation); + situation = ContentBundle::GetInstance()->GetText(situation); } } else if (def->name()->value() == "orders") { @@ -486,7 +487,7 @@ Campaign::LoadCampaign(DataLoader* loader, bool full) } else { orders = def->term()->isText()->value(); - orders = Game::GetInstance()->GetText(orders); + orders = ContentBundle::GetInstance()->GetText(orders); } } else if (def->name()->value() == "scripted") { @@ -777,7 +778,7 @@ Campaign::ParseAction(TermStruct* val, const char* filename) } else if (pdef->name()->value() == "text") { GetDefText(text, pdef, filename); - text = Game::GetInstance()->GetText(text); + text = ContentBundle::GetInstance()->GetText(text); } else if (pdef->name()->value() == "asset_id") { GetDefNumber(asset_id, pdef, filename); @@ -1022,13 +1023,13 @@ Campaign::LoadMissionList(DataLoader* loader) else if (pdef->name()->value() == "name") { GetDefText(name, pdef, filename); - name = Game::GetInstance()->GetText(name); + name = ContentBundle::GetInstance()->GetText(name); } else if (pdef->name()->value() == "desc") { GetDefText(desc, pdef, filename); if (desc.length() > 0 && desc.length() < 32) - desc = Game::GetInstance()->GetText(desc); + desc = ContentBundle::GetInstance()->GetText(desc); } else if (pdef->name()->value() == "start") @@ -1137,7 +1138,7 @@ Campaign::LoadCustomMissions(DataLoader* loader) if (def) { if (def->name()->value() == "name") { GetDefText(name, def, filename); - name = Game::GetInstance()->GetText(name); + name = ContentBundle::GetInstance()->GetText(name); } else if (def->name()->value() == "type") { @@ -1152,7 +1153,7 @@ Campaign::LoadCustomMissions(DataLoader* loader) else if (def->name()->value() == "desc") { GetDefText(desc, def, filename); if (desc.length() > 0 && desc.length() < 32) - desc = Game::GetInstance()->GetText(desc); + desc = ContentBundle::GetInstance()->GetText(desc); } else if (def->name()->value() == "system") diff --git a/Stars45/CampaignMissionFighter.cpp b/Stars45/CampaignMissionFighter.cpp index 8c90d5d..16c3f7b 100644 --- a/Stars45/CampaignMissionFighter.cpp +++ b/Stars45/CampaignMissionFighter.cpp @@ -33,6 +33,7 @@ #include "StarSystem.h" #include "Player.h" +#include "ContentBundle.h" #include "Random.h" static int pkg_id = 1000; @@ -2108,13 +2109,13 @@ CampaignMissionFighter::DescribeMission() if (mission_info && mission_info->name.length()) sprintf_s(name, "MSN-%03d %s", mission->Identity(), mission_info->name.data()); else if (ward) - sprintf_s(name, "MSN-%03d %s %s", mission->Identity(), Game::GetInstance()->GetText(mission->TypeName()).data(), ward->Name().data()); + sprintf_s(name, "MSN-%03d %s %s", mission->Identity(), ContentBundle::GetInstance()->GetText(mission->TypeName()).data(), ward->Name().data()); else if (prime_target) - sprintf_s(name, "MSN-%03d %s %s %s", mission->Identity(), Game::GetInstance()->GetText(mission->TypeName()).data(), + sprintf_s(name, "MSN-%03d %s %s %s", mission->Identity(), ContentBundle::GetInstance()->GetText(mission->TypeName()).data(), Ship::ClassName(prime_target->GetDesign()->type), prime_target->Name().data()); else - sprintf_s(name, "MSN-%03d %s", mission->Identity(), Game::GetInstance()->GetText(mission->TypeName()).data()); + sprintf_s(name, "MSN-%03d %s", mission->Identity(), ContentBundle::GetInstance()->GetText(mission->TypeName()).data()); if (player_elem) { sprintf_s(player_info, "%d x %s %s '%s'", diff --git a/Stars45/CampaignMissionStarship.cpp b/Stars45/CampaignMissionStarship.cpp index d222e37..35cf9b5 100644 --- a/Stars45/CampaignMissionStarship.cpp +++ b/Stars45/CampaignMissionStarship.cpp @@ -31,6 +31,7 @@ #include "Starshatter.h" #include "StarSystem.h" #include "Player.h" +#include "ContentBundle.h" #include "Random.h" static int pkg_id = 1000; @@ -1359,13 +1360,13 @@ CampaignMissionStarship::DescribeMission() if (mission_info && mission_info->name.length()) sprintf_s(name, "MSN-%03d %s", mission->Identity(), mission_info->name.data()); else if (ward) - sprintf_s(name, "MSN-%03d %s %s", mission->Identity(), Game::GetInstance()->GetText(mission->TypeName()).data(), ward->Name().data()); + sprintf_s(name, "MSN-%03d %s %s", mission->Identity(), ContentBundle::GetInstance()->GetText(mission->TypeName()).data(), ward->Name().data()); else if (prime_target) - sprintf_s(name, "MSN-%03d %s %s %s", mission->Identity(), Game::GetInstance()->GetText(mission->TypeName()).data(), + sprintf_s(name, "MSN-%03d %s %s %s", mission->Identity(), ContentBundle::GetInstance()->GetText(mission->TypeName()).data(), Ship::ClassName(prime_target->GetDesign()->type), prime_target->Name().data()); else - sprintf_s(name, "MSN-%03d %s", mission->Identity(), Game::GetInstance()->GetText(mission->TypeName()).data()); + sprintf_s(name, "MSN-%03d %s", mission->Identity(), ContentBundle::GetInstance()->GetText(mission->TypeName()).data()); if (player) { strcpy_s(player_info, player->GetCombatGroup()->GetDescription()); diff --git a/Stars45/CmdIntelDlg.cpp b/Stars45/CmdIntelDlg.cpp index 5dfceac..3fbc6ec 100644 --- a/Stars45/CmdIntelDlg.cpp +++ b/Stars45/CmdIntelDlg.cpp @@ -26,6 +26,7 @@ #include "CameraDirector.h" #include "Game.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "Button.h" #include "ComboBox.h" @@ -168,7 +169,7 @@ CmdIntelDlg::ExecFrame() lst_news->SetItemText(i, 1, dateline); lst_news->SetItemText(i, 2, info->Title()); lst_news->SetItemText(i, 3, info->Region()); - lst_news->SetItemText(i, 4, Game::GetInstance()->GetText(info->SourceName())); + lst_news->SetItemText(i, 4, ContentBundle::GetInstance()->GetText(info->SourceName())); if (!info->Visited()) auto_scroll = true; @@ -192,7 +193,7 @@ CmdIntelDlg::ExecFrame() lst_news->SetItemText(j, 1, dateline); lst_news->SetItemText(j, 2, info->Title()); lst_news->SetItemText(j, 3, info->Region()); - lst_news->SetItemText(j, 4, Game::GetInstance()->GetText(info->SourceName())); + lst_news->SetItemText(j, 4, ContentBundle::GetInstance()->GetText(info->SourceName())); if (!info->Visited()) auto_scroll = true; diff --git a/Stars45/CmdMissionsDlg.cpp b/Stars45/CmdMissionsDlg.cpp index e378c3d..a2dac90 100644 --- a/Stars45/CmdMissionsDlg.cpp +++ b/Stars45/CmdMissionsDlg.cpp @@ -26,6 +26,7 @@ #include "Player.h" #include "Game.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "Button.h" #include "ComboBox.h" @@ -120,7 +121,7 @@ CmdMissionsDlg::Show() Mission* m = info->mission; if (m) { if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) { - lst_missions->SetItemText(i, 1, Game::GetInstance()->GetText("CmdMissionsDlg.training")); + lst_missions->SetItemText(i, 1, ContentBundle::GetInstance()->GetText("CmdMissionsDlg.training")); } else { lst_missions->SetItemText(i, 1, m->TypeName()); @@ -152,7 +153,7 @@ CmdMissionsDlg::ExecFrame() Mission* m = info->mission; if (m) { if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) { - lst_missions->SetItemText(i, 1, Game::GetInstance()->GetText("CmdMissionsDlg.training")); + lst_missions->SetItemText(i, 1, ContentBundle::GetInstance()->GetText("CmdMissionsDlg.training")); } else { lst_missions->SetItemText(i, 1, m->TypeName()); @@ -175,7 +176,7 @@ CmdMissionsDlg::ExecFrame() Mission* m = info->mission; if (m) { if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) { - lst_missions->SetItemText(i, 1, Game::GetInstance()->GetText("CmdMissionsDlg.training")); + lst_missions->SetItemText(i, 1, ContentBundle::GetInstance()->GetText("CmdMissionsDlg.training")); } else { lst_missions->SetItemText(i, 1, m->TypeName()); @@ -213,7 +214,7 @@ CmdMissionsDlg::ExecFrame() Mission* m = info->mission; if (m) { if (m->Type() == Mission::TRAINING && player->HasTrained(m->Identity())) { - lst_missions->SetItemText(i, 1, Game::GetInstance()->GetText("CmdMissionsDlg.training")); + lst_missions->SetItemText(i, 1, ContentBundle::GetInstance()->GetText("CmdMissionsDlg.training")); } else { lst_missions->SetItemText(i, 1, m->TypeName()); diff --git a/Stars45/CmdOrdersDlg.cpp b/Stars45/CmdOrdersDlg.cpp index 835aea7..fd6e860 100644 --- a/Stars45/CmdOrdersDlg.cpp +++ b/Stars45/CmdOrdersDlg.cpp @@ -23,6 +23,7 @@ #include "ShipDesign.h" #include "Game.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "Button.h" #include "ComboBox.h" @@ -92,7 +93,7 @@ CmdOrdersDlg::Show() if (campaign && lbl_orders) { Text orders(""); - orders += Game::GetInstance()->GetText("CmdOrdersDlg.situation"); + orders += ContentBundle::GetInstance()->GetText("CmdOrdersDlg.situation"); orders += "\n"; if (*campaign->Situation()) orders += campaign->Situation(); @@ -100,7 +101,7 @@ CmdOrdersDlg::Show() orders += campaign->Description(); orders += "\n\n"; - orders += Game::GetInstance()->GetText("CmdOrdersDlg.orders"); + orders += ContentBundle::GetInstance()->GetText("CmdOrdersDlg.orders"); orders += "\n"; orders += campaign->Orders(); diff --git a/Stars45/CmpSelectDlg.cpp b/Stars45/CmpSelectDlg.cpp index 47ce573..4e21257 100644 --- a/Stars45/CmpSelectDlg.cpp +++ b/Stars45/CmpSelectDlg.cpp @@ -23,6 +23,7 @@ #include "Player.h" #include "Game.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "Button.h" #include "ListBox.h" @@ -54,7 +55,7 @@ selected_mission(-1), show_saved(false), loading(false), loaded(false), hproc(0) { stars = Starshatter::GetInstance(); - select_msg = Game::GetInstance()->GetText("CmpSelectDlg.select_msg"); + select_msg = ContentBundle::GetInstance()->GetText("CmpSelectDlg.select_msg"); Init(def); } @@ -139,7 +140,7 @@ CmpSelectDlg::ExecFrame() campaign->Name() + Text("\n\n") + Text("") + - Game::GetInstance()->GetText("CmpSelectDlg.scenario") + + ContentBundle::GetInstance()->GetText("CmpSelectDlg.scenario") + Text("\n\t") + campaign->Description()); } @@ -156,15 +157,15 @@ CmpSelectDlg::ExecFrame() campaign->Name() + Text("\n\n") + Text("") + - Game::GetInstance()->GetText("CmpSelectDlg.scenario") + + ContentBundle::GetInstance()->GetText("CmpSelectDlg.scenario") + Text("\n\t") + campaign->Description() + Text("\n\n") + - Game::GetInstance()->GetText("CmpSelectDlg.campaign-time") + + ContentBundle::GetInstance()->GetText("CmpSelectDlg.campaign-time") + Text("\n\t") + time_buf + Text("\n\n") + - Game::GetInstance()->GetText("CmpSelectDlg.assignment") + + ContentBundle::GetInstance()->GetText("CmpSelectDlg.assignment") + Text("\n\t"); if (campaign->GetPlayerGroup()) @@ -173,7 +174,7 @@ CmpSelectDlg::ExecFrame() desc += "n/a"; desc += Text("\n\n") + - Game::GetInstance()->GetText("CmpSelectDlg.team-score") + + ContentBundle::GetInstance()->GetText("CmpSelectDlg.team-score") + Text("\n\t") + score_buf; @@ -208,7 +209,7 @@ CmpSelectDlg::ShowNewCampaigns() AutoThreadSync a(sync); if (loading && description) { - description->SetText(Game::GetInstance()->GetText("CmpSelectDlg.already-loading")); + description->SetText(ContentBundle::GetInstance()->GetText("CmpSelectDlg.already-loading")); Button::PlaySound(Button::SND_REJECT); return; } @@ -285,7 +286,7 @@ CmpSelectDlg::ShowSavedCampaigns() AutoThreadSync a(sync); if (loading && description) { - description->SetText(Game::GetInstance()->GetText("CmpSelectDlg.already-loading")); + description->SetText(ContentBundle::GetInstance()->GetText("CmpSelectDlg.already-loading")); Button::PlaySound(Button::SND_REJECT); return; } @@ -334,7 +335,7 @@ CmpSelectDlg::OnCampaignSelect(AWEvent* event) AutoThreadSync a(sync); if (loading) { - description->SetText(Game::GetInstance()->GetText("CmpSelectDlg.already-loading")); + description->SetText(ContentBundle::GetInstance()->GetText("CmpSelectDlg.already-loading")); Button::PlaySound(Button::SND_REJECT); return; } @@ -455,9 +456,9 @@ CmpSelectDlg::OnDelete(AWEvent* event) ConfirmDlg* confirm = manager->GetConfirmDlg(); if (confirm) { char msg[256]; - sprintf_s(msg, Game::GetInstance()->GetText("CmpSelectDlg.are-you-sure"), load_file.data()); + sprintf_s(msg, ContentBundle::GetInstance()->GetText("CmpSelectDlg.are-you-sure"), load_file.data()); confirm->SetMessage(msg); - confirm->SetTitle(Game::GetInstance()->GetText("CmpSelectDlg.confirm")); + confirm->SetTitle(ContentBundle::GetInstance()->GetText("CmpSelectDlg.confirm")); manager->ShowConfirmDlg(); } @@ -533,7 +534,7 @@ CmpSelectDlg::StartLoadProc() loaded = false; if (description) - description->SetText(Game::GetInstance()->GetText("CmpSelectDlg.loading")); + description->SetText(ContentBundle::GetInstance()->GetText("CmpSelectDlg.loading")); DWORD thread_id = 0; hproc = CreateThread(0, 4096, CmpSelectDlgLoadProc, (LPVOID) this, 0, &thread_id); diff --git a/Stars45/CmpnScreen.cpp b/Stars45/CmpnScreen.cpp index 9d33499..44a3863 100644 --- a/Stars45/CmpnScreen.cpp +++ b/Stars45/CmpnScreen.cpp @@ -29,6 +29,7 @@ #include "MusicDirector.h" #include "Game.h" +#include "ContentBundle.h" #include "Video.h" #include "Screen.h" #include "Window.h" @@ -233,8 +234,8 @@ CmpnScreen::ExecFrame() if (player->Trained() >= all_missions && player->Trained() < 255) { player->SetTrained(255); - cmd_msg_dlg->Title()->SetText(Game::GetInstance()->GetText("CmpnScreen.training")); - sprintf_s(msg_info, Game::GetInstance()->GetText("CmpnScreen.congrats"), + cmd_msg_dlg->Title()->SetText(ContentBundle::GetInstance()->GetText("CmpnScreen.training")); + sprintf_s(msg_info, ContentBundle::GetInstance()->GetText("CmpnScreen.congrats"), Player::RankName(player->Rank()), player->Name().data()); diff --git a/Stars45/CombatGroup.cpp b/Stars45/CombatGroup.cpp index 767c6a7..9844445 100644 --- a/Stars45/CombatGroup.cpp +++ b/Stars45/CombatGroup.cpp @@ -22,6 +22,7 @@ #include "Ship.h" #include "Game.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "ParseUtil.h" @@ -440,7 +441,7 @@ CombatGroup::GetOrdinal() const if (last_two_digits > 10 && last_two_digits < 20) { sprintf_s(ordinal, "ordinal.%d", last_two_digits); - Text suffix = Game::GetInstance()->GetText(ordinal); + Text suffix = ContentBundle::GetInstance()->GetText(ordinal); if (suffix != ordinal) sprintf_s(ordinal, "%d%s", id, suffix.data()); @@ -450,7 +451,7 @@ CombatGroup::GetOrdinal() const else { int last_digit = last_two_digits % 10; sprintf_s(ordinal, "ordinal.%d", last_digit); - Text suffix = Game::GetInstance()->GetText(ordinal); + Text suffix = ContentBundle::GetInstance()->GetText(ordinal); if (suffix != ordinal) sprintf_s(ordinal, "%d%s", id, suffix.data()); else if (last_digit == 1) @@ -480,35 +481,35 @@ CombatGroup::GetDescription() const switch (type) { case FORCE: strcpy_s(desc, (const char*) name); break; - case FLEET: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.FLEET").data(), name_desc); break; - case CARRIER_GROUP: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.CARRIER_GROUP").data(), name_desc); break; - case BATTLE_GROUP: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.BATTLE_GROUP").data(), name_desc); break; - case DESTROYER_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.DESTROYER_SQUADRON").data(), name_desc); break; - - case WING: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.WING").data(), name_desc); break; - case ATTACK_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.ATTACK_SQUADRON").data(), name_desc); break; - case FIGHTER_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.FIGHTER_SQUADRON").data(), name_desc); break; - case INTERCEPT_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.INTERCEPT_SQUADRON").data(), name_desc); break; - case LCA_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.LCA_SQUADRON").data(), name_desc); break; - - case BATTALION: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.BATTALION").data(), name_desc); break; - case STATION: sprintf_s(desc, "%s %s", Game::GetInstance()->GetText("CombatGroup.STATION").data(), name.data()); break; - case STARBASE: sprintf_s(desc, "%s %d%s", Game::GetInstance()->GetText("CombatGroup.STARBASE").data(), id, name_desc); break; - case MINEFIELD: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.MINEFIELD").data(), name_desc); break; - case BATTERY: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.BATTERY").data(), name_desc); break; - case MISSILE: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.MISSILE").data(), name_desc); break; - - case C3I: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.C3I").data(), name_desc); break; - case COMM_RELAY: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.COMM_RELAY").data(), name_desc); break; - case EARLY_WARNING: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.EARLY_WARNING").data(), name_desc); break; - case FWD_CONTROL_CTR: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.FWD_CONTROL_CTR").data(), name_desc); break; - case ECM: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.ECM").data(), name_desc); break; - - case SUPPORT: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.SUPPORT").data(), name_desc); break; - case COURIER: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.COURIER").data(), name_desc); break; - case SUPPLY: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.SUPPLY").data(), name_desc); break; - case REPAIR: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.REPAIR").data(), name_desc); break; - case MEDICAL: sprintf_s(desc, "%s %s%s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.MEDICAL").data(), name_desc); break; + case FLEET: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.FLEET").data(), name_desc); break; + case CARRIER_GROUP: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.CARRIER_GROUP").data(), name_desc); break; + case BATTLE_GROUP: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.BATTLE_GROUP").data(), name_desc); break; + case DESTROYER_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.DESTROYER_SQUADRON").data(), name_desc); break; + + case WING: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.WING").data(), name_desc); break; + case ATTACK_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.ATTACK_SQUADRON").data(), name_desc); break; + case FIGHTER_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.FIGHTER_SQUADRON").data(), name_desc); break; + case INTERCEPT_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.INTERCEPT_SQUADRON").data(), name_desc); break; + case LCA_SQUADRON: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.LCA_SQUADRON").data(), name_desc); break; + + case BATTALION: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.BATTALION").data(), name_desc); break; + case STATION: sprintf_s(desc, "%s %s", ContentBundle::GetInstance()->GetText("CombatGroup.STATION").data(), name.data()); break; + case STARBASE: sprintf_s(desc, "%s %d%s", ContentBundle::GetInstance()->GetText("CombatGroup.STARBASE").data(), id, name_desc); break; + case MINEFIELD: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.MINEFIELD").data(), name_desc); break; + case BATTERY: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.BATTERY").data(), name_desc); break; + case MISSILE: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.MISSILE").data(), name_desc); break; + + case C3I: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.C3I").data(), name_desc); break; + case COMM_RELAY: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.COMM_RELAY").data(), name_desc); break; + case EARLY_WARNING: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.EARLY_WARNING").data(), name_desc); break; + case FWD_CONTROL_CTR: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.FWD_CONTROL_CTR").data(), name_desc); break; + case ECM: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.ECM").data(), name_desc); break; + + case SUPPORT: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.SUPPORT").data(), name_desc); break; + case COURIER: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.COURIER").data(), name_desc); break; + case SUPPLY: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.SUPPLY").data(), name_desc); break; + case REPAIR: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.REPAIR").data(), name_desc); break; + case MEDICAL: sprintf_s(desc, "%s %s%s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.MEDICAL").data(), name_desc); break; case CIVILIAN: case WAR_PRODUCTION: @@ -525,7 +526,7 @@ CombatGroup::GetDescription() const case PASSENGER: case PRIVATE: strcpy_s(desc, (const char*) name); break; - default: sprintf_s(desc, "%s%s", Game::GetInstance()->GetText("CombatGroup.default").data(), name_desc); break; + default: sprintf_s(desc, "%s%s", ContentBundle::GetInstance()->GetText("CombatGroup.default").data(), name_desc); break; } return desc; @@ -539,34 +540,34 @@ CombatGroup::GetShortDescription() const switch (type) { case FORCE: strcpy_s(desc, (const char*) name); break; - case FLEET: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.FLEET").data()); break; - case CARRIER_GROUP: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.CARRIER_GROUP").data()); break; - case BATTLE_GROUP: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.BATTLE_GROUP").data()); break; - case DESTROYER_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.DESTROYER_SQUADRON").data()); break; - - case WING: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.WING").data()); break; - case ATTACK_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.ATTACK_SQUADRON").data()); break; - case FIGHTER_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.FIGHTER_SQUADRON").data()); break; - case INTERCEPT_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.INTERCEPT_SQUADRON").data()); break; - case LCA_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.LCA_SQUADRON").data()); break; - - case BATTALION: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.BATTALION").data()); break; - case STATION: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.STATION").data()); break; - case STARBASE: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.STARBASE").data()); break; - case MINEFIELD: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.MINEFIELD").data()); break; - case BATTERY: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.BATTERY").data()); break; - - case C3I: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.C3I").data()); break; - case COMM_RELAY: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.COMM_RELAY").data()); break; - case EARLY_WARNING: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.EARLY_WARNING").data()); break; - case FWD_CONTROL_CTR: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.FWD_CONTROL_CTR").data()); break; - case ECM: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.ECM").data()); break; - - case SUPPORT: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.SUPPORT").data()); break; - case COURIER: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.COURIER").data()); break; - case MEDICAL: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.MEDICAL").data()); break; - case SUPPLY: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.SUPPLY").data()); break; - case REPAIR: sprintf_s(desc, "%s %s", GetOrdinal(), Game::GetInstance()->GetText("CombatGroup.abrv.REPAIR").data()); break; + case FLEET: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.FLEET").data()); break; + case CARRIER_GROUP: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.CARRIER_GROUP").data()); break; + case BATTLE_GROUP: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.BATTLE_GROUP").data()); break; + case DESTROYER_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.DESTROYER_SQUADRON").data()); break; + + case WING: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.WING").data()); break; + case ATTACK_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.ATTACK_SQUADRON").data()); break; + case FIGHTER_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.FIGHTER_SQUADRON").data()); break; + case INTERCEPT_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.INTERCEPT_SQUADRON").data()); break; + case LCA_SQUADRON: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.LCA_SQUADRON").data()); break; + + case BATTALION: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.BATTALION").data()); break; + case STATION: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.STATION").data()); break; + case STARBASE: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.STARBASE").data()); break; + case MINEFIELD: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.MINEFIELD").data()); break; + case BATTERY: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.BATTERY").data()); break; + + case C3I: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.C3I").data()); break; + case COMM_RELAY: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.COMM_RELAY").data()); break; + case EARLY_WARNING: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.EARLY_WARNING").data()); break; + case FWD_CONTROL_CTR: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.FWD_CONTROL_CTR").data()); break; + case ECM: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.ECM").data()); break; + + case SUPPORT: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.SUPPORT").data()); break; + case COURIER: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.COURIER").data()); break; + case MEDICAL: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.MEDICAL").data()); break; + case SUPPLY: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.SUPPLY").data()); break; + case REPAIR: sprintf_s(desc, "%s %s", GetOrdinal(), ContentBundle::GetInstance()->GetText("CombatGroup.abrv.REPAIR").data()); break; case CIVILIAN: case WAR_PRODUCTION: @@ -583,7 +584,7 @@ CombatGroup::GetShortDescription() const case PASSENGER: case PRIVATE: strcpy_s(desc, (const char*) name); break; - default: sprintf_s(desc, "%s", Game::GetInstance()->GetText("CombatGroup.abrv.default").data()); break; + default: sprintf_s(desc, "%s", ContentBundle::GetInstance()->GetText("CombatGroup.abrv.default").data()); break; } return desc; diff --git a/Stars45/CombatUnit.cpp b/Stars45/CombatUnit.cpp index 6a25ab5..7d6d3df 100644 --- a/Stars45/CombatUnit.cpp +++ b/Stars45/CombatUnit.cpp @@ -19,6 +19,7 @@ #include "Ship.h" #include "Game.h" +#include "ContentBundle.h" // +----------------------------------------------------------------------+ #undef random @@ -88,7 +89,7 @@ CombatUnit::GetDescription() const static char desc[256]; if (!design) { - strcpy_s(desc, Game::GetInstance()->GetText("[unknown]").data()); + strcpy_s(desc, ContentBundle::GetInstance()->GetText("[unknown]").data()); } else if (count > 1) { @@ -103,7 +104,7 @@ CombatUnit::GetDescription() const if (dead_count > 0) { strcat_s(desc, " "); - strcat_s(desc, Game::GetInstance()->GetText("killed.in.action")); + strcat_s(desc, ContentBundle::GetInstance()->GetText("killed.in.action")); } } diff --git a/Stars45/Computer.cpp b/Stars45/Computer.cpp index a4b9564..2687bde 100644 --- a/Stars45/Computer.cpp +++ b/Stars45/Computer.cpp @@ -14,6 +14,7 @@ #include "MemDebug.h" #include "Computer.h" #include "Game.h" +#include "ContentBundle.h" // +----------------------------------------------------------------------+ @@ -26,7 +27,7 @@ static int computer_value[] = { Computer::Computer(int comp_type, const char* comp_name) : System(COMPUTER, comp_type, comp_name, 1, 1, 1, 1) { - SetAbbreviation(Game::GetInstance()->GetText("sys.computer.abrv")); + SetAbbreviation(ContentBundle::GetInstance()->GetText("sys.computer.abrv")); power_flags = POWER_WATTS | POWER_CRITICAL; if (subtype == FLIGHT) { diff --git a/Stars45/DebriefDlg.cpp b/Stars45/DebriefDlg.cpp index f19fa16..cf9882c 100644 --- a/Stars45/DebriefDlg.cpp +++ b/Stars45/DebriefDlg.cpp @@ -32,6 +32,7 @@ #include "HttpServer.h" #include "Game.h" +#include "ContentBundle.h" #include "Keyboard.h" #include "Mouse.h" #include "Button.h" @@ -112,7 +113,7 @@ DebriefDlg::Show() if (mission) mission_name->SetText(mission->Name()); else - mission_name->SetText(Game::GetInstance()->GetText("DebriefDlg.mission-name")); + mission_name->SetText(ContentBundle::GetInstance()->GetText("DebriefDlg.mission-name")); } if (mission_system) { @@ -166,7 +167,7 @@ DebriefDlg::Show() if (mission) objectives->SetText(mission->Objective()); else - objectives->SetText(Game::GetInstance()->GetText("DebriefDlg.unspecified")); + objectives->SetText(ContentBundle::GetInstance()->GetText("DebriefDlg.unspecified")); } } @@ -174,11 +175,11 @@ DebriefDlg::Show() if (mission) situation->SetText(mission->Situation()); else - situation->SetText(Game::GetInstance()->GetText("DebriefDlg.unknown")); + situation->SetText(ContentBundle::GetInstance()->GetText("DebriefDlg.unknown")); } if (mission_score) { - mission_score->SetText(Game::GetInstance()->GetText("DebriefDlg.no-stats")); + mission_score->SetText(ContentBundle::GetInstance()->GetText("DebriefDlg.no-stats")); if (ship) { for (int i = 0; i < ShipStats::NumStats(); i++) { @@ -193,7 +194,7 @@ DebriefDlg::Show() points = player->GetMissionPoints(stats, sim->StartTime()) + stats->GetCommandPoints(); char score[32]; - sprintf_s(score, "%d %s", points, Game::GetInstance()->GetText("DebriefDlg.points").data()); + sprintf_s(score, "%d %s", points, ContentBundle::GetInstance()->GetText("DebriefDlg.points").data()); mission_score->SetText(score); break; } diff --git a/Stars45/Drive.cpp b/Stars45/Drive.cpp index e1aeb0e..24536cf 100644 --- a/Stars45/Drive.cpp +++ b/Stars45/Drive.cpp @@ -31,6 +31,7 @@ #include "Bolt.h" #include "Solid.h" #include "Game.h" +#include "ContentBundle.h" // +--------------------------------------------------------------------+ @@ -75,16 +76,16 @@ Drive::Drive(SUBTYPE drive_type, float max_thrust, float max_aug, bool show) switch (drive_type) { default: - case PLASMA: name = Game::GetInstance()->GetText("sys.drive.plasma"); break; - case FUSION: name = Game::GetInstance()->GetText("sys.drive.fusion"); break; - case GREEN: name = Game::GetInstance()->GetText("sys.drive.green"); break; - case RED: name = Game::GetInstance()->GetText("sys.drive.red"); break; - case BLUE: name = Game::GetInstance()->GetText("sys.drive.blue"); break; - case YELLOW: name = Game::GetInstance()->GetText("sys.drive.yellow"); break; - case STEALTH: name = Game::GetInstance()->GetText("sys.drive.stealth"); break; + case PLASMA: name = ContentBundle::GetInstance()->GetText("sys.drive.plasma"); break; + case FUSION: name = ContentBundle::GetInstance()->GetText("sys.drive.fusion"); break; + case GREEN: name = ContentBundle::GetInstance()->GetText("sys.drive.green"); break; + case RED: name = ContentBundle::GetInstance()->GetText("sys.drive.red"); break; + case BLUE: name = ContentBundle::GetInstance()->GetText("sys.drive.blue"); break; + case YELLOW: name = ContentBundle::GetInstance()->GetText("sys.drive.yellow"); break; + case STEALTH: name = ContentBundle::GetInstance()->GetText("sys.drive.stealth"); break; } - abrv = Game::GetInstance()->GetText("sys.drive.abrv"); + abrv = ContentBundle::GetInstance()->GetText("sys.drive.abrv"); emcon_power[0] = 0; emcon_power[1] = 50; diff --git a/Stars45/EngDlg.cpp b/Stars45/EngDlg.cpp index 545b925..8bd865d 100644 --- a/Stars45/EngDlg.cpp +++ b/Stars45/EngDlg.cpp @@ -19,6 +19,7 @@ #include "Component.h" #include "Sim.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "Button.h" #include "ListBox.h" @@ -251,7 +252,7 @@ EngDlg::UpdateRouteTables() PowerSource* reactor = reactor_iter.value(); if (sources[reactor_index] && clients[reactor_index]) { - sources[reactor_index]->SetText(Game::GetInstance()->GetText(reactor->Abbreviation())); + sources[reactor_index]->SetText(ContentBundle::GetInstance()->GetText(reactor->Abbreviation())); sources[reactor_index]->Show(); source_levels[reactor_index]->Show(); @@ -264,9 +265,9 @@ EngDlg::UpdateRouteTables() while (++client) { char abrv[64], num[20]; FormatNumber(num, client->GetPowerLevel()); - strcpy_s(abrv, Game::GetInstance()->GetText(client->Name())); + strcpy_s(abrv, ContentBundle::GetInstance()->GetText(client->Name())); - clients[reactor_index]->AddItemWithData(Game::GetInstance()->GetText(abrv), index); + clients[reactor_index]->AddItemWithData(ContentBundle::GetInstance()->GetText(abrv), index); clients[reactor_index]->SetItemText(index, 1, num); clients[reactor_index]->SetItemData(index, 1, (DWORD) client->GetPowerLevel()); @@ -357,7 +358,7 @@ EngDlg::UpdateSelection() // update the detail info: if (selected_source) { - selected_name->SetText(Game::GetInstance()->GetText(selected_source->Name())); + selected_name->SetText(ContentBundle::GetInstance()->GetText(selected_source->Name())); power_off->SetEnabled(true); power_on->SetEnabled(true); override->SetEnabled(true); @@ -409,7 +410,7 @@ EngDlg::UpdateSelection() case Component::REPAIR: stat = "MAINT"; c = Color::Cyan; break; } - stat = Game::GetInstance()->GetText(Text("EngDlg.") + stat); + stat = ContentBundle::GetInstance()->GetText(Text("EngDlg.") + stat); components->SetItemText(i, 1, stat); components->SetItemData(i, 1, (int) comp->Status()); @@ -424,7 +425,7 @@ EngDlg::UpdateSelection() else if (selected_clients.size() == 1) { System* sink = selected_clients[0]; - selected_name->SetText(Game::GetInstance()->GetText(sink->Name())); + selected_name->SetText(ContentBundle::GetInstance()->GetText(sink->Name())); power_off->SetEnabled(true); power_on->SetEnabled(true); override->SetEnabled(true); @@ -476,7 +477,7 @@ EngDlg::UpdateSelection() case Component::REPAIR: stat = "MAINT"; c = Color::Cyan; break; } - stat = Game::GetInstance()->GetText(Text("EngDlg.") + stat); + stat = ContentBundle::GetInstance()->GetText(Text("EngDlg.") + stat); components->SetItemText(i, 1, stat); components->SetItemData(i, 1, (int) comp->Status()); @@ -491,7 +492,7 @@ EngDlg::UpdateSelection() else if (selected_clients.size() > 1) { System* sink = selected_clients[0]; - selected_name->SetText(Game::GetInstance()->GetText("[Multiple]")); + selected_name->SetText(ContentBundle::GetInstance()->GetText("[Multiple]")); power_off->SetEnabled(true); power_on->SetEnabled(true); override->SetEnabled(true); @@ -527,7 +528,7 @@ EngDlg::UpdateSelection() } else { - selected_name->SetText(Game::GetInstance()->GetText("No Selection")); + selected_name->SetText(ContentBundle::GetInstance()->GetText("No Selection")); power_off->SetEnabled(false); power_off->SetButtonState(0); power_on->SetEnabled(false); @@ -564,7 +565,7 @@ EngDlg::UpdateSelection() } FormatTime(etr, (int) (time_remaining / ship->RepairSpeed())); - repair_queue->AddItem(Game::GetInstance()->GetText(sys->Name())); + repair_queue->AddItem(ContentBundle::GetInstance()->GetText(sys->Name())); repair_queue->SetItemText(i, 1, etr); i++; } @@ -649,7 +650,7 @@ EngDlg::OnSource(AWEvent* event) int index = 0; ListIter comp = selected_source->GetComponents(); while (++comp) - components->AddItemWithData(Game::GetInstance()->GetText(comp->Abbreviation()), index++); + components->AddItemWithData(ContentBundle::GetInstance()->GetText(comp->Abbreviation()), index++); } } } @@ -702,7 +703,7 @@ EngDlg::OnClient(AWEvent* event) int index = 0; ListIter comp = sink->GetComponents(); while (++comp) - components->AddItemWithData(Game::GetInstance()->GetText(comp->Abbreviation()), index++); + components->AddItemWithData(ContentBundle::GetInstance()->GetText(comp->Abbreviation()), index++); } } } @@ -1007,7 +1008,7 @@ EngDlg::OnQueue(AWEvent* event) int index = 0; ListIter comp = selected_repair->GetComponents(); while (++comp) - components->AddItemWithData(Game::GetInstance()->GetText(comp->Abbreviation()), index++); + components->AddItemWithData(ContentBundle::GetInstance()->GetText(comp->Abbreviation()), index++); } } diff --git a/Stars45/Farcaster.cpp b/Stars45/Farcaster.cpp index 33de64c..ccf52db 100644 --- a/Stars45/Farcaster.cpp +++ b/Stars45/Farcaster.cpp @@ -21,6 +21,7 @@ #include "Instruction.h" #include "Game.h" +#include "ContentBundle.h" #include "Solid.h" #include "Light.h" #include "Sound.h" @@ -33,8 +34,8 @@ Farcaster::Farcaster(double cap, double rate) ship(0), dest(0), jumpship(0), cycle_time(10), active_state(QuantumDrive::ACTIVE_READY), warp_fov(1), no_dest(false) { - name = Game::GetInstance()->GetText("sys.farcaster"); - abrv = Game::GetInstance()->GetText("sys.farcaster.abrv"); + name = ContentBundle::GetInstance()->GetText("sys.farcaster"); + abrv = ContentBundle::GetInstance()->GetText("sys.farcaster.abrv"); } // +----------------------------------------------------------------------+ diff --git a/Stars45/FighterAI.cpp b/Stars45/FighterAI.cpp index 409a89b..029b928 100644 --- a/Stars45/FighterAI.cpp +++ b/Stars45/FighterAI.cpp @@ -34,6 +34,7 @@ #include "RadioTraffic.h" #include "Game.h" +#include "ContentBundle.h" static const double TIME_TO_DOCK = 30; @@ -211,7 +212,7 @@ FighterAI::FindObjective() // transform into camera coords: objective = Transform(obj_w); - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.launch")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.launch")); return; } else { @@ -226,7 +227,7 @@ FighterAI::FindObjective() // transform into camera coords: objective = Transform(obj_w); - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.takeoff")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.takeoff")); return; } @@ -247,14 +248,14 @@ FighterAI::FindObjective() // transform into camera coords: objective = Transform(obj_w); - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.inbound")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.inbound")); return; } // final approach else { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.finals")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.finals")); obj_w = deck->StartPoint(); if (inbound->Final()) { @@ -427,7 +428,7 @@ FighterAI::ReturnToBase(Ship* controller) // transform into camera coords: objective = Transform(obj_w); - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.return-to-base")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.return-to-base")); rtb_code = 1; } @@ -626,7 +627,7 @@ FighterAI::Navigator() } if (target) - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-target")); accumulator.Clear(); magnitude = 0; @@ -716,7 +717,7 @@ FighterAI::HelmControl() } else { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.station-keeping")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.station-keeping")); station_keeping = true; // go into a slow orbit if airborne: @@ -1121,7 +1122,7 @@ FighterAI::AvoidTerrain() if (ship->AltitudeMSL() > 25e3) { if (!navpt || (navpt->Region() == ship->GetRegion() && navpt->Location().z < 27e3)) { terrain_warning = true; - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.too-high")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.too-high")); // where will we be? Point selfpt = ship->Location() + ship->Velocity() + Point(0, -15e3, 0); @@ -1137,11 +1138,11 @@ FighterAI::AvoidTerrain() // too low? else if (ship->AltitudeAGL() < 2500) { terrain_warning = true; - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.too-low")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.too-low")); // way too low? if (ship->AltitudeAGL() < 1500) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.way-too-low")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.way-too-low")); target = 0; drop_time = 5; } @@ -1189,7 +1190,7 @@ FighterAI::SeekTarget() if (patrol) { Steer result = Seek(objective); - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-patrol-point")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-patrol-point")); if (distance < 10 * self->Radius()) { patrol = 0; @@ -1209,7 +1210,7 @@ FighterAI::SeekTarget() result.stop = 1; } else { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-inbound")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-inbound")); // approach legs: if (inbound->Approach() > 0) { @@ -1241,7 +1242,7 @@ FighterAI::SeekTarget() } else if (!inbound->Cleared() && distance < 2000) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.hold-final")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.hold-final")); result = Steer(); result.brake = 1; result.stop = 1; @@ -1267,7 +1268,7 @@ FighterAI::SeekTarget() } else if (navpt && navpt->Action() == Instruction::LAUNCH) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.launch")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.launch")); return Seek(objective); } @@ -1276,7 +1277,7 @@ FighterAI::SeekTarget() if (element_index > 1) return SeekFormationSlot(); - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-farcaster")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-farcaster")); return Seek(objective); } @@ -1338,13 +1339,13 @@ FighterAI::SeekTarget() return Steer(); } - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-target")); return Seek(objective); } } if (navpt) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-navpt")); } return Seek(objective); @@ -1414,7 +1415,7 @@ FighterAI::SeekFormationSlot() } seeking = 1; - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-formation")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-formation")); return s; } @@ -1497,7 +1498,7 @@ FighterAI::EvadeThreat() } // beam the missile - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-missile")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.evade-missile")); Point beam_line = threat_missile->Velocity().cross(Point(0,1,0)); beam_line.Normalize(); @@ -1530,7 +1531,7 @@ FighterAI::EvadeThreat() } if (threat_dist <= threat_range) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-threat")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.evade-threat")); if (ship->IsAirborne()) { evading = true; @@ -1553,7 +1554,7 @@ FighterAI::EvadeThreat() } if (!target) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-starship")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.evade-starship")); // flee for three seconds: if ((ship->MissionClock() & 3) != 3) { @@ -1577,7 +1578,7 @@ FighterAI::EvadeThreat() } else { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-and-seek")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.evade-and-seek")); // seek for three seconds: if ((ship->MissionClock() & 3) < 3) { @@ -1622,9 +1623,9 @@ FighterAI::EvadeThreat() } if (target) - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.evade-and-seek")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.evade-and-seek")); else - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.random-evade")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.random-evade")); // beam the threat Point beam_line = threat->Velocity().cross(Point(0,1,0)); diff --git a/Stars45/FighterTacticalAI.cpp b/Stars45/FighterTacticalAI.cpp index 46aef0b..be40e6e 100644 --- a/Stars45/FighterTacticalAI.cpp +++ b/Stars45/FighterTacticalAI.cpp @@ -28,6 +28,7 @@ #include "StarSystem.h" #include "Game.h" +#include "ContentBundle.h" // +----------------------------------------------------------------------+ @@ -132,12 +133,12 @@ FighterTacticalAI::CheckFlightPlan() } switch (roe) { - case NONE: ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.none")); break; - case SELF_DEFENSIVE: ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.self-defensive")); break; - case DEFENSIVE: ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.defensive")); break; - case DIRECTED: ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.directed")); break; - case FLEXIBLE: ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.flexible")); break; - default: ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.default")); break; + case NONE: ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.none")); break; + case SELF_DEFENSIVE: ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.self-defensive")); break; + case DEFENSIVE: ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.defensive")); break; + case DIRECTED: ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.directed")); break; + case FLEXIBLE: ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.flexible")); break; + default: ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.default")); break; } return (navpt != 0); diff --git a/Stars45/FlightDeck.cpp b/Stars45/FlightDeck.cpp index d335376..df48def 100644 --- a/Stars45/FlightDeck.cpp +++ b/Stars45/FlightDeck.cpp @@ -37,6 +37,7 @@ #include "NetUtil.h" #include "Game.h" +#include "ContentBundle.h" #include "Solid.h" #include "Light.h" #include "Sound.h" @@ -188,8 +189,8 @@ FlightDeck::FlightDeck() carrier(0), index(0), num_slots(0), slots(0), cycle_time(5), num_hoops(0), hoops(0), azimuth(0), light(0), num_catsounds(0), num_approach_pts(0) { - name = Game::GetInstance()->GetText("sys.flight-deck"); - abrv = Game::GetInstance()->GetText("sys.flight-deck.abrv"); + name = ContentBundle::GetInstance()->GetText("sys.flight-deck"); + abrv = ContentBundle::GetInstance()->GetText("sys.flight-deck.abrv"); } // +----------------------------------------------------------------------+ diff --git a/Stars45/FltDlg.cpp b/Stars45/FltDlg.cpp index a62853e..44770b2 100644 --- a/Stars45/FltDlg.cpp +++ b/Stars45/FltDlg.cpp @@ -28,6 +28,7 @@ #include "NetUtil.h" #include "Game.h" +#include "ContentBundle.h" #include "Button.h" #include "ListBox.h" #include "ComboBox.h" @@ -140,8 +141,8 @@ FltDlg::SetShip(Ship* s) filter_list->AddItem(filter); } - filter_list->AddItem(Game::GetInstance()->GetText("FltDlg.PENDING")); - filter_list->AddItem(Game::GetInstance()->GetText("FltDlg.ACTIVE")); + filter_list->AddItem(ContentBundle::GetInstance()->GetText("FltDlg.PENDING")); + filter_list->AddItem(ContentBundle::GetInstance()->GetText("FltDlg.ACTIVE")); } flight_planner = new(__FILE__,__LINE__) FlightPlanner(ship); @@ -291,7 +292,7 @@ FltDlg::UpdateSelection() } else { hangar_list->SetItemText(item, 1, "--"); - hangar_list->SetItemText(item, 2, Game::GetInstance()->GetText("FltDlg.Open")); + hangar_list->SetItemText(item, 2, ContentBundle::GetInstance()->GetText("FltDlg.Open")); } FormatTime(txt, time); @@ -479,7 +480,7 @@ FltDlg::UpdateObjective() FormatNumber(txt, r); } else { - strcpy_s(txt, Game::GetInstance()->GetText("FltDlg.Unknown").data()); + strcpy_s(txt, ContentBundle::GetInstance()->GetText("FltDlg.Unknown").data()); r = 2e9; } } @@ -592,7 +593,7 @@ FltDlg::OnFilter(AWEvent* event) } else { hangar_list->SetItemText(item, 1, "--"); - hangar_list->SetItemText(item, 2, Game::GetInstance()->GetText("FltDlg.Open")); + hangar_list->SetItemText(item, 2, ContentBundle::GetInstance()->GetText("FltDlg.Open")); } @@ -993,7 +994,7 @@ FltDlg::OnMissionType(AWEvent* event) FormatNumber(txt, r); } else { - strcpy_s(txt, Game::GetInstance()->GetText("FltDlg.Unknown").data()); + strcpy_s(txt, ContentBundle::GetInstance()->GetText("FltDlg.Unknown").data()); r = 2e9; } } diff --git a/Stars45/FormDef.cpp b/Stars45/FormDef.cpp index 360217d..77eb1ca 100644 --- a/Stars45/FormDef.cpp +++ b/Stars45/FormDef.cpp @@ -17,6 +17,7 @@ #include "DataLoader.h" #include "Bitmap.h" #include "Game.h" +#include "ContentBundle.h" // +----------------------------------------------------------------------+ @@ -621,7 +622,7 @@ FormDef::Load(const char* fname) pdef->name()->value() == "caption") { GetDefText(buf, pdef, filename); - form->SetText(Game::GetInstance()->GetText(buf)); + form->SetText(ContentBundle::GetInstance()->GetText(buf)); } else if (pdef->name()->value() == "id") { @@ -798,7 +799,7 @@ void FormDef::ParseCtrlDef(CtrlDef* ctrl, TermStruct* val) if (pdef->name()->value() == "text" || pdef->name()->value() == "caption") { GetDefText(buf, pdef, filename); - ctrl->SetText(Game::GetInstance()->GetText(buf)); + ctrl->SetText(ContentBundle::GetInstance()->GetText(buf)); } else if (pdef->name()->value() == "id") { @@ -815,7 +816,7 @@ void FormDef::ParseCtrlDef(CtrlDef* ctrl, TermStruct* val) else if (pdef->name()->value() == "alt") { GetDefText(buf, pdef, filename); - ctrl->SetAltText(Game::GetInstance()->GetText(buf)); + ctrl->SetAltText(ContentBundle::GetInstance()->GetText(buf)); } else if (pdef->name()->value() == "type") { @@ -966,7 +967,7 @@ void FormDef::ParseCtrlDef(CtrlDef* ctrl, TermStruct* val) else if (pdef->name()->value() == "item") { GetDefText(buf, pdef, filename); - ctrl->AddItem(Game::GetInstance()->GetText(buf)); + ctrl->AddItem(ContentBundle::GetInstance()->GetText(buf)); } else if (pdef->name()->value() == "tab") { @@ -1182,7 +1183,7 @@ void FormDef::ParseColumnDef(CtrlDef* ctrl, TermStruct* val) if (pdef->name()->value() == "text" || pdef->name()->value() == "title") { GetDefText(buf, pdef, filename); - text = Game::GetInstance()->GetText(buf); + text = ContentBundle::GetInstance()->GetText(buf); } else if (pdef->name()->value() == "width") { diff --git a/Stars45/HUDView.cpp b/Stars45/HUDView.cpp index 8862241..2ca3bf4 100644 --- a/Stars45/HUDView.cpp +++ b/Stars45/HUDView.cpp @@ -62,6 +62,7 @@ #include "Polygon.h" #include "Sound.h" #include "Game.h" +#include "ContentBundle.h" #include "Window.h" static Bitmap hud_left_air; @@ -1069,15 +1070,15 @@ HUDView::DrawContact(Contact* contact, int index) bool name_crowded = false; if (x < width-8) { - char code = *(Game::GetInstance()->GetText("HUDView.symbol.fighter").data()); + char code = *(ContentBundle::GetInstance()->GetText("HUDView.symbol.fighter").data()); if (c_ship) { if (c_ship->Class() > Ship::LCA) - code = *(Game::GetInstance()->GetText("HUDView.symbol.starship").data()); + code = *(ContentBundle::GetInstance()->GetText("HUDView.symbol.starship").data()); } else if (c_shot) { - code = *(Game::GetInstance()->GetText("HUDView.symbol.torpedo").data()); + code = *(ContentBundle::GetInstance()->GetText("HUDView.symbol.torpedo").data()); } Sensor* sensor = ship->GetSensor(); @@ -1338,7 +1339,7 @@ HUDView::DrawBars() if (Game::GetInstance()->Paused()) { Rect pause_rect = Rect(cx - 128, cy - 60, 256, 12); - DrawHUDText(TXT_PAUSED, Game::GetInstance()->GetText("HUDView.PAUSED"), pause_rect, DT_CENTER); + DrawHUDText(TXT_PAUSED, ContentBundle::GetInstance()->GetText("HUDView.PAUSED"), pause_rect, DT_CENTER); } if (ship) { @@ -1376,7 +1377,7 @@ HUDView::DrawBars() if (arcade) { char arcade_txt[32]; - sprintf_s(arcade_txt, "%s %s", Game::GetInstance()->GetText("HUDView.altitude").data(), txt); + sprintf_s(arcade_txt, "%s %s", ContentBundle::GetInstance()->GetText("HUDView.altitude").data(), txt); align = (tactical) ? DT_LEFT : DT_RIGHT; DrawHUDText(TXT_ALTITUDE, arcade_txt, speed_rect, align); } @@ -1398,7 +1399,7 @@ HUDView::DrawBars() // upper left hud quadrant (starships) else if (ship->IsStarship() && ship->GetFLCSMode() == Ship::FLCS_HELM && !arcade) { - sprintf_s(txt, "%s: %.1f", Game::GetInstance()->GetText("HUDView.Pitch").data(), ship->GetHelmPitch()/DEGREES); + sprintf_s(txt, "%s: %.1f", ContentBundle::GetInstance()->GetText("HUDView.Pitch").data(), ship->GetHelmPitch()/DEGREES); speed_rect.y -= 50; align = (tactical) ? DT_LEFT : DT_RIGHT; @@ -1407,7 +1408,7 @@ HUDView::DrawBars() speed_rect.y -= 10; int heading_degrees = (int) (ship->GetHelmHeading()/DEGREES); if (heading_degrees < 0) heading_degrees += 360; - sprintf_s(txt, "%s: %03d", Game::GetInstance()->GetText("HUDView.Heading").data(), heading_degrees); + sprintf_s(txt, "%s: %03d", ContentBundle::GetInstance()->GetText("HUDView.Heading").data(), heading_degrees); DrawHUDText(TXT_HEADING, txt, speed_rect, align); speed_rect.y += 60; @@ -1423,9 +1424,9 @@ HUDView::DrawBars() } switch (mode) { - case HUD_MODE_TAC: strcpy_s(txt, Game::GetInstance()->GetText("HUDView.mode.tactical").data()); break; - case HUD_MODE_NAV: strcpy_s(txt, Game::GetInstance()->GetText("HUDView.mode.navigation").data()); break; - case HUD_MODE_ILS: strcpy_s(txt, Game::GetInstance()->GetText("HUDView.mode.landing").data()); break; + case HUD_MODE_TAC: strcpy_s(txt, ContentBundle::GetInstance()->GetText("HUDView.mode.tactical").data()); break; + case HUD_MODE_NAV: strcpy_s(txt, ContentBundle::GetInstance()->GetText("HUDView.mode.navigation").data()); break; + case HUD_MODE_ILS: strcpy_s(txt, ContentBundle::GetInstance()->GetText("HUDView.mode.landing").data()); break; } if (tactical) { @@ -1441,7 +1442,7 @@ HUDView::DrawBars() // landing gear: if (ship->IsGearDown()) { - const char* gear_down = Game::GetInstance()->GetText("HUDView.gear-down"); + const char* gear_down = ContentBundle::GetInstance()->GetText("HUDView.gear-down"); Rect gear_rect(l, b+20, box_width, 12); DrawHUDText(TXT_GEAR_DOWN, gear_down, gear_rect, DT_CENTER, HUD_UPPER_CASE, true); @@ -1451,17 +1452,17 @@ HUDView::DrawBars() QuantumDrive* quantum = ship->GetQuantumDrive(); if (threat || (quantum && quantum->JumpTime() > 0)) { - const char* threat_warn = Game::GetInstance()->GetText("HUDView.threat-warn"); + const char* threat_warn = ContentBundle::GetInstance()->GetText("HUDView.threat-warn"); bool show_msg = true; if (quantum && quantum->JumpTime() > 0) { static char buf[64]; - sprintf_s(buf, "%s: %d", Game::GetInstance()->GetText("HUDView.quantum-jump").data(), (int) quantum->JumpTime()); + sprintf_s(buf, "%s: %d", ContentBundle::GetInstance()->GetText("HUDView.quantum-jump").data(), (int) quantum->JumpTime()); threat_warn = buf; } else if (threat > 1) { - threat_warn = Game::GetInstance()->GetText("HUDView.missile-warn"); + threat_warn = ContentBundle::GetInstance()->GetText("HUDView.missile-warn"); show_msg = ((Game::GetInstance()->RealTime()/500) & 1) != 0; } @@ -1473,7 +1474,7 @@ HUDView::DrawBars() if (ship->CanTimeSkip()) { Rect auto_rect(l, t-40, box_width, 12); - DrawHUDText(TXT_AUTO, Game::GetInstance()->GetText("HUDView.AUTO"), auto_rect, DT_CENTER, HUD_MIXED_CASE, true); + DrawHUDText(TXT_AUTO, ContentBundle::GetInstance()->GetText("HUDView.AUTO"), auto_rect, DT_CENTER, HUD_MIXED_CASE, true); } if (mode == HUD_MODE_NAV) { @@ -1511,19 +1512,19 @@ HUDView::DrawBars() // missile range indicator if (missile->GetSelected()->Locked()) { Rect shoot_rect(l, b+5, box_width, 12); - DrawHUDText(TXT_SHOOT, Game::GetInstance()->GetText("HUDView.SHOOT"), shoot_rect, DT_CENTER, HUD_MIXED_CASE, true); + DrawHUDText(TXT_SHOOT, ContentBundle::GetInstance()->GetText("HUDView.SHOOT"), shoot_rect, DT_CENTER, HUD_MIXED_CASE, true); } } if (!arcade && !ship->IsNetObserver()) { if (ship->GetShield()) { speed_rect.y = cy-5+40; - sprintf_s(txt, "%s - %03d +", Game::GetInstance()->GetText("HUDView.SHIELD").data(), ship->ShieldStrength()); + sprintf_s(txt, "%s - %03d +", ContentBundle::GetInstance()->GetText("HUDView.SHIELD").data(), ship->ShieldStrength()); DrawHUDText(TXT_SHIELD, txt, speed_rect, align); } else if (ship->GetDecoy()) { speed_rect.y = cy-5+40; - sprintf_s(txt, "%s %d", Game::GetInstance()->GetText("HUDView.DECOY").data(), ship->GetDecoy()->Ammo()); + sprintf_s(txt, "%s %d", ContentBundle::GetInstance()->GetText("HUDView.DECOY").data(), ship->GetDecoy()->Ammo()); DrawHUDText(TXT_DECOY, txt, speed_rect, align); } @@ -1555,12 +1556,12 @@ HUDView::DrawBars() NetGame* netgame = NetGame::GetInstance(); if (netgame && !netgame->IsActive()) { Rect shoot_rect(l, b+5, box_width, 12); - DrawHUDText(TXT_SHOOT, Game::GetInstance()->GetText("HUDView.NET-GAME-OVER"), shoot_rect, DT_CENTER, HUD_MIXED_CASE, true); + DrawHUDText(TXT_SHOOT, ContentBundle::GetInstance()->GetText("HUDView.NET-GAME-OVER"), shoot_rect, DT_CENTER, HUD_MIXED_CASE, true); } else if (ship->IsNetObserver()) { Rect shoot_rect(l, b+5, box_width, 12); - DrawHUDText(TXT_SHOOT, Game::GetInstance()->GetText("HUDView.OBSERVER"), shoot_rect, DT_CENTER, HUD_MIXED_CASE, true); + DrawHUDText(TXT_SHOOT, ContentBundle::GetInstance()->GetText("HUDView.OBSERVER"), shoot_rect, DT_CENTER, HUD_MIXED_CASE, true); } DrawTarget(); @@ -2058,7 +2059,7 @@ HUDView::DrawTarget() distance = contact->Range(ship, limit); if (!contact->ActLock() && !contact->PasLock()) { - strcpy_s(txt, Game::GetInstance()->GetText("HUDView.No-Range").data()); + strcpy_s(txt, ContentBundle::GetInstance()->GetText("HUDView.No-Range").data()); speed = 0; } else { @@ -2103,12 +2104,12 @@ HUDView::DrawTarget() if (mode != HUD_MODE_ILS) { if (tgt_ship->IsStarship()) { range_rect.y += 10; - sprintf_s(txt, "%s %03d", Game::GetInstance()->GetText("HUDView.symbol.shield").data(), (int) tgt_ship->ShieldStrength()); + sprintf_s(txt, "%s %03d", ContentBundle::GetInstance()->GetText("HUDView.symbol.shield").data(), (int) tgt_ship->ShieldStrength()); DrawHUDText(TXT_TARGET_SHIELD, txt, range_rect, DT_RIGHT); } range_rect.y += 10; - sprintf_s(txt, "%s %03d", Game::GetInstance()->GetText("HUDView.symbol.hull").data(), (int) (tgt_ship->Integrity() / tgt_ship->Design()->integrity * 100)); + sprintf_s(txt, "%s %03d", ContentBundle::GetInstance()->GetText("HUDView.symbol.hull").data(), (int) (tgt_ship->Integrity() / tgt_ship->Design()->integrity * 100)); DrawHUDText(TXT_TARGET_HULL, txt, range_rect, DT_RIGHT); System* sys = ship->GetSubTarget(); @@ -2177,7 +2178,7 @@ HUDView::DrawNavInfo() if (big_font) hud_text[TXT_NAV_INDEX].font = big_font; - DrawHUDText(TXT_NAV_INDEX, Game::GetInstance()->GetText("HUDView.Auto-Nav"), info_rect, DT_CENTER); + DrawHUDText(TXT_NAV_INDEX, ContentBundle::GetInstance()->GetText("HUDView.Auto-Nav"), info_rect, DT_CENTER); } return; @@ -2210,9 +2211,9 @@ HUDView::DrawNavInfo() info_rect.x = width - info_rect.w - 8; if (ship->IsAutoNavEngaged()) - sprintf_s(txt, "%s %d", Game::GetInstance()->GetText("HUDView.Auto-Nav").data(), index); + sprintf_s(txt, "%s %d", ContentBundle::GetInstance()->GetText("HUDView.Auto-Nav").data(), index); else - sprintf_s(txt, "%s %d", Game::GetInstance()->GetText("HUDView.Nav").data(), index); + sprintf_s(txt, "%s %d", ContentBundle::GetInstance()->GetText("HUDView.Nav").data(), index); DrawHUDText(TXT_NAV_INDEX, txt, info_rect, DT_RIGHT); info_rect.y += 10; @@ -2225,7 +2226,7 @@ HUDView::DrawNavInfo() if (etr > 3600) { info_rect.y += 10; - sprintf_s(txt, "%s XX:XX", Game::GetInstance()->GetText("HUDView.time-enroute").data()); + sprintf_s(txt, "%s XX:XX", ContentBundle::GetInstance()->GetText("HUDView.time-enroute").data()); DrawHUDText(TXT_NAV_ETR, txt, info_rect, DT_RIGHT); } else if (etr > 0) { @@ -2233,7 +2234,7 @@ HUDView::DrawNavInfo() int minutes = (etr/60) % 60; int seconds = (etr ) % 60; - sprintf_s(txt, "%s %2d:%02d", Game::GetInstance()->GetText("HUDView.time-enroute").data(), minutes, seconds); + sprintf_s(txt, "%s %2d:%02d", ContentBundle::GetInstance()->GetText("HUDView.time-enroute").data(), minutes, seconds); DrawHUDText(TXT_NAV_ETR, txt, info_rect, DT_RIGHT); } @@ -2243,7 +2244,7 @@ HUDView::DrawNavInfo() int hold = (int) navpt->HoldTime(); int minutes = (hold/60) % 60; int seconds = (hold ) % 60; - sprintf_s(txt, "%s %2d:%02d", Game::GetInstance()->GetText("HUDView.HOLD").data(), minutes, seconds); + sprintf_s(txt, "%s %2d:%02d", ContentBundle::GetInstance()->GetText("HUDView.HOLD").data(), minutes, seconds); DrawHUDText(TXT_NAV_HOLD, txt, info_rect, DT_RIGHT); } } @@ -2660,15 +2661,15 @@ HUDView::DrawWarningPanel() for (int index = 0; index < 12; index++) { int stat = -1; - Text abrv = Game::GetInstance()->GetText("HUDView.UNKNOWN"); + Text abrv = ContentBundle::GetInstance()->GetText("HUDView.UNKNOWN"); switch (index) { - case 0: stat = GetReactorStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.REACTOR"); break; - case 1: stat = GetDriveStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.DRIVE"); break; - case 2: stat = GetQuantumStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.QUANTUM"); break; - case 3: stat = GetShieldStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.SHIELD"); + case 0: stat = GetReactorStatus(ship); abrv = ContentBundle::GetInstance()->GetText("HUDView.REACTOR"); break; + case 1: stat = GetDriveStatus(ship); abrv = ContentBundle::GetInstance()->GetText("HUDView.DRIVE"); break; + case 2: stat = GetQuantumStatus(ship); abrv = ContentBundle::GetInstance()->GetText("HUDView.QUANTUM"); break; + case 3: stat = GetShieldStatus(ship); abrv = ContentBundle::GetInstance()->GetText("HUDView.SHIELD"); if (ship->GetShield() == 0 && ship->GetDecoy()) - abrv = Game::GetInstance()->GetText("HUDView.DECOY"); + abrv = ContentBundle::GetInstance()->GetText("HUDView.DECOY"); break; case 4: @@ -2681,10 +2682,10 @@ HUDView::DrawWarningPanel() } break; - case 8: stat = GetSensorStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.SENSOR"); break; - case 9: stat = GetComputerStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.COMPUTER"); break; - case 10: stat = GetThrusterStatus(ship); abrv = Game::GetInstance()->GetText("HUDView.THRUSTER"); break; - case 11: stat = GetFlightDeckStatus(ship);abrv = Game::GetInstance()->GetText("HUDView.FLTDECK"); break; + case 8: stat = GetSensorStatus(ship); abrv = ContentBundle::GetInstance()->GetText("HUDView.SENSOR"); break; + case 9: stat = GetComputerStatus(ship); abrv = ContentBundle::GetInstance()->GetText("HUDView.COMPUTER"); break; + case 10: stat = GetThrusterStatus(ship); abrv = ContentBundle::GetInstance()->GetText("HUDView.THRUSTER"); break; + case 11: stat = GetFlightDeckStatus(ship);abrv = ContentBundle::GetInstance()->GetText("HUDView.FLTDECK"); break; } Rect warn_rect(x, y, box_width, box_height); @@ -2810,7 +2811,7 @@ HUDView::DrawInstructions() else { hud_text[TXT_CAUTION_TXT].color = standard_txt_colors[color]; - DrawHUDText(TXT_CAUTION_TXT, Game::GetInstance()->GetText("HUDView.No-Instructions"), r, DT_LEFT, HUD_MIXED_CASE); + DrawHUDText(TXT_CAUTION_TXT, ContentBundle::GetInstance()->GetText("HUDView.No-Instructions"), r, DT_LEFT, HUD_MIXED_CASE); } } @@ -3516,9 +3517,9 @@ HUDView::Refresh() Rect dock_rect(width/2-100, height/6, 200, 20); if (ship->IsAirborne()) - DrawHUDText(TXT_AUTO, Game::GetInstance()->GetText("HUDView.SUCCESSFUL-LANDING"), dock_rect, DT_CENTER); + DrawHUDText(TXT_AUTO, ContentBundle::GetInstance()->GetText("HUDView.SUCCESSFUL-LANDING"), dock_rect, DT_CENTER); else - DrawHUDText(TXT_AUTO, Game::GetInstance()->GetText("HUDView.DOCKING-COMPLETE"), dock_rect, DT_CENTER); + DrawHUDText(TXT_AUTO, ContentBundle::GetInstance()->GetText("HUDView.DOCKING-COMPLETE"), dock_rect, DT_CENTER); } return; } @@ -3575,7 +3576,7 @@ HUDView::Refresh() int fov_degrees = 180 - 2 * (int)(projector->XAngle()*180/PI); if (fov_degrees > 90) - DrawHUDText(TXT_CAM_ANGLE, Game::GetInstance()->GetText("HUDView.Wide-Angle"), fov_rect, DT_CENTER); + DrawHUDText(TXT_CAM_ANGLE, ContentBundle::GetInstance()->GetText("HUDView.Wide-Angle"), fov_rect, DT_CENTER); fov_rect.y = 20; DrawHUDText(TXT_CAM_MODE, CameraDirector::GetModeName(), fov_rect, DT_CENTER); diff --git a/Stars45/Hangar.cpp b/Stars45/Hangar.cpp index 3aaaddc..7aafada 100644 --- a/Stars45/Hangar.cpp +++ b/Stars45/Hangar.cpp @@ -28,6 +28,7 @@ #include "CombatGroup.h" #include "Game.h" +#include "ContentBundle.h" #include "Random.h" // +======================================================================+ @@ -666,7 +667,7 @@ Hangar::SquadronName(int n) const if (n >= 0 && n < nsquadrons) return names[n]; - return Game::GetInstance()->GetText("Unknown"); + return ContentBundle::GetInstance()->GetText("Unknown"); } int @@ -769,22 +770,22 @@ Hangar::StatusName(const HangarSlot* s) const { switch (s->state) { default: - case UNAVAIL: return Game::GetInstance()->GetText("hangar.UNAVAIL"); - case MAINT: return Game::GetInstance()->GetText("hangar.MAINT"); - case STORAGE: return Game::GetInstance()->GetText("hangar.STORAGE"); - case PREP: return Game::GetInstance()->GetText("hangar.PREP"); - case ALERT: return Game::GetInstance()->GetText("hangar.ALERT"); + case UNAVAIL: return ContentBundle::GetInstance()->GetText("hangar.UNAVAIL"); + case MAINT: return ContentBundle::GetInstance()->GetText("hangar.MAINT"); + case STORAGE: return ContentBundle::GetInstance()->GetText("hangar.STORAGE"); + case PREP: return ContentBundle::GetInstance()->GetText("hangar.PREP"); + case ALERT: return ContentBundle::GetInstance()->GetText("hangar.ALERT"); case QUEUED: { - Text state = Game::GetInstance()->GetText("hangar.QUEUED"); + Text state = ContentBundle::GetInstance()->GetText("hangar.QUEUED"); char seq[8]; sprintf_s(seq, " %d", s->deck->Sequence(s->slot)); return state + seq; } - case LOCKED: return Game::GetInstance()->GetText("hangar.LOCKED"); - case LAUNCH: return Game::GetInstance()->GetText("hangar.LAUNCH"); - case ACTIVE: return Game::GetInstance()->GetText("hangar.ACTIVE"); - case APPROACH: return Game::GetInstance()->GetText("hangar.APPROACH"); - case RECOVERY: return Game::GetInstance()->GetText("hangar.RECOVERY"); + case LOCKED: return ContentBundle::GetInstance()->GetText("hangar.LOCKED"); + case LAUNCH: return ContentBundle::GetInstance()->GetText("hangar.LAUNCH"); + case ACTIVE: return ContentBundle::GetInstance()->GetText("hangar.ACTIVE"); + case APPROACH: return ContentBundle::GetInstance()->GetText("hangar.APPROACH"); + case RECOVERY: return ContentBundle::GetInstance()->GetText("hangar.RECOVERY"); } } diff --git a/Stars45/Instruction.cpp b/Stars45/Instruction.cpp index 368cbf5..5b17203 100644 --- a/Stars45/Instruction.cpp +++ b/Stars45/Instruction.cpp @@ -19,6 +19,7 @@ #include "Sim.h" #include "Game.h" +#include "ContentBundle.h" #include "Text.h" // +----------------------------------------------------------------------+ @@ -340,67 +341,67 @@ Instruction::GetShortDescription() const switch (action) { case VECTOR: if (farcast) - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.farcast").data(), rgn_name.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.farcast").data(), rgn_name.data()); else - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.vector").data(), rgn_name.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.vector").data(), rgn_name.data()); break; case LAUNCH: - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.launch").data(), tgt_name.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.launch").data(), tgt_name.data()); break; case DOCK: - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.dock").data(), tgt_name.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.dock").data(), tgt_name.data()); break; case RTB: - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.return-to-base").data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.return-to-base").data()); break; case DEFEND: if (priority == PRIMARY) { - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.defend").data(), ActionName(action), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.defend").data(), ActionName(action), tgt_desc.data()); } else { - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.protect").data(), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.protect").data(), tgt_desc.data()); } break; case ESCORT: if (priority == PRIMARY) { - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.escort").data(), ActionName(action), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.escort").data(), ActionName(action), tgt_desc.data()); } else { - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.protect").data(), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.protect").data(), tgt_desc.data()); } break; case PATROL: - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.patrol").data(), + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.patrol").data(), tgt_desc.data(), rgn_name.data()); break; case SWEEP: - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.sweep").data(), + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.sweep").data(), tgt_desc.data(), rgn_name.data()); break; case INTERCEPT: - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.intercept").data(), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.intercept").data(), tgt_desc.data()); break; case STRIKE: - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.strike").data(), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.strike").data(), tgt_desc.data()); break; case ASSAULT: - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.assault").data(), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.assault").data(), tgt_desc.data()); break; case RECON: - sprintf_s(desc, Game::GetInstance()->GetText("instr.short.recon").data(), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.short.recon").data(), tgt_desc.data()); break; default: @@ -410,7 +411,7 @@ Instruction::GetShortDescription() const if (status != PENDING) { strcat_s(desc, " - "); - strcat_s(desc, Game::GetInstance()->GetText(StatusName(status))); + strcat_s(desc, ContentBundle::GetInstance()->GetText(StatusName(status))); } return desc; @@ -426,67 +427,67 @@ Instruction::GetDescription() const switch (action) { case VECTOR: if (farcast) - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.farcast").data(), rgn_name.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.farcast").data(), rgn_name.data()); else - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.vector").data(), rgn_name.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.vector").data(), rgn_name.data()); break; case LAUNCH: - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.launch").data(), tgt_name.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.launch").data(), tgt_name.data()); break; case DOCK: - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.dock").data(), tgt_name.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.dock").data(), tgt_name.data()); break; case RTB: - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.return-to-base").data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.return-to-base").data()); break; case DEFEND: if (priority == PRIMARY) { - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.defend").data(), ActionName(action), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.defend").data(), ActionName(action), tgt_desc.data()); } else { - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.protect").data(), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.protect").data(), tgt_desc.data()); } break; case ESCORT: if (priority == PRIMARY) { - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.escort").data(), ActionName(action), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.escort").data(), ActionName(action), tgt_desc.data()); } else { - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.protect").data(), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.protect").data(), tgt_desc.data()); } break; case PATROL: - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.patrol").data(), + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.patrol").data(), tgt_desc.data(), rgn_name.data()); break; case SWEEP: - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.sweep").data(), + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.sweep").data(), tgt_desc.data(), rgn_name.data()); break; case INTERCEPT: - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.intercept").data(), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.intercept").data(), tgt_desc.data()); break; case STRIKE: - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.strike").data(), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.strike").data(), tgt_desc.data()); break; case ASSAULT: - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.assault").data(), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.assault").data(), tgt_desc.data()); break; case RECON: - sprintf_s(desc, Game::GetInstance()->GetText("instr.long.recon").data(), tgt_desc.data()); + sprintf_s(desc, ContentBundle::GetInstance()->GetText("instr.long.recon").data(), tgt_desc.data()); break; default: @@ -496,7 +497,7 @@ Instruction::GetDescription() const if (status != PENDING) { strcat_s(desc, " - "); - strcat_s(desc, Game::GetInstance()->GetText(StatusName(status))); + strcat_s(desc, ContentBundle::GetInstance()->GetText(StatusName(status))); } return desc; diff --git a/Stars45/JoyDlg.cpp b/Stars45/JoyDlg.cpp index acb2f93..bf6de68 100644 --- a/Stars45/JoyDlg.cpp +++ b/Stars45/JoyDlg.cpp @@ -18,6 +18,7 @@ #include "FormatUtil.h" #include "Game.h" +#include "ContentBundle.h" #include "ListBox.h" #include "ComboBox.h" #include "Button.h" @@ -112,12 +113,12 @@ JoyDlg::ExecFrame() Button* b = axis_button[selected_axis]; if (sample_axis >= 0) { - b->SetText(Game::GetInstance()->GetText(joy_axis_names[sample_axis])); + b->SetText(ContentBundle::GetInstance()->GetText(joy_axis_names[sample_axis])); map_axis[selected_axis] = sample_axis; } else - b->SetText(Game::GetInstance()->GetText("JoyDlg.select")); + b->SetText(ContentBundle::GetInstance()->GetText("JoyDlg.select")); } } } @@ -136,11 +137,11 @@ JoyDlg::Show() int inv = Joystick::GetAxisInv(i); if (map >= 0 && map < 8) { - b->SetText(Game::GetInstance()->GetText(joy_axis_names[map])); + b->SetText(ContentBundle::GetInstance()->GetText(joy_axis_names[map])); map_axis[i] = map; } else { - b->SetText(Game::GetInstance()->GetText("JoyDlg.unmapped")); + b->SetText(ContentBundle::GetInstance()->GetText("JoyDlg.unmapped")); } b->SetButtonState(0); @@ -159,11 +160,11 @@ JoyDlg::OnAxis(AWEvent* event) { for (int i = 0; i < 4; i++) { int map = map_axis[i]; - Text name = Game::GetInstance()->GetText("JoyDlg.unmapped"); + Text name = ContentBundle::GetInstance()->GetText("JoyDlg.unmapped"); Button* b = axis_button[i]; if (map >= 0 && map < 8) - name = Game::GetInstance()->GetText(joy_axis_names[map]); + name = ContentBundle::GetInstance()->GetText(joy_axis_names[map]); if (b) { if (b == event->window) { @@ -173,7 +174,7 @@ JoyDlg::OnAxis(AWEvent* event) selected_axis = -1; } else { - b->SetText(Game::GetInstance()->GetText("JoyDlg.select")); + b->SetText(ContentBundle::GetInstance()->GetText("JoyDlg.select")); b->SetButtonState(1); selected_axis = i; } diff --git a/Stars45/LandingGear.cpp b/Stars45/LandingGear.cpp index 934ac76..086b4af 100644 --- a/Stars45/LandingGear.cpp +++ b/Stars45/LandingGear.cpp @@ -22,6 +22,7 @@ #include "Scene.h" #include "Sound.h" #include "Game.h" +#include "ContentBundle.h" static Sound* gear_transit_sound = 0; @@ -31,8 +32,8 @@ LandingGear::LandingGear() : System(MISC_SYSTEM, 0, "Landing Gear", 1, 1, 1, 1), state(GEAR_UP), transit(0), ngear(0), clearance(0) { - name = Game::GetInstance()->GetText("sys.landing-gear"); - abrv = Game::GetInstance()->GetText("sys.landing-gear.abrv"); + name = ContentBundle::GetInstance()->GetText("sys.landing-gear"); + abrv = ContentBundle::GetInstance()->GetText("sys.landing-gear.abrv"); for (int i = 0; i < MAX_GEAR; i++) { models[i] = 0; diff --git a/Stars45/LoadDlg.cpp b/Stars45/LoadDlg.cpp index 77b5a6f..1d98e0d 100644 --- a/Stars45/LoadDlg.cpp +++ b/Stars45/LoadDlg.cpp @@ -17,6 +17,7 @@ #include "Starshatter.h" #include "Game.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "Video.h" #include "Keyboard.h" @@ -58,13 +59,13 @@ LoadDlg::ExecFrame() if (title) { if (stars->GetGameMode() == Starshatter::CLOD_MODE || stars->GetGameMode() == Starshatter::CMPN_MODE) - title->SetText(Game::GetInstance()->GetText("LoadDlg.campaign")); + title->SetText(ContentBundle::GetInstance()->GetText("LoadDlg.campaign")); else if (stars->GetGameMode() == Starshatter::MENU_MODE) - title->SetText(Game::GetInstance()->GetText("LoadDlg.tac-ref")); + title->SetText(ContentBundle::GetInstance()->GetText("LoadDlg.tac-ref")); else - title->SetText(Game::GetInstance()->GetText("LoadDlg.mission")); + title->SetText(ContentBundle::GetInstance()->GetText("LoadDlg.mission")); } activity->SetText(stars->GetLoadActivity()); diff --git a/Stars45/MapView.cpp b/Stars45/MapView.cpp index a0e2a86..486785b 100644 --- a/Stars45/MapView.cpp +++ b/Stars45/MapView.cpp @@ -35,6 +35,7 @@ #include "NetUtil.h" #include "Game.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "EventDispatch.h" #include "Video.h" @@ -280,7 +281,7 @@ MapView::BuildMenu() { ClearMenu(); - map_system_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.STARSYSTEM")); + map_system_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.STARSYSTEM")); if (system_list.size() > 0) { int i = 0; @@ -296,64 +297,64 @@ MapView::BuildMenu() map_system_menu->AddItem(system->Name(), MAP_SYSTEM); } - map_sector_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.SECTOR")); + map_sector_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.SECTOR")); for (int i = 0; i < regions.size(); i++) { Orbital* rgn = regions[i]; map_sector_menu->AddItem(rgn->Name(), MAP_SECTOR + i); } - map_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.MAP")); + map_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.MAP")); map_menu->AddMenu("System", map_system_menu); map_menu->AddMenu("Sector", map_sector_menu); if (ship || mission) { - ship_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.SHIP")); - ship_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Starsystem"), map_system_menu); - ship_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Sector"), map_sector_menu); + ship_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.SHIP")); + ship_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Starsystem"), map_system_menu); + ship_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Sector"), map_sector_menu); ship_menu->AddItem("", 0); - ship_menu->AddItem(Game::GetInstance()->GetText("MapView.item.Add-Nav"), MAP_ADDNAV); - ship_menu->AddItem(Game::GetInstance()->GetText("MapView.item.Clear-All"), MAP_CLEAR); + ship_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.Add-Nav"), MAP_ADDNAV); + ship_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.Clear-All"), MAP_CLEAR); - action_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.ACTION")); + action_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.ACTION")); for (int i = 0; i < Instruction::NUM_ACTIONS; i++) { - action_menu->AddItem(Game::GetInstance()->GetText(Text("MapView.item.") + Instruction::ActionName(i)), MAP_ACTION + i); + action_menu->AddItem(ContentBundle::GetInstance()->GetText(Text("MapView.item.") + Instruction::ActionName(i)), MAP_ACTION + i); } - formation_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.FORMATION")); + formation_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.FORMATION")); for (int i = 0; i < Instruction::NUM_FORMATIONS; i++) { - formation_menu->AddItem(Game::GetInstance()->GetText(Text("MapView.item.") + Instruction::FormationName(i)), MAP_FORMATION + i); + formation_menu->AddItem(ContentBundle::GetInstance()->GetText(Text("MapView.item.") + Instruction::FormationName(i)), MAP_FORMATION + i); } - speed_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.SPEED")); + speed_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.SPEED")); speed_menu->AddItem("250", MAP_SPEED + 0); speed_menu->AddItem("500", MAP_SPEED + 1); speed_menu->AddItem("750", MAP_SPEED + 2); speed_menu->AddItem("1000", MAP_SPEED + 3); - hold_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.HOLD")); - hold_menu->AddItem(Game::GetInstance()->GetText("MapView.item.None"), MAP_HOLD + 0); - hold_menu->AddItem(Game::GetInstance()->GetText("MapView.item.1-Minute"), MAP_HOLD + 1); - hold_menu->AddItem(Game::GetInstance()->GetText("MapView.item.5-Minutes"), MAP_HOLD + 2); - hold_menu->AddItem(Game::GetInstance()->GetText("MapView.item.10-Minutes"), MAP_HOLD + 3); - hold_menu->AddItem(Game::GetInstance()->GetText("MapView.item.15-Minutes"), MAP_HOLD + 4); - - farcast_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.FARCAST")); - farcast_menu->AddItem(Game::GetInstance()->GetText("MapView.item.Use-Quantum"), MAP_FARCAST + 0); - farcast_menu->AddItem(Game::GetInstance()->GetText("MapView.item.Use-Farcast"), MAP_FARCAST + 1); - - objective_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.OBJECTIVE")); - - nav_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("MapView.menu.NAVPT")); - nav_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Action"), action_menu); - nav_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Objective"), objective_menu); - nav_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Formation"), formation_menu); - nav_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Speed"), speed_menu); - nav_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Hold"), hold_menu); - nav_menu->AddMenu(Game::GetInstance()->GetText("MapView.item.Farcast"), farcast_menu); + hold_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.HOLD")); + hold_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.None"), MAP_HOLD + 0); + hold_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.1-Minute"), MAP_HOLD + 1); + hold_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.5-Minutes"), MAP_HOLD + 2); + hold_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.10-Minutes"), MAP_HOLD + 3); + hold_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.15-Minutes"), MAP_HOLD + 4); + + farcast_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.FARCAST")); + farcast_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.Use-Quantum"), MAP_FARCAST + 0); + farcast_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.Use-Farcast"), MAP_FARCAST + 1); + + objective_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.OBJECTIVE")); + + nav_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("MapView.menu.NAVPT")); + nav_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Action"), action_menu); + nav_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Objective"), objective_menu); + nav_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Formation"), formation_menu); + nav_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Speed"), speed_menu); + nav_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Hold"), hold_menu); + nav_menu->AddMenu(ContentBundle::GetInstance()->GetText("MapView.item.Farcast"), farcast_menu); nav_menu->AddItem("", 0); - nav_menu->AddItem(Game::GetInstance()->GetText("MapView.item.Add-Nav"), MAP_ADDNAV); - nav_menu->AddItem(Game::GetInstance()->GetText("MapView.item.Del-Nav"), MAP_DELETE); + nav_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.Add-Nav"), MAP_ADDNAV); + nav_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.Del-Nav"), MAP_DELETE); } else if (campaign) { @@ -731,7 +732,7 @@ MapView::SelectNavpt(Instruction* navpt) case Instruction::PATROL: case Instruction::SWEEP: case Instruction::RECON: - objective_menu->AddItem(Game::GetInstance()->GetText("MapView.item.not-available"), 0); + objective_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.not-available"), 0); objective_menu->GetItem(0)->SetEnabled(false); break; @@ -767,7 +768,7 @@ MapView::SelectNavpt(Instruction* navpt) } else { objective_menu->ClearItems(); - objective_menu->AddItem(Game::GetInstance()->GetText("MapView.item.not-available"), 0); + objective_menu->AddItem(ContentBundle::GetInstance()->GetText("MapView.item.not-available"), 0); objective_menu->GetItem(0)->SetEnabled(false); } } @@ -1619,7 +1620,7 @@ MapView::Refresh() if (!system) { DrawGrid(); - DrawTabbedText(title_font, Game::GetInstance()->GetText("MapView.item.no-system")); + DrawTabbedText(title_font, ContentBundle::GetInstance()->GetText("MapView.item.no-system")); return; } @@ -1694,7 +1695,7 @@ MapView::DrawTitle() void MapView::DrawGalaxy() { - title = Game::GetInstance()->GetText("MapView.title.Galaxy"); + title = ContentBundle::GetInstance()->GetText("MapView.title.Galaxy"); DrawGrid(); double cx = rect.w/2; @@ -1827,19 +1828,19 @@ MapView::DrawGalaxy() void MapView::DrawSystem() { - Text caption = Game::GetInstance()->GetText("MapView.title.Starsystem"); + Text caption = ContentBundle::GetInstance()->GetText("MapView.title.Starsystem"); caption += " "; caption += system->Name(); if (current_ship) { caption += "\n"; - caption += Game::GetInstance()->GetText("MapView.title.Ship"); + caption += ContentBundle::GetInstance()->GetText("MapView.title.Ship"); caption += " "; caption += current_ship->Name(); } else if (current_elem) { caption += "\n"; - caption += Game::GetInstance()->GetText("MapView.title.Ship"); + caption += ContentBundle::GetInstance()->GetText("MapView.title.Ship"); caption += " "; caption += current_elem->Name(); } @@ -1883,7 +1884,7 @@ MapView::DrawSystem() char r_txt[32]; FormatNumber(r_txt, system->Radius() * zoom); char resolution[64]; - sprintf_s(resolution, "%s: %s", Game::GetInstance()->GetText("MapView.info.Resolution").data(), r_txt); + sprintf_s(resolution, "%s: %s", ContentBundle::GetInstance()->GetText("MapView.info.Resolution").data(), r_txt); active_window->SetFont(font); Rect text_rect(4, 4, rect.w - 8, 24); @@ -1897,19 +1898,19 @@ MapView::DrawRegion() { OrbitalRegion* rgn = (OrbitalRegion*) regions[current_region]; - Text caption = Game::GetInstance()->GetText("MapView.title.Sector"); + Text caption = ContentBundle::GetInstance()->GetText("MapView.title.Sector"); caption += " "; caption += rgn->Name(); if (current_ship) { caption += "\n"; - caption += Game::GetInstance()->GetText("MapView.title.Ship"); + caption += ContentBundle::GetInstance()->GetText("MapView.title.Ship"); caption += " "; caption += current_ship->Name(); } else if (current_elem) { caption += "\n"; - caption += Game::GetInstance()->GetText("MapView.title.Ship"); + caption += ContentBundle::GetInstance()->GetText("MapView.title.Ship"); caption += " "; caption += current_elem->Name(); } @@ -2057,7 +2058,7 @@ MapView::DrawRegion() char r_txt[32]; FormatNumber(r_txt, r*2); char resolution[64]; - sprintf_s(resolution, "%s: %s", Game::GetInstance()->GetText("MapView.info.Resolution").data(), r_txt); + sprintf_s(resolution, "%s: %s", ContentBundle::GetInstance()->GetText("MapView.info.Resolution").data(), r_txt); active_window->SetFont(font); Rect text_rect(4, 4, rect.w - 8, 24); @@ -2652,15 +2653,15 @@ MissionElement* elem) if (navpt == current_navpt) { if (navpt->TargetName() && strlen(navpt->TargetName())) { - sprintf_s(buf, "%s %s", Game::GetInstance()->GetText(Text("MapView.item.") + Instruction::ActionName(navpt->Action())).data(), navpt->TargetName()); + sprintf_s(buf, "%s %s", ContentBundle::GetInstance()->GetText(Text("MapView.item.") + Instruction::ActionName(navpt->Action())).data(), navpt->TargetName()); window->Print(x2+3, y1+10, buf); } else { - sprintf_s(buf, "%s", Game::GetInstance()->GetText(Text("MapView.item.") + Instruction::ActionName(navpt->Action())).data()); + sprintf_s(buf, "%s", ContentBundle::GetInstance()->GetText(Text("MapView.item.") + Instruction::ActionName(navpt->Action())).data()); window->Print(x2+3, y1+10, buf); } - sprintf_s(buf, "%s", Game::GetInstance()->GetText(Text("MapView.item.") + Instruction::FormationName(navpt->Formation())).data()); + sprintf_s(buf, "%s", ContentBundle::GetInstance()->GetText(Text("MapView.item.") + Instruction::FormationName(navpt->Formation())).data()); window->Print(x2+3, y1+20, buf); sprintf_s(buf, "%d", navpt->Speed()); @@ -2670,7 +2671,7 @@ MissionElement* elem) char hold_time[32]; FormatTime(hold_time, navpt->HoldTime()); - sprintf_s(buf, "%s %s", Game::GetInstance()->GetText("MapView.item.Hold").data(), hold_time); + sprintf_s(buf, "%s %s", ContentBundle::GetInstance()->GetText("MapView.item.Hold").data(), hold_time); window->Print(x2+3, y1+40, buf); } } diff --git a/Stars45/Mfd.cpp b/Stars45/Mfd.cpp index 377eabe..6dc4822 100644 --- a/Stars45/Mfd.cpp +++ b/Stars45/Mfd.cpp @@ -48,6 +48,7 @@ #include "Keyboard.h" #include "Mouse.h" #include "Game.h" +#include "ContentBundle.h" static Bitmap sensor_fov; static Bitmap sensor_fwd; @@ -326,12 +327,12 @@ MFD::DrawSensorLabels(const char* mfd_mode) int scan_y = rect.y; switch (sensor->GetMode()) { - case Sensor::PAS: strcpy_s(mode_buf, Game::GetInstance()->GetText("MFD.mode.passive").data()); break; - case Sensor::STD: strcpy_s(mode_buf, Game::GetInstance()->GetText("MFD.mode.standard").data()); break; - case Sensor::ACM: strcpy_s(mode_buf, Game::GetInstance()->GetText("MFD.mode.auto-combat").data()); break; - case Sensor::GM: strcpy_s(mode_buf, Game::GetInstance()->GetText("MFD.mode.ground").data()); break; - case Sensor::PST: strcpy_s(mode_buf, Game::GetInstance()->GetText("MFD.mode.passive").data()); break; - case Sensor::CST: strcpy_s(mode_buf, Game::GetInstance()->GetText("MFD.mode.combined").data()); break; + case Sensor::PAS: strcpy_s(mode_buf, ContentBundle::GetInstance()->GetText("MFD.mode.passive").data()); break; + case Sensor::STD: strcpy_s(mode_buf, ContentBundle::GetInstance()->GetText("MFD.mode.standard").data()); break; + case Sensor::ACM: strcpy_s(mode_buf, ContentBundle::GetInstance()->GetText("MFD.mode.auto-combat").data()); break; + case Sensor::GM: strcpy_s(mode_buf, ContentBundle::GetInstance()->GetText("MFD.mode.ground").data()); break; + case Sensor::PST: strcpy_s(mode_buf, ContentBundle::GetInstance()->GetText("MFD.mode.passive").data()); break; + case Sensor::CST: strcpy_s(mode_buf, ContentBundle::GetInstance()->GetText("MFD.mode.combined").data()); break; default: break; } @@ -355,7 +356,7 @@ MFD::DrawSensorLabels(const char* mfd_mode) if (ship->GetProbeLauncher()) { char probes[32]; - sprintf_s(probes, "%s %02d", Game::GetInstance()->GetText("MFD.probe").data(), ship->GetProbeLauncher()->Ammo()); + sprintf_s(probes, "%s %02d", ContentBundle::GetInstance()->GetText("MFD.probe").data(), ship->GetProbeLauncher()->Ammo()); DrawMFDText(3, probes, probe_rect, DT_RIGHT); } else { @@ -411,7 +412,7 @@ MFD::DrawSensorMFD() Sensor* sensor = ship->GetSensor(); if (!sensor) { - DrawMFDText(0, Game::GetInstance()->GetText("MFD.inactive").data(), rect, DT_CENTER); + DrawMFDText(0, ContentBundle::GetInstance()->GetText("MFD.inactive").data(), rect, DT_CENTER); return; } @@ -596,7 +597,7 @@ MFD::DrawSensorMFD() } } - DrawSensorLabels(Game::GetInstance()->GetText("MFD.mode.field-of-view").data()); + DrawSensorLabels(ContentBundle::GetInstance()->GetText("MFD.mode.field-of-view").data()); } // +--------------------------------------------------------------------+ @@ -619,7 +620,7 @@ MFD::DrawHSD() Sensor* sensor = ship->GetSensor(); if (!sensor) { - DrawMFDText(0, Game::GetInstance()->GetText("MFD.inactive").data(), rect, DT_CENTER); + DrawMFDText(0, ContentBundle::GetInstance()->GetText("MFD.inactive").data(), rect, DT_CENTER); return; } @@ -820,7 +821,7 @@ MFD::DrawHSD() } } - DrawSensorLabels(Game::GetInstance()->GetText("MFD.mode.horizontal").data()); + DrawSensorLabels(ContentBundle::GetInstance()->GetText("MFD.mode.horizontal").data()); } // +--------------------------------------------------------------------+ @@ -843,7 +844,7 @@ MFD::Draw3D() Sensor* sensor = ship->GetSensor(); if (!sensor) { - DrawMFDText(0, Game::GetInstance()->GetText("MFD.inactive").data(), rect, DT_CENTER); + DrawMFDText(0, ContentBundle::GetInstance()->GetText("MFD.inactive").data(), rect, DT_CENTER); return; } @@ -1036,7 +1037,7 @@ MFD::Draw3D() } } - DrawSensorLabels(Game::GetInstance()->GetText("MFD.mode.3D").data()); + DrawSensorLabels(ContentBundle::GetInstance()->GetText("MFD.mode.3D").data()); } // +--------------------------------------------------------------------+ @@ -1047,7 +1048,7 @@ void MFD::DrawMap() { Rect text_rect(rect.x, rect.y, rect.w, 12); - DrawMFDText(0, Game::GetInstance()->GetText("MFD.mode.ground").data(), text_rect, DT_CENTER); + DrawMFDText(0, ContentBundle::GetInstance()->GetText("MFD.mode.ground").data(), text_rect, DT_CENTER); } // +--------------------------------------------------------------------+ @@ -1134,15 +1135,15 @@ MFD::DrawGameMFD() if (ship) { switch (ship->GetFlightPhase()) { - case Ship::DOCKED: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.DOCKED").data(), txt_rect, DT_LEFT); break; - case Ship::ALERT: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.ALERT").data(), txt_rect, DT_LEFT); break; - case Ship::LOCKED: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.LOCKED").data(), txt_rect, DT_LEFT); break; - case Ship::LAUNCH: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.LAUNCH").data(), txt_rect, DT_LEFT); break; - case Ship::TAKEOFF: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.TAKEOFF").data(), txt_rect, DT_LEFT); break; - case Ship::ACTIVE: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.ACTIVE").data(), txt_rect, DT_LEFT); break; - case Ship::APPROACH: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.APPROACH").data(), txt_rect, DT_LEFT); break; - case Ship::RECOVERY: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.RECOVERY").data(), txt_rect, DT_LEFT); break; - case Ship::DOCKING: DrawMFDText(t++, Game::GetInstance()->GetText("MFD.phase.DOCKING").data(), txt_rect, DT_LEFT); break; + case Ship::DOCKED: DrawMFDText(t++, ContentBundle::GetInstance()->GetText("MFD.phase.DOCKED").data(), txt_rect, DT_LEFT); break; + case Ship::ALERT: DrawMFDText(t++, ContentBundle::GetInstance()->GetText("MFD.phase.ALERT").data(), txt_rect, DT_LEFT); break; + case Ship::LOCKED: DrawMFDText(t++, ContentBundle::GetInstance()->GetText("MFD.phase.LOCKED").data(), txt_rect, DT_LEFT); break; + case Ship::LAUNCH: DrawMFDText(t++, ContentBundle::GetInstance()->GetText("MFD.phase.LAUNCH").data(), txt_rect, DT_LEFT); break; + case Ship::TAKEOFF: DrawMFDText(t++, ContentBundle::GetInstance()->GetText("MFD.phase.TAKEOFF").data(), txt_rect, DT_LEFT); break; + case Ship::ACTIVE: DrawMFDText(t++, ContentBundle::GetInstance()->GetText("MFD.phase.ACTIVE").data(), txt_rect, DT_LEFT); break; + case Ship::APPROACH: DrawMFDText(t++, ContentBundle::GetInstance()->GetText("MFD.phase.APPROACH").data(), txt_rect, DT_LEFT); break; + case Ship::RECOVERY: DrawMFDText(t++, ContentBundle::GetInstance()->GetText("MFD.phase.RECOVERY").data(), txt_rect, DT_LEFT); break; + case Ship::DOCKING: DrawMFDText(t++, ContentBundle::GetInstance()->GetText("MFD.phase.DOCKING").data(), txt_rect, DT_LEFT); break; } } } @@ -1162,7 +1163,7 @@ MFD::DrawStatusMFD() Drive* drive = ship->GetDrive(); if (drive) { - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.THRUST").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.THRUST").data(), status_rect, DT_LEFT); DrawGauge(status_rect.x+70, status_rect.y, (int) ship->Throttle()); status_rect.y += 10; } @@ -1172,7 +1173,7 @@ MFD::DrawStatusMFD() if (ship->Reactors().size() > 0) { PowerSource* reactor = ship->Reactors()[0]; if (reactor) { - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.FUEL").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.FUEL").data(), status_rect, DT_LEFT); DrawGauge(status_rect.x+70, status_rect.y, reactor->Charge()); status_rect.y += 10; } @@ -1182,7 +1183,7 @@ MFD::DrawStatusMFD() QuantumDrive* quantum_drive = ship->GetQuantumDrive(); if (quantum_drive) { - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.QUANTUM").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.QUANTUM").data(), status_rect, DT_LEFT); DrawGauge(status_rect.x+70, status_rect.y, (int) quantum_drive->Charge()); status_rect.y += 10; } @@ -1197,7 +1198,7 @@ MFD::DrawStatusMFD() else if (hull > 33) hull_status = System::DEGRADED; - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.HULL").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.HULL").data(), status_rect, DT_LEFT); DrawGauge(status_rect.x+70, status_rect.y, (int) hull); status_rect.y += 10; @@ -1205,7 +1206,7 @@ MFD::DrawStatusMFD() Shield* shield = ship->GetShield(); if (shield) { - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.SHIELD").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.SHIELD").data(), status_rect, DT_LEFT); DrawGauge(status_rect.x+70, status_rect.y, ship->ShieldStrength()); status_rect.y += 10; } @@ -1214,7 +1215,7 @@ MFD::DrawStatusMFD() Weapon* primary = ship->GetPrimary(); if (primary) { - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.GUNS").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.GUNS").data(), status_rect, DT_LEFT); DrawGauge(status_rect.x+70, status_rect.y, primary->Charge()); status_rect.y += 10; } @@ -1244,7 +1245,7 @@ MFD::DrawStatusMFD() if (ship->GetDecoy()) { char ammo[8]; sprintf_s(ammo, "%d", ship->GetDecoy()->Ammo()); - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.DECOY").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.DECOY").data(), status_rect, DT_LEFT); status_rect.x += 70; DrawMFDText(row++, ammo, status_rect, DT_LEFT); status_rect.x -= 70; @@ -1254,7 +1255,7 @@ MFD::DrawStatusMFD() if (NetGame::GetInstance()) { char lives[8]; sprintf_s(lives, "%d", ship->RespawnCount() + 1); - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.LIVES").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.LIVES").data(), status_rect, DT_LEFT); status_rect.x += 70; DrawMFDText(row++, lives, status_rect, DT_LEFT); status_rect.x -= 70; @@ -1267,22 +1268,22 @@ MFD::DrawStatusMFD() Sensor* sensor = ship->GetSensor(); if (sensor) { if (ship->GetFlightPhase() != Ship::ACTIVE) { - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.SENSOR").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.SENSOR").data(), status_rect, DT_LEFT); status_rect.x += 70; - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.OFFLINE").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.OFFLINE").data(), status_rect, DT_LEFT); status_rect.x -= 70; status_rect.y += 10; } else { - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.EMCON").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.EMCON").data(), status_rect, DT_LEFT); status_rect.x += 70; - sprintf_s(txt, "%s %d", Game::GetInstance()->GetText("MFD.status.MODE").data(), ship->GetEMCON()); + sprintf_s(txt, "%s %d", ContentBundle::GetInstance()->GetText("MFD.status.MODE").data(), ship->GetEMCON()); if (!sensor->IsPowerOn() || sensor->GetEnergy() == 0) { if (!Game::GetInstance()->Paused() && (Game::GetInstance()->RealTime()/1000) & 2) - strcpy_s(txt, Game::GetInstance()->GetText("MFD.status.SENSOR-OFF").data()); + strcpy_s(txt, ContentBundle::GetInstance()->GetText("MFD.status.SENSOR-OFF").data()); } DrawMFDText(row++, txt, status_rect, DT_LEFT); @@ -1293,7 +1294,7 @@ MFD::DrawStatusMFD() if (lines <= 7) return; - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.SYSTEMS").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.SYSTEMS").data(), status_rect, DT_LEFT); status_rect.x += 70; DrawMFDText(row++, ship->GetDirectorInfo(), status_rect, DT_LEFT); @@ -1302,7 +1303,7 @@ MFD::DrawStatusMFD() sprintf_s(lives, "%d", ship->RespawnCount() + 1); status_rect.x -= 70; status_rect.y += 10; - DrawMFDText(row++, Game::GetInstance()->GetText("MFD.status.LIVES").data(), status_rect, DT_LEFT); + DrawMFDText(row++, ContentBundle::GetInstance()->GetText("MFD.status.LIVES").data(), status_rect, DT_LEFT); status_rect.x += 70; DrawMFDText(row++, lives, status_rect, DT_LEFT); } diff --git a/Stars45/Mission.cpp b/Stars45/Mission.cpp index b9fa542..9c9b181 100644 --- a/Stars45/Mission.cpp +++ b/Stars45/Mission.cpp @@ -25,6 +25,7 @@ #include "Sim.h" #include "Game.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "ParseUtil.h" #include "FormatUtil.h" @@ -38,8 +39,8 @@ Mission::Mission(int identity, const char* fname, const char* pname) star_system(0), start(33 * 3600), stardate(0), target(0), ward(0), current(0), degrees(false) { - objective = Game::GetInstance()->GetText("Mission.unspecified"); - sitrep = Game::GetInstance()->GetText("Mission.unknown"); + objective = ContentBundle::GetInstance()->GetText("Mission.unspecified"); + sitrep = ContentBundle::GetInstance()->GetText("Mission.unknown"); if (fname) strcpy_s(filename, fname); @@ -306,13 +307,13 @@ Mission::ParseMission(const char* block) if (defname == "name") { GetDefText(name, def, filename); - name = Game::GetInstance()->GetText(name); + name = ContentBundle::GetInstance()->GetText(name); } else if (defname == "desc") { GetDefText(desc, def, filename); if (desc.length() > 0 && desc.length() < 32) - desc = Game::GetInstance()->GetText(desc); + desc = ContentBundle::GetInstance()->GetText(desc); } else if (defname == "type") { @@ -341,13 +342,13 @@ Mission::ParseMission(const char* block) else if (defname == "objective") { GetDefText(objective, def, filename); if (objective.length() > 0 && objective.length() < 32) - objective = Game::GetInstance()->GetText(objective); + objective = ContentBundle::GetInstance()->GetText(objective); } else if (defname == "sitrep") { GetDefText(sitrep, def, filename); if (sitrep.length() > 0 && sitrep.length() < 32) - sitrep = Game::GetInstance()->GetText(sitrep); + sitrep = ContentBundle::GetInstance()->GetText(sitrep); } else if (defname == "subtitles") { @@ -429,14 +430,14 @@ Mission::Save() Validate(); if (!filename[0] || !path[0]) { - AddError(Game::GetInstance()->GetText("Mission.error.no-file")); + AddError(ContentBundle::GetInstance()->GetText("Mission.error.no-file")); return ok; } Text content = Serialize(); if (content.length() < 8) { - AddError(Game::GetInstance()->GetText("Mission.error.no-serial")); + AddError(ContentBundle::GetInstance()->GetText("Mission.error.no-serial")); return ok; } @@ -471,7 +472,7 @@ Mission::Validate() ok = true; if (elements.isEmpty()) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.no-elem").data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.no-elem").data(), filename); AddError(err); } else { @@ -481,7 +482,7 @@ Mission::Validate() MissionElement* elem = elements.at(i); if (elem->Name().length() < 1) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.unnamed-elem").data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.unnamed-elem").data(), filename); AddError(err); } @@ -490,14 +491,14 @@ Mission::Validate() found_player = true; if (elem->Region() != GetRegion()) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.wrong-sector").data(), + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.wrong-sector").data(), elem->Name().data(), GetRegion()); AddError(err); } } else { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.extra-player").data(), + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.extra-player").data(), elem->Name().data(), filename); AddError(err); @@ -506,7 +507,7 @@ Mission::Validate() } if (!found_player) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.no-player").data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.no-player").data(), filename); AddError(err); } } @@ -611,14 +612,14 @@ Mission::ParseElement(TermStruct* val) element->design = ShipDesign::Get(design, element->path); if (!element->design) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.unknown-ship").data(), design.data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.unknown-ship").data(), design.data(), filename); AddError(err); } } else if (defname == "skin") { if (!element->design) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.out-of-order").data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.out-of-order").data(), filename); AddError(err); } @@ -628,7 +629,7 @@ Mission::ParseElement(TermStruct* val) } else if (pdef->term()->isStruct()) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.bad-skin").data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.bad-skin").data(), filename); AddError(err); } } @@ -724,7 +725,7 @@ Mission::ParseElement(TermStruct* val) else if (defname == "objective") { if (!pdef->term() || !pdef->term()->isStruct()) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.no-objective").data(), element->name.data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.no-objective").data(), element->name.data(), filename); AddError(err); } else { @@ -744,7 +745,7 @@ Mission::ParseElement(TermStruct* val) else if (defname == "ship") { if (!pdef->term() || !pdef->term()->isStruct()) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.no-ship").data(), element->name.data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.no-ship").data(), element->name.data(), filename); AddError(err); } else { @@ -759,7 +760,7 @@ Mission::ParseElement(TermStruct* val) else if (defname == "order" || defname == "navpt") { if (!pdef->term() || !pdef->term()->isStruct()) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.no-navpt").data(), element->name.data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.no-navpt").data(), element->name.data(), filename); AddError(err); } else { @@ -771,7 +772,7 @@ Mission::ParseElement(TermStruct* val) else if (defname == "loadout") { if (!pdef->term() || !pdef->term()->isStruct()) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.no-loadout").data(), element->name.data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.no-loadout").data(), element->name.data(), filename); AddError(err); } else { @@ -783,12 +784,12 @@ Mission::ParseElement(TermStruct* val) } if (element->name.length() < 1) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.unnamed-elem").data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.unnamed-elem").data(), filename); AddError(err); } else if (element->design == 0) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.unknown-ship").data(), element->name.data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.unknown-ship").data(), element->name.data(), filename); AddError(err); } @@ -883,7 +884,7 @@ Mission::ParseEvent(TermStruct* val) else if (defname == "event_message" || defname == "message") { Text raw_msg; GetDefText(raw_msg, pdef, filename); - raw_msg = Game::GetInstance()->GetText(raw_msg); + raw_msg = ContentBundle::GetInstance()->GetText(raw_msg); event->event_message = FormatTextEscape(raw_msg); } @@ -948,7 +949,7 @@ Mission::ParseShip(TermStruct* val, MissionElement* element) else if (defname == "skin") { if (!element || !element->design) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.out-of-order").data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.out-of-order").data(), filename); AddError(err); } @@ -958,7 +959,7 @@ Mission::ParseShip(TermStruct* val, MissionElement* element) } else if (pdef->term()->isStruct()) { - sprintf_s(err, Game::GetInstance()->GetText("Mission.error.bad-skin").data(), filename); + sprintf_s(err, ContentBundle::GetInstance()->GetText("Mission.error.bad-skin").data(), filename); AddError(err); } } diff --git a/Stars45/MsnDlg.cpp b/Stars45/MsnDlg.cpp index 2419629..fe2a878 100644 --- a/Stars45/MsnDlg.cpp +++ b/Stars45/MsnDlg.cpp @@ -25,6 +25,7 @@ #include "NetLobby.h" #include "Game.h" +#include "ContentBundle.h" #include "FormWindow.h" #include "FormatUtil.h" #include "Keyboard.h" @@ -113,7 +114,7 @@ MsnDlg::ShowMsnDlg() if (mission) mission_name->SetText(mission->Name()); else - mission_name->SetText(Game::GetInstance()->GetText("MsnDlg.no-mission")); + mission_name->SetText(ContentBundle::GetInstance()->GetText("MsnDlg.no-mission")); } if (mission_system) { @@ -150,7 +151,7 @@ MsnDlg::ShowMsnDlg() char txt[32]; FormatDayTime(txt, time_on_target); mission_time_target->SetText(txt); - mission_time_target_label->SetText(Game::GetInstance()->GetText("MsnDlg.target")); + mission_time_target_label->SetText(ContentBundle::GetInstance()->GetText("MsnDlg.target")); } else { mission_time_target->SetText(""); diff --git a/Stars45/MsnEditDlg.cpp b/Stars45/MsnEditDlg.cpp index 69b8d61..527c451 100644 --- a/Stars45/MsnEditDlg.cpp +++ b/Stars45/MsnEditDlg.cpp @@ -26,6 +26,7 @@ #include "Galaxy.h" #include "Game.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "Button.h" #include "ListBox.h" @@ -341,7 +342,7 @@ MsnEditDlg::DrawPackages() sprintf_s(txt, "%s %s", design->abrv, design->name); } else { - sprintf_s(txt, "%s", Game::GetInstance()->GetText("MsnDlg.undefined").data()); + sprintf_s(txt, "%s", ContentBundle::GetInstance()->GetText("MsnDlg.undefined").data()); } lst_elem->SetItemText(i, 3, txt); diff --git a/Stars45/MsnElemDlg.cpp b/Stars45/MsnElemDlg.cpp index a1e1f69..e6f4eea 100644 --- a/Stars45/MsnElemDlg.cpp +++ b/Stars45/MsnElemDlg.cpp @@ -24,6 +24,7 @@ #include "Galaxy.h" #include "Game.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "Button.h" #include "ListBox.h" @@ -497,7 +498,7 @@ MsnElemDlg::OnDesignSelect(AWEvent* event) cmb_skin->ClearItems(); if (design) { - cmb_skin->AddItem(Game::GetInstance()->GetText("MsnDlg.default")); + cmb_skin->AddItem(ContentBundle::GetInstance()->GetText("MsnDlg.default")); cmb_skin->SetSelection(0); ListIter iter = design->skins; @@ -692,7 +693,7 @@ MsnElemDlg::OnAccept(AWEvent* event) if (cmb_skin) { const char* skin_name = cmb_skin->GetSelectedItem(); - if (strcmp(skin_name, Game::GetInstance()->GetText("MsnDlg.default").data())) { + if (strcmp(skin_name, ContentBundle::GetInstance()->GetText("MsnDlg.default").data())) { elem->SetSkin(d->FindSkin(skin_name)); } else { diff --git a/Stars45/MsnObjDlg.cpp b/Stars45/MsnObjDlg.cpp index 3052495..3089c91 100644 --- a/Stars45/MsnObjDlg.cpp +++ b/Stars45/MsnObjDlg.cpp @@ -22,6 +22,7 @@ #include "StarSystem.h" #include "Game.h" +#include "ContentBundle.h" #include "Mouse.h" #include "Button.h" #include "ComboBox.h" @@ -141,7 +142,7 @@ MsnObjDlg::Show() objectives->SetText(""); } else { - objectives->SetText(Game::GetInstance()->GetText("MsnDlg.no-mission")); + objectives->SetText(ContentBundle::GetInstance()->GetText("MsnDlg.no-mission")); } } @@ -150,11 +151,11 @@ MsnObjDlg::Show() if (mission->IsOK()) sitrep->SetText(mission->Situation()); else - sitrep->SetText(Game::GetInstance()->GetText("MsnDlg.found-errors") + + sitrep->SetText(ContentBundle::GetInstance()->GetText("MsnDlg.found-errors") + mission->ErrorMessage()); } else { - sitrep->SetText(Game::GetInstance()->GetText("MsnDlg.no-mission")); + sitrep->SetText(ContentBundle::GetInstance()->GetText("MsnDlg.no-mission")); } } @@ -220,7 +221,7 @@ MsnObjDlg::Show() if (cmb_skin && design && design->skins.size()) { cmb_skin->Show(); - cmb_skin->AddItem(Game::GetInstance()->GetText("MsnDlg.default")); + cmb_skin->AddItem(ContentBundle::GetInstance()->GetText("MsnDlg.default")); cmb_skin->SetSelection(0); ListIter iter = ((ShipDesign*) design)->skins; diff --git a/Stars45/MsnPkgDlg.cpp b/Stars45/MsnPkgDlg.cpp index 2dcf608..d13c518 100644 --- a/Stars45/MsnPkgDlg.cpp +++ b/Stars45/MsnPkgDlg.cpp @@ -22,6 +22,7 @@ #include "StarSystem.h" #include "Game.h" +#include "ContentBundle.h" #include "Mouse.h" #include "Button.h" #include "ListBox.h" @@ -256,9 +257,9 @@ MsnPkgDlg::DrawThreats() mission_role == Mission::INTERCEPT || mission_role == Mission::FLEET || mission_role == Mission::BOMBARDMENT) - strcpy_s(role, Game::GetInstance()->GetText("MsnDlg.ATTACK").data()); + strcpy_s(role, ContentBundle::GetInstance()->GetText("MsnDlg.ATTACK").data()); else - strcpy_s(role, Game::GetInstance()->GetText("MsnDlg.PATROL").data()); + strcpy_s(role, ContentBundle::GetInstance()->GetText("MsnDlg.PATROL").data()); double dist = Point(base_loc - elem->Location()).length(); FormatNumber(rng, dist); diff --git a/Stars45/MsnSelectDlg.cpp b/Stars45/MsnSelectDlg.cpp index fff58f2..ee75cb0 100644 --- a/Stars45/MsnSelectDlg.cpp +++ b/Stars45/MsnSelectDlg.cpp @@ -22,6 +22,7 @@ #include "Mission.h" #include "Game.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "Button.h" #include "ComboBox.h" @@ -199,7 +200,7 @@ MsnSelectDlg::Show() } if (description) - description->SetText(Game::GetInstance()->GetText("MsnSelectDlg.choose")); + description->SetText(ContentBundle::GetInstance()->GetText("MsnSelectDlg.choose")); if (lst_missions) { lst_missions->ClearItems(); @@ -268,7 +269,7 @@ MsnSelectDlg::OnCampaignSelect(AWEvent* event) btn_accept->SetEnabled(false); if (description) - description->SetText(Game::GetInstance()->GetText("MsnSelectDlg.choose")); + description->SetText(ContentBundle::GetInstance()->GetText("MsnSelectDlg.choose")); int id = c->GetCampaignId(); editable = (id >= Campaign::MULTIPLAYER_MISSIONS && @@ -302,25 +303,25 @@ MsnSelectDlg::OnMissionSelect(AWEvent* event) Text d(""); d += info->name; d += "\n\n"; - d += Game::GetInstance()->GetText("MsnSelectDlg.mission-type"); + d += ContentBundle::GetInstance()->GetText("MsnSelectDlg.mission-type"); d += "\n\t"; d += Mission::RoleName(info->type); d += "\n\n"; - d += Game::GetInstance()->GetText("MsnSelectDlg.scenario"); + d += ContentBundle::GetInstance()->GetText("MsnSelectDlg.scenario"); d += "\n\t"; d += info->description; d += "\n\n"; - d += Game::GetInstance()->GetText("MsnSelectDlg.location"); + d += ContentBundle::GetInstance()->GetText("MsnSelectDlg.location"); d += "\n\t"; d += info->region; d += " "; - d += Game::GetInstance()->GetText("MsnSelectDlg.sector"); + d += ContentBundle::GetInstance()->GetText("MsnSelectDlg.sector"); d += " / "; d += info->system; d += " "; - d += Game::GetInstance()->GetText("MsnSelectDlg.system"); + d += ContentBundle::GetInstance()->GetText("MsnSelectDlg.system"); d += "\n\n"; - d += Game::GetInstance()->GetText("MsnSelectDlg.start-time"); + d += ContentBundle::GetInstance()->GetText("MsnSelectDlg.start-time"); d += "\n\t"; d += time_buf; @@ -332,7 +333,7 @@ MsnSelectDlg::OnMissionSelect(AWEvent* event) } else { - description->SetText(Game::GetInstance()->GetText("MsnSelectDlg.choose")); + description->SetText(ContentBundle::GetInstance()->GetText("MsnSelectDlg.choose")); btn_accept->SetEnabled(false); if (btn_edit) btn_edit->SetEnabled(false); @@ -442,9 +443,9 @@ MsnSelectDlg::OnDel(AWEvent* event) ConfirmDlg* confirm = manager->GetConfirmDlg(); if (confirm) { char msg[256]; - sprintf_s(msg, Game::GetInstance()->GetText("MsnSelectDlg.are-you-sure").data(), m->Name()); + sprintf_s(msg, ContentBundle::GetInstance()->GetText("MsnSelectDlg.are-you-sure").data(), m->Name()); confirm->SetMessage(msg); - confirm->SetTitle(Game::GetInstance()->GetText("MsnSelectDlg.confirm-delete")); + confirm->SetTitle(ContentBundle::GetInstance()->GetText("MsnSelectDlg.confirm-delete")); confirm->SetParentControl(btn_del); manager->ShowConfirmDlg(); diff --git a/Stars45/NavAI.cpp b/Stars45/NavAI.cpp index d20ce8b..fe1ac75 100644 --- a/Stars45/NavAI.cpp +++ b/Stars45/NavAI.cpp @@ -30,6 +30,7 @@ #include "HUDSounds.h" #include "Game.h" +#include "ContentBundle.h" // +----------------------------------------------------------------------+ @@ -169,7 +170,7 @@ NavAI::FindObjective() // transform into camera coords: objective = Transform(obj_w); - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.takeoff")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.takeoff")); return; } @@ -308,15 +309,15 @@ NavAI::Navigator() if (navpt) { if (navpt->Status() == Instruction::COMPLETE && navpt->HoldTime() > 0) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.auto-hold")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.auto-hold")); hold = true; } else { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.auto-nav")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.auto-nav")); } } else { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.auto-stop")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.auto-stop")); } Accumulate(AvoidTerrain()); @@ -596,11 +597,11 @@ NavAI::AvoidTerrain() // too low? if (ship->AltitudeAGL() < 1000) { terrain_warning = true; - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.too-low")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.too-low")); // way too low? if (ship->AltitudeAGL() < 750) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.way-too-low")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.way-too-low")); } // where will we be? diff --git a/Stars45/NavDlg.cpp b/Stars45/NavDlg.cpp index 6bfbf3c..662f185 100644 --- a/Stars45/NavDlg.cpp +++ b/Stars45/NavDlg.cpp @@ -29,6 +29,7 @@ #include "Mission.h" #include "Game.h" +#include "ContentBundle.h" #include "Keyboard.h" #include "Mouse.h" #include "ListBox.h" @@ -358,7 +359,7 @@ NavDlg::ExecFrame() FormatNumber(y, ship->Location().z); FormatNumber(z, ship->Location().y); - strcpy_s(loc_buf, Game::GetInstance()->GetText("NavDlg.loc-labels").data()); + strcpy_s(loc_buf, ContentBundle::GetInstance()->GetText("NavDlg.loc-labels").data()); loc_labels->SetText(loc_buf); if (sim->GetActiveRegion()) { @@ -379,7 +380,7 @@ NavDlg::ExecFrame() NavSystem* navsys = ship->GetNavSystem(); if (ship->GetNextNavPoint() == 0 || !navsys) { - commit_btn->SetText(Game::GetInstance()->GetText("NavDlg.commit")); + commit_btn->SetText(ContentBundle::GetInstance()->GetText("NavDlg.commit")); commit_btn->SetBackColor(commit_color); commit_btn->SetEnabled(false); } @@ -387,11 +388,11 @@ NavDlg::ExecFrame() commit_btn->SetEnabled(true); if (navsys->AutoNavEngaged()) { - commit_btn->SetText(Game::GetInstance()->GetText("NavDlg.cancel")); + commit_btn->SetText(ContentBundle::GetInstance()->GetText("NavDlg.cancel")); commit_btn->SetBackColor(cancel_color); } else { - commit_btn->SetText(Game::GetInstance()->GetText("NavDlg.commit")); + commit_btn->SetText(ContentBundle::GetInstance()->GetText("NavDlg.commit")); commit_btn->SetBackColor(commit_color); } } @@ -416,7 +417,7 @@ NavDlg::ExecFrame() distance = Point(npt - ship->Location()).length(); FormatNumber(d, distance); - strcpy_s(loc_buf, Game::GetInstance()->GetText("NavDlg.dst-labels").data()); + strcpy_s(loc_buf, ContentBundle::GetInstance()->GetText("NavDlg.dst-labels").data()); dst_labels->SetText(loc_buf); sprintf_s(loc_buf, "\n%s\n%s\n%s, %s, %s\n%s", @@ -426,8 +427,8 @@ NavDlg::ExecFrame() dst_data->SetText(loc_buf); } else { - dst_labels->SetText(Game::GetInstance()->GetText("NavDlg.destination")); - dst_data->SetText(Game::GetInstance()->GetText("NavDlg.not-avail")); + dst_labels->SetText(ContentBundle::GetInstance()->GetText("NavDlg.destination")); + dst_data->SetText(ContentBundle::GetInstance()->GetText("NavDlg.not-avail")); } } } @@ -685,8 +686,8 @@ NavDlg::UpdateSelection() info_list->ClearItems(); - Text units_km = Text(" ") + Game::GetInstance()->GetText("NavDlg.units.kilometers"); - Text units_tonnes = Text(" ") + Game::GetInstance()->GetText("NavDlg.units.tonnes"); + Text units_km = Text(" ") + ContentBundle::GetInstance()->GetText("NavDlg.units.kilometers"); + Text units_tonnes = Text(" ") + ContentBundle::GetInstance()->GetText("NavDlg.units.tonnes"); if (seln_mode <= SELECT_REGION) { Orbital* s = star_map->GetSelection(); @@ -701,23 +702,23 @@ NavDlg::UpdateSelection() double p = s->Period(); if (p < 60) { - sprintf_s(units, " %s", Game::GetInstance()->GetText("NavDlg.units.seconds").data()); + sprintf_s(units, " %s", ContentBundle::GetInstance()->GetText("NavDlg.units.seconds").data()); } else if (p < 3600) { p /= 60; - sprintf_s(units, " %s", Game::GetInstance()->GetText("NavDlg.units.minutes").data()); + sprintf_s(units, " %s", ContentBundle::GetInstance()->GetText("NavDlg.units.minutes").data()); } else if (p < 24 * 3600) { p /= 3600; - sprintf_s(units, " %s", Game::GetInstance()->GetText("NavDlg.units.hours").data()); + sprintf_s(units, " %s", ContentBundle::GetInstance()->GetText("NavDlg.units.hours").data()); } else if (p < 365.25 * 24 * 3600) { p /= 24*3600; - sprintf_s(units, " %s", Game::GetInstance()->GetText("NavDlg.units.days").data()); + sprintf_s(units, " %s", ContentBundle::GetInstance()->GetText("NavDlg.units.days").data()); } else { p /= 365.25*24*3600; - sprintf_s(units, " %s", Game::GetInstance()->GetText("NavDlg.units.years").data()); + sprintf_s(units, " %s", ContentBundle::GetInstance()->GetText("NavDlg.units.years").data()); } FormatNumberExp(radius, s->Radius()/1000); @@ -731,12 +732,12 @@ NavDlg::UpdateSelection() strcat_s(period, units); if (seln_mode >= SELECT_SYSTEM) { - info_list->AddItem(Game::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode])); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.radius")); + info_list->AddItem(ContentBundle::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode])); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.radius")); if (s->Mass() > 0) - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.mass")); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.orbit")); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.period")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.mass")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.orbit")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.period")); int row = 0; info_list->SetItemText(row++, 1, s->Name()); @@ -757,27 +758,27 @@ NavDlg::UpdateSelection() MissionElement* sel_elem = star_map->GetSelectedElem(); if (sel_ship) { - Text order_desc = Game::GetInstance()->GetText("NavDlg.none"); + Text order_desc = ContentBundle::GetInstance()->GetText("NavDlg.none"); char shield[16]; char hull[16]; char range[32]; sprintf_s(shield, "%03d", sel_ship->ShieldStrength()); sprintf_s(hull, "%03d", sel_ship->HullStrength()); - sprintf_s(range, "%s", Game::GetInstance()->GetText("NavDlg.not-avail").data()); + sprintf_s(range, "%s", ContentBundle::GetInstance()->GetText("NavDlg.not-avail").data()); if (ship) { FormatNumberExp(range, Point(sel_ship->Location()-ship->Location()).length()/1000); strcat_s(range, units_km.data()); } - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.name")); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.class")); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.sector")); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.shield")); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.hull")); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.range")); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.orders")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.name")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.class")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.sector")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.shield")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.hull")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.range")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.orders")); int row = 0; info_list->SetItemText(row++, 1, sel_ship->Name()); @@ -790,7 +791,7 @@ NavDlg::UpdateSelection() } else if (sel_elem) { - Text order_desc = Game::GetInstance()->GetText("NavDlg.none"); + Text order_desc = ContentBundle::GetInstance()->GetText("NavDlg.none"); char range[32]; MissionElement* self = mission->GetElements()[0]; @@ -801,11 +802,11 @@ NavDlg::UpdateSelection() strcat_s(range, units_km.data()); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.name")); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.class")); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.sector")); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.range")); - info_list->AddItem(Game::GetInstance()->GetText("NavDlg.orders")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.name")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.class")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.sector")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.range")); + info_list->AddItem(ContentBundle::GetInstance()->GetText("NavDlg.orders")); int row = 0; info_list->SetItemText(row++, 1, sel_elem->Name()); @@ -813,7 +814,7 @@ NavDlg::UpdateSelection() if (sel_elem->GetDesign()) info_list->SetItemText(row++, 1, sel_elem->Abbreviation() + Text(" ") + sel_elem->GetDesign()->name); else - info_list->SetItemText(row++, 1, Game::GetInstance()->GetText("NavDlg.unknown")); + info_list->SetItemText(row++, 1, ContentBundle::GetInstance()->GetText("NavDlg.unknown")); info_list->SetItemText(row++, 1, sel_elem->Region()); info_list->SetItemText(row++, 1, range); @@ -843,7 +844,7 @@ NavDlg::UpdateLists() switch (seln_mode) { case SELECT_SYSTEM: { - seln_list->SetColumnTitle(0, Game::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode])); + seln_list->SetColumnTitle(0, ContentBundle::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode])); int i = 0; ListIter iter = star_map->GetGalaxy(); while (++iter) @@ -853,7 +854,7 @@ NavDlg::UpdateLists() case SELECT_PLANET: { - seln_list->SetColumnTitle(0, Game::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode])); + seln_list->SetColumnTitle(0, ContentBundle::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode])); int i = 0; ListIter iter = planets; while (++iter) { @@ -867,7 +868,7 @@ NavDlg::UpdateLists() case SELECT_REGION: { - seln_list->SetColumnTitle(0, Game::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode])); + seln_list->SetColumnTitle(0, ContentBundle::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode])); int i = 0; ListIter iter = regions; while (++iter) { @@ -880,7 +881,7 @@ NavDlg::UpdateLists() case SELECT_STARSHIP: case SELECT_FIGHTER: { - seln_list->SetColumnTitle(0, Game::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode])); + seln_list->SetColumnTitle(0, ContentBundle::GetInstance()->GetText(Text("NavDlg.filter.") + filter_name[seln_mode])); int i = 0; if (mission) { @@ -960,12 +961,12 @@ NavDlg::OnEngage(AWEvent* event) if (navsys) { if (navsys->AutoNavEngaged()) { navsys->DisengageAutoNav(); - commit_btn->SetText(Game::GetInstance()->GetText("NavDlg.commit")); + commit_btn->SetText(ContentBundle::GetInstance()->GetText("NavDlg.commit")); commit_btn->SetBackColor(commit_color); } else { navsys->EngageAutoNav(); - commit_btn->SetText(Game::GetInstance()->GetText("NavDlg.cancel")); + commit_btn->SetText(ContentBundle::GetInstance()->GetText("NavDlg.cancel")); commit_btn->SetBackColor(cancel_color); hide = true; } diff --git a/Stars45/NavLight.cpp b/Stars45/NavLight.cpp index 9461405..63712ac 100644 --- a/Stars45/NavLight.cpp +++ b/Stars45/NavLight.cpp @@ -17,6 +17,7 @@ #include "Game.h" #include "Bitmap.h" #include "DataLoader.h" +#include "ContentBundle.h" // +----------------------------------------------------------------------+ @@ -28,8 +29,8 @@ NavLight::NavLight(double p, double s) : System(COMPUTER, 32, "Navigation Lights", 1, 0), period(p), nlights(0), scale(s), enable(true) { - name = Game::GetInstance()->GetText("sys.nav-light"); - abrv = Game::GetInstance()->GetText("sys.nav-light.abrv"); + name = ContentBundle::GetInstance()->GetText("sys.nav-light"); + abrv = ContentBundle::GetInstance()->GetText("sys.nav-light.abrv"); ZeroMemory(beacon, sizeof(beacon)); ZeroMemory(beacon_type, sizeof(beacon_type)); diff --git a/Stars45/NavSystem.cpp b/Stars45/NavSystem.cpp index bf27dae..877e720 100644 --- a/Stars45/NavSystem.cpp +++ b/Stars45/NavSystem.cpp @@ -18,6 +18,7 @@ #include "HUDSounds.h" #include "Button.h" #include "Game.h" +#include "ContentBundle.h" // +----------------------------------------------------------------------+ @@ -25,8 +26,8 @@ NavSystem::NavSystem() : System(COMPUTER, 2, "Auto Nav System", 1, 1,1,1), autonav(0) { - name = Game::GetInstance()->GetText("sys.nav-system"); - abrv = Game::GetInstance()->GetText("sys.nav-system.abrv"); + name = ContentBundle::GetInstance()->GetText("sys.nav-system"); + abrv = ContentBundle::GetInstance()->GetText("sys.nav-system.abrv"); power_flags = POWER_WATTS | POWER_CRITICAL; } diff --git a/Stars45/NetClientDlg.cpp b/Stars45/NetClientDlg.cpp index 8b64ca5..7597a2c 100644 --- a/Stars45/NetClientDlg.cpp +++ b/Stars45/NetClientDlg.cpp @@ -23,6 +23,7 @@ #include "NetAddr.h" #include "DataLoader.h" +#include "ContentBundle.h" #include "Button.h" #include "ListBox.h" #include "Slider.h" @@ -168,9 +169,9 @@ NetClientDlg::ShowServers() lst_servers->AddItemWithData(info->name, (DWORD) i); lst_servers->SetItemText(i, 1, info->type); lst_servers->SetItemText(i, 2, info->password); - lst_servers->SetItemText(i, 3, Game::GetInstance()->GetText("NetClientDlg.offline")); + lst_servers->SetItemText(i, 3, ContentBundle::GetInstance()->GetText("NetClientDlg.offline")); lst_servers->SetItemText(i, 4, "0"); - lst_servers->SetItemText(i, 5, Game::GetInstance()->GetText("NetClientDlg.not-avail")); + lst_servers->SetItemText(i, 5, ContentBundle::GetInstance()->GetText("NetClientDlg.not-avail")); i++; } @@ -199,7 +200,7 @@ NetClientDlg::UpdateServers() NetServerInfo* info = config->GetServerList().at(n); lst_servers->SetItemText(i, 0, info->name); - Text status = Game::GetInstance()->GetText("NetClientDlg.offline"); + Text status = ContentBundle::GetInstance()->GetText("NetClientDlg.offline"); if (info->ping_time > 0 && info->ping_time < 10000) { char buffer[32]; @@ -208,16 +209,16 @@ NetClientDlg::UpdateServers() switch (info->status) { default: - case NetServerInfo::OFFLINE: status = Game::GetInstance()->GetText("NetClientDlg.offline"); break; - case NetServerInfo::LOBBY: status = Game::GetInstance()->GetText("NetClientDlg.lobby"); break; - case NetServerInfo::BRIEFING: status = Game::GetInstance()->GetText("NetClientDlg.briefing"); break; - case NetServerInfo::ACTIVE: status = Game::GetInstance()->GetText("NetClientDlg.active"); break; - case NetServerInfo::DEBRIEFING: status = Game::GetInstance()->GetText("NetClientDlg.debriefing"); break; - case NetServerInfo::PERSISTENT: status = Game::GetInstance()->GetText("NetClientDlg.persistent"); break; + case NetServerInfo::OFFLINE: status = ContentBundle::GetInstance()->GetText("NetClientDlg.offline"); break; + case NetServerInfo::LOBBY: status = ContentBundle::GetInstance()->GetText("NetClientDlg.lobby"); break; + case NetServerInfo::BRIEFING: status = ContentBundle::GetInstance()->GetText("NetClientDlg.briefing"); break; + case NetServerInfo::ACTIVE: status = ContentBundle::GetInstance()->GetText("NetClientDlg.active"); break; + case NetServerInfo::DEBRIEFING: status = ContentBundle::GetInstance()->GetText("NetClientDlg.debriefing"); break; + case NetServerInfo::PERSISTENT: status = ContentBundle::GetInstance()->GetText("NetClientDlg.persistent"); break; } } else { - lst_servers->SetItemText(i, 5, Game::GetInstance()->GetText("NetClientDlg.not-avail")); + lst_servers->SetItemText(i, 5, ContentBundle::GetInstance()->GetText("NetClientDlg.not-avail")); } lst_servers->SetItemText(i, 3, status); diff --git a/Stars45/NetGameClient.cpp b/Stars45/NetGameClient.cpp index 1871057..4d9d5ae 100644 --- a/Stars45/NetGameClient.cpp +++ b/Stars45/NetGameClient.cpp @@ -40,6 +40,7 @@ #include "NetPeer.h" #include "Game.h" +#include "ContentBundle.h" #include "Light.h" // +--------------------------------------------------------------------+ @@ -159,10 +160,10 @@ NetGameClient::DoJoinAnnounce(NetMsg* msg) Ship* ship = 0; char ship_name[128]; - strcpy_s(ship_name, Game::GetInstance()->GetText("NetGameClient.no-ship").data()); + strcpy_s(ship_name, ContentBundle::GetInstance()->GetText("NetGameClient.no-ship").data()); if (local_player && player_name == name) { - HUDView::Message(Game::GetInstance()->GetText("NetGameClient.local-accept"), name.data(), local_player->Name()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameClient.local-accept"), name.data(), local_player->Name()); objid = oid; netid = nid; @@ -239,7 +240,7 @@ NetGameClient::DoJoinAnnounce(NetMsg* msg) Print("Remote Player '%s' has joined as '%s' with ID %d\n", name.data(), ship_name, oid); } else { - HUDView::Message(Game::GetInstance()->GetText("NetGameClient.remote-join").data(), name.data(), ship_name); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameClient.remote-join").data(), name.data(), ship_name); } } } @@ -274,7 +275,7 @@ NetGameClient::DoJoinBacklog(NetJoinAnnounce* join_ann) Ship* ship = 0; char ship_name[128]; - strcpy_s(ship_name, Game::GetInstance()->GetText("NetGameClient.no-ship").data()); + strcpy_s(ship_name, ContentBundle::GetInstance()->GetText("NetGameClient.no-ship").data()); if (nid && oid) { NetPlayer* remote_player = FindPlayerByObjID(oid); @@ -322,7 +323,7 @@ NetGameClient::DoJoinBacklog(NetJoinAnnounce* join_ann) Print("NetGameClient::DoJoinBacklog() Remote Player '%s' has joined as '%s' with ID %d\n", name.data(), ship_name, oid); } else { - HUDView::Message(Game::GetInstance()->GetText("NetGameClient.remote-join").data(), name.data(), ship_name); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameClient.remote-join").data(), name.data(), ship_name); } } } @@ -361,9 +362,9 @@ NetGameClient::DoQuitAnnounce(NetMsg* msg) } if (quit_ann.GetDisconnected()) - HUDView::Message(Game::GetInstance()->GetText("NetGameClient.remote-discon").data(), zombie->Name()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameClient.remote-discon").data(), zombie->Name()); else - HUDView::Message(Game::GetInstance()->GetText("NetGameClient.remote-quit").data(), zombie->Name()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameClient.remote-quit").data(), zombie->Name()); delete zombie; } else { @@ -376,7 +377,7 @@ NetGameClient::DoGameOver(NetMsg* msg) { if (!msg) return; - HUDView::Message(Game::GetInstance()->GetText("NetGameClient.game-over").data()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameClient.game-over").data()); players.destroy(); active = false; } @@ -386,8 +387,8 @@ NetGameClient::DoDisconnect(NetMsg* msg) { if (!msg) return; - HUDView::Message(Game::GetInstance()->GetText("NetGameClient.discon-detect").data()); - HUDView::Message(Game::GetInstance()->GetText("NetGameClient.please-exit").data()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameClient.discon-detect").data()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameClient.please-exit").data()); players.destroy(); active = false; } @@ -473,7 +474,7 @@ NetGameClient::DoObjKill(NetMsg* msg) Ship* ship = FindShipByObjID(obj_kill.GetObjID()); if (ship) { Ship* killer = FindShipByObjID(obj_kill.GetKillerID()); - Text killer_name = Game::GetInstance()->GetText("NetGameClient.unknown"); + Text killer_name = ContentBundle::GetInstance()->GetText("NetGameClient.unknown"); if (killer) killer_name = killer->Name(); @@ -911,7 +912,7 @@ NetGameClient::DoChatMsg(NetMsg* msg) Text name = chat_msg.GetName(); if (name.length() < 1) - name = Game::GetInstance()->GetText("NetGameClient.chat.unknown"); + name = ContentBundle::GetInstance()->GetText("NetGameClient.chat.unknown"); HUDView::Message("%s> %s", name.data(), chat_msg.GetText().data()); } diff --git a/Stars45/NetGameServer.cpp b/Stars45/NetGameServer.cpp index 10ab73d..76bd4ff 100644 --- a/Stars45/NetGameServer.cpp +++ b/Stars45/NetGameServer.cpp @@ -40,6 +40,7 @@ #include "NetPeer.h" #include "NetUtil.h" #include "Game.h" +#include "ContentBundle.h" #include "Light.h" // +--------------------------------------------------------------------+ @@ -171,7 +172,7 @@ NetGameServer::CheckSessions() if (peer && (NetLayer::GetUTC() - peer->LastReceiveTime()) > NET_DISCONNECT_TIME) { // announce drop: NetPlayer* zombie = iter.removeItem(); - HUDView::Message(Game::GetInstance()->GetText("NetGameServer.remote-discon").data(), zombie->Name()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameServer.remote-discon").data(), zombie->Name()); // tell everyone else: NetQuitAnnounce quit_ann; @@ -222,7 +223,7 @@ NetGameServer::DoJoinRequest(NetMsg* msg) NetJoinRequest join_req; if (join_req.Unpack(msg->Data())) { - HUDView::Message(Game::GetInstance()->GetText("NetGameServer::join-request").data(), join_req.GetName(), join_req.GetElement(), join_req.GetIndex()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameServer::join-request").data(), join_req.GetName(), join_req.GetElement(), join_req.GetIndex()); DWORD nid = msg->NetID(); Text name = join_req.GetName(); @@ -286,7 +287,7 @@ NetGameServer::DoJoinRequest(NetMsg* msg) remote_player->SetObjID(ship->GetObjID()); remote_player->SetShip(ship); - HUDView::Message(Game::GetInstance()->GetText("NetGameServer::join-announce").data()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameServer::join-announce").data()); Print("remote player name = %s\n", name.data()); Print(" obj = %d\n", ship->GetObjID()); Print(" ship = %s\n", ship->Name()); @@ -372,7 +373,7 @@ NetGameServer::DoQuitRequest(NetMsg* msg) if (player) { NetPlayer* zombie = players.remove(player); - HUDView::Message(Game::GetInstance()->GetText("NetGameServer.remote-quit").data(), zombie->Name()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameServer.remote-quit").data(), zombie->Name()); // tell everyone else: NetQuitAnnounce quit_ann; @@ -465,7 +466,7 @@ NetGameServer::DoObjKill(NetMsg* msg) Ship* ship = FindShipByObjID(obj_kill.GetObjID()); if (ship) { Ship* killer = FindShipByObjID(obj_kill.GetKillerID()); - Text killer_name = Game::GetInstance()->GetText("NetGameServer.unknown"); + Text killer_name = ContentBundle::GetInstance()->GetText("NetGameServer.unknown"); if (killer) killer_name = killer->Name(); @@ -909,7 +910,7 @@ NetGameServer::RouteChatMsg(NetChatMsg& chat_msg) if (local_player && (dst_id == 0xffff || dst_id == 0 || local_player->GetIFF() == (int) dst_id-1)) { Text name = chat_msg.GetName(); if (name.length() < 1) - name = Game::GetInstance()->GetText("NetGameServer.chat.unknown"); + name = ContentBundle::GetInstance()->GetText("NetGameServer.chat.unknown"); // don't echo general messages from the local player. // they are already displayed by the chat entry code @@ -924,7 +925,7 @@ NetGameServer::RouteChatMsg(NetChatMsg& chat_msg) else if (local_player && local_player->GetObjID() == dst_id) { Text name = chat_msg.GetName(); if (name.length() < 1) - name = Game::GetInstance()->GetText("NetGameServer.chat.unknown"); + name = ContentBundle::GetInstance()->GetText("NetGameServer.chat.unknown"); HUDView::Message("%s> %s", name.data(), chat_msg.GetText().data()); } diff --git a/Stars45/NetUnitDlg.cpp b/Stars45/NetUnitDlg.cpp index f0a2b0a..61b9bcd 100644 --- a/Stars45/NetUnitDlg.cpp +++ b/Stars45/NetUnitDlg.cpp @@ -30,6 +30,7 @@ #include "NetUser.h" #include "NetChat.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "Video.h" #include "Keyboard.h" @@ -580,9 +581,9 @@ NetUnitDlg::OnBan(AWEvent* event) ConfirmDlg* confirm = manager->GetConfirmDlg(); if (confirm) { char msg[512]; - sprintf_s(msg, Game::GetInstance()->GetText("NetUnitDlg.are-you-sure").data(), u->Name().data()); + sprintf_s(msg, ContentBundle::GetInstance()->GetText("NetUnitDlg.are-you-sure").data(), u->Name().data()); confirm->SetMessage(msg); - confirm->SetTitle(Game::GetInstance()->GetText("NetUnitDlg.confirm-ban")); + confirm->SetTitle(ContentBundle::GetInstance()->GetText("NetUnitDlg.confirm-ban")); confirm->SetParentControl(btn_ban); manager->ShowConfirmDlg(); diff --git a/Stars45/Player.cpp b/Stars45/Player.cpp index 7648fb9..9ba5c35 100644 --- a/Stars45/Player.cpp +++ b/Stars45/Player.cpp @@ -30,6 +30,7 @@ #include "FormatUtil.h" #include "Bitmap.h" #include "Game.h" +#include "ContentBundle.h" // +-------------------------------------------------------------------+ @@ -1380,24 +1381,24 @@ Player::LoadAwardTables() if (pdef) { if (pdef->name()->value() == ("name")) { GetDefText(award->name, pdef, filename); - award->name = Game::GetInstance()->GetText(award->name); + award->name = ContentBundle::GetInstance()->GetText(award->name); } else if (pdef->name()->value() == ("abrv")) { GetDefText(award->abrv, pdef, filename); - award->abrv = Game::GetInstance()->GetText(award->abrv); + award->abrv = ContentBundle::GetInstance()->GetText(award->abrv); } else if (pdef->name()->value() == ("desc")) { GetDefText(award->desc, pdef, filename); if (award->desc.length() <= 40) - award->desc = Game::GetInstance()->GetText(award->desc); + award->desc = ContentBundle::GetInstance()->GetText(award->desc); } else if (pdef->name()->value() == ("award")) { GetDefText(award->grant, pdef, filename); if (award->grant.length() <= 40) - award->grant = Game::GetInstance()->GetText(award->grant); + award->grant = ContentBundle::GetInstance()->GetText(award->grant); } else if (pdef->name()->value() == ("desc_sound")) diff --git a/Stars45/PlayerDlg.cpp b/Stars45/PlayerDlg.cpp index f06fc37..1c09161 100644 --- a/Stars45/PlayerDlg.cpp +++ b/Stars45/PlayerDlg.cpp @@ -21,6 +21,7 @@ #include "FormatUtil.h" #include "Game.h" +#include "ContentBundle.h" #include "DataLoader.h" #include "Button.h" #include "ListBox.h" @@ -294,10 +295,10 @@ PlayerDlg::OnDel(AWEvent* event) ConfirmDlg* confirm = manager->GetConfirmDlg(); if (confirm) { char msg[256]; - sprintf_s(msg, Game::GetInstance()->GetText("PlayerDlg.are-you-sure").data(), + sprintf_s(msg, ContentBundle::GetInstance()->GetText("PlayerDlg.are-you-sure").data(), Player::GetCurrentPlayer()->Name().data()); confirm->SetMessage(msg); - confirm->SetTitle(Game::GetInstance()->GetText("PlayerDlg.confirm-delete")); + confirm->SetTitle(ContentBundle::GetInstance()->GetText("PlayerDlg.confirm-delete")); confirm->SetParentControl(btn_del); manager->ShowConfirmDlg(); diff --git a/Stars45/Power.cpp b/Stars45/Power.cpp index a4b95c1..e3dfebe 100644 --- a/Stars45/Power.cpp +++ b/Stars45/Power.cpp @@ -17,6 +17,7 @@ #include "NetUtil.h" #include "Game.h" +#include "ContentBundle.h" // +----------------------------------------------------------------------+ @@ -33,8 +34,8 @@ PowerSource::PowerSource(SUBTYPE s, double max_out, double f_ratio) max_output((float) max_out), fuel_ratio((float) f_ratio), route_changed(false), requested_power_level(1.0f) { - name = Game::GetInstance()->GetText(source_type[s]); - abrv = Game::GetInstance()->GetText(Text(source_type[s]) + ".abrv"); + name = ContentBundle::GetInstance()->GetText(source_type[s]); + abrv = ContentBundle::GetInstance()->GetText(Text(source_type[s]) + ".abrv"); if (fuel_ratio < 1) { switch (subtype) { // enough to last for [n] hours at full power diff --git a/Stars45/QuantumDrive.cpp b/Stars45/QuantumDrive.cpp index 96d37d6..a6785d2 100644 --- a/Stars45/QuantumDrive.cpp +++ b/Stars45/QuantumDrive.cpp @@ -21,6 +21,7 @@ #include "StarSystem.h" #include "Game.h" +#include "ContentBundle.h" #include "Random.h" // +----------------------------------------------------------------------+ @@ -33,8 +34,8 @@ QuantumDrive::QuantumDrive(SUBTYPE s, double cap, double rate) : System(DRIVE, s, "Quantum", drive_value, (float) cap, (float) cap, (float) rate), dst_rgn(0), active_state(ACTIVE_READY), warp_fov(1), jump_time(0), countdown(5) { - name = Game::GetInstance()->GetText("sys.quantum"); - abrv = Game::GetInstance()->GetText("sys.quantum.abrv"); + name = ContentBundle::GetInstance()->GetText("sys.quantum"); + abrv = ContentBundle::GetInstance()->GetText("sys.quantum.abrv"); emcon_power[0] = 0; emcon_power[1] = 0; diff --git a/Stars45/QuantumView.cpp b/Stars45/QuantumView.cpp index ae6e869..67d67d2 100644 --- a/Stars45/QuantumView.cpp +++ b/Stars45/QuantumView.cpp @@ -32,6 +32,7 @@ #include "Keyboard.h" #include "Mouse.h" #include "Game.h" +#include "ContentBundle.h" #include "Menu.h" static Color hud_color = Color::Black; @@ -50,7 +51,7 @@ QuantumView::Initialize() static int initialized = 0; if (initialized) return; - quantum_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("QuantumView.menu")); + quantum_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("QuantumView.menu")); initialized = 1; } diff --git a/Stars45/QuitView.cpp b/Stars45/QuitView.cpp index 4d02836..7cf6fe4 100644 --- a/Stars45/QuitView.cpp +++ b/Stars45/QuitView.cpp @@ -36,6 +36,7 @@ #include "Mouse.h" #include "MouseController.h" #include "Game.h" +#include "ContentBundle.h" #include "Menu.h" // +====================================================================+ @@ -228,8 +229,8 @@ QuitView::CanAccept() Ship* player_ship = sim->GetPlayerShip(); if (player_ship->MissionClock() < 60000) { - RadioView::Message(Game::GetInstance()->GetText("QuitView.too-soon")); - RadioView::Message(Game::GetInstance()->GetText("QuitView.abort")); + RadioView::Message(ContentBundle::GetInstance()->GetText("QuitView.too-soon")); + RadioView::Message(ContentBundle::GetInstance()->GetText("QuitView.abort")); return false; } @@ -240,8 +241,8 @@ QuitView::CanAccept() int ciff = c->GetIFF(player_ship); if (c->Threat(player_ship)) { - RadioView::Message(Game::GetInstance()->GetText("QuitView.threats-present")); - RadioView::Message(Game::GetInstance()->GetText("QuitView.abort")); + RadioView::Message(ContentBundle::GetInstance()->GetText("QuitView.threats-present")); + RadioView::Message(ContentBundle::GetInstance()->GetText("QuitView.abort")); return false; } @@ -250,14 +251,14 @@ QuitView::CanAccept() double dist = delta.length(); if (cship->IsDropship() && dist < 50e3) { - RadioView::Message(Game::GetInstance()->GetText("QuitView.threats-present")); - RadioView::Message(Game::GetInstance()->GetText("QuitView.abort")); + RadioView::Message(ContentBundle::GetInstance()->GetText("QuitView.threats-present")); + RadioView::Message(ContentBundle::GetInstance()->GetText("QuitView.abort")); return false; } else if (cship->IsStarship() && dist < 100e3) { - RadioView::Message(Game::GetInstance()->GetText("QuitView.threats-present")); - RadioView::Message(Game::GetInstance()->GetText("QuitView.abort")); + RadioView::Message(ContentBundle::GetInstance()->GetText("QuitView.threats-present")); + RadioView::Message(ContentBundle::GetInstance()->GetText("QuitView.abort")); return false; } } diff --git a/Stars45/RadioHandler.cpp b/Stars45/RadioHandler.cpp index e7ff7f8..00dadce 100644 --- a/Stars45/RadioHandler.cpp +++ b/Stars45/RadioHandler.cpp @@ -34,6 +34,7 @@ #include "Text.h" #include "Game.h" +#include "ContentBundle.h" // +----------------------------------------------------------------------+ @@ -393,16 +394,16 @@ RadioHandler::Inbound(RadioMessage* msg, Ship* ship) if (!deck || !same_rgn || squadron < 0 || slot < 0) { RadioMessage* wave_off = new(__FILE__,__LINE__) RadioMessage(inbound, ship, RadioMessage::NACK); if (!hangar) - wave_off->SetInfo(Game::GetInstance()->GetText("RadioHandler.no-hangar")); + wave_off->SetInfo(ContentBundle::GetInstance()->GetText("RadioHandler.no-hangar")); else if (!same_rgn) { char info[256]; - sprintf_s(info, Game::GetInstance()->GetText("RadioHandler.too-far-away").data(), ship->GetRegion()->Name()); + sprintf_s(info, ContentBundle::GetInstance()->GetText("RadioHandler.too-far-away").data(), ship->GetRegion()->Name()); wave_off->SetInfo(info); } else - wave_off->SetInfo(Game::GetInstance()->GetText("RadioHandler.all-full")); + wave_off->SetInfo(ContentBundle::GetInstance()->GetText("RadioHandler.all-full")); RadioTraffic::Transmit(wave_off); return false; @@ -425,12 +426,12 @@ RadioHandler::Inbound(RadioMessage* msg, Ship* ship) if (inbound_slot->Cleared()) { char info[256]; - sprintf_s(info, Game::GetInstance()->GetText("RadioHandler.cleared").data(), deck->Name()); + sprintf_s(info, ContentBundle::GetInstance()->GetText("RadioHandler.cleared").data(), deck->Name()); approach->SetInfo(info); } else if (sequence) { char info[256]; - sprintf_s(info, Game::GetInstance()->GetText("RadioHandler.sequenced").data(), sequence, deck->Name()); + sprintf_s(info, ContentBundle::GetInstance()->GetText("RadioHandler.sequenced").data(), sequence, deck->Name()); approach->SetInfo(info); } @@ -521,7 +522,7 @@ RadioHandler::Support(RadioMessage* msg, Ship* ship) escort->TargetList().append(msg->Sender()); RadioTraffic::Transmit(escort); - Text ok = Game::GetInstance()->GetText("RadioHandler.help-enroute"); + Text ok = ContentBundle::GetInstance()->GetText("RadioHandler.help-enroute"); Ship* sender = (Ship*) msg->Sender(); // cast-away const RadioMessage* response = new(__FILE__,__LINE__) RadioMessage(sender, ship, RadioMessage::ACK); response->SetInfo(ok); @@ -530,7 +531,7 @@ RadioHandler::Support(RadioMessage* msg, Ship* ship) // no help in sight: else { - Text nope = Game::GetInstance()->GetText("RadioHandler.no-help-for-you"); + Text nope = ContentBundle::GetInstance()->GetText("RadioHandler.no-help-for-you"); Ship* sender = (Ship*) msg->Sender(); // cast-away const RadioMessage* response = new(__FILE__,__LINE__) RadioMessage(sender, ship, RadioMessage::NACK); response->SetInfo(nope); diff --git a/Stars45/RadioTraffic.cpp b/Stars45/RadioTraffic.cpp index 2ce5acb..782885c 100644 --- a/Stars45/RadioTraffic.cpp +++ b/Stars45/RadioTraffic.cpp @@ -25,6 +25,7 @@ #include "NetData.h" #include "Game.h" +#include "ContentBundle.h" #include "Text.h" // +----------------------------------------------------------------------+ @@ -159,7 +160,7 @@ RadioTraffic::TranslateVox(const char* phrase) Text vox = "vox."; vox += phrase; vox.toLower(); - vox = Game::GetInstance()->GetText(vox); + vox = ContentBundle::GetInstance()->GetText(vox); if (vox.contains("vox.")) // failed to translate return Text(phrase); // return the original text diff --git a/Stars45/RadioView.cpp b/Stars45/RadioView.cpp index 9452e34..feb696a 100644 --- a/Stars45/RadioView.cpp +++ b/Stars45/RadioView.cpp @@ -34,6 +34,7 @@ #include "Keyboard.h" #include "Mouse.h" #include "Game.h" +#include "ContentBundle.h" #include "Menu.h" static Color hud_color = Color::Black; @@ -67,59 +68,59 @@ RadioView::Initialize() static int initialized = 0; if (initialized) return; - target_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.TARGET")); - target_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.attack"), RadioMessage::ATTACK); - target_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.bracket"), RadioMessage::BRACKET); - target_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.escort"), RadioMessage::ESCORT); - - combat_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.COMBAT")); - combat_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.cover"), RadioMessage::COVER_ME); - combat_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.break-attack"), RadioMessage::WEP_FREE); - combat_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.form-up"), RadioMessage::FORM_UP); - - formation_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.FORMATION")); - formation_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.diamond"), RadioMessage::GO_DIAMOND); - formation_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.spread"), RadioMessage::GO_SPREAD); - formation_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.box"), RadioMessage::GO_BOX); - formation_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.trail"), RadioMessage::GO_TRAIL); - - sensors_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.SENSORS")); - sensors_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.emcon-1"), RadioMessage::GO_EMCON1); - sensors_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.emcon-2"), RadioMessage::GO_EMCON2); - sensors_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.emcon-3"), RadioMessage::GO_EMCON3); - sensors_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.probe"), RadioMessage::LAUNCH_PROBE); - - mission_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.MISSION")); - mission_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.skip-navpt"), RadioMessage::SKIP_NAVPOINT); - mission_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.resume"), RadioMessage::RESUME_MISSION); - mission_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.rtb"), RadioMessage::RTB); - - wing_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.WINGMAN")); - wing_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.target"), target_menu); - wing_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.combat"), combat_menu); - wing_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.formation"), formation_menu); - wing_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.mission"), mission_menu); - wing_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.sensors"), sensors_menu); - - elem_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.ELEMENT")); - elem_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.target"), target_menu); - elem_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.combat"), combat_menu); - elem_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.formation"), formation_menu); - elem_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.mission"), mission_menu); - elem_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.sensors"), sensors_menu); - - control_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.CONTROL")); - control_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.picture"), RadioMessage::REQUEST_PICTURE); - control_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.backup"), RadioMessage::REQUEST_SUPPORT); - control_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.call-inbound"), RadioMessage::CALL_INBOUND); - control_menu->AddItem(Game::GetInstance()->GetText("RadioView.item.call-finals"), RadioMessage::CALL_FINALS); - - fighter_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.RADIO")); - fighter_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.wingman"), wing_menu); - fighter_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.element"), elem_menu); - fighter_menu->AddMenu(Game::GetInstance()->GetText("RadioView.item.control"), control_menu); - - starship_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("RadioView.menu.RADIO")); + target_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.TARGET")); + target_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.attack"), RadioMessage::ATTACK); + target_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.bracket"), RadioMessage::BRACKET); + target_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.escort"), RadioMessage::ESCORT); + + combat_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.COMBAT")); + combat_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.cover"), RadioMessage::COVER_ME); + combat_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.break-attack"), RadioMessage::WEP_FREE); + combat_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.form-up"), RadioMessage::FORM_UP); + + formation_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.FORMATION")); + formation_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.diamond"), RadioMessage::GO_DIAMOND); + formation_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.spread"), RadioMessage::GO_SPREAD); + formation_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.box"), RadioMessage::GO_BOX); + formation_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.trail"), RadioMessage::GO_TRAIL); + + sensors_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.SENSORS")); + sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.emcon-1"), RadioMessage::GO_EMCON1); + sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.emcon-2"), RadioMessage::GO_EMCON2); + sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.emcon-3"), RadioMessage::GO_EMCON3); + sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.probe"), RadioMessage::LAUNCH_PROBE); + + mission_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.MISSION")); + mission_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.skip-navpt"), RadioMessage::SKIP_NAVPOINT); + mission_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.resume"), RadioMessage::RESUME_MISSION); + mission_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.rtb"), RadioMessage::RTB); + + wing_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.WINGMAN")); + wing_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.target"), target_menu); + wing_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.combat"), combat_menu); + wing_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.formation"), formation_menu); + wing_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.mission"), mission_menu); + wing_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.sensors"), sensors_menu); + + elem_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.ELEMENT")); + elem_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.target"), target_menu); + elem_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.combat"), combat_menu); + elem_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.formation"), formation_menu); + elem_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.mission"), mission_menu); + elem_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.sensors"), sensors_menu); + + control_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.CONTROL")); + control_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.picture"), RadioMessage::REQUEST_PICTURE); + control_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.backup"), RadioMessage::REQUEST_SUPPORT); + control_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.call-inbound"), RadioMessage::CALL_INBOUND); + control_menu->AddItem(ContentBundle::GetInstance()->GetText("RadioView.item.call-finals"), RadioMessage::CALL_FINALS); + + fighter_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.RADIO")); + fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.wingman"), wing_menu); + fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.element"), elem_menu); + fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("RadioView.item.control"), control_menu); + + starship_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("RadioView.menu.RADIO")); initialized = 1; } @@ -369,7 +370,7 @@ RadioView::SendRadioMessage(Ship* ship, MenuItem* item) dst_elem = 0; } - else if (history.Find(Game::GetInstance()->GetText("RadioView.menu.WINGMAN"))) { // wingman menu + else if (history.Find(ContentBundle::GetInstance()->GetText("RadioView.menu.WINGMAN"))) { // wingman menu int index = ship->GetElementIndex(); int wing = 0; @@ -393,7 +394,7 @@ RadioView::SendRadioMessage(Ship* ship, MenuItem* item) } } - else if (history.Find(Game::GetInstance()->GetText("RadioView.menu.ELEMENT"))) { // element menu + else if (history.Find(ContentBundle::GetInstance()->GetText("RadioView.menu.ELEMENT"))) { // element menu RadioMessage* msg = new(__FILE__,__LINE__) RadioMessage(elem, ship, item->GetData()); if (TargetRequired(item)) @@ -402,7 +403,7 @@ RadioView::SendRadioMessage(Ship* ship, MenuItem* item) RadioTraffic::Transmit(msg); } - else if (history.Find(Game::GetInstance()->GetText("RadioView.menu.CONTROL"))) { // control menu + else if (history.Find(ContentBundle::GetInstance()->GetText("RadioView.menu.CONTROL"))) { // control menu RadioMessage* msg = 0; Ship* controller = ship->GetController(); @@ -571,7 +572,7 @@ RadioView::GetRadioMenu(Ship* s) } else { strcat_s(text, " "); - strcat_s(text, Game::GetInstance()->GetText("RadioView.item.not-avail").data()); + strcat_s(text, ContentBundle::GetInstance()->GetText("RadioView.item.not-avail").data()); starship_menu->AddItem(text, 0, false); } } @@ -581,7 +582,7 @@ RadioView::GetRadioMenu(Ship* s) if (num_pages > 1) { char text[64]; - sprintf_s(text, Game::GetInstance()->GetText("RadioView.item.next-page").data(), starship_page + 1, num_pages); + sprintf_s(text, ContentBundle::GetInstance()->GetText("RadioView.item.next-page").data(), starship_page + 1, num_pages); starship_menu->AddItem(text); } diff --git a/Stars45/Sensor.cpp b/Stars45/Sensor.cpp index ea705e9..3a0f15e 100644 --- a/Stars45/Sensor.cpp +++ b/Stars45/Sensor.cpp @@ -25,6 +25,7 @@ #include "CombatUnit.h" #include "Game.h" +#include "ContentBundle.h" // +----------------------------------------------------------------------+ @@ -37,8 +38,8 @@ Sensor::Sensor() mode(STD), target(0), nsettings(0), range_index(0) { - name = Game::GetInstance()->GetText("sys.sensor"); - abrv = Game::GetInstance()->GetText("sys.sensor.abrv"); + name = ContentBundle::GetInstance()->GetText("sys.sensor"); + abrv = ContentBundle::GetInstance()->GetText("sys.sensor.abrv"); SetMode(mode); power_flags = POWER_WATTS; diff --git a/Stars45/Shield.cpp b/Stars45/Shield.cpp index e330ba4..c287e7b 100644 --- a/Stars45/Shield.cpp +++ b/Stars45/Shield.cpp @@ -17,6 +17,7 @@ #include "WeaponDesign.h" #include "Game.h" +#include "ContentBundle.h" // +----------------------------------------------------------------------+ @@ -38,8 +39,8 @@ Shield::Shield(SUBTYPE shield_type) shield_cutoff(0.0f), shield_capacitor(false), shield_bubble(false), deflection_cost(1.0f), shield_curve(0.05f) { - name = Game::GetInstance()->GetText(shield_name[shield_type]); - abrv = Game::GetInstance()->GetText("sys.shield.abrv"); + name = ContentBundle::GetInstance()->GetText(shield_name[shield_type]); + abrv = ContentBundle::GetInstance()->GetText("sys.shield.abrv"); power_flags = POWER_WATTS | POWER_CRITICAL; energy = 0.0f; diff --git a/Stars45/Ship.cpp b/Stars45/Ship.cpp index 89b5dda..61765fd 100644 --- a/Stars45/Ship.cpp +++ b/Stars45/Ship.cpp @@ -73,6 +73,7 @@ #include "Joystick.h" #include "Bolt.h" #include "Game.h" +#include "ContentBundle.h" #include "Solid.h" #include "Shadow.h" #include "Skin.h" @@ -4049,17 +4050,17 @@ Ship::SetFLCSMode(int mode) if (dir && dir->Type() < SteerAI::SEEKER) { switch (flcs_mode) { - case FLCS_MANUAL: director_info = Game::GetInstance()->GetText("flcs.manual"); break; - case FLCS_AUTO: director_info = Game::GetInstance()->GetText("flcs.auto"); break; - case FLCS_HELM: director_info = Game::GetInstance()->GetText("flcs.helm"); break; - default: director_info = Game::GetInstance()->GetText("flcs.fault"); break; + case FLCS_MANUAL: director_info = ContentBundle::GetInstance()->GetText("flcs.manual"); break; + case FLCS_AUTO: director_info = ContentBundle::GetInstance()->GetText("flcs.auto"); break; + case FLCS_HELM: director_info = ContentBundle::GetInstance()->GetText("flcs.helm"); break; + default: director_info = ContentBundle::GetInstance()->GetText("flcs.fault"); break; } if (!flcs || !flcs->IsPowerOn()) - director_info = Game::GetInstance()->GetText("flcs.offline"); + director_info = ContentBundle::GetInstance()->GetText("flcs.offline"); else if (IsAirborne()) - director_info = Game::GetInstance()->GetText("flcs.atmospheric"); + director_info = ContentBundle::GetInstance()->GetText("flcs.atmospheric"); } if (flcs) @@ -5018,7 +5019,7 @@ Ship::SetControls(MotionController* m) Keyboard::FlushKeys(); m->Acquire(); dir = new(__FILE__,__LINE__) ShipCtrl(this, m); - director_info = Game::GetInstance()->GetText("flcs.auto"); + director_info = ContentBundle::GetInstance()->GetText("flcs.auto"); } else if (GetIFF() < 100) { if (IsStatic()) diff --git a/Stars45/ShipAI.cpp b/Stars45/ShipAI.cpp index 71c1abe..892f41e 100644 --- a/Stars45/ShipAI.cpp +++ b/Stars45/ShipAI.cpp @@ -36,6 +36,7 @@ #include "Asteroid.h" #include "Game.h" +#include "ContentBundle.h" #include "Random.h" // +----------------------------------------------------------------------+ @@ -383,7 +384,7 @@ ShipAI::FindObjective() // if not the element leader, stay in formation: if (form && element_index > 1) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.formation")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.formation")); if (navpt && navpt->Action() == Instruction::LAUNCH) { FindObjectiveNavPoint(); @@ -411,7 +412,7 @@ ShipAI::FindObjective() if (support) { double d_support = Point(support->Location() - ship->Location()).length(); if (d_support > 35e3) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.regroup")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.regroup")); FindObjectiveTarget(support); objective = Transform(obj_w); return; @@ -420,7 +421,7 @@ ShipAI::FindObjective() // run away: else if (threat != target) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.retreat")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.retreat")); obj_w = ship->Location() + Point(ship->Location() - threat->Location()) * 100; objective = Transform(obj_w); return; @@ -429,31 +430,31 @@ ShipAI::FindObjective() // normal processing: if (target) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-target")); FindObjectiveTarget(target); objective = AimTransform(obj_w); } else if (patrol) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.patrol")); FindObjectivePatrol(); objective = Transform(obj_w); } else if (ward) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-ward")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-ward")); FindObjectiveFormation(); objective = Transform(obj_w); } else if (navpt && form) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-navpt")); FindObjectiveNavPoint(); objective = Transform(obj_w); } else if (rumor) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.search")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.search")); FindObjectiveTarget(rumor); objective = Transform(obj_w); } @@ -892,11 +893,11 @@ ShipAI::Navigator() ship->SetFLCSMode(Ship::FLCS_HELM); if (target) - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-target")); else if (rumor) - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-rumor")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-rumor")); else - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.none")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.none")); Accumulate(AvoidCollision()); Accumulate(AvoidTerrain()); @@ -1119,7 +1120,7 @@ ShipAI::AvoidCollision() avoid = Avoid(obstacle, (float) (ship->Radius() + other->Radius() + avoid_dist * 0.9)); avoid.brake = brake; - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.avoid-collision")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.avoid-collision")); } } @@ -1260,7 +1261,7 @@ ShipAI::AvoidCloseObject(SimObject* obj) Steer avoid = Flee(obstacle); avoid.brake = 0.3; - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.avoid-collision")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.avoid-collision")); return avoid; } diff --git a/Stars45/ShipDesign.cpp b/Stars45/ShipDesign.cpp index 55e8d41..f110f0f 100644 --- a/Stars45/ShipDesign.cpp +++ b/Stars45/ShipDesign.cpp @@ -34,6 +34,7 @@ #include "Component.h" #include "Game.h" +#include "ContentBundle.h" #include "Solid.h" #include "Skin.h" #include "Sprite.h" @@ -1513,7 +1514,7 @@ ShipDesign::ParseShip(TermDef* def) } if (description.length()) - description = Game::GetInstance()->GetText(description); + description = ContentBundle::GetInstance()->GetText(description); } // +--------------------------------------------------------------------+ diff --git a/Stars45/Sim.cpp b/Stars45/Sim.cpp index 85183f4..cd2fb87 100644 --- a/Stars45/Sim.cpp +++ b/Stars45/Sim.cpp @@ -65,6 +65,7 @@ #include "NetData.h" #include "Game.h" +#include "ContentBundle.h" #include "Sound.h" #include "Bolt.h" #include "Solid.h" @@ -2268,7 +2269,7 @@ SimRegion::SimRegion(Sim* s, OrbitalRegion* r) } } else { - name = Game::GetInstance()->GetText("Unknown"); + name = ContentBundle::GetInstance()->GetText("Unknown"); } } @@ -3064,7 +3065,7 @@ SimRegion::CollideShips() if (ship->Integrity() < 1.0f) { if (!kill_list.contains(ship)) { ShipStats* r = ShipStats::Find(ship->Name()); - if (r) r->AddEvent(SimEvent::COLLIDE, Game::GetInstance()->GetText("DEBRIS")); + if (r) r->AddEvent(SimEvent::COLLIDE, ContentBundle::GetInstance()->GetText("DEBRIS")); kill_list.insert(ship); } @@ -3088,7 +3089,7 @@ SimRegion::CollideShips() if (ship->Integrity() < 1.0f) { if (!kill_list.contains(ship)) { ShipStats* r = ShipStats::Find(ship->Name()); - if (r) r->AddEvent(SimEvent::COLLIDE, Game::GetInstance()->GetText("ASTEROID")); + if (r) r->AddEvent(SimEvent::COLLIDE, ContentBundle::GetInstance()->GetText("ASTEROID")); kill_list.insert(ship); } diff --git a/Stars45/SimEvent.cpp b/Stars45/SimEvent.cpp index 801d75a..60d254d 100644 --- a/Stars45/SimEvent.cpp +++ b/Stars45/SimEvent.cpp @@ -15,6 +15,7 @@ #include "SimEvent.h" #include "Sim.h" #include "Game.h" +#include "ContentBundle.h" // +====================================================================+ @@ -73,26 +74,26 @@ Text SimEvent::GetEventDesc() const { switch (event) { - case LAUNCH: return Game::GetInstance()->GetText("sim.event.Launch"); - case DOCK: return Game::GetInstance()->GetText("sim.event.Dock"); - case LAND: return Game::GetInstance()->GetText("sim.event.Land"); - case EJECT: return Game::GetInstance()->GetText("sim.event.Eject"); - case CRASH: return Game::GetInstance()->GetText("sim.event.Crash"); - case COLLIDE: return Game::GetInstance()->GetText("sim.event.Collision With"); - case DESTROYED: return Game::GetInstance()->GetText("sim.event.Destroyed By"); - case MAKE_ORBIT: return Game::GetInstance()->GetText("sim.event.Make Orbit"); - case BREAK_ORBIT: return Game::GetInstance()->GetText("sim.event.Break Orbit"); - case QUANTUM_JUMP: return Game::GetInstance()->GetText("sim.event.Quantum Jump"); - case LAUNCH_SHIP: return Game::GetInstance()->GetText("sim.event.Launch Ship"); - case RECOVER_SHIP: return Game::GetInstance()->GetText("sim.event.Recover Ship"); - case FIRE_GUNS: return Game::GetInstance()->GetText("sim.event.Fire Guns"); - case FIRE_MISSILE: return Game::GetInstance()->GetText("sim.event.Fire Missile"); - case DROP_DECOY: return Game::GetInstance()->GetText("sim.event.Drop Decoy"); - case GUNS_KILL: return Game::GetInstance()->GetText("sim.event.Guns Kill"); - case MISSILE_KILL: return Game::GetInstance()->GetText("sim.event.Missile Kill"); - case LAUNCH_PROBE: return Game::GetInstance()->GetText("sim.event.Launch Probe"); - case SCAN_TARGET: return Game::GetInstance()->GetText("sim.event.Scan Target"); - default: return Game::GetInstance()->GetText("sim.event.no event"); + case LAUNCH: return ContentBundle::GetInstance()->GetText("sim.event.Launch"); + case DOCK: return ContentBundle::GetInstance()->GetText("sim.event.Dock"); + case LAND: return ContentBundle::GetInstance()->GetText("sim.event.Land"); + case EJECT: return ContentBundle::GetInstance()->GetText("sim.event.Eject"); + case CRASH: return ContentBundle::GetInstance()->GetText("sim.event.Crash"); + case COLLIDE: return ContentBundle::GetInstance()->GetText("sim.event.Collision With"); + case DESTROYED: return ContentBundle::GetInstance()->GetText("sim.event.Destroyed By"); + case MAKE_ORBIT: return ContentBundle::GetInstance()->GetText("sim.event.Make Orbit"); + case BREAK_ORBIT: return ContentBundle::GetInstance()->GetText("sim.event.Break Orbit"); + case QUANTUM_JUMP: return ContentBundle::GetInstance()->GetText("sim.event.Quantum Jump"); + case LAUNCH_SHIP: return ContentBundle::GetInstance()->GetText("sim.event.Launch Ship"); + case RECOVER_SHIP: return ContentBundle::GetInstance()->GetText("sim.event.Recover Ship"); + case FIRE_GUNS: return ContentBundle::GetInstance()->GetText("sim.event.Fire Guns"); + case FIRE_MISSILE: return ContentBundle::GetInstance()->GetText("sim.event.Fire Missile"); + case DROP_DECOY: return ContentBundle::GetInstance()->GetText("sim.event.Drop Decoy"); + case GUNS_KILL: return ContentBundle::GetInstance()->GetText("sim.event.Guns Kill"); + case MISSILE_KILL: return ContentBundle::GetInstance()->GetText("sim.event.Missile Kill"); + case LAUNCH_PROBE: return ContentBundle::GetInstance()->GetText("sim.event.Launch Probe"); + case SCAN_TARGET: return ContentBundle::GetInstance()->GetText("sim.event.Scan Target"); + default: return ContentBundle::GetInstance()->GetText("sim.event.no event"); } } @@ -104,7 +105,7 @@ cmd_points(0), gun_shots(0), gun_hits(0), missile_shots(0), missile_hits(0), combat_group(0), combat_unit(0), player(false), ship_class(0), elem_index(-1) { if (!n || !n[0]) - name = Game::GetInstance()->GetText("[unknown]"); + name = ContentBundle::GetInstance()->GetText("[unknown]"); } ShipStats::~ShipStats() diff --git a/Stars45/StarServer.cpp b/Stars45/StarServer.cpp index 97a0721..c972a41 100644 --- a/Stars45/StarServer.cpp +++ b/Stars45/StarServer.cpp @@ -44,6 +44,7 @@ #include "Token.h" #include "MachineInfo.h" #include "Game.h" +#include "ContentBundle.h" #include "Keyboard.h" #include "Mouse.h" #include "EventDispatch.h" @@ -410,7 +411,7 @@ StarServer::OnPaint() Text txt_title = title_text; Text txt_mode; - Text txt_users = Game::GetInstance()->GetText("server.no-users"); + Text txt_users = ContentBundle::GetInstance()->GetText("server.no-users"); char buf[256]; txt_title += " "; @@ -419,35 +420,35 @@ StarServer::OnPaint() switch (game_mode) { case LOAD_MODE: case MENU_MODE: - txt_mode = Game::GetInstance()->GetText("server.mode.lobby"); + txt_mode = ContentBundle::GetInstance()->GetText("server.mode.lobby"); if (lobby_server) { - sprintf_s(buf, Game::GetInstance()->GetText("server.users").data(), lobby_server->NumUsers()); + sprintf_s(buf, ContentBundle::GetInstance()->GetText("server.users").data(), lobby_server->NumUsers()); txt_users = buf; } break; case PLAY_MODE: - txt_mode = Game::GetInstance()->GetText("server.mode.active"); + txt_mode = ContentBundle::GetInstance()->GetText("server.mode.active"); if (lobby_server) { - sprintf_s(buf, Game::GetInstance()->GetText("server.users-and-players").data(), lobby_server->NumUsers(), NetGame::NumPlayers()); + sprintf_s(buf, ContentBundle::GetInstance()->GetText("server.users-and-players").data(), lobby_server->NumUsers(), NetGame::NumPlayers()); } else { - sprintf_s(buf, Game::GetInstance()->GetText("server.players").data(), NetGame::NumPlayers()); + sprintf_s(buf, ContentBundle::GetInstance()->GetText("server.players").data(), NetGame::NumPlayers()); } txt_users = buf; break; default: - txt_mode = Game::GetInstance()->GetText("server.mode.other"); + txt_mode = ContentBundle::GetInstance()->GetText("server.mode.other"); break; } if (lobby_server && lobby_server->GetStatus() == NetServerInfo::PERSISTENT) - txt_mode += " " + Game::GetInstance()->GetText("server.alt.persistent"); + txt_mode += " " + ContentBundle::GetInstance()->GetText("server.alt.persistent"); if (paused) - txt_mode += " " + Game::GetInstance()->GetText("server.alt.paused"); + txt_mode += " " + ContentBundle::GetInstance()->GetText("server.alt.paused"); TextOut(hdc, 4, 4, txt_title, txt_title.length()); TextOut(hdc, 4, 22, txt_mode, txt_mode.length()); @@ -456,7 +457,7 @@ StarServer::OnPaint() Sim* sim = Sim::GetSim(); if (sim && sim->GetMission()) { Mission* mission = sim->GetMission(); - Text txt_msn = Game::GetInstance()->GetText("server.mission"); + Text txt_msn = ContentBundle::GetInstance()->GetText("server.mission"); txt_msn += mission->Name(); TextOut(hdc, 4, 58, txt_msn, txt_msn.length()); } diff --git a/Stars45/Starshatter.cpp b/Stars45/Starshatter.cpp index 59ad3fd..7326128 100644 --- a/Stars45/Starshatter.cpp +++ b/Stars45/Starshatter.cpp @@ -84,6 +84,7 @@ #include "MachineInfo.h" #include "Game.h" +#include "ContentBundle.h" #include "VideoFactory.h" #include "Screen.h" #include "Window.h" @@ -567,7 +568,7 @@ Starshatter::OpenTacticalReference() LoadDlg* load_dlg = menuscreen->GetLoadDlg(); if (load_dlg && load_dlg->IsShown()) { - load_activity = Game::GetInstance()->GetText("Starshatter.load.tac-ref"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.tac-ref"); load_progress = 1; catalog_index = 0; } @@ -608,14 +609,14 @@ Starshatter::SetGameMode(int m) if (m == CLOD_MODE || m == PREP_MODE || m == LOAD_MODE) { load_step = 0; load_progress = 0; - load_activity = Game::GetInstance()->GetText("Starshatter.load.general"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.general"); paused = true; } else if (m == CMPN_MODE) { load_step = 0; load_progress = 100; - load_activity = Game::GetInstance()->GetText("Starshatter.load.complete"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.complete"); paused = false; } @@ -624,7 +625,7 @@ Starshatter::SetGameMode(int m) player_ship = 0; load_progress = 100; - load_activity = Game::GetInstance()->GetText("Starshatter.load.complete"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.complete"); if (!world) { CreateWorld(); @@ -1159,7 +1160,7 @@ Starshatter::DoMenuScreenFrame() // load all ship designs in the standard catalog if (catalog_index < ShipDesign::StandardCatalogSize()) { ShipDesign::PreloadCatalog(catalog_index++); - load_activity = Game::GetInstance()->GetText("Starshatter.load.tac-ref"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.tac-ref"); if (load_progress < 95) load_progress++; @@ -1313,7 +1314,7 @@ Starshatter::DoLoadScreenFrame() switch (load_step) { case 0: - load_activity = Game::GetInstance()->GetText("Starshatter.load.campaign"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.campaign"); load_progress = 1; catalog_index = 0; break; @@ -1322,7 +1323,7 @@ Starshatter::DoLoadScreenFrame() // load all ship designs in the standard catalog if (catalog_index < ShipDesign::StandardCatalogSize()) { ShipDesign::PreloadCatalog(catalog_index++); - load_activity = Game::GetInstance()->GetText("Starshatter.load.campaign"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.campaign"); if (load_progress < 80) load_progress++; @@ -1330,7 +1331,7 @@ Starshatter::DoLoadScreenFrame() load_step = 0; // force return to current step on next frame } else { - load_activity = Game::GetInstance()->GetText("Starshatter.load.start"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.start"); load_progress = 80; } break; @@ -1345,7 +1346,7 @@ Starshatter::DoLoadScreenFrame() load_progress++; } else { - load_activity = Game::GetInstance()->GetText("Starshatter.load.ready"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.ready"); load_progress = 100; SetGameMode(CMPN_MODE); } @@ -1355,40 +1356,40 @@ Starshatter::DoLoadScreenFrame() else { switch (load_step) { case 0: - load_activity = Game::GetInstance()->GetText("Starshatter.load.drives"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.drives"); load_progress = 0; break; case 1: Drive::Initialize(); LandingGear::Initialize(); - load_activity = Game::GetInstance()->GetText("Starshatter.load.explosions"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.explosions"); load_progress = 5; break; case 2: Explosion::Initialize(); - load_activity = Game::GetInstance()->GetText("Starshatter.load.systems"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.systems"); load_progress = 10; break; case 3: FlightDeck::Initialize(); NavLight::Initialize(); - load_activity = Game::GetInstance()->GetText("Starshatter.load.ships"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.ships"); load_progress = 15; break; case 4: Ship::Initialize(); Shot::Initialize(); - load_activity = Game::GetInstance()->GetText("Starshatter.load.hud"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.hud"); load_progress = 20; break; case 5: MFD::Initialize(); - load_activity = Game::GetInstance()->GetText("Starshatter.load.menus"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.menus"); load_progress = 25; break; @@ -1400,7 +1401,7 @@ Starshatter::DoLoadScreenFrame() if (!gamescreen && game_mode != PREP_MODE) SetupGameScreen(); - load_activity = Game::GetInstance()->GetText("Starshatter.load.mission"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.mission"); load_progress = 65; break; @@ -1409,26 +1410,26 @@ Starshatter::DoLoadScreenFrame() if (Campaign::GetCampaign()) Campaign::GetCampaign()->GetMission(); SetGameMode(PLAN_MODE); - load_activity = Game::GetInstance()->GetText("Starshatter.load.loaded"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.loaded"); load_progress = 100; Button::PlaySound(4); } else { CreateWorld(); - load_activity = Game::GetInstance()->GetText("Starshatter.load.simulation"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.simulation"); load_progress = 75; } break; case 8: InstantiateMission(); - load_activity = Game::GetInstance()->GetText("Starshatter.load.viewscreen"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.viewscreen"); load_progress = 90; break; default: SetGameMode(PLAY_MODE); - load_activity = Game::GetInstance()->GetText("Starshatter.load.ready"); + load_activity = ContentBundle::GetInstance()->GetText("Starshatter.load.ready"); load_progress = 100; break; } diff --git a/Stars45/StarshipAI.cpp b/Stars45/StarshipAI.cpp index 19de0c6..3057f1d 100644 --- a/Stars45/StarshipAI.cpp +++ b/Stars45/StarshipAI.cpp @@ -30,6 +30,7 @@ #include "QuantumDrive.h" #include "Game.h" +#include "ContentBundle.h" #include "Random.h" // +----------------------------------------------------------------------+ @@ -101,7 +102,7 @@ StarshipAI::FindObjective() // if not the element leader, stay in formation: if (form && element_index > 1) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.formation")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.formation")); if (navpt && navpt->Action() == Instruction::LAUNCH) { FindObjectiveNavPoint(); @@ -135,7 +136,7 @@ StarshipAI::FindObjective() if (support) { double d_support = Point(support->Location() - ship->Location()).length(); if (d_support > 35e3) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.regroup")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.regroup")); FindObjectiveTarget(support); objective = Transform(obj_w); return; @@ -144,7 +145,7 @@ StarshipAI::FindObjective() // run away: else if (threat && threat != target) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.retreat")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.retreat")); obj_w = ship->Location() + Point(ship->Location() - threat->Location()) * 100; objective = Transform(obj_w); return; @@ -154,44 +155,44 @@ StarshipAI::FindObjective() // weapons hold: if (hold) { if (navpt) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-navpt")); FindObjectiveNavPoint(); } else if (patrol) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.patrol")); FindObjectivePatrol(); } else { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.holding")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.holding")); objective = Point(); } } // normal processing: else if (target) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-target")); FindObjectiveTarget(target); } else if (patrol) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.patrol")); FindObjectivePatrol(); } else if (ward) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-ward")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-ward")); FindObjectiveFormation(); } else if (navpt) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-navpt")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-navpt")); FindObjectiveNavPoint(); } else if (rumor) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.search")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.search")); FindObjectiveTarget(rumor); } @@ -210,7 +211,7 @@ StarshipAI::Navigator() { // signifies this ship is a dead hulk: if (ship && ship->Design()->auto_roll < 0) { - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.dead")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.dead")); return; } @@ -226,11 +227,11 @@ StarshipAI::Navigator() if (!ship->GetDirectorInfo()) { if (target) - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-target")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-target")); else if (ship->GetWard()) - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.seek-ward")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.seek-ward")); else - ship->SetDirectorInfo(Game::GetInstance()->GetText("ai.patrol")); + ship->SetDirectorInfo(ContentBundle::GetInstance()->GetText("ai.patrol")); } if (farcaster && distance < 25e3) { diff --git a/Stars45/TacRefDlg.cpp b/Stars45/TacRefDlg.cpp index 66906ac..3a4e965 100644 --- a/Stars45/TacRefDlg.cpp +++ b/Stars45/TacRefDlg.cpp @@ -22,6 +22,7 @@ #include "WeaponGroup.h" #include "Game.h" +#include "ContentBundle.h" #include "EventDispatch.h" #include "Mouse.h" #include "Button.h" @@ -204,12 +205,12 @@ TacRefDlg::SelectShip(const ShipDesign* design) Text desc; char txt[256]; - sprintf_s(txt, "%s\t\t\t%s\n", Game::GetInstance()->GetText("tacref.type").data(), Ship::ClassName(design->type)); + sprintf_s(txt, "%s\t\t\t%s\n", ContentBundle::GetInstance()->GetText("tacref.type").data(), Ship::ClassName(design->type)); desc += txt; - sprintf_s(txt, "%s\t\t\t%s\n", Game::GetInstance()->GetText("tacref.class").data(), design->DisplayName()); + sprintf_s(txt, "%s\t\t\t%s\n", ContentBundle::GetInstance()->GetText("tacref.class").data(), design->DisplayName()); desc += txt; - desc += Game::GetInstance()->GetText("tacref.length"); + desc += ContentBundle::GetInstance()->GetText("tacref.length"); desc += "\t\t"; if (design->type < Ship::STATION) @@ -219,13 +220,13 @@ TacRefDlg::SelectShip(const ShipDesign* design) strcat_s(txt, " m\n"); desc += txt; - desc += Game::GetInstance()->GetText("tacref.mass"); + desc += ContentBundle::GetInstance()->GetText("tacref.mass"); desc += "\t\t\t"; FormatNumber(txt, design->mass); strcat_s(txt, " T\n"); desc += txt; - desc += Game::GetInstance()->GetText("tacref.hull"); + desc += ContentBundle::GetInstance()->GetText("tacref.hull"); desc += "\t\t\t"; FormatNumber(txt, design->integrity); @@ -233,7 +234,7 @@ TacRefDlg::SelectShip(const ShipDesign* design) desc += txt; if (design->weapons.size()) { - desc += Game::GetInstance()->GetText("tacref.weapons"); + desc += ContentBundle::GetInstance()->GetText("tacref.weapons"); WepGroup groups[8]; for (int w = 0; w < design->weapons.size(); w++) { @@ -273,7 +274,7 @@ TacRefDlg::SelectShip(const ShipDesign* design) txt_description->SetText(design->description); } else { - txt_description->SetText(Game::GetInstance()->GetText("tacref.mass")); + txt_description->SetText(ContentBundle::GetInstance()->GetText("tacref.mass")); } } } @@ -304,84 +305,84 @@ TacRefDlg::SelectWeapon(const WeaponDesign* design) Text desc; char txt[256]; - desc = Game::GetInstance()->GetText("tacref.name"); + desc = ContentBundle::GetInstance()->GetText("tacref.name"); desc += "\t"; desc += design->name; desc += "\n"; - desc += Game::GetInstance()->GetText("tacref.type"); + desc += ContentBundle::GetInstance()->GetText("tacref.type"); desc += "\t\t"; if (design->damage < 1) - desc += Game::GetInstance()->GetText("tacref.wep.other"); + desc += ContentBundle::GetInstance()->GetText("tacref.wep.other"); else if (design->beam) - desc += Game::GetInstance()->GetText("tacref.wep.beam"); + desc += ContentBundle::GetInstance()->GetText("tacref.wep.beam"); else if (design->primary) - desc += Game::GetInstance()->GetText("tacref.wep.bolt"); + desc += ContentBundle::GetInstance()->GetText("tacref.wep.bolt"); else if (design->drone) - desc += Game::GetInstance()->GetText("tacref.wep.drone"); + desc += ContentBundle::GetInstance()->GetText("tacref.wep.drone"); else if (design->guided) - desc += Game::GetInstance()->GetText("tacref.wep.guided"); + desc += ContentBundle::GetInstance()->GetText("tacref.wep.guided"); else - desc += Game::GetInstance()->GetText("tacref.wep.missile"); + desc += ContentBundle::GetInstance()->GetText("tacref.wep.missile"); if (design->turret_model && design->damage >= 1) { desc += " "; - desc += Game::GetInstance()->GetText("tacref.wep.turret"); + desc += ContentBundle::GetInstance()->GetText("tacref.wep.turret"); desc += "\n"; } else { desc += "\n"; } - desc += Game::GetInstance()->GetText("tacref.targets"); + desc += ContentBundle::GetInstance()->GetText("tacref.targets"); desc += "\t"; if ((design->target_type & Ship::DROPSHIPS) != 0) { if ((design->target_type & Ship::STARSHIPS) != 0) { if ((design->target_type & Ship::GROUND_UNITS) != 0) { - desc += Game::GetInstance()->GetText("tacref.targets.fsg"); + desc += ContentBundle::GetInstance()->GetText("tacref.targets.fsg"); } else { - desc += Game::GetInstance()->GetText("tacref.targets.fs"); + desc += ContentBundle::GetInstance()->GetText("tacref.targets.fs"); } } else { if ((design->target_type & Ship::GROUND_UNITS) != 0) { - desc += Game::GetInstance()->GetText("tacref.targets.fg"); + desc += ContentBundle::GetInstance()->GetText("tacref.targets.fg"); } else { - desc += Game::GetInstance()->GetText("tacref.targets.f"); + desc += ContentBundle::GetInstance()->GetText("tacref.targets.f"); } } } else if ((design->target_type & Ship::STARSHIPS) != 0) { if ((design->target_type & Ship::GROUND_UNITS) != 0) { - desc += Game::GetInstance()->GetText("tacref.targets.sg"); + desc += ContentBundle::GetInstance()->GetText("tacref.targets.sg"); } else { - desc += Game::GetInstance()->GetText("tacref.targets.s"); + desc += ContentBundle::GetInstance()->GetText("tacref.targets.s"); } } else if ((design->target_type & Ship::GROUND_UNITS) != 0) { - desc += Game::GetInstance()->GetText("tacref.targets.g"); + desc += ContentBundle::GetInstance()->GetText("tacref.targets.g"); } desc += "\n"; - desc += Game::GetInstance()->GetText("tacref.speed"); + desc += ContentBundle::GetInstance()->GetText("tacref.speed"); desc += "\t"; FormatNumber(txt, design->speed); desc += txt; desc += "m/s\n"; - desc += Game::GetInstance()->GetText("tacref.range"); + desc += ContentBundle::GetInstance()->GetText("tacref.range"); desc += "\t"; FormatNumber(txt, design->max_range); desc += txt; desc += "m\n"; - desc += Game::GetInstance()->GetText("tacref.damage"); + desc += ContentBundle::GetInstance()->GetText("tacref.damage"); desc += "\t"; if (design->damage > 0) { @@ -391,13 +392,13 @@ TacRefDlg::SelectWeapon(const WeaponDesign* design) desc += "/s"; } else { - desc += Game::GetInstance()->GetText("tacref.none"); + desc += ContentBundle::GetInstance()->GetText("tacref.none"); } desc += "\n"; if (!design->primary && design->damage > 0) { - desc += Game::GetInstance()->GetText("tacref.kill-radius"); + desc += ContentBundle::GetInstance()->GetText("tacref.kill-radius"); desc += "\t"; FormatNumber(txt, design->lethal_radius); desc += txt; @@ -413,7 +414,7 @@ TacRefDlg::SelectWeapon(const WeaponDesign* design) txt_description->SetText(design->description); } else { - txt_description->SetText(Game::GetInstance()->GetText("tacref.no-info")); + txt_description->SetText(ContentBundle::GetInstance()->GetText("tacref.no-info")); } } } diff --git a/Stars45/TacticalView.cpp b/Stars45/TacticalView.cpp index 2bbf691..9fe4b87 100644 --- a/Stars45/TacticalView.cpp +++ b/Stars45/TacticalView.cpp @@ -46,6 +46,7 @@ #include "MouseController.h" #include "Menu.h" #include "Game.h" +#include "ContentBundle.h" #include "FormatUtil.h" static Color hud_color = Color::Black; @@ -349,8 +350,8 @@ TacticalView::DrawSelectionInfo(Ship* seln) sprintf_s(name, "%s", seln->Name()); if (show_labels) { - sprintf_s(shield, "%s %03d", Game::GetInstance()->GetText("HUDView.symbol.shield").data(), shield_val); - sprintf_s(hull, "%s %03d", Game::GetInstance()->GetText("HUDView.symbol.hull").data(), hull_val); + sprintf_s(shield, "%s %03d", ContentBundle::GetInstance()->GetText("HUDView.symbol.shield").data(), shield_val); + sprintf_s(hull, "%s %03d", ContentBundle::GetInstance()->GetText("HUDView.symbol.hull").data(), hull_val); } else { sprintf_s(shield, "%03d", shield_val); @@ -359,7 +360,7 @@ TacticalView::DrawSelectionInfo(Ship* seln) FormatNumberExp(range, Point(seln->Location()-ship->Location()).length()/1000); strcat_s(range, " km"); - sprintf_s(heading, "%03d %s", (int) (seln->CompassHeading() / DEGREES), Game::GetInstance()->GetText("HUDView.symbol.degrees").data()); + sprintf_s(heading, "%03d %s", (int) (seln->CompassHeading() / DEGREES), ContentBundle::GetInstance()->GetText("HUDView.symbol.degrees").data()); double ss = seln->Velocity().length(); if (seln->Velocity() * seln->Heading() < 0) @@ -377,7 +378,7 @@ TacticalView::DrawSelectionInfo(Ship* seln) if (c->GetShip() == seln) { contact = c.value(); if (c->GetIFF(ship) > seln->GetIFF()) { - sprintf_s(name, "%s %04d", Game::GetInstance()->GetText("TacView.contact").data(), seln->GetContactID()); + sprintf_s(name, "%s %04d", ContentBundle::GetInstance()->GetText("TacView.contact").data(), seln->GetContactID()); full_info = false; } @@ -390,31 +391,31 @@ TacticalView::DrawSelectionInfo(Ship* seln) font->SetColor(txt_color); font->SetAlpha(1); - font->DrawText(Game::GetInstance()->GetText("TacView.name"), 5, label_rect, DT_LEFT); + font->DrawText(ContentBundle::GetInstance()->GetText("TacView.name"), 5, label_rect, DT_LEFT); label_rect.y += 10; - font->DrawText(Game::GetInstance()->GetText("TacView.type"), 5, label_rect, DT_LEFT); + font->DrawText(ContentBundle::GetInstance()->GetText("TacView.type"), 5, label_rect, DT_LEFT); label_rect.y += 10; if (full_info) { - font->DrawText(Game::GetInstance()->GetText("TacView.shield"), 5, label_rect, DT_LEFT); + font->DrawText(ContentBundle::GetInstance()->GetText("TacView.shield"), 5, label_rect, DT_LEFT); label_rect.y += 10; - font->DrawText(Game::GetInstance()->GetText("TacView.hull"), 5, label_rect, DT_LEFT); + font->DrawText(ContentBundle::GetInstance()->GetText("TacView.hull"), 5, label_rect, DT_LEFT); label_rect.y += 10; } - font->DrawText(Game::GetInstance()->GetText("TacView.range"), 4, label_rect, DT_LEFT); + font->DrawText(ContentBundle::GetInstance()->GetText("TacView.range"), 4, label_rect, DT_LEFT); label_rect.y += 10; if (full_info) { - font->DrawText(Game::GetInstance()->GetText("TacView.speed"), 4, label_rect, DT_LEFT); + font->DrawText(ContentBundle::GetInstance()->GetText("TacView.speed"), 4, label_rect, DT_LEFT); label_rect.y += 10; - font->DrawText(Game::GetInstance()->GetText("TacView.heading"), 4, label_rect, DT_LEFT); + font->DrawText(ContentBundle::GetInstance()->GetText("TacView.heading"), 4, label_rect, DT_LEFT); label_rect.y += 10; } else { - font->DrawText(Game::GetInstance()->GetText("TacView.passive"), 4, label_rect, DT_LEFT); + font->DrawText(ContentBundle::GetInstance()->GetText("TacView.passive"), 4, label_rect, DT_LEFT); label_rect.y += 10; - font->DrawText(Game::GetInstance()->GetText("TacView.active"), 4, label_rect, DT_LEFT); + font->DrawText(ContentBundle::GetInstance()->GetText("TacView.active"), 4, label_rect, DT_LEFT); label_rect.y += 10; } } @@ -429,9 +430,9 @@ TacticalView::DrawSelectionInfo(Ship* seln) } else { if (seln->IsStarship()) - font->DrawText(Game::GetInstance()->GetText("TacView.starship"), 8, info_rect, DT_LEFT); + font->DrawText(ContentBundle::GetInstance()->GetText("TacView.starship"), 8, info_rect, DT_LEFT); else - font->DrawText(Game::GetInstance()->GetText("TacView.fighter"), 7, info_rect, DT_LEFT); + font->DrawText(ContentBundle::GetInstance()->GetText("TacView.fighter"), 7, info_rect, DT_LEFT); info_rect.y += 10; } @@ -470,7 +471,7 @@ TacticalView::DrawSelectionInfo(Ship* seln) if (*orders) { if (show_labels) { - font->DrawText(Game::GetInstance()->GetText("TacView.orders"), 5, label_rect, DT_LEFT); + font->DrawText(ContentBundle::GetInstance()->GetText("TacView.orders"), 5, label_rect, DT_LEFT); label_rect.y += 10; } @@ -516,7 +517,7 @@ TacticalView::DrawSelectionList(ListIter seln) while (++c) { if (c->GetShip() == seln.value()) { if (c->GetIFF(ship) > seln->GetIFF()) { - sprintf_s(name, "%s %04d", Game::GetInstance()->GetText("TacView.contact").data(), seln->GetContactID()); + sprintf_s(name, "%s %04d", ContentBundle::GetInstance()->GetText("TacView.contact").data(), seln->GetContactID()); } break; @@ -917,57 +918,57 @@ TacticalView::Initialize() static int initialized = 0; if (initialized) return; - view_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.view")); - view_menu->AddItem(Game::GetInstance()->GetText("TacView.item.forward"), VIEW_FORWARD); - view_menu->AddItem(Game::GetInstance()->GetText("TacView.item.chase"), VIEW_CHASE); - view_menu->AddItem(Game::GetInstance()->GetText("TacView.item.orbit"), VIEW_ORBIT); - view_menu->AddItem(Game::GetInstance()->GetText("TacView.item.padlock"), VIEW_PADLOCK); - - emcon_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.emcon")); - - quantum_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.quantum")); - farcast_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.farcast")); - - main_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.main")); - - action_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.action")); - action_menu->AddItem(Game::GetInstance()->GetText("TacView.item.engage"), RadioMessage::ATTACK); - action_menu->AddItem(Game::GetInstance()->GetText("TacView.item.bracket"), RadioMessage::BRACKET); - action_menu->AddItem(Game::GetInstance()->GetText("TacView.item.escort"), RadioMessage::ESCORT); - action_menu->AddItem(Game::GetInstance()->GetText("TacView.item.identify"), RadioMessage::IDENTIFY); - action_menu->AddItem(Game::GetInstance()->GetText("TacView.item.hold"), RadioMessage::WEP_HOLD); - - formation_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.formation")); - formation_menu->AddItem(Game::GetInstance()->GetText("TacView.item.diamond"), RadioMessage::GO_DIAMOND); - formation_menu->AddItem(Game::GetInstance()->GetText("TacView.item.spread"), RadioMessage::GO_SPREAD); - formation_menu->AddItem(Game::GetInstance()->GetText("TacView.item.box"), RadioMessage::GO_BOX); - formation_menu->AddItem(Game::GetInstance()->GetText("TacView.item.trail"), RadioMessage::GO_TRAIL); - - sensors_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.emcon")); - sensors_menu->AddItem(Game::GetInstance()->GetText("TacView.item.emcon-1"), RadioMessage::GO_EMCON1); - sensors_menu->AddItem(Game::GetInstance()->GetText("TacView.item.emcon-2"), RadioMessage::GO_EMCON2); - sensors_menu->AddItem(Game::GetInstance()->GetText("TacView.item.emcon-3"), RadioMessage::GO_EMCON3); - sensors_menu->AddItem(Game::GetInstance()->GetText("TacView.item.probe"), RadioMessage::LAUNCH_PROBE); - - fighter_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.context")); - fighter_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.action"), action_menu); - fighter_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.formation"), formation_menu); - fighter_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.sensors"), sensors_menu); - fighter_menu->AddItem(Game::GetInstance()->GetText("TacView.item.patrol"), RadioMessage::MOVE_PATROL); - fighter_menu->AddItem(Game::GetInstance()->GetText("TacView.item.cancel"), RadioMessage::RESUME_MISSION); + view_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.view")); + view_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.forward"), VIEW_FORWARD); + view_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.chase"), VIEW_CHASE); + view_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.orbit"), VIEW_ORBIT); + view_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.padlock"), VIEW_PADLOCK); + + emcon_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.emcon")); + + quantum_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.quantum")); + farcast_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.farcast")); + + main_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.main")); + + action_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.action")); + action_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.engage"), RadioMessage::ATTACK); + action_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.bracket"), RadioMessage::BRACKET); + action_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.escort"), RadioMessage::ESCORT); + action_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.identify"), RadioMessage::IDENTIFY); + action_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.hold"), RadioMessage::WEP_HOLD); + + formation_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.formation")); + formation_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.diamond"), RadioMessage::GO_DIAMOND); + formation_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.spread"), RadioMessage::GO_SPREAD); + formation_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.box"), RadioMessage::GO_BOX); + formation_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.trail"), RadioMessage::GO_TRAIL); + + sensors_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.emcon")); + sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.emcon-1"), RadioMessage::GO_EMCON1); + sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.emcon-2"), RadioMessage::GO_EMCON2); + sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.emcon-3"), RadioMessage::GO_EMCON3); + sensors_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.probe"), RadioMessage::LAUNCH_PROBE); + + fighter_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.context")); + fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.action"), action_menu); + fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.formation"), formation_menu); + fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.sensors"), sensors_menu); + fighter_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.patrol"), RadioMessage::MOVE_PATROL); + fighter_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.cancel"), RadioMessage::RESUME_MISSION); fighter_menu->AddItem("", 0); - fighter_menu->AddItem(Game::GetInstance()->GetText("TacView.item.rtb"), RadioMessage::RTB); - fighter_menu->AddItem(Game::GetInstance()->GetText("TacView.item.dock"), RadioMessage::DOCK_WITH); - fighter_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.farcast"), farcast_menu); - - starship_menu = new(__FILE__,__LINE__) Menu(Game::GetInstance()->GetText("TacView.menu.context")); - starship_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.action"), action_menu); - starship_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.sensors"), sensors_menu); - starship_menu->AddItem(Game::GetInstance()->GetText("TacView.item.patrol"), RadioMessage::MOVE_PATROL); - starship_menu->AddItem(Game::GetInstance()->GetText("TacView.item.cancel"), RadioMessage::RESUME_MISSION); + fighter_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.rtb"), RadioMessage::RTB); + fighter_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.dock"), RadioMessage::DOCK_WITH); + fighter_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.farcast"), farcast_menu); + + starship_menu = new(__FILE__,__LINE__) Menu(ContentBundle::GetInstance()->GetText("TacView.menu.context")); + starship_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.action"), action_menu); + starship_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.sensors"), sensors_menu); + starship_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.patrol"), RadioMessage::MOVE_PATROL); + starship_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.cancel"), RadioMessage::RESUME_MISSION); starship_menu->AddItem("", 0); - starship_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.quantum"), quantum_menu); - starship_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.farcast"), farcast_menu); + starship_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.quantum"), quantum_menu); + starship_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.farcast"), farcast_menu); initialized = 1; } @@ -1154,38 +1155,38 @@ TacticalView::BuildMenu() } // build the main menu: - main_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.camera"), view_menu); + main_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.camera"), view_menu); main_menu->AddItem("", 0); - main_menu->AddItem(Game::GetInstance()->GetText("TacView.item.instructions"), VIEW_INS); - main_menu->AddItem(Game::GetInstance()->GetText("TacView.item.navigation"), VIEW_NAV); + main_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.instructions"), VIEW_INS); + main_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.navigation"), VIEW_NAV); if (ship->Design()->repair_screen) - main_menu->AddItem(Game::GetInstance()->GetText("TacView.item.engineering"), VIEW_ENG); + main_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.engineering"), VIEW_ENG); if (ship->Design()->wep_screen) - main_menu->AddItem(Game::GetInstance()->GetText("TacView.item.weapons"), VIEW_WEP); + main_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.weapons"), VIEW_WEP); if (ship->NumFlightDecks() > 0) - main_menu->AddItem(Game::GetInstance()->GetText("TacView.item.flight"), VIEW_FLT); + main_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.flight"), VIEW_FLT); - emcon_menu->AddItem(Game::GetInstance()->GetText("TacView.item.emcon-1"), RadioMessage::GO_EMCON1); - emcon_menu->AddItem(Game::GetInstance()->GetText("TacView.item.emcon-2"), RadioMessage::GO_EMCON2); - emcon_menu->AddItem(Game::GetInstance()->GetText("TacView.item.emcon-3"), RadioMessage::GO_EMCON3); + emcon_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.emcon-1"), RadioMessage::GO_EMCON1); + emcon_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.emcon-2"), RadioMessage::GO_EMCON2); + emcon_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.emcon-3"), RadioMessage::GO_EMCON3); if (ship->GetProbeLauncher()) - emcon_menu->AddItem(Game::GetInstance()->GetText("TacView.item.probe"), RadioMessage::LAUNCH_PROBE); + emcon_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.probe"), RadioMessage::LAUNCH_PROBE); main_menu->AddItem("", 0); - main_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.sensors"), emcon_menu); + main_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.sensors"), emcon_menu); if (sim && ship->GetQuantumDrive()) { main_menu->AddItem("", 0); - main_menu->AddMenu(Game::GetInstance()->GetText("TacView.item.quantum"), quantum_menu); + main_menu->AddMenu(ContentBundle::GetInstance()->GetText("TacView.item.quantum"), quantum_menu); } if (ship->IsStarship()) { main_menu->AddItem("", 0); - main_menu->AddItem(Game::GetInstance()->GetText("TacView.item.command"), VIEW_CMD); + main_menu->AddItem(ContentBundle::GetInstance()->GetText("TacView.item.command"), VIEW_CMD); } } diff --git a/Stars45/Thruster.cpp b/Stars45/Thruster.cpp index f8e1af1..dda7410 100644 --- a/Stars45/Thruster.cpp +++ b/Stars45/Thruster.cpp @@ -28,6 +28,7 @@ #include "Bitmap.h" #include "Sound.h" #include "DataLoader.h" +#include "ContentBundle.h" #include "Bolt.h" #include "Sprite.h" #include "Game.h" @@ -66,8 +67,8 @@ Thruster::Thruster(int dtype, double max_thrust, float flare_scale) ship(0), thrust(1.0f), scale(flare_scale), avail_x(1.0f), avail_y(1.0f), avail_z(1.0f) { - name = Game::GetInstance()->GetText("sys.thruster"); - abrv = Game::GetInstance()->GetText("sys.thruster.abrv"); + name = ContentBundle::GetInstance()->GetText("sys.thruster"); + abrv = ContentBundle::GetInstance()->GetText("sys.thruster.abrv"); power_flags = POWER_WATTS; diff --git a/Stars45/Weapon.cpp b/Stars45/Weapon.cpp index 45483a0..4d3eaa5 100644 --- a/Stars45/Weapon.cpp +++ b/Stars45/Weapon.cpp @@ -25,6 +25,7 @@ #include "NetUtil.h" #include "Game.h" +#include "ContentBundle.h" #include "Solid.h" // +----------------------------------------------------------------------+ @@ -45,9 +46,9 @@ Weapon::Weapon(WeaponDesign* d, int nmuz, Vec3* muzzles, double az, double el) ZeroMemory(visible_stores, sizeof(visible_stores)); if (design->primary) - abrv = Game::GetInstance()->GetText("sys.weapon.primary.abrv"); + abrv = ContentBundle::GetInstance()->GetText("sys.weapon.primary.abrv"); else - abrv = Game::GetInstance()->GetText("sys.weapon.secondary.abrv"); + abrv = ContentBundle::GetInstance()->GetText("sys.weapon.secondary.abrv"); nbarrels = nmuz; diff --git a/Stars45/WeaponDesign.cpp b/Stars45/WeaponDesign.cpp index ad9888b..b658c25 100644 --- a/Stars45/WeaponDesign.cpp +++ b/Stars45/WeaponDesign.cpp @@ -17,6 +17,7 @@ #include "Weapon.h" #include "Game.h" +#include "ContentBundle.h" #include "Sprite.h" #include "Light.h" #include "Bitmap.h" @@ -466,7 +467,7 @@ WeaponDesign::LoadDesign(const char* path, const char* filename, bool mod) } if (design->description.length()) { - design->description = Game::GetInstance()->GetText(design->description); + design->description = ContentBundle::GetInstance()->GetText(design->description); } if (design->anim_length > 0) { diff --git a/Stars45/Weather.cpp b/Stars45/Weather.cpp index 2f626ea..9c2b170 100644 --- a/Stars45/Weather.cpp +++ b/Stars45/Weather.cpp @@ -15,6 +15,7 @@ #include "Weather.h" #include "StarSystem.h" #include "Game.h" +#include "ContentBundle.h" // +--------------------------------------------------------------------+ @@ -149,27 +150,27 @@ Weather::Description() const switch (state) { default: case CLEAR: - description = Game::GetInstance()->GetText("weather.clear"); + description = ContentBundle::GetInstance()->GetText("weather.clear"); break; case HIGH_CLOUDS: - description = Game::GetInstance()->GetText("weather.high-clouds"); + description = ContentBundle::GetInstance()->GetText("weather.high-clouds"); break; case MODERATE_CLOUDS: - description = Game::GetInstance()->GetText("weather.partly-cloudy"); + description = ContentBundle::GetInstance()->GetText("weather.partly-cloudy"); break; case OVERCAST: - description = Game::GetInstance()->GetText("weather.overcast"); + description = ContentBundle::GetInstance()->GetText("weather.overcast"); break; case FOG: - description = Game::GetInstance()->GetText("weather.fog"); + description = ContentBundle::GetInstance()->GetText("weather.fog"); break; case STORM: - description = Game::GetInstance()->GetText("weather.storm"); + description = ContentBundle::GetInstance()->GetText("weather.storm"); break; } -- cgit v1.1