Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
HotItemEQSet Class Reference
Inheritance diagram for HotItemEQSet:
HotAction HotItem UIButton.Item

Classes

class  Item
 

Public Member Functions

HotItemEQSet Register ()
 
override void Perform ()
 
override void OnShowContextMenu (UIContextMenu m)
 
- Public Member Functions inherited from HotAction
override void OnClick (ButtonHotItem b, Hotbar h)
 
virtual void Perform ()
 
override void OnShowContextMenu (UIContextMenu m)
 
- Public Member Functions inherited from HotItem
string TextHotkey ()
 
virtual void OnClick (ButtonHotItem b, Hotbar h)
 
virtual void OnRightClick (ButtonHotItem b)
 
virtual bool CanAutoFire (Chara tg)
 
virtual void OnSetCurrentItem ()
 
virtual void OnUnsetCurrentItem ()
 
virtual void OnUnselect ()
 
virtual void SetImage (Image icon)
 
virtual bool TrySetAct (ActPlan p)
 
virtual void OnMarkMapHighlights ()
 
virtual void OnRenderTile (Point point, HitResult result, int dir)
 
- Public Member Functions inherited from UIButton.Item
virtual Sprite GetSprite ()
 
virtual Sprite GetSprite (bool highlight)
 
virtual bool ShouldHighlight ()
 
virtual void OnAddedToBar ()
 
virtual void OnShowContextMenu (UIContextMenu m)
 
virtual void OnHover (UIButton b)
 
virtual void OnClick (UIButton b)
 
virtual void OnSetItem (UIButton b)
 
virtual void SetSubText (UIText t)
 

Public Attributes

List< int > ids = new List<int>()
 
- Public Attributes inherited from HotAction
int _bgColor
 
string text
 
- Public Attributes inherited from HotItem
ButtonHotItem button
 
Hotbar hotbar
 
bool disabled
 
- Public Attributes inherited from UIButton.Item
bool always
 

Properties

override string Id [get]
 
override bool CanChangeIconColor [get]
 
override string TextTip [get]
 
- Properties inherited from HotAction
Color bgColor [get, set]
 
override Color SpriteColor [get]
 
virtual string Id [get]
 
virtual bool CanChangeIconColor [get]
 
virtual bool CanName [get]
 
override string Name [get]
 
override string pathSprite [get]
 
- Properties inherited from HotItem
override Sprite SpriteHighlight [get]
 
override bool IsSelectable [get]
 
override string TextTip [get]
 
virtual Thing RenderThing [get]
 
virtual Thing Thing [get]
 
virtual Thing Tool [get]
 
virtual bool IsTool [get]
 
virtual bool LookAtMouse [get]
 
virtual bool IsGameAction [get]
 
virtual bool UseUIObjMaterial [get]
 
- Properties inherited from UIButton.Item
virtual string TextTip [get]
 
virtual string Name [get]
 
virtual Sprite SpriteHighlight [get]
 
virtual string pathSprite [get]
 
virtual bool IsSelectable [get]
 
virtual bool AdjustImageSize [get]
 
virtual bool UseIconForHighlight [get]
 
virtual bool KeepVisibleWhenHighlighted [get]
 
virtual Color SpriteColor [get]
 
virtual Vector3 SpriteScale [get]
 
virtual bool Hidden [get]
 
virtual Transition Transition [get]
 

Detailed Description

Definition at line 5 of file HotItemEQSet.cs.

Member Function Documentation

◆ OnShowContextMenu()

override void HotItemEQSet.OnShowContextMenu ( UIContextMenu  m)
inlinevirtual

Reimplemented from HotAction.

Definition at line 111 of file HotItemEQSet.cs.

112 {
113 base.OnShowContextMenu(m);
114 m.AddButton("updateEQ", delegate
115 {
116 Register();
117 });
118 }
HotItemEQSet Register()
Definition: HotItemEQSet.cs:38
void AddButton(Func< string > funcText, UnityAction action=null)

References UIContextMenu.AddButton(), and Register().

◆ Perform()

override void HotItemEQSet.Perform ( )
inlinevirtual

Reimplemented from HotAction.

Definition at line 52 of file HotItemEQSet.cs.

53 {
54 for (int j = 0; j < 2; j++)
55 {
56 Dictionary<int, Thing> dictionary = new Dictionary<int, Thing>();
57 foreach (BodySlot slot2 in EClass.pc.body.slots)
58 {
59 if (slot2.elementId != 44 && slot2.thing != null && slot2.thing.blessedState >= BlessedState.Normal)
60 {
61 dictionary.Add(slot2.thing.c_equippedSlot - 1, slot2.thing);
62 EClass.pc.body.Unequip(slot2.thing, refresh: false);
63 }
64 }
65 Card card = null;
66 foreach (int i in ids)
67 {
68 Thing thing = EClass.pc.things.Find((Thing t) => t.uid == i && !t.isEquipped);
69 if (thing == null)
70 {
71 continue;
72 }
73 BodySlot slot = EClass.pc.body.GetSlot(thing, onlyEmpty: true);
74 if (slot == null || thing == slot.thing)
75 {
76 continue;
77 }
78 Card parentCard = thing.parentCard;
79 int invX = thing.invX;
80 int invY = thing.invY;
81 EClass.pc.body.Equip(thing, slot, msg: false);
82 if (dictionary.ContainsKey(slot.index))
83 {
84 Thing thing2 = dictionary[slot.index];
85 if (thing2.uid != thing.uid)
86 {
87 parentCard.AddThing(thing2);
88 card = parentCard;
89 thing2.invX = invX;
90 thing2.invY = invY;
91 dictionary.Remove(slot.index);
92 }
93 }
94 }
95 if (card == null)
96 {
97 continue;
98 }
99 foreach (Thing value in dictionary.Values)
100 {
101 if (!value.isEquipped && !card.things.IsFull(value))
102 {
103 card.AddThing(value);
104 }
105 }
106 }
107 SE.Equip();
109 }
BlessedState
Definition: BlessedState.cs:2
int index
Definition: BodySlot.cs:10
int elementId
Definition: BodySlot.cs:6
Thing thing
Definition: BodySlot.cs:8
Definition: Card.cs:11
int c_equippedSlot
Definition: Card.cs:912
int invY
Definition: Card.cs:1831
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:2901
int uid
Definition: Card.cs:118
ThingContainer things
Definition: Card.cs:34
int invX
Definition: Card.cs:1819
BlessedState blessedState
Definition: Card.cs:262
Card parentCard
Definition: Card.cs:99
void Unequip(Thing thing, bool refresh=true)
Definition: CharaBody.cs:49
List< BodySlot > slots
Definition: CharaBody.cs:8
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
Definition: CharaBody.cs:182
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Definition: CharaBody.cs:341
CharaBody body
Definition: Chara.cs:91
Definition: EClass.cs:5
static Chara pc
Definition: EClass.cs:14
List< int > ids
Definition: HotItemEQSet.cs:17
static void Refresh()
Definition: LayerChara.cs:16
Thing Find(int uid)
Definition: Thing.cs:8
bool isEquipped
Definition: Thing.cs:17

References Card.AddThing(), Card.blessedState, Chara.body, Card.c_equippedSlot, card, BodySlot.elementId, CharaBody.Equip(), ThingContainer.Find(), CharaBody.GetSlot(), ids, BodySlot.index, Card.invX, Card.invY, Thing.isEquipped, Card.parentCard, EClass.pc, LayerChara.Refresh(), CharaBody.slots, BodySlot.thing, Card.things, Card.uid, and CharaBody.Unequip().

◆ Register()

HotItemEQSet HotItemEQSet.Register ( )
inline

Definition at line 38 of file HotItemEQSet.cs.

39 {
40 ids.Clear();
41 foreach (BodySlot slot in EClass.pc.body.slots)
42 {
43 if (slot.elementId != 44 && slot.thing != null)
44 {
45 ids.Add(slot.thing.uid);
46 }
47 }
48 SE.Equip();
49 return this;
50 }

References Chara.body, BodySlot.elementId, ids, EClass.pc, CharaBody.slots, BodySlot.thing, and Card.uid.

Referenced by OnShowContextMenu().

Member Data Documentation

◆ ids

List<int> HotItemEQSet.ids = new List<int>()

Definition at line 17 of file HotItemEQSet.cs.

Referenced by Perform(), and Register().

Property Documentation

◆ CanChangeIconColor

override bool HotItemEQSet.CanChangeIconColor
get

Definition at line 21 of file HotItemEQSet.cs.

◆ Id

override string HotItemEQSet.Id
get

Definition at line 19 of file HotItemEQSet.cs.

◆ TextTip

override string HotItemEQSet.TextTip
get

Definition at line 23 of file HotItemEQSet.cs.

24 {
25 get
26 {
27 string text = base.text.IsEmpty("EQSet".lang()) + TextHotkey() + Environment.NewLine;
28 foreach (int i in ids)
29 {
30 Thing thing = EClass.pc.things.Find((Thing t) => t.uid == i);
31 text += ((thing == null) ? "missingEQ".lang() : thing.Name);
32 text += Environment.NewLine;
33 }
34 return text.TrimEnd(Environment.NewLine.ToCharArray());
35 }
36 }
string Name
Definition: Card.cs:2013
string text
Definition: HotAction.cs:10
string TextHotkey()
Definition: HotItem.cs:50

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