Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
LayerSkinDeco Class Reference
Inheritance diagram for LayerSkinDeco:
ELayer Layer IUISkin

Public Member Functions

override void OnInit ()
 
void SetWidget (Widget _widget)
 
override void OnUpdateInput ()
 
void Activate (SkinDecoActor actor)
 
override void OnKill ()
 
- Public Member Functions inherited from ELayer
override void OnBeforeAddLayer ()
 
void InitInspector ()
 
sealed override void Init ()
 
override void OnAfterAddLayer ()
 
void TryShowHelp ()
 
void AddLayerToUI (string id)
 
void TryShowHint (string _langHint=null)
 
void TalkHomeMemeber (string id)
 
void TalkMaid (string id)
 
override void OnRightClick ()
 
- Public Member Functions inherited from Layer
virtual string GetTextHeader (Window window)
 
virtual bool HeaderIsListOf (int id)
 
virtual void Init ()
 
virtual void OnInit ()
 
virtual void OnAfterInit ()
 
virtual void ApplySkin ()
 
void ShowScreenLock (string id)
 
void UpdateInput ()
 
virtual void OnUpdateInput ()
 
virtual void OnRightClick ()
 
virtual bool OnBack ()
 
virtual void OnChangeLayer ()
 
virtual void OnCreate ()
 
void _AddLayer (string id)
 
Layer AddLayer (string id)
 
AddLayer< T > ()
 
AddLayer< T > (string id)
 
AddLayerDontCloseOthers< T > ()
 
Layer AddLayerDontCloseOthers (Layer l)
 
GetOrAddLayer< T > ()
 
virtual void OnBeforeAddLayer ()
 
virtual void OnAfterAddLayer ()
 
Layer AddLayer (Layer l)
 
void ToggleLayer (string id)
 
ToggleLayer< T > (string id=null)
 
void WaitAndClose ()
 
void OnClickClose ()
 
virtual void Close ()
 
void CloseLayers ()
 
void RemoveLayers (bool removeImportant=false)
 
bool RemoveLayer< T > ()
 
void RemoveLayer (Layer l)
 
virtual void OnKill ()
 
Layer SetOnKill (Action action)
 
void DisableClose ()
 
void Delay (float duration=0.05f)
 
Layer SetDelay (float d)
 
Layer GetLayer (string id)
 
GetLayer< T > (bool fromTop=false)
 
Layer GetTopLayer ()
 
void SwitchContent (int idWindow, int i)
 
virtual void OnSwitchContent (Window window)
 
Layer SetTitles (string langList, string idHeaderRow=null)
 
bool IsBlockWidgetClick ()
 
bool IsHideHud ()
 
bool IsAllowGeneralInput ()
 
bool IsUseBlur ()
 
bool IsPointerOnLayer ()
 
void ApplySkin ()
 

Public Attributes

Widget widget
 
Transform widgetHolder
 
- Public Attributes inherited from Layer
Option option
 
UnityEvent onKill
 
Anime animeIn
 
Anime animeOut
 
bool closeOthers
 
bool defaultActionMode = true
 
Button screenLock
 
Layer parent
 
string idLayer
 
List< Layerlayers = new List<Layer>()
 
Vector2 lastParentPos
 
List< Windowwindows = new List<Window>()
 
string langHint
 

Properties

List< SkinDecodecos [get]
 
SkinConfig cfg [get]
 
- Properties inherited from ELayer
static Core core [get]
 
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static FactionBranch Branch [get]
 
static Faction Home [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static CoreConfig config [get]
 
static GameSetting setting [get]
 
static ColorProfile Colors [get]
 
static SourceManager sources [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
bool IsFloat [get]
 
virtual string IdHelp [get]
 
- Properties inherited from Layer
Layer TopLayer [get]
 
string uid [get]
 
virtual RectTransform rectLayers [get]
 
virtual bool blockWidgetClick [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from ELayer
static int rnd (int a)
 
- Static Public Member Functions inherited from Layer
static T Create< T > ()
 
static T Create< T > (string path)
 
static Layer Create (string path)
 
- Static Public Attributes inherited from Layer
static int skipInput
 
static bool closeOnRightClick
 
static bool rightClicked
 
static bool cancelKeyDown
 
static bool ignoreSounds
 
static Transform blurStopInstance
 
static string[] searchPath = new string[3] { "Layer", "Layer/Dialog", "Layer/LayerHome" }
 
- Protected Member Functions inherited from ELayer
sealed override void _Close ()
 
sealed override void Kill ()
 
- Protected Member Functions inherited from Layer
virtual void Awake ()
 
virtual void _Close ()
 
virtual void Kill ()
 
- Protected Attributes inherited from Layer
RectTransform _rect
 
bool isDestroyed
 

Detailed Description

Definition at line 5 of file LayerSkinDeco.cs.

Member Function Documentation

◆ Activate()

void LayerSkinDeco.Activate ( SkinDecoActor  actor)
inline

Definition at line 137 of file LayerSkinDeco.cs.

138 {
139 actor.image.raycastTarget = true;
140 actor.transform.SetParent(base.transform, worldPositionStays: true);
141 UIDragPanel uIDragPanel = actor.gameObject.AddComponent<UIDragPanel>();
142 uIDragPanel.target = actor.Rect();
143 uIDragPanel.bound = actor.Rect();
144 uIDragPanel.clamp = false;
145 }

Referenced by OnUpdateInput(), and SetWidget().

◆ OnInit()

override void LayerSkinDeco.OnInit ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 16 of file LayerSkinDeco.cs.

17 {
18 base.OnInit();
19 }

◆ OnKill()

override void LayerSkinDeco.OnKill ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 147 of file LayerSkinDeco.cs.

148 {
149 widget.transform.SetParent(ELayer.ui.widgets.transform, worldPositionStays: false);
151 foreach (SkinDeco deco in decos)
152 {
153 SkinDecoActor actor = deco.actor;
154 actor.image.raycastTarget = false;
155 UnityEngine.Object.DestroyImmediate(actor.gameObject.GetComponent<UIDragPanel>());
156 actor.transform.SetParent(widget.transform, worldPositionStays: true);
157 deco.x = (int)actor.Rect().anchoredPosition.x;
158 deco.y = (int)actor.Rect().anchoredPosition.y;
159 actor.Refresh();
160 }
161 }
Definition: ELayer.cs:4
static UI ui
Definition: ELayer.cs:21
List< SkinDeco > decos
SkinDecoActor actor
Definition: SkinDeco.cs:8
void RefreshOrder()
Definition: Widget.cs:272

References SkinDeco.actor, decos, SkinDecoActor.Refresh(), Widget.RefreshOrder(), ELayer.ui, and widget.

◆ OnUpdateInput()

override void LayerSkinDeco.OnUpdateInput ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 31 of file LayerSkinDeco.cs.

32 {
34 {
36 {
37 return;
38 }
39 SkinDecoActor selected = InputModuleEX.GetComponentOf<SkinDecoActor>();
40 Vector3 clickPos = Input.mousePosition;
41 UIContextMenu i = ELayer.ui.CreateContextMenu();
42 if ((bool)selected)
43 {
44 SkinDeco deco = selected.owner;
45 i.AddButton("editColor", delegate
46 {
47 ELayer.ui.AddLayer<LayerColorPicker>().SetColor(deco.color, Color.white, delegate(PickerState state, Color _c)
48 {
49 deco.color = _c;
50 selected.Refresh();
51 });
52 });
53 i.AddButton("bringToTop", delegate
54 {
55 decos.Remove(deco);
56 decos.Add(deco);
57 selected.transform.SetAsLastSibling();
58 });
59 i.AddSlider("rotation", (float n) => (n * 45f).ToString() ?? "", deco.rz, delegate(float a)
60 {
61 deco.rz = (int)a;
62 selected.Refresh();
63 }, 0f, 7f, isInt: true);
64 i.AddSlider("size", (float n) => n.ToString() ?? "", Mathf.Abs(deco.sx), delegate(float a)
65 {
66 deco.sx = (int)a * ((deco.sx > 0) ? 1 : (-1));
67 deco.sy = (int)a * ((deco.sy > 0) ? 1 : (-1));
68 selected.Refresh();
69 }, 10f, 400f, isInt: true);
70 i.AddToggle("shadow", deco.shadow, delegate(bool a)
71 {
72 deco.shadow = a;
73 selected.Refresh();
74 });
75 i.AddToggle("reverse", deco.reverse, delegate(bool a)
76 {
77 deco.reverse = a;
78 selected.Refresh();
79 });
80 i.AddToggle("placeBeforeWidget", deco.bottom, delegate(bool a)
81 {
82 deco.bottom = a;
83 selected.Refresh();
84 });
85 i.AddButton("removeDeco", delegate
86 {
87 widget.RemoveDeco(selected.owner);
88 });
89 }
90 else
91 {
92 UIContextMenu uIContextMenu = i.AddChild("addDeco");
93 UIList uIList = Util.Instantiate<UIList>("UI/Element/List/ListImageGrid", uIContextMenu);
94 uIList.callbacks = new UIList.Callback<Sprite, UIButton>
95 {
96 onInstantiate = delegate(Sprite a, UIButton _b)
97 {
98 _b.icon.sprite = a;
99 },
100 onClick = delegate(Sprite a, UIButton _b)
101 {
102 SkinDeco skinDeco = new SkinDeco
103 {
104 sx = 100,
105 sy = 100,
106 color = Color.white
107 };
108 skinDeco.id = int.Parse(a.name.Remove(0, 4));
109 widget.AddDeco(skinDeco);
110 SkinDecoActor actor = skinDeco.actor;
111 Activate(actor);
112 actor.transform.position = clickPos;
113 EInput.Consume();
114 i.Hide();
115 }
116 };
117 Sprite[] array = Resources.LoadAll<Sprite>("Media/Graphics/Deco/");
118 foreach (Sprite o in array)
119 {
120 uIList.Add(o);
121 }
122 uIList.Refresh();
123 }
124 i.Show();
125 }
127 {
128 UIContextMenu uIContextMenu2 = ELayer.ui.CreateContextMenu();
129 uIContextMenu2.AddButton("quitEdit", delegate
130 {
131 Close();
132 });
133 uIContextMenu2.Show();
134 }
135 }
PickerState
Definition: PickerState.cs:2
bool dragging
Definition: ButtonState.cs:43
bool clicked
Definition: ButtonState.cs:37
Definition: EInput.cs:8
static void Consume(int _skipFrame)
Definition: EInput.cs:656
static ButtonState leftMouse
Definition: EInput.cs:349
static ButtonState rightMouse
Definition: EInput.cs:351
void Activate(SkinDecoActor actor)
virtual void Close()
Definition: Layer.cs:463
SkinDeco owner
Definition: SkinDecoActor.cs:6
int sy
Definition: SkinDeco.cs:64
int rz
Definition: SkinDeco.cs:88
Color color
Definition: SkinDeco.cs:76
bool bottom
Definition: SkinDeco.cs:136
bool reverse
Definition: SkinDeco.cs:124
int sx
Definition: SkinDeco.cs:52
bool shadow
Definition: SkinDeco.cs:112
UIContextMenuItem AddToggle(string idLang="", bool isOn=false, UnityAction< bool > action=null)
void Show(UIItem i)
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)
void AddButton(Func< string > funcText, UnityAction action=null)
UIContextMenu AddChild(string idLang, TextAnchor anchor)
Definition: UIList.cs:9
override void Add(object item)
Definition: UIList.cs:302
virtual void Refresh(bool highlightLast=false)
Definition: UIList.cs:424
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67
void RemoveDeco(SkinDeco deco)
Definition: Widget.cs:590
void AddDeco(SkinDeco deco)
Definition: Widget.cs:584

References Activate(), SkinDeco.actor, UIContextMenu.AddButton(), UIContextMenu.AddChild(), Widget.AddDeco(), UIContextMenu.AddSlider(), UIContextMenu.AddToggle(), SkinDeco.bottom, ButtonState.clicked, Layer.Close(), Color, SkinDeco.color, EInput.Consume(), decos, ButtonState.down, ButtonState.dragging, UIContextMenu.Hide(), EInput.leftMouse, SkinDecoActor.owner, SkinDecoActor.Refresh(), Widget.RemoveDeco(), SkinDeco.reverse, EInput.rightMouse, SkinDeco.rz, SkinDeco.shadow, UIContextMenu.Show(), SkinDeco.sx, SkinDeco.sy, ELayer.ui, Util, and widget.

◆ SetWidget()

void LayerSkinDeco.SetWidget ( Widget  _widget)
inline

Definition at line 21 of file LayerSkinDeco.cs.

22 {
23 widget = _widget;
24 foreach (SkinDeco deco in decos)
25 {
26 Activate(deco.actor);
27 }
28 widget.transform.SetParent(widgetHolder, worldPositionStays: false);
29 }
Transform widgetHolder

References Activate(), SkinDeco.actor, decos, widget, and widgetHolder.

Member Data Documentation

◆ widget

Widget LayerSkinDeco.widget

Definition at line 8 of file LayerSkinDeco.cs.

Referenced by OnKill(), OnUpdateInput(), and SetWidget().

◆ widgetHolder

Transform LayerSkinDeco.widgetHolder

Definition at line 10 of file LayerSkinDeco.cs.

Referenced by SetWidget().

Property Documentation

◆ cfg

SkinConfig LayerSkinDeco.cfg
get

Definition at line 14 of file LayerSkinDeco.cs.

◆ decos

List<SkinDeco> LayerSkinDeco.decos
get

Definition at line 12 of file LayerSkinDeco.cs.

Referenced by OnKill(), OnUpdateInput(), and SetWidget().


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