Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
micutio committed Dec 10, 2023
1 parent 4b35214 commit 51c5d7b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
14 changes: 7 additions & 7 deletions src/ui/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,49 +64,49 @@ pub struct Palette {

pub const DEFAULT_PALETTE: Palette = Palette {
// base color palette
/// Main color, used as base for the UI and the world, probably.
// Main color, used as base for the UI and the world, probably.
col_main: ui::Rgba {
r: 124,
g: 59,
b: 8,
a: 255,
},
/// Main complementary color
// Main complementary color
col_comp: ui::Rgba {
r: 9,
g: 124,
b: 172,
a: 255,
},
/// Accent color 1
// Accent color 1
col_acc1: ui::Rgba {
r: 157,
g: 213,
b: 194,
a: 255,
},
/// Accent color 2
// Accent color 2
col_acc2: ui::Rgba {
r: 182,
g: 191,
b: 118,
a: 255,
},
/// Accent color 3
// Accent color 3
col_acc3: ui::Rgba {
r: 220,
g: 98,
b: 42,
a: 255,
},
/// Accent color 4
// Accent color 4
col_acc4: ui::Rgba {
r: 100,
g: 180,
b: 240,
a: 255,
},
/// transparent color
// transparent color
col_transparent: ui::Rgba {
r: 255,
g: 255,
Expand Down
36 changes: 17 additions & 19 deletions src/ui/custom/genome_editor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/*!
The genome editor provides the facilities for the player to manipulate their own DNA, provided
they have a plasmid that allows this.
*/
//! The genome editor provides the facilities for the player to manipulate their own DNA, provided
//! they have a plasmid that allows this.
use crate::entity::genetics::{Dna, GeneticTrait, TraitAttribute, TraitFamily};
use crate::game::{self, ObjectStore, State};
Expand All @@ -28,11 +26,11 @@ pub enum EditingState {

#[derive(Debug)]
struct EditFunction {
layout: rltk::Rect,
layout: rltk::Rect,
is_enabled: bool,
state: EditingState,
idx: usize,
title: String,
state: EditingState,
idx: usize,
title: String,
}

impl EditFunction {
Expand All @@ -55,10 +53,10 @@ impl EditFunction {

#[derive(Debug, Clone)]
struct GeneItem {
layout: rltk::Rect,
layout: rltk::Rect,
/// position of the represented gene within the genome
gene_idx: usize,
color: ui::Rgba,
color: ui::Rgba,
}

impl GeneItem {
Expand All @@ -80,19 +78,19 @@ impl GeneItem {
/// - values and additional info about the trait
#[derive(Debug)]
pub struct GenomeEditor {
layout: rltk::Rect,
layout: rltk::Rect,
gene_selection_locked: bool,
/// Not all plasmids offer the same capabilities.
/// The used plasmid determines which operations the genome editor can perform.
/// How many operations can be performed with the editor.
/// Plasmids are consumed when using the editor to avoid infinite amounts of gene editing.
plasmid_charges: usize,
selected_gene: usize,
selected_function: usize,
pub state: EditingState,
pub player_dna: Dna,
edit_functions: Vec<EditFunction>,
gene_items: Vec<GeneItem>,
plasmid_charges: usize,
selected_gene: usize,
selected_function: usize,
pub state: EditingState,
pub player_dna: Dna,
edit_functions: Vec<EditFunction>,
gene_items: Vec<GeneItem>,
}

impl GenomeEditor {
Expand Down Expand Up @@ -139,7 +137,7 @@ impl GenomeEditor {
);

let layout_top_row = rltk::Rect::with_size(layout.x1, layout.y1 + TOP_ROW_Y_OFFSET, 0, 1);
for mut item in &mut edit_functions {
for item in &mut edit_functions {
item.layout = item.layout.add(layout_top_row);
}

Expand Down

0 comments on commit 51c5d7b

Please sign in to comment.