NS/main/source/ui/ChatPanel.h

44 lines
1.1 KiB
C
Raw Normal View History

2014-12-16 13:36:27 +00:00
#ifndef CHAT_PANEL_H
#define CHAT_PANEL_H
#include <VGUI.h>
#include <VGUI_KeyCode.h>
#include <VGUI_Panel.h>
#include "vgui_defaultinputsignal.h"
#include "AvHFont.h"
#include <string>
2016-10-11 21:26:04 +00:00
#include <SDL2/SDL_events.h> //#define VK_ESCAPE 0x1B
#include <SDL2/SDL_keyboard.h> //#define VK_RETURN 0x0D
#include <SDL2/SDL_keycode.h> //#define VK_CAPITAL 0x14
2014-12-16 13:36:27 +00:00
class ChatPanel : public vgui::Panel, public vgui::CDefaultInputSignal
{
public:
ChatPanel(int x, int y, int wide, int tall);
void CancelChat();
void SetChatMode(std::string sChatMode);
2016-10-05 18:19:07 +00:00
void KeyEvent();
2014-12-16 13:36:27 +00:00
void KeyDown(int virtualKey, int scanCode);
// Checks if a key was pushed since the chat window was opened.
bool WasKeyPushed(int virtualKey) const;
virtual void paint();
virtual void paintBackground();
const static char* chatModeAll;
const static char* chatModeTeam;
private:
std::string mText;
std::string mChatMode;
2016-10-05 18:19:07 +00:00
std::string UTF8toASCII(unsigned char* multibyte);
2014-12-16 13:36:27 +00:00
bool mKeyPushed[256];
2016-10-05 18:19:07 +00:00
SDL_Event event;
2014-12-16 13:36:27 +00:00
};
#endif