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

Public Member Functions

bool IsValidVersion ()
 
bool Init ()
 
void UpdateMeta (bool updateOnly=false)
 
void Activate ()
 
void Parse ()
 

Public Attributes

string title
 
string author
 
string version
 
string id
 
string description
 
string visibility
 
string[] tags
 
bool builtin
 
bool activated
 
bool willActivate = true
 
bool installed
 
bool banned
 
bool isInPackages
 
bool hasPublishedPackage
 
bool downloadStarted
 
int loadPriority
 
object item
 
DirectoryInfo dirInfo
 
Text progressText
 

Static Public Attributes

static XmlReader xmlReader
 
static XmlReaderSettings readerSetting
 

Detailed Description

Definition at line 6 of file BaseModPackage.cs.

Member Function Documentation

◆ Activate()

void BaseModPackage.Activate ( )
inline

Definition at line 145 of file BaseModPackage.cs.

146 {
148 {
149 Debug.Log("Activating(" + loadPriority + ") :" + title + "/" + id);
150 activated = true;
151 Parse();
152 }
153 }
DirectoryInfo dirInfo
bool hasPublishedPackage

References activated, Debug, dirInfo, hasPublishedPackage, installed, loadPriority, Parse(), title, and willActivate.

Referenced by ModManager.RefreshMods().

◆ Init()

bool BaseModPackage.Init ( )
inline

Definition at line 55 of file BaseModPackage.cs.

56 {
57 if (!File.Exists(dirInfo.FullName + "/package.xml"))
58 {
59 return false;
60 }
61 UpdateMeta();
62 return true;
63 }
void UpdateMeta(bool updateOnly=false)

References dirInfo, and UpdateMeta().

Referenced by ModManager.RefreshMods().

◆ IsValidVersion()

bool BaseModPackage.IsValidVersion ( )
inline

Definition at line 50 of file BaseModPackage.cs.

51 {
53 }
Version versionMod
Definition: BaseCore.cs:21
static BaseCore Instance
Definition: BaseCore.cs:11
static Version Get(string str)
Definition: Version.cs:46
bool IsBelow(int _major, int _minor, int _batch)
Definition: Version.cs:31

References Version.Get(), BaseCore.Instance, Version.IsBelow(), version, and BaseCore.versionMod.

Referenced by LayerMod.OnInit(), and ModManager.RefreshMods().

◆ Parse()

void BaseModPackage.Parse ( )
inline

Definition at line 155 of file BaseModPackage.cs.

156 {
157 DirectoryInfo[] directories = dirInfo.GetDirectories();
158 foreach (DirectoryInfo directoryInfo in directories)
159 {
160 if (directoryInfo.Name == "Actor")
161 {
162 FileInfo[] files = directoryInfo.GetFiles();
163 foreach (FileInfo fileInfo in files)
164 {
165 if (fileInfo.Name.EndsWith(".xlsx"))
166 {
167 MOD.actorSources.items.Add(new ExcelData(fileInfo.FullName));
168 }
169 }
170 DirectoryInfo[] directories2 = directoryInfo.GetDirectories();
171 foreach (DirectoryInfo directoryInfo2 in directories2)
172 {
173 Log.App(directoryInfo2.FullName);
174 string name = directoryInfo2.Name;
175 if (!(name == "PCC"))
176 {
177 if (!(name == "Sprite"))
178 {
179 continue;
180 }
181 files = directoryInfo2.GetFiles();
182 foreach (FileInfo fileInfo2 in files)
183 {
184 if (fileInfo2.Name.EndsWith(".png"))
185 {
186 MOD.sprites.Add(fileInfo2);
187 }
188 }
189 }
190 else
191 {
192 DirectoryInfo[] directories3 = directoryInfo2.GetDirectories();
193 foreach (DirectoryInfo obj in directories3)
194 {
195 MOD.OnAddPcc(obj);
196 }
197 }
198 }
199 }
200 else
201 {
202 BaseModManager.Instance.ParseExtra(directoryInfo, this);
203 }
204 }
205 }
virtual void ParseExtra(DirectoryInfo dir, BaseModPackage package)
static BaseModManager Instance
List< ExcelData > items
Definition: ExcelDataList.cs:6
Definition: Log.cs:4
static void App(string s)
Definition: Log.cs:7
Definition: MOD.cs:7
static ExcelDataList actorSources
Definition: MOD.cs:14
static ModItemList< Sprite > sprites
Definition: MOD.cs:16
static Action< DirectoryInfo > OnAddPcc
Definition: MOD.cs:18
void Add(FileInfo fi, string path=null, string prefix="")
Definition: ModItemList.cs:85

References MOD.actorSources, ModItemList< T >.Add(), Log.App(), dirInfo, BaseModManager.Instance, ExcelDataList.items, MOD.OnAddPcc, BaseModManager.ParseExtra(), and MOD.sprites.

Referenced by Activate().

◆ UpdateMeta()

void BaseModPackage.UpdateMeta ( bool  updateOnly = false)
inline

Definition at line 65 of file BaseModPackage.cs.

66 {
67 string text = dirInfo.FullName + "/package.xml";
68 if (!File.Exists(text))
69 {
70 return;
71 }
72 XmlReader xmlReader = XmlReader.Create(text, new XmlReaderSettings
73 {
74 IgnoreComments = true,
75 IgnoreWhitespace = true
76 });
77 while (xmlReader.Read())
78 {
79 if (xmlReader.NodeType != XmlNodeType.Element)
80 {
81 continue;
82 }
83 switch (xmlReader.Name)
84 {
85 case "title":
86 if (xmlReader.Read())
87 {
88 title = xmlReader.Value;
89 }
90 break;
91 case "author":
92 if (xmlReader.Read())
93 {
94 author = xmlReader.Value;
95 }
96 break;
97 case "id":
98 if (xmlReader.Read())
99 {
100 id = xmlReader.Value;
101 }
102 break;
103 case "description":
104 if (xmlReader.Read())
105 {
106 description = xmlReader.Value;
107 }
108 break;
109 case "version":
110 if (xmlReader.Read())
111 {
112 version = xmlReader.Value;
113 }
114 break;
115 case "builtin":
116 if (xmlReader.Read())
117 {
118 bool.TryParse(xmlReader.Value, out builtin);
119 }
120 break;
121 case "tag":
122 case "tags":
123 if (xmlReader.Read())
124 {
125 tags = xmlReader.Value.Split(',');
126 }
127 break;
128 case "loadPriority":
129 if (!updateOnly && xmlReader.Read())
130 {
131 int.TryParse(xmlReader.Value, out loadPriority);
132 }
133 break;
134 case "visibility":
135 if (xmlReader.Read())
136 {
137 visibility = xmlReader.Value;
138 }
139 break;
140 }
141 }
142 xmlReader.Close();
143 }
static XmlReader xmlReader

References author, builtin, description, loadPriority, tags, title, version, visibility, and xmlReader.

Referenced by Steam.CreateUserContent(), Init(), and LayerMod.OnInit().

Member Data Documentation

◆ activated

bool BaseModPackage.activated

◆ author

string BaseModPackage.author

Definition at line 14 of file BaseModPackage.cs.

Referenced by LayerMod.OnInit(), and UpdateMeta().

◆ banned

bool BaseModPackage.banned

Definition at line 34 of file BaseModPackage.cs.

◆ builtin

◆ description

string BaseModPackage.description

Definition at line 20 of file BaseModPackage.cs.

Referenced by Steam.CreateItemData(), and UpdateMeta().

◆ dirInfo

◆ downloadStarted

bool BaseModPackage.downloadStarted

Definition at line 40 of file BaseModPackage.cs.

Referenced by ModManager.RefreshMods().

◆ hasPublishedPackage

bool BaseModPackage.hasPublishedPackage

Definition at line 38 of file BaseModPackage.cs.

Referenced by Activate().

◆ id

string BaseModPackage.id

◆ installed

bool BaseModPackage.installed

Definition at line 32 of file BaseModPackage.cs.

Referenced by Activate(), and ModManager.RefreshMods().

◆ isInPackages

bool BaseModPackage.isInPackages

Definition at line 36 of file BaseModPackage.cs.

Referenced by LayerMod.OnInit(), and ModManager.RefreshMods().

◆ item

object BaseModPackage.item

Definition at line 44 of file BaseModPackage.cs.

◆ loadPriority

int BaseModPackage.loadPriority

Definition at line 42 of file BaseModPackage.cs.

Referenced by Activate(), ModManager.RefreshMods(), and UpdateMeta().

◆ progressText

Text BaseModPackage.progressText

Definition at line 48 of file BaseModPackage.cs.

Referenced by ModManager.RefreshMods().

◆ readerSetting

XmlReaderSettings BaseModPackage.readerSetting
static

Definition at line 10 of file BaseModPackage.cs.

◆ tags

string [] BaseModPackage.tags

Definition at line 24 of file BaseModPackage.cs.

Referenced by Steam.CreateItemData(), and UpdateMeta().

◆ title

string BaseModPackage.title

◆ version

string BaseModPackage.version

Definition at line 16 of file BaseModPackage.cs.

Referenced by IsValidVersion(), LayerMod.OnInit(), and UpdateMeta().

◆ visibility

string BaseModPackage.visibility

Definition at line 22 of file BaseModPackage.cs.

Referenced by Steam.CreateItemData(), and UpdateMeta().

◆ willActivate

bool BaseModPackage.willActivate = true

Definition at line 30 of file BaseModPackage.cs.

Referenced by Activate(), LayerMod.OnInit(), and ModManager.RefreshMods().

◆ xmlReader

XmlReader BaseModPackage.xmlReader
static

Definition at line 8 of file BaseModPackage.cs.

Referenced by UpdateMeta().


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