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

◆ Update()

void Update ( float deltaT)
protected

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

300 {
301 // no updates on restrained characters
302 if (m_Player.IsRestrained())
303 return;
304
306 {
307 if (g_Game.IsServer() && m_Callback && !m_Player.GetItemInHands())
308 {
309 m_Player.GetHumanInventory().CreateInHands("SurrenderDummyItem");
310 }
311 m_ItemToBeCreated = false;
312 }
313
314 int gestureSlot = 0;
315 #ifndef SERVER
316 gestureSlot = DetermineGestureIndex();
317 #endif
318
319 //nuclear solution to inventory question
320 if (g_Game.IsClient() && g_Game.GetUIManager().FindMenu(MENU_INVENTORY) && IsEmotePlaying())
321 m_Player.CloseInventoryMenu();
322
323 //deferred emote cancel
324 if (m_InstantCancelEmote) //'hard' cancel
325 {
326 if (m_Callback)
327 m_Callback.Cancel();
328
331 m_InstantCancelEmote = false;
332 SetPending(false);
333
334 if (m_IsSurrendered)
336 else
337 SetEmoteLockState(false);
338 }
339 else if (m_CancelEmote) //'soft' cancel
340 {
341 SetPending(false);
342 m_CancelEmote = false;
343
344 if (m_IsSurrendered)
346 else if (m_Callback)
347 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_INTERRUPT);
348 }
349
351 {
352 ClearEmoteLauncher(true);
354 }
355
356 //if (m_DisconnectEmoteQueued && (!m_bEmoteIsPlaying && !m_bEmoteIsRequestPending))
358 {
359 if (!m_MenuEmote || !m_MenuEmote.IsStartGuaranteed())
360 {
363 m_MenuEmote.SetStartGuaranteed(true);
364
365 EmoteBase emote = EmoteBase.Cast(m_NameEmoteMap.Get(m_MenuEmote.GetID()));
366 int stanceIdx = DayZPlayerUtils.ConvertStanceMaskToStanceIdx(emote.GetStanceMaskFullbody());
367
368 //if the emote cannot be played, don't sent a request to server
369 if (!DayZPlayerUtils.PlayerCanChangeStance(m_Player, stanceIdx))
370 {
371 m_MenuEmote = null; //setting this to null also ensures that the forcedEmotQueuedClient below is also false
373 }
374 }
375 }
376
377 bool forcedEmoteQueuedClient = m_MenuEmote && !m_MenuEmote.WasSynced() && m_MenuEmote.GetForced() > EmoteLauncher.FORCE_NONE && !g_Game.IsDedicatedServer();
378 if (forcedEmoteQueuedClient) //regular forced emote playing
379 {
381 }
382 else if (m_Callback)
383 {
384 bool uiGesture = false;
385 if (!g_Game.IsDedicatedServer())
386 {
387 uiGesture = g_Game.GetUIManager().IsMenuOpen(MENU_GESTURES);
388
390 {
392 }
393
395 {
397 }
398 }
399
400 if (gestureSlot > 0 || m_GestureInterruptInput || (m_HIC.IsSingleUse() && !uiGesture) || (m_HIC.IsContinuousUseStart() && !uiGesture) || (m_Callback.m_IsFullbody && !uiGesture && m_HIC.IsWeaponRaised()))
401 {
403 {
404 if (m_Callback.GetState() == m_Callback.STATE_LOOP_LOOP)
405 {
407 }
408 else
409 {
410 return;
411 }
412 }
414 {
415 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_ACTION);
416 }
418 {
419 if (m_RPSOutcome != -1)
420 {
421 if (m_RPSOutcome == 0)
422 {
423 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_RPS_ROCK);
424 }
425 else if (m_RPSOutcome == 1)
426 {
427 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_RPS_PAPER);
428 }
429 else if (m_RPSOutcome == 2)
430 {
431 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_RPS_SCISSORS);
432 }
433 m_RPSOutcome = -1;
434 }
435 else
436 {
437 m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_END);
438 }
439 }
441 {
443 }
445 {
447 }
448 }
449
450 if (m_LastMask != -1 && m_Player.IsPlayerInStance(DayZPlayerConstants.STANCEMASK_PRONE))
451 {
452 m_Callback.Cancel();
453 }
454
455 if (m_MenuEmote && !m_MenuEmote.IsStartGuaranteed() && m_bEmoteIsPlaying)
456 {
458 }
459
461 {
463 }
464
466 {
468 }
469 }
470 //no m_Callback exists
471 else
472 {
473 if (m_bEmoteIsRequestPending && (m_Player.IsUnconscious() || !m_Player.IsAlive()))
474 {
475 SetPending(false);
476 }
477
479 {
480 OnEmoteEnd();
481 }
482 else if (!m_Player.GetItemInHands() && m_IsSurrendered && !m_ItemToBeCreated && (!m_MenuEmote || m_MenuEmote.GetForced() != EmoteLauncher.FORCE_NONE)) //play only when there is time to do so
483 {
484 PlaySurrenderInOut(false);
485 return;
486 }
487 // getting out of surrender state
488 else if (m_IsSurrendered && m_Player.GetItemInHands() && (m_HIC.IsSingleUse() || m_HIC.IsContinuousUseStart() || m_HIC.IsWeaponRaised()))
489 {
490 if (m_Player.GetItemInHands())
491 m_Player.GetItemInHands().DeleteSafe();//Note, this keeps item 'alive' until it is released by all the systems (inventory swapping etc.)
492 return;
493 }
494 // fallback in case lock does not end properly
495 else if (m_IsSurrendered && (!m_Player.GetItemInHands() || (m_Player.GetItemInHands() && m_Player.GetItemInHands().GetType() != "SurrenderDummyItem" && m_EmoteLockState)))
496 {
498 return;
499 }
500 //actual emote launch
502 {
504 //m_DeferredGuaranteedEmoteId = CALLBACK_CMD_INVALID;
505 }
507 {
510 }
511 //client-side emote launcher
512 else if (!m_bEmoteIsPlaying && m_MenuEmote && !m_MenuEmote.WasSynced() && !g_Game.IsDedicatedServer())
513 {
515 }
516 else if (!m_MenuEmote && gestureSlot > 0)
517 {
518 CreateEmoteCBFromMenu(gestureSlot,true); //translation no longer needed
519 }
520 }
521 }
map m_Player
DayZGame g_Game
Определения DayZGame.c:3942
void DayZPlayerUtils()
cannot be instantiated
Определения DayZPlayerUtils.c:465
bool m_DisconnectEmoteQueued
Определения EmoteManager.c:138
EmoteCB m_Callback
Определения EmoteManager.c:125
bool ClearDeferredExecution()
Определения EmoteManager.c:862
const int CALLBACK_CMD_END
Определения EmoteManager.c:156
int m_RPSOutcome
Определения EmoteManager.c:153
void CreateEmoteCBFromMenu(int id, bool interrupts_same=false)
Определения EmoteManager.c:847
const int CALLBACK_CMD_INVALID
Определения EmoteManager.c:155
int m_CurrentGestureID
Определения EmoteManager.c:151
bool m_CancelEmote
Определения EmoteManager.c:135
int m_DeferredEmoteExecution
Определения EmoteManager.c:148
bool m_DeferredEmoteLauncherCleanup
Определения EmoteManager.c:139
int m_DeferredGuaranteedEmoteId
Определения EmoteManager.c:147
void InterruptCallbackCommand()
Определения EmoteManager.c:873
void SetPending(bool state)
Определения EmoteManager.c:293
int m_LastMask
Определения EmoteManager.c:152
void PlaySurrenderInOut(bool state)
Определения EmoteManager.c:1156
int DetermineGestureIndex()
Определения EmoteManager.c:254
void SendEmoteRequestSyncEx(notnull EmoteLauncher launcher)
To avoid mixing m_MenuEmote with exceptional sync commands.
Определения EmoteManager.c:974
void CommitSuicide()
Определения EmoteManager.c:775
bool m_GestureInterruptInput
Определения EmoteManager.c:137
void ClearSurrenderState()
Queues item deletion only, surrender state cleared from item event directly.
Определения EmoteManager.c:1284
const int CALLBACK_CMD_INSTACANCEL
Определения EmoteManager.c:158
void OnEmoteEnd()
Определения EmoteManager.c:523
void SetEmoteLockState(bool state)
Определения EmoteManager.c:1204
bool ClearEmoteLauncher(bool forced=false)
Определения EmoteManager.c:853
ref EmoteLauncher m_MenuEmote
Определения EmoteManager.c:130
bool InterruptGestureCheck()
Определения EmoteManager.c:1325
bool InterruptWaterCheck()
Определения EmoteManager.c:1354
bool IsEmotePlaying()
Определения EmoteManager.c:1370
bool m_EmoteLockState
Определения EmoteManager.c:146
bool m_ItemToBeCreated
Определения EmoteManager.c:134
bool m_IsSurrendered
Определения EmoteManager.c:133
const int CALLBACK_CMD_GESTURE_INTERRUPT
Определения EmoteManager.c:157
ref map< int, ref EmoteBase > m_NameEmoteMap
Определения EmoteManager.c:162
HumanInputController m_HIC
Определения EmoteManager.c:126
void EndCallbackCommand()
Определения EmoteManager.c:881
bool m_bEmoteIsPlaying
Определения EmoteManager.c:132
bool m_InstantCancelEmote
Определения EmoteManager.c:136
bool m_bEmoteIsRequestPending
Определения EmoteManager.c:131
void SendEmoteRequestSync(int id)
Определения EmoteManager.c:897
bool PlayEmote(int id)
Определения EmoteManager.c:673
int GetStanceMaskFullbody()
Определения EmoteBase.c:80
Определения EmoteBase.c:2
static const int FORCE_NONE
Определения EmoteManager.c:66
static const int FORCE_DIFFERENT
Определения EmoteManager.c:67
Определения EmoteManager.c:65
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
const int ID_EMOTE_RPS_P
Определения 3_Game/DayZ/constants.c:394
const int ID_EMOTE_RPS
Определения 3_Game/DayZ/constants.c:383
const int ID_EMOTE_SITA
Определения 3_Game/DayZ/constants.c:373
const int ID_EMOTE_THUMB
Определения 3_Game/DayZ/constants.c:368
const int ID_EMOTE_RPS_S
Определения 3_Game/DayZ/constants.c:395
const int ID_EMOTE_SUICIDE
Определения 3_Game/DayZ/constants.c:370
const int ID_EMOTE_RPS_R
Определения 3_Game/DayZ/constants.c:393
const int ID_EMOTE_THUMBDOWN
Определения 3_Game/DayZ/constants.c:375
const int MENU_GESTURES
Определения 3_Game/DayZ/constants.c:194
const int MENU_INVENTORY
Определения 3_Game/DayZ/constants.c:180

Перекрестные ссылки CALLBACK_CMD_END, CALLBACK_CMD_GESTURE_INTERRUPT, CALLBACK_CMD_INSTACANCEL, CALLBACK_CMD_INVALID, ClearDeferredExecution(), ClearEmoteLauncher(), ClearSurrenderState(), CommitSuicide(), CreateEmoteCBFromMenu(), DayZPlayerUtils(), DetermineGestureIndex(), EndCallbackCommand(), EmoteLauncher::FORCE_DIFFERENT, EmoteLauncher::FORCE_NONE, g_Game, EmoteBase::GetStanceMaskFullbody(), EmoteConstants::ID_EMOTE_RPS, EmoteConstants::ID_EMOTE_RPS_P, EmoteConstants::ID_EMOTE_RPS_R, EmoteConstants::ID_EMOTE_RPS_S, EmoteConstants::ID_EMOTE_SITA, EmoteConstants::ID_EMOTE_SUICIDE, EmoteConstants::ID_EMOTE_THUMB, EmoteConstants::ID_EMOTE_THUMBDOWN, InterruptCallbackCommand(), InterruptGestureCheck(), InterruptWaterCheck(), IsEmotePlaying(), m_bEmoteIsPlaying, m_bEmoteIsRequestPending, m_Callback, m_CancelEmote, m_CurrentGestureID, m_DeferredEmoteExecution, m_DeferredEmoteLauncherCleanup, m_DeferredGuaranteedEmoteId, m_DisconnectEmoteQueued, m_EmoteLockState, m_GestureInterruptInput, m_HIC, m_InstantCancelEmote, m_IsSurrendered, m_ItemToBeCreated, m_LastMask, m_MenuEmote, m_NameEmoteMap, m_RPSOutcome, MENU_GESTURES, MENU_INVENTORY, OnEmoteEnd(), PlayEmote(), PlaySurrenderInOut(), SendEmoteRequestSync(), SendEmoteRequestSyncEx(), SetEmoteLockState() и SetPending().