16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-20 12:39:17 +02:00

build 171102: mouse support for light preset switch, vehicle lights cab indicators

This commit is contained in:
tmj-fstate
2017-11-02 21:51:44 +01:00
parent 3456fbd651
commit da11e689ce
10 changed files with 226 additions and 261 deletions

View File

@@ -872,7 +872,12 @@ basic_region::update_traction( TDynamicObject *Vehicle, int const Pantographinde
void
basic_region::serialize( std::string const &Scenariofile ) const {
auto filename { Global::asCurrentSceneryPath + Scenariofile };
auto filename { Scenariofile };
if( filename[ 0 ] == '$' ) {
// trim leading $ char rainsted utility may add to the base name for modified .scn files
filename.erase( 0, 1 );
}
filename = Global::asCurrentSceneryPath + filename;
if( ( filename.rfind( '.' ) != std::string::npos )
&& ( filename.rfind( '.' ) != filename.rfind( ".." ) + 1 ) ) {
// trim extension, it's typically going to be for different file type
@@ -910,7 +915,12 @@ basic_region::serialize( std::string const &Scenariofile ) const {
bool
basic_region::deserialize( std::string const &Scenariofile ) {
auto filename { Global::asCurrentSceneryPath + Scenariofile };
auto filename { Scenariofile };
if( filename[ 0 ] == '$' ) {
// trim leading $ char rainsted utility may add to the base name for modified .scn files
filename.erase( 0, 1 );
}
filename = Global::asCurrentSceneryPath + filename;
if( ( filename.rfind( '.' ) != std::string::npos )
&& ( filename.rfind( '.' ) != filename.rfind( ".." ) + 1 ) ) {
// trim extension, it's typically going to be for different file type