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

◆ SpawnFromClipboard()

EntityAI PluginBase::SpawnFromClipboard ( )
inlineprotected

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

745 {
746 UIScriptedMenu menu_curr = g_Game.GetUIManager().GetMenu();
747
748 if ( menu_curr == NULL )
749 {
750 PlayerBase player = PlayerBase.Cast( g_Game.GetPlayer() );
751
752 if ( player && !g_Game.GetWorld().Is3rdPersonDisabled() )
753 {
754 player.SetIsInThirdPerson(!player.IsInThirdPerson());//this counters the effect of switching camera through pressing the 'V' key
755 }
756
757 vector pos_player, pos_direction;
758 GetCameraDirections(player, false, pos_player, pos_direction);
759
760 // Get item from clipboard
761 string clipboard;
762 g_Game.CopyFromClipboard(clipboard);
763
764 if (!clipboard.Contains(","))
765 {
766 //single item
767 if (DeveloperFreeCamera.IsFreeCameraEnabled())
768 SpawnItemOnCrosshair(player, clipboard.Trim(), -1, 1, 40, true );
769 else
770 SpawnEntityOnCursorDir(player, clipboard.Trim(), 1, 1);
771 }
772 else
773 {
774 TStringArray items = new TStringArray;
775 clipboard.Split( ",", items );
776
777 foreach (string item:items)
778 {
779 if (DeveloperFreeCamera.IsFreeCameraEnabled())
780 SpawnItemOnCrosshair(player, item.Trim(), -1, 1, 40, true );
781 else
782 SpawnEntityOnCursorDir(player, item.Trim(), 1, 1);
783 }
784 }
785
786 }
787
788 return NULL;
789 }
DayZGame g_Game
Определения DayZGame.c:3942
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:523
void SpawnItemOnCrosshair(PlayerBase player, string itemName, float health, float quantity, float maxDist=100, bool allowFreeflight=false, bool special=false, bool withPhysics=false)
Определения PluginDeveloper.c:461
void GetCameraDirections(Man player, bool allowFreeflight, out vector position, out vector direction)
Определения PluginDeveloper.c:410
array< string > TStringArray
Определения EnScript.c:712
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(), g_Game, GetCameraDirections(), DeveloperFreeCamera::IsFreeCameraEnabled(), SpawnEntityOnCursorDir(), SpawnItemOnCrosshair(), string::Split() и string::Trim().