Allow to use emoji ingame
This commit is contained in:
parent
d6aa111f16
commit
d0fac726d3
@ -3,8 +3,10 @@
|
|||||||
<div x="2%" y="5%" width="96%" height="90%" layout="vertical-row" >
|
<div x="2%" y="5%" width="96%" height="90%" layout="vertical-row" >
|
||||||
<div x="1%" width="98%" height="fit" layout="horizontal-row">
|
<div x="1%" width="98%" height="fit" layout="horizontal-row">
|
||||||
<textbox id="chat" proportion="1"/>
|
<textbox id="chat" proportion="1"/>
|
||||||
<spacer width="3%" height="10"/>
|
<spacer width="2%" height="10"/>
|
||||||
<button id="send" width="20%" height="fit" align="center" I18N="In the network lobby" text="Send"/>
|
<button id="send" width="10%" height="fit" align="center" text=""/>
|
||||||
|
<spacer width="1%" height="10"/>
|
||||||
|
<button id="emoji" width="10%" height="fit" align="center" text=""/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<spacer width="20" height="2%" />
|
<spacer width="20" height="2%" />
|
@ -22,8 +22,10 @@
|
|||||||
#include "audio/music_manager.hpp"
|
#include "audio/music_manager.hpp"
|
||||||
#include "audio/sfx_manager.hpp"
|
#include "audio/sfx_manager.hpp"
|
||||||
#include "config/user_config.hpp"
|
#include "config/user_config.hpp"
|
||||||
|
#include "guiengine/emoji_keyboard.hpp"
|
||||||
#include "guiengine/engine.hpp"
|
#include "guiengine/engine.hpp"
|
||||||
#include "guiengine/scalable_font.hpp"
|
#include "guiengine/scalable_font.hpp"
|
||||||
|
#include "guiengine/widgets/CGUIEditBox.hpp"
|
||||||
#include "guiengine/widgets/icon_button_widget.hpp"
|
#include "guiengine/widgets/icon_button_widget.hpp"
|
||||||
#include "guiengine/widgets/ribbon_widget.hpp"
|
#include "guiengine/widgets/ribbon_widget.hpp"
|
||||||
#include "io/file_manager.hpp"
|
#include "io/file_manager.hpp"
|
||||||
@ -64,7 +66,7 @@ RacePausedDialog::RacePausedDialog(const float percentWidth,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
loadFromFile("network_ingame_dialog.stkgui");
|
loadFromFile("online/network_ingame_dialog.stkgui");
|
||||||
}
|
}
|
||||||
|
|
||||||
GUIEngine::RibbonWidget* back_btn = getWidget<RibbonWidget>("backbtnribbon");
|
GUIEngine::RibbonWidget* back_btn = getWidget<RibbonWidget>("backbtnribbon");
|
||||||
@ -76,16 +78,22 @@ RacePausedDialog::RacePausedDialog(const float percentWidth,
|
|||||||
SFXManager::get()->pauseAll();
|
SFXManager::get()->pauseAll();
|
||||||
m_text_box->clearListeners();
|
m_text_box->clearListeners();
|
||||||
m_text_box->setTextBoxType(TBT_CAP_SENTENCES);
|
m_text_box->setTextBoxType(TBT_CAP_SENTENCES);
|
||||||
|
// Unicode enter arrow
|
||||||
|
getWidget("send")->setText(L"\u21B2");
|
||||||
|
// Unicode smile emoji
|
||||||
|
getWidget("emoji")->setText(L"\u263A");
|
||||||
if (UserConfigParams::m_lobby_chat)
|
if (UserConfigParams::m_lobby_chat)
|
||||||
{
|
{
|
||||||
m_text_box->setActive(true);
|
m_text_box->setActive(true);
|
||||||
getWidget("send")->setVisible(true);
|
getWidget("send")->setVisible(true);
|
||||||
|
getWidget("emoji")->setVisible(true);
|
||||||
m_text_box->addListener(this);
|
m_text_box->addListener(this);
|
||||||
auto cl = LobbyProtocol::get<ClientLobby>();
|
auto cl = LobbyProtocol::get<ClientLobby>();
|
||||||
if (cl && !cl->serverEnabledChat())
|
if (cl && !cl->serverEnabledChat())
|
||||||
{
|
{
|
||||||
m_text_box->setActive(false);
|
m_text_box->setActive(false);
|
||||||
getWidget("send")->setActive(false);
|
getWidget("send")->setActive(false);
|
||||||
|
getWidget("emoji")->setActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -94,6 +102,7 @@ RacePausedDialog::RacePausedDialog(const float percentWidth,
|
|||||||
m_text_box->setText(
|
m_text_box->setText(
|
||||||
_("Chat is disabled, enable in options menu."));
|
_("Chat is disabled, enable in options menu."));
|
||||||
getWidget("send")->setVisible(false);
|
getWidget("send")->setVisible(false);
|
||||||
|
getWidget("emoji")->setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -175,6 +184,14 @@ GUIEngine::EventPropagation
|
|||||||
onEnterPressed(m_text_box->getText());
|
onEnterPressed(m_text_box->getText());
|
||||||
return GUIEngine::EVENT_BLOCK;
|
return GUIEngine::EVENT_BLOCK;
|
||||||
}
|
}
|
||||||
|
else if (eventSource == "emoji" && m_text_box &&
|
||||||
|
!ScreenKeyboard::isActive())
|
||||||
|
{
|
||||||
|
EmojiKeyboard* ek = new EmojiKeyboard(1.0f, 0.40f,
|
||||||
|
m_text_box->getIrrlichtElement<CGUIEditBox>());
|
||||||
|
ek->init();
|
||||||
|
return GUIEngine::EVENT_BLOCK;
|
||||||
|
}
|
||||||
else if (eventSource == "backbtnribbon")
|
else if (eventSource == "backbtnribbon")
|
||||||
{
|
{
|
||||||
// unpausing is done in the destructor so nothing more to do here
|
// unpausing is done in the destructor so nothing more to do here
|
||||||
|
Loading…
x
Reference in New Issue
Block a user