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

◆ SpawnFromClipboard()

EntityAI PluginBase::SpawnFromClipboard ( )
inlineprotected

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

681 {
682 UIScriptedMenu menu_curr = GetGame().GetUIManager().GetMenu();
683
684 if ( menu_curr == NULL )
685 {
686 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
687 if ( player )
688 {
689 if ( !GetGame().GetWorld().Is3rdPersonDisabled() )
690 {
691 player.SetIsInThirdPerson(!player.IsInThirdPerson());//this counters the effect of switching camera through pressing the 'V' key
692 }
693
694 vector pos_player = player.GetPosition();
695
696 // Get item from clipboard
697 string clipboard;
698 GetGame().CopyFromClipboard(clipboard);
699
700 if (!clipboard.Contains(","))
701 {
702 //single item
703 if (DeveloperFreeCamera.IsFreeCameraEnabled())
704 SpawnItemOnCrosshair(player, clipboard.Trim(), -1, 1, 40, true );
705 else
706 SpawnEntityOnCursorDir(player, clipboard.Trim(), 1, 1);
707 }
708 else
709 {
710 TStringArray items = new TStringArray;
711 clipboard.Split( ",", items );
712
713 foreach (string item:items)
714 {
715 if (DeveloperFreeCamera.IsFreeCameraEnabled())
716 SpawnItemOnCrosshair(player, item.Trim(), -1, 1, 40, true );
717 else
718 SpawnEntityOnCursorDir(player, item.Trim(), 1, 1);
719 }
720 }
721
722 }
723 }
724
725 return NULL;
726 }
PlayerBase GetPlayer()
Определения ModifierBase.c:51
proto native UIManager GetUIManager()
proto void CopyFromClipboard(out string text)
EntityAI SpawnEntityOnCursorDir(PlayerBase player, string item_name, float quantity, float distance, float health=-1, bool special=false, string presetName="", bool withPhysics=false)
spawns entity in direction of cursor at specified distance
Определения PluginDeveloper.c:459
void SpawnItemOnCrosshair(notnull PlayerBase player, string itemName, float health, float quantity, float maxDist=100, bool allowFreeflight=false, bool special=false, bool withPhysics=false)
Определения PluginDeveloper.c:389
proto native UIScriptedMenu GetMenu()
Returns most-top open menu.
proto native CGame GetGame()
array< string > TStringArray
Определения EnScript.c:685
proto string Trim()
Returns trimmed string with removed leading and trailing whitespaces.
bool Contains(string sample)
Returns true if sample is substring of string.
Определения EnString.c:286
void Split(string sample, out array< string > output)
Splits string into array of strings separated by 'sample'.
Определения EnString.c:396

Перекрестные ссылки string::Contains(), CGame::CopyFromClipboard(), GetGame(), UIManager::GetMenu(), GetPlayer(), CGame::GetUIManager(), DeveloperFreeCamera::IsFreeCameraEnabled(), SpawnEntityOnCursorDir(), SpawnItemOnCrosshair(), string::Split() и string::Trim().