mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
key binding lookup, ai vehicle activation delay
This commit is contained in:
@@ -83,10 +83,10 @@ driver_mode::drivermode_input::init() {
|
||||
}
|
||||
|
||||
std::string
|
||||
driver_mode::drivermode_input::command_hints( std::pair<user_command, user_command> const &Commands ) const {
|
||||
driver_mode::drivermode_input::binding_hints( std::pair<user_command, user_command> const &Commands ) const {
|
||||
|
||||
auto const inputhintleft { keyboard.mapping( Commands.first ) };
|
||||
auto const inputhintright { keyboard.mapping( Commands.second ) };
|
||||
auto const inputhintleft { keyboard.binding_hint( Commands.first ) };
|
||||
auto const inputhintright { keyboard.binding_hint( Commands.second ) };
|
||||
std::string inputhints =
|
||||
inputhintleft
|
||||
+ ( inputhintright.empty() ? "" :
|
||||
@@ -296,14 +296,14 @@ driver_mode::update() {
|
||||
// in regular mode show control functions, for defined controls
|
||||
auto const controlname { train->GetLabel( GfxRenderer->Pick_Control() ) };
|
||||
if( false == controlname.empty() ) {
|
||||
auto const bindings { m_input.mouse.bindings( controlname ) };
|
||||
auto inputhints { m_input.command_hints( bindings ) };
|
||||
auto const mousecommands { m_input.mouse.bindings( controlname ) };
|
||||
auto inputhints { m_input.binding_hints( mousecommands ) };
|
||||
// if the commands bound with the control don't have any assigned keys try potential fallbacks
|
||||
if( inputhints.empty() ) {
|
||||
inputhints = m_input.command_hints( m_input.command_fallback( bindings.first ) );
|
||||
inputhints = m_input.binding_hints( m_input.command_fallback( mousecommands.first ) );
|
||||
}
|
||||
if( inputhints.empty() ) {
|
||||
inputhints = m_input.command_hints( m_input.command_fallback( bindings.second ) );
|
||||
inputhints = m_input.binding_hints( m_input.command_fallback( mousecommands.second ) );
|
||||
}
|
||||
// ready or not, here we go
|
||||
if( inputhints.empty() ) {
|
||||
@@ -411,6 +411,13 @@ driver_mode::exit() {
|
||||
|
||||
}
|
||||
|
||||
// provides key code associated with specified command
|
||||
int
|
||||
driver_mode::key_binding( user_command const Command ) const {
|
||||
|
||||
return m_input.keyboard.binding( Command );
|
||||
}
|
||||
|
||||
void
|
||||
driver_mode::on_key( int const Key, int const Scancode, int const Action, int const Mods ) {
|
||||
|
||||
@@ -496,7 +503,7 @@ driver_mode::on_event_poll() {
|
||||
}
|
||||
|
||||
bool
|
||||
driver_mode::is_command_processor() {
|
||||
driver_mode::is_command_processor() const {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user