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

◆ Rebuild()

void ScriptedWidgetEventHandler::Rebuild ( )
inlineprotected

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

18 {
20
21 int actionMax = 80;
22 int column_index = 0;
23 int item_index = 0;
24 string output = "";
25 string option_text = "";
26 int deviceFlags = GetActiveDeviceFlags();
27 TIntArray actions = new TIntArray;
28 GetUApi().GetActiveInputs(actions);
29
30 int actionCount = actions.Count();
31 for (int i = 0; i < actionCount; ++i)
32 {
33 UAInput input = GetUApi().GetInputByID(actions.Get(i));
34 if (!input)
35 continue;
36
37 if (item_index < actionMax)
38 {
39 output = "";
40 option_text = "";
41 g_Game.GetInput().GetActionDesc(actions.Get(i), option_text);
42
43 if (SetElementTitle(input, deviceFlags, output))
44 {
45 column_index = Math.Floor(item_index / 21);
46 Widget container = m_Root.FindAnyWidget("container" + column_index);
47 if (!container)
48 continue;
49
50 Widget w = g_Game.GetWorkspace().CreateWidgets("gui/layouts/new_ui/tutorials/xbox/keybindings_panels/keybinding_panel.layout", container);
51 Widget spacer = w.FindWidget("Spacer");
52 TextWidget name = TextWidget.Cast(w.FindWidget("KeybindName"));
53 TextWidget mod = TextWidget.Cast(spacer.FindWidget("KeybindModifier"));
54 TextWidget value = TextWidget.Cast(spacer.FindWidget("KeybindButton"));
55
56 string modifier_text = "";
57 name.SetText(option_text);
58 value.SetText(output);
59
60 if (SetElementModifier(input, modifier_text))
61 {
62 mod.SetText(modifier_text);
63 }
64
65 name.Update();
66 mod.Update();
67 value.Update();
68 spacer.Update();
69
70 item_index++;
71 }
72 }
73 else
74 {
75 option_text = "";
76 g_Game.GetInput().GetActionDesc(actions.Get(i), option_text);
77 ErrorEx("input action " + option_text + " index out of bounds!", ErrorExSeverity.INFO);
78 }
79 }
80 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Определения DayZGame.c:4074
proto native UAInputAPI GetUApi()
bool SetElementModifier(UAInput pInput, out string output)
Determine the active limiter of the bindings (currently unreliable, multiple limiters can be active o...
Определения ControlMappingKeybinds.c:165
Widget m_Root
Определения SizeToChild.c:9
bool SetElementTitle(UAInput pInput, int iDeviceFlags, out string output)
assemble all active bindings at widget element
Определения ControlMappingKeybinds.c:113
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)
ErrorExSeverity
Определения EnDebug.c:62
enum ShapeType ErrorEx
array< int > TIntArray
Определения EnScript.c:733
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
WorkspaceWidget Widget
Defined in code.

Перекрестные ссылки ClearBindingPanels(), ErrorEx, Math::Floor(), g_Game, GetActiveDeviceFlags(), UAInputAPI::GetActiveInputs(), UAInputAPI::GetInputByID(), GetUApi(), m_Root, name, SetElementModifier() и SetElementTitle().

Используется в TutorialKeybinds().