Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bracket-lib"
version = "0.8.7"
authors = ["Herbert Wolverson <herberticus@gmail.com>"]
edition = "2021"
edition = "2024"
publish = true
description = "Meta-crate holding the entirety of bracket-lib (and exposing it). Use this for the full roguelike toolkit experience."
homepage = "https://github.com/thebracket/bracket-lib"
Expand Down
2 changes: 1 addition & 1 deletion bracket-algorithm-traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bracket-algorithm-traits"
version = "0.8.7"
authors = ["Herbert Wolverson <herberticus@gmail.com>"]
edition = "2021"
edition = "2024"
publish = true
description = "Traits required for the bracket-* crates. Adapt your maps to the traits with Algorithm2D, Algorithm3D and BaseMap."
homepage = "https://github.com/thebracket/bracket-lib"
Expand Down
4 changes: 3 additions & 1 deletion bracket-algorithm-traits/src/algorithm2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ pub trait Algorithm2D: BaseMap {

/// Retrieve the map's dimensions. Made optional to reduce API breakage.
fn dimensions(&self) -> Point {
panic!("You must either define the dimensions function (trait Algorithm2D) on your map, or define the various point2d_to_index and index_to_point2d functions.");
panic!(
"You must either define the dimensions function (trait Algorithm2D) on your map, or define the various point2d_to_index and index_to_point2d functions."
);
}

// Optional - check that an x/y coordinate is within the map bounds. If not provided,
Expand Down
4 changes: 3 additions & 1 deletion bracket-algorithm-traits/src/algorithm3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ pub trait Algorithm3D: BaseMap {

/// Dimensions
fn dimensions(&self) -> Point3 {
panic!("You must either define the dimensions function (trait Algorithm3D) on your map, or define the various point3d_to_index and index_to_point3d functions.");
panic!(
"You must either define the dimensions function (trait Algorithm3D) on your map, or define the various point3d_to_index and index_to_point3d functions."
);
}

// Optional - check that an x/y/z coordinate is within the map bounds. If not provided,
Expand Down
2 changes: 1 addition & 1 deletion bracket-algorithm-traits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ pub mod prelude {
pub use crate::basemap::BaseMap;

/// Since we use `SmallVec`, it's only polite to export it so you don't have to have multiple copies.
pub use smallvec::{smallvec, SmallVec};
pub use smallvec::{SmallVec, smallvec};
}
2 changes: 1 addition & 1 deletion bracket-bevy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bracket-bevy"
version = "0.9.0"
edition = "2021"
edition = "2024"
authors = ["Herbert Wolverson <herberticus@gmail.com>"]
publish = true
description = "ASCII/CP437 Psuedo-terminal for Bevy, based on bracket-lib. Aims to provide everything you need to produce a retro console experience using Bevy for the ECS and rendering."
Expand Down
2 changes: 1 addition & 1 deletion bracket-bevy/examples/bevy_roguelike_tutorial_4/map.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::rect::Rect;
use bevy::prelude::Resource;
use bracket_bevy::{
prelude::{to_cp437, RGB},
BracketContext, RandomNumbers,
prelude::{RGB, to_cp437},
};
use std::cmp::{max, min};

Expand Down
7 changes: 4 additions & 3 deletions bracket-bevy/src/builder/bterm_builder.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use crate::{
RandomNumbers, TerminalBuilderFont, TerminalLayer,
consoles::{
apply_all_batches, default_gutter_size, replace_meshes, update_mouse_position,
update_timing, window_resize, ScreenScaler,
ScreenScaler, apply_all_batches, default_gutter_size, replace_meshes,
update_mouse_position, update_timing, window_resize,
},
fix_images, load_terminals, update_consoles, RandomNumbers, TerminalBuilderFont, TerminalLayer,
fix_images, load_terminals, update_consoles,
};
use bevy::{
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
Expand Down
4 changes: 2 additions & 2 deletions bracket-bevy/src/builder/loader_system.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::{
consoles::SparseConsole, fonts::FontStore, BTermBuilder, BracketContext, SimpleConsole,
TerminalLayer,
BTermBuilder, BracketContext, SimpleConsole, TerminalLayer, consoles::SparseConsole,
fonts::FontStore,
};
use bevy::{
asset::UntypedHandle,
Expand Down
2 changes: 1 addition & 1 deletion bracket-bevy/src/consoles/common_draw.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{ColoredTextSpans, ConsoleFrontEnd, TextAlign};
use crate::{
prelude::{string_to_cp437, to_cp437},
BracketContext,
prelude::{string_to_cp437, to_cp437},
};
use bracket_color::prelude::*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::SimpleConsoleBackend;
use crate::consoles::{scaler::FontScaler, BracketMesh, ScreenScaler, SimpleConsole};
use crate::consoles::{BracketMesh, ScreenScaler, SimpleConsole, scaler::FontScaler};
use bevy::{
asset::RenderAssetUsages,
mesh::{Indices, PrimitiveTopology},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::consoles::{scaler::FontScaler, BracketMesh, ScreenScaler, SimpleConsole};
use crate::consoles::{BracketMesh, ScreenScaler, SimpleConsole, scaler::FontScaler};
use bevy::{
asset::RenderAssetUsages,
mesh::{Indices, PrimitiveTopology},
Expand Down
6 changes: 3 additions & 3 deletions bracket-bevy/src/consoles/simple_console/front_end.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use super::{
back_end::{SimpleBackendNoBackground, SimpleBackendWithBackground, SimpleConsoleBackend},
TerminalGlyph,
back_end::{SimpleBackendNoBackground, SimpleBackendWithBackground, SimpleConsoleBackend},
};
use crate::{
consoles::{common_draw, ConsoleFrontEnd, Rect, ScreenScaler},
fonts::FontStore,
BracketContext, FontCharType, SimpleConsoleFeatures,
consoles::{ConsoleFrontEnd, Rect, ScreenScaler, common_draw},
fonts::FontStore,
};
use bevy::prelude::{Assets, ColorMaterial, Commands, Handle, Mesh};
use bracket_color::prelude::RGBA;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::SparseConsoleBackend;
use crate::consoles::{scaler::FontScaler, BracketMesh, ScreenScaler, SparseConsole};
use crate::consoles::{BracketMesh, ScreenScaler, SparseConsole, scaler::FontScaler};
use bevy::{
asset::RenderAssetUsages,
mesh::{Indices, PrimitiveTopology},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::SparseConsoleBackend;
use crate::consoles::{scaler::FontScaler, BracketMesh, ScreenScaler, SparseConsole};
use crate::consoles::{BracketMesh, ScreenScaler, SparseConsole, scaler::FontScaler};
use bevy::{
asset::RenderAssetUsages,
mesh::{Indices, PrimitiveTopology},
Expand Down
4 changes: 2 additions & 2 deletions bracket-bevy/src/consoles/sparse_console/front_end.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use std::collections::HashSet;

use super::{SparseBackendNoBackground, SparseBackendWithBackground, SparseConsoleBackend};
use crate::{
consoles::{common_draw, ConsoleFrontEnd, Rect, ScreenScaler, TerminalGlyph},
fonts::FontStore,
BracketContext, FontCharType, SparseConsoleFeatures,
consoles::{ConsoleFrontEnd, Rect, ScreenScaler, TerminalGlyph, common_draw},
fonts::FontStore,
};
use bevy::prelude::{Assets, ColorMaterial, Commands, Handle, Mesh};
use bracket_color::prelude::RGBA;
Expand Down
10 changes: 5 additions & 5 deletions bracket-bevy/src/consoles/update_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ pub(crate) fn update_mouse_position(
return;
};

if let Some(screen_pos) = wnd.cursor_position() {
if let Ok(world_pos) = camera.viewport_to_world_2d(camera_transform, screen_pos) {
let result = (world_pos.x, world_pos.y);
context.set_mouse_pixel_position(result, &scaler);
}
if let Some(screen_pos) = wnd.cursor_position()
&& let Ok(world_pos) = camera.viewport_to_world_2d(camera_transform, screen_pos)
{
let result = (world_pos.x, world_pos.y);
context.set_mouse_pixel_position(result, &scaler);
}
}
2 changes: 1 addition & 1 deletion bracket-bevy/src/consoles/virtual_console.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bracket_color::prelude::RGBA;
use bracket_geometry::prelude::{Point, Rect};

use super::{common_draw, ConsoleFrontEnd, TerminalGlyph};
use super::{ConsoleFrontEnd, TerminalGlyph, common_draw};
use crate::{BracketContext, FontCharType};

pub struct VirtualConsole {
Expand Down
2 changes: 1 addition & 1 deletion bracket-bevy/src/context.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{
FontCharType, TerminalScalingMode,
consoles::{ConsoleFrontEnd, DrawBatch, DrawCommand, ScreenScaler},
fonts::FontStore,
FontCharType, TerminalScalingMode,
};
use bevy::prelude::{Mesh2d, Resource};
use bracket_color::prelude::RGBA;
Expand Down
4 changes: 2 additions & 2 deletions bracket-bevy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pub type FontCharType = u16;

pub mod prelude {
pub use crate::{
consoles::TextAlign, cp437::*, textblock::*, BTermBuilder, BracketContext, DrawBatch,
RandomNumbers, TerminalScalingMode, VirtualConsole,
BTermBuilder, BracketContext, DrawBatch, RandomNumbers, TerminalScalingMode,
VirtualConsole, consoles::TextAlign, cp437::*, textblock::*,
};
pub use bracket_color::prelude::*;
pub use bracket_geometry::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion bracket-bevy/src/textblock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bracket_geometry::prelude::{Point, Rect};
use std::cmp;

use crate::{
consoles::TerminalGlyph, cp437::string_to_cp437, BracketContext, DrawBatch, FontCharType,
BracketContext, DrawBatch, FontCharType, consoles::TerminalGlyph, cp437::string_to_cp437,
};

pub struct TextBlock {
Expand Down
2 changes: 1 addition & 1 deletion bracket-color/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bracket-color"
version = "0.8.7"
authors = ["Herbert Wolverson <herberticus@gmail.com>"]
edition = "2021"
edition = "2024"
publish = true
description = "RGB and HSV color handling and utilities, including lerp and W3C named colors. Part of the bracket-lib family."
homepage = "https://github.com/thebracket/bracket-lib"
Expand Down
2 changes: 1 addition & 1 deletion bracket-color/examples/colors.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bracket_color::prelude::*;
use std::io::{stdout, Write};
use std::io::{Write, stdout};
use util::print_color;

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion bracket-color/examples/lerp.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bracket_color::prelude::*;
use std::io::{stdout, Write};
use std::io::{Write, stdout};
use util::print_color;

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion bracket-color/examples/lerpit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bracket_color::prelude::*;
use std::io::{stdout, Write};
use std::io::{Write, stdout};
use util::print_color;

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion bracket-color/examples/lerpit_hsv.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bracket_color::prelude::*;
use std::io::{stdout, Write};
use std::io::{Write, stdout};
use util::print_color;

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion bracket-color/examples/named_color.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bracket_color::prelude::*;
use std::io::{stdout, Write};
use std::io::{Write, stdout};
use util::print_color;

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion bracket-color/examples/shades_of_grey.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bracket_color::prelude::*;
use std::io::{stdout, Write};
use std::io::{Write, stdout};
use util::print_color;

fn main() {
Expand Down
Loading
Loading