summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/CmpSelectDlg.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-04-01 05:16:14 +0200
committerAki <please@ignore.pl>2024-04-01 05:21:16 +0200
commit3be3bfaa17773550a696ed2b756136debfe79ae2 (patch)
treedb55a420e43ddaa4a72140d2795892757c1672d3 /StarsEx/CmpSelectDlg.cpp
parent0a3451f251f360267e2927d8320787d59148eadd (diff)
downloadstarshatter-3be3bfaa17773550a696ed2b756136debfe79ae2.zip
starshatter-3be3bfaa17773550a696ed2b756136debfe79ae2.tar.gz
starshatter-3be3bfaa17773550a696ed2b756136debfe79ae2.tar.bz2
Fixed date and time consistency across Campaigns and Missions
This fixes campaign mission generation mostly, but a full playthrough will be needed. Missions now serialize and accept stardate setting a bit better. Thanks to this, date is propagated over multiplayer, too. This seems to break points system? Code-wise, this does not workaround the problems from before namely over-reliance on side-effects. Stardate class is at least one small step into good direction. Now, it'd be nice to attach clocks to simulation and campaign and whatever else that needs them.
Diffstat (limited to 'StarsEx/CmpSelectDlg.cpp')
-rw-r--r--StarsEx/CmpSelectDlg.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/StarsEx/CmpSelectDlg.cpp b/StarsEx/CmpSelectDlg.cpp
index 941c53a..028dc17 100644
--- a/StarsEx/CmpSelectDlg.cpp
+++ b/StarsEx/CmpSelectDlg.cpp
@@ -23,6 +23,7 @@
#include "CombatGroup.h"
#include "ShipDesign.h"
#include "Player.h"
+#include "Stardate.h"
#include "Clock.h"
#include "ContentBundle.h"
@@ -147,14 +148,9 @@ CmpSelectDlg::ExecFrame()
campaign->Description());
}
else {
- char time_buf[32];
char score_buf[32];
-
- double t = campaign->GetLoadTime() - campaign->GetStartTime();
- FormatDayTime(time_buf, t);
-
+ const auto load_time = starshatter::engine::Stardate{campaign->LoadTime()}.Format();
sprintf_s(score_buf, "%d", campaign->GetPlayerTeamScore());
-
Text desc = Text("<font Limerick12><color ffffff>") +
campaign->Name() +
Text("<font Verdana>\n\n") +
@@ -165,7 +161,7 @@ CmpSelectDlg::ExecFrame()
Text("\n\n<color ffff80>") +
ContentBundle::GetInstance()->GetText("CmpSelectDlg.campaign-time") +
Text("<color ffffff>\n\t") +
- time_buf +
+ load_time +
Text("\n\n<color ffff80>") +
ContentBundle::GetInstance()->GetText("CmpSelectDlg.assignment") +
Text("<color ffffff>\n\t");