Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/UI/ChatScreen.h
5656 views
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
void OnAskForChatMessage(UI::EventParams &e);
29
30
void OnSubmitMessage(UI::EventParams &e);
31
32
UI::TextEdit *chatEdit_ = nullptr;
33
UI::ScrollView *scroll_ = nullptr;
34
UI::LinearLayout *chatVert_ = nullptr;
35
UI::ViewGroup *box_ = nullptr;
36
ScreenManager *screenManager_;
37
38
int chatChangeID_ = 0;
39
bool toBottom_ = true;
40
bool promptInput_ = false;
41
int token_;
42
std::string messageTemp_;
43
UI::Button *chatButton_ = nullptr;
44
};
45
46