CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/UI/ChatScreen.h
Views: 1401
1
#pragma once
2
3
#include "ppsspp_config.h"
4
#include "Common/UI/UIScreen.h"
5
6
class ChatMenu : public UI::AnchorLayout {
7
public:
8
ChatMenu(int token, const Bounds &screenBounds, ScreenManager *screenManager, UI::LayoutParams *lp = nullptr)
9
: UI::AnchorLayout(lp), screenManager_(screenManager), token_(token) {
10
CreateSubviews(screenBounds);
11
}
12
void Update() override;
13
bool SubviewFocused(UI::View *view) override;
14
15
void Close();
16
17
bool Contains(float x, float y) const {
18
if (box_)
19
return box_->GetBounds().Contains(x, y);
20
return false;
21
}
22
23
private:
24
void CreateSubviews(const Bounds &screenBounds);
25
void CreateContents(UI::ViewGroup *parent);
26
void UpdateChat();
27
28
UI::EventReturn OnAskForChatMessage(UI::EventParams &e);
29
30
UI::EventReturn OnSubmitMessage(UI::EventParams &e);
31
UI::EventReturn OnQuickChat1(UI::EventParams &e);
32
UI::EventReturn OnQuickChat2(UI::EventParams &e);
33
UI::EventReturn OnQuickChat3(UI::EventParams &e);
34
UI::EventReturn OnQuickChat4(UI::EventParams &e);
35
UI::EventReturn OnQuickChat5(UI::EventParams &e);
36
37
UI::TextEdit *chatEdit_ = nullptr;
38
UI::ScrollView *scroll_ = nullptr;
39
UI::LinearLayout *chatVert_ = nullptr;
40
UI::ViewGroup *box_ = nullptr;
41
ScreenManager *screenManager_;
42
43
int chatChangeID_ = 0;
44
bool toBottom_ = true;
45
bool promptInput_ = false;
46
int token_;
47
std::string messageTemp_;
48
UI::Button *chatButton_ = nullptr;
49
};
50
51