Chat messages

This commit is contained in:
Vladislav Khorev 2013-12-12 21:07:42 +00:00
parent 37ba5e51f6
commit 33040259bd
2 changed files with 34 additions and 10 deletions

View File

@ -145,7 +145,8 @@ public:
boost::signal<void(int)> KeyPressedSignal; boost::signal<void(int)> KeyPressedSignal;
boost::signal<void(std::string)> SetTextSignal; boost::signal<void(std::string)> SetTextSignal;
//boost::signal<void()> PostUpdateSignal; boost::signal<void()> OnKeyboardShowSignal;
boost::signal<void()> OnKeyboardHideSignal;
TGUIManager(); TGUIManager();
@ -178,6 +179,8 @@ public:
void ShowKeyboard(const std::string text = ""); void ShowKeyboard(const std::string text = "");
void HideKeyboard(); void HideKeyboard();
bool IsKeyboardOnScreen();
void PrintWidgetList(); void PrintWidgetList();

View File

@ -108,12 +108,15 @@ void TGUIManager::Update(cardinal dt)
for (TWidgetArr::iterator i = WidgetArr.begin(); i != WidgetArr.end(); ++i) for (TWidgetArr::iterator i = WidgetArr.begin(); i != WidgetArr.end(); ++i)
{ {
i->Widget->Update(dt); //i->Widget->Update(dt);
if (i->IsMouseDown) if (i->IsMouseDown)
{ {
signalMap.push_back((i->SignalMap[CONST_HOLD_SIGNAL_NAME])); signalMap.push_back((i->SignalMap[CONST_HOLD_SIGNAL_NAME]));
} }
i->Widget->Update(dt);
} }
//Keep this outside since signal may affect WidgetArr //Keep this outside since signal may affect WidgetArr
@ -455,6 +458,8 @@ void TGUIManager::OnMove(vec2 shift, int touchNumber)
void TGUIManager::ShowKeyboard(const std::string text) void TGUIManager::ShowKeyboard(const std::string text)
{
if (!KeyboardIsOnScreen)
{ {
#ifdef TARGET_IOS #ifdef TARGET_IOS
SE::ShowKeyboard(text); SE::ShowKeyboard(text);
@ -465,15 +470,26 @@ void TGUIManager::ShowKeyboard(const std::string text)
MoveWidget("Keyboard", vec2(0, 216)); MoveWidget("Keyboard", vec2(0, 216));
KeyboardIsOnScreen = true; KeyboardIsOnScreen = true;
}*/ }*/
OnKeyboardShowSignal();
KeyboardIsOnScreen = true;
}
} }
void TGUIManager::HideKeyboard() void TGUIManager::HideKeyboard()
{
if (KeyboardIsOnScreen)
{ {
ResourceManager->GUIManager.SetTextSignal.disconnect_all_slots(); ResourceManager->GUIManager.SetTextSignal.disconnect_all_slots();
#ifdef TARGET_IOS #ifdef TARGET_IOS
SE::HideKeyboard(); SE::HideKeyboard();
#endif #endif
OnKeyboardHideSignal();
OnKeyboardShowSignal.disconnect_all_slots();
OnKeyboardHideSignal.disconnect_all_slots();
KeyboardIsOnScreen = false;
}
/* /*
if (KeyboardIsOnScreen) if (KeyboardIsOnScreen)
{ {
@ -482,6 +498,11 @@ void TGUIManager::HideKeyboard()
}*/ }*/
} }
bool TGUIManager::IsKeyboardOnScreen()
{
return KeyboardIsOnScreen;
}
void TGUIManager::PrintWidgetList() void TGUIManager::PrintWidgetList()
{ {
TWidgetArr::iterator i; TWidgetArr::iterator i;