16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 01:59:19 +02:00

build 210324. event queue text filter enhancement, contextual uncoupling sounds, parameter support for python screens, radio and odometer state exposed to python scripts, configurable audio volume when paused, skydome color calculation tweak, fog color calculation tweak, doorstep cab control enhancement, tempomat cab control enhancement, pantograph selector preset list support, minor bug fixes

This commit is contained in:
tmj-fstate
2021-03-24 22:00:23 +01:00
parent c8169fa1ee
commit 195b7cb17b
17 changed files with 383 additions and 202 deletions

View File

@@ -249,6 +249,9 @@ bool TDynamicObject::destination_data::deserialize_mapping( cParser &Input ) {
else if( key == "parameters:" ) {
parameters = Input.getToken<std::string>();
}
else if( key == "background:" ) {
background = Input.getToken<std::string>();
}
return true;
}
@@ -4648,31 +4651,47 @@ void TDynamicObject::RenderSounds() {
}
}
// attach/detach sounds
if( ( coupler.sounds & sound::attachcoupler ) != 0 ) {
couplersounds.attach_coupler.play();
if( ( coupler.sounds & sound::detach ) == 0 ) {
// potentially added some couplings
if( ( coupler.sounds & sound::attachcoupler ) != 0 ) {
couplersounds.attach_coupler.play();
}
if( ( coupler.sounds & sound::attachbrakehose ) != 0 ) {
couplersounds.attach_brakehose.play();
}
if( ( coupler.sounds & sound::attachmainhose ) != 0 ) {
couplersounds.attach_mainhose.play();
}
if( ( coupler.sounds & sound::attachcontrol ) != 0 ) {
couplersounds.attach_control.play();
}
if( ( coupler.sounds & sound::attachgangway ) != 0 ) {
couplersounds.attach_gangway.play();
}
if( ( coupler.sounds & sound::attachheating ) != 0 ) {
couplersounds.attach_heating.play();
}
}
if( ( coupler.sounds & sound::attachbrakehose ) != 0 ) {
couplersounds.attach_brakehose.play();
}
if( ( coupler.sounds & sound::attachmainhose ) != 0 ) {
couplersounds.attach_mainhose.play();
}
if( ( coupler.sounds & sound::attachcontrol ) != 0 ) {
couplersounds.attach_control.play();
}
if( ( coupler.sounds & sound::attachgangway ) != 0 ) {
couplersounds.attach_gangway.play();
}
if( ( coupler.sounds & sound::attachheating ) != 0 ) {
couplersounds.attach_heating.play();
}
if( true == TestFlag( coupler.sounds, sound::detachall ) ) {
couplersounds.detach_coupler.play();
couplersounds.detach_brakehose.play();
couplersounds.detach_mainhose.play();
couplersounds.detach_control.play();
couplersounds.detach_gangway.play();
couplersounds.detach_heating.play();
else {
// potentially removed some couplings
if( ( coupler.sounds & sound::attachcoupler ) != 0 ) {
couplersounds.detach_coupler.play();
}
if( ( coupler.sounds & sound::attachbrakehose ) != 0 ) {
couplersounds.detach_brakehose.play();
}
if( ( coupler.sounds & sound::attachmainhose ) != 0 ) {
couplersounds.detach_mainhose.play();
}
if( ( coupler.sounds & sound::attachcontrol ) != 0 ) {
couplersounds.detach_control.play();
}
if( ( coupler.sounds & sound::attachgangway ) != 0 ) {
couplersounds.detach_gangway.play();
}
if( ( coupler.sounds & sound::attachheating ) != 0 ) {
couplersounds.detach_heating.play();
}
}
if( true == TestFlag( coupler.sounds, sound::attachadapter ) ) {
couplersounds.dsbAdapterAttach.play();
@@ -5992,12 +6011,15 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
// vehicle faces +Z in 'its' space, for motor locations negative value means ahead of centre
auto const offset { std::atof( token.c_str() ) * -1.f };
// NOTE: we skip setting owner of the sounds, it'll be done during individual sound deserialization
sound_source motor { sound_placement::external }; // generally traction motor
sound_source motor { sound_placement::external }; // generic traction motor sounds
sound_source acmotor { sound_placement::external }; // inverter-specific traction motor sounds
sound_source motorblower { sound_placement::engine }; // associated motor blowers
// add entry to the list
auto const location { glm::vec3 { 0.f, 0.f, offset } };
motor.offset( location );
m_powertrainsounds.motors.emplace_back( motor );
acmotor.offset( location );
m_powertrainsounds.acmotors.emplace_back( acmotor );
motorblower.offset( location );
m_powertrainsounds.motorblowers.emplace_back( motorblower );
}
@@ -6344,6 +6366,7 @@ void TDynamicObject::LoadMMediaFile( std::string const &TypeName, std::string co
DestinationSign.script = asBaseDir + DestinationSign.script;
}
}
// NOTE: legacy key, now expected as optional "background:" parameter in pydestinationsign: { parameter block }
else if( token == "destinationsignbackground:" ) {
parser.getTokens();
parser >> DestinationSign.background;