-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContextHelpService.cs
More file actions
89 lines (79 loc) · 3.25 KB
/
ContextHelpService.cs
File metadata and controls
89 lines (79 loc) · 3.25 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
using NobleRobot;
using UnityEngine.EventSystems;
namespace BlippoAccess
{
/// <summary>
/// Builds concise control help text for the current screen context.
/// </summary>
internal static class ContextHelpService
{
/// <summary>
/// Builds a context-aware controls hint.
/// </summary>
public static string BuildAnnouncement()
{
if (GameManager.instance == null)
{
return Loc.Get("help_general");
}
switch (GameManager.currentSystemScreen)
{
case SystemScreen.Type.PROGRAM_GUIDE:
return Loc.Get("help_program_guide");
case SystemScreen.Type.BROADCAST_DISPLAY:
return Loc.Get("help_broadcast");
case SystemScreen.Type.CONTROL_MENU:
return BuildControlMenuHelp();
case SystemScreen.Type.MESSAGES:
return BuildMessagesHelp();
case SystemScreen.Type.FEMTOFAX:
return Loc.Get("help_femtofax");
case SystemScreen.Type.TUNER_CALIBRATION:
return Loc.Get("help_tuner_calibration");
case SystemScreen.Type.PACKETTE_LOAD:
return Loc.Get("help_packette_load");
case SystemScreen.Type.CREDITS:
return Loc.Get("help_credits");
case SystemScreen.Type.SIGNAL_LOSS:
return Loc.Get("help_signal_loss");
default:
return Loc.Get("help_general");
}
}
private static string BuildMessagesHelp()
{
if (Bookshelf.instance == null || !Bookshelf.instance.systemScreens.ContainsKey(SystemScreen.Type.MESSAGES))
{
return Loc.Get("help_messages_list");
}
var messages = Bookshelf.instance.systemScreens[SystemScreen.Type.MESSAGES] as Messages;
if (messages == null || messages.currentSubmenu != messages.messageSubmenu)
{
return Loc.Get("help_messages_list");
}
return Loc.Get("help_messages_content");
}
private static string BuildControlMenuHelp()
{
if (Bookshelf.instance == null || !Bookshelf.instance.systemScreens.ContainsKey(SystemScreen.Type.CONTROL_MENU))
{
return Loc.Get("help_control_menu");
}
var menu = Bookshelf.instance.systemScreens[SystemScreen.Type.CONTROL_MENU] as ControlMenu;
if (menu == null || menu.currentSubmenu == null)
{
return Loc.Get("help_control_menu");
}
var selectedObject = EventSystem.current != null ? EventSystem.current.currentSelectedGameObject : null;
if (FactoryResetHandler.IsFactoryResetContext(menu.currentSubmenu, selectedObject))
{
return Loc.Get("help_control_menu_factory_reset");
}
if (DataManagerContentHandler.IsDataSubmenuContext(menu.currentSubmenu))
{
return Loc.Get("help_control_menu_data_manager");
}
return Loc.Get("help_control_menu");
}
}
}