mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Use newer IrrlichtMt
now with SDL2
This commit is contained in:
parent
225aa107f6
commit
699d1bf27c
11 changed files with 20 additions and 26 deletions
|
@ -678,12 +678,8 @@ bool GUIChatConsole::OnEvent(const SEvent& event)
|
|||
if (!was_url_pressed
|
||||
&& event.MouseInput.Event == EMIE_MMOUSE_PRESSED_DOWN) {
|
||||
// Paste primary selection at cursor pos
|
||||
#if IRRLICHT_VERSION_MT_REVISION >= 11
|
||||
const c8 *text = Environment->getOSOperator()
|
||||
->getTextFromPrimarySelection();
|
||||
#else
|
||||
const c8 *text = nullptr;
|
||||
#endif
|
||||
if (text)
|
||||
prompt.input(utf8_to_wide(text));
|
||||
}
|
||||
|
@ -774,9 +770,7 @@ bool GUIChatConsole::weblinkClick(s32 col, s32 row)
|
|||
|
||||
void GUIChatConsole::updatePrimarySelection()
|
||||
{
|
||||
#if IRRLICHT_VERSION_MT_REVISION >= 11
|
||||
std::wstring wselected = m_chat_backend->getPrompt().getSelection();
|
||||
std::string selected = wide_to_utf8(wselected);
|
||||
Environment->getOSOperator()->copyToPrimarySelection(selected.c_str());
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -178,7 +178,6 @@ void GUIEditBox::setTextMarkers(s32 begin, s32 end)
|
|||
m_mark_begin = begin;
|
||||
m_mark_end = end;
|
||||
|
||||
#if IRRLICHT_VERSION_MT_REVISION >= 11
|
||||
if (!m_passwordbox && m_operator && m_mark_begin != m_mark_end) {
|
||||
// copy to primary selection
|
||||
const s32 realmbgn = m_mark_begin < m_mark_end ? m_mark_begin : m_mark_end;
|
||||
|
@ -187,7 +186,6 @@ void GUIEditBox::setTextMarkers(s32 begin, s32 end)
|
|||
std::string s = stringw_to_utf8(Text.subString(realmbgn, realmend - realmbgn));
|
||||
m_operator->copyToPrimarySelection(s.c_str());
|
||||
}
|
||||
#endif
|
||||
|
||||
sendGuiEvent(EGET_EDITBOX_MARKING_CHANGED);
|
||||
}
|
||||
|
@ -796,7 +794,6 @@ bool GUIEditBox::processMouse(const SEvent &event)
|
|||
m_mouse_marking = false;
|
||||
setTextMarkers(m_cursor_pos, m_cursor_pos);
|
||||
|
||||
#if IRRLICHT_VERSION_MT_REVISION >= 11
|
||||
// paste from the primary selection
|
||||
inputString([&] {
|
||||
if (!m_operator)
|
||||
|
@ -806,7 +803,6 @@ bool GUIEditBox::processMouse(const SEvent &event)
|
|||
return core::stringw();
|
||||
return utf8_to_stringw(inserted_text_utf8);
|
||||
}());
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue