Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some air temperature bugs and improved the debug monitor. #291

Open
wants to merge 4 commits into
base: production
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ class WeatherMenu extends PopupMenu
{
m_TxtWeatherTime.SetText( GetGame().GetWeather().GetTime().ToString() );
// m_TxtAirTemperature.SetText( GetGame().GetWeather().GetAirTemperature().ToString() );
PlayerBase player = PlayerBase.Cast( COM_GetPB() ); //Get player
m_TxtAirTemperature.SetText(player.m_Environment.GetTemperature().ToString() ); //Get player environment temperature instad of game temperature
}

void ResetSliders()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,26 @@ class CustomDebugMonitor extends Module
{
auto health = player.GetHealth("","Health");
auto blood = player.GetHealth("","Blood");
auto shock = player.GetHealth("","Shock"); //added Shock value
//auto bodytemp = player.GetStatTemperature().Get(); //future non existent function
auto airtemp = player.m_Environment.GetTemperature(); //Get player environment temperature
auto lastdamage = values.GetLastDamage();

if( lastdamage == "" )
{
lastdamage = "Unknown";
}

auto position = player.GetPosition();
auto orientation = GetGame().GetCurrentCameraDirection().VectorToAngles();
//auto position = player.GetPosition(); // Not working when you fly camera after pressing INSERT
auto orientation = GetGame().GetCurrentCameraDirection().VectorToAngles();
auto position = GetGame().GetCurrentCameraPosition(); //Get camera position instead of the player position

m_debugMonitor.SetHealth( health );
m_debugMonitor.SetBlood( blood );
m_debugMonitor.SetLastDamage( lastdamage );
m_debugMonitor.SetShock( shock ); // Added shock
//m_debugMonitor.SetBodyTemp( bodytemp ); // Not working, reserved for future
m_debugMonitor.SetAirTemp( airtemp ); // Added air temp
//m_debugMonitor.SetLastDamage( lastdamage ); // Not working
m_debugMonitor.SetPosition( position );
m_debugMonitor.SetOrientation( orientation );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,33 @@ class ArkDebugMonitor

m_pNamesListboxWidget.AddItem("BLOOD:", NULL, 0);
m_pValuesListboxWidget.AddItem("", NULL, 0);

m_pNamesListboxWidget.AddItem("SHOCK:", NULL, 0); //Added shcok
m_pValuesListboxWidget.AddItem("", NULL, 0);

/* m_pNamesListboxWidget.AddItem("BODY t°:", NULL, 0); // Not working
m_pValuesListboxWidget.AddItem("", NULL, 0); */

/*m_pNamesListboxWidget.AddItem("BODY TEMP:", NULL, 0);
m_pValuesListboxWidget.AddItem("", NULL, 0);*/

m_pNamesListboxWidget.AddItem("LAST DAMAGE:", NULL, 0);
m_pNamesListboxWidget.AddItem("AIR TEMP°:", NULL, 0); //Fixed air temp
m_pValuesListboxWidget.AddItem("", NULL, 0);

/*m_pNamesListboxWidget.AddItem("LAST DAMAGE:", NULL, 0); // Removed, not working.
m_pValuesListboxWidget.AddItem("", NULL, 0);*/

m_pNamesListboxWidget.AddItem("POSITION:", NULL, 0);
m_pValuesListboxWidget.AddItem("", NULL, 0);

m_pNamesListboxWidget.AddItem("ORIENTATION:", NULL, 0);
m_pValuesListboxWidget.AddItem("", NULL, 0);

m_pNamesListboxWidget.AddItem("DATETIME:", NULL, 0);
m_pNamesListboxWidget.AddItem("TIME:", NULL, 0); //Shorter text, easier to read
m_pValuesListboxWidget.AddItem("", NULL, 0);

string version;
GetGame().GetVersion(version);

m_pNamesListboxWidget.AddItem("VERSION:", NULL, 0);
m_pValuesListboxWidget.AddItem( " " + version, NULL, 0);
m_pValuesListboxWidget.AddItem(" " + version, NULL, 0);

/*m_pNamesListboxWidget.AddItem("MODIFIERS:", NULL, 0);
m_pValuesListboxWidget.AddItem("", NULL, 0);*/
Expand All @@ -67,28 +73,46 @@ class ArkDebugMonitor
m_pValuesListboxWidget.SetItem(1, blood, NULL, 0);
}

void SetLastDamage(string value)
void SetShock(float value)
{
string lastDamage = string.Format(" %1", value);
m_pValuesListboxWidget.SetItem(2, lastDamage, NULL, 0);
string shock = string.Format(" %1", value.ToString());
m_pValuesListboxWidget.SetItem(2, shock, NULL, 0);
}

/* void SetBodyTemp(float value)
{
string bodyTemp = string.Format(" %1", value.ToString());
m_pValuesListboxWidget.SetItem(3, bodyTemp, NULL, 0);
} */

void SetAirTemp(float value)
{
string airTemp = string.Format(" %1", value.ToString());
m_pValuesListboxWidget.SetItem(3, airTemp, NULL, 0);
}

/*void SetLastDamage(string value)
{
string lastDamage = string.Format(" %1", value);
m_pValuesListboxWidget.SetItem(4, lastDamage, NULL, 0);
}*/

void SetPosition(vector value)
{
string position = string.Format(" %1 %2 %3", value[0].ToString(), value[1].ToString(), value[2].ToString());
m_pValuesListboxWidget.SetItem(3, position, NULL, 0);
m_pValuesListboxWidget.SetItem(4, position, NULL, 0);
}

void SetOrientation(vector value)
{
string orientation = string.Format(" %1 %2 %3", value[0].ToString(), value[1].ToString(), value[2].ToString());
m_pValuesListboxWidget.SetItem(4, orientation, NULL, 0);
m_pValuesListboxWidget.SetItem(5, orientation, NULL, 0);
}

void SetDateTime(string value)
{
string orientation = string.Format(" %1", value);
m_pValuesListboxWidget.SetItem(5, orientation, NULL, 0);
string dateTime = string.Format(" %1", value);
m_pValuesListboxWidget.SetItem(6, dateTime, NULL, 0);
}

void Hide()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ FrameWidgetClass HudDebugFrameWidget {
WindowWidgetClass StatusWindowWidget {
visible 1
position 0.01 0.01
size 310 165
size 370 230
halign right_ref
hexactpos 0
vexactpos 0
hexactsize 1
vexactsize 1
style rover_sim_black_2
"Size To Content H" 1
"title visible" 0
"text color" 0.6353 0.6353 0.6353 1
"disabled text color" 0.6353 0.6353 0.6353 1
Expand All @@ -42,8 +43,8 @@ FrameWidgetClass HudDebugFrameWidget {
visible 1
disabled 1
clipchildren 0
position 35 36.7
size 79 125
position 32 36.7
size 145 330
hexactpos 1
vexactpos 1
hexactsize 1
Expand All @@ -52,15 +53,16 @@ FrameWidgetClass HudDebugFrameWidget {
"title visible" 0
colums ""
lines 7
"Size To Content H" 1
font "gui/fonts/MetronBook12"
"text color" 0.9451 0.9451 0.9451 1
}
TextListboxWidgetClass ValuesListboxWidget {
visible 1
disabled 1
clipchildren 0
position 125 36.7
size 170 125
position 142 36.7
size 270 330
hexactpos 1
vexactpos 1
hexactsize 1
Expand All @@ -69,6 +71,7 @@ FrameWidgetClass HudDebugFrameWidget {
"title visible" 0
colums ""
lines 7
"Size To Content H" 1
font "gui/fonts/MetronBook12"
"text color" 0.6353 0.6353 0.6353 1
"disabled text color" 0.6353 0.6353 0.6353 1
Expand All @@ -93,7 +96,7 @@ FrameWidgetClass HudDebugFrameWidget {
PanelWidgetClass PanelWidget0 {
color 0.6353 0.6353 0.6353 1
position 24 30
size 262 1
size 330 1
hexactpos 1
vexactpos 1
hexactsize 1
Expand Down