Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс InputUtils

Защищенные статические члены

static string GetButtonNameFromInput (string pInputName, int pInputDeviceType)
 
static map< int, ref TStringArrayGetComboButtonNamesFromInput (string pInputName, int pInputDeviceType)
 returns a map of button names, combo or not
 
static array< stringGetButtonIconPathFromInput (notnull UAInput pInput, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER)
 
static array< stringGetButtonIconPathFromInput (string pInputName, int pInputDeviceType)
 
static void GetImagesetAndIconFromInputAction (notnull UAInput pInput, int pInputDeviceType, out array< string > pImageSet, out array< string > pIconName)
 
static void GetImagesetAndIconFromInputAction (string pInputAction, int pInputDeviceType, out array< string > pImageSet, out array< string > pIconName)
 
static string GetRichtextButtonIconFromInputAction (notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
 
static string GetRichtextButtonIconFromInputAction (string pInputAction, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
 
static void UpdateConsolePresetID ()
 
static int GetConsolePresetID ()
 
static map< int, ref array< int > > GetInputActionSortingMap ()
 
static array< intGetUnsortedInputActions ()
 
static bool InitInputMetadata ()
 

Статические защищенные данные

ref map< int, ref array< int > > m_InputActionSortingMap
 
ref array< intm_UnsortedInputActions
 
static const float ICON_SCALE_NORMAL = 1.21
 
static const float ICON_SCALE_TOOLBAR = 1.81
 

Закрытые статические данные

static const string PRESET_OLD = "#STR_UAPRESET_0"
 
static const string PRESET_NEW = "#STR_UAPRESET_1"
 
static const int VARIANT_OLD = 0
 
static const int VARIANT_NEW = 1
 
static int m_CurrentPresetIDConsole = -1
 

Подробное описание

Методы

◆ GetButtonIconPathFromInput() [1/2]

static array< string > GetButtonIconPathFromInput ( notnull UAInput pInput,
int pInputDeviceType = EUAINPUT_DEVICE_CONTROLLER )
inlinestaticprotected
78 {
80
81 for (int i = 0; i < pInput.AlternativeCount(); i++)
82 {
83 pInput.SelectAlternative(i);
84 bool done = false;
85 for (int bk = 0; bk < pInput.BindKeyCount(); bk++)
86 {
87 if (pInput.CheckBindDevice(0, pInputDeviceType))
88 {
89 buttonIcons.Insert(GetUApi().GetButtonIcon(pInput.Binding(bk)));
90
91 if (bk == pInput.BindKeyCount() - 1)
92 {
93 done = true;
94 }
95 }
96 }
97
98 if (done)
99 {
100 buttonIcons.Invert();
101 return buttonIcons;
102 }
103 }
104
105 return buttonIcons;
106 }
proto native UAInputAPI GetUApi()
Definition EntityAI.c:95

Перекрестные ссылки GetUApi().

Используется в GetButtonIconPathFromInput() и GetImagesetAndIconFromInputAction().

◆ GetButtonIconPathFromInput() [2/2]

static array< string > GetButtonIconPathFromInput ( string pInputName,
int pInputDeviceType )
inlinestaticprotected
109 {
110 UAInput inp = GetUApi().GetInputByName(pInputName);
111
114
115 return buttonIcons;
116 }
Definition InputUtils.c:2
static array< string > GetButtonIconPathFromInput(notnull UAInput pInput, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER)
Definition InputUtils.c:77
Definition UAInput.c:24

Перекрестные ссылки GetButtonIconPathFromInput() и GetUApi().

◆ GetButtonNameFromInput()

static string GetButtonNameFromInput ( string pInputName,
int pInputDeviceType )
inlinestaticprotected
18 {
19 UAInput inp = GetUApi().GetInputByName(pInputName);
20 for (int i = 0; i < inp.AlternativeCount(); i++)
21 {
22 inp.SelectAlternative(i);
23 if (inp.CheckBindDevice(0, pInputDeviceType))
24 {
25 return GetUApi().GetButtonName(inp.GetBindKey(0));
26 }
27 }
28
29 return "";
30 }

Перекрестные ссылки GetUApi().

Используется в ActionTargetsCursor::SetInteractActionIcon().

◆ GetComboButtonNamesFromInput()

static map< int, ref TStringArray > GetComboButtonNamesFromInput ( string pInputName,
int pInputDeviceType )
inlinestaticprotected

returns a map of button names, combo or not

34 {
35 UAInput inp = GetUApi().GetInputByName(pInputName);
37 map<int,ref TStringArray> output;//<alternativeIDX<button_array>>
38 for (int i = 0; i < inp.AlternativeCount(); i++)
39 {
40 inp.SelectAlternative(i);
41 if (inp.BindingCount() > 0 && inp.Binding(0) != 0 && inp.CheckBindDevice(0,pInputDeviceType))
42 {
44 if (inp.IsCombo())
45 {
46 buttons.Insert(GetUApi().GetButtonName( inp.Binding(0) ));
47
48 for (int j = 1; j < inp.BindingCount(); j++)
49 {
50 if (inp.Binding(j) != 0 && inp.CheckBindDevice(j,pInputDeviceType))
51 {
52 buttons.Insert(GetUApi().GetButtonName( inp.Binding(j) ));
53 }
54 }
55 //return buttons;
56 }
57 else
58 {
59 buttons.Insert(GetUApi().GetButtonName(inp.GetBindKey(0)));
60 //return buttons;
61 }
62
63 if (buttons.Count() > 0)
64 {
65 if (!output)
66 {
68 }
69 output.Insert(i,buttons);
70 }
71 }
72 }
73
74 return output;
75 }
array< string > TStringArray
Definition EnScript.c:685

Перекрестные ссылки GetUApi().

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

◆ GetConsolePresetID()

static int GetConsolePresetID ( )
inlinestaticprotected
225 {
227 }
static int m_CurrentPresetIDConsole
Definition InputUtils.c:8

Перекрестные ссылки m_CurrentPresetIDConsole.

Используется в UIScriptedMenu::UpdateTabContent().

◆ GetImagesetAndIconFromInputAction() [1/2]

static void GetImagesetAndIconFromInputAction ( notnull UAInput pInput,
int pInputDeviceType,
out array< string > pImageSet,
out array< string > pIconName )
inlinestaticprotected

Asia vs Europe/N.America controller layout

119 {
121 if (buttons.Count() == 0 )
122 {
123 return;
124 }
125
126 for (int i = 0; i < buttons.Count(); i++)
127 {
129 buttons.Get(i).Split(":", parts);
130
131 if (parts.Count() < 2)
132 {
133 return;
134 }
135
136 pImageSet.Insert(parts[1].SubstringInverted(parts[1], parts[1].Length() - 6, parts[1].Length()));
137
139 #ifdef PLATFORM_PS4
140 if (GetGame().GetInput().GetEnterButton() == GamepadButton.B)
141 {
143 if (parts[2] == "cross")
144 {
145 parts[2] = "circle";
146 }
147
149 if (parts[2] == "circle")
150 {
151 parts[2] = "cross";
152 }
153 }
154 #endif
155
156 pIconName.Insert(parts[2]);
157 }
158 }
ActionInput GetInput()
Definition ActionBase.c:1066
proto native CGame GetGame()
GamepadButton
Definition EnSystem.c:341

Перекрестные ссылки GetButtonIconPathFromInput(), GetGame() и GetInput().

Используется в GetImagesetAndIconFromInputAction(), GetRichtextButtonIconFromInputAction() и GetRichtextButtonIconFromInputAction().

◆ GetImagesetAndIconFromInputAction() [2/2]

static void GetImagesetAndIconFromInputAction ( string pInputAction,
int pInputDeviceType,
out array< string > pImageSet,
out array< string > pIconName )
inlinestaticprotected
161 {
162 UAInput inp = GetUApi().GetInputByName(pInputAction);
163
165 }
static void GetImagesetAndIconFromInputAction(notnull UAInput pInput, int pInputDeviceType, out array< string > pImageSet, out array< string > pIconName)
Definition InputUtils.c:118

Перекрестные ссылки GetImagesetAndIconFromInputAction() и GetUApi().

◆ GetInputActionSortingMap()

static map< int, ref array< int > > GetInputActionSortingMap ( )
inlinestaticprotected
230 {
232 }
ref map< int, ref array< int > > m_InputActionSortingMap
Definition InputUtils.c:11

Перекрестные ссылки m_InputActionSortingMap.

Используется в array::AddSubgroup(), array::CreateSubgroups() и UIScriptedMenu::CreateTabs().

◆ GetRichtextButtonIconFromInputAction() [1/2]

static string GetRichtextButtonIconFromInputAction ( notnull UAInput pInput,
string pLocalizedDescription,
int pInputDeviceType = EUAINPUT_DEVICE_CONTROLLER,
float pScale = ICON_SCALE_NORMAL,
bool pVertical = false )
inlinestaticprotected

first element is already taken

168 {
172
173 if (imageSets.Count() == 0)
174 {
175 return "";
176 }
177
178 string result = string.Format("<image set=\"%1\" name=\"%2\" scale=\"%3\" />", imageSets.Get(0), iconNames.Get(0), pScale);
179
180 string divider = " ";
181 if (pVertical)
182 {
183 divider = string.Format("\n%1\n", divider);
184 }
185
186 if (imageSets.Count() > 1)
187 {
189 for (int i = 1; i < imageSets.Count(); i++)
190 {
191 result = string.Format("%1%2<image set=\"%3\" name=\"%4\" scale=\"%5\" />", result, divider, imageSets.Get(i), iconNames.Get(i), pScale);
192 }
193 }
194
195 return string.Format("%1 %2", result, pLocalizedDescription);
196 }

Перекрестные ссылки GetImagesetAndIconFromInputAction().

Используется в GetRichtextButtonIconFromInputAction(), Init(), LoginScreenBase::Init(), UIScriptedMenu::Init(), Inventory(), ActionTargetsCursor::SetControllerIcon(), ScriptedWidgetEventHandler::SetControllerIcon(), UIScriptedMenu::UpdateControlsElements(), WarningMenuBase::UpdateControlsElements(), ScriptedWidgetEventHandler::UpdateControlsElements() и UIScriptedMenu::UpdateInfoPanelText().

◆ GetRichtextButtonIconFromInputAction() [2/2]

static string GetRichtextButtonIconFromInputAction ( string pInputAction,
string pLocalizedDescription,
int pInputDeviceType = EUAINPUT_DEVICE_CONTROLLER,
float pScale = ICON_SCALE_NORMAL,
bool pVertical = false )
inlinestaticprotected
199 {
200 UAInput inp = GetUApi().GetInputByName(pInputAction);
201
205
207 }
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Definition InputUtils.c:167

Перекрестные ссылки GetImagesetAndIconFromInputAction(), GetRichtextButtonIconFromInputAction() и GetUApi().

◆ GetUnsortedInputActions()

static array< int > GetUnsortedInputActions ( )
inlinestaticprotected
235 {
237 }
ref array< int > m_UnsortedInputActions
Definition InputUtils.c:12

Перекрестные ссылки m_UnsortedInputActions.

Используется в array::AddSubgroup(), array::CreateSubgroups() и UIScriptedMenu::CreateTabs().

◆ InitInputMetadata()

static bool InitInputMetadata ( )
inlinestaticprotected
240 {
242 {
244
247 {
249 }
250 GetUApi().GetActiveInputs(m_UnsortedInputActions);
251
252 UAInput inp;
253
254 for (int i = 0; i < GetUApi().SortingCount(); i++)
255 {
256 int input_id;
258 for (int j = 0; j < m_UnsortedInputActions.Count(); j++)
259 {
261 inp = GetUApi().GetInputByID(input_id);
262 if (inp.HasSorting(i))
263 {
265 sorted_actions.Insert(input_id);
266 }
267 }
268
269 if (sorting_content.Count() > 0)
270 {
271 sorting_content.Sort();
273 }
274 }
275
276 //remove sorted used inputs
277 int count = sorted_actions.Count();
278 for (i = 0; i < count; i++)
279 {
281 }
282 return true;
283 }
284 return false;
285 }
array< int > TIntArray
Definition EnScript.c:687

Перекрестные ссылки GetUApi(), m_InputActionSortingMap и m_UnsortedInputActions.

Используется в UIScriptedMenu::InitInputSortingMap().

◆ UpdateConsolePresetID()

static void UpdateConsolePresetID ( )
inlinestaticprotected
210 {
211 string profile_name;
212 GetGame().GetInput().GetProfileName(GetUApi().PresetCurrent(), profile_name);
213
215 {
217 }
218 else
219 {
221 }
222 }
static const int VARIANT_NEW
Definition InputUtils.c:7
static const int VARIANT_OLD
Definition InputUtils.c:6
static const string PRESET_OLD
Definition InputUtils.c:4

Перекрестные ссылки GetGame(), GetUApi(), m_CurrentPresetIDConsole, PRESET_OLD, VARIANT_NEW и VARIANT_OLD.

Используется в UIScriptedMenu::ComposeData() и UIScriptedMenu::PerformSwitchPreset().

Поля

◆ ICON_SCALE_NORMAL

const float ICON_SCALE_NORMAL = 1.21
staticprotected

◆ ICON_SCALE_TOOLBAR

◆ m_CurrentPresetIDConsole

int m_CurrentPresetIDConsole = -1
staticprivate

Используется в GetConsolePresetID() и UpdateConsolePresetID().

◆ m_InputActionSortingMap

ref map<int, ref array<int> > m_InputActionSortingMap
staticprotected

Используется в GetInputActionSortingMap() и InitInputMetadata().

◆ m_UnsortedInputActions

ref array<int> m_UnsortedInputActions
staticprotected

Используется в GetUnsortedInputActions() и InitInputMetadata().

◆ PRESET_NEW

const string PRESET_NEW = "#STR_UAPRESET_1"
staticprivate

Используется в UIScriptedMenu::UpdateToolbarText().

◆ PRESET_OLD

const string PRESET_OLD = "#STR_UAPRESET_0"
staticprivate

◆ VARIANT_NEW

const int VARIANT_NEW = 1
staticprivate

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

◆ VARIANT_OLD

const int VARIANT_OLD = 0
staticprivate

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


Объявления и описания членов класса находятся в файле: