10 public override object CreateExtra()
26 public override void OnActivate()
28 WidgetDate.Instance =
this;
30 base.InvokeRepeating(
"_Refresh", 0.1f, 0.1f);
34 public void _Refresh()
36 if (
EMono.game.activeZone ==
null)
42 text += (this.extra.date ?
EMono.world.date.GetText(
Date.TextFormat.Widget) :
"");
43 if (this.extra.period)
45 text = text +
" (" +
EMono.world.date.periodOfDay.ToString().lang() +
") ";
47 text += (this.extra.realDate ? (
" (" + DateTime.Now.ToString(
"H:mm") +
") ") :
"");
50 text = text +
" " +
EMono._zone.NameWithLevel;
51 if (
EMono._zone.isClaimable && !
EMono._zone.IsPCFaction)
54 List<Element> list =
EMono._zone.ListLandFeats();
55 foreach (
Element element
in list)
57 if (element != list[0])
66 if (
EMono._zone.idCurrentSubset !=
null)
68 text += (
"(" + (EMono._zone.idExport +
"_" +
EMono._zone.idCurrentSubset).lang() +
")").TagColor(this.colorFestival);
70 if (
EMono.debug.showExtra)
72 text =
string.Concat(
new string[]
76 EMono._zone.biome.name,
78 EMono._zone.lv.ToString(),
80 EMono._zone.DangerLv.ToString(),
82 EMono._zone._dangerLv.ToString(),
84 EMono._zone.electricity.ToString(),
87 if (
EMono._zone.IsInstance)
92 if (this.extra.weather)
94 text = text +
" - " +
EMono.world.weather.GetName();
96 if (this.extra.room &&
EMono.pc.IsInActiveZone &&
EMono._zone.IsPCFaction)
101 text = text +
" (" + room.Name +
")";
103 if (
EMono.pc.pos.area !=
null)
105 text = text +
" (" + EMono.pc.pos.area.Name +
")";
108 text +=
EMono._zone.TextWidgetDate;
111 text += zoneEvent.TextWidgetDate;
113 this.textTime.text = text;
114 this.rectClock.SetActive(this.extra.clock);
115 if (this.extra.clock)
117 this.imageHour.transform.localEulerAngles =
new Vector3(0f, 0f, (
float)(-(
float)date.hour * 30 + 90));
119 float num = base.transform.position.x / (float)Screen.width;
120 bool flag = base.config.pivot == RectPosition.BottomRIGHT || base.config.pivot == RectPosition.TopRIGHT || base.config.pivot == RectPosition.Right;
121 this.Rect().SetPivot((
float)(flag ? 1 : 0), 0f);
122 this.rectClock.SetAnchor((
float)(flag ? 1 : 0), 1f, (
float)(flag ? 1 : 0), 1f);
123 this.rectClock.anchoredPosition =
new Vector2((
float)(flag ? -60 : 60), -75f);
124 this.textTime.RebuildLayout(
false);
128 public override void OnChangePivot()
134 public static void Refresh()
143 public override void OnSetContextMenu(UIContextMenu m)
145 UIContextMenu uicontextMenu = m.AddChild(
"setting");
146 uicontextMenu.AddToggle(
"showPeriodOfDay", this.extra.period, delegate(
bool a)
148 this.extra.period = a;
151 uicontextMenu.AddToggle(
"showRealDate", this.extra.realDate, delegate(
bool a)
153 this.extra.realDate = a;
156 uicontextMenu.AddToggle(
"showRoom", this.extra.room, delegate(
bool a)
161 uicontextMenu.AddToggle(
"showClock", this.extra.clock, delegate(
bool a)
163 this.extra.clock = a;
166 uicontextMenu.AddToggle(
"showLoc", this.extra.loc, delegate(
bool a)
171 uicontextMenu.AddToggle(
"showWeather", this.extra.weather, delegate(
bool a)
173 this.extra.weather = a;
176 base.SetBaseContextMenu(m);
183 public Text textTime;
186 public Text textLevel;
189 public RectTransform rectClock;
192 public Image imageHour;
195 public Color colorFestival;
204 public bool realDate;