|
|
**2023年02月07日 皮蛋创建 需代码侧审核格式及内容是否正确**
|
|
|
|
|
|
# 接口名称
|
|
|
```
|
|
|
MBInformationManager.ShowMultiSelectionInquiry
|
|
|
```
|
|
|
# 接口位置
|
|
|
```
|
|
|
TaleWorlds.Core
|
|
|
```
|
|
|
# 功能说明
|
|
|
- 一种弹窗。
|
|
|
- 玩家需要选择一个选项,然后单击确认。
|
|
|
- 弹窗时游戏暂停。
|
|
|
- 与其他弹窗相比,此弹窗主要用于玩家需要在多个选项中作出一项选择的情景下。
|
|
|
- # 案例截图
|
|
|
注意:截图案例来源于
|
|
|
- 随机事件模组(Random Events MOD)
|
|
|
- [中文站链接](https://bbs.mountblade.com.cn/download_729.html)
|
|
|
- [NexusMOD链接](https://www.nexusmods.com/mountandblade2bannerlord/mods/1410)
|
|
|
- 
|
|
|
- # 使用案例
|
|
|
- 位于[军火商](https://bbs.mountblade.com.cn/download_60.html)模组
|
|
|
- `ArmsDealer.ArmsDealer.TrainSoldiersBehavior`
|
|
|
|
|
|
``cs
|
|
|
public void OnSessionLaunched(CampaignGameStarter campaignGameStarter)
|
|
|
{
|
|
|
new ADMenu(campaignGameStarter).AddConditionOption("town_arena", "town_ad_train_soldier", "{=addMenuTrainSoldier}Train Soldier", GameMenuOption.LeaveType.HostileAction, delegate(MenuCallbackArgs args)
|
|
|
{
|
|
|
TextObject disabledText = new TextObject("{=addMenuTrainSoldierDisable}", null);
|
|
|
return MenuHelper.SetOptionProperties(args, this._isCanTrainSoldier, true, disabledText);
|
|
|
}, delegate(MenuCallbackArgs args)
|
|
|
{
|
|
|
List<InquiryElement> list = Enumerable.ToList<InquiryElement>(Enumerable.Select<TroopRosterElement, InquiryElement>(Enumerable.Where<TroopRosterElement>(MobileParty.MainParty.MemberRoster.GetTroopRoster(), new Func<TroopRosterElement, bool>(this.FilterNormalTroop)), (TroopRosterElement troopRosterElement) => new InquiryElement(troopRosterElement, troopRosterElement.Character.Name.ToString() + "【" + troopRosterElement.Number.ToString() + "人】", new ImageIdentifier(CharacterCode.CreateFrom(troopRosterElement.Character)))));
|
|
|
if (list.Count == 0)
|
|
|
{
|
|
|
ADInfo.Display("{=adInquiryChooseSoldierEmpty}", "");
|
|
|
return;
|
|
|
}
|
|
|
MBInformationManager.ShowMultiSelectionInquiry(new MultiSelectionInquiryData(new TextObject("{=adInquiryChooseSoldier}Choose Soldier", null).ToString(), "", list, true, 1, new TextObject("{=adConfirm}DONE", null).ToString(), "", delegate(List<InquiryElement> obj)
|
|
|
{
|
|
|
TroopRosterElement troopRosterElement = (TroopRosterElement)Enumerable.FirstOrDefault<InquiryElement>(obj).Identifier;
|
|
|
this.CreateNewMission(troopRosterElement);
|
|
|
}, null, ""), true, false);
|
|
|
}, 0);
|
|
|
}``
|
|
|
- |