Skip to content

Commit c563392

Browse files
committed
Merge remote-tracking branch 'darkademic/dev'
2 parents efcba01 + 815aa36 commit c563392

71 files changed

Lines changed: 269 additions & 25 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

OpenRA.Mods.CA/Traits/LobbyMissionInfo.cs renamed to OpenRA.Mods.CA/Traits/World/LobbyMissionInfo.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111
#endregion
1212

13+
using OpenRA.Primitives;
1314
using OpenRA.Traits;
1415

1516
namespace OpenRA.Mods.CA.Traits
@@ -19,11 +20,17 @@ namespace OpenRA.Mods.CA.Traits
1920
public class LobbyMissionInfoInfo : TraitInfo
2021
{
2122
[FieldLoader.Require]
22-
[Desc("Info to display in the lobby chat.")]
23-
public readonly string Info = "";
23+
[Desc("Text to display in the lobby chat.")]
24+
public readonly string Text = "";
2425

2526
[Desc("Prefix to display before the info in the lobby chat.")]
26-
public readonly string Prefix = "Mission Info";
27+
public readonly string Prefix = null;
28+
29+
[Desc("Color of the prefix text in the lobby chat.")]
30+
public readonly Color PrefixColor = Color.Cyan;
31+
32+
[Desc("Color of the info text in the lobby chat.")]
33+
public readonly Color TextColor = Color.Cyan;
2734

2835
public override object Create(ActorInitializer init) { return new LobbyMissionInfo(); }
2936
}

OpenRA.Mods.CA/Widgets/Logic/Lobby/LobbyMissionInfoLogic.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using System;
1212
using OpenRA.Mods.CA.Traits;
1313
using OpenRA.Network;
14-
using OpenRA.Primitives;
1514
using OpenRA.Widgets;
1615

1716
namespace OpenRA.Mods.CA.Widgets.Logic
@@ -43,14 +42,24 @@ void OnLobbyInfoChanged()
4342

4443
lastMapUid = mapUid;
4544

46-
var lobbyMissionInfo = map.WorldActorInfo.TraitInfoOrDefault<LobbyMissionInfoInfo>();
47-
if (lobbyMissionInfo == null || string.IsNullOrEmpty(lobbyMissionInfo.Info))
45+
var lobbyMissionInfos = map.WorldActorInfo.TraitInfos<LobbyMissionInfoInfo>();
46+
47+
if (lobbyMissionInfos.Count == 0)
4848
return;
4949

50-
var info = lobbyMissionInfo.Info;
51-
var prefix = lobbyMissionInfo.Prefix;
50+
Game.RunAfterTick(() => {
51+
foreach (var lobbyMissionInfo in lobbyMissionInfos)
52+
{
53+
var text = lobbyMissionInfo.Text;
54+
var prefix = lobbyMissionInfo.Prefix;
55+
var prefixColor = lobbyMissionInfo.PrefixColor;
56+
var textColor = lobbyMissionInfo.TextColor;
57+
58+
text = text.Replace("\\n", "\n");
5259

53-
Game.RunAfterTick(() => TextNotificationsManager.AddChatLine(TextNotificationsManager.SystemClientId, prefix, info, Color.DeepSkyBlue, Color.DeepSkyBlue));
60+
TextNotificationsManager.AddChatLine(TextNotificationsManager.SystemClientId, prefix, text, prefixColor, textColor);
61+
}
62+
});
5463
}
5564

5665
protected override void Dispose(bool disposing)

mods/ca/maps/ceasefire-3v3.oramap

34.2 KB
Binary file not shown.

mods/ca/maps/ceasefire-4v4.oramap

38.6 KB
Binary file not shown.

mods/ca/maps/donssacks.oramap

24.8 KB
Binary file not shown.

mods/ca/maps/frozen_rift_ca.oramap

24.2 KB
Binary file not shown.

mods/ca/missions/coop-campaign/ca-prologue-01-coop/map.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,6 @@ Actors:
511511
PrismSpawn2: waypoint
512512
Owner: Neutral
513513
Location: 53,62
514-
SubPen: spen
515-
Owner: USSR
516-
Location: 75,74
517514
Actor131: ss
518515
Owner: USSR
519516
Stance: Defend
@@ -571,6 +568,9 @@ Actors:
571568
TanyaDest: waypoint
572569
Owner: Neutral
573570
Location: 63,48
571+
SubPen: spen
572+
Owner: USSR
573+
Location: 75,75
574574

575575
Rules: ca|rules/custom/campaign-rules.yaml, ca|rules/custom/campaign-tooltips.yaml, ca|rules/custom/two-tone-nod.yaml, ca|rules/custom/disable-coalitions.yaml, ca|missions/main-campaign/ca-prologue-01/relativity-rules.yaml, ca|rules/custom/coop-rules.yaml, relativity-coop-rules.yaml
576576

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
World:
22
LuaScript:
33
Scripts: campaign.lua, coop.lua, ca|missions/main-campaign/ca-prologue-01/relativity.lua, relativity-coop.lua
4+
LobbyMissionInfo@InitialObjectives:
5+
Prefix: Initial Objectives
6+
Text: • Find and rescue Prof. Einstein.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
World:
22
LuaScript:
33
Scripts: campaign.lua, coop.lua, ca|missions/main-campaign/ca-prologue-02/reprisal.lua, reprisal-coop.lua
4+
LobbyMissionInfo@InitialObjectives:
5+
Prefix: Initial Objectives
6+
Text: • Destroy the village and all its inhabitants.\n• Destroy the Allied base.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
World:
22
LuaScript:
33
Scripts: campaign.lua, coop.lua, ca|missions/main-campaign/ca-prologue-03/detachment.lua, detachment-coop.lua
4+
LobbyMissionInfo@InitialObjectives:
5+
Prefix: Initial Objectives
6+
Text: • Make contact with GDI forces in the area and find a route to safety.

0 commit comments

Comments
 (0)