Compare commits
No commits in common. "250dc402a480504ac26bc5872efff816e9ab1c10" and "cbcb060c66980ff38d91d280f4a3999040da4f14" have entirely different histories.
250dc402a4
...
cbcb060c66
2
TODO.md
2
TODO.md
|
@ -1,8 +1,6 @@
|
|||
# Specific projects
|
||||
|
||||
## Now:
|
||||
- Replace handles with Arcs in content
|
||||
- clean up content
|
||||
- Clean up state api
|
||||
- Persistent variables
|
||||
- Better planet icons
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[outfit."plasma engines"]
|
||||
thumbnail = "icon::engine"
|
||||
|
||||
space.engine = 20
|
||||
|
||||
engine.thrust = 100
|
||||
engine.flare.sprite = "flare::ion"
|
||||
engine.flare.on_start = "rise:top"
|
||||
|
@ -10,16 +10,15 @@ steering.power = 20
|
|||
|
||||
|
||||
[outfit."shield generator"]
|
||||
thumbnail = "icon::shield"
|
||||
|
||||
space.outfit = 5
|
||||
|
||||
shield.generation = 10
|
||||
shield.strength = 500
|
||||
shield.delay = 2.0
|
||||
|
||||
|
||||
[outfit."blaster"]
|
||||
thumbnail = "icon::shield"
|
||||
|
||||
space.weapon = 10
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[ship."Gypsum"]
|
||||
sprite = "ship::gypsum"
|
||||
thumbnail = "icon::gypsum"
|
||||
thumb = "icon::gypsum"
|
||||
size = 100
|
||||
mass = 1
|
||||
hull = 200
|
||||
|
|
|
@ -17,7 +17,6 @@ pub(crate) mod syntax {
|
|||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Outfit {
|
||||
pub thumbnail: String,
|
||||
pub engine: Option<Engine>,
|
||||
pub steering: Option<Steering>,
|
||||
pub space: outfitspace::syntax::OutfitSpace,
|
||||
|
@ -128,9 +127,6 @@ pub(crate) mod syntax {
|
|||
/// Represents an outfit that may be attached to a ship.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Outfit {
|
||||
/// This outfit's thumbnail
|
||||
pub thumbnail: SpriteHandle,
|
||||
|
||||
/// How much space this outfit requires
|
||||
pub space: OutfitSpace,
|
||||
|
||||
|
@ -264,19 +260,7 @@ impl crate::Build for Outfit {
|
|||
),
|
||||
};
|
||||
|
||||
let thumb_handle = match content.sprite_index.get(&outfit.thumbnail) {
|
||||
None => {
|
||||
return Err(anyhow!(
|
||||
"thumbnail sprite `{}` doesn't exist",
|
||||
outfit.thumbnail
|
||||
))
|
||||
.with_context(|| format!("in outfit `{}`", outfit_name));
|
||||
}
|
||||
Some(t) => *t,
|
||||
};
|
||||
|
||||
let mut o = Self {
|
||||
thumbnail: thumb_handle,
|
||||
gun,
|
||||
handle,
|
||||
name: outfit_name.clone(),
|
||||
|
|
|
@ -16,7 +16,7 @@ pub(crate) mod syntax {
|
|||
#[derive(Debug, Deserialize)]
|
||||
pub struct Ship {
|
||||
pub sprite: String,
|
||||
pub thumbnail: String,
|
||||
pub thumb: String,
|
||||
pub size: f32,
|
||||
pub engines: Vec<Engine>,
|
||||
pub guns: Vec<Gun>,
|
||||
|
@ -98,7 +98,7 @@ pub struct Ship {
|
|||
pub sprite: SpriteHandle,
|
||||
|
||||
/// This ship's thumbnail
|
||||
pub thumbnail: SpriteHandle,
|
||||
pub thumb: SpriteHandle,
|
||||
|
||||
/// The size of this ship.
|
||||
/// Measured as unrotated height,
|
||||
|
@ -276,11 +276,11 @@ impl crate::Build for Ship {
|
|||
Some(t) => *t,
|
||||
};
|
||||
|
||||
let thumbnail = match ct.sprite_index.get(&ship.thumbnail) {
|
||||
let thumb = match ct.sprite_index.get(&ship.thumb) {
|
||||
None => bail!(
|
||||
"In ship `{}`: thumbnail sprite `{}` doesn't exist",
|
||||
ship_name,
|
||||
ship.thumbnail
|
||||
ship.thumb
|
||||
),
|
||||
Some(t) => *t,
|
||||
};
|
||||
|
@ -429,7 +429,7 @@ impl crate::Build for Ship {
|
|||
|
||||
ct.ships.push(Self {
|
||||
sprite,
|
||||
thumbnail,
|
||||
thumb,
|
||||
aspect,
|
||||
collapse,
|
||||
damage,
|
||||
|
|
|
@ -90,7 +90,7 @@ impl CustomType for ShipState {
|
|||
s.get_ship().get_data().get_state().is_collapsing()
|
||||
})
|
||||
.with_fn("name", |s: &mut Self| s.get_content().name.clone())
|
||||
.with_fn("thumbnail", |s: &mut Self| s.get_content().thumbnail)
|
||||
.with_fn("thumbnail", |s: &mut Self| s.get_content().thumb)
|
||||
.with_fn("landed_on", |s: &mut Self| s.landed_on())
|
||||
.with_fn("get_shields", |s: &mut Self| {
|
||||
s.get_ship().get_data().get_shields()
|
||||
|
|
Loading…
Reference in New Issue