mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 20:55:44 +00:00
Show retreating armies in progress panels (#8688)
This commit is contained in:
+10
-3
@@ -24,9 +24,11 @@ namespace eagle {
|
||||
public void
|
||||
Populate(ShardokBattleView battle, IGameModel model, Action<string> goToBattleAction) {
|
||||
model.Provinces.TryGetValue(battle.DefenderProvince, out var pv);
|
||||
provinceLabel.text = AttackerOriginsText(battle, model);
|
||||
defenderProvinceLabel.text =
|
||||
pv != null ? pv.Name : $"Province {battle.DefenderProvince}";
|
||||
provinceLabel.text =
|
||||
RetreatingLabel(AttackerOriginsText(battle, model), battle.AttackerRetreating);
|
||||
defenderProvinceLabel.text = RetreatingLabel(
|
||||
pv != null ? pv.Name : $"Province {battle.DefenderProvince}",
|
||||
battle.DefenderRetreating);
|
||||
|
||||
bool isSelf = battle.PlayerInfos.Any(pi => pi.Hostility == Hostility.SelfHostility);
|
||||
bool isAllied = isSelf ||
|
||||
@@ -136,6 +138,11 @@ namespace eagle {
|
||||
return $"Province {provinceId}";
|
||||
}
|
||||
|
||||
private static string RetreatingLabel(string label, bool isRetreating) {
|
||||
if (!isRetreating) return label;
|
||||
return string.IsNullOrEmpty(label) ? "Retreating" : $"{label} (Retreating)";
|
||||
}
|
||||
|
||||
private void SetFightButtonTutorialRegistration(bool shouldRegister) {
|
||||
var registry = TutorialManager.Instance?.TargetRegistry;
|
||||
if (registry == null) return;
|
||||
|
||||
+3
-1
@@ -163,7 +163,9 @@ namespace eagle {
|
||||
newRow.HeroCount = army.HeroCount;
|
||||
newRow.TroopCount = army.TroopCount;
|
||||
newRow.Origin = Model.Provinces[army.OriginProvinceId].Name;
|
||||
newRow.Destination = Model.Provinces[army.DestinationProvinceId].Name;
|
||||
var destination = Model.Provinces[army.DestinationProvinceId].Name;
|
||||
newRow.Destination =
|
||||
army.IsRetreating ? $"{destination} (Retreating)" : destination;
|
||||
if (CurrentProvince != null && army.DestinationProvinceId == CurrentProvince.Id) {
|
||||
newRow.DestinationColor = Color.blue;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user