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/StarshipAI.cpp | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'Stars45/StarshipAI.cpp') 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) { -- cgit v1.1