Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
UIHangIcon Class Reference
Inheritance diagram for UIHangIcon:
EMono

Public Member Functions

void OnClickCorner ()
 
void OnClick ()
 
void Refresh ()
 

Public Attributes

Image image
 
UIButton button
 
string id
 
bool rightClick
 
bool windowCorner
 

Static Public Attributes

static Sprite lastCorner
 
- Static Public Attributes inherited from EMono
static Core core
 

Private Member Functions

void Awake ()
 

Private Attributes

Sprite original
 

Additional Inherited Members

- Static Public Member Functions inherited from EMono
static int rnd (int a)
 
- 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]
 

Detailed Description

Definition at line 4 of file UIHangIcon.cs.

Member Function Documentation

◆ Awake()

void UIHangIcon.Awake ( )
inlineprivate

Definition at line 20 of file UIHangIcon.cs.

21 {
22 if (!image && (bool)button)
23 {
24 image = button.image;
25 }
26 original = image.sprite;
27 if ((bool)button && !rightClick)
28 {
29 button.onClick.AddListener(OnClick);
30 }
31 Refresh();
32 }
UIButton button
Definition: UIHangIcon.cs:8
Sprite original
Definition: UIHangIcon.cs:16
void Refresh()
Definition: UIHangIcon.cs:68
bool rightClick
Definition: UIHangIcon.cs:12
Image image
Definition: UIHangIcon.cs:6
void OnClick()
Definition: UIHangIcon.cs:39

References button, image, OnClick(), original, Refresh(), and rightClick.

◆ OnClick()

void UIHangIcon.OnClick ( )
inline

Definition at line 39 of file UIHangIcon.cs.

40 {
42 {
43 return;
44 }
46 if (EMono.ui.contextMenu.isActive)
47 {
48 EMono.ui.contextMenu.currentMenu.Hide();
50 }
51 LayerCollectible layerCollectible = EMono.ui.ToggleLayer<LayerCollectible>();
52 if (layerCollectible == null)
53 {
54 return;
55 }
56 EMono.ui.hud.hint.Show("h_hang");
57 layerCollectible.onClick = delegate(Hoard.Item a)
58 {
59 EMono.player.hangIcons[id] = a.id;
60 if (this != null && base.gameObject != null)
61 {
62 Refresh();
63 }
64 return true;
65 };
66 }
static ActionMode DefaultMode
Definition: ActionMode.cs:7
void Activate(bool toggle=true, bool forceActivate=false)
Definition: ActionMode.cs:339
void Consume()
Definition: ButtonState.cs:184
bool IsGameStarted
Definition: Core.cs:84
Definition: EInput.cs:8
static ButtonState rightMouse
Definition: EInput.cs:351
Definition: EMono.cs:4
static Core core
Definition: EMono.cs:5
static Player player
Definition: EMono.cs:11
static UI ui
Definition: EMono.cs:15
Definition: Hoard.cs:8
Dictionary< string, string > hangIcons
Definition: Player.cs:844
string id
Definition: UIHangIcon.cs:10

References ActionMode.Activate(), ButtonState.Consume(), EMono.core, ActionMode.DefaultMode, Player.hangIcons, id, Core.IsGameStarted, EMono.player, Refresh(), EInput.rightMouse, and EMono.ui.

Referenced by Awake().

◆ OnClickCorner()

void UIHangIcon.OnClickCorner ( )
inline

Definition at line 34 of file UIHangIcon.cs.

35 {
36 SE.Play("Ambience/Random/windchime1");
37 }

◆ Refresh()

void UIHangIcon.Refresh ( )
inline

Definition at line 68 of file UIHangIcon.cs.

69 {
70 if (!Core.Instance)
71 {
72 return;
73 }
75 {
76 image.sprite = (lastCorner = EMono.core.refs.spritesCorner.NextItem(lastCorner));
77 }
78 else
79 {
80 string str = ((!windowCorner) ? EMono.player.hangIcons.TryGetValue(id) : EMono.player.hoard.items.RandomItem()?.id);
81 if (!str.IsEmpty())
82 {
83 image.sprite = EMono.player.hoard.GetSprite(str);
84 }
85 }
86 image.SetNativeSize();
87 }
new UISetting ui
Definition: CoreConfig.cs:588
List< Sprite > spritesCorner
Definition: CoreRef.cs:349
Definition: Core.cs:14
CoreRef refs
Definition: Core.cs:51
static new Core Instance
Definition: Core.cs:15
CoreConfig config
Definition: Core.cs:70
Sprite GetSprite(string id)
Definition: Hoard.cs:211
Dictionary< string, Item > items
Definition: Hoard.cs:106
Hoard hoard
Definition: Player.cs:892
static Sprite lastCorner
Definition: UIHangIcon.cs:18
bool windowCorner
Definition: UIHangIcon.cs:14

References Core.config, EMono.core, CoreConfig.UISetting.cornerHoard, Hoard.GetSprite(), Player.hangIcons, Player.hoard, image, Core.Instance, Core.IsGameStarted, Hoard.items, lastCorner, EMono.player, Core.refs, CoreRef.spritesCorner, CoreConfig.ui, and windowCorner.

Referenced by Awake(), UI.OnActivateZone(), and OnClick().

Member Data Documentation

◆ button

UIButton UIHangIcon.button

Definition at line 8 of file UIHangIcon.cs.

Referenced by Awake().

◆ id

string UIHangIcon.id

Definition at line 10 of file UIHangIcon.cs.

Referenced by OnClick().

◆ image

Image UIHangIcon.image

Definition at line 6 of file UIHangIcon.cs.

Referenced by Awake(), and Refresh().

◆ lastCorner

Sprite UIHangIcon.lastCorner
static

Definition at line 18 of file UIHangIcon.cs.

Referenced by Refresh().

◆ original

Sprite UIHangIcon.original
private

Definition at line 16 of file UIHangIcon.cs.

Referenced by Awake().

◆ rightClick

bool UIHangIcon.rightClick

Definition at line 12 of file UIHangIcon.cs.

Referenced by Awake().

◆ windowCorner

bool UIHangIcon.windowCorner

Definition at line 14 of file UIHangIcon.cs.

Referenced by Refresh().


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