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

DragQueue Class provide callbacks while mouse is dragging. Callback function must have exact arguments: Подробнее...

Закрытые члены

void DragQueue ()
 
override void Tick ()
 System function, don't call it.
 

Закрытые данные

ref Param3< int, int, boolm_mouse_params
 

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

DragQueue Class provide callbacks while mouse is dragging. Callback function must have exact arguments:

Definition EntityAI.c:95

When mouse button is released, callback function is called one more time with is_dragging = false. Then all callbacks are automatically removed from queue.


usage:

class XYZ
{
void UpdateDrag(int mouse_x, int mouse_y, bool is_dragging);
}
...
GetGame().GetDragQueue().Call(this, "UpdateDrag"); // calls "UpdateDrag" function on "this"
proto native CGame GetGame()

Методы

◆ DragQueue()

void DragQueue ( )
inlineprivate
158 {
160 }
ref Param3< int, int, bool > m_mouse_params
Definition tools.c:155

◆ Tick()

override void Tick ( )
inlineprivate

System function, don't call it.

166 {
167 if (m_processing) return;
168
169 m_processing = true;
170
171 int last_index = 0;
172 int mouse_x;
173 int mouse_y;
174 bool is_holding = false;
176
177 if (GetMouseState(MouseState.LEFT) & 0x80000000)
178 {
179 is_holding = true;
180 }
181
183
184 if (!is_holding || mouse_x != m_mouse_params.param1 || mouse_y != m_mouse_params.param2)
185 {
186 m_mouse_params.param1 = mouse_x;
187 m_mouse_params.param2 = mouse_y;
188 m_mouse_params.param3 = is_holding;
189
190 while (Count() > last_index)
191 {
192 ctx = Get(last_index);
193 if (!ctx.IsValid())
194 {
196 }
197 else
198 {
199 ctx.CallParams(m_mouse_params);
200 last_index++;
201 }
202 }
203 }
204
205 // clear queue when mouse button is released
206 if (!is_holding)
207 {
208 Clear();
209 }
210
211 m_processing = false;
212 }
void Remove(Object object)
Definition ActionTargets.c:207
array< ref PlayerStatBase > Get()
Definition PlayerStatsPCO.c:103
@ Count
Definition RandomGeneratorSyncManager.c:7
void Clear(bool clearFile=false)
Definition ScriptConsoleEnfScriptTab.c:359
Definition tools.c:16
MouseState
Definition EnSystem.c:311
proto native int GetMouseState(MouseState index)
proto void GetMousePos(out int x, out int y)

Перекрестные ссылки Clear(), Count, Get(), GetMousePos(), GetMouseState() и Remove().

Поля

◆ m_mouse_params

ref Param3<int, int, bool> m_mouse_params
private

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