Should be proper fix
dev-time-step
Krzysztof Dermont 2016-02-10 17:06:02 +01:00
parent 12e3724319
commit 8a0cda1c2a
4 changed files with 21 additions and 12 deletions

View File

@ -66,6 +66,7 @@ CInput::CInput()
{ INPUT_SLOT_CAMERA_UP, "camup" }, { INPUT_SLOT_CAMERA_UP, "camup" },
{ INPUT_SLOT_CAMERA_DOWN, "camdown" }, { INPUT_SLOT_CAMERA_DOWN, "camdown" },
{ INPUT_SLOT_PAUSE, "pause" }, { INPUT_SLOT_PAUSE, "pause" },
{ INPUT_SLOT_CMDLINE, "cmdline" },
}; };
m_kmodState = 0; m_kmodState = 0;
@ -275,6 +276,7 @@ void CInput::SetDefaultInputBindings()
m_inputBindings[INPUT_SLOT_CAMERA_DOWN].primary = KEY(PAGEDOWN); m_inputBindings[INPUT_SLOT_CAMERA_DOWN].primary = KEY(PAGEDOWN);
m_inputBindings[INPUT_SLOT_PAUSE].primary = KEY(PAUSE); m_inputBindings[INPUT_SLOT_PAUSE].primary = KEY(PAUSE);
m_inputBindings[INPUT_SLOT_PAUSE].secondary = KEY(p); m_inputBindings[INPUT_SLOT_PAUSE].secondary = KEY(p);
m_inputBindings[INPUT_SLOT_CMDLINE].primary = KEY(BACKQUOTE);
m_joyAxisBindings[JOY_AXIS_SLOT_X].axis = 0; m_joyAxisBindings[JOY_AXIS_SLOT_X].axis = 0;
m_joyAxisBindings[JOY_AXIS_SLOT_Y].axis = 1; m_joyAxisBindings[JOY_AXIS_SLOT_Y].axis = 1;

View File

@ -105,6 +105,7 @@ enum InputSlot
INPUT_SLOT_CAMERA_UP, INPUT_SLOT_CAMERA_UP,
INPUT_SLOT_CAMERA_DOWN, INPUT_SLOT_CAMERA_DOWN,
INPUT_SLOT_PAUSE, INPUT_SLOT_PAUSE,
INPUT_SLOT_CMDLINE,
INPUT_SLOT_MAX INPUT_SLOT_MAX
}; };

View File

@ -239,6 +239,7 @@ void InitializeRestext()
stringsEvent[EVENT_INTERFACE_KEY+INPUT_SLOT_CAMERA_UP] = TR("Camera up\\Increase camera angle while visiting message origin"); stringsEvent[EVENT_INTERFACE_KEY+INPUT_SLOT_CAMERA_UP] = TR("Camera up\\Increase camera angle while visiting message origin");
stringsEvent[EVENT_INTERFACE_KEY+INPUT_SLOT_CAMERA_DOWN] = TR("Camera down\\Decrease camera angle while visiting message origin"); stringsEvent[EVENT_INTERFACE_KEY+INPUT_SLOT_CAMERA_DOWN] = TR("Camera down\\Decrease camera angle while visiting message origin");
stringsEvent[EVENT_INTERFACE_KEY+INPUT_SLOT_PAUSE] = TR("Pause\\Pause the game without opening menu"); stringsEvent[EVENT_INTERFACE_KEY+INPUT_SLOT_PAUSE] = TR("Pause\\Pause the game without opening menu");
stringsEvent[EVENT_INTERFACE_KEY+INPUT_SLOT_CMDLINE] = TR("Cheat console\\Show cheat console");
stringsEvent[EVENT_INTERFACE_VOLSOUND] = TR("Sound effects:\\Volume of engines, voice, shooting, etc."); stringsEvent[EVENT_INTERFACE_VOLSOUND] = TR("Sound effects:\\Volume of engines, voice, shooting, etc.");
stringsEvent[EVENT_INTERFACE_VOLMUSIC] = TR("Background sound :\\Volume of audio tracks"); stringsEvent[EVENT_INTERFACE_VOLMUSIC] = TR("Background sound :\\Volume of audio tracks");

View File

@ -715,21 +715,25 @@ bool CRobotMain::ProcessEvent(Event &event)
} }
// Management of the console. // Management of the console.
if (event.type == EVENT_TEXT_INPUT && if (event.type == EVENT_KEY_DOWN)
event.GetData<TextInputData>()->text[0] == KEY(BACKQUOTE)) // Pause ?
{ {
if (m_phase != PHASE_PLAYER_SELECT && auto data = event.GetData<KeyEventData>();
!m_movie->IsExist() &&
!m_movieLock && !m_editLock && !m_cmdEdit) if (data->slot == INPUT_SLOT_CMDLINE)
{ {
Ui::CEdit* pe = static_cast<Ui::CEdit*>(m_interface->SearchControl(EVENT_CMD)); if (m_phase != PHASE_PLAYER_SELECT &&
if (pe == nullptr) return false; !m_movie->IsExist() &&
pe->SetState(Ui::STATE_VISIBLE); !m_movieLock && !m_editLock && !m_cmdEdit)
m_interface->SetFocus(pe); {
if (m_phase == PHASE_SIMUL) m_cmdEditPause = m_pause->ActivatePause(PAUSE_ENGINE); Ui::CEdit* pe = static_cast<Ui::CEdit*>(m_interface->SearchControl(EVENT_CMD));
m_cmdEdit = true; if (pe == nullptr) return false;
pe->SetState(Ui::STATE_VISIBLE);
m_interface->SetFocus(pe);
if (m_phase == PHASE_SIMUL) m_cmdEditPause = m_pause->ActivatePause(PAUSE_ENGINE);
m_cmdEdit = true;
}
return false;
} }
return false;
} }
if (event.type == EVENT_KEY_DOWN && if (event.type == EVENT_KEY_DOWN &&
@ -741,6 +745,7 @@ bool CRobotMain::ProcessEvent(Event &event)
pe->GetText(cmd, 50); pe->GetText(cmd, 50);
pe->SetText(""); pe->SetText("");
pe->ClearState(Ui::STATE_VISIBLE); pe->ClearState(Ui::STATE_VISIBLE);
m_interface->SetFocus(nullptr);
if (m_phase == PHASE_SIMUL) if (m_phase == PHASE_SIMUL)
{ {
m_pause->DeactivatePause(m_cmdEditPause); m_pause->DeactivatePause(m_cmdEditPause);