rename interfaces to packs
This commit is contained in:
37
Classes/PackConfig.as
Normal file
37
Classes/PackConfig.as
Normal file
@@ -0,0 +1,37 @@
|
||||
class PackConfig {
|
||||
string Name;
|
||||
string Author;
|
||||
string Version;
|
||||
string ModePattern;
|
||||
array<LayerConfig> Layers;
|
||||
array<string> UnloadModules;
|
||||
|
||||
PackConfig() {}
|
||||
|
||||
PackConfig(const string &in _ParentPath, const string &in _Json) {
|
||||
const Json::Value@ Data = Json::Parse(_Json);
|
||||
|
||||
Name = Data['Name'];
|
||||
Author = Data['Author'];
|
||||
Version = Data['Version'];
|
||||
ModePattern = Data['ModePattern'];
|
||||
|
||||
if (Data.HasKey('Layers') && Data['Layers'].GetType() == Json::Type::Array) {
|
||||
for (uint i = 0; i < Data['Layers'].Length; i++) {
|
||||
try {
|
||||
const LayerConfig LayerConfig(_ParentPath, Data['Layers'][i]);
|
||||
|
||||
Layers.InsertLast(LayerConfig);
|
||||
} catch {
|
||||
warn("Can't load layer \""+ i +"\" of Interface Config: \""+ Name +"\"\nException Message: " + getExceptionInfo());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Data.HasKey('UnloadModules') && Data['UnloadModules'].GetType() == Json::Type::Array) {
|
||||
for (uint i = 0; i < Data['UnloadModules'].Length; i++) {
|
||||
UnloadModules.InsertLast(Data['UnloadModules'][i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user