Skip to content
Permalink
Browse files

Enable chat input for SDL

  • Loading branch information
vnctdj committed Mar 8, 2020
1 parent ef4ecb0 commit 220616e3e44f78111b368dc5366fe10cf2dbc88c
Showing with 4 additions and 4 deletions.
  1. +3 −3 UI/ChatScreen.cpp
  2. +1 −1 UI/ChatScreen.h
@@ -20,7 +20,7 @@ void ChatMenu::CreatePopupContents(UI::ViewGroup *parent) {
LinearLayout *outer = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT,400));
scroll_ = outer->Add(new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0)));
LinearLayout *bottom = outer->Add(new LinearLayout(ORIENT_HORIZONTAL, new LayoutParams(FILL_PARENT, WRAP_CONTENT)));
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI)
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || defined(SDL)
chatEdit_ = bottom->Add(new TextEdit("", n->T("Chat Here"), new LinearLayoutParams(1.0)));
#if defined(USING_WIN_UI)
//freeze the ui when using ctrl + C hotkey need workaround
@@ -98,7 +98,7 @@ void ChatMenu::CreateViews() {
box_->Add(title);

CreatePopupContents(box_);
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI)
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || defined(SDL)
UI::EnableFocusMovement(true);
root_->SetDefaultFocusView(box_);
box_->SubviewFocused(chatEdit_);
@@ -120,7 +120,7 @@ void ChatMenu::dialogFinished(const Screen *dialog, DialogResult result) {
}

UI::EventReturn ChatMenu::OnSubmit(UI::EventParams &e) {
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI)
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || defined(SDL)
std::string chat = chatEdit_->GetText();
chatEdit_->SetText("");
chatEdit_->SetFocus();
@@ -25,7 +25,7 @@ class ChatMenu : public PopupScreen {
UI::EventReturn OnQuickChat4(UI::EventParams &e);
UI::EventReturn OnQuickChat5(UI::EventParams &e);

#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI)
#if PPSSPP_PLATFORM(WINDOWS) || defined(USING_QT_UI) || defined(SDL)
UI::TextEdit *chatEdit_ = nullptr;
#endif
UI::ScrollView *scroll_ = nullptr;

0 comments on commit 220616e

Please sign in to comment.
You can’t perform that action at this time.