From 80d9aa13251f7f5c3d3eeaa877bc79dac4435341 Mon Sep 17 00:00:00 2001 From: salmonik Date: Thu, 29 Oct 2026 23:08:25 +0100 Subject: PLN changed to Kromer --- src/client/core.rs | 16 ++++++++-------- src/client/games/blackjack.rs | 10 +++++----- src/client/games/crash.rs | 6 +++--- src/client/games/roulette.rs | 25 ++++++++++++++----------- src/client/games/slots.rs | 10 +++++----- src/client/ui.rs | 8 ++------ 6 files changed, 37 insertions(+), 38 deletions(-) (limited to 'src/client') diff --git a/src/client/core.rs b/src/client/core.rs index 95fa050..54a6434 100644 --- a/src/client/core.rs +++ b/src/client/core.rs @@ -2,12 +2,12 @@ use crate::client::games::manager::GameManager; use crate::client::games::response::{ parse_blackjack_response, parse_crash_response, parse_roulette_response, parse_spin_response, }; +use crate::client::games::roulette::Direction; use crate::client::ui::{ command_names, completion_lines, display_width, help_lines, input_cursor_column, parse_bet_arg, record_history, }; -use crate::crash::{multiplier_at, CrashState}; -use crate::client::games::roulette::Direction; +use crate::crash::{CrashState, multiplier_at}; use crate::roulette::Bets; use std::time::{Duration, Instant}; @@ -240,7 +240,7 @@ impl ClientCore { Ok(state) => { self.game.end_game(); let message = format!( - "Game exited. Active hand forfeited ({} PLN lost).", + "Game exited. Active hand forfeited ({} Kr lost).", state.bet ); vec![Effect::ClearRegion, Effect::Print(vec![message])] @@ -273,7 +273,7 @@ impl ClientCore { Ok(state) => { self.crash_started = None; self.game.end_game(); - let message = format!("Game exited. Round forfeited ({} PLN lost).", state.bet); + let message = format!("Game exited. Round forfeited ({} Kr lost).", state.bet); vec![Effect::ClearRegion, Effect::Print(vec![message])] } Err(_) if self.game.crash_status() != "running" => { @@ -865,9 +865,9 @@ impl ClientCore { Some(fingerprint) => { effects.push(Effect::Print(vec![format!("Fingerprint: {fingerprint}")])) } - None => effects.push(Effect::Print( - vec!["Fingerprint: (not trusted)".to_string()], - )), + None => effects.push(Effect::Print(vec![ + "Fingerprint: (not trusted)".to_string(), + ])), } self.pending = Some(Pending::Info); @@ -953,7 +953,7 @@ fn info_lines(reply: &str) -> Vec { vec![ format!("User: {}", parts[1]), format!("Account: {}", parts[2]), - format!("Balance: {} PLN", parts[3]), + format!("Balance: {} Kr", parts[3]), ] } else { vec![reply.trim().to_string()] diff --git a/src/client/games/blackjack.rs b/src/client/games/blackjack.rs index d5f45b3..8fa5693 100644 --- a/src/client/games/blackjack.rs +++ b/src/client/games/blackjack.rs @@ -1,5 +1,5 @@ use super::traits::{Game, GameState}; -use crate::blackjack::{card_label, BlackjackState}; +use crate::blackjack::{BlackjackState, card_label}; pub const BLACKJACK_BOARD_LINES: usize = 6; @@ -33,8 +33,8 @@ impl BlackjackGame { fn result_text(result: &str, winnings: u64) -> String { match result { - "blackjack" => format!("BLACKJACK! Won {winnings} PLN"), - "win" => format!("Win! Won {winnings} PLN"), + "blackjack" => format!("BLACKJACK! Won {winnings} Kr"), + "win" => format!("Win! Won {winnings} Kr"), "push" => "Push. Bet returned.".to_string(), "lose" => "Dealer wins.".to_string(), "bust" => "Bust.".to_string(), @@ -65,7 +65,7 @@ impl Game for BlackjackGame { .map(|hand| hand.bet) .unwrap_or(state.bet_amount); return format!( - "=== BLACKJACK ===\r\nBalance: {balance} PLN Bet: {bet} PLN\r\n\r\n\r\nERROR: {error}\r\n[Q] Quit" + "=== BLACKJACK ===\r\nBalance: {balance} Kr Bet: {bet} Kr\r\n\r\n\r\nERROR: {error}\r\n[Q] Quit" ); } @@ -120,7 +120,7 @@ impl Game for BlackjackGame { }; format!( - "=== BLACKJACK ===\r\nBalance: {} PLN Bet: {} PLN\r\nDealer: {} {}\r\nYou: {} {}\r\n{}\r\n{}", + "=== BLACKJACK ===\r\nBalance: {} Kr Bet: {} Kr\r\nDealer: {} {}\r\nYou: {} {}\r\n{}\r\n{}", balance, bet, dealer, dealer_total, player, player_total, text, controls ) } diff --git a/src/client/games/crash.rs b/src/client/games/crash.rs index 19733f2..383e807 100644 --- a/src/client/games/crash.rs +++ b/src/client/games/crash.rs @@ -19,7 +19,7 @@ impl CrashGame { "starting" => "Starting...".to_string(), "running" => "Rising... cash out before it crashes.".to_string(), "cashed" => format!( - "Cashed out at {}x Won {} PLN", + "Cashed out at {}x Won {} Kr", Self::value(state, "multiplier").unwrap_or("1.00"), Self::value(state, "payout").unwrap_or("0") ), @@ -55,13 +55,13 @@ impl Game for CrashGame { if let Some(error) = Self::value(state, "error") { return format!( - "=== CRASH ===\r\nBalance: {balance} PLN Bet: {} PLN\r\n\r\nERROR: {error}\r\n\r\n[SPACE] Play [+/=/-] Bet [Q] Quit", + "=== CRASH ===\r\nBalance: {balance} Kr Bet: {} Kr\r\n\r\nERROR: {error}\r\n\r\n[SPACE] Play [+/=/-] Bet [Q] Quit", state.bet_amount ); } format!( - "=== CRASH ===\r\nBalance: {} PLN Bet: {} PLN\r\nMultiplier: {}x\r\nPotential: {} PLN\r\n{}\r\n{}", + "=== CRASH ===\r\nBalance: {} Kr Bet: {} Kr\r\nMultiplier: {}x\r\nPotential: {} Kr\r\n{}\r\n{}", balance, state.bet_amount, multiplier, diff --git a/src/client/games/roulette.rs b/src/client/games/roulette.rs index 3cb1c58..96f8791 100644 --- a/src/client/games/roulette.rs +++ b/src/client/games/roulette.rs @@ -1,5 +1,5 @@ use super::traits::{Game, GameState}; -use crate::roulette::{is_even, is_odd, BetTarget, Bets, Outside}; +use crate::roulette::{BetTarget, Bets, Outside, is_even, is_odd}; pub const ROULETTE_BOARD_LINES: usize = 12; @@ -96,7 +96,9 @@ impl Cursor { /// Numbers the cursor would cover, for highlighting the felt. pub fn numbers(&self) -> Vec { - self.target().map(|target| target.numbers()).unwrap_or_default() + self.target() + .map(|target| target.numbers()) + .unwrap_or_default() } pub fn moved(&self, direction: Direction) -> Cursor { @@ -130,9 +132,7 @@ impl Cursor { (Cursor::Column(index), Direction::Up) => Cursor::Dozen(index), (Cursor::Column(index), Direction::Down) => Cursor::Outside(index * 2), - (Cursor::Outside(index), Direction::Left) => { - Cursor::Outside(index.saturating_sub(1)) - } + (Cursor::Outside(index), Direction::Left) => Cursor::Outside(index.saturating_sub(1)), (Cursor::Outside(index), Direction::Right) => { Cursor::Outside((index + 1).min(OUTSIDE_ORDER.len() - 1)) } @@ -249,7 +249,11 @@ impl RouletteGame { .iter() .enumerate() .map(|(index, kind)| { - Self::wide_cell(kind.label(), OUTSIDE_WIDTH, cursor == Cursor::Outside(index)) + Self::wide_cell( + kind.label(), + OUTSIDE_WIDTH, + cursor == Cursor::Outside(index), + ) }) .collect() } @@ -268,7 +272,7 @@ impl RouletteGame { if list.chars().count() > 40 { list = list.chars().take(39).collect::() + "…"; } - format!("Bets: {list} Total: {} PLN", bets.total()) + format!("Bets: {list} Total: {} Kr", bets.total()) } fn status_line(state: &GameState) -> String { @@ -309,7 +313,7 @@ impl RouletteGame { format!("No win at {number} {color}{parity}") } else { let profit = winnings.parse::().unwrap_or(0).saturating_sub(stake); - format!("Won {winnings} PLN at {number} {color}{parity} (+{profit})") + format!("Won {winnings} Kr at {number} {color}{parity} (+{profit})") } } Some("spinning") => "Spinning...".to_string(), @@ -332,7 +336,7 @@ impl Game for RouletteGame { let lines = [ "=== ROULETTE ===".to_string(), - format!("Balance: {balance} PLN Chip: {chip} PLN"), + format!("Balance: {balance} Kr Chip: {chip} Kr"), Self::zero_cell(cursor), Self::number_row(0, &covered), Self::number_row(1, &covered), @@ -342,8 +346,7 @@ impl Game for RouletteGame { Self::outside_row(cursor), Self::bets_line(&bets), Self::status_line(state), - "[ARROWS] Move [ENTER] Bet [C]lear [+/-] Chip [SPACE] Spin [Q] Quit" - .to_string(), + "[ARROWS] Move [ENTER] Bet [C]lear [+/-] Chip [SPACE] Spin [Q] Quit".to_string(), ]; lines.join("\r\n") } diff --git a/src/client/games/slots.rs b/src/client/games/slots.rs index 2ec354e..5bffc4c 100644 --- a/src/client/games/slots.rs +++ b/src/client/games/slots.rs @@ -1,5 +1,5 @@ use super::traits::{Game, GamePhase, GameState}; -use crate::slots::{paytable_lines, LINE_NAMES, REELS, ROWS}; +use crate::slots::{LINE_NAMES, REELS, ROWS, paytable_lines}; /// Height of the game board. It must never depend on the spin result. pub const SLOT_BOARD_LINES: usize = 10; @@ -65,9 +65,9 @@ impl SlotsGame { .unwrap_or("0"); if winnings != "0" { return match state.data.get("win_type").map(String::as_str) { - Some("mega") => format!("MEGA WIN! {winnings} PLN"), - Some("big") => format!("BIG WIN! {winnings} PLN"), - _ => format!("Won {winnings} PLN"), + Some("mega") => format!("MEGA WIN! {winnings} Kr"), + Some("big") => format!("BIG WIN! {winnings} Kr"), + _ => format!("Won {winnings} Kr"), }; } return "No win.".to_string(); @@ -115,7 +115,7 @@ impl Game for SlotsGame { let paytable = paytable_lines(); format!( - "=== SLOTS ===\r\nBet: {} PLN Balance: {} PLN\r\n{}\r\n{}\r\n{}\r\n{}\r\n{}\r\n{}\r\n{}\r\n[+/-] Bet [SPACE] Spin [Q] Quit", + "=== SLOTS ===\r\nBet: {} Kr Balance: {} Kr\r\n{}\r\n{}\r\n{}\r\n{}\r\n{}\r\n{}\r\n{}\r\n[+/-] Bet [SPACE] Spin [Q] Quit", state.bet_amount, balance, grid[0], diff --git a/src/client/ui.rs b/src/client/ui.rs index ca001c2..e7f510b 100644 --- a/src/client/ui.rs +++ b/src/client/ui.rs @@ -145,7 +145,7 @@ pub fn parse_bet_arg(raw: &str) -> Result { .parse::() .map_err(|_| format!("Invalid bet: {raw}"))?; if bet < 10 { - return Err("Bet must be at least 10 PLN".to_string()); + return Err("Bet must be at least 10 Kr".to_string()); } Ok(bet) } @@ -189,11 +189,7 @@ fn char_width(c: char) -> usize { if is_zero_width(cp) || is_combining(cp) { return 0; } - if is_wide(cp) { - 2 - } else { - 1 - } + if is_wide(cp) { 2 } else { 1 } } fn is_zero_width(cp: u32) -> bool { -- cgit v1.2.3