17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-30 05:00:29 +01:00

First implementation of graph vehicles

This commit is contained in:
2026-10-14 12:20:49 +02:00
parent 70abf879b3
commit 1ef465264c
121 changed files with 12292 additions and 729 deletions

View File

@@ -1168,6 +1168,15 @@ int eu07_application::init_settings(int Argc, char *Argv[])
else
editwithoutscenery = true;
}
else if (token == "-graph-preview")
{
// live preview server of the vehicle graph editor, on the default or the specified port
Global.vehiclegraph_preview = true;
if (i + 1 < Argc && Argv[i + 1][0] >= '0' && Argv[i + 1][0] <= '9')
{
Global.vehiclegraph_preview_port = std::atoi(Argv[++i]);
}
}
else if (token == "-seed")
{
// a number is the seed; anything else is a word that stands for one. said in the
@@ -1183,7 +1192,8 @@ int eu07_application::init_settings(int Argc, char *Argv[])
std::cout << "usage: " << std::string(Argv[0]) << " [-s sceneryfilepath]"
<< " [-v vehiclename]"
<< " [-edit [sceneryfilepath]]"
<< " [-seed number|word]" << std::endl;
<< " [-seed number|word]"
<< " [-graph-preview [port]]" << std::endl;
return -1;
}
}

View File

@@ -10,6 +10,7 @@ http://mozilla.org/MPL/2.0/.
#include "stdafx.h"
#include "application/drivermode.h"
#include "application/driveruilayer.h"
#include "vehicle/graph/graph_preview.h"
#include "utilities/Globals.h"
#include "application/application.h"
@@ -170,6 +171,8 @@ bool driver_mode::update()
simulation::State.update_clocks();
simulation::State.update_scripting_interface();
simulation::Environment.update();
// live preview connections of the vehicle graph editor
vgraph::preview_update();
if (deltatime != 0.0 || false == simulation::is_ready)
{

View File

@@ -37,6 +37,7 @@ driver_ui::driver_ui()
add_external_panel(&m_logpanel);
add_external_panel(&m_perfgraphpanel);
add_external_panel(&m_cameraviewpanel);
add_external_panel(&m_vehiclegraphpanel);
m_logpanel.is_open = false;
m_aidpanel.title = STR("Driving Aid");
@@ -81,6 +82,7 @@ void driver_ui::render_menu_contents()
ImGui::MenuItem(m_vehiclelist.name().c_str(), nullptr, &m_vehiclelist.is_open);
ImGui::MenuItem(m_trainingcardpanel.name().c_str(), nullptr, &m_trainingcardpanel.is_open);
ImGui::MenuItem(m_cameraviewpanel.name().c_str(), nullptr, &m_cameraviewpanel.is_open);
ImGui::MenuItem(m_vehiclegraphpanel.name().c_str(), nullptr, &m_vehiclegraphpanel.is_open);
if (DebugModeFlag)
ImGui::MenuItem(m_perfgraphpanel.name().c_str(), nullptr, &m_perfgraphpanel.is_open);

View File

@@ -19,6 +19,7 @@ http://mozilla.org/MPL/2.0/.
#include "widgets/time.h"
#include "widgets/trainingcard.h"
#include "widgets/perfgraphs.h"
#include "widgets/vehiclegraph.h"
#include "widgets/cameraview_extcam.h"
class driver_ui : public ui_layer {
@@ -69,4 +70,5 @@ private:
ui::map_panel m_mappanel;
ui::time_panel m_timepanel;
ui::cameraview_panel m_cameraviewpanel;
ui::vehiclegraph_panel m_vehiclegraphpanel;
};