Shtoyan
2 years ago
8 changed files with 168 additions and 7 deletions
@ -1,2 +1,2 @@
|
||||
[AcediaLauncher.Packages] |
||||
useGameModes=false |
||||
useGameModes=true |
@ -0,0 +1,7 @@
|
||||
[default MapList] |
||||
autoEnable=true |
||||
map="KF-BioticsLab" |
||||
map="KF-Farm" |
||||
map="KF-Manor" |
||||
map="KF-Offices" |
||||
map="KF-WestLondon" |
@ -0,0 +1,75 @@
|
||||
/** |
||||
* Config for `MapList_Feature`. |
||||
* Copyright 2023 Anton Tarasenko |
||||
* 2023 Shtoyan |
||||
*------------------------------------------------------------------------------ |
||||
* This file is part of Acedia. |
||||
* |
||||
* Acedia is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation, version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* Acedia is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. |
||||
*/ |
||||
class MapList extends FeatureConfig |
||||
perObjectConfig |
||||
config(AcediaMaps); |
||||
|
||||
var public config array<string> map; |
||||
|
||||
protected function HashTable ToData() { |
||||
local int i; |
||||
local ArrayList mapArray; |
||||
local HashTable result; |
||||
|
||||
result = _.collections.EmptyHashTable(); |
||||
mapArray = _.collections.EmptyArrayList(); |
||||
|
||||
for (i = 0; i < map.length; i += 1) { |
||||
mapArray.AddString(map[i]); |
||||
} |
||||
|
||||
result.SetItem(P("maps"), mapArray); |
||||
_.memory.Free(mapArray); |
||||
|
||||
return result; |
||||
} |
||||
|
||||
protected function FromData(HashTable source) { |
||||
local int i; |
||||
local ArrayList mapArray; |
||||
|
||||
if (source == none) { |
||||
return; |
||||
} |
||||
|
||||
mapArray = source.GetArrayList(P("maps")); |
||||
if (mapArray == none) { |
||||
return; |
||||
} |
||||
|
||||
map.length = 0; |
||||
for (i = 0; i < mapArray.GetLength(); i += 1) { |
||||
map[map.length] = mapArray.GetString(i); |
||||
} |
||||
_.memory.Free(mapArray); |
||||
} |
||||
|
||||
protected function DefaultIt() { |
||||
map[0] = "KF-BioticsLab"; |
||||
map[1] = "KF-Farm"; |
||||
map[2] = "KF-Manor"; |
||||
map[3] = "KF-Offices"; |
||||
map[4] = "KF-WestLondon"; |
||||
} |
||||
|
||||
defaultproperties { |
||||
configName = "AcediaMaps" |
||||
} |
@ -0,0 +1,25 @@
|
||||
/** |
||||
* This feature is a dumb proxy for loading map list configs. |
||||
* Copyright 2023 Anton Tarasenko |
||||
* 2023 Shtoyan |
||||
*------------------------------------------------------------------------------ |
||||
* This file is part of Acedia. |
||||
* |
||||
* Acedia is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation, version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* Acedia is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with Acedia. If not, see <https://www.gnu.org/licenses/>. |
||||
*/ |
||||
class MapList_Feature extends Feature; |
||||
|
||||
defaultproperties { |
||||
configClass = class'MapList' |
||||
} |
Loading…
Reference in new issue