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

Classes

class  Extra
 

Public Member Functions

override object CreateExtra ()
 
override void OnActivate ()
 
void _Refresh ()
 
override void OnChangePivot ()
 
override void OnSetContextMenu (UIContextMenu m)
 
- 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 Refresh ()
 
- Static Public Member Functions inherited from EMono
static int rnd (int a)
 

Public Attributes

Text textTime
 
Text textLevel
 
RectTransform rectClock
 
Image imageHour
 
Color colorFestival
 
- Public Attributes inherited from Widget
Image imageBG
 
SoundData soundActivate
 
UIDragPanel dragPanel
 
RectTransform tipPivotLeft
 
RectTransform tipPivotRight
 

Static Public Attributes

static WidgetDate Instance
 
- Static Public Attributes inherited from EMono
static Core core
 

Properties

Extra extra [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]
 

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 6 of file WidgetDate.cs.

Member Function Documentation

◆ _Refresh()

void WidgetDate._Refresh ( )
inline

Definition at line 51 of file WidgetDate.cs.

52 {
53 if (EMono.game.activeZone == null)
54 {
55 return;
56 }
57 string text = "";
58 GameDate date = EMono.world.date;
59 text += (extra.date ? EMono.world.date.GetText(Date.TextFormat.Widget) : "");
60 if (extra.period)
61 {
62 text = text + " (" + EMono.world.date.periodOfDay.ToString().lang() + ") ";
63 }
64 text += (extra.realDate ? (" (" + DateTime.Now.ToString("H:mm") + ") ") : "");
65 if (extra.loc)
66 {
67 text = text + " " + EMono._zone.NameWithLevel;
69 {
70 text += EMono._zone.TextDangerLv;
71 }
73 {
74 text += "(";
75 List<Element> list = EMono._zone.ListLandFeats();
76 foreach (Element item in list)
77 {
78 if (item != list[0])
79 {
80 text += ", ";
81 }
82 text += item.Name;
83 }
84 text += ")";
85 }
86 }
87 if (EMono._zone.idCurrentSubset != null)
88 {
89 text += ("(" + (EMono._zone.idExport + "_" + EMono._zone.idCurrentSubset).lang() + ")").TagColor(colorFestival);
90 }
92 {
93 text += "zone_peace".lang().TagColor(colorFestival);
94 }
96 {
97 text = text + " <size=12>(" + EMono._zone.biome.name + "/Lv:" + EMono._zone.lv + "/Danger:" + EMono._zone.DangerLv + "/_danger:" + EMono._zone._dangerLv + "/elec:" + EMono._zone.electricity + ")</size>";
99 {
100 text += "Instance";
101 }
102 }
103 if (extra.weather)
104 {
105 text = text + " - " + EMono.world.weather.GetName();
106 }
108 {
109 Room room = EMono.pc.Cell.room;
110 if (room != null)
111 {
112 text = text + " (" + room.Name + ")";
113 }
114 if (EMono.pc.pos.area != null)
115 {
116 text = text + " (" + EMono.pc.pos.area.Name + ")";
117 }
118 }
119 text += EMono._zone.TextWidgetDate;
120 foreach (ZoneEvent item2 in EMono._zone.events.list)
121 {
122 text += item2.TextWidgetDate;
123 }
125 {
126 text += "raid_till".lang(EMono.game.survival.flags.raidLv.ToString() ?? "");
127 }
128 if (EMono.Branch != null && EMono.Branch.luckyMonth)
129 {
130 text = text + " " + "lucky_month".lang().TagColor(Msg.colors.colors["save"]);
131 }
132 if (EMono.debug.enable)
133 {
134 text += " *DEBUG MODE*";
135 }
136 textTime.text = text;
137 rectClock.SetActive(extra.clock);
138 if (extra.clock)
139 {
140 imageHour.transform.localEulerAngles = new Vector3(0f, 0f, -date.hour * 30 + 90);
141 }
142 _ = base.transform.position.x / (float)Screen.width;
143 bool flag = base.config.pivot == RectPosition.BottomRIGHT || base.config.pivot == RectPosition.TopRIGHT || base.config.pivot == RectPosition.Right;
144 this.Rect().SetPivot(flag ? 1 : 0, 0f);
145 rectClock.SetAnchor(flag ? 1 : 0, 1f, flag ? 1 : 0, 1f);
146 rectClock.anchoredPosition = new Vector2(flag ? (-60) : 60, -75f);
147 textTime.RebuildLayout();
148 }
RectPosition
Definition: RectPosition.cs:2
Point pos
Definition: Card.cs:57
Cell Cell
Definition: Card.cs:2017
Room room
Definition: Cell.cs:102
bool IsInActiveZone
Definition: Chara.cs:836
bool showExtra
Definition: CoreDebug.cs:168
bool enable
Definition: CoreDebug.cs:286
Definition: Date.cs:4
int hour
Definition: Date.cs:74
PeriodOfDay periodOfDay
Definition: Date.cs:124
string GetText(TextFormat format)
Definition: Date.cs:245
TextFormat
Definition: Date.cs:6
Definition: EMono.cs:4
static Chara pc
Definition: EMono.cs:13
static World world
Definition: EMono.cs:37
static Zone _zone
Definition: EMono.cs:19
static Game game
Definition: EMono.cs:7
static FactionBranch Branch
Definition: EMono.cs:21
static CoreDebug debug
Definition: EMono.cs:45
SurvivalManager survival
Definition: Game.cs:224
Zone activeZone
Definition: Game.cs:248
bool IsSurvival
Definition: Game.cs:272
UD_String_Color colors
Definition: MsgColors.cs:23
Definition: Msg.cs:5
static MsgColors colors
Definition: Msg.cs:20
Area area
Definition: Point.cs:73
Definition: Room.cs:4
string idCurrentSubset
Definition: Spatial.cs:28
virtual bool isClaimable
Definition: Spatial.cs:550
bool isPeace
Definition: Spatial.cs:406
string GetName()
Definition: Weather.cs:158
Text textTime
Definition: WidgetDate.cs:27
Color colorFestival
Definition: WidgetDate.cs:35
RectTransform rectClock
Definition: WidgetDate.cs:31
Extra extra
Definition: WidgetDate.cs:37
GameDate date
Definition: World.cs:6
Weather weather
Definition: World.cs:12
List< ZoneEvent > list
virtual string TextWidgetDate
Definition: ZoneEvent.cs:25
string TextDangerLv
Definition: Zone.cs:426
ZoneEventManager events
Definition: Zone.cs:40
virtual string TextWidgetDate
Definition: Zone.cs:132
bool IsInstance
Definition: Zone.cs:484
List< Element > ListLandFeats()
Definition: Zone.cs:2987
bool IsPCFaction
Definition: Zone.cs:468
string NameWithLevel
Definition: Zone.cs:424

References EMono._zone, Game.activeZone, Point.area, EMono.Branch, Card.Cell, WidgetDate.Extra.clock, colorFestival, Msg.colors, MsgColors.colors, World.date, EMono.debug, CoreDebug.enable, Zone.events, extra, SurvivalManager.flags, EMono.game, Weather.GetName(), Date.GetText(), Spatial.idCurrentSubset, Spatial.isClaimable, Chara.IsInActiveZone, Zone.IsInstance, Zone.IsPCFaction, Spatial.isPeace, Game.IsSurvival, item, ZoneEventManager.list, Zone.ListLandFeats(), WidgetDate.Extra.loc, FactionBranch.luckyMonth, Zone.NameWithLevel, EMono.pc, WidgetDate.Extra.period, Date.periodOfDay, Card.pos, SurvivalManager.Flags.raidLv, rectClock, Cell.room, WidgetDate.Extra.room, CoreDebug.showExtra, Game.survival, Zone.TextDangerLv, textTime, Zone.TextWidgetDate, ZoneEvent.TextWidgetDate, WidgetDate.Extra.weather, World.weather, and EMono.world.

Referenced by OnActivate(), OnChangePivot(), OnSetContextMenu(), and Refresh().

◆ CreateExtra()

override object WidgetDate.CreateExtra ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 39 of file WidgetDate.cs.

40 {
41 return new Extra();
42 }

◆ OnActivate()

override void WidgetDate.OnActivate ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 44 of file WidgetDate.cs.

45 {
46 Instance = this;
47 _Refresh();
48 InvokeRepeating("_Refresh", 0.1f, 0.1f);
49 }
static WidgetDate Instance
Definition: WidgetDate.cs:25
void _Refresh()
Definition: WidgetDate.cs:51

References _Refresh(), and Instance.

◆ OnChangePivot()

override void WidgetDate.OnChangePivot ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 150 of file WidgetDate.cs.

151 {
152 _Refresh();
153 }

References _Refresh().

◆ OnSetContextMenu()

override void WidgetDate.OnSetContextMenu ( UIContextMenu  m)
inlinevirtual

Reimplemented from Widget.

Definition at line 163 of file WidgetDate.cs.

164 {
165 UIContextMenu uIContextMenu = m.AddChild("setting");
166 uIContextMenu.AddToggle("showPeriodOfDay", extra.period, delegate(bool a)
167 {
168 extra.period = a;
169 _Refresh();
170 });
171 uIContextMenu.AddToggle("showRealDate", extra.realDate, delegate(bool a)
172 {
173 extra.realDate = a;
174 _Refresh();
175 });
176 uIContextMenu.AddToggle("showRoom", extra.room, delegate(bool a)
177 {
178 extra.room = a;
179 _Refresh();
180 });
181 uIContextMenu.AddToggle("showClock", extra.clock, delegate(bool a)
182 {
183 extra.clock = a;
184 _Refresh();
185 });
186 uIContextMenu.AddToggle("showLoc", extra.loc, delegate(bool a)
187 {
188 extra.loc = a;
189 _Refresh();
190 });
191 uIContextMenu.AddToggle("showWeather", extra.weather, delegate(bool a)
192 {
193 extra.weather = a;
194 _Refresh();
195 });
197 }
UIContextMenuItem AddToggle(string idLang="", bool isOn=false, UnityAction< bool > action=null)
UIContextMenu AddChild(string idLang, TextAnchor anchor)
void SetBaseContextMenu(UIContextMenu m)
Definition: Widget.cs:608

References _Refresh(), UIContextMenu.AddChild(), UIContextMenu.AddToggle(), WidgetDate.Extra.clock, extra, WidgetDate.Extra.loc, WidgetDate.Extra.period, WidgetDate.Extra.realDate, WidgetDate.Extra.room, Widget.SetBaseContextMenu(), and WidgetDate.Extra.weather.

◆ Refresh()

static void WidgetDate.Refresh ( )
inlinestatic

Definition at line 155 of file WidgetDate.cs.

156 {
157 if ((bool)Instance)
158 {
160 }
161 }

References _Refresh(), and Instance.

Referenced by Scene.Init(), TraitCoreZone.TrySetAct(), and TraitWaystone.TrySetAct().

Member Data Documentation

◆ colorFestival

Color WidgetDate.colorFestival

Definition at line 35 of file WidgetDate.cs.

Referenced by _Refresh().

◆ imageHour

Image WidgetDate.imageHour

Definition at line 33 of file WidgetDate.cs.

◆ Instance

WidgetDate WidgetDate.Instance
static

Definition at line 25 of file WidgetDate.cs.

Referenced by OnActivate(), and Refresh().

◆ rectClock

RectTransform WidgetDate.rectClock

Definition at line 31 of file WidgetDate.cs.

Referenced by _Refresh().

◆ textLevel

Text WidgetDate.textLevel

Definition at line 29 of file WidgetDate.cs.

◆ textTime

Text WidgetDate.textTime

Definition at line 27 of file WidgetDate.cs.

Referenced by _Refresh().

Property Documentation

◆ extra

Extra WidgetDate.extra
get

Definition at line 37 of file WidgetDate.cs.

Referenced by _Refresh(), and OnSetContextMenu().


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