This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CastleMenus.cs
56 lines (51 loc) · 2.19 KB
/
CastleMenus.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using TaleWorlds.CampaignSystem;
using TaleWorlds.CampaignSystem.Encounters;
using TaleWorlds.CampaignSystem.GameMenus;
using TaleWorlds.CampaignSystem.Overlay;
namespace WaitUntilFullyRested {
public abstract class CastleMenus {
public static void register(CampaignGameStarter campaignGameStarter) {
AddGameMenuOptionsToDefaultCastleGameMenu(campaignGameStarter);
AddNewCastleGameWaitMenu(campaignGameStarter);
AddGameMenuOptionsToNewCastleGameWaitMenu(campaignGameStarter);
}
private static void AddGameMenuOptionsToDefaultCastleGameMenu(CampaignGameStarter campaignGameStarter) {
campaignGameStarter.AddGameMenuOption(
"castle",
"castle_wait_until_fully_rested",
"{=3hLhzZ9nUCmZE}Wait here until you are fully rested",
Conditions.waitUntilFullyRestedGameMenuOptionCondition,
Consequences.waitUntilFullyRestedGameMenuOptionConsequenceFactory("castle_wait_until_fully_rested_menus"),
false,
10
);
}
private static void AddNewCastleGameWaitMenu(CampaignGameStarter campaignGameStarter) {
campaignGameStarter.AddWaitGameMenu(
"castle_wait_until_fully_rested_menus",
"{=HRC4ChHx1QVOi}You are waiting in {CURRENT_SETTLEMENT} until you are fully rested.",
(MenuCallbackArgs args) => {
PlayerEncounter.Current.IsPlayerWaiting = true;
},
Conditions.waitUntilFullyRestedGameMenuCondition,
null,
Consequences.waitUntilFullyRestedGameMenuOnTickConsequenceFactory("castle"),
GameMenu.MenuAndOptionType.WaitMenuHideProgressAndHoursOption,
GameOverlays.MenuOverlayType.SettlementWithBoth
);
}
private static void AddGameMenuOptionsToNewCastleGameWaitMenu(CampaignGameStarter campaignGameStarter) {
campaignGameStarter.AddGameMenuOption(
"castle_wait_until_fully_rested_menus",
"castle_wait_until_fully_rested_menus_leave",
"{=UqDNAZqM}Stop waiting",
(MenuCallbackArgs args) => {
args.optionLeaveType = GameMenuOption.LeaveType.Leave;
return true;
},
Consequences.waitUntilFullyRestedGameMenuLeaveConsequenceFactory("castle"),
true
);
}
}
}