3 private static const string LOG_DEBUG =
"Debug";
35 if (CastTo(obj, entity))
36 return obj.GetDebugNameNative();
38 return entity.GetDebugName();
56 static void CanvasDrawLine(
float x1,
float y1,
float x2,
float y2,
float width,
int color)
103 if ( found_shape && found_shape == shape )
105 found_shape.Destroy();
191 string logMessage =
string.Format(
"%1: %2", entity.GetSimulationTimeStamp(), message);
254 for (
int i = 0; i < arr.Count(); i++)
265 for (
int i = 0; i < arr.Count(); i++)
304 float size_h = size * 0.5;
306 min[0] = min[0] - size_h;
307 min[1] = min[1] - size_h;
308 min[2] = min[2] - size_h;
310 max[0] = max[0] + size_h;
311 max[1] = max[1] + size_h;
312 max[2] = max[2] + size_h;
321 Shape shape =
Shape.CreateSphere(color, flags, pos, size);
329 Shape shape =
Shape.CreateFrustum(horizontalAngle, verticalAngle, length, color, flags);
337 Shape shape =
Shape.CreateCylinder(color, flags, pos, radius, height);
364 foreach (
Shape shape : shapes)
388 Shape shape =
Shape.CreateLines(color, flags, pts, 2);
398 Shape shape =
Shape.CreateLines(color, flags, positions, count);
406 Shape shape =
Shape.CreateArrow(from, to, size, color, flags);
419 base_classes.Clear();
443 filtered_classes.Clear();
447 for (
int s = 0; s < searching_in.Count(); ++s )
449 string config_path = searching_in.Get(s);
452 for (
int i = 0; i < objects_count; i++)
466 string nchName = childName;
469 if ( nchName.
Contains(search_string) != -1)
471 filtered_classes.Insert(childName);
482 private static string LogMessage(
string level,
string plugin,
string entity,
string author,
string label,
string message)
493 string env =
"Client";
494 string msg =
string.Empty;
501 msg =
string.
Format(
"%1 | %2 | %3 | %4 | %5 | %6 | %7", date, env, level, plugin, entity, label, message);
508 Param1<string> msg_p =
new Param1<string>(msg);
520 private static void SaveLog(
string log_message)
522 if (log_message.
Length() == 0)
553 Print(
string.Format(
"%1", log_message));
587 string date = month.ToStringLen(2) +
"-" + day.ToStringLen(2) +
" " + hour.ToStringLen(2) +
":" + minute.ToStringLen(2) +
":" + second.ToStringLen(2);
610 #ifdef ENABLE_LOGGING
782 for(
int i = 0; i < items.Count(); i++)
Dispatcher GetDispatcher()
const CallID CALL_ID_SEND_LOG
const CallID CALL_ID_SCR_CNSL_ADD_PRINT
Param CallMethod(CallID call_id, Param params)
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native bool IsMultiplayer()
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto native bool IsServer()
proto native WorkspaceWidget GetWorkspace()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
static ref Param1< string > PARAM1_STRING
static ref array< Shape > m_DebugShapes
static const string LOG_DEBUG_MELEE
static const string LOG_DEBUG_BLEEDING_CHANCES
static void BaseBuildingLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static const string LOG_DEBUG_INV_RESERVATION
static void TFLog(string message=LOG_DEFAULT, TestFramework caller=null, string function="")
static Shape DrawLines(vector[] positions, int count, int color=0xFFFFFFFF, int flags=0)
static bool m_EnabledLogs
static void QuickbarLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static const string LOG_DEBUG_ACTION
static void GetBaseConfigClasses(out TStringArray base_classes)
Returns some of base config classes strings like CfgVehicles, CfgWeapons, etc. for searching purposes...
static const string LOG_DEBUG
static CanvasWidget m_CanvasDebug
static const string LOG_DEBUG_PARTICLE
static void SymptomLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static Shape DrawCylinder(vector pos, float radius, float height=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static void InventoryReservationLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void ParticleLog(string message=LOG_DEFAULT, Managed caller=null, string function="", Managed entity=null)
static Shape DrawBox(vector pos1, vector pos2, int color=0x1fff7f7f)
static string GetFileName()
static const string LOG_DEBUG_WEIGHT
static const string LOG_DEBUG_TF
static void LogWarning(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as warning message.
static void CanvasDrawLine(float x1, float y1, float x2, float y2, float width, int color)
static void LogInfo(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
static const string LOG_DEBUG_WEATHER
static void BleedingChancesLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static void GetFiltredConfigClasses(string search_string, out TStringArray filtered_classes, bool only_public=true)
Returns config classes containing search_string in name.
static void WeightLog(string message=LOG_DEFAULT, Managed caller=null, string function="", Managed entity=null)
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
static void MeleeLog(Entity entity, string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT)
static Shape DrawFrustum(float horizontalAngle, float verticalAngle, float length, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.WIREFRAME)
static const string LOG_DEBUG_BASEBUILDING
static const string LOG_DEBUG_TRIGGER
static void SaveLog(string log_message)
static const string LOG_DEBUG_QUICKBAR
static Shape DrawCube(vector pos, float size=1, int color=0x1fff7f7f)
static const string LOG_INFO
static void ClearCanvas()
static const string LOG_DEBUG_SYMPTOM
static void ReceivedLogMessageFromServer(string message)
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
static void TriggerLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void CleanupDrawShapes(array< Shape > shapes)
static const string LOG_DEBUG_INV_MOVE
static array< Shape > DrawCone(vector pos, float lenght, float halfAngle, float offsetAngle, int color=0xFFFFFFFF, int flags=0)
static void CanvasDrawPoint(float x1, float y1, int color)
Draws a "point" on the screen at x,y coordinates Debug.ClearCanvas(); for(int i = 0; i < 700;i++) { f...
static const string LOG_WARNING
static void InventoryHFSMLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void DestroyAllShapes()
static Shape DrawBoxEx(vector pos1, vector pos2, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOZWRITE)
static void WeatherLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
static void LogArrayInt(array< int > arr=NULL, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void ClearScriptLogs()
static const string LOG_DEFAULT
static Widget m_DebugLayoutCanvas
static void LogArrayString(array< string > arr=NULL, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static void InventoryMoveLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
static const string LOG_ERROR
static void RemoveShape(out Shape shape)
static string GetDebugName(Managed entity)
static const string LOG_DEBUG_INV_HFSM
static Shape DrawLine(vector from, vector to, int color=0xFFFFFFFF, int flags=0)
static string LogMessage(string level, string plugin, string entity, string author, string label, string message)
DEPRECATED.
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Param CallMethod(CallID call_id, Param params)
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
script counterpart to engine's class Inventory
static void InventoryHFSMLogEnable(bool enable)
static void InventoryReservationLogEnable(bool enable)
static void SymptomLogEnable(bool enable)
static void SyncLogEnable(bool enable)
static bool IsWeaponLogEnable()
static void BleedingChancesLogEnable(bool enable)
static bool m_DoActionDebugLog
static bool m_DoInventoryHFSMLog
static void WeaponLogEnable(bool enable)
static bool m_DoSymptomDebugLog
static bool IsBaseBuildingLogEnable()
static bool m_DoInventoryReservationLog
static bool IsWeatherLogEnabled()
static void SetLogsEnabled(bool enable)
static bool IsInventoryReservationLogEnable()
static bool IsSymptomLogEnable()
static bool IsSyncLogEnable()
static bool IsInventoryHFSMLogEnable()
static bool IsLogsEnable()
static bool m_DoBleedingChanceLog
static bool m_DoBaseBuildingLog
static void QuickbarLogEnable(bool enable)
static void ActionLogEnable(bool enable)
static void InventoryMoveLogEnable(bool enable)
static bool m_DoWeatherLog
static bool IsBleedingChancesLogEnable()
static bool IsInventoryMoveLogEnable()
static bool IsActionLogEnable()
static void BaseBuildingLogEnable(bool enable)
static bool m_DoWeaponLog
static bool IsQuickbarLogEnable()
static bool m_DoInventoryMoveLog
static bool m_DoQuickbarLog
void AddCalcDetails(string details)
void SetCalcDetails(string details)
void SetWeight(float weight)
void WeightDebugData(EntityAI entity)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString(bool simple=true)
override string GetDebugName()
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
const string CFG_FILE_SCRIPT_LOG_EXT
proto void Print(void var)
Prints content of variable to console/log.
proto void PrintToRPT(void var)
Prints content of variable to RPT file (performance warning - each write means fflush!...
array< string > TStringArray
proto void CloseFile(FileHandle file)
Close the File.
proto FileHandle OpenFile(string name, FileMode mode)
Opens File.
proto bool FileExist(string name)
Check existence of file.
proto void FPrintln(FileHandle file, void var)
Write to file and add new line.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto void ConePoints(vector origin, float length, float halfAngle, float angleOffset, out vector leftPoint, out vector rightPoint)
Calculates the points of a right 2D cone in 3D space.
static proto float Cos(float angle)
Returns cosinus of angle in radians.
static proto float Sin(float angle)
Returns sinus of angle in radians.
proto native int Length()
Returns length of string.
bool Contains(string sample)
Returns true if sample is substring of string.
static const string Empty
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.
proto int ToLower()
Changes string to lowercase. Returns length.
proto void GetYearMonthDay(out int year, out int month, out int day)
Returns system date.
proto void GetHourMinuteSecond(out int hour, out int minute, out int second)
Returns system time.
proto native bool IsCLIParam(string param)
Returns if command line argument is present.