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

◆ SpawnFromClipboard()

EntityAI PluginBase::SpawnFromClipboard ( )
inlineprotected

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

794 {
795 UIScriptedMenu menu_curr = g_Game.GetUIManager().GetMenu();
796
797 if ( menu_curr == NULL )
798 {
799 PlayerBase player = PlayerBase.Cast( g_Game.GetPlayer() );
800
801 if ( player && g_Game.GetWorld().GetThirdPersonViewMode() == ThirdPersonMode.ENABLED )
802 {
803 player.SetIsInThirdPerson(!player.IsInThirdPerson());//this counters the effect of switching camera through pressing the 'V' key
804 }
805
806 vector pos_player, pos_direction;
807 GetCameraDirections(player, false, pos_player, pos_direction);
808
809 // Get item from clipboard
810 string clipboard;
811 g_Game.CopyFromClipboard(clipboard);
812
813 if (!clipboard.Contains(","))
814 {
815 //single item
816 if (DeveloperFreeCamera.IsFreeCameraEnabled())
817 SpawnItemOnCrosshair(player, clipboard.Trim(), -1, 1, 40, true );
818 else
819 SpawnEntityOnCursorDir(player, clipboard.Trim(), 1, 1);
820 }
821 else
822 {
823 TStringArray items = new TStringArray;
824 clipboard.Split( ",", items );
825
826 foreach (string item:items)
827 {
828 if (DeveloperFreeCamera.IsFreeCameraEnabled())
829 SpawnItemOnCrosshair(player, item.Trim(), -1, 1, 40, true );
830 else
831 SpawnEntityOnCursorDir(player, item.Trim(), 1, 1);
832 }
833 }
834
835 }
836
837 return NULL;
838 }
DayZGame g_Game
Определения DayZGame.c:4074
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:572
void SpawnItemOnCrosshair(PlayerBase player, string itemName, float health, float quantity, float maxDist=100, bool allowFreeflight=false, bool special=false, bool withPhysics=false)
Определения PluginDeveloper.c:510
void GetCameraDirections(Man player, bool allowFreeflight, out vector position, out vector direction)
Определения PluginDeveloper.c:459
class array< Class T > TStringArray
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
ThirdPersonMode
Определения World.c:302

Перекрестные ссылки string::Contains(), g_Game, GetCameraDirections(), DeveloperFreeCamera::IsFreeCameraEnabled(), SpawnEntityOnCursorDir(), SpawnItemOnCrosshair(), string::Split(), string::Trim() и TStringArray.