ui: include Hakurei in history force filter
This commit is contained in:
parent
f2af485dbb
commit
61493354bf
@ -92,22 +92,27 @@ namespace TH1_UI.View.Outside
|
|||||||
|
|
||||||
private void SetDropForce()
|
private void SetDropForce()
|
||||||
{
|
{
|
||||||
DropdownForceData = new List<Empire>() {
|
DropdownForceData = new List<Empire>
|
||||||
new Empire(){Civ = CivEnum.Common,Force = ForceEnum.Common},
|
{
|
||||||
new Empire(){Civ = CivEnum.Egyptian,Force = ForceEnum.Remilia},
|
new Empire(CivEnum.Common, ForceEnum.Common)
|
||||||
new Empire(){Civ = CivEnum.French,Force = ForceEnum.Kaguya},
|
|
||||||
new Empire(){Civ = CivEnum.Germany,Force = ForceEnum.Kanako},
|
|
||||||
new Empire(){Civ = CivEnum.Indian,Force = ForceEnum.Satori},
|
|
||||||
};
|
};
|
||||||
DropdownForce.ClearOptions();
|
DropdownForce.ClearOptions();
|
||||||
List<string> options = new List<string>();
|
List<string> options = new List<string>
|
||||||
options.Add(MultilingualManager.Instance.GetMultilingualText(uint.Parse(Table.Instance.PlayerDataAssets.CommonForceTitleText)));
|
|
||||||
foreach (var item in DropdownForceData)
|
|
||||||
{
|
{
|
||||||
if (!Table.Instance.PlayerDataAssets.GetPlayerInfo(item.Civ, item.Force, out var info)) continue;
|
MultilingualManager.Instance.GetMultilingualText(uint.Parse(Table.Instance.PlayerDataAssets.CommonForceTitleText))
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var info in Table.Instance.PlayerDataAssets.PlayerDataList)
|
||||||
|
{
|
||||||
|
if (info == null || !ContentGate.CanSelectEmpire(info.CivId, info.ForceId)) continue;
|
||||||
|
var empire = new Empire(
|
||||||
|
Table.Instance.TransCivIdToCivEnum(info.CivId),
|
||||||
|
Table.Instance.TransForceIdToForceEnum(info.ForceId));
|
||||||
|
DropdownForceData.Add(empire);
|
||||||
options.Add(MultilingualManager.Instance.GetMultilingualText(info.ForceName));
|
options.Add(MultilingualManager.Instance.GetMultilingualText(info.ForceName));
|
||||||
}
|
}
|
||||||
DropdownForce.AddOptions(options);
|
DropdownForce.AddOptions(options);
|
||||||
|
DropdownForce.SetValueWithoutNotify(0);
|
||||||
|
|
||||||
DropdownForce.onValueChanged.RemoveAllListeners();
|
DropdownForce.onValueChanged.RemoveAllListeners();
|
||||||
DropdownForce.onValueChanged.AddListener(OnOrderUpdate);
|
DropdownForce.onValueChanged.AddListener(OnOrderUpdate);
|
||||||
@ -151,15 +156,7 @@ namespace TH1_UI.View.Outside
|
|||||||
private void _RefreshList()
|
private void _RefreshList()
|
||||||
{
|
{
|
||||||
var gameMode = _currentGameMode;
|
var gameMode = _currentGameMode;
|
||||||
var forceEnum = DropdownForce.value switch
|
var forceEnum = GetSelectedForceEnum();
|
||||||
{
|
|
||||||
0 => ForceEnum.Common,
|
|
||||||
1 => ForceEnum.Remilia,
|
|
||||||
2 => ForceEnum.Kaguya,
|
|
||||||
3 => ForceEnum.Kanako,
|
|
||||||
4 => ForceEnum.Satori,
|
|
||||||
_ => ForceEnum.Common
|
|
||||||
};
|
|
||||||
// index 0 = 不限, 1..16 → 玩家数 2..17
|
// index 0 = 不限, 1..16 → 玩家数 2..17
|
||||||
int playerCount = PlayerCountDropdown.value == 0 ? 0 : PlayerCountDropdown.value + 1;
|
int playerCount = PlayerCountDropdown.value == 0 ? 0 : PlayerCountDropdown.value + 1;
|
||||||
bool isScore = false;
|
bool isScore = false;
|
||||||
@ -182,6 +179,14 @@ namespace TH1_UI.View.Outside
|
|||||||
|
|
||||||
SetItemList(GameRecordManager.Instance.GetSortGameRecordList(gameMode,forceEnum,playerCount,isScore,isTurn,isTime,order));
|
SetItemList(GameRecordManager.Instance.GetSortGameRecordList(gameMode,forceEnum,playerCount,isScore,isTurn,isTime,order));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private ForceEnum GetSelectedForceEnum()
|
||||||
|
{
|
||||||
|
if (DropdownForceData == null || DropdownForce == null) return ForceEnum.Common;
|
||||||
|
var index = DropdownForce.value;
|
||||||
|
if (index < 0 || index >= DropdownForceData.Count) return ForceEnum.Common;
|
||||||
|
return DropdownForceData[index].Force;
|
||||||
|
}
|
||||||
|
|
||||||
public void SetContent(ShowUIOutsideHistory evt)
|
public void SetContent(ShowUIOutsideHistory evt)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user