Compare commits
5 commits
47be2f574b
...
ca8eff1353
Author | SHA1 | Date | |
---|---|---|---|
ca8eff1353 | |||
67cdffc574 | |||
a7f06438a9 | |||
5de8374842 | |||
c6398b5d3c |
15 changed files with 28 additions and 16 deletions
|
@ -36,7 +36,7 @@ sdl2 = { version = "0.37.0" }
|
|||
syn = { version = "2.0.67", features = ["extra-traits", "full"] }
|
||||
quote = "1.0.35"
|
||||
proc-macro2 = "1.0.86"
|
||||
downcast-rs = "1.2.1"
|
||||
downcast-rs = "2.0.0"
|
||||
|
||||
utilities = { git = "https://gavania.de/hodasemi/utilities.git" }
|
||||
vulkan-rs = { git = "https://gavania.de/hodasemi/vulkan_lib.git" }
|
||||
|
|
|
@ -6,7 +6,7 @@ mod page_content;
|
|||
mod traits;
|
||||
|
||||
use anyhow::Result;
|
||||
use downcast_rs::{impl_downcast, Downcast};
|
||||
use downcast_rs::{Downcast, impl_downcast};
|
||||
use engine::prelude::*;
|
||||
use rpg_components::{
|
||||
components::{
|
||||
|
@ -21,8 +21,8 @@ use std::{
|
|||
collections::HashMap,
|
||||
ops::{Deref, DerefMut},
|
||||
sync::{
|
||||
atomic::{AtomicUsize, Ordering::SeqCst},
|
||||
Arc, Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard,
|
||||
atomic::{AtomicUsize, Ordering::SeqCst},
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -125,19 +125,19 @@ pub struct CharacterWindow {
|
|||
|
||||
tabs: RwLock<[Box<dyn Page>; 3]>,
|
||||
tab: AtomicUsize,
|
||||
|
||||
engine: Arc<Engine>,
|
||||
}
|
||||
|
||||
impl CharacterWindow {
|
||||
pub fn new<A: Ability + 'static>(
|
||||
engine: Arc<Engine>,
|
||||
world: &World,
|
||||
hero: Entity,
|
||||
name: &str,
|
||||
close: Box<dyn FutureStateChange>,
|
||||
) -> Result<Arc<Self>> {
|
||||
let menu_gui =
|
||||
GuiBuilder::from_str(engine.gui_handler(), include_str!("../resources/menu.xml"))?;
|
||||
let menu_gui = GuiBuilder::from_str(
|
||||
world.resources.get::<Arc<GuiHandler>>(),
|
||||
include_str!("../resources/menu.xml"),
|
||||
)?;
|
||||
|
||||
let content_grid = menu_gui.element("tab_content")?;
|
||||
let open_character_page: Arc<Button> = menu_gui.element("open_statistics")?;
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
use anyhow::bail;
|
||||
use engine::prelude::{image::RgbaImage, *};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use std::{cmp::Ordering, slice::Iter, str::FromStr};
|
||||
|
||||
use crate::{
|
||||
config::attributes::{AttributeColorSettings, StartingAttributes},
|
||||
items::{ability_book::Ability, ItemSystem},
|
||||
items::{ItemSystem, ability_book::Ability},
|
||||
};
|
||||
|
||||
generate_stat!(Agility, u32, "Agility");
|
||||
|
|
|
@ -2,6 +2,7 @@ use std::time::Duration;
|
|||
|
||||
use anyhow::Result;
|
||||
use engine::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::statistics::*;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use engine::prelude::*;
|
||||
|
||||
use paste::paste;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{config::save_game::SaveGame, items::Rarities};
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
use anyhow::Result;
|
||||
use engine::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use std::fmt;
|
||||
|
||||
|
@ -540,7 +541,7 @@ impl std::str::FromStr for StatisticType {
|
|||
return Err(anyhow::Error::msg(format!(
|
||||
"Failed parsing StatisticTypes from {}",
|
||||
s
|
||||
)))
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use engine::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
config::{
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
use assetpath::AssetPath;
|
||||
use engine::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
create_settings_section!(
|
||||
AbilityIcons,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use engine::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::components::npc_type::NPCType;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
use anyhow::Result;
|
||||
use engine::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use std::convert::TryFrom;
|
||||
|
||||
|
@ -31,7 +32,7 @@ impl std::str::FromStr for DamageType {
|
|||
return Err(anyhow::Error::msg(format!(
|
||||
"Failed parsing DamageType from {}",
|
||||
s
|
||||
)))
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use anyhow::Result;
|
||||
use assetpath::AssetPath;
|
||||
use engine::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use std::{
|
||||
fmt,
|
||||
|
|
|
@ -2,6 +2,7 @@ use anyhow::Result;
|
|||
use assetpath::AssetPath;
|
||||
use cgmath::{Vector2, Vector3};
|
||||
use engine::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use std::{fmt::Debug, str::FromStr, sync::Arc, time::Duration};
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ use crate::{
|
|||
config::items::ItemSettings,
|
||||
};
|
||||
|
||||
use super::{ability_book::Ability, ItemSlots, ItemSystem, Jewel, Rarities, Tooltip};
|
||||
use super::{ItemSlots, ItemSystem, Jewel, Rarities, Tooltip, ability_book::Ability};
|
||||
|
||||
const ITEM_SNIPPETS: [&'static str; 8] = [
|
||||
include_str!("../../resources/items/slots_0.xml"),
|
||||
|
@ -314,7 +314,7 @@ impl Item {
|
|||
None => {
|
||||
socket_icon.set_icon(
|
||||
&Image::from_slice(include_bytes!("../../resources/circle.png"))?
|
||||
.attach_sampler(Sampler::pretty_sampler().build(gui_handler.device())?)
|
||||
.attach_pretty_sampler(gui_handler.device())?
|
||||
.build(gui_handler.device(), gui_handler.queue())?,
|
||||
)?;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use anyhow::Result;
|
||||
use assetpath::AssetPath;
|
||||
use engine::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use std::{fmt, slice::Iter};
|
||||
|
||||
|
@ -91,7 +92,7 @@ impl std::str::FromStr for ItemSlots {
|
|||
return Err(anyhow::Error::msg(format!(
|
||||
"Failed parsing ItemSlots from {}",
|
||||
s
|
||||
)))
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,13 @@ use anyhow::Result;
|
|||
use engine::prelude::*;
|
||||
|
||||
use image::RgbaImage;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use std::{fmt, slice::Iter};
|
||||
|
||||
use crate::config::items::{ItemSettings, RarityColorSettings};
|
||||
|
||||
use super::{ability_book::Ability, ItemSystem};
|
||||
use super::{ItemSystem, ability_book::Ability};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Rarities {
|
||||
|
@ -114,7 +115,7 @@ impl std::str::FromStr for Rarities {
|
|||
return Err(anyhow::Error::msg(format!(
|
||||
"Failed parsing Rarities from {}",
|
||||
s
|
||||
)))
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue