mirror of
https://github.com/Tomato-dayZ/DayZ-SA-Tomato.git
synced 2024-08-30 16:22:09 +00:00
Initial Upload
This commit is contained in:
parent
a615503714
commit
90725f671f
3
DayZ-Sa-Tomato/Config/Admins.txt
Normal file
3
DayZ-Sa-Tomato/Config/Admins.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
76561198017833573
|
||||||
|
76561198134309775
|
||||||
|
76561198065995341
|
1
DayZ-Sa-Tomato/Config/Test.txt
Normal file
1
DayZ-Sa-Tomato/Config/Test.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
TestString
|
BIN
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato.pbo
Normal file
BIN
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato.pbo
Normal file
Binary file not shown.
1
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/$PREFIX$
Normal file
1
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/$PREFIX$
Normal file
@ -0,0 +1 @@
|
|||||||
|
com\DayZ-SA-Tomato
|
1
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/$REVISION$
Normal file
1
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/$REVISION$
Normal file
@ -0,0 +1 @@
|
|||||||
|
1
|
6
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/PBOPREFIX.txt
Normal file
6
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/PBOPREFIX.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
///'scripts.pbo' from Mikero's dos tools, dll version 5.66///
|
||||||
|
prefix=com\DayZ-SA-Tomato
|
||||||
|
revision=1
|
||||||
|
Pbo Type is: Arma Unknown pbo typ (no config).
|
||||||
|
Sha: '5CAF7A50CB0D1CACBB90A6A0DA4EFC47B8998E0D'
|
||||||
|
//////</HEADER>//////
|
10
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/config.cpp
Normal file
10
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/config.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
class CfgPatches
|
||||||
|
{
|
||||||
|
class DayZSATomato
|
||||||
|
{
|
||||||
|
units[]={};
|
||||||
|
weapons[]={};
|
||||||
|
requiredVersion=0.1;
|
||||||
|
requiredAddons[]={};
|
||||||
|
};
|
||||||
|
};
|
265
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/COMCam.c
Normal file
265
DayZ-Sa-Tomato/addons/DayZ-SA-Tomato/scripts/4_World/COMCam.c
Normal file
@ -0,0 +1,265 @@
|
|||||||
|
modded class DayZSpectator
|
||||||
|
{
|
||||||
|
protected float forwardVelocity;
|
||||||
|
protected float strafeVelocity;
|
||||||
|
protected float altitudeVelocity;
|
||||||
|
|
||||||
|
protected float yawVelocity;
|
||||||
|
protected float pitchVelocity;
|
||||||
|
|
||||||
|
protected float m_CamDrag = 0.95;
|
||||||
|
|
||||||
|
protected float m_CamFOV = 1.0; // default FOV
|
||||||
|
protected float m_TargetFOV = 1.0;
|
||||||
|
protected float m_TargetRoll;
|
||||||
|
protected float m_DistanceToObject;
|
||||||
|
protected bool m_FollowTarget = false;
|
||||||
|
protected bool m_FreezePlayer = false;
|
||||||
|
protected bool m_OrbitalCam = false;
|
||||||
|
protected bool m_FreezeCam = false;
|
||||||
|
|
||||||
|
protected bool m_FreezeMouse = false;
|
||||||
|
|
||||||
|
static float CAMERA_FOV = 1.0;
|
||||||
|
static float CAMERA_TARGETFOV = 1.0;
|
||||||
|
static float CAMERA_FOV_SPEED_MODIFIER = 6.0;
|
||||||
|
static float CAMERA_SPEED = 2.0;
|
||||||
|
static float CAMERA_MAXSPEED = 1.0;
|
||||||
|
static float CAMERA_VELDRAG;
|
||||||
|
static float CAMERA_MSENS = 0.8; // acceleration
|
||||||
|
static float CAMERA_SMOOTH = 0.8; // drag
|
||||||
|
|
||||||
|
static bool CAMERA_DOF = false;
|
||||||
|
static bool CAMERA_AFOCUS = true;
|
||||||
|
static float CAMERA_BLUR = 0.0; // modified via ui
|
||||||
|
static float CAMERA_FLENGTH = 50.0; // modified via ui
|
||||||
|
static float CAMERA_FNEAR = 50.0; // modified via ui
|
||||||
|
static float CAMERA_FDIST = 0.0;
|
||||||
|
static float CAMERA_DOFFSET = 0.0;
|
||||||
|
|
||||||
|
static float CAMERA_SMOOTH_BLUR = 0.0;
|
||||||
|
|
||||||
|
protected vector m_CamOffset;
|
||||||
|
|
||||||
|
protected Object m_Target;
|
||||||
|
protected vector m_TargetPos; // Static position
|
||||||
|
|
||||||
|
protected float m_CurrentSmoothBlur;
|
||||||
|
|
||||||
|
override void EOnFrame(IEntity other, float timeSlice)
|
||||||
|
{
|
||||||
|
// zoom camera
|
||||||
|
int i = GetMouseState( MouseState.WHEEL );
|
||||||
|
|
||||||
|
if ( i != 0 )
|
||||||
|
{
|
||||||
|
if ( CTRL() )
|
||||||
|
{
|
||||||
|
vector ori = GetOrientation();
|
||||||
|
m_TargetRoll = ori[2] - Math.RAD2DEG * i*0.06;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_TargetFOV-=i*0.06; // invert
|
||||||
|
if ( m_TargetFOV < 0.01 )
|
||||||
|
{
|
||||||
|
m_TargetFOV = 0.01;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( m_CamFOV != m_TargetFOV )
|
||||||
|
{
|
||||||
|
m_CamFOV = Math.Lerp( m_CamFOV, m_TargetFOV, timeSlice*CAMERA_FOV_SPEED_MODIFIER );
|
||||||
|
SetFOV( m_CamFOV );
|
||||||
|
}
|
||||||
|
|
||||||
|
vector oldOrient = GetOrientation();
|
||||||
|
if ( oldOrient[2] != m_TargetRoll )
|
||||||
|
{
|
||||||
|
oldOrient[2] = Math.Lerp( oldOrient[2], m_TargetRoll, timeSlice*CAMERA_FOV_SPEED_MODIFIER );
|
||||||
|
SetOrientation( oldOrient );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Camera movement
|
||||||
|
Input input = GetGame().GetInput();
|
||||||
|
|
||||||
|
if ( !m_FreezeCam )
|
||||||
|
{
|
||||||
|
float forward = input.GetAction(UAMoveForward) - input.GetAction(UAMoveBack); // -1, 0, 1
|
||||||
|
float strafe = input.GetAction(UATurnRight) - input.GetAction(UATurnLeft);
|
||||||
|
|
||||||
|
float altitude = input.GetAction(UACarShiftGearUp) - input.GetAction(UACarShiftGearDown);
|
||||||
|
altitudeVelocity = altitudeVelocity + altitude * CAMERA_SPEED * timeSlice;
|
||||||
|
|
||||||
|
Math.Clamp( altitudeVelocity, -CAMERA_MAXSPEED, CAMERA_MAXSPEED);
|
||||||
|
vector up = vector.Up * altitudeVelocity;
|
||||||
|
|
||||||
|
vector direction = GetDirection();
|
||||||
|
vector directionAside = vector.Up * direction;
|
||||||
|
|
||||||
|
altitudeVelocity *= m_CamDrag;
|
||||||
|
|
||||||
|
vector oldPos = GetPosition();
|
||||||
|
|
||||||
|
forwardVelocity = forwardVelocity + forward * CAMERA_SPEED * timeSlice;
|
||||||
|
strafeVelocity = strafeVelocity + strafe * CAMERA_SPEED * timeSlice;
|
||||||
|
|
||||||
|
Math.Clamp ( forwardVelocity, -CAMERA_MAXSPEED, CAMERA_MAXSPEED);
|
||||||
|
Math.Clamp ( strafeVelocity, -CAMERA_MAXSPEED, CAMERA_MAXSPEED);
|
||||||
|
|
||||||
|
vector forwardChange = forwardVelocity * direction;
|
||||||
|
vector strafeChange = strafeVelocity * directionAside;
|
||||||
|
|
||||||
|
forwardVelocity *= m_CamDrag;
|
||||||
|
strafeVelocity *= m_CamDrag;
|
||||||
|
|
||||||
|
vector newPos = oldPos + forwardChange + strafeChange + up;
|
||||||
|
|
||||||
|
float surfaceY = GetGame().SurfaceY( newPos[0], newPos[2] ) + 0.25;
|
||||||
|
if ( newPos[1] < surfaceY )
|
||||||
|
{
|
||||||
|
newPos[1] = surfaceY;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetPosition(newPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !m_FreezeMouse )
|
||||||
|
{
|
||||||
|
float yawDiff = input.GetAction(UAAimHeadLeft) - input.GetAction(UAAimHeadRight);
|
||||||
|
float pitchDiff = input.GetAction(UAAimHeadDown) - input.GetAction(UAAimHeadUp);
|
||||||
|
|
||||||
|
yawVelocity = yawVelocity + yawDiff * CAMERA_MSENS;
|
||||||
|
pitchVelocity = pitchVelocity + pitchDiff * CAMERA_MSENS; // 0.8
|
||||||
|
|
||||||
|
vector newOrient = oldOrient;
|
||||||
|
|
||||||
|
Math.Clamp ( yawVelocity, -1.5, 1.5);
|
||||||
|
Math.Clamp ( pitchVelocity, -1.5, 1.5);
|
||||||
|
|
||||||
|
newOrient[0] = newOrient[0] - Math.RAD2DEG * yawVelocity * timeSlice;
|
||||||
|
newOrient[1] = newOrient[1] - Math.RAD2DEG * pitchVelocity * timeSlice;
|
||||||
|
|
||||||
|
yawVelocity *= CAMERA_SMOOTH; // drag 0.9
|
||||||
|
pitchVelocity *= CAMERA_SMOOTH;
|
||||||
|
|
||||||
|
if( newOrient[1] < -89 )
|
||||||
|
newOrient[1] = -89;
|
||||||
|
if( newOrient[1] > 89 )
|
||||||
|
newOrient[1] = 89;
|
||||||
|
|
||||||
|
SetOrientation( newOrient );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Camera targetting
|
||||||
|
float dist = 0.0;
|
||||||
|
vector from = GetGame().GetCurrentCameraPosition();
|
||||||
|
|
||||||
|
if ( m_Target )
|
||||||
|
{
|
||||||
|
vector targetPos;
|
||||||
|
|
||||||
|
if ( m_Target.IsInherited( SurvivorBase ) )
|
||||||
|
{
|
||||||
|
targetPos = GetTargetCenter();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vector pos = m_Target.GetPosition();
|
||||||
|
pos[1] = GetGame().SurfaceY(pos[0], pos[2]);
|
||||||
|
|
||||||
|
vector clippingInfo;
|
||||||
|
vector objectBBOX;
|
||||||
|
|
||||||
|
m_Target.GetCollisionBox(objectBBOX);
|
||||||
|
|
||||||
|
pos[1] = (pos[1] - objectBBOX[1] + clippingInfo[1] - objectBBOX[1]) + 1.5;
|
||||||
|
|
||||||
|
targetPos = pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( m_OrbitalCam )
|
||||||
|
{
|
||||||
|
LookAt( targetPos );
|
||||||
|
}
|
||||||
|
|
||||||
|
dist = vector.Distance( from, targetPos );
|
||||||
|
|
||||||
|
if ( m_FollowTarget )
|
||||||
|
{
|
||||||
|
if ( m_DistanceToObject == 0.0 )
|
||||||
|
{
|
||||||
|
m_DistanceToObject = vector.Distance(GetTargetCenter(), GetPosition());
|
||||||
|
m_CamOffset = vector.Direction( GetTargetCenter() , GetPosition() );
|
||||||
|
m_CamOffset.Normalize();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( m_OrbitalCam )
|
||||||
|
{
|
||||||
|
direction = vector.Direction( GetTargetCenter() , GetPosition() );
|
||||||
|
direction.Normalize();
|
||||||
|
newPos = GetTargetCenter() + ( direction * m_DistanceToObject );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newPos = GetTargetCenter() + ( m_CamOffset * m_DistanceToObject );
|
||||||
|
}
|
||||||
|
|
||||||
|
SetPosition( newPos );
|
||||||
|
dist = m_DistanceToObject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( m_TargetPos != vector.Zero )
|
||||||
|
{
|
||||||
|
LookAt( m_TargetPos ); // auto orbital
|
||||||
|
dist = vector.Distance( from, m_TargetPos );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( CAMERA_DOF ) // DOF enabled
|
||||||
|
{
|
||||||
|
if ( CAMERA_AFOCUS && !m_Target ) //auto focus
|
||||||
|
{
|
||||||
|
vector to = from + (GetGame().GetCurrentCameraDirection() * 9999);
|
||||||
|
vector contact_pos;
|
||||||
|
|
||||||
|
DayZPhysics.RaycastRV( from, to, contact_pos, NULL, NULL, NULL , NULL, NULL, false, false, ObjIntersectIFire);
|
||||||
|
dist = vector.Distance( from, contact_pos );
|
||||||
|
}
|
||||||
|
if ( dist > 0 ) CAMERA_FDIST = dist;
|
||||||
|
|
||||||
|
PPEffects.OverrideDOF(true, CAMERA_FDIST, CAMERA_FLENGTH, CAMERA_FNEAR, CAMERA_BLUR, CAMERA_DOFFSET);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vector GetTargetCenter()
|
||||||
|
{
|
||||||
|
vector targetPosition;
|
||||||
|
|
||||||
|
if ( m_Target.IsInherited( SurvivorBase ))
|
||||||
|
{
|
||||||
|
targetPosition = m_Target.GetPosition();
|
||||||
|
targetPosition[1] = targetPosition[1] + 1.5;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
targetPosition = m_Target.GetPosition();
|
||||||
|
targetPosition[1] = GetGame().SurfaceY(targetPosition[0], targetPosition[2]);
|
||||||
|
|
||||||
|
vector clippingInfo;
|
||||||
|
vector objectBBOX;
|
||||||
|
|
||||||
|
m_Target.GetCollisionBox(objectBBOX);
|
||||||
|
|
||||||
|
targetPosition[1] = (targetPosition[1] - objectBBOX[1] + clippingInfo[1] - objectBBOX[1]) + 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
return targetPosition;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool CTRL() // static functions arent scope global?
|
||||||
|
{
|
||||||
|
return( ( KeyState( KeyCode.KC_LCONTROL ) > 0 ) || ( KeyState( KeyCode.KC_RCONTROL ) > 0 ) );
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
static float GetWaterMetabolicSpeed(int movement_speed)
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
@ -0,0 +1,98 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
modded class MissionGameplay
|
||||||
|
{
|
||||||
|
ref DevTeleport devTeleport;
|
||||||
|
ref DevCam devCam;
|
||||||
|
ref AdminMenu adminMenu;
|
||||||
|
ref AdminMenuManager adminMenuManager;
|
||||||
|
//ref AdminMenuMain AdminMenumain;
|
||||||
|
|
||||||
|
bool isSpectating = false;
|
||||||
|
bool MenuOpen = false;
|
||||||
|
void MissionGameplay()
|
||||||
|
{
|
||||||
|
Print( " Mission Gameplay Constructor ");
|
||||||
|
|
||||||
|
devTeleport = new DevTeleport();
|
||||||
|
devCam = new DevCam();
|
||||||
|
adminMenu = new AdminMenu();
|
||||||
|
adminMenuManager = new AdminMenuManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
override void OnInit()
|
||||||
|
{
|
||||||
|
super.OnInit();
|
||||||
|
|
||||||
|
Print( " Mission Gameplay ");
|
||||||
|
}
|
||||||
|
|
||||||
|
override void OnMissionStart()
|
||||||
|
{
|
||||||
|
super.OnMissionStart();
|
||||||
|
|
||||||
|
Widget welcomeMenu = GetGame().GetWorkspace().CreateWidgets( "DZ\\DayZ-SA-Tomato\\scripts\\5_Mission\\core\\WelcomeMenu.layout", NULL );
|
||||||
|
//welcomeMenu.Show(true);
|
||||||
|
|
||||||
|
GetGame().GetCallQueue( CALL_CATEGORY_GUI ).CallLater( welcomeMenu.Show, 5000, false, false );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override void OnKeyRelease( int key )
|
||||||
|
{
|
||||||
|
super.OnKeyRelease( key );
|
||||||
|
PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
|
||||||
|
if ( key == KeyCode.KC_N )
|
||||||
|
{
|
||||||
|
adminMenuManager.Teleport();
|
||||||
|
if ( GetGame().IsClient() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( key == KeyCode.KC_INSERT )
|
||||||
|
{
|
||||||
|
|
||||||
|
//devCam.SendRPC( isSpectating, GetCursorPos() );
|
||||||
|
adminMenuManager.CamTeleport( isSpectating, GetCursorPos() );
|
||||||
|
|
||||||
|
isSpectating = !isSpectating;
|
||||||
|
}
|
||||||
|
if ( key == KeyCode.KC_M )
|
||||||
|
{
|
||||||
|
if(GetGame().IsClient() || !GetGame().IsMultiplayer())
|
||||||
|
{
|
||||||
|
if ( player )
|
||||||
|
{
|
||||||
|
adminMenuManager.MenuOpen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Mission CreateCustomMission(string path)
|
||||||
|
{
|
||||||
|
if ( GetGame().IsServer() && GetGame().IsMultiplayer() ) {
|
||||||
|
return new CommunityOfflineServer(); // this always runs because createcustommission isnt a client side function
|
||||||
|
}
|
||||||
|
return new MissionGameplay();
|
||||||
|
}
|
||||||
|
// class, function, params
|
@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
enum M_RPCs
|
||||||
|
{
|
||||||
|
M_SPAWN_OBJECT = 7000;
|
||||||
|
M_SET_GODMODE = 7001;
|
||||||
|
M_SET_CAM = 7002;
|
||||||
|
M_TELEPORT = 7003;
|
||||||
|
M_Admin_Menu = 7004;
|
||||||
|
M_Admin_Menu_OK = 7005;
|
||||||
|
M_Admin_Menu_Spawn_Ground = 7006;
|
||||||
|
M_Admin_Menu_Spawn_Cursor = 7007;
|
||||||
|
M_Admin_Menu_Spawn_Inventory = 7008;
|
||||||
|
M_Admin_Menu_Heal = 7009;
|
||||||
|
M_Admin_Menu_Strip = 7010;
|
||||||
|
M_Admin_Menu_TpTo = 7011;
|
||||||
|
M_Admin_Menu_TpMe = 7012;
|
||||||
|
M_Admin_Menu_TpAllMe = 7013;
|
||||||
|
M_Admin_Menu_Spawn_Car = 7014;
|
||||||
|
M_Admin_Menu_Day = 7015;
|
||||||
|
M_Admin_Menu_Night = 7016;
|
||||||
|
M_Admin_Menu_Car_Refill = 7017;
|
||||||
|
M_Admin_Menu_TpToPos = 7018;
|
||||||
|
M_Admin_Menu_Kill = 7019;
|
||||||
|
M_Admin_Menu_SpWear = 7020;
|
||||||
|
M_Admin_Menu_Spawn_ItemPrev = 7021;
|
||||||
|
M_Admin_Menu_Spawn_ItemPrev_ok = 7022;
|
||||||
|
M_Admin_Menu_KillAll = 7023;
|
||||||
|
M_Admin_Menu_StripAll = 7024;
|
||||||
|
M_Admin_Menu_HealAll = 7025;
|
||||||
|
M_Admin_Menu_Stamina_Enable = 7026;
|
||||||
|
M_Admin_Menu_Stamina_Dissable = 7027;
|
||||||
|
M_Admin_Menu_PM = 7028;
|
||||||
|
M_Admin_Menu_Map_Player = 7029;
|
||||||
|
M_Admin_Menu_Map_Player_Request = 7030;
|
||||||
|
M_Admin_Menu_Player_Health_Request = 7031;
|
||||||
|
M_Admin_Menu_Player_Health = 7032;
|
||||||
|
M_Admin_Menu_Player_Stamina_Request = 7033;
|
||||||
|
M_Admin_Menu_Player_Stamina_ok = 7034;
|
||||||
|
}
|
@ -0,0 +1,355 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
class CommunityOfflineServer : MissionServer
|
||||||
|
{
|
||||||
|
protected bool m_bLoaded;
|
||||||
|
ref DevTeleport devTeleport;
|
||||||
|
ref DevCam devCam;
|
||||||
|
ref AdminMenu adminMenu;
|
||||||
|
protected float m_LogInTimerLength = 1;
|
||||||
|
//admin list
|
||||||
|
PlayerBase Admin = null;
|
||||||
|
protected ref map<string, string> m_AdminList;
|
||||||
|
static ref map<string, string> m_StaminaList;
|
||||||
|
protected string m_AdminListPath = "$CurrentDir:\\DayZ-SA-Tomato\\Config\\";
|
||||||
|
void CommunityOfflineServer()
|
||||||
|
{
|
||||||
|
Print( "CommunityOfflineServer::CommunityOfflineServer()" );
|
||||||
|
m_bLoaded = false;
|
||||||
|
devTeleport = new DevTeleport();
|
||||||
|
devCam = new DevCam();
|
||||||
|
adminMenu = new AdminMenu();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ~CommunityOfflineServer()
|
||||||
|
{
|
||||||
|
Print( "CommunityOfflineServer::~CommunityOfflineServer()" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Create Mags And Custom Guns
|
||||||
|
void addMags(PlayerBase player, string mag_type, int count)
|
||||||
|
{
|
||||||
|
if (count < 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
EntityAI mag;
|
||||||
|
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
|
mag = player.GetInventory().CreateInInventory(mag_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
player.SetQuickBarEntityShortcut(mag, 1, true);
|
||||||
|
}
|
||||||
|
EntityAI SVD(int ground, PlayerBase player)
|
||||||
|
{
|
||||||
|
EntityAI item;
|
||||||
|
ItemBase itemBs
|
||||||
|
vector NewPosition;
|
||||||
|
vector OldPosition;
|
||||||
|
if (ground == 1)
|
||||||
|
{
|
||||||
|
OldPosition = player.GetPosition();
|
||||||
|
NewPosition[0] = OldPosition[0] + 1.5;
|
||||||
|
NewPosition[1] = OldPosition[1] + 0.1;
|
||||||
|
NewPosition[2] = OldPosition[2] + 1.5;
|
||||||
|
EntityAI gun = GetGame().CreateObject( "SVD", NewPosition, false, true );
|
||||||
|
gun.GetInventory().CreateAttachment("PSO1Optic");
|
||||||
|
gun.GetInventory().CreateAttachment("ImprovisedSuppressor");
|
||||||
|
gun.GetInventory().CreateAttachment("GhillieAtt_Tan");
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
EntityAI gun1 = player.GetHumanInventory().CreateInHands("SVD");
|
||||||
|
gun1.GetInventory().CreateAttachment("PSO1Optic");
|
||||||
|
gun1.GetInventory().CreateAttachment("ImprovisedSuppressor");
|
||||||
|
gun1.GetInventory().CreateAttachment("GhillieAtt_Tan");
|
||||||
|
addMags(player, "Mag_SVD_10Rnd", 3);
|
||||||
|
}
|
||||||
|
return gun;
|
||||||
|
}
|
||||||
|
|
||||||
|
override void OnEvent(EventType eventTypeId, Param params)
|
||||||
|
{
|
||||||
|
super.OnEvent(eventTypeId,params);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override void TickScheduler(float timeslice)
|
||||||
|
{
|
||||||
|
GetGame().GetWorld().GetPlayerList(m_Players);
|
||||||
|
if( m_Players.Count() == 0 ) return;
|
||||||
|
for(int i = 0; i < SCHEDULER_PLAYERS_PER_TICK; i++)
|
||||||
|
{
|
||||||
|
if(m_currentPlayer >= m_Players.Count() )
|
||||||
|
{
|
||||||
|
m_currentPlayer = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
PlayerBase currentPlayer = PlayerBase.Cast(m_Players.Get(m_currentPlayer));
|
||||||
|
string PlayerName;
|
||||||
|
PlayerIdentity PlayerIdent;
|
||||||
|
string PlayerSteam64ID;
|
||||||
|
vector PlayerPos;
|
||||||
|
|
||||||
|
PlayerIdent = currentPlayer.GetIdentity();
|
||||||
|
PlayerName = PlayerIdent.GetName();
|
||||||
|
PlayerSteam64ID = PlayerIdent.GetPlainId();
|
||||||
|
PlayerPos = currentPlayer.GetPosition()
|
||||||
|
currentPlayer.OnTick();
|
||||||
|
|
||||||
|
if (m_StaminaList.Contains(PlayerName))
|
||||||
|
{
|
||||||
|
currentPlayer.GetStaminaHandler().SyncStamina(1000,1000);
|
||||||
|
currentPlayer.GetStatStamina().Set(currentPlayer.GetStaminaHandler().GetStaminaCap());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsAdmin(PlayerName, PlayerSteam64ID ))
|
||||||
|
{
|
||||||
|
currentPlayer.GetStaminaHandler().SyncStamina(1000,1000);
|
||||||
|
currentPlayer.GetStatStamina().Set(currentPlayer.GetStaminaHandler().GetStaminaCap());
|
||||||
|
}
|
||||||
|
|
||||||
|
m_currentPlayer++;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendPosTOAdmins()
|
||||||
|
{
|
||||||
|
array<Man> players = new array<Man>;
|
||||||
|
GetGame().GetPlayers( players );
|
||||||
|
|
||||||
|
for (int i = 0; i < players.Count(); ++i)
|
||||||
|
{
|
||||||
|
|
||||||
|
PlayerBase currentPlayer = players.Get(i);
|
||||||
|
string PlayerName;
|
||||||
|
PlayerIdentity PlayerIdent;
|
||||||
|
string PlayerSteam64ID;
|
||||||
|
PlayerName = PlayerIdent.GetName()
|
||||||
|
PlayerIdent = currentPlayer.GetIdentity();
|
||||||
|
PlayerSteam64ID = PlayerIdent.GetPlainId();
|
||||||
|
vector pos;
|
||||||
|
|
||||||
|
pos = currentPlayer.GetPosition()
|
||||||
|
|
||||||
|
SendPosToAdmins(PlayerName, pos)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void SendPosToAdmins(string PlayerName, vector pos)
|
||||||
|
{
|
||||||
|
array<Man> players = new array<Man>;
|
||||||
|
GetGame().GetPlayers( players );
|
||||||
|
|
||||||
|
for (int i = 0; i < players.Count(); ++i)
|
||||||
|
{
|
||||||
|
PlayerBase currentPlayer = players.Get(i);
|
||||||
|
string AdminPlayerName;
|
||||||
|
PlayerIdentity AdminIdent;
|
||||||
|
string PlayerSteam64ID;
|
||||||
|
AdminPlayerName = AdminIdent.GetName()
|
||||||
|
AdminIdent = currentPlayer.GetIdentity();
|
||||||
|
PlayerSteam64ID = AdminIdent.GetPlainId();
|
||||||
|
if (IsAdmin(AdminPlayerName, PlayerSteam64ID ))
|
||||||
|
{
|
||||||
|
ScriptRPC PPos = new ScriptRPC();
|
||||||
|
PPos.Write(PlayerName);
|
||||||
|
PPos.Write(pos);
|
||||||
|
PPos.Send(NULL, M_RPCs.M_Admin_Menu_Map_Player, false, AdminIdent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void AddStamina(string name)
|
||||||
|
{
|
||||||
|
m_StaminaList.Insert(name, "null");
|
||||||
|
}
|
||||||
|
|
||||||
|
void RemoveStamina(string name)
|
||||||
|
{
|
||||||
|
m_StaminaList.Remove(m_StaminaList.GetKeyByValue(name));
|
||||||
|
}
|
||||||
|
bool StaminaContains(string name)
|
||||||
|
{
|
||||||
|
if (m_StaminaList.Contains(name))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool IsAdmin( string name, string ID )
|
||||||
|
{
|
||||||
|
array<Man> players = new array<Man>;
|
||||||
|
GetGame().GetPlayers( players );
|
||||||
|
for (int i = 0; i < players.Count(); ++i)
|
||||||
|
{
|
||||||
|
if (players.Get(i).GetIdentity().GetName() == name && m_AdminList.Contains(ID))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
PlayerBase IsAdminID(string name, string ID )
|
||||||
|
{
|
||||||
|
array<Man> players = new array<Man>;
|
||||||
|
GetGame().GetPlayers( players );
|
||||||
|
for (int i = 0; i < players.Count(); ++i)
|
||||||
|
{
|
||||||
|
if (players.Get(i).GetIdentity().GetName() == name && m_AdminList.Contains(ID))
|
||||||
|
{
|
||||||
|
Admin = players.Get(i);
|
||||||
|
//AdminIdentity = Admin.GetIdentity();
|
||||||
|
//AdminUID = AdminIdentity.GetPlainId();
|
||||||
|
return Admin;
|
||||||
|
}
|
||||||
|
return Admin;
|
||||||
|
}
|
||||||
|
return Admin; // temp true
|
||||||
|
}
|
||||||
|
|
||||||
|
ref Man GetPlayerFromIdentity( PlayerIdentity identity )
|
||||||
|
{
|
||||||
|
foreach( ref Man manBase : m_Players )
|
||||||
|
{
|
||||||
|
Print( "Getter: " + manBase + " : " + manBase.GetIdentity().GetName() + " : " + manBase.GetIdentity().GetId() + ":" + manBase.GetIdentity().GetPlainId());
|
||||||
|
if ( manBase.GetIdentity().GetPlayerId() == identity.GetPlayerId() )
|
||||||
|
{
|
||||||
|
return manBase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
override void OnInit()
|
||||||
|
{
|
||||||
|
super.OnInit();
|
||||||
|
SetupWeather();
|
||||||
|
|
||||||
|
//Admin list Insert from text
|
||||||
|
m_AdminList = new map<string, string>; //UID, name
|
||||||
|
m_StaminaList = new map<string, string>; //UID, name
|
||||||
|
FileHandle AdminUIDSFile = OpenFile(m_AdminListPath + "Admins.txt", FileMode.READ);
|
||||||
|
if (AdminUIDSFile != 0)
|
||||||
|
{
|
||||||
|
string line_content = "";
|
||||||
|
while ( FGets(AdminUIDSFile,line_content) > 0 )
|
||||||
|
{
|
||||||
|
m_AdminList.Insert(line_content,"null"); //UID , NAME
|
||||||
|
Print("Adding Admin: "+ line_content + " To the Admin List!");
|
||||||
|
}
|
||||||
|
CloseFile(AdminUIDSFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override void OnMissionStart()
|
||||||
|
{
|
||||||
|
super.OnMissionStart();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override void OnMissionFinish()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
super.OnMissionFinish();
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnMissionLoaded()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override void OnUpdate( float timeslice )
|
||||||
|
{
|
||||||
|
super.OnUpdate( timeslice );
|
||||||
|
|
||||||
|
if( !m_bLoaded && !GetDayZGame().IsLoading() )
|
||||||
|
{
|
||||||
|
m_bLoaded = true;
|
||||||
|
OnMissionLoaded();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SetupWeather()
|
||||||
|
{
|
||||||
|
//Offical DayZ SA weather code
|
||||||
|
Weather weather = g_Game.GetWeather();
|
||||||
|
|
||||||
|
weather.GetOvercast().SetLimits( 0.0 , 2.0 );
|
||||||
|
weather.GetRain().SetLimits( 0.0 , 2.0 );
|
||||||
|
weather.GetFog().SetLimits( 0.0 , 2.0 );
|
||||||
|
|
||||||
|
weather.GetOvercast().SetForecastChangeLimits( 0.0, 0.0 );
|
||||||
|
weather.GetRain().SetForecastChangeLimits( 0.0, 0.0 );
|
||||||
|
weather.GetFog().SetForecastChangeLimits( 0.0, 0.0 );
|
||||||
|
|
||||||
|
weather.GetOvercast().SetForecastTimeLimits( 1800 , 1800 );
|
||||||
|
weather.GetRain().SetForecastTimeLimits( 600 , 600 );
|
||||||
|
weather.GetFog().SetForecastTimeLimits( 600 , 600 );
|
||||||
|
|
||||||
|
weather.GetOvercast().Set( 0.0, 0, 0 );
|
||||||
|
weather.GetRain().Set( 0.0, 0, 0 );
|
||||||
|
weather.GetFog().Set( 0.0, 0, 0 );
|
||||||
|
|
||||||
|
weather.SetWindMaximumSpeed( 50 );
|
||||||
|
weather.SetWindFunctionParams( 0, 0, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
override void OnPreloadEvent(PlayerIdentity identity, out bool useDB, out vector pos, out float yaw, out int queueTime)
|
||||||
|
{
|
||||||
|
if (GetHive())
|
||||||
|
{
|
||||||
|
queueTime = m_LogInTimerLength;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
queueTime = m_LogInTimerLength;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void InitHive()
|
||||||
|
{
|
||||||
|
Hive oHive = GetHive();
|
||||||
|
|
||||||
|
if( !oHive )
|
||||||
|
{
|
||||||
|
oHive = CreateHive();
|
||||||
|
}
|
||||||
|
|
||||||
|
if( oHive )
|
||||||
|
{
|
||||||
|
oHive.InitOffline();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,243 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
class KeyMouseBinding
|
||||||
|
{
|
||||||
|
const int KB_EVENT_PRESS = 0;
|
||||||
|
const int KB_EVENT_RELEASE = 1;
|
||||||
|
const int KB_EVENT_HOLD = 2;
|
||||||
|
|
||||||
|
const int MB_EVENT_PRESS = 0;
|
||||||
|
const int MB_EVENT_CLICK = 1;
|
||||||
|
const int MB_EVENT_RELEASE = 2;
|
||||||
|
const int MB_EVENT_DOUBLECLICK = 3;
|
||||||
|
const int MB_EVENT_DRAG = 4;
|
||||||
|
const int MB_EVENT_HOLD = 5;
|
||||||
|
|
||||||
|
protected typename m_Object;
|
||||||
|
protected ref map<int, int> m_KeyBinds;
|
||||||
|
protected ref map<int, int> m_MouseBinds;
|
||||||
|
protected string m_strCallbackFunction;
|
||||||
|
protected string m_strShortcut;
|
||||||
|
protected string m_strDescription;
|
||||||
|
protected bool canUseInMenu;
|
||||||
|
|
||||||
|
void KeyMouseBinding( typename object, string callback, string shortcut, string description, bool menu = false )
|
||||||
|
{
|
||||||
|
m_Object = object;
|
||||||
|
m_KeyBinds = new map< int, int >;
|
||||||
|
m_MouseBinds = new map< int, int >;
|
||||||
|
|
||||||
|
m_strCallbackFunction = callback;
|
||||||
|
m_strShortcut = shortcut;
|
||||||
|
m_strDescription = description;
|
||||||
|
|
||||||
|
canUseInMenu = menu;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool canUseInMenu()
|
||||||
|
{
|
||||||
|
return canUseInMenu;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Check()
|
||||||
|
{
|
||||||
|
bool k_m_Pressed = true;
|
||||||
|
for ( int kb = 0; kb < m_KeyBinds.Count(); ++kb )
|
||||||
|
{
|
||||||
|
int keyCode = m_KeyBinds.GetKey(kb);
|
||||||
|
int keyEvent = m_KeyBinds.Get(keyCode);
|
||||||
|
|
||||||
|
if ( keyEvent == KB_EVENT_RELEASE )
|
||||||
|
{ // Skip checking for release keys
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( KeyState( keyCode ) == 0 )
|
||||||
|
{
|
||||||
|
k_m_Pressed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( int mb = 0; mb < m_MouseBinds.Count(); ++mb )
|
||||||
|
{
|
||||||
|
int mouseButton = m_MouseBinds.GetKey(mb);
|
||||||
|
int mouseEvent = m_MouseBinds.Get(mouseButton);
|
||||||
|
|
||||||
|
if ( mouseEvent == MB_EVENT_RELEASE || mouseEvent == MB_EVENT_CLICK || mouseEvent == MB_EVENT_DOUBLECLICK || mouseButton == MouseState.WHEEL || mouseEvent == MB_EVENT_DRAG )
|
||||||
|
{
|
||||||
|
continue; // Skip checking for release buttons, click or double click, or mouse drag/wheel (handled else where)
|
||||||
|
}
|
||||||
|
if ( !(GetMouseState( mouseButton ) & MB_PRESSED_MASK ) )
|
||||||
|
{
|
||||||
|
k_m_Pressed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return k_m_Pressed;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsRecurring() // Recurring if both mouse or keys are hold, drag OR wheel
|
||||||
|
{
|
||||||
|
bool recurring = true;
|
||||||
|
|
||||||
|
for ( int kb = 0; kb < m_KeyBinds.Count(); ++kb )
|
||||||
|
{
|
||||||
|
int keyCode = m_KeyBinds.GetKey(kb);
|
||||||
|
int keyEvent = m_KeyBinds.Get(keyCode);
|
||||||
|
|
||||||
|
|
||||||
|
if ( keyEvent != KB_EVENT_HOLD )
|
||||||
|
{
|
||||||
|
return false; // a key is found that is not hold or drag. so it should not be recurring
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( int mb = 0; mb < m_MouseBinds.Count(); ++mb )
|
||||||
|
{
|
||||||
|
int mouseButton = m_MouseBinds.GetKey(mb);
|
||||||
|
int mouseEvent = m_MouseBinds.Get(mouseButton);
|
||||||
|
|
||||||
|
if ( mouseEvent != MB_EVENT_DRAG && mouseEvent != MB_EVENT_HOLD && mouseButton != MouseState.WHEEL )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return recurring;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsHold()
|
||||||
|
{
|
||||||
|
bool release = false;
|
||||||
|
|
||||||
|
for ( int kb = 0; kb < GetKeyBinds().Count(); ++kb)
|
||||||
|
{
|
||||||
|
int keyCode = m_KeyBinds.GetKey(kb);
|
||||||
|
int keyEvent = m_KeyBinds.Get(keyCode);
|
||||||
|
|
||||||
|
if ( keyEvent == KB_EVENT_RELEASE )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ( m_KeyBinds.GetKeyByValue(KB_EVENT_RELEASE) || m_MouseBinds.GetKeyByValue(MB_EVENT_RELEASE) );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool HasKeyEvent( int key_Event )
|
||||||
|
{
|
||||||
|
for ( int kb = 0; kb < GetKeyBinds().Count(); ++kb)
|
||||||
|
{
|
||||||
|
int keyCode = m_KeyBinds.GetKey(kb);
|
||||||
|
int keyEvent = m_KeyBinds.Get(keyCode);
|
||||||
|
|
||||||
|
if ( keyEvent == key_Event )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ContainsKey( int key )
|
||||||
|
{
|
||||||
|
return m_KeyBinds.Contains( key );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ContainsButton( int button )
|
||||||
|
{
|
||||||
|
return m_MouseBinds.Contains( button );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ContainsKeyEvent( int key, int key_Event )
|
||||||
|
{
|
||||||
|
int kc = -1;
|
||||||
|
for ( int kb = 0; kb < GetKeyBinds().Count(); ++kb)
|
||||||
|
{
|
||||||
|
int keyCode = m_KeyBinds.GetKey(kb);
|
||||||
|
int keyEvent = m_KeyBinds.Get(keyCode);
|
||||||
|
|
||||||
|
if ( keyCode == key && keyEvent == key_Event )
|
||||||
|
{
|
||||||
|
kc = keyCode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return kc > -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ContainsButtonEvent( int button, int button_Event )
|
||||||
|
{
|
||||||
|
int m = -1;
|
||||||
|
for ( int mb = 0; mb < GetMouseBinds().Count(); ++mb)
|
||||||
|
{
|
||||||
|
int mouseBind = m_MouseBinds.GetKey(mb);
|
||||||
|
int mouseEvemt = m_MouseBinds.Get(mouseBind);
|
||||||
|
|
||||||
|
if ( mouseBind == button && mouseEvemt == button_Event )
|
||||||
|
{
|
||||||
|
m = mouseBind;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return m > -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddKeyBind( int key, int key_event )
|
||||||
|
{
|
||||||
|
m_KeyBinds.Insert( key, key_event );
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddMouseBind( int button, int mouse_event )
|
||||||
|
{
|
||||||
|
m_MouseBinds.Insert( button, mouse_event );
|
||||||
|
}
|
||||||
|
|
||||||
|
ref map<int, int> GetKeyBinds()
|
||||||
|
{
|
||||||
|
return m_KeyBinds;
|
||||||
|
}
|
||||||
|
|
||||||
|
ref map<int, int> GetMouseBinds()
|
||||||
|
{
|
||||||
|
return m_MouseBinds;
|
||||||
|
}
|
||||||
|
|
||||||
|
typename GetObject()
|
||||||
|
{
|
||||||
|
return m_Object;
|
||||||
|
}
|
||||||
|
|
||||||
|
string GetShortcut()
|
||||||
|
{
|
||||||
|
return m_strShortcut;
|
||||||
|
}
|
||||||
|
|
||||||
|
string GetDescription()
|
||||||
|
{
|
||||||
|
return m_strDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
string GetCallBackFunction()
|
||||||
|
{
|
||||||
|
return m_strCallbackFunction;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,452 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
static string FormatFloat( float value, int decimals )
|
||||||
|
{
|
||||||
|
string result = "";
|
||||||
|
array<string> output = new array<string>;
|
||||||
|
|
||||||
|
value.ToString().Split(".", output);
|
||||||
|
|
||||||
|
if ( output.Count() == 0 ) return value.ToString();
|
||||||
|
|
||||||
|
if ( decimals == 0 ) return output.Get(0);
|
||||||
|
|
||||||
|
string right = output.Get(1).Substring(0, decimals);
|
||||||
|
result = output.Get(0) + "." + right;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
static string VectorToString( vector vec )
|
||||||
|
{
|
||||||
|
string result = vec.ToString();
|
||||||
|
result.Replace( "<", "" );
|
||||||
|
result.Replace( ">", "" );
|
||||||
|
result.Replace( ",", "" );
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
static string VectorToString( vector vec, int decimals )
|
||||||
|
{
|
||||||
|
string result = "";
|
||||||
|
result = FormatFloat(vec[0], decimals) + "|" + FormatFloat(vec[1], decimals) + "|" + FormatFloat(vec[2], decimals);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TStringArray GetChildrenFromBaseClass( string strConfigName, string strBaseClass )
|
||||||
|
{
|
||||||
|
string child_name = "";
|
||||||
|
int count = GetGame().ConfigGetChildrenCount ( strConfigName );
|
||||||
|
TStringArray class_names = new TStringArray;
|
||||||
|
|
||||||
|
for (int p = 0; p < count; p++)
|
||||||
|
{
|
||||||
|
GetGame().ConfigGetChildName ( strConfigName, p, child_name );
|
||||||
|
|
||||||
|
if ( GetGame().IsKindOf(child_name, strBaseClass ) && ( child_name != strBaseClass ) )
|
||||||
|
{
|
||||||
|
class_names.Insert(child_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return class_names;
|
||||||
|
}
|
||||||
|
|
||||||
|
static TVectorArray GetSpawnPoints()
|
||||||
|
{
|
||||||
|
return { "15135.1 0 13901.1", "15017.8 0 13892.4", "14887.1 0 14547.9", "14749.7 0 13248.7",
|
||||||
|
"14697.6 0 13418.4", "14537.3 0 14755.7", "14415.3 0 14025.2", "14338.0 0 12859.5",
|
||||||
|
"14263.8 0 12748.7", "14172.2 0 12304.9", "14071.4 0 12033.3", "14054.9 0 11341.3",
|
||||||
|
"14017.8 0 2959.1", "13905.5 0 12489.7", "13852.4 0 11686.0", "13846.6 0 12050.0",
|
||||||
|
"13676.0 0 12262.1", "13617.4 0 12759.8", "13610.1 0 11223.6", "13594.3 0 4064.0",
|
||||||
|
"13587.8 0 6026.5", "13571.1 0 3056.8", "13552.6 0 4653.7", "13529.9 0 3968.3",
|
||||||
|
"13520.8 0 4223.7", "13504.0 0 5004.5", "13476.7 0 6136.3", "13441.6 0 5262.2",
|
||||||
|
"13426.6 0 5747.3", "13416.8 0 11840.4", "13400.8 0 4120.7", "13395.8 0 5902.8",
|
||||||
|
"13385.0 0 3946.6", "13374.4 0 6454.3", "13367.1 0 10837.1", "13366.3 0 4906.0",
|
||||||
|
"13337.1 0 5120.8", "13326.7 0 5489.1", "13312.7 0 6771.1", "13288.7 0 11415.1",
|
||||||
|
"13261.6 0 11785.2", "13171.6 0 6534.8", "13159.8 0 5401.7", "13155.2 0 5475.2",
|
||||||
|
"13084.9 0 7938.6", "13056.8 0 4848.5", "13048.1 0 8357.6", "13048.1 0 3867.7",
|
||||||
|
"12991.7 0 7287.1", "12983.0 0 5539.1", "12978.9 0 9727.8", "12950.2 0 5226.7",
|
||||||
|
"12942.1 0 8393.1", "12891.5 0 3673.9", "12628.7 0 10495.2", "12574.3 0 3592.8",
|
||||||
|
"12566.3 0 6682.6", "12465.2 0 8009.0", "12354.5 0 3480.0", "13262.8 0 7225.8" };
|
||||||
|
}
|
||||||
|
|
||||||
|
static TStringArray WorkingZombieClasses()
|
||||||
|
{
|
||||||
|
return { "ZmbM_HermitSkinny_Base","ZmbM_HermitSkinny_Beige","ZmbM_HermitSkinny_Black","ZmbM_HermitSkinny_Green",
|
||||||
|
"ZmbM_HermitSkinny_Red","ZmbM_FarmerFat_Base","ZmbM_FarmerFat_Beige","ZmbM_FarmerFat_Blue","ZmbM_FarmerFat_Brown",
|
||||||
|
"ZmbM_FarmerFat_Green","ZmbF_CitizenANormal_Base","ZmbF_CitizenANormal_Beige","ZmbF_CitizenANormal_Brown",
|
||||||
|
"ZmbF_CitizenANormal_Blue","ZmbM_CitizenASkinny_Base","ZmbM_CitizenASkinny_Blue","ZmbM_CitizenASkinny_Brown",
|
||||||
|
"ZmbM_CitizenASkinny_Grey","ZmbM_CitizenASkinny_Red","ZmbM_CitizenBFat_Base","ZmbM_CitizenBFat_Blue","ZmbM_CitizenBFat_Red",
|
||||||
|
"ZmbM_CitizenBFat_Green","ZmbF_CitizenBSkinny_Base","ZmbF_CitizenBSkinny","ZmbM_PrisonerSkinny_Base","ZmbM_PrisonerSkinny",
|
||||||
|
"ZmbM_FirefighterNormal_Base","ZmbM_FirefighterNormal","ZmbM_FishermanOld_Base","ZmbM_FishermanOld_Blue","ZmbM_FishermanOld_Green",
|
||||||
|
"ZmbM_FishermanOld_Grey","ZmbM_FishermanOld_Red","ZmbM_JournalistSkinny_Base","ZmbM_JournalistSkinny","ZmbF_JournalistNormal_Base",
|
||||||
|
"ZmbF_JournalistNormal_Blue","ZmbF_JournalistNormal_Green","ZmbF_JournalistNormal_Red","ZmbF_JournalistNormal_White",
|
||||||
|
"ZmbM_ParamedicNormal_Base","ZmbM_ParamedicNormal_Blue","ZmbM_ParamedicNormal_Green","ZmbM_ParamedicNormal_Red",
|
||||||
|
"ZmbM_ParamedicNormal_Black","ZmbF_ParamedicNormal_Base","ZmbF_ParamedicNormal_Blue","ZmbF_ParamedicNormal_Green",
|
||||||
|
"ZmbF_ParamedicNormal_Red","ZmbM_HikerSkinny_Base","ZmbM_HikerSkinny_Blue","ZmbM_HikerSkinny_Green","ZmbM_HikerSkinny_Yellow",
|
||||||
|
"ZmbF_HikerSkinny_Base","ZmbF_HikerSkinny_Blue","ZmbF_HikerSkinny_Grey","ZmbF_HikerSkinny_Green","ZmbF_HikerSkinny_Red",
|
||||||
|
"ZmbM_HunterOld_Base","ZmbM_HunterOld_Autumn","ZmbM_HunterOld_Spring","ZmbM_HunterOld_Summer","ZmbM_HunterOld_Winter",
|
||||||
|
"ZmbF_SurvivorNormal_Base","ZmbF_SurvivorNormal_Blue","ZmbF_SurvivorNormal_Orange","ZmbF_SurvivorNormal_Red",
|
||||||
|
"ZmbF_SurvivorNormal_White","ZmbM_SurvivorDean_Base","ZmbM_SurvivorDean_Black","ZmbM_SurvivorDean_Blue","ZmbM_SurvivorDean_Grey",
|
||||||
|
"ZmbM_PolicemanFat_Base","ZmbM_PolicemanFat","ZmbF_PoliceWomanNormal_Base","ZmbF_PoliceWomanNormal","ZmbM_PolicemanSpecForce_Base",
|
||||||
|
"ZmbM_PolicemanSpecForce","ZmbM_SoldierNormal_Base","ZmbM_SoldierNormal","ZmbM_usSoldier_normal_Base",
|
||||||
|
"ZmbM_usSoldier_normal_Woodland","ZmbM_usSoldier_normal_Desert","ZmbM_CommercialPilotOld_Base","ZmbM_CommercialPilotOld_Blue",
|
||||||
|
"ZmbM_CommercialPilotOld_Olive","ZmbM_CommercialPilotOld_Brown","ZmbM_CommercialPilotOld_Grey","ZmbM_PatrolNormal_Base",
|
||||||
|
"ZmbM_PatrolNormal_PautRev","ZmbM_PatrolNormal_Autumn","ZmbM_PatrolNormal_Flat","ZmbM_PatrolNormal_Summer","ZmbM_JoggerSkinny_Base",
|
||||||
|
"ZmbM_JoggerSkinny_Blue","ZmbM_JoggerSkinny_Green","ZmbM_JoggerSkinny_Red","ZmbF_JoggerSkinny_Base","ZmbF_JoggerSkinny_Blue",
|
||||||
|
"ZmbF_JoggerSkinny_Brown","ZmbF_JoggerSkinny_Green","ZmbF_JoggerSkinny_Red","ZmbM_MotobikerFat_Base","ZmbM_MotobikerFat_Beige",
|
||||||
|
"ZmbM_MotobikerFat_Black","ZmbM_MotobikerFat_Blue","ZmbM_VillagerOld_Base","ZmbM_VillagerOld_Blue","ZmbM_VillagerOld_Green",
|
||||||
|
"ZmbM_VillagerOld_White","ZmbM_SkaterYoung_Base","ZmbM_SkaterYoung_Blue","ZmbM_SkaterYoung_Brown","ZmbM_SkaterYoung_Green",
|
||||||
|
"ZmbM_SkaterYoung_Grey","ZmbF_SkaterYoung_Base","ZmbF_SkaterYoung_Brown","ZmbF_SkaterYoung_Striped","ZmbF_SkaterYoung_Violet",
|
||||||
|
"ZmbF_DoctorSkinny_Base","ZmbF_DoctorSkinny","ZmbF_BlueCollarFat_Base","ZmbF_BlueCollarFat_Blue","ZmbF_BlueCollarFat_Green",
|
||||||
|
"ZmbF_BlueCollarFat_Red","ZmbF_BlueCollarFat_White","ZmbF_MechanicNormal_Base","ZmbF_MechanicNormal_Beige","ZmbF_MechanicNormal_Green",
|
||||||
|
"ZmbF_MechanicNormal_Grey","ZmbF_MechanicNormal_Orange","ZmbM_MechanicSkinny_Base","ZmbM_MechanicSkinny_Blue","ZmbM_MechanicSkinny_Grey",
|
||||||
|
"ZmbM_MechanicSkinny_Green","ZmbM_MechanicSkinny_Red","ZmbM_ConstrWorkerNormal_Base","ZmbM_ConstrWorkerNormal_Beige",
|
||||||
|
"ZmbM_ConstrWorkerNormal_Black","ZmbM_ConstrWorkerNormal_Green","ZmbM_ConstrWorkerNormal_Grey","ZmbM_HeavyIndustryWorker_Base",
|
||||||
|
"ZmbM_HeavyIndustryWorker","ZmbM_OffshoreWorker_Base","ZmbM_OffshoreWorker_Green","ZmbM_OffshoreWorker_Orange","ZmbM_OffshoreWorker_Red",
|
||||||
|
"ZmbM_OffshoreWorker_Yellow","ZmbF_NurseFat_Base","ZmbF_NurseFat","ZmbM_HandymanNormal_Base","ZmbM_HandymanNormal_Beige",
|
||||||
|
"ZmbM_HandymanNormal_Blue","ZmbM_HandymanNormal_Green","ZmbM_HandymanNormal_Grey","ZmbM_HandymanNormal_White","ZmbM_DoctorFat_Base",
|
||||||
|
"ZmbM_DoctorFat","ZmbM_Jacket_Base","ZmbM_Jacket_beige","ZmbM_Jacket_black","ZmbM_Jacket_blue","ZmbM_Jacket_bluechecks",
|
||||||
|
"ZmbM_Jacket_brown","ZmbM_Jacket_greenchecks","ZmbM_Jacket_grey","ZmbM_Jacket_khaki","ZmbM_Jacket_magenta","ZmbM_Jacket_stripes",
|
||||||
|
"ZmbF_PatientOld_Base","ZmbF_PatientOld","ZmbM_PatientSkinny_Base","ZmbM_PatientSkinny","ZmbF_ShortSkirt_Base","ZmbF_ShortSkirt_beige",
|
||||||
|
"ZmbF_ShortSkirt_black","ZmbF_ShortSkirt_brown","ZmbF_ShortSkirt_green","ZmbF_ShortSkirt_grey","ZmbF_ShortSkirt_checks",
|
||||||
|
"ZmbF_ShortSkirt_red","ZmbF_ShortSkirt_stripes","ZmbF_ShortSkirt_white","ZmbF_ShortSkirt_yellow","ZmbF_VillagerOld_Base",
|
||||||
|
"ZmbF_VillagerOld_Blue","ZmbF_VillagerOld_Green","ZmbF_VillagerOld_Red","ZmbF_VillagerOld_White","ZmbM_Soldier","ZmbM_SoldierAlice",
|
||||||
|
"ZmbM_SoldierHelmet","ZmbM_SoldierVest","ZmbM_SoldierAliceHelmet","ZmbM_SoldierVestHelmet","ZmbF_MilkMaidOld_Base",
|
||||||
|
"ZmbF_MilkMaidOld_Beige","ZmbF_MilkMaidOld_Black","ZmbF_MilkMaidOld_Green","ZmbF_MilkMaidOld_Grey","ZmbM_priestPopSkinny_Base",
|
||||||
|
"ZmbM_priestPopSkinny","ZmbM_ClerkFat_Base","ZmbM_ClerkFat_Brown","ZmbM_ClerkFat_Grey","ZmbM_ClerkFat_Khaki","ZmbM_ClerkFat_White",
|
||||||
|
"ZmbF_Clerk_Normal_Base","ZmbF_Clerk_Normal_Blue","ZmbF_Clerk_Normal_White","ZmbF_Clerk_Normal_Green","ZmbF_Clerk_Normal_Red" };
|
||||||
|
}
|
||||||
|
|
||||||
|
static set< Object > GetObjectsAt( vector from, vector to, Object ignore = NULL, float radius = 0.5, Object with = NULL )
|
||||||
|
{
|
||||||
|
vector contact_pos;
|
||||||
|
vector contact_dir;
|
||||||
|
int contact_component;
|
||||||
|
|
||||||
|
set< Object > geom = new set< Object >;
|
||||||
|
set< Object > view = new set< Object >;
|
||||||
|
|
||||||
|
DayZPhysics.RaycastRV( from, to, contact_pos, contact_dir, contact_component, geom, with, ignore, false, false, ObjIntersectGeom, radius );
|
||||||
|
DayZPhysics.RaycastRV( from, to, contact_pos, contact_dir, contact_component, view, with, ignore, false, false, ObjIntersectView, radius );
|
||||||
|
|
||||||
|
if ( geom.Count() > 0 )
|
||||||
|
{
|
||||||
|
return geom;
|
||||||
|
}
|
||||||
|
if ( view.Count() > 0 )
|
||||||
|
{
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Object GetPointerObject( Object ignore = NULL, float radius = 0.5, Object with = NULL )
|
||||||
|
{
|
||||||
|
vector dir = GetGame().GetPointerDirection();
|
||||||
|
|
||||||
|
vector from = GetGame().GetCurrentCameraPosition();
|
||||||
|
|
||||||
|
vector to = from + ( dir * 10000 );
|
||||||
|
|
||||||
|
auto objs = GetObjectsAt( from, to, ignore, radius, with );
|
||||||
|
|
||||||
|
if( objs.Count() > 0 )
|
||||||
|
{
|
||||||
|
return objs[ 0 ];
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Object GetCursorObject()
|
||||||
|
{
|
||||||
|
vector rayStart = GetGame().GetCurrentCameraPosition();
|
||||||
|
vector rayEnd = rayStart + GetGame().GetCurrentCameraDirection() * 10000;
|
||||||
|
|
||||||
|
auto objs = GetObjectsAt( rayStart, rayEnd );
|
||||||
|
|
||||||
|
if( objs.Count() > 0 )
|
||||||
|
{
|
||||||
|
return objs[ 0 ];
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static vector GetPointerPos()
|
||||||
|
{
|
||||||
|
if ( !GetPlayer() )
|
||||||
|
{
|
||||||
|
return "0 0 0";
|
||||||
|
}
|
||||||
|
|
||||||
|
vector dir = GetGame().GetPointerDirection();
|
||||||
|
|
||||||
|
vector from = GetGame().GetCurrentCameraPosition();
|
||||||
|
|
||||||
|
vector to = from + ( dir * 10000 );
|
||||||
|
|
||||||
|
vector rayStart = from;
|
||||||
|
vector rayEnd = to;
|
||||||
|
vector hitPos;
|
||||||
|
vector hitNormal;
|
||||||
|
int hitComponentIndex;
|
||||||
|
DayZPhysics.RaycastRV(rayStart, rayEnd, hitPos, hitNormal, hitComponentIndex, NULL, NULL, GetPlayer());
|
||||||
|
|
||||||
|
return hitPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
static vector GetCursorPos()
|
||||||
|
{
|
||||||
|
if ( !GetPlayer() )
|
||||||
|
{
|
||||||
|
return "0 0 0";
|
||||||
|
}
|
||||||
|
|
||||||
|
vector rayStart = GetGame().GetCurrentCameraPosition();
|
||||||
|
vector rayEnd = rayStart + GetGame().GetCurrentCameraDirection() * 10000;
|
||||||
|
vector hitPos;
|
||||||
|
vector hitNormal;
|
||||||
|
int hitComponentIndex;
|
||||||
|
DayZPhysics.RaycastRV(rayStart, rayEnd, hitPos, hitNormal, hitComponentIndex, NULL, NULL, GetPlayer());
|
||||||
|
|
||||||
|
return hitPos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static Weapon GetWeaponInHands()
|
||||||
|
{
|
||||||
|
Weapon weapon_in_hands;
|
||||||
|
if( GetPlayer() && GetPlayer().GetItemInHands() ) Class.CastTo(weapon_in_hands, GetPlayer().GetItemInHands());
|
||||||
|
|
||||||
|
return weapon_in_hands;
|
||||||
|
}
|
||||||
|
|
||||||
|
static MissionBase GetMission()
|
||||||
|
{
|
||||||
|
return MissionBase.Cast( GetGame().GetMission() );
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SetFreezePlayer( ref PlayerBase player, bool freeze )
|
||||||
|
{
|
||||||
|
player.GetInputController().OverrideMovementSpeed( freeze, 0 );
|
||||||
|
player.GetInputController().OverrideAimChangeX( freeze, 0 );
|
||||||
|
player.GetInputController().OverrideAimChangeY( freeze, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
static CommunityOfflineServer GetServerMission()
|
||||||
|
{
|
||||||
|
return CommunityOfflineServer.Cast( GetGame().GetMission() );
|
||||||
|
}
|
||||||
|
|
||||||
|
static ref PlayerBase GetPlayer()
|
||||||
|
{
|
||||||
|
return GetGame().GetPlayer();
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool SHIFT()
|
||||||
|
{
|
||||||
|
return( ( KeyState( KeyCode.KC_LSHIFT ) > 0 ) || ( KeyState( KeyCode.KC_RSHIFT ) > 0 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool CTRL()
|
||||||
|
{
|
||||||
|
return( ( KeyState( KeyCode.KC_LCONTROL ) > 0 ) || ( KeyState( KeyCode.KC_RCONTROL ) > 0 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool ALT()
|
||||||
|
{
|
||||||
|
return( ( KeyState( KeyCode.KC_LMENU ) > 0 ) || ( KeyState( KeyCode.KC_RMENU ) > 0 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool WINKEY()
|
||||||
|
{
|
||||||
|
return( ( KeyState( KeyCode.KC_LWIN ) > 0 ) || ( KeyState( KeyCode.KC_RWIN ) > 0 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
static ZombieBase SpawnInfected(vector pos)
|
||||||
|
{
|
||||||
|
return ZombieBase.Cast(GetGame().CreateObject( WorkingZombieClasses().GetRandomElement(), pos, false, true ));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
static Weapon_Base CreateWeapon( PlayerBase oPlayer )
|
||||||
|
{
|
||||||
|
Weapon_Base oWpn = Weapon_Base.Cast(oPlayer.GetInventory().CreateInInventory( "M4A1_Black" ));
|
||||||
|
oWpn.GetInventory().CreateAttachment( "M4_Suppressor" );
|
||||||
|
oWpn.GetInventory().CreateAttachment( "M4_RISHndgrd_Black" );
|
||||||
|
oWpn.GetInventory().CreateAttachment( "M4_MPBttstck_Black" );
|
||||||
|
oWpn.GetInventory().CreateAttachment( "ACOGOptic" );
|
||||||
|
|
||||||
|
return oWpn;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
static Weapon_Base CreateWeapon( PlayerBase oPlayer, string sWeapon )
|
||||||
|
{
|
||||||
|
Weapon_Base oWpn = Weapon_Base.Cast(oPlayer.GetInventory().CreateInInventory( sWeapon ));
|
||||||
|
oWpn.GetInventory().CreateAttachment( "PistolSuppressor" );
|
||||||
|
EntityAI optic = oWpn.GetInventory().CreateAttachment( "ReflexOptic" );
|
||||||
|
optic.GetInventory().CreateAttachment("Battery9V");
|
||||||
|
|
||||||
|
return oWpn;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Magazine LoadMag( PlayerBase oPlayer, Weapon_Base oWpn )
|
||||||
|
{
|
||||||
|
Magazine oMag = Magazine.Cast(oPlayer.GetInventory().CreateInInventory( "Mag_UMP_25Rnd" ));
|
||||||
|
oPlayer.GetWeaponManager().AttachMagazine( oMag );
|
||||||
|
|
||||||
|
return oMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
static PlayerBase CreateCustomDefaultCharacter()
|
||||||
|
{
|
||||||
|
PlayerBase oPlayer = PlayerBase.Cast( GetGame().CreatePlayer( NULL, GetGame().CreateRandomPlayer(), GetSpawnPoints().GetRandomElement(), 0, "NONE") );
|
||||||
|
|
||||||
|
EntityAI item = NULL;
|
||||||
|
|
||||||
|
item = oPlayer.GetInventory().CreateInInventory( "AviatorGlasses" );
|
||||||
|
item = oPlayer.GetInventory().CreateInInventory( "MilitaryBeret_UN" );
|
||||||
|
item = oPlayer.GetInventory().CreateInInventory( "M65Jacket_Black" );
|
||||||
|
item = oPlayer.GetInventory().CreateInInventory( "PlateCarrierHolster" );
|
||||||
|
item = oPlayer.GetInventory().CreateInInventory( "TacticalGloves_Black" );
|
||||||
|
item = oPlayer.GetInventory().CreateInInventory( "HunterPants_Autumn" );
|
||||||
|
item = oPlayer.GetInventory().CreateInInventory( "MilitaryBoots_Black" );
|
||||||
|
item = oPlayer.GetInventory().CreateInInventory( "AliceBag_Camo" );
|
||||||
|
|
||||||
|
item = oPlayer.GetInventory().CreateInInventory( "Mag_UMP_25Rnd" );
|
||||||
|
|
||||||
|
Weapon_Base oWpn = CreateWeapon(oPlayer, "UMP45");
|
||||||
|
LoadMag(oPlayer, oWpn);
|
||||||
|
|
||||||
|
oPlayer.LocalTakeEntityToHands( oWpn );
|
||||||
|
oPlayer.SetQuickBarEntityShortcut( oWpn, 0, true );
|
||||||
|
|
||||||
|
return oPlayer;
|
||||||
|
}
|
||||||
|
|
||||||
|
static string FileAttributeToString( FileAttr attr )
|
||||||
|
{
|
||||||
|
string fileType = "";
|
||||||
|
if ( attr & FileAttr.DIRECTORY )
|
||||||
|
{
|
||||||
|
fileType = fileType + "DIRECTORY";
|
||||||
|
}
|
||||||
|
if ( attr & FileAttr.HIDDEN )
|
||||||
|
{
|
||||||
|
fileType = fileType + "HIDDEN";
|
||||||
|
}
|
||||||
|
if ( attr & FileAttr.READONLY )
|
||||||
|
{
|
||||||
|
fileType = fileType + "READONLY";
|
||||||
|
}
|
||||||
|
if ( attr & FileAttr.INVALID )
|
||||||
|
{
|
||||||
|
fileType = fileType + "INVALID";
|
||||||
|
}
|
||||||
|
return fileType;
|
||||||
|
}
|
||||||
|
|
||||||
|
static vector SnapToGround(vector pos)
|
||||||
|
{
|
||||||
|
float pos_x = pos[0];
|
||||||
|
float pos_z = pos[2];
|
||||||
|
float pos_y = GetGame().SurfaceY( pos_x, pos_z );
|
||||||
|
vector tmp_pos = Vector( pos_x, pos_y, pos_z );
|
||||||
|
tmp_pos[1] = tmp_pos[1] + pos[1];
|
||||||
|
|
||||||
|
return tmp_pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool m_GodMode; // move these to player saves? Edit: Jacob says "yes"
|
||||||
|
static bool m_OldAiming;
|
||||||
|
static bool bc_Visible;
|
||||||
|
|
||||||
|
static void SnapToGroundNew( Object object )
|
||||||
|
{
|
||||||
|
vector pos = object.GetPosition();
|
||||||
|
pos[1] = GetGame().SurfaceY(pos[0], pos[2]);
|
||||||
|
|
||||||
|
vector clippingInfo[2];
|
||||||
|
vector objectBBOX[2];
|
||||||
|
|
||||||
|
object.GetCollisionBox( objectBBOX );
|
||||||
|
object.ClippingInfo( clippingInfo );
|
||||||
|
|
||||||
|
//float clipY = objectBBOX[1][1] / 2.0//- clippingInfo[0][1];
|
||||||
|
//pos[1] = pos[1] + objectBBOX[1][1] - clipY;
|
||||||
|
pos[1] = pos[1] + clippingInfo[1][1] / 2.0;//objectBBOX[0][1] - clipY
|
||||||
|
|
||||||
|
object.SetPosition(pos);
|
||||||
|
|
||||||
|
ForceTargetCollisionUpdate( object );
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ForceTargetCollisionUpdate( Object oObj )
|
||||||
|
{
|
||||||
|
if ( !oObj ) return;
|
||||||
|
|
||||||
|
vector roll = oObj.GetOrientation();
|
||||||
|
roll [ 2 ] = roll [ 2 ] - 1;
|
||||||
|
oObj.SetOrientation( roll );
|
||||||
|
roll [ 2 ] = roll [ 2 ] + 1;
|
||||||
|
oObj.SetOrientation( roll );
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ToggleCursor()
|
||||||
|
{
|
||||||
|
if ( GetGame().GetInput().HasGameFocus( INPUT_DEVICE_MOUSE ) )
|
||||||
|
{
|
||||||
|
GetGame().GetInput().ChangeGameFocus( 1 );
|
||||||
|
GetGame().GetUIManager().ShowUICursor( true );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GetGame().GetUIManager().ShowUICursor( false );
|
||||||
|
GetGame().GetInput().ResetGameFocus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Token types:
|
||||||
|
0 - error, no token
|
||||||
|
1 - defined token (special characters etc. . / * )
|
||||||
|
2 - quoted string. Quotes are removed -> TODO
|
||||||
|
3 - alphabetic string
|
||||||
|
4 - number
|
||||||
|
5 - end of line -> TODO
|
||||||
|
*/
|
||||||
|
static bool CheckStringType( string str, int type )
|
||||||
|
{
|
||||||
|
for(int i = 0; i<str.Length(); i++ )
|
||||||
|
{
|
||||||
|
string character = str.Get(i);
|
||||||
|
string token;
|
||||||
|
int result = character.ParseStringEx(token);
|
||||||
|
if ( result == type ) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
@ -0,0 +1,924 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
class AdminMenu //extends UIScriptedMenu
|
||||||
|
{
|
||||||
|
protected ref map<string, vector> m_TPLocations;
|
||||||
|
|
||||||
|
ref AdminMenuGui m_adMenu;
|
||||||
|
ref AdminMenuGuiMap m_map;
|
||||||
|
PlayerBase Admin;
|
||||||
|
PlayerIdentity AdminIdentity;
|
||||||
|
string AdminUID;
|
||||||
|
|
||||||
|
void AdminMenu()
|
||||||
|
{
|
||||||
|
GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
|
||||||
|
//adminMenuMain = new AdminMenuMain();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Message (string strMessage)
|
||||||
|
{
|
||||||
|
Param1<string> Msgparam1;
|
||||||
|
Msgparam1 = new Param1<string>( strMessage );
|
||||||
|
GetGame().RPCSingleParam(Admin, ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam1, true, AdminIdentity);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
|
||||||
|
{
|
||||||
|
array<Man> players = new array<Man>;
|
||||||
|
GetGame().GetPlayers( players );
|
||||||
|
PlayerIdentity selectedIdentity;
|
||||||
|
PlayerBase selectedPlayer;
|
||||||
|
string strMessage;
|
||||||
|
Param1<string> Msgparam;
|
||||||
|
string PlayerName;
|
||||||
|
string cData;
|
||||||
|
ItemBase oItem = NULL;
|
||||||
|
PlayerIdentity AdminIdent;
|
||||||
|
bool ai = false;
|
||||||
|
|
||||||
|
int quantity = 0;
|
||||||
|
string text = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
switch(rpc_type)
|
||||||
|
{
|
||||||
|
|
||||||
|
case (int)M_RPCs.M_Admin_Menu:
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Print("Admin Menu RPC");
|
||||||
|
//GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu, new Param1<vector>( GetCursorPos() ), false, NULL );
|
||||||
|
// permission check - server mission file
|
||||||
|
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
Print("Admin Menu sender name : " + sender.GetName() + "PlainID : " + sender.GetPlainId());
|
||||||
|
AdminIdentity = Admin.GetIdentity();
|
||||||
|
AdminUID = AdminIdentity.GetPlainId();
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_OK, new Param1<string>( "Test" ), false, NULL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
// UIScriptedMenu adminMenuGui = NULL;
|
||||||
|
// adminMenuGui = new AdminMenuGui();
|
||||||
|
// if ( g_Game.GetUIManager().GetMenu() == NULL )
|
||||||
|
// {
|
||||||
|
// g_Game.GetUIManager().ShowScriptedMenu( adminMenuGui, NULL );
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case (int)M_RPCs.M_Admin_Menu_OK:
|
||||||
|
Print("Admin Menu OK RPC");
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
UIScriptedMenu adminMenuGui = NULL;
|
||||||
|
adminMenuGui = new AdminMenuGui();
|
||||||
|
if ( g_Game.GetUIManager().GetMenu() == NULL )
|
||||||
|
{
|
||||||
|
g_Game.GetUIManager().ShowScriptedMenu( adminMenuGui, NULL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Spawn_Ground:
|
||||||
|
//read stuff
|
||||||
|
string GroundN_Item; //ItemName
|
||||||
|
string GroundN_ai; //ai Bool
|
||||||
|
string QuantityItem; //Textbox
|
||||||
|
ctx.Read(GroundN_Item);
|
||||||
|
ctx.Read(GroundN_ai);
|
||||||
|
ctx.Read(QuantityItem);
|
||||||
|
|
||||||
|
if (GroundN_ai == "true")
|
||||||
|
{
|
||||||
|
ai = true;
|
||||||
|
}
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID( sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
|
||||||
|
EntityAI oObj = GetGame().CreateObject( GroundN_Item, Admin.GetPosition(), false, ai );
|
||||||
|
//obEditor.addObject( oObj );
|
||||||
|
if ( oObj.IsInherited( ItemBase ) )
|
||||||
|
{
|
||||||
|
oItem = ( ItemBase ) oObj;
|
||||||
|
SetupSpawnedItem( oItem, oItem.GetMaxHealth(), 1 );
|
||||||
|
|
||||||
|
quantity = 0;
|
||||||
|
text = QuantityItem;
|
||||||
|
text.ToUpper();
|
||||||
|
//TODO ?? Check IsInherited EntetyAI
|
||||||
|
if (text == "MAX")
|
||||||
|
{
|
||||||
|
quantity = oItem.GetQuantityMax();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
quantity = text.ToInt();
|
||||||
|
}
|
||||||
|
oItem.SetQuantity(quantity);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Spawn_ItemPrev:
|
||||||
|
//read stuff
|
||||||
|
string ItemPrev_Item; //ItemName
|
||||||
|
ctx.Read(ItemPrev_Item);
|
||||||
|
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID( sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
|
||||||
|
EntityAI oObjp = GetGame().CreateObject( ItemPrev_Item, vector.Zero, false, false );
|
||||||
|
//obEditor.addObject( oObj );
|
||||||
|
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Spawn_ItemPrev_ok, new Param1<EntityAI>( oObjp ), false, NULL );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Spawn_Inventory:
|
||||||
|
//read stuff
|
||||||
|
string Inventory_Item; //ItemName
|
||||||
|
string Inventory_ai; //ai Bool
|
||||||
|
string Inventory_QuantityItem; //Textbox
|
||||||
|
ctx.Read(Inventory_Item);
|
||||||
|
ctx.Read(Inventory_ai);
|
||||||
|
ctx.Read(Inventory_QuantityItem);
|
||||||
|
|
||||||
|
if (Inventory_ai == "true")
|
||||||
|
{
|
||||||
|
ai = true;
|
||||||
|
}
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID( sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
EntityAI oInvItem = Admin.GetInventory().CreateInInventory( Inventory_Item );
|
||||||
|
oInvItem.SetHealth( oInvItem.GetMaxHealth() );
|
||||||
|
if ( oInvItem.IsInherited( ItemBase ) )
|
||||||
|
{
|
||||||
|
oItem = ( ItemBase ) oObj;
|
||||||
|
SetupSpawnedItem( oItem, oItem.GetMaxHealth(), 1 );
|
||||||
|
quantity = 0;
|
||||||
|
text = Inventory_QuantityItem;
|
||||||
|
text.ToUpper();
|
||||||
|
if (text == "MAX")
|
||||||
|
{
|
||||||
|
quantity = oItem.GetQuantityMax();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
quantity = text.ToInt();
|
||||||
|
}
|
||||||
|
oItem.SetQuantity(quantity);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Spawn_Cursor:
|
||||||
|
//read stuff
|
||||||
|
string Cursor_Item; //ItemName
|
||||||
|
vector Cursor_Pos //Vector Postition
|
||||||
|
string Cursor_ai; //ai Bool
|
||||||
|
string Cursor_QuantityItem; //Textbox
|
||||||
|
ctx.Read(Cursor_Item);
|
||||||
|
ctx.Read(Cursor_Pos);
|
||||||
|
ctx.Read(Cursor_ai);
|
||||||
|
ctx.Read(Cursor_QuantityItem);
|
||||||
|
if (Cursor_ai == "true")
|
||||||
|
{
|
||||||
|
ai = true;
|
||||||
|
}
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
EntityAI oCursorObj = GetGame().CreateObject( Cursor_Item, Cursor_Pos, false, ai );
|
||||||
|
//obEditor.addObject( oCursorObj );
|
||||||
|
|
||||||
|
if ( oCursorObj.IsInherited( ItemBase ) )
|
||||||
|
{
|
||||||
|
oItem = ( ItemBase ) oCursorObj;
|
||||||
|
SetupSpawnedItem( oItem, oItem.GetMaxHealth(), 1 );
|
||||||
|
|
||||||
|
quantity = 0;
|
||||||
|
text = Cursor_QuantityItem;
|
||||||
|
text.ToUpper();
|
||||||
|
|
||||||
|
if (text == "MAX")
|
||||||
|
{
|
||||||
|
quantity = oItem.GetQuantityMax();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
quantity = text.ToInt();
|
||||||
|
}
|
||||||
|
oItem.SetQuantity(quantity);
|
||||||
|
oCursorObj.PlaceOnSurface();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Heal:
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
//AdminIdentity = Admin.GetIdentity();
|
||||||
|
//AdminUID = AdminIdentity.GetPlainId();
|
||||||
|
Print(AdminUID);
|
||||||
|
Admin.SetHealth( Admin.GetMaxHealth( "", "" ) );
|
||||||
|
Admin.SetHealth( "","Blood", Admin.GetMaxHealth( "", "Blood" ) );
|
||||||
|
Admin.GetStatEnergy().Add(250);
|
||||||
|
Admin.GetStatWater().Add(250);
|
||||||
|
Admin.SetBleedingBits(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Strip:
|
||||||
|
string item;
|
||||||
|
Param1<string> stringParam;
|
||||||
|
ctx.Read( stringParam );
|
||||||
|
PlayerName = stringParam.param1;
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
for ( int a = 0; a < players.Count(); ++a )
|
||||||
|
{
|
||||||
|
selectedPlayer = players.Get(a);
|
||||||
|
selectedIdentity = selectedPlayer.GetIdentity();
|
||||||
|
if ( selectedIdentity.GetName() == PlayerName )
|
||||||
|
{
|
||||||
|
selectedPlayer.RemoveAllItems();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_TpTo:
|
||||||
|
ctx.Read( stringParam );
|
||||||
|
PlayerName = stringParam.param1;
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
for ( int z = 0; z < players.Count(); ++z )
|
||||||
|
{
|
||||||
|
selectedPlayer = players.Get(z);
|
||||||
|
selectedIdentity = selectedPlayer.GetIdentity();
|
||||||
|
if ( selectedIdentity.GetName() == PlayerName )
|
||||||
|
{
|
||||||
|
selectedPlayer.SetPosition(Admin.GetPosition());
|
||||||
|
|
||||||
|
Msgparam = new Param1<string>( "You were teleported by the admin!" );
|
||||||
|
GetGame().RPCSingleParam(Admin, ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, selectedIdentity);
|
||||||
|
|
||||||
|
strMessage = "Player " + PlayerName + " was teleported to your location!";
|
||||||
|
Msgparam = new Param1<string>( strMessage );
|
||||||
|
GetGame().RPCSingleParam(Admin, ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, AdminIdentity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_TpMe:
|
||||||
|
ctx.Read( stringParam );
|
||||||
|
PlayerName = stringParam.param1;
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
for ( int zm = 0; zm < players.Count(); ++zm )
|
||||||
|
{
|
||||||
|
if ( players.Get(zm).GetIdentity().GetName() == PlayerName )
|
||||||
|
{
|
||||||
|
Admin.SetPosition(players.Get(zm).GetPosition());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_TpAllMe:
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
int tpCount = TeleportAllPlayersTo(Admin);
|
||||||
|
string msgc = "All " + tpCount.ToString() + " Players Teleported to my POS!";
|
||||||
|
Msgparam = new Param1<string>( msgc );
|
||||||
|
GetGame().RPCSingleParam(Admin, ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, AdminIdentity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Spawn_Car:
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
Car MyNiva;
|
||||||
|
vector position = Admin.GetPosition();
|
||||||
|
float adminHeading = MiscGameplayFunctions.GetHeadingAngle(Admin);
|
||||||
|
vector posModifier = Vector(-(3 * Math.Sin(adminHeading)), 0, 3 * Math.Cos(adminHeading));
|
||||||
|
|
||||||
|
MyNiva = Car.Cast(GetGame().CreateObject( "OffroadHatchback", position + posModifier, false, true, true ));
|
||||||
|
MyNiva.GetInventory().CreateAttachment("HatchbackHood");
|
||||||
|
MyNiva.GetInventory().CreateAttachment("HatchbackTrunk");
|
||||||
|
MyNiva.GetInventory().CreateAttachment("HatchbackDoors_CoDriver");
|
||||||
|
MyNiva.GetInventory().CreateAttachment("HatchbackWheel");
|
||||||
|
MyNiva.GetInventory().CreateAttachment("HatchbackWheel");
|
||||||
|
MyNiva.GetInventory().CreateAttachment("HatchbackWheel");
|
||||||
|
MyNiva.GetInventory().CreateAttachment("HatchbackWheel");
|
||||||
|
MyNiva.GetInventory().CreateAttachment("SparkPlug");
|
||||||
|
MyNiva.GetInventory().CreateAttachment("EngineBelt");
|
||||||
|
MyNiva.GetInventory().CreateAttachment("CarBattery");
|
||||||
|
|
||||||
|
MyNiva.Fill( CarFluid.FUEL, MyNiva.GetFluidCapacity( CarFluid.FUEL ) );
|
||||||
|
MyNiva.Fill( CarFluid.OIL, MyNiva.GetFluidCapacity( CarFluid.OIL ) );
|
||||||
|
MyNiva.Fill( CarFluid.BRAKE, MyNiva.GetFluidCapacity( CarFluid.BRAKE ) );
|
||||||
|
MyNiva.Fill( CarFluid.COOLANT, MyNiva.GetFluidCapacity( CarFluid.COOLANT ) );
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Car_Refill:
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
ref array<Object> nearest_objects = new array<Object>;
|
||||||
|
ref array<CargoBase> proxy_cargos = new array<CargoBase>;
|
||||||
|
Car toBeFilled;
|
||||||
|
vector position1 = Admin.GetPosition();
|
||||||
|
GetGame().GetObjectsAtPosition ( position1, 10, nearest_objects, proxy_cargos );
|
||||||
|
|
||||||
|
for (int i = 0; i < nearest_objects.Count(); i++)
|
||||||
|
{
|
||||||
|
if (nearest_objects[i].IsKindOf("CarScript"))
|
||||||
|
{
|
||||||
|
toBeFilled = Car.Cast(nearest_objects[i]);
|
||||||
|
float fuelReq = toBeFilled.GetFluidCapacity( CarFluid.FUEL ) - (toBeFilled.GetFluidCapacity( CarFluid.FUEL ) * toBeFilled.GetFluidFraction( CarFluid.FUEL ));
|
||||||
|
float oilReq = toBeFilled.GetFluidCapacity( CarFluid.OIL ) - (toBeFilled.GetFluidCapacity( CarFluid.OIL ) * toBeFilled.GetFluidFraction( CarFluid.OIL ));
|
||||||
|
float coolantReq = toBeFilled.GetFluidCapacity( CarFluid.COOLANT ) - (toBeFilled.GetFluidCapacity( CarFluid.COOLANT ) * toBeFilled.GetFluidFraction( CarFluid.COOLANT ));
|
||||||
|
float brakeReq = toBeFilled.GetFluidCapacity( CarFluid.BRAKE ) - (toBeFilled.GetFluidCapacity( CarFluid.BRAKE ) * toBeFilled.GetFluidFraction( CarFluid.BRAKE ));
|
||||||
|
toBeFilled.Fill( CarFluid.FUEL, fuelReq );
|
||||||
|
toBeFilled.Fill( CarFluid.OIL, oilReq );
|
||||||
|
toBeFilled.Fill( CarFluid.COOLANT, coolantReq );
|
||||||
|
toBeFilled.Fill( CarFluid.BRAKE, brakeReq );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Day:
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
GetGame().GetWorld().SetDate( 1988, 5, 23, 12, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Night:
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
GetGame().GetWorld().SetDate( 1988, 9, 23, 22, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_TpToPos:
|
||||||
|
ctx.Read( stringParam );
|
||||||
|
cData = stringParam.param1;
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
vector position3 = "0 0 0";
|
||||||
|
m_TPLocations.Find( cData, position3 );
|
||||||
|
|
||||||
|
vector ofixPlayerPos;
|
||||||
|
ofixPlayerPos[0] = position3[0];
|
||||||
|
ofixPlayerPos[2] = position3[2];
|
||||||
|
|
||||||
|
ofixPlayerPos = SnapToGround( ofixPlayerPos );
|
||||||
|
|
||||||
|
Admin.SetPosition(ofixPlayerPos);
|
||||||
|
|
||||||
|
strMessage = "Teleported To Location: " + cData;
|
||||||
|
Msgparam = new Param1<string>( strMessage );
|
||||||
|
GetGame().RPCSingleParam(Admin, ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, AdminIdentity);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Kill:
|
||||||
|
ctx.Read( stringParam );
|
||||||
|
PlayerName = stringParam.param1;
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
for ( int ig = 0; ig < players.Count(); ++ig )
|
||||||
|
{
|
||||||
|
PlayerBase Target = players.Get(ig);
|
||||||
|
if ( Target.GetIdentity().GetName() == PlayerName )
|
||||||
|
{
|
||||||
|
Target.SetHealth(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_KillAll:
|
||||||
|
ctx.Read( stringParam );
|
||||||
|
PlayerName = stringParam.param1;
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
for ( int ig1 = 0; ig1 < players.Count(); ++ig1 )
|
||||||
|
{
|
||||||
|
PlayerBase Target1 = players.Get(ig1);
|
||||||
|
Target1.SetHealth(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_HealAll:
|
||||||
|
ctx.Read( stringParam );
|
||||||
|
PlayerName = stringParam.param1;
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
for ( int ig2 = 0; ig2 < players.Count(); ++ig2 )
|
||||||
|
{
|
||||||
|
PlayerBase Target2 = players.Get(ig2);
|
||||||
|
Target2.SetHealth( Admin.GetMaxHealth( "", "" ) );
|
||||||
|
Target2.SetHealth( "","Blood", Admin.GetMaxHealth( "", "Blood" ) );
|
||||||
|
Target2.GetStatEnergy().Add(250);
|
||||||
|
Target2.GetStatWater().Add(250);
|
||||||
|
Target2.SetBleedingBits(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_StripAll:
|
||||||
|
ctx.Read( stringParam );
|
||||||
|
PlayerName = stringParam.param1;
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
for ( int ig3 = 0; ig3 < players.Count(); ++ig3 )
|
||||||
|
{
|
||||||
|
PlayerBase Target3 = players.Get(ig3);
|
||||||
|
Target3.RemoveAllItems();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Stamina_Enable:
|
||||||
|
ctx.Read( stringParam );
|
||||||
|
PlayerName = stringParam.param1;
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
GetServerMission().RemoveStamina(PlayerName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Stamina_Dissable:
|
||||||
|
ctx.Read( stringParam );
|
||||||
|
PlayerName = stringParam.param1;
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
GetServerMission().AddStamina(PlayerName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Player_Stamina_Request:
|
||||||
|
ctx.Read( stringParam );
|
||||||
|
PlayerName = stringParam.param1;
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
if (GetServerMission().StaminaContains(PlayerName))
|
||||||
|
{
|
||||||
|
ScriptRPC IsStamina = new ScriptRPC();
|
||||||
|
IsStamina.Write(PlayerName);
|
||||||
|
IsStamina.Send(NULL, M_RPCs.M_Admin_Menu_Player_Stamina_ok, false, sender);
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
ScriptRPC IsStamina2 = new ScriptRPC();
|
||||||
|
IsStamina2.Write("NULL");
|
||||||
|
IsStamina2.Send(NULL, M_RPCs.M_Admin_Menu_Player_Stamina_ok, false, sender);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_PM:
|
||||||
|
string MSG;
|
||||||
|
string MSGName;//Vector Postition
|
||||||
|
ctx.Read(MSG);
|
||||||
|
ctx.Read(MSGName);
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
for ( int z1 = 0; z1 < players.Count(); ++z1 )
|
||||||
|
{
|
||||||
|
selectedPlayer = players.Get(z1);
|
||||||
|
selectedIdentity = selectedPlayer.GetIdentity();
|
||||||
|
if ( selectedIdentity.GetName() == MSGName )
|
||||||
|
{
|
||||||
|
Msgparam = new Param1<string>( MSG );
|
||||||
|
GetGame().RPCSingleParam(Admin, ERPCs.RPC_USER_ACTION_MESSAGE, Msgparam, true, sender);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Map_Player_Request:
|
||||||
|
string PosName;
|
||||||
|
vector Pos1; //Vector Postition
|
||||||
|
ctx.Read(PosName);
|
||||||
|
ctx.Read(Pos1);
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
GetServerMission().SendPosTOAdmins();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Player_Health_Request:
|
||||||
|
|
||||||
|
PlayerBase HealthPlayer;
|
||||||
|
ctx.Read(HealthPlayer);
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
|
||||||
|
Admin = GetServerMission().IsAdminID(sender.GetName(), sender.GetPlainId());
|
||||||
|
if ( Admin != null )
|
||||||
|
{
|
||||||
|
DebugMonitorValues values = HealthPlayer.GetDebugMonitorValues();
|
||||||
|
float Value1;
|
||||||
|
Value1 = HealthPlayer.GetHealth("", "Health");
|
||||||
|
string health = string.Format(" %1", Value1.ToString());
|
||||||
|
Print("Name : " + HealthPlayer.GetIdentity().GetName() + "Health :" + health);
|
||||||
|
|
||||||
|
float Value2;
|
||||||
|
Value2 = HealthPlayer.GetHealth("", "Blood");
|
||||||
|
string blood = string.Format(" %1", Value2.ToString());
|
||||||
|
Print("Name : " + HealthPlayer.GetIdentity().GetName() + "blood :" + blood);
|
||||||
|
|
||||||
|
vector Value;
|
||||||
|
Value = HealthPlayer.GetPosition()
|
||||||
|
string positionP = string.Format(" %1 %2 %3", Value[0].ToString(), Value[1].ToString(), Value[2].ToString());
|
||||||
|
Print("Name : " + HealthPlayer.GetIdentity().GetName() + "positionP :" + positionP);
|
||||||
|
|
||||||
|
ScriptRPC PPos = new ScriptRPC();
|
||||||
|
PPos.Write(health);
|
||||||
|
PPos.Write(blood);
|
||||||
|
PPos.Write(positionP);
|
||||||
|
PPos.Send(NULL, M_RPCs.M_Admin_Menu_Player_Health, false, sender);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPC()
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu, new Param1<vector>( GetCursorPos() ), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPCItem(string item)
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Spawn_Ground, new Param1<string>(item), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SendRPCHeal()
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Heal, new Param1<string>(""), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPCStrip(string PlayerName)
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Strip, new Param1<string>(PlayerName), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPCTpTo(string PlayerName)
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_TpTo, new Param1<string>(PlayerName), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPCTpMe(string PlayerName)
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_TpMe, new Param1<string>(PlayerName), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPCTpAllMe()
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_TpAllMe, new Param1<string>(""), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPCSpCar()
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Spawn_Car, new Param1<string>(""), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPCDay()
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Day, new Param1<string>(""), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPCNight()
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Night, new Param1<string>(""), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPCRefill()
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Car_Refill, new Param1<string>(""), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void SendRPCTpToPos(string pos)
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_TpToPos, new Param1<string>(pos), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPCKill(string PlayerName)
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Kill, new Param1<string>(PlayerName), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPCSpWear()
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_SpWear, new Param1<string>(""), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
vector SnapToGround(vector pos)
|
||||||
|
{
|
||||||
|
float pos_x = pos[0];
|
||||||
|
float pos_z = pos[2];
|
||||||
|
float pos_y = GetGame().SurfaceY( pos_x, pos_z );
|
||||||
|
vector tmp_pos = Vector( pos_x, pos_y, pos_z );
|
||||||
|
tmp_pos[1] = tmp_pos[1] + pos[1];
|
||||||
|
|
||||||
|
return tmp_pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
int TeleportAllPlayersTo(PlayerBase Admin)
|
||||||
|
{
|
||||||
|
array<Man> players = new array<Man>;
|
||||||
|
GetGame().GetPlayers( players );
|
||||||
|
|
||||||
|
vector AdminPos;
|
||||||
|
AdminPos = Admin.GetPosition();
|
||||||
|
|
||||||
|
for ( int i = 0; i < players.Count(); ++i )
|
||||||
|
{
|
||||||
|
PlayerBase Target = players.Get(i);
|
||||||
|
Target.SetPosition( AdminPos );
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void oSpawnItemFunc(int ground, string ClassName)//2nd PlayerBase player
|
||||||
|
{
|
||||||
|
EntityAI item;
|
||||||
|
ItemBase itemBs
|
||||||
|
|
||||||
|
vector NewPosition;
|
||||||
|
vector OldPosition;
|
||||||
|
|
||||||
|
if (ground == 1)
|
||||||
|
{
|
||||||
|
OldPosition = Admin.GetPosition();
|
||||||
|
|
||||||
|
NewPosition[0] = OldPosition[0] + 1.5;
|
||||||
|
NewPosition[1] = OldPosition[1] + 0.1;
|
||||||
|
NewPosition[2] = OldPosition[2] + 1.5;
|
||||||
|
GetGame().CreateObject( ClassName, NewPosition, false, true );
|
||||||
|
}else{
|
||||||
|
|
||||||
|
item = Admin.GetInventory().CreateInInventory( ClassName );
|
||||||
|
itemBs = ItemBase.Cast(item);
|
||||||
|
itemBs.SetQuantity(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
class DevCam
|
||||||
|
{
|
||||||
|
void DevCam()
|
||||||
|
{
|
||||||
|
GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
|
||||||
|
{
|
||||||
|
if ( rpc_type == M_RPCs.M_SET_CAM )
|
||||||
|
{
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
Print( " receive rpc dev cam is server");
|
||||||
|
|
||||||
|
ref PlayerBase player = GetServerMission().GetPlayerFromIdentity( sender );
|
||||||
|
|
||||||
|
Param2< bool, vector > camParams;
|
||||||
|
ctx.Read( camParams );
|
||||||
|
|
||||||
|
bool spectating = camParams.param1;
|
||||||
|
vector pos = camParams.param2;
|
||||||
|
if ( GetServerMission().IsAdmin( sender.GetName(), sender.GetPlainId() ) )
|
||||||
|
{
|
||||||
|
if ( spectating )
|
||||||
|
{
|
||||||
|
player.SetPosition( pos );
|
||||||
|
SetFreezePlayer( player, false );
|
||||||
|
GetGame().SelectPlayer( sender, player );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetFreezePlayer( player, true );
|
||||||
|
GetGame().SelectSpectator( sender, "DayZSpectator", GetServerMission().GetPlayerFromIdentity( sender ).GetPosition() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{ // test if setting camera works on client side. instead of server side ^
|
||||||
|
GetPlayer().MessageStatus("Toggle Free cam");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPC( bool isSpectating, vector toPos )
|
||||||
|
{
|
||||||
|
Print("Send Cam RPC");
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_SET_CAM, new Param2< bool, vector >( isSpectating, toPos ), false, NULL );
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
class DevTeleport
|
||||||
|
{
|
||||||
|
void DevTeleport()
|
||||||
|
{
|
||||||
|
GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
|
||||||
|
{
|
||||||
|
if ( rpc_type == M_RPCs.M_TELEPORT )
|
||||||
|
{
|
||||||
|
vector positionToTeleport;
|
||||||
|
|
||||||
|
Param1<vector> vectorParam;
|
||||||
|
ctx.Read( vectorParam );
|
||||||
|
|
||||||
|
positionToTeleport = vectorParam.param1;
|
||||||
|
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
ref PlayerBase player = GetServerMission().GetPlayerFromIdentity( sender );
|
||||||
|
// permission check - server mission file
|
||||||
|
// if has permissions send message back to client
|
||||||
|
if ( GetServerMission().IsAdmin( sender.GetName(), sender.GetPlainId())
|
||||||
|
{
|
||||||
|
player.SetPosition( positionToTeleport ); //set player position on server side
|
||||||
|
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_TELEPORT, vectorParam, false, NULL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
//GetPlayer().SetPosition( positionToTeleport ); //client side
|
||||||
|
GetPlayer().MessageStatus( "Teleported ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SendRPC()
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_TELEPORT, new Param1<vector>( GetCursorPos() ), false, NULL );
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,198 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
class AdminMenuGuiCommands extends ScriptedWidgetEventHandler
|
||||||
|
{
|
||||||
|
protected Widget m_Root;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected AdminMenuGui m_Menu;
|
||||||
|
CheckBoxWidget m_Config_Teleport;
|
||||||
|
CheckBoxWidget m_Config_Cam;
|
||||||
|
protected ref map<int, ref Param2<string, string>> m_TextMap;
|
||||||
|
|
||||||
|
protected ButtonWidget m_Command_Day;
|
||||||
|
protected ButtonWidget m_Command_Night;
|
||||||
|
protected ButtonWidget m_Command_Refill;
|
||||||
|
protected ButtonWidget m_Command_HealButton;
|
||||||
|
protected ButtonWidget m_Command_SpCar;
|
||||||
|
protected ButtonWidget m_Command_Cam;
|
||||||
|
protected ButtonWidget m_Command_CamTp;
|
||||||
|
protected ButtonWidget m_Command_Test;
|
||||||
|
protected ref map<string, string> m_TestList;
|
||||||
|
protected string m_TestListPath = "$CurrentDir:\\DayZ-SA-Tomato\\Config\\";
|
||||||
|
|
||||||
|
ref AdminMenuManager AMenuM;
|
||||||
|
|
||||||
|
void AdminMenuGuiCommands( Widget parent, AdminMenuGui menu )
|
||||||
|
{
|
||||||
|
|
||||||
|
m_Root = GetGame().GetWorkspace().CreateWidgets( "com\\DayZ-SA-Tomato\\scripts\\5_Mission\\core\\modules\\GUI\\Layouts\\Admin_Commands.layout", parent );
|
||||||
|
|
||||||
|
m_Menu = menu;
|
||||||
|
|
||||||
|
m_Config_Teleport = CheckBoxWidget.Cast( m_Root.FindAnyWidget( "Config_Teleport" ) );
|
||||||
|
m_Config_Cam = CheckBoxWidget.Cast( m_Root.FindAnyWidget( "Config_Cam" ) );
|
||||||
|
|
||||||
|
m_Command_HealButton = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Command_Heal" ) );
|
||||||
|
m_Command_SpCar = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Command_SpCar" ) );
|
||||||
|
m_Command_Day = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Command_Day" ) );
|
||||||
|
m_Command_Night = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Command_Night" ) );
|
||||||
|
m_Command_Refill = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Command_Refill" ) );
|
||||||
|
m_Command_Cam = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Command_Cam" ) );
|
||||||
|
m_Command_CamTp = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Command_CamTp" ) );
|
||||||
|
|
||||||
|
m_Command_Test = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Command_Test" ) );
|
||||||
|
|
||||||
|
if (AMenuM.Config_Cam)
|
||||||
|
{
|
||||||
|
m_Config_Cam.SetChecked(true);
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
m_Config_Cam.SetChecked(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AMenuM.Config_Teleport)
|
||||||
|
{
|
||||||
|
m_Config_Teleport.SetChecked(true);
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
m_Config_Teleport.SetChecked(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-----Add Admins from txt-----
|
||||||
|
FileHandle AdminUIDSFile = OpenFile(m_TestListPath + "Test.txt",FileMode.READ);
|
||||||
|
if (AdminUIDSFile != 0)
|
||||||
|
{
|
||||||
|
m_TestList = new map<string, string>; //UID, name
|
||||||
|
string line_content = "";
|
||||||
|
while ( FGets(AdminUIDSFile,line_content) > 0 )
|
||||||
|
{
|
||||||
|
m_TestList.Insert(line_content,"null"); //UID , NAME
|
||||||
|
}
|
||||||
|
CloseFile(AdminUIDSFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Click(Widget w, int x, int y, int button)
|
||||||
|
{
|
||||||
|
PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
|
||||||
|
if (player)
|
||||||
|
{
|
||||||
|
if( ( w == m_Command_HealButton ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Heal, new Param1<string>(""), false, NULL );
|
||||||
|
Message("1 Up");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if( ( w == m_Command_SpCar ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Spawn_Car, new Param1<string>(""), false, NULL );
|
||||||
|
Message("Going fast");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( w == m_Command_Day ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Day, new Param1<string>(""), false, NULL );
|
||||||
|
Message("DayTime");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( w == m_Command_Night ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Night, new Param1<string>(""), false, NULL );
|
||||||
|
Message("NightTime");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( w == m_Command_Refill ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Car_Refill, new Param1<string>(""), false, NULL );
|
||||||
|
Message("Gas Station");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( w == m_Command_Test ) )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Set_Teleport()
|
||||||
|
{
|
||||||
|
if (AMenuM.Config_Teleport)
|
||||||
|
{
|
||||||
|
AMenuM.Config_Teleport = false;
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
AMenuM.Config_Teleport = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Set_Cam()
|
||||||
|
{
|
||||||
|
if (AMenuM.Config_Cam)
|
||||||
|
{
|
||||||
|
AMenuM.Config_Cam = false;
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
AMenuM.Config_Cam = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ~AdminMenuGuiCommands()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Focus()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override bool OnFocus( Widget w, int x, int y )
|
||||||
|
{
|
||||||
|
if( m_Menu )
|
||||||
|
m_Menu.OnFocus( w, x, y );
|
||||||
|
if( w )
|
||||||
|
{
|
||||||
|
Param2<string, string> p = m_TextMap.Get( w.GetUserID() );
|
||||||
|
if( p )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ( w != null );
|
||||||
|
}
|
||||||
|
|
||||||
|
void Message( string txt )
|
||||||
|
{
|
||||||
|
GetGame().GetMission().OnEvent(ChatMessageEventTypeID, new ChatMessageEventParams(0, "", txt, ""));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,302 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
class AdminMenuGui extends UIScriptedMenu
|
||||||
|
{
|
||||||
|
protected TabberUI m_Tabber;
|
||||||
|
protected ref AdminMenuGuiCommands m_CommandTab;
|
||||||
|
protected ref AdminMenuGuiSpawn m_SpawnTab;
|
||||||
|
protected ref AdminMenuGuiPlayer m_PlayerTab;
|
||||||
|
protected ref AdminMenuGuiMap m_MapTab;
|
||||||
|
protected ref map<string, string> m_TestListS;
|
||||||
|
protected string m_TestListPath = "$CurrentDir:\\DayZ-SA-Tomato\\";
|
||||||
|
|
||||||
|
protected ButtonWidget m_Back;
|
||||||
|
|
||||||
|
void AdminMenuGui()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override bool OnItemSelected( Widget w, int x, int y, int row, int column, int oldRow, int oldColumn )
|
||||||
|
{
|
||||||
|
bool okstap;
|
||||||
|
okstap = false;
|
||||||
|
if ( w == m_SpawnTab.m_classList ) {
|
||||||
|
okstap = m_SpawnTab.OnItemSelect(w, x, y, row, column, oldRow, oldColumn)
|
||||||
|
return okstap;
|
||||||
|
}
|
||||||
|
return okstap;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Message( string txt )
|
||||||
|
{
|
||||||
|
GetGame().GetMission().OnEvent(ChatMessageEventTypeID, new ChatMessageEventParams(0, "", txt, ""));
|
||||||
|
}
|
||||||
|
override bool OnChange( Widget w, int x, int y, bool finished )
|
||||||
|
{
|
||||||
|
if ( w == m_PlayerTab.m_PlayerList )
|
||||||
|
{
|
||||||
|
m_PlayerTab.PlayerSelect();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( w == m_SpawnTab.m_Spawn_SearchBox )
|
||||||
|
{
|
||||||
|
m_SpawnTab.UpdateList( "All" );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( w == m_CommandTab.m_Config_Teleport )
|
||||||
|
{
|
||||||
|
m_CommandTab.Set_Teleport();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( w == m_CommandTab.m_Config_Cam )
|
||||||
|
{
|
||||||
|
m_CommandTab.Set_Cam();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( w == m_PlayerTab.m_Cb_Player_Stamina )
|
||||||
|
{
|
||||||
|
m_PlayerTab.Set_Stamina();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
void ItemPrevCall(EntityAI item)
|
||||||
|
{
|
||||||
|
m_SpawnTab.OnItemSelect2(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
override Widget Init()
|
||||||
|
{
|
||||||
|
layoutRoot = GetGame().GetWorkspace().CreateWidgets( "com\\DayZ-SA-Tomato\\scripts\\5_Mission\\core\\modules\\GUI\\Layouts\\Admin_Main.layout", null );
|
||||||
|
|
||||||
|
layoutRoot.FindAnyWidget( "Tabber" ).GetScript( m_Tabber );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
m_CommandTab = new AdminMenuGuiCommands( layoutRoot.FindAnyWidget( "Tab_0" ), this );
|
||||||
|
m_SpawnTab = new AdminMenuGuiSpawn( layoutRoot.FindAnyWidget( "Tab_1" ), this );
|
||||||
|
m_PlayerTab = new AdminMenuGuiPlayer( layoutRoot.FindAnyWidget( "Tab_2" ), this );
|
||||||
|
m_MapTab = new AdminMenuGuiMap( layoutRoot.FindAnyWidget( "Tab_3" ), this );
|
||||||
|
|
||||||
|
m_Back = ButtonWidget.Cast( layoutRoot.FindAnyWidget( "back" ) );
|
||||||
|
|
||||||
|
|
||||||
|
SetFocus( layoutRoot );
|
||||||
|
|
||||||
|
|
||||||
|
m_Tabber.m_OnTabSwitch.Insert( OnTabSwitch );
|
||||||
|
|
||||||
|
/*
|
||||||
|
//-----Add Admins from txt-----
|
||||||
|
FileHandle AdminUIDSFile = OpenFile(m_AdminListPath + "Admins.txt",FileMode.READ);
|
||||||
|
if (AdminUIDSFile != 0)
|
||||||
|
{
|
||||||
|
m_AdminList = new map<string, string>; //UID, name
|
||||||
|
string line_content = "";
|
||||||
|
while ( FGets(AdminUIDSFile,line_content) > 0 )
|
||||||
|
{
|
||||||
|
m_AdminList.Insert(line_content,"null"); //UID , NAME
|
||||||
|
Print("Adding Admin: "+ line_content + " To the Admin List!");
|
||||||
|
}
|
||||||
|
CloseFile(AdminUIDSFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
return layoutRoot;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ~AdminMenuGui()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override bool OnClick( Widget w, int x, int y, int button )
|
||||||
|
{
|
||||||
|
//SpawnTab
|
||||||
|
bool ok = false;
|
||||||
|
if ( w.GetName().Contains("_spawn_") )
|
||||||
|
{
|
||||||
|
ok = m_SpawnTab.Click(w, x, y, button)
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
//CommandTab
|
||||||
|
if ( w.GetName().Contains("_Command_") )
|
||||||
|
{
|
||||||
|
ok = m_CommandTab.Click(w, x, y, button)
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
//PlayerTab
|
||||||
|
if ( w.GetName().Contains("_Player_") )
|
||||||
|
{
|
||||||
|
ok = m_PlayerTab.Click(w, x, y, button)
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Main Widget
|
||||||
|
if( button == MouseState.LEFT )
|
||||||
|
{
|
||||||
|
if( w == m_Back )
|
||||||
|
{
|
||||||
|
Back();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnTabSwitch( int tab )
|
||||||
|
{
|
||||||
|
switch( tab )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
m_CommandTab.Focus();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
m_SpawnTab.Focus();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
m_PlayerTab.Focus();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
m_MapTab.Focus();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Back()
|
||||||
|
{
|
||||||
|
GetGame().EndOptionsVideo();
|
||||||
|
GetGame().GetUIManager().Back();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
override bool OnMouseEnter( Widget w, int x, int y )
|
||||||
|
{
|
||||||
|
if( w && IsFocusable( w ) )
|
||||||
|
{
|
||||||
|
ColorRed( w );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
override bool OnMouseLeave( Widget w, Widget enterW, int x, int y )
|
||||||
|
{
|
||||||
|
if( w && IsFocusable( w ) )
|
||||||
|
{
|
||||||
|
ColorWhite( w, enterW );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
override bool OnFocus( Widget w, int x, int y )
|
||||||
|
{
|
||||||
|
if( w && IsFocusable( w ) )
|
||||||
|
{
|
||||||
|
ColorRed( w );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
override bool OnFocusLost( Widget w, int x, int y )
|
||||||
|
{
|
||||||
|
if( w && IsFocusable( w ) )
|
||||||
|
{
|
||||||
|
ColorWhite( w, null );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsFocusable( Widget w )
|
||||||
|
{
|
||||||
|
if( w )
|
||||||
|
{
|
||||||
|
return ( w == m_Back );
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override void OnShow()
|
||||||
|
{
|
||||||
|
super.OnShow();
|
||||||
|
GetGame().GetUIManager().ShowUICursor( true );
|
||||||
|
GetGame().GetInput().ChangeGameFocus( 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
override void OnHide()
|
||||||
|
{
|
||||||
|
super.OnHide();
|
||||||
|
GetGame().GetUIManager().ShowUICursor( false );
|
||||||
|
GetGame().GetInput().ResetGameFocus( );
|
||||||
|
}
|
||||||
|
|
||||||
|
//Coloring functions (Until WidgetStyles are useful)
|
||||||
|
void ColorRed( Widget w )
|
||||||
|
{
|
||||||
|
SetFocus( w );
|
||||||
|
|
||||||
|
ButtonWidget button = ButtonWidget.Cast( w );
|
||||||
|
if( button )
|
||||||
|
{
|
||||||
|
button.SetTextColor( ARGB( 255, 200, 0, 0 ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ColorWhite( Widget w, Widget enterW )
|
||||||
|
{
|
||||||
|
#ifdef PLATFORM_WINDOWS
|
||||||
|
SetFocus( null );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ButtonWidget button = ButtonWidget.Cast( w );
|
||||||
|
if( button )
|
||||||
|
{
|
||||||
|
button.SetTextColor( ARGB( 255, 255, 255, 255 ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
class AdminMenuManager
|
||||||
|
{
|
||||||
|
|
||||||
|
static bool Config_Teleport = false;
|
||||||
|
static bool Config_Cam = false;
|
||||||
|
static ref map<string, vector> m_PlayerLocations;
|
||||||
|
|
||||||
|
void ~AdminMenuManager()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdminMenuManager()
|
||||||
|
{
|
||||||
|
m_PlayerLocations = new map<string, vector>; //name of town, pos
|
||||||
|
}
|
||||||
|
void Teleport()
|
||||||
|
{
|
||||||
|
if (Config_Teleport)
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_TELEPORT, new Param1<vector>( GetCursorPos() ), false, NULL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CamTeleport( bool isSpectating, vector toPos )
|
||||||
|
{
|
||||||
|
if (Config_Cam)
|
||||||
|
{
|
||||||
|
Print("Send Cam RPC");
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_SET_CAM, new Param2< bool, vector >( isSpectating, toPos ), false, NULL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MenuOpen()
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu, new Param1<vector>( GetCursorPos() ), false, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,108 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
class AdminMenuGuiMap extends ScriptedWidgetEventHandler
|
||||||
|
{
|
||||||
|
protected Widget m_Root;
|
||||||
|
|
||||||
|
protected MapWidget m_Map_Map;
|
||||||
|
|
||||||
|
protected AdminMenuGui m_Menu;
|
||||||
|
|
||||||
|
protected ref map<int, ref Param2<string, string>> m_TextMap;
|
||||||
|
|
||||||
|
void AdminMenuGuiMap( Widget parent, AdminMenuGui menu )
|
||||||
|
{
|
||||||
|
GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
|
||||||
|
m_Root = GetGame().GetWorkspace().CreateWidgets( "com\\DayZ-SA-Tomato\\scripts\\5_Mission\\core\\modules\\GUI\\Layouts\\Admin_Map.layout", parent );
|
||||||
|
|
||||||
|
m_Menu = menu;
|
||||||
|
m_Map_Map = MapWidget.Cast( m_Root.FindAnyWidget( "Map" ) );
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Map_Player_Request, new Param1<string>(""), false, NULL );
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
//GetMarkers();
|
||||||
|
/*
|
||||||
|
m_Map_Map.AddUserMark("2681 4.7 1751", "Lalal", ARGB(255,255,0,0), "\\dz\\gear\\navigation\\data\\map_tree_ca.paa");
|
||||||
|
m_Map_Map.AddUserMark("2683 4.7 1851", "Lala2", ARGB(255,0,255,0), "\\dz\\gear\\navigation\\data\\map_bunker_ca.paa");
|
||||||
|
m_Map_Map.AddUserMark("2670 4.7 1651", "Lala3", ARGB(255,0,0,255), "\\dz\\gear\\navigation\\data\\map_busstop_ca.paa"); */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ~AdminMenuGuiMap()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Focus()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Message( string txt )
|
||||||
|
{
|
||||||
|
GetGame().GetMission().OnEvent(ChatMessageEventTypeID, new ChatMessageEventParams(0, "", txt, ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
|
||||||
|
{
|
||||||
|
switch(rpc_type)
|
||||||
|
{
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Map_Player:
|
||||||
|
string PosName;
|
||||||
|
vector Pos1; //Vector Postition
|
||||||
|
ctx.Read(PosName);
|
||||||
|
ctx.Read(Pos1);
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
AddPlayerMarker(PosName, Pos1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void AddPlayerMarker(string name, vector pos)
|
||||||
|
{
|
||||||
|
m_Map_Map.AddUserMark(pos, name, ARGB(255,255,0,0), "\\dz\\gear\\navigation\\data\\map_tree_ca.paa");
|
||||||
|
}
|
||||||
|
|
||||||
|
override bool OnFocus( Widget w, int x, int y )
|
||||||
|
{
|
||||||
|
if( m_Menu )
|
||||||
|
m_Menu.OnFocus( w, x, y );
|
||||||
|
if( w )
|
||||||
|
{
|
||||||
|
Param2<string, string> p = m_TextMap.Get( w.GetUserID() );
|
||||||
|
if( p )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ( w != null );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,293 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
class AdminMenuGuiPlayer extends ScriptedWidgetEventHandler
|
||||||
|
{
|
||||||
|
protected Widget m_Root;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
protected AdminMenuGui m_Menu;
|
||||||
|
|
||||||
|
protected ref map<int, ref Param2<string, string>> m_TextMap;
|
||||||
|
protected ButtonWidget m_btn_Player_Kill;
|
||||||
|
protected ButtonWidget m_btn_Player_Strip;
|
||||||
|
protected ButtonWidget m_btn_Player_Heal;
|
||||||
|
protected ButtonWidget m_btn_Player_TpTo;
|
||||||
|
protected ButtonWidget m_btn_Player_TpMe;
|
||||||
|
protected ButtonWidget m_btn_Player_Stamina;
|
||||||
|
protected ButtonWidget m_btn_Player_KillAll;
|
||||||
|
protected ButtonWidget m_btn_Player_HealAll;
|
||||||
|
protected ButtonWidget m_btn_Player_StripAll;
|
||||||
|
protected ButtonWidget m_btn_Player_TpMeAll;
|
||||||
|
protected ButtonWidget m_btn_Player_Send;
|
||||||
|
protected TextWidget m_Text_Player_Blood;
|
||||||
|
protected TextWidget m_Text_Player_Health;
|
||||||
|
protected TextWidget m_Text_Player_Pos;
|
||||||
|
protected TextWidget m_Text_Player_Stamina;
|
||||||
|
protected EditBoxWidget m_Box_Player_Message;
|
||||||
|
CheckBoxWidget m_Cb_Player_Stamina;
|
||||||
|
TextListboxWidget m_PlayerList;
|
||||||
|
|
||||||
|
|
||||||
|
void AdminMenuGuiPlayer( Widget parent, AdminMenuGui menu )
|
||||||
|
{
|
||||||
|
|
||||||
|
m_Root = GetGame().GetWorkspace().CreateWidgets( "com\\DayZ-SA-Tomato\\scripts\\5_Mission\\core\\modules\\GUI\\Layouts\\Admin_Player.layout", parent );
|
||||||
|
|
||||||
|
m_Menu = menu;
|
||||||
|
GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
|
||||||
|
m_PlayerList = TextListboxWidget.Cast( m_Root.FindAnyWidget( "Player_Player_List" )
|
||||||
|
m_Box_Player_Message = EditBoxWidget.Cast( m_Root.FindAnyWidget( "Box_Player_Message" ) );
|
||||||
|
m_btn_Player_Strip = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Player_Strip" ) );
|
||||||
|
m_btn_Player_Kill = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Player_Kill" ) );
|
||||||
|
m_btn_Player_Heal = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Player_Heal" ) );
|
||||||
|
m_btn_Player_TpMe = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Player_TpMe" ) );
|
||||||
|
m_btn_Player_TpTo = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Player_TpTo" ) );
|
||||||
|
m_btn_Player_Stamina = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Player_Stamina" ) );
|
||||||
|
m_btn_Player_KillAll = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Player_KillAll" ) );
|
||||||
|
m_btn_Player_HealAll = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Player_HealAll" ) );
|
||||||
|
m_btn_Player_StripAll = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Player_StripAll" ) );
|
||||||
|
m_btn_Player_TpMeAll = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Player_TpMeAll" ) );
|
||||||
|
m_btn_Player_Send = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_Player_Send" ) );
|
||||||
|
m_Text_Player_Blood = TextWidget.Cast( m_Root.FindAnyWidget( "Text_Player_Blood" ) );
|
||||||
|
m_Text_Player_Health = TextWidget.Cast( m_Root.FindAnyWidget( "Text_Player_Energy" ) );
|
||||||
|
m_Text_Player_Pos = TextWidget.Cast( m_Root.FindAnyWidget( "Text_Player_Pos" ) );
|
||||||
|
m_Cb_Player_Stamina = CheckBoxWidget.Cast( m_Root.FindAnyWidget( "Cb_Player_Stamina" ) );
|
||||||
|
PlayerList();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Click(Widget w, int x, int y, int button)
|
||||||
|
{
|
||||||
|
PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
|
||||||
|
string PlayerName;
|
||||||
|
PlayerName = GetCurrentSelection();
|
||||||
|
if (player)
|
||||||
|
{
|
||||||
|
if( ( w == m_PlayerList ) )
|
||||||
|
{
|
||||||
|
PlayerSelect();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( w == m_btn_Player_Strip ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Strip, new Param1<string>(PlayerName), false, NULL );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if( ( w == m_btn_Player_Kill ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Kill, new Param1<string>(PlayerName), false, NULL );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( w == m_btn_Player_Heal ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Heal, new Param1<string>(""), false, NULL );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( w == m_btn_Player_TpMe ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_TpMe, new Param1<string>(PlayerName), false, NULL );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( w == m_btn_Player_TpTo ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_TpTo, new Param1<string>(PlayerName), false, NULL );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if( ( w == m_btn_Player_KillAll ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_KillAll, new Param1<string>(""), false, NULL );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( w == m_btn_Player_HealAll ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_HealAll, new Param1<string>(""), false, NULL );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( w == m_btn_Player_StripAll ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_StripAll, new Param1<string>(""), false, NULL );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( w == m_btn_Player_TpMeAll ) )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_TpAllMe, new Param1<string>(""), false, NULL );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ( w == m_btn_Player_Send ) )
|
||||||
|
{
|
||||||
|
ScriptRPC MSG = new ScriptRPC();
|
||||||
|
MSG.Write(m_Box_Player_Message.GetText());
|
||||||
|
MSG.Write(GetCurrentSelection());
|
||||||
|
MSG.Send(NULL, M_RPCs.M_Admin_Menu_Spawn_Inventory, false, NULL);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
void Set_Stamina()
|
||||||
|
{
|
||||||
|
|
||||||
|
if(m_Cb_Player_Stamina.IsChecked())
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Stamina_Dissable, new Param1<string>(GetCurrentSelection()), false, NULL );
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Stamina_Enable, new Param1<string>(GetCurrentSelection()), false, NULL );
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void ~AdminMenuGuiPlayer()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Focus()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override bool OnFocus( Widget w, int x, int y )
|
||||||
|
{
|
||||||
|
if( m_Menu )
|
||||||
|
m_Menu.OnFocus( w, x, y );
|
||||||
|
if( w )
|
||||||
|
{
|
||||||
|
Param2<string, string> p = m_TextMap.Get( w.GetUserID() );
|
||||||
|
if( p )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ( w != null );
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
|
||||||
|
{
|
||||||
|
switch(rpc_type)
|
||||||
|
{
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Player_Health:
|
||||||
|
string health;
|
||||||
|
string blood
|
||||||
|
string position; //Vector Postition
|
||||||
|
ctx.Read(health);
|
||||||
|
ctx.Read(blood);
|
||||||
|
ctx.Read(position);
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
m_Text_Player_Health.SetText(health);
|
||||||
|
m_Text_Player_Blood.SetText(blood);
|
||||||
|
m_Text_Player_Pos.SetText(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Player_Stamina_ok:
|
||||||
|
string StaminName;
|
||||||
|
ctx.Read(StaminName);
|
||||||
|
if ( GetGame().IsServer() )
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
if ( GetGame().IsClient() && GetGame().IsMultiplayer() )
|
||||||
|
{
|
||||||
|
if(StaminName == "NULL")
|
||||||
|
{
|
||||||
|
m_Cb_Player_Stamina.SetChecked(false);
|
||||||
|
}else if (StaminName == GetCurrentSelection())
|
||||||
|
{
|
||||||
|
m_Cb_Player_Stamina.SetChecked(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlayerSelect()
|
||||||
|
{
|
||||||
|
array<Man> players = new array<Man>;
|
||||||
|
GetGame().GetPlayers( players );
|
||||||
|
PlayerBase selectedPlayer;
|
||||||
|
PlayerIdentity selectedIdentity;
|
||||||
|
for ( int a = 0; a < players.Count(); ++a )
|
||||||
|
{
|
||||||
|
selectedPlayer = players.Get(a);
|
||||||
|
selectedIdentity = selectedPlayer.GetIdentity();
|
||||||
|
if ( selectedIdentity.GetName() == GetCurrentSelection() )
|
||||||
|
{
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Player_Health_Request, new Param1<PlayerBase>(selectedPlayer), false, NULL );
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Player_Stamina_Request, new Param1<string>(selectedIdentity.GetName()), false, NULL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlayerList()
|
||||||
|
{
|
||||||
|
|
||||||
|
m_PlayerList.ClearItems();
|
||||||
|
array<Man> players = new array<Man>;
|
||||||
|
GetGame().GetPlayers( players );
|
||||||
|
for (int i = 0; i < players.Count(); ++i)
|
||||||
|
{
|
||||||
|
m_PlayerList.AddItem( players.Get(i).GetIdentity().GetName(), NULL, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string GetCurrentSelection()
|
||||||
|
{
|
||||||
|
if ( m_PlayerList.GetSelectedRow() != -1 )
|
||||||
|
{
|
||||||
|
string result;
|
||||||
|
m_PlayerList.GetItemText( m_PlayerList.GetSelectedRow(), 0, result );
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
void Message( string txt )
|
||||||
|
{
|
||||||
|
GetGame().GetMission().OnEvent(ChatMessageEventTypeID, new ChatMessageEventParams(0, "", txt, ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,474 @@
|
|||||||
|
/*
|
||||||
|
DayZ SA Tomato Gui Admin tool for DayZ Standalone. Contact DayZ-SA-Tomato@Primary-Network.de
|
||||||
|
Copyright (C) 2018 DayZ-SA-Tomato
|
||||||
|
|
||||||
|
This file is part of DayZ SA Tomato.
|
||||||
|
|
||||||
|
DayZ SA Tomato is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
DayZ SA Tomato is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with DayZ SA Tomato. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
class AdminMenuGuiSpawn extends ScriptedWidgetEventHandler
|
||||||
|
{
|
||||||
|
protected Widget m_Root;
|
||||||
|
protected AdminMenuGui m_Menu;
|
||||||
|
TextListboxWidget m_classList;
|
||||||
|
EditBoxWidget m_Spawn_SearchBox;
|
||||||
|
protected ButtonWidget m_Spawn_btnSpawnGround;
|
||||||
|
protected ButtonWidget m_Spawn_btnSpawnCursor;
|
||||||
|
protected ButtonWidget m_Spawn_btnSpawnInventory;
|
||||||
|
protected ButtonWidget m_Spawn_btnCancel;
|
||||||
|
protected EditBoxWidget m_Spawn_QuantityItem;
|
||||||
|
ItemPreviewWidget m_item_widget;
|
||||||
|
|
||||||
|
//private ItemPreviewWidget m_item_widget;
|
||||||
|
protected EntityAI previewItem;
|
||||||
|
private int m_characterRotationX;
|
||||||
|
private int m_characterRotationY; // Borrowed from inspectmenu
|
||||||
|
private int m_characterScaleDelta;
|
||||||
|
private vector m_characterOrientation;
|
||||||
|
|
||||||
|
protected EditBoxWidget m_Spawn_editBox;
|
||||||
|
protected ref map<int, ref Param2<string, string>> m_TextMap;
|
||||||
|
|
||||||
|
void AdminMenuGuiSpawn( Widget parent, AdminMenuGui menu )
|
||||||
|
{
|
||||||
|
|
||||||
|
m_Root = GetGame().GetWorkspace().CreateWidgets( "com\\DayZ-SA-Tomato\\scripts\\5_Mission\\core\\modules\\GUI\\Layouts\\Admin_spawn.layout", parent );
|
||||||
|
|
||||||
|
m_Menu = menu;
|
||||||
|
GetDayZGame().Event_OnRPC.Insert( this.ReceiveRPC );
|
||||||
|
m_classList = TextListboxWidget.Cast( m_Root.FindAnyWidget( "classlist" ) );
|
||||||
|
m_Spawn_SearchBox = EditBoxWidget.Cast( m_Root.FindAnyWidget( "search_input" ) );
|
||||||
|
m_Spawn_btnSpawnGround = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_spawn_ground" ) );
|
||||||
|
m_Spawn_btnSpawnCursor = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_spawn_cursorpos" ) );
|
||||||
|
m_Spawn_btnSpawnInventory = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_spawn_inventory" ) );
|
||||||
|
m_Spawn_btnCancel = ButtonWidget.Cast( m_Root.FindAnyWidget( "btn_cancel" ) );
|
||||||
|
m_item_widget = ItemPreviewWidget.Cast( m_Root.FindAnyWidget( "ItemPrev" ) );
|
||||||
|
m_Spawn_QuantityItem = EditBoxWidget.Cast( m_Root.FindAnyWidget( "quantity_items" ) );
|
||||||
|
|
||||||
|
m_Spawn_editBox = m_Root.FindAnyWidget("className_spawner_box");
|
||||||
|
|
||||||
|
UpdateList( "All" )
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO
|
||||||
|
bool Click( Widget w, int x, int y, int button )
|
||||||
|
{
|
||||||
|
string strSelection = GetCurrentSelection();
|
||||||
|
bool ai = false;
|
||||||
|
|
||||||
|
int quantity = 0;
|
||||||
|
string text = "";
|
||||||
|
ItemBase oItem = NULL;
|
||||||
|
string ai_new = ""
|
||||||
|
if ( strSelection == "" )
|
||||||
|
{
|
||||||
|
strSelection = GetEditBoxInput();
|
||||||
|
}
|
||||||
|
|
||||||
|
if( strSelection != "" )
|
||||||
|
{
|
||||||
|
strSelection.ToLower();
|
||||||
|
//ObjectEditor obEditor = GetModuleManager().GetModule( ObjectEditor );
|
||||||
|
if ( GetGame().IsKindOf( strSelection, "DZ_LightAI" ) )
|
||||||
|
{
|
||||||
|
ai = true;
|
||||||
|
ai_new = "true"
|
||||||
|
}
|
||||||
|
|
||||||
|
if( w == m_Spawn_btnSpawnCursor )
|
||||||
|
{
|
||||||
|
|
||||||
|
text = m_Spawn_QuantityItem.GetText();
|
||||||
|
|
||||||
|
ScriptRPC Cursor_rpc = new ScriptRPC();
|
||||||
|
Cursor_rpc.Write(strSelection);
|
||||||
|
Cursor_rpc.Write(GetCursorPos())
|
||||||
|
Cursor_rpc.Write(ai_new);
|
||||||
|
Cursor_rpc.Write(text)
|
||||||
|
Cursor_rpc.Send(NULL, M_RPCs.M_Admin_Menu_Spawn_Cursor, false, NULL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
text = m_Spawn_QuantityItem.GetText();
|
||||||
|
|
||||||
|
}
|
||||||
|
else if ( w == m_Spawn_btnSpawnGround )
|
||||||
|
{
|
||||||
|
EntityAI oObj = g_Game.CreateObject( strSelection, GetGame().GetPlayer().GetPosition(), false, ai );
|
||||||
|
text = m_Spawn_QuantityItem.GetText();
|
||||||
|
//RPC Build and Send
|
||||||
|
ScriptRPC rpc = new ScriptRPC();
|
||||||
|
rpc.Write(strSelection);
|
||||||
|
rpc.Write(ai_new);
|
||||||
|
rpc.Write(text)
|
||||||
|
rpc.Send(NULL, M_RPCs.M_Admin_Menu_Spawn_Ground, false, NULL);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if ( w == m_Spawn_btnSpawnInventory )
|
||||||
|
{
|
||||||
|
text = m_Spawn_QuantityItem.GetText();
|
||||||
|
//RPC Build and Send
|
||||||
|
ScriptRPC Inventory_rpc = new ScriptRPC();
|
||||||
|
Inventory_rpc.Write(strSelection);
|
||||||
|
Inventory_rpc.Write(ai_new);
|
||||||
|
Inventory_rpc.Write(text)
|
||||||
|
Inventory_rpc.Send(NULL, M_RPCs.M_Admin_Menu_Spawn_Inventory, false, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( w.GetName().Contains( "btn_spawn_filter" ) )
|
||||||
|
{
|
||||||
|
string buttonName = w.GetName();
|
||||||
|
buttonName.Replace("btn_spawn_filter_", "");
|
||||||
|
UpdateList( buttonName );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateList( string classFilter ) // All default
|
||||||
|
{
|
||||||
|
m_classList.ClearItems();
|
||||||
|
TStringArray configs = new TStringArray;
|
||||||
|
configs.Insert( CFG_VEHICLESPATH );
|
||||||
|
configs.Insert( CFG_WEAPONSPATH );
|
||||||
|
configs.Insert( CFG_MAGAZINESPATH );
|
||||||
|
|
||||||
|
string strSearch = m_Spawn_SearchBox.GetText();
|
||||||
|
|
||||||
|
strSearch.ToLower();
|
||||||
|
|
||||||
|
for ( int nConfig = 0; nConfig < configs.Count(); ++nConfig )
|
||||||
|
{
|
||||||
|
string strConfigPath = configs.Get( nConfig );
|
||||||
|
|
||||||
|
int nClasses = g_Game.ConfigGetChildrenCount( strConfigPath );
|
||||||
|
|
||||||
|
for ( int nClass = 0; nClass < nClasses; ++nClass )
|
||||||
|
{
|
||||||
|
string strName;
|
||||||
|
|
||||||
|
g_Game.ConfigGetChildName( strConfigPath, nClass, strName );
|
||||||
|
|
||||||
|
int scope = g_Game.ConfigGetInt( strConfigPath + " " + strName + " scope" );
|
||||||
|
|
||||||
|
if ( scope == 0 )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( strName == "Mag_Scout_5Rnd") continue; // fix crash for this dumb item. dont spawn it
|
||||||
|
|
||||||
|
string strNameLower = strName;
|
||||||
|
|
||||||
|
strNameLower.ToLower();
|
||||||
|
|
||||||
|
if ( GetGame().IsKindOf( strNameLower, classFilter ) || classFilter == "All" ) // Fix for weapon_base not being child of "All"
|
||||||
|
{
|
||||||
|
|
||||||
|
if ( (strSearch != "" && (!strNameLower.Contains( strSearch ))) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( strName == "ItemOptics" )
|
||||||
|
{
|
||||||
|
continue; // Fix crash
|
||||||
|
}
|
||||||
|
|
||||||
|
m_classList.AddItem( strName, NULL, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string GetCurrentSelection()
|
||||||
|
{
|
||||||
|
if ( m_classList.GetSelectedRow() != -1 )
|
||||||
|
{
|
||||||
|
string result;
|
||||||
|
m_classList.GetItemText( m_classList.GetSelectedRow(), 0, result );
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
string GetEditBoxInput()
|
||||||
|
{
|
||||||
|
return m_Spawn_editBox.GetText();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OnItemSelect( Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
|
||||||
|
{
|
||||||
|
|
||||||
|
if ( w == m_classList )
|
||||||
|
{
|
||||||
|
EntityAI item;
|
||||||
|
item = g_Game.CreateObject( GetCurrentSelection(), vector.Zero, false, false, false );
|
||||||
|
GetGame().RPCSingleParam( NULL, M_RPCs.M_Admin_Menu_Spawn_ItemPrev, new Param1<string>( GetCurrentSelection() ), false, NULL );
|
||||||
|
if (item)
|
||||||
|
{
|
||||||
|
//InspectMenuNew.UpdateItemInfo(m_Root, item);
|
||||||
|
|
||||||
|
if (!m_item_widget)
|
||||||
|
{
|
||||||
|
if (m_item_widget)
|
||||||
|
{
|
||||||
|
float l;
|
||||||
|
float h;
|
||||||
|
m_item_widget.GetSize(l, h);
|
||||||
|
m_item_widget = ItemPreviewWidget.Cast( GetGame().GetWorkspace().CreateWidget(ItemPreviewWidgetTypeID, 0, 0, 1, 1, WidgetFlags.VISIBLE, ARGB(255, 255, 255, 255), 10, m_item_widget) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_item_widget.SetItem(item);
|
||||||
|
m_item_widget.SetView( item.GetViewIndex() );
|
||||||
|
m_item_widget.SetModelPosition(Vector(0,0,1));
|
||||||
|
|
||||||
|
float v, c;
|
||||||
|
m_item_widget.GetPos(v, c);
|
||||||
|
|
||||||
|
m_item_widget.SetSize( 1.75, 1.75 );
|
||||||
|
|
||||||
|
// align to center
|
||||||
|
m_item_widget.SetPos( -0.375, -0.375 );
|
||||||
|
|
||||||
|
//m_item_widget.SetModelOrientation
|
||||||
|
//PPEffects.SetBlurInventory(1);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnItemSelect2(EntityAI item)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (item)
|
||||||
|
{
|
||||||
|
//InspectMenuNew.UpdateItemInfo(m_Root, item);
|
||||||
|
|
||||||
|
if (!m_item_widget)
|
||||||
|
{
|
||||||
|
Widget preview_frame = m_Root.FindAnyWidget("ItemPrev");
|
||||||
|
if (preview_frame)
|
||||||
|
{
|
||||||
|
float l;
|
||||||
|
float h;
|
||||||
|
preview_frame.GetSize(l, h);
|
||||||
|
m_item_widget = ItemPreviewWidget.Cast( GetGame().GetWorkspace().CreateWidget(ItemPreviewWidgetTypeID, 0, 0, 1, 1, WidgetFlags.VISIBLE, ARGB(255, 255, 255, 255), 10, preview_frame) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_item_widget.SetItem(item);
|
||||||
|
m_item_widget.SetView( item.GetViewIndex() );
|
||||||
|
m_item_widget.SetModelPosition(Vector(0,0,1));
|
||||||
|
|
||||||
|
float v, c;
|
||||||
|
m_item_widget.GetPos(v, c);
|
||||||
|
|
||||||
|
m_item_widget.SetSize( 1.75, 1.75 );
|
||||||
|
|
||||||
|
// align to center
|
||||||
|
m_item_widget.SetPos( -0.375, -0.375 );
|
||||||
|
|
||||||
|
//m_item_widget.SetModelOrientation
|
||||||
|
PPEffects.SetBlurInventory(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override bool OnMouseButtonDown( Widget w, int x, int y, int button )
|
||||||
|
{
|
||||||
|
if (w == m_item_widget)
|
||||||
|
{
|
||||||
|
GetGame().GetDragQueue().Call(this, "UpdateRotation");
|
||||||
|
g_Game.GetMousePos(m_characterRotationX, m_characterRotationY);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
override bool OnMouseWheel( Widget w, int x, int y, int wheel )
|
||||||
|
{
|
||||||
|
if ( w == m_item_widget )
|
||||||
|
{
|
||||||
|
GetGame().GetDragQueue().Call(this, "UpdateScale");
|
||||||
|
m_characterScaleDelta = wheel ;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateScale(int mouse_x, int mouse_y, int wheel, bool is_dragging) // Borrowed from inspect menu
|
||||||
|
{
|
||||||
|
float w, h, x, y;
|
||||||
|
m_item_widget.GetPos(x, y);
|
||||||
|
m_item_widget.GetSize(w,h);
|
||||||
|
w = w + ( m_characterScaleDelta / 4);
|
||||||
|
h = h + ( m_characterScaleDelta / 4 );
|
||||||
|
if ( w > 0.5 && w < 4 )
|
||||||
|
{
|
||||||
|
m_item_widget.SetSize( w, h );
|
||||||
|
|
||||||
|
//align to center
|
||||||
|
int screen_w, screen_h;
|
||||||
|
GetScreenSize(screen_w, screen_h);
|
||||||
|
float new_x = x - ( m_characterScaleDelta / 8 );
|
||||||
|
float new_y = y - ( m_characterScaleDelta / 8 );
|
||||||
|
m_item_widget.SetPos( new_x, new_y );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateRotation(int mouse_x, int mouse_y, bool is_dragging) // Borrowed from inspect menu
|
||||||
|
{
|
||||||
|
vector o = m_characterOrientation;
|
||||||
|
o[0] = o[0] + (m_characterRotationY - mouse_y);
|
||||||
|
o[1] = o[1] - (m_characterRotationX - mouse_x);
|
||||||
|
|
||||||
|
m_item_widget.SetModelOrientation( o );
|
||||||
|
|
||||||
|
if (!is_dragging)
|
||||||
|
{
|
||||||
|
m_characterOrientation = o;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ~AdminMenuGuiSpawn()
|
||||||
|
{
|
||||||
|
if ( previewItem )
|
||||||
|
{
|
||||||
|
GetGame().ObjectDelete( previewItem );
|
||||||
|
delete m_item_widget
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Focus()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override bool OnChange( Widget w, int x, int y, bool finished )
|
||||||
|
{
|
||||||
|
if ( w == m_Spawn_SearchBox )
|
||||||
|
{
|
||||||
|
UpdateList( "All" );
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OnMouseLeave( Widget w, Widget enterW, int x, int y )
|
||||||
|
{
|
||||||
|
if ( w == m_Spawn_SearchBox )
|
||||||
|
{
|
||||||
|
GetPlayer().GetInputController().OverrideMovementSpeed( false, 0 );
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OnMouseEnter( Widget w , int x, int y )
|
||||||
|
{
|
||||||
|
if ( w == m_Spawn_SearchBox )
|
||||||
|
{
|
||||||
|
GetPlayer().GetInputController().OverrideMovementSpeed( true, 0 );
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Message( string txt )
|
||||||
|
{
|
||||||
|
GetGame().GetMission().OnEvent(ChatMessageEventTypeID, new ChatMessageEventParams(0, "", txt, ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReceiveRPC( PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx )
|
||||||
|
{
|
||||||
|
switch(rpc_type)
|
||||||
|
{
|
||||||
|
|
||||||
|
case M_RPCs.M_Admin_Menu_Spawn_ItemPrev_ok:
|
||||||
|
|
||||||
|
EntityAI PrevItem;
|
||||||
|
ctx.Read(PrevItem);
|
||||||
|
SetItem(PrevItem);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetItem(EntityAI item)
|
||||||
|
{
|
||||||
|
if (item)
|
||||||
|
{
|
||||||
|
//InspectMenuNew.UpdateItemInfo(m_Root, item);
|
||||||
|
//delete m_item_widget;
|
||||||
|
if (item == NULL)
|
||||||
|
{
|
||||||
|
item = GetGame().CreateObject( "WaterBottle", vector.Zero, false, false );
|
||||||
|
}
|
||||||
|
if (!m_item_widget)
|
||||||
|
{
|
||||||
|
Widget preview_frame = m_Root.FindAnyWidget("ItemPrev");
|
||||||
|
if (preview_frame)
|
||||||
|
{
|
||||||
|
float w;
|
||||||
|
float h;
|
||||||
|
preview_frame.GetSize(w, h);
|
||||||
|
m_item_widget = ItemPreviewWidget.Cast( GetGame().GetWorkspace().CreateWidget(ItemPreviewWidgetTypeID, 0, 0, 1, 1, WidgetFlags.VISIBLE, ARGB(255, 255, 255, 255), 10, preview_frame) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_item_widget.SetItem(item);
|
||||||
|
m_item_widget.SetView( item.GetViewIndex() );
|
||||||
|
m_item_widget.SetModelPosition(Vector(0,0,1));
|
||||||
|
|
||||||
|
float x, y;
|
||||||
|
m_item_widget.GetPos(x, y);
|
||||||
|
|
||||||
|
m_item_widget.SetSize( 1.75, 1.75 );
|
||||||
|
|
||||||
|
// align to center
|
||||||
|
m_item_widget.SetPos( -0.375, -0.375 );
|
||||||
|
|
||||||
|
//m_item_widget.SetModelOrientation
|
||||||
|
//PPEffects.SetBlurInventory(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override bool OnFocus( Widget w, int x, int y )
|
||||||
|
{
|
||||||
|
if( m_Menu )
|
||||||
|
m_Menu.OnFocus( w, x, y );
|
||||||
|
if( w )
|
||||||
|
{
|
||||||
|
Param2<string, string> p = m_TextMap.Get( w.GetUserID() );
|
||||||
|
if( p )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ( w != null );
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,178 @@
|
|||||||
|
FrameWidgetClass rootFrame {
|
||||||
|
position 10 10
|
||||||
|
size 1400 800
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
{
|
||||||
|
FrameWidgetClass command_settings_root {
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 0
|
||||||
|
size 1 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
{
|
||||||
|
ButtonWidgetClass btn_Command_Day {
|
||||||
|
position 125 360
|
||||||
|
size 300 50
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Day"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Command_Cam {
|
||||||
|
position 750 165
|
||||||
|
size 300 50
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Camera"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass ButtonWidget2 {
|
||||||
|
position 947.81403 -136.842
|
||||||
|
size 300 50
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Heal"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Command_Night {
|
||||||
|
position 550 360
|
||||||
|
size 300 50
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Night"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Command_Refill {
|
||||||
|
position 550 460
|
||||||
|
size 300 50
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Refill"
|
||||||
|
}
|
||||||
|
CheckBoxWidgetClass Config_Cam {
|
||||||
|
position 125 165
|
||||||
|
size 544.16296 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Free Cam Teleport (insert Key)"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass ButtonWidget5 {
|
||||||
|
position 310.56699 -154.14101
|
||||||
|
size 300 50
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Heal"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Command_Heal {
|
||||||
|
clipchildren 1
|
||||||
|
inheritalpha 0
|
||||||
|
position 125 260
|
||||||
|
size 300 50
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
style Default
|
||||||
|
text "Heal"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Command_CamTp {
|
||||||
|
position 1100 165
|
||||||
|
size 300 50
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Camera (Tp)"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Command_SpCar {
|
||||||
|
position 125 460
|
||||||
|
size 300 50
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Spawn Car"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass ButtonWidget9 {
|
||||||
|
position 611.57001 -97.7071
|
||||||
|
size 300 50
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Heal"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass ButtonWidget10 {
|
||||||
|
position 1304.92004 -109.47
|
||||||
|
size 300 50
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Heal"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass ButtonWidget11 {
|
||||||
|
position 12.8862 -89.7536
|
||||||
|
size 300 50
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Heal"
|
||||||
|
}
|
||||||
|
TextWidgetClass TextWidget0 {
|
||||||
|
position 0 10
|
||||||
|
size 1 50
|
||||||
|
halign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
style Bold
|
||||||
|
text "Commands"
|
||||||
|
"exact text" 0
|
||||||
|
"size to text h" 0
|
||||||
|
"size to text v" 0
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
PanelWidgetClass PanelWidget0 {
|
||||||
|
color 0.9333 0 0.0784 1
|
||||||
|
position 0 75
|
||||||
|
size 0.9 3.5
|
||||||
|
halign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
style rover_sim_colorable
|
||||||
|
}
|
||||||
|
CheckBoxWidgetClass Config_Teleport {
|
||||||
|
position 125 100
|
||||||
|
size 320.33899 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Teleport (n Key)"
|
||||||
|
checked 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,577 @@
|
|||||||
|
FrameWidgetClass settings_menu_root {
|
||||||
|
size 1500 980
|
||||||
|
halign center_ref
|
||||||
|
valign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
priority 951
|
||||||
|
{
|
||||||
|
FrameWidgetClass Tabber {
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 0
|
||||||
|
size 1 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
priority 1
|
||||||
|
scriptclass "TabberUI"
|
||||||
|
{
|
||||||
|
SpacerWidgetClass TabControls {
|
||||||
|
visible 1
|
||||||
|
clipchildren 0
|
||||||
|
ignorepointer 1
|
||||||
|
position 80 40
|
||||||
|
size 710 60
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
"no focus" 1
|
||||||
|
Padding 0
|
||||||
|
Margin 0
|
||||||
|
"Size To Content H" 1
|
||||||
|
"Size To Content V" 1
|
||||||
|
{
|
||||||
|
SpacerWidgetClass TabBar {
|
||||||
|
clipchildren 1
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 0
|
||||||
|
size 1 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
"no focus" 1
|
||||||
|
Padding 0
|
||||||
|
Margin 0
|
||||||
|
"Size To Content H" 1
|
||||||
|
"Size To Content V" 1
|
||||||
|
{
|
||||||
|
ImageWidgetClass Tabs_Background {
|
||||||
|
visible 1
|
||||||
|
ignorepointer 1
|
||||||
|
color 1 1 1 0.5098
|
||||||
|
position 0 0
|
||||||
|
size 1 1
|
||||||
|
hexactpos 0
|
||||||
|
vexactpos 0
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
imageTexture "{5A89D58DD2276E85}Gui/textures/SerratedBlack2.edds"
|
||||||
|
mode blend
|
||||||
|
"src alpha" 1
|
||||||
|
"no wrap" 0
|
||||||
|
stretch 1
|
||||||
|
}
|
||||||
|
GridSpacerWidgetClass Tab_Control_Container {
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 0
|
||||||
|
size 710 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 0
|
||||||
|
priority 1
|
||||||
|
"no focus" 1
|
||||||
|
Padding 0
|
||||||
|
Margin 0
|
||||||
|
"Size To Content H" 1
|
||||||
|
"Size To Content V" 1
|
||||||
|
Columns 10
|
||||||
|
Rows 1
|
||||||
|
{
|
||||||
|
PanelWidgetClass Tab_Control_0 {
|
||||||
|
visible 1
|
||||||
|
clipchildren 1
|
||||||
|
size 160 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 0
|
||||||
|
priority 200
|
||||||
|
userID 0
|
||||||
|
style blank
|
||||||
|
"no focus" 1
|
||||||
|
"next down" "XComboBoxWidget1"
|
||||||
|
{
|
||||||
|
TextWidgetClass Tab_Control_0_Title {
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 0
|
||||||
|
size 1 0.48
|
||||||
|
halign center_ref
|
||||||
|
valign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
priority 250
|
||||||
|
text "Commands"
|
||||||
|
font "gui/fonts/sdf_MetronLight72"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
ImageWidgetClass Tab_Control_0_Background {
|
||||||
|
visible 1
|
||||||
|
disabled 0
|
||||||
|
inheritalpha 0
|
||||||
|
ignorepointer 1
|
||||||
|
color 1 1 1 0.7843
|
||||||
|
position 0 0
|
||||||
|
size 710 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 0
|
||||||
|
draggable 0
|
||||||
|
imageTexture "{5A89D58DD2276E85}Gui/textures/SerratedBlack2.edds"
|
||||||
|
mode blend
|
||||||
|
"src alpha" 1
|
||||||
|
"no wrap" 0
|
||||||
|
stretch 1
|
||||||
|
"flip u" 0
|
||||||
|
"flip v" 0
|
||||||
|
filter 1
|
||||||
|
nocache 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PanelWidgetClass Tab_Control_1 {
|
||||||
|
visible 1
|
||||||
|
clipchildren 1
|
||||||
|
position 0 0
|
||||||
|
size 170 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 0
|
||||||
|
priority 200
|
||||||
|
userID 0
|
||||||
|
style blank
|
||||||
|
"no focus" 1
|
||||||
|
"next down" "XComboBoxWidget1"
|
||||||
|
{
|
||||||
|
TextWidgetClass Tab_Control_1_Title {
|
||||||
|
visible 1
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 0
|
||||||
|
size 1 0.48
|
||||||
|
halign center_ref
|
||||||
|
valign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
priority 250
|
||||||
|
text "Spawn"
|
||||||
|
font "gui/fonts/sdf_MetronLight72"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
ImageWidgetClass Tab_Control_1_Background {
|
||||||
|
visible 0
|
||||||
|
disabled 0
|
||||||
|
inheritalpha 0
|
||||||
|
ignorepointer 1
|
||||||
|
color 1 1 1 0.7843
|
||||||
|
position -160 0
|
||||||
|
size 710 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 0
|
||||||
|
draggable 0
|
||||||
|
imageTexture "{5A89D58DD2276E85}Gui/textures/SerratedBlack2.edds"
|
||||||
|
mode blend
|
||||||
|
"src alpha" 1
|
||||||
|
"no wrap" 0
|
||||||
|
stretch 1
|
||||||
|
"flip u" 0
|
||||||
|
"flip v" 0
|
||||||
|
filter 1
|
||||||
|
nocache 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PanelWidgetClass Tab_Control_2 {
|
||||||
|
visible 1
|
||||||
|
clipchildren 1
|
||||||
|
position 0 0
|
||||||
|
size 160 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 0
|
||||||
|
priority 200
|
||||||
|
userID 0
|
||||||
|
style blank
|
||||||
|
"no focus" 1
|
||||||
|
"next down" "XComboBoxWidget1"
|
||||||
|
{
|
||||||
|
TextWidgetClass Tab_Control_2_Title {
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 0
|
||||||
|
size 1 0.48
|
||||||
|
halign center_ref
|
||||||
|
valign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
priority 250
|
||||||
|
text "Player"
|
||||||
|
font "gui/fonts/sdf_MetronLight72"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
ImageWidgetClass Tab_Control_2_Background {
|
||||||
|
visible 0
|
||||||
|
disabled 0
|
||||||
|
inheritalpha 0
|
||||||
|
ignorepointer 1
|
||||||
|
color 1 1 1 0.7843
|
||||||
|
position -330 0
|
||||||
|
size 710 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 0
|
||||||
|
draggable 0
|
||||||
|
imageTexture "{5A89D58DD2276E85}Gui/textures/SerratedBlack2.edds"
|
||||||
|
mode blend
|
||||||
|
"src alpha" 1
|
||||||
|
"no wrap" 0
|
||||||
|
stretch 1
|
||||||
|
"flip u" 0
|
||||||
|
"flip v" 0
|
||||||
|
filter 1
|
||||||
|
nocache 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PanelWidgetClass Tab_Control_3 {
|
||||||
|
visible 1
|
||||||
|
clipchildren 1
|
||||||
|
position 0 0
|
||||||
|
size 220 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 0
|
||||||
|
priority 200
|
||||||
|
userID 0
|
||||||
|
style blank
|
||||||
|
"no focus" 1
|
||||||
|
"next down" "XComboBoxWidget1"
|
||||||
|
{
|
||||||
|
TextWidgetClass Tab_Control_3_Title {
|
||||||
|
visible 1
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 0
|
||||||
|
size 1 0.48
|
||||||
|
halign center_ref
|
||||||
|
valign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
priority 250
|
||||||
|
text "Map"
|
||||||
|
font "gui/fonts/sdf_MetronLight72"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
ImageWidgetClass Tab_Control_3_Background {
|
||||||
|
visible 0
|
||||||
|
disabled 0
|
||||||
|
inheritalpha 0
|
||||||
|
ignorepointer 1
|
||||||
|
color 1 1 1 0.7843
|
||||||
|
position -490 0
|
||||||
|
size 710 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 0
|
||||||
|
draggable 0
|
||||||
|
imageTexture "{5A89D58DD2276E85}Gui/textures/SerratedBlack2.edds"
|
||||||
|
mode blend
|
||||||
|
"src alpha" 1
|
||||||
|
"no wrap" 0
|
||||||
|
stretch 1
|
||||||
|
"flip u" 0
|
||||||
|
"flip v" 0
|
||||||
|
filter 1
|
||||||
|
nocache 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FrameWidgetClass XboxControls {
|
||||||
|
visible 0
|
||||||
|
clipchildren 0
|
||||||
|
ignorepointer 1
|
||||||
|
size 1 1
|
||||||
|
halign center_ref
|
||||||
|
valign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
{
|
||||||
|
ImageWidgetClass XboxTabLeftControl {
|
||||||
|
visible 0
|
||||||
|
clipchildren 1
|
||||||
|
ignorepointer 1
|
||||||
|
position -45 0
|
||||||
|
size 38 40
|
||||||
|
valign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
image0 "set:xbox_buttons image:LB"
|
||||||
|
mode blend
|
||||||
|
"src alpha" 1
|
||||||
|
"no wrap" 1
|
||||||
|
stretch 0
|
||||||
|
}
|
||||||
|
ImageWidgetClass XboxTabRightControl {
|
||||||
|
visible 0
|
||||||
|
clipchildren 1
|
||||||
|
ignorepointer 1
|
||||||
|
position -45 0
|
||||||
|
size 38 40
|
||||||
|
halign right_ref
|
||||||
|
valign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
image0 "set:xbox_buttons image:RB"
|
||||||
|
mode blend
|
||||||
|
"src alpha" 1
|
||||||
|
"no wrap" 1
|
||||||
|
stretch 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FrameWidgetClass Tab_0 {
|
||||||
|
visible 1
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 110
|
||||||
|
size 1400 800
|
||||||
|
halign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
}
|
||||||
|
FrameWidgetClass Tab_1 {
|
||||||
|
visible 0
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 110
|
||||||
|
size 1400 800
|
||||||
|
halign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
}
|
||||||
|
FrameWidgetClass Tab_2 {
|
||||||
|
visible 0
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 110
|
||||||
|
size 1400 800
|
||||||
|
halign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
}
|
||||||
|
FrameWidgetClass Tab_3 {
|
||||||
|
visible 0
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 110
|
||||||
|
size 1400 800
|
||||||
|
halign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TextWidgetClass SettingsTextWidget {
|
||||||
|
ignorepointer 1
|
||||||
|
position 0.05 40
|
||||||
|
size 0.38295 50
|
||||||
|
halign right_ref
|
||||||
|
hexactpos 0
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
priority 1
|
||||||
|
style Normal
|
||||||
|
text "Admin Menu"
|
||||||
|
font "gui/fonts/sdf_MetronLight72"
|
||||||
|
"text color" 0.8157 0.1255 0.7843 1
|
||||||
|
"exact text" 0
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
WrapSpacerWidgetClass play_panel_root {
|
||||||
|
visible 1
|
||||||
|
ignorepointer 1
|
||||||
|
position 0.01561 19.9362
|
||||||
|
size 0.2 42.5477
|
||||||
|
halign right_ref
|
||||||
|
valign bottom_ref
|
||||||
|
hexactpos 0
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
priority 1
|
||||||
|
Padding 10
|
||||||
|
Margin 0
|
||||||
|
"Size To Content H" 1
|
||||||
|
content_halign center
|
||||||
|
content_valign bottom
|
||||||
|
{
|
||||||
|
WrapSpacerWidgetClass top {
|
||||||
|
ignorepointer 1
|
||||||
|
color 0 0 0 0.7843
|
||||||
|
position 0 0
|
||||||
|
size 1 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
style DayZDefaultPanel
|
||||||
|
"no focus" 1
|
||||||
|
Padding 0
|
||||||
|
Margin 0
|
||||||
|
"Size To Content V" 1
|
||||||
|
content_valign bottom
|
||||||
|
{
|
||||||
|
ButtonWidgetClass back {
|
||||||
|
color 0.0392 0.0392 0.0392 1
|
||||||
|
position 0 88
|
||||||
|
size 1 38
|
||||||
|
halign center_ref
|
||||||
|
valign bottom_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
style DayZDefaultButtonBottom
|
||||||
|
"no focus" 0
|
||||||
|
"next up" ""
|
||||||
|
"next down" ""
|
||||||
|
text "Close"
|
||||||
|
text_proportion 0.6
|
||||||
|
font "gui/fonts/sdf_MetronLight24"
|
||||||
|
switch normal
|
||||||
|
}
|
||||||
|
PanelWidgetClass character {
|
||||||
|
visible 0
|
||||||
|
ignorepointer 0
|
||||||
|
position 0 172
|
||||||
|
size 1 38
|
||||||
|
halign center_ref
|
||||||
|
valign bottom_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
style blank
|
||||||
|
{
|
||||||
|
TextWidgetClass character_name_text {
|
||||||
|
inheritalpha 1
|
||||||
|
ignorepointer 1
|
||||||
|
size 1 0.55
|
||||||
|
halign center_ref
|
||||||
|
valign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
font "gui/fonts/sdf_MetronLight24"
|
||||||
|
"exact text" 0
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GridSpacerWidgetClass settings_details {
|
||||||
|
visible 0
|
||||||
|
clipchildren 1
|
||||||
|
ignorepointer 1
|
||||||
|
color 0 0 0 0.8627
|
||||||
|
position 720 160
|
||||||
|
size 600 200
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
priority 3
|
||||||
|
"no focus" 1
|
||||||
|
Padding 8
|
||||||
|
Margin 16
|
||||||
|
"Size To Content V" 1
|
||||||
|
Columns 1
|
||||||
|
Rows 2
|
||||||
|
{
|
||||||
|
TextWidgetClass details_label {
|
||||||
|
clipchildren 0
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 0
|
||||||
|
size 1 36
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
font "gui/fonts/sdf_MetronLight72"
|
||||||
|
text_proportion 0.9
|
||||||
|
}
|
||||||
|
RichTextWidgetClass details_content {
|
||||||
|
clipchildren 0
|
||||||
|
ignorepointer 1
|
||||||
|
position 0 0
|
||||||
|
size 1 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
font "gui/fonts/sdf_MetronLight24"
|
||||||
|
"exact text" 1
|
||||||
|
"exact text size" 22
|
||||||
|
"size to text h" 0
|
||||||
|
"size to text v" 1
|
||||||
|
wrap 1
|
||||||
|
"condense whitespace" 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
WindowWidgetClass WindowWidget0 {
|
||||||
|
position 0 0
|
||||||
|
size 1 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
style rover_sim_black
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
FrameWidgetClass rootFrame {
|
||||||
|
position 10 10
|
||||||
|
size 1400 800
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
{
|
||||||
|
FrameWidgetClass command_settings_root {
|
||||||
|
ignorepointer 1
|
||||||
|
size 1 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
{
|
||||||
|
TextWidgetClass TextWidget0 {
|
||||||
|
position 0 10
|
||||||
|
size 1 50
|
||||||
|
halign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
style Bold
|
||||||
|
text "Map"
|
||||||
|
"exact text" 0
|
||||||
|
"size to text h" 0
|
||||||
|
"size to text v" 0
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
PanelWidgetClass PanelWidget0 {
|
||||||
|
color 0.9333 0 0.0784 1
|
||||||
|
position 0 75
|
||||||
|
size 0.9 3.5
|
||||||
|
halign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
style rover_sim_colorable
|
||||||
|
}
|
||||||
|
MapWidgetClass Map {
|
||||||
|
position 0 20
|
||||||
|
size 0.9 580
|
||||||
|
halign center_ref
|
||||||
|
valign bottom_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,283 @@
|
|||||||
|
FrameWidgetClass rootFrame {
|
||||||
|
position 10 10
|
||||||
|
size 1400 800
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
{
|
||||||
|
FrameWidgetClass command_settings_root {
|
||||||
|
ignorepointer 1
|
||||||
|
position -3.92 0
|
||||||
|
size 1 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
{
|
||||||
|
PanelWidgetClass PanelWidget0 {
|
||||||
|
color 0.9333 0 0.0784 1
|
||||||
|
position 0 75
|
||||||
|
size 0.9 3.5
|
||||||
|
halign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
style rover_sim_colorable
|
||||||
|
}
|
||||||
|
PanelWidgetClass Panel {
|
||||||
|
position 100 150
|
||||||
|
size 450 500
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
style rover_sim_black_2
|
||||||
|
}
|
||||||
|
TextListboxWidgetClass Player_Player_List {
|
||||||
|
position 100 150
|
||||||
|
size 450 500
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
lines 20
|
||||||
|
}
|
||||||
|
TextWidgetClass TextWidget1 {
|
||||||
|
position 100 90
|
||||||
|
size 450 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Online Player :"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
TextWidgetClass TextWidget2 {
|
||||||
|
position 610 90
|
||||||
|
size 350 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Selection Commands :"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Player_Kill {
|
||||||
|
position 610 150
|
||||||
|
size 350 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Kill Player"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Player_Strip {
|
||||||
|
position 610 270
|
||||||
|
size 350 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Strip Player"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Player_tpMe {
|
||||||
|
position 610 390
|
||||||
|
size 350 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Teleport Player here"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Player_tpto {
|
||||||
|
position 610 330
|
||||||
|
size 350 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Teleport to Player"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Player_Heal {
|
||||||
|
position 610 210
|
||||||
|
size 350 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Heal Player"
|
||||||
|
}
|
||||||
|
TextWidgetClass TextWidget0 {
|
||||||
|
position 0 10
|
||||||
|
size 1 50
|
||||||
|
halign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
style Bold
|
||||||
|
text "Player"
|
||||||
|
"exact text" 0
|
||||||
|
"size to text h" 0
|
||||||
|
"size to text v" 0
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
TextWidgetClass TextWidget3 {
|
||||||
|
position 100 660
|
||||||
|
size 100 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Pos : "
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
TextWidgetClass Text_Player_Pos {
|
||||||
|
position 220 660
|
||||||
|
size 1140 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "XXX"
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
EditBoxWidgetClass Box_Player_Message {
|
||||||
|
position 361.21002 720
|
||||||
|
size 893 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
style ServerBrowser
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Player_Send {
|
||||||
|
position 1270.2699 720
|
||||||
|
size 90.21 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Send"
|
||||||
|
}
|
||||||
|
TextWidgetClass TextWidget6 {
|
||||||
|
position 1020 90
|
||||||
|
size 350 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Selection Commands :"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Player_KillAll {
|
||||||
|
position 1020 150
|
||||||
|
size 350 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Kill all Player"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Player_HealAll {
|
||||||
|
position 1020 210
|
||||||
|
size 350 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Heal all Player"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Player_StripAll {
|
||||||
|
position 1020 270
|
||||||
|
size 350 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Strip all Player"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_Player_tpMeAll {
|
||||||
|
position 1020 390
|
||||||
|
size 350 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Teleport all here"
|
||||||
|
}
|
||||||
|
CheckBoxWidgetClass Cb_Player_Stamina {
|
||||||
|
position 610 450
|
||||||
|
size 350 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Dissable Stamina"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TextWidgetClass textWidgettxt {
|
||||||
|
position 88 720
|
||||||
|
size 265.38998 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Private Message"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
TextWidgetClass TextWidget5 {
|
||||||
|
position 610 550
|
||||||
|
size 130 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Blood :"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
TextWidgetClass TextWidget7 {
|
||||||
|
position 1100 550
|
||||||
|
size 130 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Energy :"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
TextWidgetClass Text_Player_Blood {
|
||||||
|
position 610 605
|
||||||
|
size 260 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "XXX"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
TextWidgetClass Text_Player_Energy {
|
||||||
|
position 1100 605
|
||||||
|
size 260 45
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "XXX"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,255 @@
|
|||||||
|
FrameWidgetClass rootFrame {
|
||||||
|
position 10 10
|
||||||
|
size 1400 800
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
{
|
||||||
|
FrameWidgetClass command_settings_root {
|
||||||
|
ignorepointer 1
|
||||||
|
position -1.47211 0
|
||||||
|
size 1 1
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 0
|
||||||
|
{
|
||||||
|
TextWidgetClass TextWidget0 {
|
||||||
|
position 0 10
|
||||||
|
size 1 50
|
||||||
|
halign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
style Bold
|
||||||
|
text "Spawn"
|
||||||
|
"exact text" 0
|
||||||
|
"size to text h" 0
|
||||||
|
"size to text v" 0
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
PanelWidgetClass PanelWidget0 {
|
||||||
|
color 0.9333 0 0.0784 1
|
||||||
|
position 0 75
|
||||||
|
size 0.9 3.5
|
||||||
|
halign center_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 0
|
||||||
|
vexactsize 1
|
||||||
|
style rover_sim_colorable
|
||||||
|
}
|
||||||
|
TextWidgetClass search_text {
|
||||||
|
position 100 100
|
||||||
|
size 150 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Search :"
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
EditBoxWidgetClass search_input {
|
||||||
|
position 280 100
|
||||||
|
size 500 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
style ServerBrowser
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_spawn_filter_All {
|
||||||
|
position 100 180
|
||||||
|
size 150 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "All"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_spawn_filter_edible_base {
|
||||||
|
position 100 240
|
||||||
|
size 150 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Food"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_spawn_filter_weapon_base {
|
||||||
|
position 100 300
|
||||||
|
size 150 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Weapons"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_spawn_filter_clothing_base {
|
||||||
|
position 100 360
|
||||||
|
size 150 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Cloth"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_spawn_filter_transport {
|
||||||
|
position 100 420
|
||||||
|
size 150 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Vehicles"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_spawn_filter_house {
|
||||||
|
position 100 480
|
||||||
|
size 150 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Buildings"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_spawn_filter_dz_lightai {
|
||||||
|
position 100 540
|
||||||
|
size 150 47
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Ai"
|
||||||
|
}
|
||||||
|
PanelWidgetClass PanelWidget1 {
|
||||||
|
position 280 180
|
||||||
|
size 500 410
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
style rover_sim_black_2
|
||||||
|
}
|
||||||
|
TextListboxWidgetClass classlist {
|
||||||
|
position 280 180
|
||||||
|
size 500 410
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
lines 20
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_spawn_cursorpos {
|
||||||
|
position 280 720
|
||||||
|
size 160 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Cursor"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_spawn_ground {
|
||||||
|
position 460 720
|
||||||
|
size 160 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Ground"
|
||||||
|
}
|
||||||
|
ButtonWidgetClass btn_spawn_inventory {
|
||||||
|
position 640 720
|
||||||
|
size 160 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Inventory"
|
||||||
|
}
|
||||||
|
TextWidgetClass className_spawner {
|
||||||
|
position 45 660
|
||||||
|
size 100 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Class Name :"
|
||||||
|
"size to text h" 1
|
||||||
|
"size to text v" 0
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
TextWidgetClass spawn_text {
|
||||||
|
position 40 720
|
||||||
|
size 100 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Spawn Type :"
|
||||||
|
"size to text h" 1
|
||||||
|
"size to text v" 0
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
EditBoxWidgetClass className_spawner_box {
|
||||||
|
position 280 660
|
||||||
|
size 500 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
style ServerBrowser
|
||||||
|
}
|
||||||
|
TextWidgetClass quantity_text {
|
||||||
|
position 500 660
|
||||||
|
size 100 48
|
||||||
|
halign right_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "Quantity Number/\"Max\" :"
|
||||||
|
"size to text h" 1
|
||||||
|
"size to text v" 0
|
||||||
|
"text halign" center
|
||||||
|
"text valign" center
|
||||||
|
}
|
||||||
|
EditBoxWidgetClass quantity_items {
|
||||||
|
position 1220 660
|
||||||
|
size 120 48
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
text "MAX"
|
||||||
|
}
|
||||||
|
ItemPreviewWidgetClass ItemPrev {
|
||||||
|
position 100 180
|
||||||
|
size 500 410
|
||||||
|
halign right_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
priority 5
|
||||||
|
}
|
||||||
|
PanelWidgetClass PanelWidget2 {
|
||||||
|
visible 0
|
||||||
|
position 100 180
|
||||||
|
size 500 410
|
||||||
|
halign right_ref
|
||||||
|
hexactpos 1
|
||||||
|
vexactpos 1
|
||||||
|
hexactsize 1
|
||||||
|
vexactsize 1
|
||||||
|
style rover_sim_blackbox
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
41
DayZ-Sa-Tomato/mod.cpp
Normal file
41
DayZ-Sa-Tomato/mod.cpp
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
class CfgMods
|
||||||
|
{
|
||||||
|
class DayZSATomato
|
||||||
|
{
|
||||||
|
dir = "DayZ-SA-Tomato";
|
||||||
|
picture = "";
|
||||||
|
action = "";
|
||||||
|
hideName = 1;
|
||||||
|
hidePicture = 1;
|
||||||
|
name = "DayZ-SA-Tomato";
|
||||||
|
credits = "";
|
||||||
|
author = "DayZ-SA-Tomato";
|
||||||
|
authorID = "0";
|
||||||
|
version = "1.0";
|
||||||
|
extra = 0;
|
||||||
|
type = "mod";
|
||||||
|
|
||||||
|
dependencies[] = {"Game", "World", "Mission"};
|
||||||
|
|
||||||
|
class defs
|
||||||
|
{
|
||||||
|
class gameScriptModule
|
||||||
|
{
|
||||||
|
value = "";
|
||||||
|
files[] = {"com/DayZ-SA-Tomato/scripts/3_Game"};
|
||||||
|
};
|
||||||
|
|
||||||
|
class worldScriptModule
|
||||||
|
{
|
||||||
|
value = "";
|
||||||
|
files[] = {"com/DayZ-SA-Tomato/scripts/4_World"};
|
||||||
|
};
|
||||||
|
|
||||||
|
class missionScriptModule
|
||||||
|
{
|
||||||
|
value = "";
|
||||||
|
files[] = {"com/DayZ-SA-Tomato/scripts/5_Mission"};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user