S5-04
This commit is contained in:
@@ -185,7 +185,10 @@ namespace GeometryTD.UI
|
||||
return;
|
||||
}
|
||||
|
||||
Form.SetRepoItemSelected(args.ItemId, args.Assigned);
|
||||
bool isSelected = _compAreaTowerIds.Contains(args.ItemId)
|
||||
? _participantTowerIds.Contains(args.ItemId)
|
||||
: args.Assigned;
|
||||
Form.SetRepoItemSelected(args.ItemId, isSelected);
|
||||
}
|
||||
|
||||
private void OnCombineSlotClicked(object sender, GameEventArgs e)
|
||||
@@ -284,6 +287,9 @@ namespace GeometryTD.UI
|
||||
result.TowerInstanceId,
|
||||
result.FailureReason,
|
||||
result.ValidationFailureReason);
|
||||
GameEntry.UIRouter.OpenUI(
|
||||
UIFormType.DialogForm,
|
||||
RepoParticipantAssignDialogUtility.BuildDialog(result, MaxParticipantCount));
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
using GeometryTD.Definition;
|
||||
|
||||
namespace GeometryTD.UI
|
||||
{
|
||||
public static class RepoParticipantAssignDialogUtility
|
||||
{
|
||||
public static DialogFormRawData BuildDialog(
|
||||
ParticipantTowerAssignResult result,
|
||||
int maxParticipantCount)
|
||||
{
|
||||
return new DialogFormRawData
|
||||
{
|
||||
Mode = 1,
|
||||
Title = "无法加入参战区",
|
||||
Message = BuildMessage(result, maxParticipantCount),
|
||||
PauseGame = false,
|
||||
ConfirmText = "知道了"
|
||||
};
|
||||
}
|
||||
|
||||
private static string BuildMessage(
|
||||
ParticipantTowerAssignResult result,
|
||||
int maxParticipantCount)
|
||||
{
|
||||
if (result == null)
|
||||
{
|
||||
return "当前无法加入参战区,请稍后重试。";
|
||||
}
|
||||
|
||||
switch (result.FailureReason)
|
||||
{
|
||||
case ParticipantTowerAssignFailureReason.TowerMissing:
|
||||
return $"塔 #{result.TowerInstanceId} 已不存在,无法加入参战区。";
|
||||
case ParticipantTowerAssignFailureReason.InvalidTower:
|
||||
return $"塔 #{result.TowerInstanceId} {CombatParticipantTowerValidationText.GetFailureReasonMessage(result.ValidationFailureReason)}";
|
||||
case ParticipantTowerAssignFailureReason.AlreadyAssigned:
|
||||
return $"塔 #{result.TowerInstanceId} 已在参战区中。";
|
||||
case ParticipantTowerAssignFailureReason.ParticipantAreaFull:
|
||||
return $"参战区已满,最多只能放入 {maxParticipantCount} 座塔。";
|
||||
default:
|
||||
return "当前无法加入参战区,请稍后重试。";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e6500e5312e4f2cb788f03f0aa8ab0c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user