DayZ
1.24
Loading...
Searching...
No Matches
KeysToUIElements.c
Go to the documentation of this file.
1
//
2
// Keep this Object up-to-date with KeyCodes Enum in EnSystem.c
3
//
4
// KeysToUIElements is mapping of KeyCodes to its literal name or icon from ImageSet
5
// that will be displayed in floating widget for Default Actions - aka Action Target Selection
6
7
typedef
Param2<string, bool>
KeyToUIElement
;
8
9
class
KeysToUIElements
10
{
11
static
private
ref
map<int, ref KeyToUIElement>
m_KeysToUIElements
;
12
13
static
private
void
RegisterKeyToUIElement
(
int
key_code
,
string
name
,
bool
is_image_set
)
14
{
15
if
(
m_KeysToUIElements
==
NULL
)
16
m_KeysToUIElements
=
new
map<int, ref KeyToUIElement>
;
17
18
if
(
m_KeysToUIElements
.Contains(
key_code
))
19
Debug
.
Log
(
"Template ID: "
+
string
.
ToString
(
key_code
) +
" is alredy exist!"
,
"KeysToUIElements -> OnInit()"
,
"System"
,
"KeysToUIElements Registration"
,
"None"
);
20
else
21
{
22
KeyToUIElement
params
=
new
KeyToUIElement
(
name
,
is_image_set
);
23
m_KeysToUIElements
.Set(
key_code
,
params
);
24
}
25
}
26
27
static
KeyToUIElement
GetKeyToUIElement
(
int
key_code
)
28
{
29
if
(
m_KeysToUIElements
&&
m_KeysToUIElements
.Contains(
key_code
))
30
return
m_KeysToUIElements
.Get(
key_code
);
31
32
Debug
.
Log
(
"Template ID: "
+
string
.
ToString
(
key_code
) +
" does not exist!"
,
"KeysToUIElements -> GetKeysToUIElement()"
,
"System"
,
"Get KeysToUIElements"
,
"None"
);
33
return
NULL
;
34
}
35
36
static
void
Init
()
37
{
40
// | KeyCode | Name | is_image_set //
41
RegisterKeyToUIElement
(
KeyCode
.KC_ESCAPE,
"ESC"
,
false
);
42
RegisterKeyToUIElement
(
KeyCode
.KC_1,
"1"
,
false
);
43
RegisterKeyToUIElement
(
KeyCode
.KC_2,
"2"
,
false
);
44
RegisterKeyToUIElement
(
KeyCode
.KC_3,
"3"
,
false
);
45
RegisterKeyToUIElement
(
KeyCode
.KC_4,
"4"
,
false
);
46
RegisterKeyToUIElement
(
KeyCode
.KC_5,
"5"
,
false
);
47
RegisterKeyToUIElement
(
KeyCode
.KC_6,
"6"
,
false
);
48
RegisterKeyToUIElement
(
KeyCode
.KC_7,
"7"
,
false
);
49
RegisterKeyToUIElement
(
KeyCode
.KC_8,
"8"
,
false
);
50
RegisterKeyToUIElement
(
KeyCode
.KC_9,
"9"
,
false
);
51
RegisterKeyToUIElement
(
KeyCode
.KC_0,
"0"
,
false
);
52
RegisterKeyToUIElement
(
KeyCode
.KC_MINUS,
"-"
,
false
);
53
RegisterKeyToUIElement
(
KeyCode
.KC_EQUALS,
"="
,
false
);
54
RegisterKeyToUIElement
(
KeyCode
.KC_BACK,
"BKSPC"
,
false
);
55
RegisterKeyToUIElement
(
KeyCode
.KC_TAB,
"TAB"
,
false
);
56
RegisterKeyToUIElement
(
KeyCode
.KC_Q,
"Q"
,
false
);
57
RegisterKeyToUIElement
(
KeyCode
.KC_W,
"W"
,
false
);
58
RegisterKeyToUIElement
(
KeyCode
.KC_E,
"E"
,
false
);
59
RegisterKeyToUIElement
(
KeyCode
.KC_R,
"R"
,
false
);
60
RegisterKeyToUIElement
(
KeyCode
.KC_T,
"T"
,
false
);
61
RegisterKeyToUIElement
(
KeyCode
.KC_Y,
"Y"
,
false
);
62
RegisterKeyToUIElement
(
KeyCode
.KC_U,
"U"
,
false
);
63
RegisterKeyToUIElement
(
KeyCode
.KC_I,
"I"
,
false
);
64
RegisterKeyToUIElement
(
KeyCode
.KC_O,
"O"
,
false
);
65
RegisterKeyToUIElement
(
KeyCode
.KC_P,
"P"
,
false
);
66
RegisterKeyToUIElement
(
KeyCode
.KC_LBRACKET,
"("
,
false
);
67
RegisterKeyToUIElement
(
KeyCode
.KC_RBRACKET,
")"
,
false
);
68
RegisterKeyToUIElement
(
KeyCode
.KC_RETURN,
"ENTER"
,
false
);
69
RegisterKeyToUIElement
(
KeyCode
.KC_LCONTROL,
"LCTRL"
,
false
);
70
RegisterKeyToUIElement
(
KeyCode
.KC_A,
"A"
,
false
);
71
RegisterKeyToUIElement
(
KeyCode
.KC_S,
"S"
,
false
);
72
RegisterKeyToUIElement
(
KeyCode
.KC_D,
"D"
,
false
);
73
RegisterKeyToUIElement
(
KeyCode
.KC_F,
"F"
,
false
);
74
RegisterKeyToUIElement
(
KeyCode
.KC_G,
"G"
,
false
);
75
RegisterKeyToUIElement
(
KeyCode
.KC_H,
"H"
,
false
);
76
RegisterKeyToUIElement
(
KeyCode
.KC_J,
"J"
,
false
);
77
RegisterKeyToUIElement
(
KeyCode
.KC_K,
"K"
,
false
);
78
RegisterKeyToUIElement
(
KeyCode
.KC_L,
"L"
,
false
);
79
RegisterKeyToUIElement
(
KeyCode
.KC_SEMICOLON,
";"
,
false
);
80
RegisterKeyToUIElement
(
KeyCode
.KC_APOSTROPHE,
"'"
,
false
);
81
RegisterKeyToUIElement
(
KeyCode
.KC_GRAVE,
"`"
,
false
);
82
RegisterKeyToUIElement
(
KeyCode
.KC_LSHIFT,
"LSHIFT"
,
false
);
83
RegisterKeyToUIElement
(
KeyCode
.KC_BACKSLASH,
"\\"
,
false
);
84
RegisterKeyToUIElement
(
KeyCode
.KC_Z,
"Z"
,
false
);
85
RegisterKeyToUIElement
(
KeyCode
.KC_X,
"X"
,
false
);
86
RegisterKeyToUIElement
(
KeyCode
.KC_C,
"C"
,
false
);
87
RegisterKeyToUIElement
(
KeyCode
.KC_V,
"V"
,
false
);
88
RegisterKeyToUIElement
(
KeyCode
.KC_B,
"B"
,
false
);
89
RegisterKeyToUIElement
(
KeyCode
.KC_N,
"N"
,
false
);
90
RegisterKeyToUIElement
(
KeyCode
.KC_M,
"M"
,
false
);
91
RegisterKeyToUIElement
(
KeyCode
.KC_COMMA,
","
,
false
);
92
RegisterKeyToUIElement
(
KeyCode
.KC_PERIOD,
"."
,
false
);
93
RegisterKeyToUIElement
(
KeyCode
.KC_SLASH,
"/"
,
false
);
94
RegisterKeyToUIElement
(
KeyCode
.KC_RSHIFT,
"RSHIFT"
,
false
);
95
RegisterKeyToUIElement
(
KeyCode
.KC_MULTIPLY,
"*"
,
false
);
96
RegisterKeyToUIElement
(
KeyCode
.KC_LMENU,
"LALT"
,
false
);
97
RegisterKeyToUIElement
(
KeyCode
.KC_SPACE,
"SPACE"
,
false
);
98
RegisterKeyToUIElement
(
KeyCode
.KC_CAPITAL,
"CPSLOCK"
,
false
);
99
RegisterKeyToUIElement
(
KeyCode
.KC_F1,
"F1"
,
false
);
100
RegisterKeyToUIElement
(
KeyCode
.KC_F2,
"F2"
,
false
);
101
RegisterKeyToUIElement
(
KeyCode
.KC_F3,
"F3"
,
false
);
102
RegisterKeyToUIElement
(
KeyCode
.KC_F4,
"F4"
,
false
);
103
RegisterKeyToUIElement
(
KeyCode
.KC_F5,
"F5"
,
false
);
104
RegisterKeyToUIElement
(
KeyCode
.KC_F6,
"F6"
,
false
);
105
RegisterKeyToUIElement
(
KeyCode
.KC_F7,
"F7"
,
false
);
106
RegisterKeyToUIElement
(
KeyCode
.KC_F8,
"F8"
,
false
);
107
RegisterKeyToUIElement
(
KeyCode
.KC_F9,
"F9"
,
false
);
108
RegisterKeyToUIElement
(
KeyCode
.KC_F10,
"F10"
,
false
);
109
RegisterKeyToUIElement
(
KeyCode
.KC_NUMLOCK,
"NMLOCK"
,
false
);
110
RegisterKeyToUIElement
(
KeyCode
.KC_SCROLL,
"SCRLOCK"
,
false
);
111
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPAD7,
"Num7"
,
false
);
112
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPAD8,
"Num8"
,
false
);
113
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPAD9,
"Num9"
,
false
);
114
RegisterKeyToUIElement
(
KeyCode
.KC_SUBTRACT,
"Num-"
,
false
);
115
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPAD4,
"Num4"
,
false
);
116
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPAD5,
"Num5"
,
false
);
117
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPAD6,
"Num6"
,
false
);
118
RegisterKeyToUIElement
(
KeyCode
.KC_ADD,
"Num+"
,
false
);
119
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPAD1,
"Num1"
,
false
);
120
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPAD2,
"Num2"
,
false
);
121
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPAD3,
"Num3"
,
false
);
122
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPAD0,
"Num0"
,
false
);
123
RegisterKeyToUIElement
(
KeyCode
.KC_DECIMAL,
"Num."
,
false
);
124
//RegisterKeyToUIElement( KeyCode.KC_OEM_102, ///< < > | on UK/Germany keyboards
125
RegisterKeyToUIElement
(
KeyCode
.KC_F11,
"F11"
,
false
);
126
RegisterKeyToUIElement
(
KeyCode
.KC_F12,
"F12"
,
false
);
127
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPADEQUALS,
"Num="
,
false
);
128
RegisterKeyToUIElement
(
KeyCode
.KC_PREVTRACK,
"PrevTrack"
,
false
);
129
//RegisterKeyToUIElement( KeyCode.KC_AT, ///< (NEC PC98)
130
RegisterKeyToUIElement
(
KeyCode
.KC_COLON,
":"
,
false
);
131
RegisterKeyToUIElement
(
KeyCode
.KC_UNDERLINE,
"_"
,
false
);
132
//RegisterKeyToUIElement( KeyCode.KC_STOP, ///< (NEC PC98)
133
//RegisterKeyToUIElement( KeyCode.KC_AX, ///< (Japan AX)
134
//RegisterKeyToUIElement( KeyCode.KC_UNLABELED, ///< (J3100)
135
RegisterKeyToUIElement
(
KeyCode
.KC_NEXTTRACK,
"NextTrack"
,
false
);
136
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPADENTER,
"NumEnter"
,
false
);
137
RegisterKeyToUIElement
(
KeyCode
.KC_RCONTROL,
"RCTRL"
,
false
);
138
RegisterKeyToUIElement
(
KeyCode
.KC_MUTE,
"Mute"
,
false
);
139
RegisterKeyToUIElement
(
KeyCode
.KC_CALCULATOR,
"Calc"
,
false
);
140
RegisterKeyToUIElement
(
KeyCode
.KC_PLAYPAUSE,
"Play"
,
false
);
141
RegisterKeyToUIElement
(
KeyCode
.KC_MEDIASTOP,
"Stop"
,
false
);
142
RegisterKeyToUIElement
(
KeyCode
.KC_VOLUMEDOWN,
"Vol-"
,
false
);
143
RegisterKeyToUIElement
(
KeyCode
.KC_VOLUMEUP,
"Vol+"
,
false
);
144
RegisterKeyToUIElement
(
KeyCode
.KC_WEBHOME,
"Web Home"
,
false
);
145
RegisterKeyToUIElement
(
KeyCode
.KC_NUMPADCOMMA,
"Num,"
,
false
);
146
RegisterKeyToUIElement
(
KeyCode
.KC_DIVIDE,
"Num/"
,
false
);
147
RegisterKeyToUIElement
(
KeyCode
.KC_SYSRQ,
"SysRq"
,
false
);
148
RegisterKeyToUIElement
(
KeyCode
.KC_RMENU,
"RALT"
,
false
);
149
RegisterKeyToUIElement
(
KeyCode
.KC_PAUSE,
"Pause"
,
false
);
150
RegisterKeyToUIElement
(
KeyCode
.KC_HOME,
"Home"
,
false
);
151
RegisterKeyToUIElement
(
KeyCode
.KC_UP,
"ArrowUp"
,
false
);
152
RegisterKeyToUIElement
(
KeyCode
.KC_PRIOR,
"PageUp"
,
false
);
153
RegisterKeyToUIElement
(
KeyCode
.KC_LEFT,
"ArrowLeft"
,
false
);
154
RegisterKeyToUIElement
(
KeyCode
.KC_RIGHT,
"ArrowRight"
,
false
);
155
RegisterKeyToUIElement
(
KeyCode
.KC_END,
"End"
,
false
);
156
RegisterKeyToUIElement
(
KeyCode
.KC_DOWN,
"ArrowDown"
,
false
);
157
RegisterKeyToUIElement
(
KeyCode
.KC_NEXT,
"PgDn"
,
false
);
158
RegisterKeyToUIElement
(
KeyCode
.KC_INSERT,
"Insert"
,
false
);
159
RegisterKeyToUIElement
(
KeyCode
.KC_DELETE,
"Delete"
,
false
);
160
RegisterKeyToUIElement
(
KeyCode
.KC_LWIN,
"LWIN"
,
false
);
161
RegisterKeyToUIElement
(
KeyCode
.KC_RWIN,
"RWIN"
,
false
);
162
//RegisterKeyToUIElement( KeyCode.KC_APPS, ///< AppMenu key
163
//RegisterKeyToUIElement( KeyCode.KC_POWER, ///< System Power
164
//RegisterKeyToUIElement( KeyCode.KC_SLEEP, ///< System Sleep
165
//RegisterKeyToUIElement( KeyCode.KC_WAKE, ///< System Wake
166
//RegisterKeyToUIElement( KeyCode.KC_MEDIASELECT ///< Media Selection
167
// Mouse buttons
168
RegisterKeyToUIElement
(1048576,
"set:dayz_gui image:left_mouse"
,
true
);
169
RegisterKeyToUIElement
(1048577,
"set:dayz_gui image:right_mouse"
,
true
);
170
RegisterKeyToUIElement
(1048578,
"set:dayz_gui image:middle_mouse"
,
true
);
171
}
172
}
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
ToString
proto string ToString()
KeyToUIElement
Param2< string, bool > KeyToUIElement
Definition
KeysToUIElements.c:7
Debug
Definition
Debug.c:14
Debug::Log
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition
Debug.c:133
KeysToUIElements
Definition
KeysToUIElements.c:10
KeysToUIElements::RegisterKeyToUIElement
void RegisterKeyToUIElement(int key_code, string name, bool is_image_set)
Definition
KeysToUIElements.c:13
KeysToUIElements::Init
static void Init()
Definition
KeysToUIElements.c:36
KeysToUIElements::m_KeysToUIElements
ref map< int, ref KeyToUIElement > m_KeysToUIElements
Definition
KeysToUIElements.c:11
KeysToUIElements::GetKeyToUIElement
static KeyToUIElement GetKeyToUIElement(int key_code)
Definition
KeysToUIElements.c:27
Param2
Definition
PPEConstants.c:67
Param3
Definition
EntityAI.c:95
KeyCode
KeyCode
Definition
EnSystem.c:157
scripts
3_Game
tools
KeysToUIElements.c
Generated by
1.10.0