mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 19:49:19 +02:00
Train number of train entering isolation in WM_COPYDATA
This commit is contained in:
@@ -310,6 +310,11 @@ global_settings::ConfigParse(cParser &Parser) {
|
|||||||
Parser.getTokens(1, false);
|
Parser.getTokens(1, false);
|
||||||
Parser >> iMultiplayer;
|
Parser >> iMultiplayer;
|
||||||
}
|
}
|
||||||
|
else if (token == "isolatedtrainnumber")
|
||||||
|
{
|
||||||
|
Parser.getTokens(1, false);
|
||||||
|
Parser >> bIsolatedTrainName;
|
||||||
|
}
|
||||||
else if (token == "maxtexturesize")
|
else if (token == "maxtexturesize")
|
||||||
{
|
{
|
||||||
// wymuszenie przeskalowania tekstur
|
// wymuszenie przeskalowania tekstur
|
||||||
@@ -1102,6 +1107,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
|
|||||||
export_as_text( Output, "feedbackmode", iFeedbackMode );
|
export_as_text( Output, "feedbackmode", iFeedbackMode );
|
||||||
export_as_text( Output, "feedbackport", iFeedbackPort );
|
export_as_text( Output, "feedbackport", iFeedbackPort );
|
||||||
export_as_text( Output, "multiplayer", iMultiplayer );
|
export_as_text( Output, "multiplayer", iMultiplayer );
|
||||||
|
export_as_text( Output, "isolatedtrainnumber", bIsolatedTrainName);
|
||||||
export_as_text( Output, "maxtexturesize", iMaxTextureSize );
|
export_as_text( Output, "maxtexturesize", iMaxTextureSize );
|
||||||
export_as_text( Output, "maxcabtexturesize", iMaxCabTextureSize );
|
export_as_text( Output, "maxcabtexturesize", iMaxCabTextureSize );
|
||||||
export_as_text( Output, "movelight", fMoveLight );
|
export_as_text( Output, "movelight", fMoveLight );
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ struct global_settings {
|
|||||||
#endif
|
#endif
|
||||||
// multiplayer
|
// multiplayer
|
||||||
int iMultiplayer{ 0 }; // blokada działania niektórych eventów na rzecz kominikacji
|
int iMultiplayer{ 0 }; // blokada działania niektórych eventów na rzecz kominikacji
|
||||||
|
bool bIsolatedTrainName{ false }; //wysyłanie zajęcia odcinka izolowanego z nazwą pociągu
|
||||||
// other
|
// other
|
||||||
std::string AppName{ "EU07" };
|
std::string AppName{ "EU07" };
|
||||||
std::string asVersion{ "UNKNOWN" }; // z opisem
|
std::string asVersion{ "UNKNOWN" }; // z opisem
|
||||||
|
|||||||
16
Track.cpp
16
Track.cpp
@@ -21,6 +21,7 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
#include "MemCell.h"
|
#include "MemCell.h"
|
||||||
#include "messaging.h"
|
#include "messaging.h"
|
||||||
#include "DynObj.h"
|
#include "DynObj.h"
|
||||||
|
#include "Driver.h"
|
||||||
#include "AnimModel.h"
|
#include "AnimModel.h"
|
||||||
#include "Track.h"
|
#include "Track.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
@@ -140,7 +141,20 @@ void TIsolated::Modify(int i, TDynamicObject *o)
|
|||||||
if (evBusy)
|
if (evBusy)
|
||||||
simulation::Events.AddToQuery(evBusy, o); // dodanie zajętości do kolejki
|
simulation::Events.AddToQuery(evBusy, o); // dodanie zajętości do kolejki
|
||||||
if (Global.iMultiplayer) // jeśli multiplayer
|
if (Global.iMultiplayer) // jeśli multiplayer
|
||||||
multiplayer::WyslijString(asName, 11); // wysłanie pakietu o zajęciu
|
{
|
||||||
|
auto const *owner = (
|
||||||
|
((o->Mechanik != nullptr) && (o->Mechanik->primary())) ?
|
||||||
|
o->Mechanik :
|
||||||
|
o->ctOwner);
|
||||||
|
auto textline = owner != nullptr ? Bezogonkow(owner->TrainName(), true) : "none";
|
||||||
|
if ("none" != textline && Global.bIsolatedTrainName) {
|
||||||
|
textline = ":" + Bezogonkow(owner->TrainName(), true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
textline = "";
|
||||||
|
}
|
||||||
|
multiplayer::WyslijString(asName+textline, 11); // wysłanie pakietu o zajęciu
|
||||||
|
}
|
||||||
if (pMemCell) // w powiązanej komórce
|
if (pMemCell) // w powiązanej komórce
|
||||||
pMemCell->UpdateValues( "", 0, int( pMemCell->Value2() ) | 1, basic_event::flags::value2 ); // zmieniamy ostatnią wartość na nieparzystą
|
pMemCell->UpdateValues( "", 0, int( pMemCell->Value2() ) | 1, basic_event::flags::value2 ); // zmieniamy ostatnią wartość na nieparzystą
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user