Skip to content

Commit

Permalink
remove debug items with no sprites
Browse files Browse the repository at this point in the history
  • Loading branch information
parK-dev committed Aug 29, 2022
1 parent f7cd76a commit 3140771
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/game/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::fmt::Formatter;

use crate::game::TextureId;
use crate::mouse::MouseInteractive;
use crate::positioning::{Coords};
use crate::positioning::Coords;

use super::combat::Hero;
use super::item_info_system::MouseOverItemInfo;
Expand Down
43 changes: 22 additions & 21 deletions src/game/sim/dungeon_sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,8 @@ pub fn manage_continue_prompt(
cmd.entity(e).despawn_recursive();
}
} else if !state.running && state.combat_state != CombatState::HeroDead {
if let Ok(_) = q.get_single() {} else {
if let Ok(_) = q.get_single() {
} else {
spawn_prompt(cmd, assets);
}
}
Expand All @@ -289,24 +290,24 @@ pub fn spawn_prompt(mut cmd: Commands, assets: Res<AssetStorage>) {
color: Color::NONE.into(),
..default()
})
.with_children(|parent| {
// text
parent.spawn_bundle(
TextBundle::from_section(
"Press SPACE to continue exploring!",
TextStyle {
font: assets.font(&FontId::FiraSansBold),
font_size: 32.0,
color: Color::WHITE,
},
)
.with_style(Style {
margin: UiRect::all(Val::Px(5.0)),
align_self: AlignSelf::Center,
..default()
}),
);
})
.insert(ContinuePrompt)
.insert(CleanupOnGameplayEnd);
.with_children(|parent| {
// text
parent.spawn_bundle(
TextBundle::from_section(
"Press SPACE to continue exploring!",
TextStyle {
font: assets.font(&FontId::FiraSansBold),
font_size: 32.0,
color: Color::WHITE,
},
)
.with_style(Style {
margin: UiRect::all(Val::Px(5.0)),
align_self: AlignSelf::Center,
..default()
}),
);
})
.insert(ContinuePrompt)
.insert(CleanupOnGameplayEnd);
}
44 changes: 22 additions & 22 deletions src/game/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ pub fn eye_tracking_system(
let white_pos = white.translation.truncate();
let new_iris_trans = white.translation
+ ((mouse.position - white_pos) / 100.0)
.clamp_length(0.0, 0.2)
.extend(1.0);
.clamp_length(0.0, 0.2)
.extend(1.0);
iris.translation = new_iris_trans;
}
}
Expand Down Expand Up @@ -184,26 +184,26 @@ pub fn create_debug_items(mut spawn: EventWriter<SpawnItemEvent>, items_db: Res<
item.1,
Coords::new(Pos::new(5, 0), item.0),
));
item = items_db.try_get_item(ItemId::ShieldRusty).unwrap();
spawn.send(SpawnItemEvent::without_anim(
item.1,
Coords::new(Pos::new(6, 0), item.0),
));
item = items_db.try_get_item(ItemId::Shield).unwrap();
spawn.send(SpawnItemEvent::without_anim(
item.1,
Coords::new(Pos::new(0, 2), item.0),
));
item = items_db.try_get_item(ItemId::ArmorRusty).unwrap();
spawn.send(SpawnItemEvent::without_anim(
item.1,
Coords::new(Pos::new(2, 2), item.0),
));
item = items_db.try_get_item(ItemId::ArmorRusty).unwrap();
spawn.send(SpawnItemEvent::without_anim(
item.1,
Coords::new(Pos::new(4, 2), item.0),
));
//item = items_db.try_get_item(ItemId::ShieldRusty).unwrap();
//spawn.send(SpawnItemEvent::without_anim(
// item.1,
// Coords::new(Pos::new(6, 0), item.0),
//));
//item = items_db.try_get_item(ItemId::Shield).unwrap();
//spawn.send(SpawnItemEvent::without_anim(
// item.1,
// Coords::new(Pos::new(0, 2), item.0),
//));
//item = items_db.try_get_item(ItemId::ArmorRusty).unwrap();
//spawn.send(SpawnItemEvent::without_anim(
// item.1,
// Coords::new(Pos::new(2, 2), item.0),
//));
//item = items_db.try_get_item(ItemId::ArmorRusty).unwrap();
//spawn.send(SpawnItemEvent::without_anim(
// item.1,
// Coords::new(Pos::new(4, 2), item.0),
//));
}

fn test_slice(
Expand Down

0 comments on commit 3140771

Please sign in to comment.