10 public override object CreateExtra()
26 public override void OnActivate()
29 base.InvokeRepeating(
"Refresh", 0f, 0.2f);
35 this.grid.constraintCount = this.extra.layout + 1;
37 this.RebuildLayout(
false);
43 if (!
EMono.game.isLoading)
47 EMono.pc.hp =
EMono.pc.MaxHP;
51 EMono.pc.mana.value =
EMono.pc.mana.max;
53 if (
EMono.pc.stamina.value >
EMono.pc.stamina.max)
55 EMono.pc.stamina.value =
EMono.pc.stamina.max;
58 this.gaugeHP.hideBar = !this.extra.showGauge;
59 this.gaugeMP.hideBar = !this.extra.showGauge;
60 this.gaugeStamina.hideBar = !this.extra.showGauge;
61 this.gaugeStamina.SetActive(this.extra.stamina);
62 this.gaugeHP.UpdateValue(
EMono.pc.hp,
EMono.pc.MaxHP);
63 this.gaugeMP.UpdateValue(
EMono.pc.mana.value,
EMono.pc.mana.max);
64 this.gaugeStamina.UpdateValue(
EMono.pc.stamina.value,
EMono.pc.stamina.max);
65 Color c =
EMono.Colors.Dark.gradientHP.Evaluate((
float)
EMono.pc.hp / (
float)
EMono.pc.MaxHP);
66 this.gaugeHP.textNow.text =
"".TagColor(c,
EMono.pc.hp.ToString() ??
"") + (this.extra.showMax ? (
"/" +
EMono.pc.MaxHP.ToString()) :
"");
67 c =
EMono.Colors.Dark.gradientMP.Evaluate((
float)
EMono.pc.mana.value / (
float)
EMono.pc.mana.max);
68 this.gaugeMP.textNow.text =
"".TagColor(c,
EMono.pc.mana.value.ToString() ??
"") + (this.extra.showMax ? (
"/" +
EMono.pc.mana.max.ToString()) :
"");
69 c =
EMono.Colors.Dark.gradientSP.Evaluate((
float)
EMono.pc.stamina.value / (
float)
EMono.pc.stamina.max);
70 this.gaugeStamina.textNow.text =
"".TagColor(c,
EMono.pc.stamina.value.ToString() ??
"") + (this.extra.showMax ? (
"/" +
EMono.pc.stamina.max.ToString()) :
"");
71 this.goBarrier.SetActive(
false);
72 this.textBarrier.text =
"10";
76 public override void OnSetContextMenu(UIContextMenu m)
78 UIContextMenu uicontextMenu = m.AddChild(
"setting");
79 uicontextMenu.AddSlider(
"layout", (
float n) => n.ToString() ??
"", (
float)
this.extra.layout, delegate(
float a)
81 this.extra.layout = (int)a;
84 }, 0f, 2f,
true,
true,
false);
85 uicontextMenu.AddToggle(
"showGauge", this.extra.showGauge, delegate(
bool a)
87 this.extra.showGauge = a;
89 this.RebuildLayout(
true);
91 uicontextMenu.AddToggle(
"showMax", this.extra.showMax, delegate(
bool a)
93 this.extra.showMax = a;
95 this.RebuildLayout(
true);
97 uicontextMenu.AddToggle(
"stamina", this.extra.stamina, delegate(
bool a)
99 this.extra.stamina = a;
101 this.RebuildLayout(
true);
103 base.SetBaseContextMenu(m);
107 public Gauge gaugeHP;
110 public Gauge gaugeMP;
113 public Gauge gaugeStamina;
116 public UIText textHP;
119 public UIText textMP;
122 public UIText textStamina;
125 public UIText textBarrier;
128 public GridLayoutGroup grid;
131 public GameObject goBarrier;
142 public bool showGauge;