DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ TutorialKeybinds()

void ScriptedWidgetEventHandler::TutorialKeybinds ( Widget parent,
TutorialsMenu menu )
inlineprotected

См. определение в файле ControlMappingKeybinds.c строка 8

9 {
11
12 m_Menu = menu;
13
14 int actionCount;
15 int actionMax = 80;
16
17 int column_index = 0;
18 int item_index;
19 string output = "";
20 string option_text = "";
21 TIntArray actions = new TIntArray;
22 GetUApi().GetActiveInputs(actions);
23
24 actionCount = actions.Count();
25 for (int i = 0; i < actionCount; i++)
26 {
27 UAInput input = GetUApi().GetInputByID(actions.Get(i));
28 if (input)
29 {
30 if (item_index < actionMax)
31 {
32 output = "";
33 option_text = "";
34 GetGame().GetInput().GetActionDesc(actions.Get(i), option_text);
35 if (SetElementTitle(input, EUAINPUT_DEVICE_KEYBOARDMOUSE, output))
36 {
37 column_index = Math.Floor(item_index / 21);
38 Widget w = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/tutorials/xbox/keybindings_panels/keybinding_panel.layout", m_Root.FindAnyWidget("container" + column_index));
39 Widget spacer = w.FindWidget("Spacer");
40 TextWidget name = TextWidget.Cast(w.FindWidget("KeybindName"));
41 TextWidget mod = TextWidget.Cast(spacer.FindWidget("KeybindModifier"));
42 TextWidget value = TextWidget.Cast(spacer.FindWidget("KeybindButton"));
43
44 string modifier_text = "";
45 name.SetText(option_text);
46 value.SetText(output);
47
48 if (SetElementModifier(input, modifier_text))
49 {
50 mod.SetText(modifier_text);
51 }
52
53 name.Update();
54 mod.Update();
55 value.Update();
56 spacer.Update();
57
58 item_index++;
59 }
60 }
61 else
62 {
63 option_text = "";
64 GetGame().GetInput().GetActionDesc(actions[i], option_text);
65 ErrorEx("input action " + option_text + " index out of bounds!",ErrorExSeverity.INFO);
66 }
67 }
68 }
69
70 m_Root.SetHandler(this);
71 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
proto native UAInputAPI GetUApi()
proto native WorkspaceWidget GetWorkspace()
proto native Input GetInput()
proto int GetActionDesc(int action_index, out string desc)
bool SetElementModifier(UAInput pInput, out string output)
Determine the active limiter of the bindings (currently unreliable, multiple limiters can be active o...
Определения ControlMappingKeybinds.c:126
Widget m_Root
Определения SizeToChild.c:9
CameraToolsMenu m_Menu
Определения CTEvent.c:8
bool SetElementTitle(UAInput pInput, int iDeviceFlags, out string output)
assemble all active bindings at widget element
Определения ControlMappingKeybinds.c:74
proto native UAInput GetInputByID(int iID)
returns list of all bindable (i.e. visible) inputs from the active group ('core' by default)
proto native void GetActiveInputs(out TIntArray items)
proto native CGame GetGame()
ErrorExSeverity
Определения EnDebug.c:62
enum ShapeType ErrorEx
array< int > TIntArray
Определения EnScript.c:687
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
WorkspaceWidget Widget
Defined in code.

Перекрестные ссылки WorkspaceWidget::CreateWidgets(), ErrorEx, Math::Floor(), Input::GetActionDesc(), UAInputAPI::GetActiveInputs(), GetGame(), CGame::GetInput(), UAInputAPI::GetInputByID(), GetLayoutName(), GetUApi(), CGame::GetWorkspace(), m_Menu, m_Root, name, SetElementModifier() и SetElementTitle().