mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-14 02:33:51 +02:00
Capture events in chat box
This commit is contained in:
parent
d695d87b99
commit
213d0c3553
@ -327,6 +327,11 @@ CChatBox::CChatBox(const Rect & rect)
|
|||||||
chatHistory->label->color = Colors::GREEN;
|
chatHistory->label->color = Colors::GREEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CChatBox::captureThisKey(EShortcut key)
|
||||||
|
{
|
||||||
|
return !inputBox->getText().empty() && key == EShortcut::GLOBAL_ACCEPT;
|
||||||
|
}
|
||||||
|
|
||||||
void CChatBox::keyPressed(EShortcut key)
|
void CChatBox::keyPressed(EShortcut key)
|
||||||
{
|
{
|
||||||
if(key == EShortcut::GLOBAL_ACCEPT && inputBox->getText().size())
|
if(key == EShortcut::GLOBAL_ACCEPT && inputBox->getText().size())
|
||||||
|
@ -122,6 +122,7 @@ public:
|
|||||||
CChatBox(const Rect & rect);
|
CChatBox(const Rect & rect);
|
||||||
|
|
||||||
void keyPressed(EShortcut key) override;
|
void keyPressed(EShortcut key) override;
|
||||||
|
bool captureThisKey(EShortcut key) override;
|
||||||
void addNewMessage(const std::string & text);
|
void addNewMessage(const std::string & text);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user