Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
WidgetFeed.cs
Go to the documentation of this file.
1using UnityEngine;
2
3public class WidgetFeed : Widget
4{
5 public class Extra
6 {
7 public bool showChat;
8
9 public bool intercept;
10
11 public int style;
12 }
13
14 public static WidgetFeed Instance;
15
16 public GameObject goDummy;
17
19
20 public string[] idPop;
21
22 public string idPopGod;
23
24 public string idPopSystem;
25
26 public static bool Intercept
27 {
28 get
29 {
30 if ((bool)Instance)
31 {
33 }
34 return false;
35 }
36 }
37
38 public Extra extra => base.config.extra as Extra;
39
40 public override bool AlwaysTop => true;
41
42 public override bool ShowStyleMenu => false;
43
44 public bool IgnoreFeed
45 {
46 get
47 {
48 if ((bool)WidgetMainText.Instance)
49 {
51 }
52 return false;
53 }
54 }
55
56 public override object CreateExtra()
57 {
58 return new Extra();
59 }
60
61 public override void OnActivate()
62 {
63 Instance = this;
64 System("Elin's Inn version " + EMono.core.version.GetText());
65 System("Welcome, wanderer! Press '?' for help.");
67 }
68
69 public override void OnDeactivate()
70 {
71 Instance = null;
73 }
74
75 public void Talk(Card c, string id)
76 {
77 string text = GameLang.Convert(c.GetTalkText(id, stripPun: true));
78 SayRaw(c, text);
79 }
80
81 public PopItem SayRaw(Card c, string text)
82 {
83 PopItemText popItemText = pop.PopText(text, null, idPop[extra.style]);
84 popItemText.GetComponentInChildren<Portrait>().SetChara(c as Chara);
85 return popItemText;
86 }
87
88 public void SayRaw(string idPortrait, string text, string _idPop)
89 {
90 pop.PopText(text, null, _idPop.IsEmpty(idPop[extra.style])).GetComponentInChildren<Portrait>().SetPortrait(idPortrait);
91 }
92
93 public void Nerun(string text, string idPortrait = "UN_nerun")
94 {
95 SayRaw(idPortrait, text, null);
96 }
97
98 public void System(string text)
99 {
100 if (extra.intercept)
101 {
102 pop.PopText(text, null, idPopSystem, Msg.currentColor);
103 }
104 }
105
106 public override void OnSetContextMenu(UIContextMenu m)
107 {
108 m.AddChild("setting").AddSlider("style", (float a) => idPop[(int)a], extra.style, delegate(float a)
109 {
110 extra.style = (int)a;
111 Msg.Nerun("this");
112 }, 0f, idPop.Length - 1, isInt: true);
114 }
115}
Version version
Definition: BaseCore.cs:17
Definition: Card.cs:11
string GetTalkText(string idTopic, bool stripPun=false, bool useDefault=true)
Definition: Card.cs:6073
Definition: Chara.cs:10
Definition: EMono.cs:4
static Core core
Definition: EMono.cs:5
static string Convert(string text)
Definition: GameLang.cs:106
bool isShowingLog
Definition: MsgBox.cs:55
Definition: Msg.cs:5
static Color currentColor
Definition: Msg.cs:10
static void Nerun(string lang, string idPortrait="UN_nerun")
Definition: Msg.cs:145
PopItemText PopText(string text, Sprite sprite=null, string id="PopText", Color c=default(Color), Vector3 destPos=default(Vector3), float duration=0f)
Definition: PopManager.cs:41
UIContextMenuItem AddSlider(string text, Func< float, string > textFunc, float value, Action< float > action, float min=0f, float max=1f, bool isInt=false, bool hideOther=true, bool useInput=false)
UIContextMenu AddChild(string idLang, TextAnchor anchor)
static bool Intercept
Definition: WidgetFeed.cs:27
void System(string text)
Definition: WidgetFeed.cs:98
override bool AlwaysTop
Definition: WidgetFeed.cs:40
override void OnSetContextMenu(UIContextMenu m)
Definition: WidgetFeed.cs:106
string idPopGod
Definition: WidgetFeed.cs:22
PopManager pop
Definition: WidgetFeed.cs:18
override void OnActivate()
Definition: WidgetFeed.cs:61
PopItem SayRaw(Card c, string text)
Definition: WidgetFeed.cs:81
void SayRaw(string idPortrait, string text, string _idPop)
Definition: WidgetFeed.cs:88
string idPopSystem
Definition: WidgetFeed.cs:24
void Nerun(string text, string idPortrait="UN_nerun")
Definition: WidgetFeed.cs:93
void Talk(Card c, string id)
Definition: WidgetFeed.cs:75
override bool ShowStyleMenu
Definition: WidgetFeed.cs:42
override void OnDeactivate()
Definition: WidgetFeed.cs:69
static WidgetFeed Instance
Definition: WidgetFeed.cs:14
bool IgnoreFeed
Definition: WidgetFeed.cs:45
GameObject goDummy
Definition: WidgetFeed.cs:16
Extra extra
Definition: WidgetFeed.cs:38
string[] idPop
Definition: WidgetFeed.cs:20
override object CreateExtra()
Definition: WidgetFeed.cs:56
static WidgetMainText Instance
static void Refresh()
Definition: Widget.cs:7
void SetBaseContextMenu(UIContextMenu m)
Definition: Widget.cs:608
string GetText()
Definition: Version.cs:16