Replace object initialization with read from file

This commit is contained in:
Dr. Dystopia 2021-05-26 19:40:50 +02:00 committed by juliancoffee
parent 35d5e3379e
commit 641ccd5282
2 changed files with 9 additions and 17 deletions

View File

@ -0,0 +1,8 @@
({
Armor(Chest): Item("common.items.armor.misc.chest.worker_purple_brown"),
Armor(Legs): Item("common.items.armor.misc.pants.worker_brown"),
Armor(Feet): Item("common.items.armor.misc.foot.sandals"),
Lantern: Item("common.items.lantern.black_0"),
Glider: Item("common.items.glider.glider_cloverleaf"),
})

View File

@ -413,23 +413,7 @@ impl LoadoutBuilder {
/// Set default armor items for the loadout. This may vary with game
/// updates, but should be safe defaults for a new character.
pub fn defaults(self) -> Self {
self.chest(Some(Item::new_from_asset_expect(
"common.items.armor.misc.chest.worker_purple_brown",
)))
.pants(Some(Item::new_from_asset_expect(
"common.items.armor.misc.pants.worker_brown",
)))
.feet(Some(Item::new_from_asset_expect(
"common.items.armor.misc.foot.sandals",
)))
.lantern(Some(Item::new_from_asset_expect(
"common.items.lantern.black_0",
)))
.glider(Some(Item::new_from_asset_expect(
"common.items.glider.glider_cloverleaf",
)))
}
pub fn defaults(self) -> Self { LoadoutBuilder::from_asset_expect("common.loadouts.default") }
/// Builds loadout of creature when spawned
#[allow(clippy::single_match)]