Compare commits

...

4 Commits

Author SHA1 Message Date
Florent DENEF
e4dc131808 Merge branch 'master' of https://gitea.pcornatcloud.fr/Pcornat/BillySheet-Rust 2022-11-29 16:13:16 +01:00
fdenef
fbf3d3815c Reformat with cargo fmt 2022-11-18 11:17:56 +01:00
fdenef
505aed8138 EOL 2022-11-18 10:53:36 +01:00
fdenef
94ba4b698c Auto LF EOL 2022-11-18 10:53:06 +01:00
3 changed files with 77 additions and 13 deletions

View File

@ -1,15 +1,17 @@
{
"configurations": [
{
"type": "cargo",
"name": "Build release",
"cargoArgs": ["build", "--release"],
},
{
"type": "cargo",
"name": "Run release",
"cargoArgs": ["run", "--release"],
},
"configurations": [
{
"type": "cargo",
"name": "Run Release",
"workingDir": ".",
"cargoArgs": ["run", "--release"],
},
{
"type": "cargo",
"name": "Build Release",
"cargoArgs": ["build", "--release"],
},
]
}
]
}

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
* text=auto

View File

@ -1,6 +1,9 @@
use eframe::egui::widgets::DragValue;
use eframe::egui::Ui;
<<<<<<< HEAD
=======
use serde::{Deserialize, Serialize};
>>>>>>> 281e4eb9f0a44494530a7bc3422fcd557a26088f
use crate::gui::SheetGui;
@ -83,6 +86,63 @@ impl SheetGui for CharacterSheet {
let mut carac = character_field.carac;
let mut materiel = character_field.materiel;
ui.heading(category);
<<<<<<< HEAD
ui.columns(2, |columns| {
let mut ui_column = &mut columns[0];
ui_column.label("Base");
ui_column.label("Carac.");
ui_column.label("Matériel");
ui_column = &mut columns[1];
ui_column.add(DragValue::new(&mut base));
ui_column.add(DragValue::new(&mut carac));
ui_column.add(DragValue::new(&mut materiel));
});
return (base, carac, materiel);
}
fn gui_address(&mut self, ui: &mut Ui) {
let workaround: &CharacterSheet = self;
(self.address.base, self.address.carac, self.address.materiel) =
self.shortcut(ui, "Habileté", workaround.address());
ui.label("Ne peut dépasser 5");
}
fn gui_stamina(&mut self, ui: &mut Ui) {
let workaround: &CharacterSheet = self;
(self.stamina.base, self.stamina.carac, self.stamina.materiel) =
self.shortcut(ui, "Endurance", workaround.stamina());
}
fn gui_luck(&mut self, ui: &mut Ui) {
let workaround: &CharacterSheet = self;
(self.luck.base, self.luck.carac, self.luck.materiel) =
self.shortcut(ui, "Chance", workaround.luck());
}
fn gui_skill(&mut self, ui: &mut Ui) {
let workaround: &CharacterSheet = self;
(self.skill.base, self.skill.carac, self.skill.materiel) =
self.shortcut(ui, "Habileté", workaround.skill());
}
fn secondary_stats(&mut self, ui: &mut Ui) {
let workaround: &CharacterSheet = self;
ui.heading("Stat. secondaires");
ui.columns(2, |columns| {
columns[0].vertical_centered_justified(|ui| {
ui.label("Dégâts");
ui.label("Armure");
ui.label("Critique");
});
columns[1].vertical_centered_justified(|ui| {
let mut damage = workaround.damage;
let mut armor = workaround.armor;
ui.add(DragValue::new(&mut damage));
ui.add(DragValue::new(&mut armor));
});
});
=======
ui.horizontal(|ui| {
ui.label("Base");
ui.add(DragValue::new(&mut base));
@ -139,6 +199,7 @@ impl SheetGui for CharacterSheet {
ui.add(DragValue::new(&mut armor));
});
ui.label("Critique");
>>>>>>> 281e4eb9f0a44494530a7bc3422fcd557a26088f
}
}