1class PluginUniversalTemperatureSourceClient
extends PluginBase
44 m_RootWidget[i] =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/debug/day_z_debug_remoteinfo.layout");
54 float fullRange = utsd.GetValue(1).ToFloat();
55 float maxRange = utsd.GetValue(2).ToFloat();
56 float temp = utsd.GetValue(3).ToFloat();
57 vector sphPos = utsd.GetValue(0).ToVector();
68 fullRangeColor = 0x1fefefef;
69 maxRangeColor = 0x1fefefef;
81 DbgUI.
Begin(
"Universal Temp Sources", 10, 300);
110 float min = MiscGameplayFunctions.GetMinValue(utsTemperatures);
111 float max = MiscGameplayFunctions.GetMaxValue(utsTemperatures);
113 if (max > 0 && min < 0)
127 distance =
Math.
Max(distance, 0.1);
128 float temperature = 0;
131 if (distance > utsd.GetValue(1).ToFloat())
133 float distFactor =
Math.
InverseLerp(utsd.GetValue(2).ToFloat(), utsd.GetValue(1).ToFloat(), distance);
134 distFactor =
Math.
Max(distFactor, 0.0);
135 temperature = utsd.GetValue(3).ToFloat() * distFactor;
139 temperature = utsd.GetValue(3).ToFloat();
162 vector pos = utsd.GetValue(0).ToVector();
163 vector screen_pos_stats =
g_Game.GetScreenPos(pos +
"0 0 0");
164 vector screen_pos_damage =
g_Game.GetScreenPos(pos +
"0 2 0");
165 m_RootWidget[i].SetPos(screen_pos_stats[0], screen_pos_stats[1]);
167 if (screen_pos_stats[2] > 0 && screen_pos_stats[0] > 0 && screen_pos_stats[1] > 0)
193 int numPairs = utsd.PairsCount();
194 for (
int i = 0; i < numPairs; ++i)
219 rpc.
Send(player,
ERPCs.DEV_REQUEST_UTS_DEBUG,
true, player.GetIdentity());
228 PrintString(
"-------------------------------------");
230 PrintString(
"-------------------------------------");
static Shape DrawArrow(vector from, vector to, float size=0.5, int color=0xFFFFFFFF, int flags=0)
static Shape DrawCylinder(vector pos, float radius, float height=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
Class PluginMessageManager provides some basic Message Distribution mechanics, if you get instance of...
float CalcTemperatureFromTemperatureSource(notnull UTemperatureSourceDebug utsd)
const int MAX_SIMULTANEOUS_UTS
float m_UTSAverageTemperature
void EnableWidgets(bool enable)
void ProcessUniversalTemperatureSources()
void PluginUniversalTemperatureSourceClient()
void PluginUniversalTemperatureSourceServer()
TextWidget m_HeaderWidget[MAX_SIMULTANEOUS_UTS]
void OnRPC(ParamsReadContext ctx)
TextListboxWidget m_StatListWidgets[MAX_SIMULTANEOUS_UTS]
override void OnUpdate(float delta_time)
ref array< ref UTemperatureSourceDebug > m_UTemperatureSourceDebugs
ref Widget m_RootWidget[MAX_SIMULTANEOUS_UTS]
void RequestUniversalTemperatureSources(PlayerBase player, int enable)
void UpdateStatWidget(int rowIndex, UTemperatureSourceDebug utsd)
proto native void Send(Object target, int rpc_type, bool guaranteed, PlayerIdentity recipient=NULL)
Initiate remote procedure call.
proto bool Write(void value_out)
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString(bool simple=true)
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
Serializer ParamsReadContext
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto native void Text(string label)
static proto native void End()
class array< Class T > PrintString
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static proto float SqrFloat(float f)
Returns squared value.