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

Public Member Functions

void Activate (UIPCC uiPcc, UIItemPCC uiItemPcc)
 
void PopulateButtons ()
 
- 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 ()
 

Static Public Member Functions

static string GetPartProviderString (PCC.Part part)
 
static BaseModPackage GetPartProvider (PCC.Part part)
 
static int PartSorter (PCC.Part lhs, PCC.Part rhs)
 
- 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)
 

Public Attributes

UIItemPCCPart mold
 
LayoutGroup layoutParts
 
- 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
 

Private Member Functions

void Update ()
 

Private Attributes

UIItemPCC _uiItemPcc
 
UIPCC _uiPcc
 
List< UIItemPCCPart_items = new List<UIItemPCCPart>()
 
List< Outline_outlines = new List<Outline>()
 

Static Private Attributes

static readonly Dictionary< PCC.Part, BaseModPackage_cached = new Dictionary<PCC.Part, BaseModPackage>()
 
static readonly Regex _idRegex = new Regex("(\\d+)|(\\D+)", RegexOptions.Compiled)
 

Additional Inherited Members

- 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
 
- 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]
 

Detailed Description

Definition at line 8 of file LayerPickPCC.cs.

Member Function Documentation

◆ Activate()

void LayerPickPCC.Activate ( UIPCC  uiPcc,
UIItemPCC  uiItemPcc 
)
inline

Definition at line 26 of file LayerPickPCC.cs.

27 {
28 _uiPcc = uiPcc;
29 _uiItemPcc = uiItemPcc;
31 }
UIItemPCC _uiItemPcc
Definition: LayerPickPCC.cs:14
void PopulateButtons()
Definition: LayerPickPCC.cs:43

References _uiItemPcc, _uiPcc, and PopulateButtons().

◆ GetPartProvider()

static BaseModPackage LayerPickPCC.GetPartProvider ( PCC::Part  part)
inlinestatic

Definition at line 99 of file LayerPickPCC.cs.

100 {
101 if (part == null)
102 {
103 return null;
104 }
105 if (_cached.TryGetValue(part, out var value))
106 {
107 return value;
108 }
109 string dir = part.dir;
110 value = BaseModManager.Instance.packages.FirstOrDefault((BaseModPackage p) => dir.StartsWith(p.dirInfo.FullName)) ?? new BaseModPackage
111 {
112 title = "unknownAuthor".lang()
113 };
114 return _cached[part] = value;
115 }
item3. title
Definition: UIBook.cs:640
List< BaseModPackage > packages
static BaseModManager Instance
DirectoryInfo dirInfo
static readonly Dictionary< PCC.Part, BaseModPackage > _cached
Definition: LayerPickPCC.cs:22

References _cached, BaseModPackage.dirInfo, BaseModManager.Instance, BaseModManager.packages, and title.

Referenced by GetPartProviderString(), and PartSorter().

◆ GetPartProviderString()

static string LayerPickPCC.GetPartProviderString ( PCC::Part  part)
inlinestatic

Definition at line 94 of file LayerPickPCC.cs.

95 {
96 return "ID: " + part.id + "\n<i>" + GetPartProvider(part).title.TagColor(Color.cyan) + "</i>\n" + part.dir.ShortPath();
97 }
static BaseModPackage GetPartProvider(PCC.Part part)
Definition: LayerPickPCC.cs:99

References Color, GetPartProvider(), and BaseModPackage.title.

Referenced by PopulateButtons().

◆ PartSorter()

static int LayerPickPCC.PartSorter ( PCC::Part  lhs,
PCC::Part  rhs 
)
inlinestatic

Definition at line 117 of file LayerPickPCC.cs.

118 {
119 if (lhs == null)
120 {
121 if (rhs != null)
122 {
123 return -1;
124 }
125 return 0;
126 }
127 if (rhs == null)
128 {
129 return 1;
130 }
131 int num = GetPartSortOrder(lhs);
132 int num2 = GetPartSortOrder(rhs);
133 if (num != num2)
134 {
135 return num - num2;
136 }
137 string id = lhs.id;
138 string id2 = rhs.id;
139 if (id == id2)
140 {
141 return 0;
142 }
143 int result;
144 bool flag = int.TryParse(id, out result);
145 int result2;
146 bool flag2 = int.TryParse(id2, out result2);
147 if (flag && flag2)
148 {
149 return result.CompareTo(result2);
150 }
151 if (flag)
152 {
153 return -1;
154 }
155 if (flag2)
156 {
157 return 1;
158 }
159 MatchCollection matchCollection = _idRegex.Matches(id);
160 MatchCollection matchCollection2 = _idRegex.Matches(id2);
161 int num3 = Math.Min(matchCollection.Count, matchCollection2.Count);
162 for (int i = 0; i < num3; i++)
163 {
164 string value = matchCollection[i].Value;
165 string value2 = matchCollection2[i].Value;
166 int result3;
167 bool num4 = int.TryParse(value, out result3);
168 int result4;
169 bool flag3 = int.TryParse(value2, out result4);
170 int num5 = ((!(num4 && flag3)) ? string.Compare(value, value2, StringComparison.OrdinalIgnoreCase) : result3.CompareTo(result4));
171 if (num5 != 0)
172 {
173 return num5;
174 }
175 }
176 return matchCollection.Count - matchCollection2.Count;
177 static int GetPartSortOrder(PCC.Part part)
178 {
179 int num6 = BaseModManager.Instance.packages.IndexOf(GetPartProvider(part));
180 if (num6 < 0)
181 {
182 return int.MaxValue;
183 }
184 return num6;
185 }
186 }
static readonly Regex _idRegex
Definition: LayerPickPCC.cs:24

References _idRegex, GetPartProvider(), BaseModManager.Instance, and BaseModManager.packages.

Referenced by PopulateButtons().

◆ PopulateButtons()

void LayerPickPCC.PopulateButtons ( )
inline

Definition at line 43 of file LayerPickPCC.cs.

44 {
45 List<PCC.Part> list = _uiItemPcc.parts.ToList();
46 list.Sort(PartSorter);
47 foreach (PCC.Part part in list)
48 {
50 if (part == _uiItemPcc.part)
51 {
52 SetOutline(item.outline);
53 }
54 if (part == null)
55 {
56 item.button.onClick.AddListener(delegate
57 {
58 _uiItemPcc.slider.value = 0f;
59 SetOutline(item.outline);
60 });
61 item.button.tooltip.lang = "empty";
62 }
63 else
64 {
65 ModItem<Texture2D> modItem = part.modTextures.TryGetValue("walk");
66 if (modItem == null)
67 {
68 UnityEngine.Object.Destroy(item.gameObject);
69 continue;
70 }
71 item.button.tooltip.lang = GetPartProviderString(part);
72 item.button.onClick.AddListener(delegate
73 {
74 _uiItemPcc.slider.value = _uiItemPcc.parts.IndexOf(part);
75 SetOutline(item.outline);
76 });
77 item.SetSprites(IO.LoadPNG(modItem.fileInfo.FullName));
78 Color color = _uiPcc.pcc.data.GetColor(_uiItemPcc.idPartSet);
79 item.button.icon.color = _uiPcc.pccm.ApplyColorMod(color);
80 }
81 _items.Add(item);
82 }
83 void SetOutline(Outline outline)
84 {
85 _outlines.Add(outline);
86 foreach (Outline outline in _outlines)
87 {
88 outline.enabled = false;
89 }
90 outline.enabled = true;
91 }
92 }
Definition: IO.cs:11
static Texture2D LoadPNG(string _path, FilterMode filter=FilterMode.Point)
Definition: IO.cs:465
LayoutGroup layoutParts
Definition: LayerPickPCC.cs:12
List< Outline > _outlines
Definition: LayerPickPCC.cs:20
UIItemPCCPart mold
Definition: LayerPickPCC.cs:10
static string GetPartProviderString(PCC.Part part)
Definition: LayerPickPCC.cs:94
static int PartSorter(PCC.Part lhs, PCC.Part rhs)
List< UIItemPCCPart > _items
Definition: LayerPickPCC.cs:18
FileInfo fileInfo
Definition: ModItem.cs:18
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References _items, _outlines, _uiItemPcc, _uiPcc, Color, ModItem< T >.fileInfo, GetPartProviderString(), item, layoutParts, mold, Outline, PartSorter(), and Util.

Referenced by Activate().

◆ Update()

void LayerPickPCC.Update ( )
inlineprivate

Definition at line 33 of file LayerPickPCC.cs.

34 {
35 SpriteProvider provider = _uiPcc.actor.provider;
36 int frame = (provider.currentFrame + 2) % 4;
37 foreach (UIItemPCCPart item in _items)
38 {
39 item.SetSpriteIndex(provider.currentDir, frame);
40 }
41 }

References _items, _uiPcc, and item.

Member Data Documentation

◆ _cached

readonly Dictionary<PCC.Part, BaseModPackage> LayerPickPCC._cached = new Dictionary<PCC.Part, BaseModPackage>()
staticprivate

Definition at line 22 of file LayerPickPCC.cs.

Referenced by GetPartProvider().

◆ _idRegex

readonly Regex LayerPickPCC._idRegex = new Regex("(\\d+)|(\\D+)", RegexOptions.Compiled)
staticprivate

Definition at line 24 of file LayerPickPCC.cs.

Referenced by PartSorter().

◆ _items

List<UIItemPCCPart> LayerPickPCC._items = new List<UIItemPCCPart>()
private

Definition at line 18 of file LayerPickPCC.cs.

Referenced by PopulateButtons(), and Update().

◆ _outlines

List<Outline> LayerPickPCC._outlines = new List<Outline>()
private

Definition at line 20 of file LayerPickPCC.cs.

Referenced by PopulateButtons().

◆ _uiItemPcc

UIItemPCC LayerPickPCC._uiItemPcc
private

Definition at line 14 of file LayerPickPCC.cs.

Referenced by Activate(), and PopulateButtons().

◆ _uiPcc

UIPCC LayerPickPCC._uiPcc
private

Definition at line 16 of file LayerPickPCC.cs.

Referenced by Activate(), PopulateButtons(), and Update().

◆ layoutParts

LayoutGroup LayerPickPCC.layoutParts

Definition at line 12 of file LayerPickPCC.cs.

Referenced by PopulateButtons().

◆ mold

UIItemPCCPart LayerPickPCC.mold

Definition at line 10 of file LayerPickPCC.cs.

Referenced by PopulateButtons().


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