Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
WidgetMainText Class Reference
Inheritance diagram for WidgetMainText:
Widget EMono IChangeResolution ISkinRoot

Classes

class  Extra
 

Public Member Functions

override object CreateExtra ()
 
override void OnActivate ()
 
void RefreshBG ()
 
void Append (string s, Point pos=null)
 
void Append (string s, Color col, Point pos=null)
 
void Append (Sprite sprite)
 
void _ToggleLog ()
 
void NewLine ()
 
override void OnSetContextMenu (UIContextMenu m)
 
override void OnChangeResolution ()
 
- Public Member Functions inherited from Widget
void Test ()
 
bool IsInRightMode ()
 
void Activate ()
 
void RefreshOrder ()
 
virtual void OnActivate ()
 
virtual object CreateExtra ()
 
void Deactivate ()
 
virtual void OnDeactivate ()
 
void Close ()
 
void Reactivate ()
 
virtual void OnManagerActivate ()
 
virtual void OnManagerDeactivate ()
 
void SetAnchor (RectPosition p)
 
void SetPivot (RectPosition p)
 
virtual void OnChangePivot ()
 
void UpdateConfig ()
 
virtual void OnUpdateConfig ()
 
void ClampToScreen ()
 
virtual void OnChangeResolution ()
 
void OnChangePosition ()
 
virtual void OnChangeActionMode ()
 
virtual void OnFlip ()
 
bool IsAlignTop ()
 
Layer AddLayer (Layer l, Transform trans)
 
void RefreshTipPivotPosition ()
 
SkinSet GetSkin ()
 
SkinConfig GetSkinConfig ()
 
void SetSkin (int id, int v=0)
 
void TestSkin ()
 
virtual void ApplySkin ()
 
virtual void OnApplySkin ()
 
void InstantiateDeco (SkinDeco deco)
 
void AddDeco (SkinDeco deco)
 
void RemoveDeco (SkinDeco deco)
 
virtual bool CanShowContextMenu ()
 
void ShowContextMenu ()
 
void SetBaseContextMenu (UIContextMenu m)
 
virtual void OnSetContextMenu (UIContextMenu m)
 
void SetGridContextMenu (UIContextMenu m)
 
void SoundActivate ()
 
void OnChangeResolution ()
 
SkinSet GetSkin ()
 
SkinConfig GetSkinConfig ()
 

Static Public Member Functions

static void HideLog ()
 
static void ToggleLog ()
 
static void Refresh ()
 
- Static Public Member Functions inherited from EMono
static int rnd (int a)
 

Public Attributes

MsgBox box
 
UIItem moldLine
 
int visibleLines
 
Transform layout
 
Sprite spriteElin
 
Sprite spriteDestroy
 
Sprite spriteEther
 
bool newLine = true
 
- Public Attributes inherited from Widget
Image imageBG
 
SoundData soundActivate
 
UIDragPanel dragPanel
 
RectTransform tipPivotLeft
 
RectTransform tipPivotRight
 

Static Public Attributes

static WidgetMainText Instance
 
static MsgBox boxBk
 
static bool ignoreStack
 
- Static Public Attributes inherited from EMono
static Core core
 

Properties

Extra extra [get]
 
override bool ShowStyleMenu [get]
 
override bool AlwaysTop [get]
 
- Properties inherited from Widget
string ID [get]
 
Config config [get]
 
SkinRoot skinRoot [get]
 
bool IsSealed [get]
 
virtual bool ShowStyleMenu [get]
 
virtual bool AlwaysTop [get]
 
virtual bool IsStaticPosition [get]
 
virtual bool AlwaysBottom [get]
 
virtual Type SetSiblingAfter [get]
 
virtual bool ShowInBuildMode [get]
 
virtual bool RightClickToClose [get]
 
virtual bool AllowRightClickToClose [get]
 
- Properties inherited from EMono
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static CoreDebug debug [get]
 

Private Member Functions

void _Refresh ()
 

Private Attributes

UIItem currentItem
 

Additional Inherited Members

- Public Types inherited from Widget
enum  WidgetType { Default , ZoomMenu }
 
enum  State { Active , Inactive }
 
- Protected Member Functions inherited from Widget
void ClampToScreenEnsured (Component c, Vector2 anchoredPos)
 
void ClampToScreen (RectTransform rect, float margin=10f)
 
- Protected Attributes inherited from Widget
bool flip
 

Detailed Description

Definition at line 4 of file WidgetMainText.cs.

Member Function Documentation

◆ _Refresh()

void WidgetMainText._Refresh ( )
inlineprivate

Definition at line 203 of file WidgetMainText.cs.

204 {
205 box.SetActive(box.isShowingLog || !WidgetFeed.Intercept, delegate(bool enabled)
206 {
207 if (enabled)
208 {
209 box.RebuildLayout(recursive: true);
210 }
211 });
212 }
bool isShowingLog
Definition: MsgBox.cs:55
static bool Intercept
Definition: WidgetFeed.cs:27

References box, WidgetFeed.Intercept, and MsgBox.isShowingLog.

Referenced by _ToggleLog(), Append(), OnActivate(), and Refresh().

◆ _ToggleLog()

void WidgetMainText._ToggleLog ( )
inline

Definition at line 176 of file WidgetMainText.cs.

177 {
178 box.ToggleLog();
179 _Refresh();
180 if (box.isShowingLog)
181 {
182 if ((bool)WidgetFeed.Instance)
183 {
185 }
186 box.RebuildLayout(recursive: true);
187 }
188 }
void ToggleLog()
Definition: MsgBox.cs:209
void KillAll(bool instant=false)
Definition: PopManager.cs:213
PopManager pop
Definition: WidgetFeed.cs:18
static WidgetFeed Instance
Definition: WidgetFeed.cs:14

References _Refresh(), box, WidgetFeed.Instance, MsgBox.isShowingLog, PopManager.KillAll(), WidgetFeed.pop, and MsgBox.ToggleLog().

Referenced by HideLog(), Scene.OnUpdate(), WidgetManager.Reset(), and ToggleLog().

◆ Append() [1/3]

void WidgetMainText.Append ( Sprite  sprite)
inline

Definition at line 152 of file WidgetMainText.cs.

153 {
154 box.Append(sprite);
155 _Refresh();
156 }
void Append(string s, Color col)
Definition: MsgBox.cs:74

References _Refresh(), MsgBox.Append(), and box.

◆ Append() [2/3]

void WidgetMainText.Append ( string  s,
Color  col,
Point  pos = null 
)
inline

Definition at line 98 of file WidgetMainText.cs.

99 {
100 if (s.IsEmpty() || s == " ")
101 {
102 return;
103 }
104 if (pos != null)
105 {
106 box.Load("MsgFocus").button1.onClick.AddListener(delegate
107 {
108 EMono.screen.Focus(pos);
109 });
110 }
111 if (s.StartsWith("*"))
112 {
113 s = " " + s;
114 }
116 {
117 s += " ";
118 if (s[0] == ' ')
119 {
120 s = s.TrimStart(' ');
121 }
122 }
123 else if (s.EndsWith("*"))
124 {
125 s += " ";
126 }
127 if (MsgBlock.lastBlock != null && MsgBlock.lastText == s && !ignoreStack)
128 {
129 MsgBlock lastBlock = MsgBlock.lastBlock;
130 if (lastBlock.txt != null)
131 {
132 UIText txt = lastBlock.txt;
133 lastBlock.repeat++;
134 string text = txt.text;
135 if (text.EndsWith(") ") && text.Contains("(x"))
136 {
137 text = text.Substring(0, text.IndexOf("(x"));
138 }
139 txt.text = text + "(x" + (lastBlock.repeat + 1) + ") ";
140 if (lastBlock.repeat == 1)
141 {
142 txt.RebuildLayout();
143 box.RebuildLayout(recursive: true);
144 }
145 return;
146 }
147 }
148 box.Append(s, col);
149 _Refresh();
150 }
void Focus(Int3 ints)
Definition: EMono.cs:4
static BaseGameScreen screen
Definition: EMono.cs:29
bool useSpace
Definition: LangSetting.cs:36
Definition: Lang.cs:6
static LangSetting setting
Definition: Lang.cs:54
static MsgBlock lastBlock
Definition: MsgBlock.cs:7
int repeat
Definition: MsgBlock.cs:28
static string lastText
Definition: MsgBlock.cs:9
UIText txt
Definition: MsgBlock.cs:25
UIItem Load(string id)
Definition: MsgBox.cs:86
UIButton button1
Definition: UIItem.cs:18
Definition: UIText.cs:6
static bool ignoreStack

References _Refresh(), MsgBox.Append(), box, UIItem.button1, BaseGameScreen.Focus(), ignoreStack, MsgBlock.lastBlock, MsgBlock.lastText, MsgBox.Load(), MsgBlock.repeat, EMono.screen, Lang.setting, MsgBlock.txt, and LangSetting.useSpace.

◆ Append() [3/3]

void WidgetMainText.Append ( string  s,
Point  pos = null 
)
inline

Definition at line 93 of file WidgetMainText.cs.

94 {
95 Append(s, Msg.colors.Default, pos);
96 }
Color Default
Definition: MsgColors.cs:5
Definition: Msg.cs:5
static MsgColors colors
Definition: Msg.cs:20
void Append(string s, Point pos=null)

References Append(), Msg.colors, and MsgColors.Default.

Referenced by Msg.Append(), Append(), Msg.GetGameText(), Msg.Nerun(), OnActivate(), Msg.SayHomeMember(), Msg.SayPic(), Msg.SayRaw(), and Msg.Talk().

◆ CreateExtra()

override object WidgetMainText.CreateExtra ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 48 of file WidgetMainText.cs.

49 {
50 return new Extra();
51 }

◆ HideLog()

static void WidgetMainText.HideLog ( )
inlinestatic

Definition at line 158 of file WidgetMainText.cs.

159 {
160 if ((bool)Instance && Instance.box.isShowingLog)
161 {
163 }
164 }
static WidgetMainText Instance

References _ToggleLog(), box, Instance, and MsgBox.isShowingLog.

Referenced by ELayer.OnAfterAddLayer().

◆ NewLine()

void WidgetMainText.NewLine ( )
inline

Definition at line 190 of file WidgetMainText.cs.

191 {
193 }
void MarkNewBlock()
Definition: MsgBox.cs:138

References box, and MsgBox.MarkNewBlock().

Referenced by Msg.NewLine(), OnActivate(), and Zone_User.OnActivate().

◆ OnActivate()

override void WidgetMainText.OnActivate ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 53 of file WidgetMainText.cs.

54 {
55 bool flag = true;
56 if ((bool)boxBk)
57 {
58 UnityEngine.Object.DestroyImmediate(box.gameObject);
59 box = boxBk;
60 boxBk.transform.SetParent(base.transform, worldPositionStays: false);
61 boxBk.GetComponentInChildren<UIDragPanel>(includeInactive: true).SetTarget(this.Rect());
62 boxBk = null;
63 flag = false;
64 }
67 Instance = this;
68 box.maxBlock = extra.maxLine;
69 box.fadeLines = extra.fadeLines;
70 if (base.config.skin.bgColor.Equals(new Color(0f, 0f, 0f, 0f)))
71 {
72 base.config.skin.bgColor = EMono.core.refs.bg_msg[extra.bg].color;
73 }
74 RefreshBG();
76 box.Init();
77 if (flag)
78 {
79 Append("welcome_intro".langGame(EMono.core.version.GetText()));
81 NewLine();
82 Append("welcome".langGame(EInput.keys.report.key.ToString() ?? ""));
83 NewLine();
84 }
85 _Refresh();
86 }
Version version
Definition: BaseCore.cs:17
List< SpriteAsset > bg_msg
Definition: CoreRef.cs:353
CoreRef refs
Definition: Core.cs:51
KeyCode key
Definition: EInput.cs:14
Definition: EInput.cs:8
static KeyMapManager keys
Definition: EInput.cs:367
static Core core
Definition: EMono.cs:5
Image imageBg
Definition: MsgBox.cs:33
void Init()
Definition: MsgBox.cs:68
UIDragPanel dragPanel
Definition: MsgBox.cs:35
override void OnChangeResolution()
static MsgBox boxBk
UIDragPanel dragPanel
Definition: Widget.cs:154
Image imageBG
Definition: Widget.cs:150
string GetText()
Definition: Version.cs:16

References _Refresh(), Append(), WidgetMainText.Extra.bg, CoreRef.bg_msg, box, boxBk, Color, EMono.core, MsgBox.dragPanel, Widget.dragPanel, extra, WidgetMainText.Extra.fadeLines, Version.GetText(), MsgBox.imageBg, Widget.imageBG, MsgBox.Init(), Instance, EInput.KeyMap.key, EInput.keys, WidgetMainText.Extra.maxLine, NewLine(), OnChangeResolution(), RefreshBG(), Core.refs, EInput.KeyMapManager.report, spriteElin, and BaseCore.version.

◆ OnChangeResolution()

override void WidgetMainText.OnChangeResolution ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 251 of file WidgetMainText.cs.

252 {
253 base.OnChangeResolution();
254 RectTransform rectTransform = this.Rect();
255 rectTransform.sizeDelta = new Vector2(0.01f * (float)Screen.width * (float)extra.width, rectTransform.sizeDelta.y);
256 }

References extra, and WidgetMainText.Extra.width.

Referenced by OnActivate(), and OnSetContextMenu().

◆ OnSetContextMenu()

override void WidgetMainText.OnSetContextMenu ( UIContextMenu  m)
inlinevirtual

Reimplemented from Widget.

Definition at line 214 of file WidgetMainText.cs.

215 {
216 SkinConfig cfg = base.config.skin;
217 UIContextMenu uIContextMenu = m.AddChild("setting");
218 uIContextMenu.AddSlider("msgLines", (float n) => n.ToString() ?? "", box.maxBlock, delegate(float a)
219 {
220 box.maxBlock = (int)a;
221 extra.maxLine = (int)a;
222 }, 2f, 10f, isInt: true, hideOther: false);
223 uIContextMenu.AddSlider("width", (float a) => a.ToString() ?? "", extra.width, delegate(float a)
224 {
225 extra.width = (int)a;
227 }, 30f, 100f, isInt: true);
228 UIContextMenu uIContextMenu2 = m.AddChild("style");
229 uIContextMenu2.AddToggle("fadeLines", extra.fadeLines, delegate(bool a)
230 {
231 extra.fadeLines = (box.fadeLines = a);
233 });
234 uIContextMenu2.AddSlider("changeBG", (float n) => n + "/" + (EMono.core.refs.bg_msg.Count - 1), extra.bg, delegate(float a)
235 {
236 extra.bg = (int)a;
237 cfg.bgColor = EMono.core.refs.bg_msg[extra.bg].color;
238 RefreshBG();
239 }, 0f, EMono.core.refs.bg_msg.Count - 1, isInt: true);
240 uIContextMenu2.AddButton("colorBG", delegate
241 {
242 EMono.ui.AddLayer<LayerColorPicker>().SetColor(cfg.bgColor, EMono.ui.skins.skinSets[cfg.id].bgs[cfg.bg].color, delegate(PickerState state, Color _c)
243 {
244 cfg.bgColor = _c;
245 RefreshBG();
246 });
247 });
249 }
PickerState
Definition: PickerState.cs:2
static UI ui
Definition: EMono.cs:15
int maxBlock
Definition: MsgBox.cs:37
void RefreshAlpha()
Definition: MsgBox.cs:143
Color bgColor
Definition: SkinConfig.cs:67
UIContextMenuItem AddToggle(string idLang="", bool isOn=false, UnityAction< bool > action=null)
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)
void AddButton(Func< string > funcText, UnityAction action=null)
UIContextMenu AddChild(string idLang, TextAnchor anchor)
void SetBaseContextMenu(UIContextMenu m)
Definition: Widget.cs:608

References UIContextMenu.AddButton(), UIContextMenu.AddChild(), UIContextMenu.AddSlider(), UIContextMenu.AddToggle(), SkinConfig.bg, WidgetMainText.Extra.bg, CoreRef.bg_msg, SkinConfig.bgColor, box, Color, EMono.core, extra, WidgetMainText.Extra.fadeLines, SkinConfig.id, MsgBox.maxBlock, OnChangeResolution(), MsgBox.RefreshAlpha(), RefreshBG(), Core.refs, Widget.SetBaseContextMenu(), EMono.ui, and WidgetMainText.Extra.width.

◆ Refresh()

static void WidgetMainText.Refresh ( )
inlinestatic

Definition at line 195 of file WidgetMainText.cs.

196 {
197 if ((bool)Instance)
198 {
200 }
201 }

References _Refresh(), and Instance.

Referenced by WidgetFeed.OnActivate(), and WidgetFeed.OnDeactivate().

◆ RefreshBG()

void WidgetMainText.RefreshBG ( )
inline

Definition at line 88 of file WidgetMainText.cs.

89 {
90 box.SetBG(EMono.core.refs.bg_msg[extra.bg], base.config.skin.bgColor);
91 }
void SetBG(SpriteAsset s, Color c)
Definition: MsgBox.cs:164

References WidgetMainText.Extra.bg, CoreRef.bg_msg, box, EMono.core, extra, Core.refs, and MsgBox.SetBG().

Referenced by OnActivate(), and OnSetContextMenu().

◆ ToggleLog()

static void WidgetMainText.ToggleLog ( )
inlinestatic

Definition at line 166 of file WidgetMainText.cs.

167 {
168 if (!Instance)
169 {
170 EMono.ui.widgets.Activate("MainText");
171 }
173 SE.ClickGeneral();
174 }

References _ToggleLog(), Instance, and EMono.ui.

Referenced by HotItemToggleLog.OnClick(), and AM_BaseGameMode.OnUpdateInput().

Member Data Documentation

◆ box

◆ boxBk

MsgBox WidgetMainText.boxBk
static

Definition at line 19 of file WidgetMainText.cs.

Referenced by OnActivate().

◆ currentItem

UIItem WidgetMainText.currentItem
private

Definition at line 25 of file WidgetMainText.cs.

◆ ignoreStack

bool WidgetMainText.ignoreStack
static

Definition at line 21 of file WidgetMainText.cs.

Referenced by Append().

◆ Instance

WidgetMainText WidgetMainText.Instance
static

◆ layout

Transform WidgetMainText.layout

Definition at line 31 of file WidgetMainText.cs.

◆ moldLine

UIItem WidgetMainText.moldLine

Definition at line 27 of file WidgetMainText.cs.

◆ newLine

bool WidgetMainText.newLine = true

Definition at line 40 of file WidgetMainText.cs.

◆ spriteDestroy

Sprite WidgetMainText.spriteDestroy

Definition at line 35 of file WidgetMainText.cs.

Referenced by Msg.GetGameText().

◆ spriteElin

Sprite WidgetMainText.spriteElin

Definition at line 33 of file WidgetMainText.cs.

Referenced by OnActivate().

◆ spriteEther

Sprite WidgetMainText.spriteEther

Definition at line 37 of file WidgetMainText.cs.

◆ visibleLines

int WidgetMainText.visibleLines

Definition at line 29 of file WidgetMainText.cs.

Property Documentation

◆ AlwaysTop

override bool WidgetMainText.AlwaysTop
get

Definition at line 46 of file WidgetMainText.cs.

◆ extra

Extra WidgetMainText.extra
get

Definition at line 42 of file WidgetMainText.cs.

Referenced by OnActivate(), OnChangeResolution(), OnSetContextMenu(), and RefreshBG().

◆ ShowStyleMenu

override bool WidgetMainText.ShowStyleMenu
get

Definition at line 44 of file WidgetMainText.cs.


The documentation for this class was generated from the following file: