mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-17 23:39:18 +02:00
snapshot
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "Logs.h"
|
||||
|
||||
ui::cameraview_panel::cameraview_panel()
|
||||
: ui_panel(LOC_STR(cameraview_window), false)
|
||||
: ui_panel(STR_C(cameraview_window), false)
|
||||
{
|
||||
size_min = { -2, -2 };
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "Driver.h"
|
||||
#include "AnimModel.h"
|
||||
|
||||
ui::map_panel::map_panel() : ui_panel(LOC_STR(ui_map), false)
|
||||
ui::map_panel::map_panel() : ui_panel(STR_C(ui_map), false)
|
||||
{
|
||||
size_min = {200, 200};
|
||||
size_max = {fb_size, fb_size};
|
||||
@@ -445,13 +445,13 @@ void ui::launcher_window::render_content()
|
||||
{
|
||||
ImGui::TextUnformatted(m_switch->name.c_str());
|
||||
|
||||
const std::string &open_label = locale::strings[
|
||||
const std::string &open_label = STR(
|
||||
m_switch->type == map::launcher::track_switch
|
||||
? locale::string::map_straight : locale::string::map_open];
|
||||
? locale::string::map_straight : locale::string::map_open);
|
||||
|
||||
const std::string &close_label = locale::strings[
|
||||
const std::string &close_label = STR(
|
||||
m_switch->type == map::launcher::track_switch
|
||||
? locale::string::map_divert : locale::string::map_close];
|
||||
? locale::string::map_divert : locale::string::map_close);
|
||||
|
||||
if (ImGui::Button(open_label.c_str()))
|
||||
{
|
||||
@@ -495,7 +495,7 @@ void ui::obstacle_insert_window::render_content()
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui::TextUnformatted(LOC_STR(map_obstacle_insert));
|
||||
ImGui::TextUnformatted(STR_C(map_obstacle_insert));
|
||||
for (auto const &entry : m_obstacles)
|
||||
{
|
||||
if (ImGui::Button(entry.first.c_str()))
|
||||
@@ -526,7 +526,7 @@ ui::obstacle_remove_window::obstacle_remove_window(ui_panel &panel, std::shared_
|
||||
|
||||
void ui::obstacle_remove_window::render_content()
|
||||
{
|
||||
if (ImGui::Button(LOC_STR(map_obstacle_remove))) {
|
||||
if (ImGui::Button(STR_C(map_obstacle_remove))) {
|
||||
m_relay.post(user_command::deletemodel, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(), &m_obstacle->model_name);
|
||||
|
||||
auto &entries = map::Objects.entries;
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
#include "simulationtime.h"
|
||||
#include "Globals.h"
|
||||
|
||||
ui::time_panel::time_panel() : ui_panel(LOC_STR(time_window), false)
|
||||
ui::time_panel::time_panel() : ui_panel(STR_C(time_window), false)
|
||||
{
|
||||
size.x = 450;
|
||||
}
|
||||
|
||||
void ui::time_panel::render_contents()
|
||||
{
|
||||
ImGui::SliderFloat(LOC_STR(time_time), &time, 0.0f, 24.0f, "%.1f");
|
||||
ImGui::SliderInt(LOC_STR(time_yearday), &yearday, 1, 365);
|
||||
ImGui::SliderFloat(LOC_STR(time_visibility), &fog, 50.0f, 3000.0f, "%.0f");
|
||||
ImGui::SliderFloat(LOC_STR(time_weather), &overcast, 0.0f, 2.0f, "%.1f");
|
||||
ImGui::SliderFloat(LOC_STR(time_temperature), &temperature, -20.0f, 40.0f, "%.0f");
|
||||
ImGui::SliderFloat(STR_C(time_time), &time, 0.0f, 24.0f, "%.1f");
|
||||
ImGui::SliderInt(STR_C(time_yearday), &yearday, 1, 365);
|
||||
ImGui::SliderFloat(STR_C(time_visibility), &fog, 50.0f, 3000.0f, "%.0f");
|
||||
ImGui::SliderFloat(STR_C(time_weather), &overcast, 0.0f, 2.0f, "%.1f");
|
||||
ImGui::SliderFloat(STR_C(time_temperature), &temperature, -20.0f, 40.0f, "%.0f");
|
||||
|
||||
if (ImGui::Button(LOC_STR(time_apply)))
|
||||
if (ImGui::Button(STR_C(time_apply)))
|
||||
{
|
||||
m_relay.post(user_command::setdatetime, (double)yearday, time, 1, 0);
|
||||
m_relay.post(user_command::setweather, fog, overcast, 1, 0);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "widgets/vehicleparams.h"
|
||||
|
||||
ui::vehiclelist_panel::vehiclelist_panel(ui_layer &parent)
|
||||
: ui_panel(LOC_STR(vehiclelist_window), false), m_parent(parent)
|
||||
: ui_panel(STR_C(vehiclelist_window), false), m_parent(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "Train.h"
|
||||
|
||||
ui::vehicleparams_panel::vehicleparams_panel(const std::string &vehicle)
|
||||
: ui_panel(std::string(locale::strings[locale::string::vehicleparams_window]) + ": " + vehicle, false), m_vehicle_name(vehicle)
|
||||
: ui_panel(std::string(STR(vehicleparams_window)) + ": " + vehicle, false), m_vehicle_name(vehicle)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -53,7 +53,7 @@ void ui::vehicleparams_panel::render_contents()
|
||||
|
||||
std::snprintf(
|
||||
buffer.data(), buffer.size(),
|
||||
locale::strings[ locale::string::debug_vehicle_devicespower ].c_str(),
|
||||
STR_C(debug_vehicle_devicespower),
|
||||
// devices
|
||||
( mover.Battery ? 'B' : '.' ),
|
||||
( mover.Mains ? 'M' : '.' ),
|
||||
@@ -70,7 +70,7 @@ void ui::vehicleparams_panel::render_contents()
|
||||
( mover.CompressorFlag ? 'C' : ( false == mover.CompressorAllowLocal ? '-' : ( ( mover.CompressorAllow || mover.CompressorStart == start_t::automatic ) ? 'c' : '.' ) ) ),
|
||||
( mover.CompressorGovernorLock ? '!' : '.' ),
|
||||
"",
|
||||
std::string( isdieselenginepowered ? locale::strings[ locale::string::debug_vehicle_oilpressure ] + to_string( mover.OilPump.pressure, 2 ) : "" ).c_str(),
|
||||
std::string( isdieselenginepowered ? STR(debug_vehicle_oilpressure) + to_string( mover.OilPump.pressure, 2 ) : "" ).c_str(),
|
||||
// power transfers
|
||||
mover.Couplers[ end::front ].power_high.voltage,
|
||||
mover.Couplers[ end::front ].power_high.current,
|
||||
@@ -84,11 +84,11 @@ void ui::vehicleparams_panel::render_contents()
|
||||
|
||||
std::snprintf(
|
||||
buffer.data(), buffer.size(),
|
||||
locale::strings[ locale::string::debug_vehicle_controllersenginerevolutions ].c_str(),
|
||||
STR_C(debug_vehicle_controllersenginerevolutions),
|
||||
// controllers
|
||||
mover.MainCtrlPos,
|
||||
mover.MainCtrlActualPos,
|
||||
std::string( isdieselinshuntmode ? to_string( mover.AnPos, 2 ) + locale::strings[ locale::string::debug_vehicle_shuntmode ] : std::to_string( mover.ScndCtrlPos ) + "(" + std::to_string( mover.ScndCtrlActualPos ) + ")" ).c_str(),
|
||||
std::string( isdieselinshuntmode ? to_string( mover.AnPos, 2 ) + STR(debug_vehicle_shuntmode) : std::to_string( mover.ScndCtrlPos ) + "(" + std::to_string( mover.ScndCtrlActualPos ) + ")" ).c_str(),
|
||||
// engine
|
||||
mover.EnginePower,
|
||||
std::abs( mover.TrainType == dt_EZT ? mover.ShowCurrent( 0 ) : mover.Im ),
|
||||
@@ -106,7 +106,7 @@ void ui::vehicleparams_panel::render_contents()
|
||||
if( isdieselenginepowered ) {
|
||||
std::snprintf(
|
||||
buffer.data(), buffer.size(),
|
||||
locale::strings[ locale::string::debug_vehicle_temperatures ].c_str(),
|
||||
STR_C(debug_vehicle_temperatures),
|
||||
mover.dizel_heat.Ts,
|
||||
mover.dizel_heat.To,
|
||||
mover.dizel_heat.temperatura1,
|
||||
@@ -132,7 +132,7 @@ void ui::vehicleparams_panel::render_contents()
|
||||
|
||||
std::snprintf(
|
||||
buffer.data(), buffer.size(),
|
||||
locale::strings[ locale::string::debug_vehicle_brakespressures ].c_str(),
|
||||
STR_C(debug_vehicle_brakespressures),
|
||||
// brakes
|
||||
mover.fBrakeCtrlPos,
|
||||
mover.LocalBrakePosA,
|
||||
@@ -158,7 +158,7 @@ void ui::vehicleparams_panel::render_contents()
|
||||
if( mover.EnginePowerSource.SourceType == TPowerSource::CurrentCollector ) {
|
||||
std::snprintf(
|
||||
buffer.data(), buffer.size(),
|
||||
locale::strings[ locale::string::debug_vehicle_pantograph ].c_str(),
|
||||
STR_C(debug_vehicle_pantograph),
|
||||
mover.PantPress,
|
||||
( mover.bPantKurek3 ? '-' : '|' ) );
|
||||
ImGui::TextUnformatted(buffer.data());
|
||||
@@ -166,7 +166,7 @@ void ui::vehicleparams_panel::render_contents()
|
||||
|
||||
std::snprintf(
|
||||
buffer.data(), buffer.size(),
|
||||
locale::strings[ locale::string::debug_vehicle_forcesaccelerationvelocityposition ].c_str(),
|
||||
STR_C(debug_vehicle_forcesaccelerationvelocityposition),
|
||||
// forces
|
||||
mover.Ft * 0.001f * ( mover.ActiveCab ? mover.ActiveCab : vehicle.ctOwner ? vehicle.ctOwner->Controlling()->ActiveCab : 1 ) + 0.001f,
|
||||
mover.Fb * 0.001f,
|
||||
@@ -186,40 +186,40 @@ void ui::vehicleparams_panel::render_contents()
|
||||
|
||||
ImGui::TextUnformatted(buffer.data());
|
||||
|
||||
if (ImGui::Button(LOC_STR(vehicleparams_radiostop)))
|
||||
if (ImGui::Button(STR_C(vehicleparams_radiostop)))
|
||||
m_relay.post(user_command::radiostop, 0.0, 0.0, GLFW_PRESS, 0, vehicle_ptr->GetPosition());
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button(LOC_STR(vehicleparams_reset)))
|
||||
if (ImGui::Button(STR_C(vehicleparams_reset)))
|
||||
m_relay.post(user_command::resetconsist, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button(LOC_STR(vehicleparams_resetposition))) {
|
||||
if (ImGui::Button(STR_C(vehicleparams_resetposition))) {
|
||||
std::string payload = vehicle_ptr->name() + '%' + vehicle_ptr->initial_track->name();
|
||||
m_relay.post(user_command::consistteleport, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &payload);
|
||||
m_relay.post(user_command::resetconsist, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
}
|
||||
|
||||
if (ImGui::Button(LOC_STR(vehicleparams_resetpipe)))
|
||||
if (ImGui::Button(STR_C(vehicleparams_resetpipe)))
|
||||
m_relay.post(user_command::fillcompressor, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button(LOC_STR(vehicleparams_rupturepipe)))
|
||||
if (ImGui::Button(STR_C(vehicleparams_rupturepipe)))
|
||||
m_relay.post(user_command::pullalarmchain, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::Button(LOC_STR(cab_releaser_bt));
|
||||
ImGui::Button(STR_C(cab_releaser_bt));
|
||||
if (ImGui::IsItemClicked())
|
||||
m_relay.post(user_command::consistreleaser, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
if (ImGui::IsItemDeactivated())
|
||||
m_relay.post(user_command::consistreleaser, 0.0, 0.0, GLFW_RELEASE, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
|
||||
if (vehicle_ptr->MoverParameters->V < 0.01) {
|
||||
if (ImGui::Button(LOC_STR(vehicleparams_move500f)))
|
||||
if (ImGui::Button(STR_C(vehicleparams_move500f)))
|
||||
m_relay.post(user_command::dynamicmove, 500.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button(LOC_STR(vehicleparams_move500b)))
|
||||
if (ImGui::Button(STR_C(vehicleparams_move500b)))
|
||||
m_relay.post(user_command::dynamicmove, -500.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user