parent
12e3724319
commit
8a0cda1c2a
|
@ -66,6 +66,7 @@ CInput::CInput()
|
|||
{ INPUT_SLOT_CAMERA_UP, "camup" },
|
||||
{ INPUT_SLOT_CAMERA_DOWN, "camdown" },
|
||||
{ INPUT_SLOT_PAUSE, "pause" },
|
||||
{ INPUT_SLOT_CMDLINE, "cmdline" },
|
||||
};
|
||||
|
||||
m_kmodState = 0;
|
||||
|
@ -275,6 +276,7 @@ void CInput::SetDefaultInputBindings()
|
|||
m_inputBindings[INPUT_SLOT_CAMERA_DOWN].primary = KEY(PAGEDOWN);
|
||||
m_inputBindings[INPUT_SLOT_PAUSE].primary = KEY(PAUSE);
|
||||
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_Y].axis = 1;
|
||||
|
|
|
@ -105,6 +105,7 @@ enum InputSlot
|
|||
INPUT_SLOT_CAMERA_UP,
|
||||
INPUT_SLOT_CAMERA_DOWN,
|
||||
INPUT_SLOT_PAUSE,
|
||||
INPUT_SLOT_CMDLINE,
|
||||
|
||||
INPUT_SLOT_MAX
|
||||
};
|
||||
|
|
|
@ -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_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_CMDLINE] = TR("Cheat console\\Show cheat console");
|
||||
|
||||
stringsEvent[EVENT_INTERFACE_VOLSOUND] = TR("Sound effects:\\Volume of engines, voice, shooting, etc.");
|
||||
stringsEvent[EVENT_INTERFACE_VOLMUSIC] = TR("Background sound :\\Volume of audio tracks");
|
||||
|
|
|
@ -715,21 +715,25 @@ bool CRobotMain::ProcessEvent(Event &event)
|
|||
}
|
||||
|
||||
// Management of the console.
|
||||
if (event.type == EVENT_TEXT_INPUT &&
|
||||
event.GetData<TextInputData>()->text[0] == KEY(BACKQUOTE)) // Pause ?
|
||||
if (event.type == EVENT_KEY_DOWN)
|
||||
{
|
||||
if (m_phase != PHASE_PLAYER_SELECT &&
|
||||
!m_movie->IsExist() &&
|
||||
!m_movieLock && !m_editLock && !m_cmdEdit)
|
||||
auto data = event.GetData<KeyEventData>();
|
||||
|
||||
if (data->slot == INPUT_SLOT_CMDLINE)
|
||||
{
|
||||
Ui::CEdit* pe = static_cast<Ui::CEdit*>(m_interface->SearchControl(EVENT_CMD));
|
||||
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;
|
||||
if (m_phase != PHASE_PLAYER_SELECT &&
|
||||
!m_movie->IsExist() &&
|
||||
!m_movieLock && !m_editLock && !m_cmdEdit)
|
||||
{
|
||||
Ui::CEdit* pe = static_cast<Ui::CEdit*>(m_interface->SearchControl(EVENT_CMD));
|
||||
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 &&
|
||||
|
@ -741,6 +745,7 @@ bool CRobotMain::ProcessEvent(Event &event)
|
|||
pe->GetText(cmd, 50);
|
||||
pe->SetText("");
|
||||
pe->ClearState(Ui::STATE_VISIBLE);
|
||||
m_interface->SetFocus(nullptr);
|
||||
if (m_phase == PHASE_SIMUL)
|
||||
{
|
||||
m_pause->DeactivatePause(m_cmdEditPause);
|
||||
|
|
Loading…
Reference in New Issue