summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMittendrein Markus <maxmitti@gmx.net>2015-08-26 22:47:46 +0200
committerMittendrein Markus <maxmitti@gmx.net>2016-03-09 14:47:54 +0100
commit29726293c49ba1c3a4bd6d5c9ab09a1f6942ad1d (patch)
treeec0ba00dc5382ecfbcb9b1cf5f79a365343a61fd
parent1fe7abceccdb55fb12ec7d6c746fb8cfacafd762 (diff)
downloadtempelschubsen-29726293c49ba1c3a4bd6d5c9ab09a1f6942ad1d.tar.gz
tempelschubsen-29726293c49ba1c3a4bd6d5c9ab09a1f6942ad1d.zip
Add GameComments to show current game state
-rw-r--r--TemplePushing.c4s/Script.c43
-rw-r--r--TemplePushing.c4s/StringTblDE.txt9
-rw-r--r--TemplePushing.c4s/StringTblUS.txt9
-rw-r--r--TemplePushing.c4s/System.c4g/Compatibility.c5
4 files changed, 63 insertions, 3 deletions
diff --git a/TemplePushing.c4s/Script.c b/TemplePushing.c4s/Script.c
index b01d6e4..41b1bca 100644
--- a/TemplePushing.c4s/Script.c
+++ b/TemplePushing.c4s/Script.c
@@ -156,11 +156,14 @@ func UpdateScoreboard(int player, bool leaver)
SortScoreboard(SBRD_ScoreCol, true);
if (!deathmatchEnabled) SortScoreboard(SBRD_RelaunchesCol, true);
SortScoreboard(SBRD_SortCol);
+
+ UpdateComment();
}
func ShowLobby()
{
LoadScenarioSection("Lobby");
+ UpdateComment(true);
}
func SetupDone(object menu, string message)
@@ -674,4 +677,42 @@ func ToggleAmbienceSounds(int player)
SetPlrExtraData(player, PlrData_EnableAmbienceSounds, preference);
DoAmbienceSounds(player);
-} \ No newline at end of file
+}
+
+func UpdateComment(bool inLobby)
+{
+ if (inLobby) SetGameComment(" $LobbyComment$");
+ else
+ {
+ var score = "";
+ var teams = [];
+ var teamRelaunches = [];
+ for (var i = 0; i < GetPlayerCount(); i++)
+ {
+ if (!eliminatedPlayers[GetPlayerID(GetPlayerByIndex(i))])
+ {
+ ++teams[GetPlayerTeam(GetPlayerByIndex(i))];
+ if (!deathmatchEnabled) teamRelaunches[GetPlayerTeam(GetPlayerByIndex(i))] += numRelaunches - playerDeaths[GetPlayerID(GetPlayerByIndex(i))];
+ }
+ }
+
+ for (var i = 0; i <= GetTeamCount(); ++i)
+ {
+ var team = GetTeamByIndex(i);
+ if (teams[team])
+ {
+ if (GetLength(score)) score = Format("%s : ", score);
+ if (deathmatchEnabled) score = Format("%s<c %x>%d</c>", score, GetTeamColor(team), teamScore[team]);
+ else score = Format("%s<c %x>%d</c>", score, GetTeamColor(team), teamRelaunches[team]);
+ }
+ }
+
+ var sudden = "";
+ if(suddendeathEnabled) sudden = " $SuddenDeath$";
+ var goalDesc;
+ if(deathmatchEnabled) goalDesc = Format("$DM$", deathmatchWinScore);
+ else goalDesc = Format("$LMS$", numRelaunches);
+
+ SetGameComment(Format(" $GameComment$", GetName(0, sectionID), mode->ModeName(), sudden, goalDesc, score));
+ }
+}
diff --git a/TemplePushing.c4s/StringTblDE.txt b/TemplePushing.c4s/StringTblDE.txt
index 6250fbe..709493f 100644
--- a/TemplePushing.c4s/StringTblDE.txt
+++ b/TemplePushing.c4s/StringTblDE.txt
@@ -11,4 +11,11 @@ Kills=Kills
WinScore=Ziel
MsgDeathmatchWin=<c %x>Team %s</c> erringt den Sieg.
Win=Sieg
-Rematch=Startet eine weitere Runde Tempelschubsen. \ No newline at end of file
+Rematch=Startet eine weitere Runde Tempelschubsen.
+
+# GameComment-Strings
+LobbyComment= <i>Es wird noch eingestellt…<i>
+SuddenDeath=mit <c ff0000>Sudden Death</c>
+DM=<c ff0000>DM</c> mit %d Punkten
+LMS=<c 80>LMS</c> mit %d Relaunches
+GameComment=<c ffffc0>Tempel</c>: %s| <c ffffc0>Modus</c>: %s%s| <c ffffc0>Ziel</c>: %s| <c ffffc0>Spielstand</c>: %s
diff --git a/TemplePushing.c4s/StringTblUS.txt b/TemplePushing.c4s/StringTblUS.txt
index 98deff7..320ad3d 100644
--- a/TemplePushing.c4s/StringTblUS.txt
+++ b/TemplePushing.c4s/StringTblUS.txt
@@ -11,4 +11,11 @@ Kills=Kills
WinScore=Goal
MsgDeathmatchWin=<c %x>Team %s</c> wins the match.
Win=Win
-Rematch=Starts another round of Temple Pushing. \ No newline at end of file
+Rematch=Starts another round of Temple Pushing.
+
+# GameComment-Strings
+LobbyComment= <i>Settings are still being chosen…</i>
+SuddenDeath=with <c ff0000>sudden death</c>
+DM=<c ff0000>DM</c> with %d points
+LMS=<c 80>LMS</c> with %d relaunches
+GameComment=<c ffffc0>Temple</c>: %s| <c ffffc0>Mode</c>: %s%s| <c ffffc0>Goal</c>: %s| <c ffffc0>Score</c>: %s
diff --git a/TemplePushing.c4s/System.c4g/Compatibility.c b/TemplePushing.c4s/System.c4g/Compatibility.c
new file mode 100644
index 0000000..5d3865e
--- /dev/null
+++ b/TemplePushing.c4s/System.c4g/Compatibility.c
@@ -0,0 +1,5 @@
+/*-- Avoid errors from non-existent Engine-Functions --*/
+
+#strict 2
+
+global func SetGameComment() { return _inherited(...); }