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

Classes

class  Extra
 

Public Member Functions

override object CreateExtra ()
 
override void OnActivate ()
 
void Rebuild ()
 
void Refresh ()
 
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 ()
 

Public Attributes

Gauge gaugeHP
 
Gauge gaugeMP
 
Gauge gaugeStamina
 
UIText textHP
 
UIText textMP
 
UIText textStamina
 
UIText textBarrier
 
GridLayoutGroup grid
 
GameObject goBarrier
 
- Public Attributes inherited from Widget
Image imageBG
 
SoundData soundActivate
 
UIDragPanel dragPanel
 
RectTransform tipPivotLeft
 
RectTransform tipPivotRight
 

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 }
 
- Static Public Member Functions inherited from EMono
static int rnd (int a)
 
- Static Public Attributes inherited from EMono
static Core core
 
- 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 5 of file WidgetHP.cs.

Member Function Documentation

◆ CreateExtra()

override object WidgetHP.CreateExtra ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 42 of file WidgetHP.cs.

43 {
44 return new Extra();
45 }

◆ OnActivate()

override void WidgetHP.OnActivate ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 47 of file WidgetHP.cs.

48 {
49 Rebuild();
50 InvokeRepeating("Refresh", 0f, 0.2f);
51 }
void Rebuild()
Definition: WidgetHP.cs:53

References Rebuild().

◆ OnSetContextMenu()

override void WidgetHP.OnSetContextMenu ( UIContextMenu  m)
inlinevirtual

Reimplemented from Widget.

Definition at line 94 of file WidgetHP.cs.

95 {
96 UIContextMenu uIContextMenu = m.AddChild("setting");
97 uIContextMenu.AddSlider("layout", (float n) => n.ToString() ?? "", extra.layout, delegate(float a)
98 {
99 extra.layout = (int)a;
100 Rebuild();
102 }, 0f, 2f, isInt: true);
103 uIContextMenu.AddToggle("showGauge", extra.showGauge, delegate(bool a)
104 {
105 extra.showGauge = a;
106 Refresh();
107 this.RebuildLayout(recursive: true);
108 });
109 uIContextMenu.AddToggle("showMax", extra.showMax, delegate(bool a)
110 {
111 extra.showMax = a;
112 Refresh();
113 this.RebuildLayout(recursive: true);
114 });
115 uIContextMenu.AddToggle("stamina", extra.stamina, delegate(bool a)
116 {
117 extra.stamina = a;
118 Refresh();
119 this.RebuildLayout(recursive: true);
120 });
122 }
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)
UIContextMenu AddChild(string idLang, TextAnchor anchor)
bool showGauge
Definition: WidgetHP.cs:13
bool stamina
Definition: WidgetHP.cs:19
bool showMax
Definition: WidgetHP.cs:16
void Refresh()
Definition: WidgetHP.cs:60
Extra extra
Definition: WidgetHP.cs:40
void SetBaseContextMenu(UIContextMenu m)
Definition: Widget.cs:608
void ClampToScreen()
Definition: Widget.cs:437

References UIContextMenu.AddChild(), UIContextMenu.AddSlider(), UIContextMenu.AddToggle(), Widget.ClampToScreen(), extra, WidgetHP.Extra.layout, Rebuild(), Refresh(), Widget.SetBaseContextMenu(), WidgetHP.Extra.showGauge, WidgetHP.Extra.showMax, and WidgetHP.Extra.stamina.

◆ Rebuild()

void WidgetHP.Rebuild ( )
inline

Definition at line 53 of file WidgetHP.cs.

54 {
55 grid.constraintCount = extra.layout + 1;
56 Refresh();
57 this.RebuildLayout();
58 }

References Refresh().

Referenced by OnActivate(), and OnSetContextMenu().

◆ Refresh()

void WidgetHP.Refresh ( )
inline

Definition at line 60 of file WidgetHP.cs.

61 {
62 if (!EMono.game.isLoading)
63 {
64 if (EMono.pc.hp > EMono.pc.MaxHP)
65 {
66 EMono.pc.hp = EMono.pc.MaxHP;
67 }
69 {
70 EMono.pc.mana.value = EMono.pc.mana.max;
71 }
73 {
74 EMono.pc.stamina.value = EMono.pc.stamina.max;
75 }
76 }
77 gaugeHP.hideBar = !extra.showGauge;
78 gaugeMP.hideBar = !extra.showGauge;
79 gaugeStamina.hideBar = !extra.showGauge;
80 gaugeStamina.SetActive(extra.stamina);
84 Color c = EMono.Colors.Dark.gradientHP.Evaluate((float)EMono.pc.hp / (float)EMono.pc.MaxHP);
85 gaugeHP.textNow.text = "".TagColor(c, EMono.pc.hp.ToString() ?? "") + (extra.showMax ? ("/" + EMono.pc.MaxHP) : "");
86 c = EMono.Colors.Dark.gradientMP.Evaluate((float)EMono.pc.mana.value / (float)EMono.pc.mana.max);
87 gaugeMP.textNow.text = "".TagColor(c, EMono.pc.mana.value.ToString() ?? "") + (extra.showMax ? ("/" + EMono.pc.mana.max) : "");
88 c = EMono.Colors.Dark.gradientSP.Evaluate((float)EMono.pc.stamina.value / (float)EMono.pc.stamina.max);
89 gaugeStamina.textNow.text = "".TagColor(c, EMono.pc.stamina.value.ToString() ?? "") + (extra.showMax ? ("/" + EMono.pc.stamina.max) : "");
90 goBarrier.SetActive(value: false);
91 textBarrier.text = "10";
92 }
int hp
Definition: Card.cs:226
override int MaxHP
Definition: Chara.cs:693
Stats mana
Definition: Chara.cs:963
Stats stamina
Definition: Chara.cs:955
SkinColorProfile Dark
Definition: EMono.cs:4
static ColorProfile Colors
Definition: EMono.cs:35
static Chara pc
Definition: EMono.cs:13
static Game game
Definition: EMono.cs:7
bool isLoading
Definition: Game.cs:235
void UpdateValue(float now, float _max)
Definition: Gauge.cs:68
virtual int value
Definition: Stats.cs:56
virtual int max
Definition: Stats.cs:68
Gauge gaugeMP
Definition: WidgetHP.cs:24
GameObject goBarrier
Definition: WidgetHP.cs:38
Gauge gaugeStamina
Definition: WidgetHP.cs:26
Gauge gaugeHP
Definition: WidgetHP.cs:22

References Color, EMono.Colors, ColorProfile.Dark, extra, EMono.game, gaugeHP, gaugeMP, gaugeStamina, goBarrier, SkinColorProfile.gradientHP, SkinColorProfile.gradientMP, SkinColorProfile.gradientSP, Card.hp, Game.isLoading, Chara.mana, Stats.max, Chara.MaxHP, EMono.pc, WidgetHP.Extra.showGauge, WidgetHP.Extra.showMax, Chara.stamina, WidgetHP.Extra.stamina, Gauge.UpdateValue(), and Stats.value.

Referenced by OnSetContextMenu(), and Rebuild().

Member Data Documentation

◆ gaugeHP

Gauge WidgetHP.gaugeHP

Definition at line 22 of file WidgetHP.cs.

Referenced by Refresh().

◆ gaugeMP

Gauge WidgetHP.gaugeMP

Definition at line 24 of file WidgetHP.cs.

Referenced by Refresh().

◆ gaugeStamina

Gauge WidgetHP.gaugeStamina

Definition at line 26 of file WidgetHP.cs.

Referenced by Refresh().

◆ goBarrier

GameObject WidgetHP.goBarrier

Definition at line 38 of file WidgetHP.cs.

Referenced by Refresh().

◆ grid

GridLayoutGroup WidgetHP.grid

Definition at line 36 of file WidgetHP.cs.

◆ textBarrier

UIText WidgetHP.textBarrier

Definition at line 34 of file WidgetHP.cs.

◆ textHP

UIText WidgetHP.textHP

Definition at line 28 of file WidgetHP.cs.

◆ textMP

UIText WidgetHP.textMP

Definition at line 30 of file WidgetHP.cs.

◆ textStamina

UIText WidgetHP.textStamina

Definition at line 32 of file WidgetHP.cs.

Property Documentation

◆ extra

Extra WidgetHP.extra
get

Definition at line 40 of file WidgetHP.cs.

Referenced by OnSetContextMenu(), and Refresh().


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