mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-23 03:59:18 +02:00
network-aware obstacles, other changes
This commit is contained in:
@@ -129,6 +129,7 @@ set(SOURCES
|
|||||||
"widgets/popup.cpp"
|
"widgets/popup.cpp"
|
||||||
"widgets/time.cpp"
|
"widgets/time.cpp"
|
||||||
"widgets/vehicleparams.cpp"
|
"widgets/vehicleparams.cpp"
|
||||||
|
"widgets/trainingcontrol.cpp"
|
||||||
|
|
||||||
"ref/glad/src/glad.c"
|
"ref/glad/src/glad.c"
|
||||||
|
|
||||||
|
|||||||
@@ -1982,7 +1982,7 @@ event_manager::update() {
|
|||||||
|
|
||||||
if (launcher->check_activation_key()) {
|
if (launcher->check_activation_key()) {
|
||||||
WriteLog( "Eventlauncher: " + launcher->name() );
|
WriteLog( "Eventlauncher: " + launcher->name() );
|
||||||
m_relay.post(user_command::queueevent, (double)simulation::Events.GetEventId(launcher->Event1), 0.0, GLFW_PRESS, 0);
|
m_relay.post(user_command::queueevent, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &launcher->Event1->name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
53
Train.cpp
53
Train.cpp
@@ -1789,20 +1789,18 @@ void TTrain::OnCommand_batterydisable( TTrain *Train, command_data const &Comman
|
|||||||
|
|
||||||
void TTrain::OnCommand_pantographtogglefront( TTrain *Train, command_data const &cmd )
|
void TTrain::OnCommand_pantographtogglefront( TTrain *Train, command_data const &cmd )
|
||||||
{
|
{
|
||||||
command_data Command = cmd;
|
if( cmd.action == GLFW_PRESS ) {
|
||||||
|
|
||||||
if( Command.action == GLFW_PRESS ) {
|
|
||||||
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||||
if( false == Train->mvControlled->PantFrontUp ) {
|
if( false == Train->mvControlled->PantFrontUp ) {
|
||||||
// turn on...
|
// turn on...
|
||||||
OnCommand_pantographraisefront( Train, Command );
|
OnCommand_pantographraisefront( Train, cmd );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// ...or turn off
|
// ...or turn off
|
||||||
OnCommand_pantographlowerfront( Train, Command );
|
OnCommand_pantographlowerfront( Train, cmd );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( Command.action == GLFW_RELEASE ) {
|
else if( cmd.action == GLFW_RELEASE ) {
|
||||||
// impulse switches return automatically to neutral position
|
// impulse switches return automatically to neutral position
|
||||||
// NOTE: this routine is used also by dedicated raise and lower commands
|
// NOTE: this routine is used also by dedicated raise and lower commands
|
||||||
if( Train->mvOccupied->PantSwitchType == "impulse" ) {
|
if( Train->mvOccupied->PantSwitchType == "impulse" ) {
|
||||||
@@ -1825,20 +1823,19 @@ void TTrain::OnCommand_pantographtogglefront( TTrain *Train, command_data const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TTrain::OnCommand_pantographtogglerear( TTrain *Train, command_data const &cmd ) {
|
void TTrain::OnCommand_pantographtogglerear( TTrain *Train, command_data const &cmd ) {
|
||||||
command_data Command = cmd;
|
|
||||||
|
|
||||||
if( Command.action == GLFW_PRESS ) {
|
if( cmd.action == GLFW_PRESS ) {
|
||||||
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||||
if( false == Train->mvControlled->PantRearUp ) {
|
if( false == Train->mvControlled->PantRearUp ) {
|
||||||
// turn on...
|
// turn on...
|
||||||
OnCommand_pantographraiserear( Train, Command );
|
OnCommand_pantographraiserear( Train, cmd );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// ...or turn off
|
// ...or turn off
|
||||||
OnCommand_pantographlowerrear( Train, Command );
|
OnCommand_pantographlowerrear( Train, cmd );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( Command.action == GLFW_RELEASE ) {
|
else if( cmd.action == GLFW_RELEASE ) {
|
||||||
// impulse switches return automatically to neutral position
|
// impulse switches return automatically to neutral position
|
||||||
// NOTE: this routine is used also by dedicated raise and lower commands
|
// NOTE: this routine is used also by dedicated raise and lower commands
|
||||||
if( Train->mvOccupied->PantSwitchType == "impulse" ) {
|
if( Train->mvOccupied->PantSwitchType == "impulse" ) {
|
||||||
@@ -5003,32 +5000,38 @@ void TTrain::OnCommand_cabchangebackward( TTrain *Train, command_data const &Com
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTrain::OnCommand_vehiclemove(TTrain *Train, const command_data &Command) {
|
void TTrain::vehiclemove(float distance) {
|
||||||
if (Command.action == GLFW_RELEASE || !DebugModeFlag)
|
TDynamicObject *d = DynamicObject;
|
||||||
return;
|
|
||||||
|
|
||||||
TDynamicObject *d = Train->DynamicObject;
|
|
||||||
while( d ) {
|
while( d ) {
|
||||||
d->Move( Command.param1 * d->DirectionGet() );
|
d->Move( distance * d->DirectionGet() );
|
||||||
d = d->Next(); // pozostałe też
|
d = d->Next(); // pozostałe też
|
||||||
}
|
}
|
||||||
d = Train->DynamicObject->Prev();
|
d = DynamicObject->Prev();
|
||||||
while( d ) {
|
while( d ) {
|
||||||
d->Move( Command.param1 * d->DirectionGet() );
|
d->Move( distance * d->DirectionGet() );
|
||||||
d = d->Prev(); // w drugą stronę też
|
d = d->Prev(); // w drugą stronę też
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_vehiclemove(TTrain *Train, const command_data &Command) {
|
||||||
|
if (Command.action == GLFW_RELEASE || !DebugModeFlag)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Train->vehiclemove(Command.param1);
|
||||||
|
}
|
||||||
|
|
||||||
void TTrain::OnCommand_vehiclemoveforwards(TTrain *Train, const command_data &Command) {
|
void TTrain::OnCommand_vehiclemoveforwards(TTrain *Train, const command_data &Command) {
|
||||||
command_data modified = Command;
|
if (Command.action == GLFW_RELEASE || !DebugModeFlag)
|
||||||
modified.param1 = 100.0;
|
return;
|
||||||
OnCommand_vehiclemove(Train, modified);
|
|
||||||
|
Train->vehiclemove(100.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTrain::OnCommand_vehiclemovebackwards(TTrain *Train, const command_data &Command) {
|
void TTrain::OnCommand_vehiclemovebackwards(TTrain *Train, const command_data &Command) {
|
||||||
command_data modified = Command;
|
if (Command.action == GLFW_RELEASE || !DebugModeFlag)
|
||||||
modified.param1 = -100.0;
|
return;
|
||||||
OnCommand_vehiclemove(Train, modified);
|
|
||||||
|
Train->vehiclemove(-100.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTrain::OnCommand_vehicleboost(TTrain *Train, const command_data &Command) {
|
void TTrain::OnCommand_vehicleboost(TTrain *Train, const command_data &Command) {
|
||||||
|
|||||||
2
Train.h
2
Train.h
@@ -353,6 +353,8 @@ class TTrain
|
|||||||
static void OnCommand_vehiclemovebackwards( TTrain *Train, command_data const &Command );
|
static void OnCommand_vehiclemovebackwards( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_vehicleboost( TTrain *Train, command_data const &Command );
|
static void OnCommand_vehicleboost( TTrain *Train, command_data const &Command );
|
||||||
|
|
||||||
|
void vehiclemove(float distance);
|
||||||
|
|
||||||
|
|
||||||
// members
|
// members
|
||||||
TDynamicObject *DynamicObject { nullptr }; // przestawia zmiana pojazdu [F5]
|
TDynamicObject *DynamicObject { nullptr }; // przestawia zmiana pojazdu [F5]
|
||||||
|
|||||||
@@ -244,6 +244,8 @@ commanddescription_sequence Commands_descriptions = {
|
|||||||
{ "entervehicle", command_target::simulation, command_mode::oneoff },
|
{ "entervehicle", command_target::simulation, command_mode::oneoff },
|
||||||
{ "queueevent", command_target::simulation, command_mode::oneoff },
|
{ "queueevent", command_target::simulation, command_mode::oneoff },
|
||||||
{ "setlight", command_target::simulation, command_mode::oneoff },
|
{ "setlight", command_target::simulation, command_mode::oneoff },
|
||||||
|
{ "insertmodel", command_target::simulation, command_mode::oneoff },
|
||||||
|
{ "deletemodel", command_target::simulation, command_mode::oneoff },
|
||||||
};
|
};
|
||||||
|
|
||||||
} // simulation
|
} // simulation
|
||||||
@@ -332,7 +334,7 @@ void command_queue::push_commands(const commands_map &commands) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
command_relay::post(user_command const Command, double const Param1, double const Param2,
|
command_relay::post(user_command const Command, double const Param1, double const Param2,
|
||||||
int const Action, uint16_t Recipient, glm::vec3 Position) const {
|
int const Action, uint16_t Recipient, glm::vec3 Position, const std::string *Payload) const {
|
||||||
|
|
||||||
auto const &command = simulation::Commands_descriptions[ static_cast<std::size_t>( Command ) ];
|
auto const &command = simulation::Commands_descriptions[ static_cast<std::size_t>( Command ) ];
|
||||||
|
|
||||||
@@ -356,6 +358,8 @@ command_relay::post(user_command const Command, double const Param1, double cons
|
|||||||
|
|
||||||
uint32_t combined_recipient = static_cast<uint32_t>( command.target ) | Recipient;
|
uint32_t combined_recipient = static_cast<uint32_t>( command.target ) | Recipient;
|
||||||
command_data commanddata({Command, Action, Param1, Param2, Timer::GetDeltaTime(), FreeFlyModeFlag, Position });
|
command_data commanddata({Command, Action, Param1, Param2, Timer::GetDeltaTime(), FreeFlyModeFlag, Position });
|
||||||
|
if (Payload)
|
||||||
|
commanddata.payload = *Payload;
|
||||||
|
|
||||||
simulation::Commands.push(commanddata, combined_recipient);
|
simulation::Commands.push(commanddata, combined_recipient);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -238,6 +238,8 @@ enum class user_command {
|
|||||||
entervehicle,
|
entervehicle,
|
||||||
queueevent,
|
queueevent,
|
||||||
setlight,
|
setlight,
|
||||||
|
insertmodel,
|
||||||
|
deletemodel,
|
||||||
|
|
||||||
none = -1
|
none = -1
|
||||||
};
|
};
|
||||||
@@ -278,6 +280,8 @@ struct command_data {
|
|||||||
|
|
||||||
bool freefly;
|
bool freefly;
|
||||||
glm::vec3 location;
|
glm::vec3 location;
|
||||||
|
|
||||||
|
std::string payload;
|
||||||
};
|
};
|
||||||
|
|
||||||
// command_queues: collects and holds commands from input sources, for processing by their intended recipients
|
// command_queues: collects and holds commands from input sources, for processing by their intended recipients
|
||||||
@@ -363,7 +367,7 @@ public:
|
|||||||
// posts specified command for the specified recipient
|
// posts specified command for the specified recipient
|
||||||
void
|
void
|
||||||
post(user_command const Command, double const Param1, double const Param2,
|
post(user_command const Command, double const Param1, double const Param2,
|
||||||
int const Action, uint16_t Recipient, glm::vec3 Position = glm::vec3(0.0f) ) const;
|
int const Action, uint16_t Recipient, glm::vec3 Position = glm::vec3(0.0f) , const std::string *Payload = nullptr) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -644,7 +644,7 @@ driver_mode::OnKeyDown(int cKey) {
|
|||||||
// z [Shift] uruchomienie eventu
|
// z [Shift] uruchomienie eventu
|
||||||
if( ( false == Global.iPause ) // podczas pauzy klawisze nie działają
|
if( ( false == Global.iPause ) // podczas pauzy klawisze nie działają
|
||||||
&& ( KeyEvents[ i ] != nullptr ) ) {
|
&& ( KeyEvents[ i ] != nullptr ) ) {
|
||||||
m_relay.post(user_command::queueevent, (double)simulation::Events.GetEventId(KeyEvents[i]), 0.0, GLFW_PRESS, 0);
|
m_relay.post(user_command::queueevent, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &KeyEvents[i]->name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( Global.ctrlState ) {
|
else if( Global.ctrlState ) {
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ OnCommandGet(multiplayer::DaneRozkaz *pRozkaz)
|
|||||||
|| ( event->m_sibling != 0 ) ) {
|
|| ( event->m_sibling != 0 ) ) {
|
||||||
// tylko jawne albo niejawne Multiple
|
// tylko jawne albo niejawne Multiple
|
||||||
command_relay relay;
|
command_relay relay;
|
||||||
relay.post(user_command::queueevent, (double)simulation::Events.GetEventId(event), 0.0, GLFW_PRESS, 0);
|
relay.post(user_command::queueevent, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &event->name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ void ::network::request_command::serialize(std::ostream &stream) const
|
|||||||
|
|
||||||
sn_utils::s_bool(stream, data.freefly);
|
sn_utils::s_bool(stream, data.freefly);
|
||||||
sn_utils::s_vec3(stream, data.location);
|
sn_utils::s_vec3(stream, data.location);
|
||||||
|
|
||||||
|
sn_utils::s_str(stream, data.payload);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -67,6 +69,8 @@ void network::request_command::deserialize(std::istream &stream)
|
|||||||
data.freefly = sn_utils::d_bool(stream);
|
data.freefly = sn_utils::d_bool(stream);
|
||||||
data.location = sn_utils::d_vec3(stream);
|
data.location = sn_utils::d_vec3(stream);
|
||||||
|
|
||||||
|
data.payload = sn_utils::d_str(stream);
|
||||||
|
|
||||||
sequence.emplace_back(data);
|
sequence.emplace_back(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -656,9 +656,9 @@ basic_cell::launch_event( TEventLauncher *Launcher, bool local_only ) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Global.shiftState && Launcher->Event2 != nullptr)
|
if (Global.shiftState && Launcher->Event2 != nullptr)
|
||||||
m_relay.post(user_command::queueevent, (double)simulation::Events.GetEventId(Launcher->Event2), 0.0, GLFW_PRESS, 0);
|
m_relay.post(user_command::queueevent, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &Launcher->Event2->name());
|
||||||
else if (Launcher->Event1)
|
else if (Launcher->Event1)
|
||||||
m_relay.post(user_command::queueevent, (double)simulation::Events.GetEventId(Launcher->Event1), 0.0, GLFW_PRESS, 0);
|
m_relay.post(user_command::queueevent, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &Launcher->Event1->name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -130,16 +130,17 @@ void state_manager::process_commands() {
|
|||||||
|
|
||||||
if (commanddata.command == user_command::queueevent) {
|
if (commanddata.command == user_command::queueevent) {
|
||||||
uint32_t id = std::round(commanddata.param1);
|
uint32_t id = std::round(commanddata.param1);
|
||||||
basic_event *ev = Events.FindEventById(id); // TODO: depends on vector position
|
basic_event *ev = Events.FindEvent(commanddata.payload);
|
||||||
|
if (ev)
|
||||||
Events.AddToQuery(ev, nullptr);
|
Events.AddToQuery(ev, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commanddata.command == user_command::setlight) {
|
if (commanddata.command == user_command::setlight) {
|
||||||
uint32_t id = commanddata.action;
|
|
||||||
int light = std::round(commanddata.param1);
|
int light = std::round(commanddata.param1);
|
||||||
float state = commanddata.param2;
|
float state = commanddata.param2;
|
||||||
if (id < simulation::Instances.sequence().size())
|
TAnimModel *model = simulation::Instances.find(commanddata.payload);
|
||||||
simulation::Instances.sequence()[id]->LightSet(light, state); // TODO: depends on vector position
|
if (model)
|
||||||
|
model->LightSet(light, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commanddata.command == user_command::setdatetime) {
|
if (commanddata.command == user_command::setdatetime) {
|
||||||
@@ -161,6 +162,21 @@ void state_manager::process_commands() {
|
|||||||
Global.AirTemperature = commanddata.param1;
|
Global.AirTemperature = commanddata.param1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (commanddata.command == user_command::insertmodel) {
|
||||||
|
std::istringstream ss(commanddata.payload);
|
||||||
|
|
||||||
|
std::string name;
|
||||||
|
std::string data;
|
||||||
|
std::getline(ss, name, ':');
|
||||||
|
std::getline(ss, data, ':');
|
||||||
|
|
||||||
|
simulation::State.create_model(data, name, commanddata.location);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (commanddata.command == user_command::deletemodel) {
|
||||||
|
simulation::State.delete_model(simulation::Instances.find(commanddata.payload));
|
||||||
|
}
|
||||||
|
|
||||||
if (DebugModeFlag) {
|
if (DebugModeFlag) {
|
||||||
if (commanddata.command == user_command::timejump) {
|
if (commanddata.command == user_command::timejump) {
|
||||||
Time.update(commanddata.param1);
|
Time.update(commanddata.param1);
|
||||||
|
|||||||
@@ -384,8 +384,7 @@ void ui::semaphore_window::render_content()
|
|||||||
if (level >= 3.0f)
|
if (level >= 3.0f)
|
||||||
level = 0.0f;
|
level = 0.0f;
|
||||||
|
|
||||||
int id = simulation::Instances.find_id(model->name());
|
m_relay.post(user_command::setlight, (double)i, level, GLFW_PRESS, 0, glm::vec3(0.0f), &model->name());
|
||||||
m_relay.post(user_command::setlight, (double)i, level, id, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::PopStyleColor(2);
|
ImGui::PopStyleColor(2);
|
||||||
@@ -407,7 +406,7 @@ void ui::semaphore_window::render_content()
|
|||||||
|
|
||||||
if (ImGui::Button(displayname.c_str()))
|
if (ImGui::Button(displayname.c_str()))
|
||||||
{
|
{
|
||||||
m_relay.post(user_command::queueevent, (double)simulation::Events.GetEventId(item), 0.0, GLFW_PRESS, 0);
|
m_relay.post(user_command::queueevent, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &item->name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -420,13 +419,13 @@ void ui::switch_window::render_content()
|
|||||||
|
|
||||||
if (ImGui::Button(LOC_STR(map_straight)))
|
if (ImGui::Button(LOC_STR(map_straight)))
|
||||||
{
|
{
|
||||||
m_relay.post(user_command::queueevent, (double)simulation::Events.GetEventId(m_switch->straight_event), 0.0, GLFW_PRESS, 0);
|
m_relay.post(user_command::queueevent, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &m_switch->straight_event->name());
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Button(LOC_STR(map_divert)))
|
if (ImGui::Button(LOC_STR(map_divert)))
|
||||||
{
|
{
|
||||||
m_relay.post(user_command::queueevent, (double)simulation::Events.GetEventId(m_switch->divert_event), 0.0, GLFW_PRESS, 0);
|
m_relay.post(user_command::queueevent, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &m_switch->divert_event->name());
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -467,12 +466,13 @@ void ui::obstacle_insert_window::render_content()
|
|||||||
{
|
{
|
||||||
std::string name("obstacle_" + std::to_string(LocalRandom(0.0, 100000.0)));
|
std::string name("obstacle_" + std::to_string(LocalRandom(0.0, 100000.0)));
|
||||||
|
|
||||||
TAnimModel *cloned = simulation::State.create_model(entry.second, name, m_position);
|
std::string payload(name + ':' + entry.second);
|
||||||
|
m_relay.post(user_command::insertmodel, 0.0, 0.0, GLFW_PRESS, 0, m_position, &payload);
|
||||||
|
|
||||||
auto obstacle = std::make_shared<map::obstacle>();
|
auto obstacle = std::make_shared<map::obstacle>();
|
||||||
obstacle->name = entry.first;
|
obstacle->name = entry.first;
|
||||||
obstacle->location = m_position;
|
obstacle->location = m_position;
|
||||||
obstacle->model = cloned;
|
obstacle->model_name = name;
|
||||||
map::Objects.entries.push_back(std::move(obstacle));
|
map::Objects.entries.push_back(std::move(obstacle));
|
||||||
|
|
||||||
std::vector<gfx::basic_vertex> vertices;
|
std::vector<gfx::basic_vertex> vertices;
|
||||||
@@ -490,7 +490,7 @@ ui::obstacle_remove_window::obstacle_remove_window(ui_panel &panel, std::shared_
|
|||||||
void ui::obstacle_remove_window::render_content()
|
void ui::obstacle_remove_window::render_content()
|
||||||
{
|
{
|
||||||
if (ImGui::Button(LOC_STR(map_obstacle_remove))) {
|
if (ImGui::Button(LOC_STR(map_obstacle_remove))) {
|
||||||
simulation::State.delete_model(m_obstacle->model);
|
m_relay.post(user_command::deletemodel, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(), &m_obstacle->model_name);
|
||||||
|
|
||||||
auto &entries = map::Objects.entries;
|
auto &entries = map::Objects.entries;
|
||||||
for (auto it = entries.rbegin(); it != entries.rend(); it++) {
|
for (auto it = entries.rbegin(); it != entries.rend(); it++) {
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ class obstacle_insert_window : public popup
|
|||||||
{
|
{
|
||||||
glm::dvec3 m_position;
|
glm::dvec3 m_position;
|
||||||
std::vector<std::pair<std::string, std::string>> m_obstacles;
|
std::vector<std::pair<std::string, std::string>> m_obstacles;
|
||||||
|
command_relay m_relay;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
obstacle_insert_window(ui_panel &panel, glm::dvec3 const &pos);
|
obstacle_insert_window(ui_panel &panel, glm::dvec3 const &pos);
|
||||||
@@ -56,6 +57,7 @@ class obstacle_insert_window : public popup
|
|||||||
class obstacle_remove_window : public popup
|
class obstacle_remove_window : public popup
|
||||||
{
|
{
|
||||||
std::shared_ptr<map::obstacle> m_obstacle;
|
std::shared_ptr<map::obstacle> m_obstacle;
|
||||||
|
command_relay m_relay;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
obstacle_remove_window(ui_panel &panel, std::shared_ptr<map::obstacle> &&obstacle);
|
obstacle_remove_window(ui_panel &panel, std::shared_ptr<map::obstacle> &&obstacle);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ struct track_switch : public map_object
|
|||||||
// training obstacle description
|
// training obstacle description
|
||||||
struct obstacle : public map_object
|
struct obstacle : public map_object
|
||||||
{
|
{
|
||||||
TAnimModel *model;
|
std::string model_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct objects
|
struct objects
|
||||||
|
|||||||
5
widgets/trainingcontrol.cpp
Normal file
5
widgets/trainingcontrol.cpp
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#include "widgets/trainingcontrol.h"
|
||||||
|
|
||||||
|
void ui::trainingcontrol_panel::render_contents() {
|
||||||
|
|
||||||
|
}
|
||||||
10
widgets/trainingcontrol.h
Normal file
10
widgets/trainingcontrol.h
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#include "uilayer.h"
|
||||||
|
|
||||||
|
namespace ui
|
||||||
|
{
|
||||||
|
class trainingcontrol_panel : public ui_panel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void render_contents() override;
|
||||||
|
};
|
||||||
|
} // namespace ui
|
||||||
Reference in New Issue
Block a user