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

Public Member Functions

override void OnInit ()
 
void Refresh ()
 
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

UIList list
 
UIList list2
 
UIText textRestart
 
UIButton toggleDisableMods
 
- 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
 

Static Public Attributes

static LayerMod Instance
 
- 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" }
 

Properties

ModManager manager [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]
 

Private Member Functions

void Move (BaseModPackage p, ItemMod b, int a)
 

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)
 
- 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 4 of file LayerMod.cs.

Member Function Documentation

◆ Move()

void LayerMod.Move ( BaseModPackage  p,
ItemMod  b,
int  a 
)
inlineprivate

Definition at line 18 of file LayerMod.cs.

19 {
20 List<BaseModPackage> packages = ELayer.core.mods.packages;
21 int num = packages.IndexOf(p);
22 if (num + a < 0 || num + a >= packages.Count || packages[num + a].builtin)
23 {
24 SE.BeepSmall();
25 return;
26 }
27 packages.Move(p, a);
28 SE.Tab();
29 textRestart.SetActive(enable: true);
31 list.List();
32 }
ModManager mods
Definition: Core.cs:39
Definition: ELayer.cs:4
static Core core
Definition: ELayer.cs:7
UIList list
Definition: LayerMod.cs:8
UIText textRestart
Definition: LayerMod.cs:12
void SaveLoadOrder()
Definition: ModManager.cs:63
override void List()
Definition: UIList.cs:769

References ELayer.core, list, UIList.List(), Core.mods, ModManager.SaveLoadOrder(), and textRestart.

Referenced by OnInit().

◆ OnInit()

override void LayerMod.OnInit ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 34 of file LayerMod.cs.

35 {
36 textRestart.SetActive(enable: false);
38 {
39 ELayer.config.other.disableMods = on;
41 textRestart.SetActive(enable: true);
42 });
43 Instance = this;
44 list.dragScrollView = GetComponentInChildren<UIScrollView>();
45 list.dragViewport = windows[0].Rect();
46 list.dragEdgeSize = 34f;
47 UIList uIList = list;
48 UIList uIList2 = list2;
50 {
51 onClick = delegate
52 {
53 },
54 onInstantiate = delegate(ModPackage a, ItemMod b)
55 {
56 a.UpdateMeta(updateOnly: true);
57 b.package = a;
58 string s = ELayer.core.mods.packages.IndexOf(a) + 1 + ". " + (a.isInPackages ? "[Local] " : "") + a.title;
59 b.buttonActivate.mainText.SetText(s, (!a.IsValidVersion()) ? FontColor.Bad : (a.activated ? FontColor.ButtonGeneral : FontColor.Passive));
60 b.buttonActivate.subText.text = a.version;
61 b.buttonLock.mainText.text = a.author;
62 b.buttonUp.SetActive(!a.builtin);
63 b.buttonDown.SetActive(!a.builtin);
64 b.buttonToggle.SetToggle(a.willActivate);
65 b.buttonUp.SetOnClick(delegate
66 {
67 Move(a, b, -1);
68 });
69 b.buttonDown.SetOnClick(delegate
70 {
71 Move(a, b, 1);
72 });
74 bt.SetOnClick(delegate
75 {
76 a.willActivate = !a.willActivate;
77 bt.SetToggle(a.willActivate);
79 textRestart.SetActive(enable: true);
80 });
81 bt.interactable = !a.builtin;
82 b.buttonActivate.onClick.AddListener(delegate
83 {
84 Refresh();
85 UIContextMenu uIContextMenu = ELayer.ui.CreateContextMenuInteraction();
86 if (ELayer.debug.enable || (!BaseCore.IsOffline && a.isInPackages && !a.builtin && !ELayer.core.version.demo))
87 {
88 uIContextMenu.AddButton("mod_publish", delegate
89 {
90 Core.TryWarnUpload(delegate
91 {
92 Dialog.YesNo("mod_publish_warn".lang(a.title, a.id, a.author), delegate
93 {
94 ELayer.core.steam.CreateUserContent(a);
95 });
96 });
97 });
98 }
99 if (!a.builtin)
100 {
101 uIContextMenu.AddButton(a.willActivate ? "mod_deactivate" : "mod_activate", delegate
102 {
103 SE.Click();
104 a.willActivate = !a.willActivate;
105 ELayer.core.mods.SaveLoadOrder();
106 list.List();
107 textRestart.SetActive(enable: true);
108 });
109 if (!a.isInPackages && !a.workshopId.IsEmpty())
110 {
111 uIContextMenu.AddButton("mod_convert_local", delegate
112 {
113 SE.Click();
114 string path = ("Mod_" + a.workshopId + "_" + a.id).SanitizeDirectoryName();
115 string text2 = Path.Combine(BaseModManager.rootMod, path);
116 a.CopyContentTo(text2);
117 ModPackage modPackage = manager.AddPackage(new DirectoryInfo(text2), isInPackages: true);
118 manager.packages.Move(modPackage, manager.packages.IndexOf(a) - manager.packages.Count + 2);
119 modPackage.willActivate = false;
120 modPackage.activated = false;
122 list.List();
123 textRestart.SetActive(enable: true);
124 });
125 }
126 if (a.isInPackages && a.IsSourceLocalizable)
127 {
128 uIContextMenu.AddButton("mod_export_text", delegate
129 {
130 SE.Click();
131 string text = a.UpdateSourceLocalizationFile(Lang.langCode, force: true);
132 ELayer.ui.Say(text);
133 });
134 }
135 }
136 uIContextMenu.AddButton("mod_info", delegate
137 {
138 SE.Click();
139 Util.ShowExplorer(a.dirInfo.FullName + "/package.xml");
140 });
141 uIContextMenu.Show();
142 });
143 b.buttonLock.onClick.AddListener(Refresh);
144 },
145 onList = delegate
146 {
147 foreach (BaseModPackage package in manager.packages)
148 {
149 if (package.builtin)
150 {
151 list2.Add(package);
152 }
153 else
154 {
155 list.Add(package);
156 }
157 }
158 },
159 onRefresh = Refresh,
160 onDragReorder = delegate(ModPackage p, int a)
161 {
163 manager.packages.Move(p, a);
164 SE.Tab();
165 textRestart.SetActive(enable: true);
167 list.List();
168 },
169 canDragReorder = (ModPackage p) => !p.builtin
170 };
171 UIList.ICallback callbacks = obj;
172 uIList2.callbacks = obj;
173 uIList.callbacks = callbacks;
174 list.List();
175 list2.List();
176 }
FontColor
Definition: FontColor.cs:2
static bool IsOffline
Definition: BaseCore.cs:9
Version version
Definition: BaseCore.cs:17
static BaseCore Instance
Definition: BaseCore.cs:11
virtual void FreezeScreen(float duration=0.2f)
Definition: BaseCore.cs:80
static string rootMod
void Save()
Definition: CoreConfig.cs:840
OtherSetting other
Definition: CoreConfig.cs:627
bool enable
Definition: CoreDebug.cs:301
Definition: Core.cs:14
static void TryWarnUpload(Action action)
Definition: Core.cs:848
Definition: Dialog.cs:7
static Dialog YesNo(string langDetail, Action actionYes, Action actionNo=null, string langYes="yes", string langNo="no")
Definition: Dialog.cs:252
static CoreDebug debug
Definition: ELayer.cs:43
static CoreConfig config
Definition: ELayer.cs:31
static UI ui
Definition: ELayer.cs:21
UIButton buttonActivate
Definition: ItemMod.cs:5
UIButton buttonUp
Definition: ItemMod.cs:11
UIButton buttonToggle
Definition: ItemMod.cs:15
UIButton buttonDown
Definition: ItemMod.cs:13
UIButton buttonLock
Definition: ItemMod.cs:9
Definition: Lang.cs:7
static string langCode
Definition: Lang.cs:29
ModManager manager
Definition: LayerMod.cs:16
void Move(BaseModPackage p, ItemMod b, int a)
Definition: LayerMod.cs:18
UIButton toggleDisableMods
Definition: LayerMod.cs:14
UIList list2
Definition: LayerMod.cs:10
void Refresh()
Definition: LayerMod.cs:178
static LayerMod Instance
Definition: LayerMod.cs:6
List< Window > windows
Definition: Layer.cs:116
ModPackage AddPackage(DirectoryInfo dir, bool isInPackages=false)
Definition: ModManager.cs:159
void CopyContentTo(string dir)
Definition: ModPackage.cs:19
override string UpdateSourceLocalizationFile(string lang, bool force=false)
Definition: ModPackage.cs:308
UIText mainText
Definition: UIButton.cs:102
void SetToggle(bool isOn, Action< bool > onToggle=null)
Definition: UIButton.cs:341
void Show(UIItem i)
void AddButton(Func< string > funcText, UnityAction action=null)
Definition: UIList.cs:9
override void Add(object item)
Definition: UIList.cs:354
void SetText(string s)
Definition: UIText.cs:163
Definition: Util.cs:10
static void ShowExplorer(string itemPath, bool selectFirstFile=false)
Definition: Util.cs:228
bool demo
Definition: Version.cs:14

References UIList.Add(), UIContextMenu.AddButton(), ModManager.AddPackage(), BaseModPackage.builtin, ItemMod.buttonActivate, ItemMod.buttonDown, ItemMod.buttonLock, ItemMod.buttonToggle, ItemMod.buttonUp, ELayer.config, ModPackage.CopyContentTo(), ELayer.core, ELayer.debug, Version.demo, CoreConfig.OtherSetting.disableMods, CoreDebug.enable, BaseCore.FreezeScreen(), Instance, BaseCore.Instance, BaseCore.IsOffline, Lang.langCode, list, UIList.List(), list2, UIButton.mainText, manager, Core.mods, Move(), CoreConfig.other, Refresh(), BaseModManager.rootMod, CoreConfig.Save(), ModManager.SaveLoadOrder(), UIText.SetText(), UIButton.SetToggle(), UIContextMenu.Show(), textRestart, toggleDisableMods, Core.TryWarnUpload(), ELayer.ui, ModPackage.UpdateSourceLocalizationFile(), Util, BaseCore.version, Layer.windows, and Dialog.YesNo().

◆ OnKill()

override void LayerMod.OnKill ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 182 of file LayerMod.cs.

183 {
185 }

References ELayer.core, Core.mods, and ModManager.SaveLoadOrder().

◆ Refresh()

void LayerMod.Refresh ( )
inline

Definition at line 178 of file LayerMod.cs.

179 {
180 }

Referenced by OnInit().

Member Data Documentation

◆ Instance

LayerMod LayerMod.Instance
static

Definition at line 6 of file LayerMod.cs.

Referenced by OnInit().

◆ list

UIList LayerMod.list

Definition at line 8 of file LayerMod.cs.

Referenced by Move(), and OnInit().

◆ list2

UIList LayerMod.list2

Definition at line 10 of file LayerMod.cs.

Referenced by OnInit().

◆ textRestart

UIText LayerMod.textRestart

Definition at line 12 of file LayerMod.cs.

Referenced by Move(), and OnInit().

◆ toggleDisableMods

UIButton LayerMod.toggleDisableMods

Definition at line 14 of file LayerMod.cs.

Referenced by OnInit().

Property Documentation

◆ manager

ModManager LayerMod.manager
get

Definition at line 16 of file LayerMod.cs.

Referenced by OnInit().


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