use ratatui::style::{Color, Modifier, Style};
use crate::types::AgePhase;
use crate::scene::types::{EmotionTag, PacingTag};
pub fn age_accent(phase: AgePhase) -> Color {
match phase {
AgePhase::Youth => Color::Rgb(180, 200, 160), AgePhase::YoungMan => Color::Rgb(200, 180, 120), AgePhase::Adult => Color::Rgb(160, 140, 120), AgePhase::Older => Color::Rgb(140, 140, 150), }
}
pub fn age_menu_title(phase: AgePhase) -> &'static str {
match phase {
AgePhase::Youth => "What do you do?",
AgePhase::YoungMan => "Your move.",
AgePhase::Adult => "Orders.",
AgePhase::Older => "One more time.",
}
}
pub fn age_name_style(phase: AgePhase) -> Style {
match phase {
AgePhase::Youth => Style::default().fg(Color::White),
AgePhase::YoungMan => Style::default().fg(Color::White),
AgePhase::Adult => Style::default().fg(Color::White).add_modifier(Modifier::BOLD),
AgePhase::Older => Style::default().fg(Color::White)
.add_modifier(Modifier::BOLD | Modifier::ITALIC),
}
}
pub fn age_label(phase: AgePhase) -> &'static str {
match phase {
AgePhase::Youth => "Youth, Age 19",
AgePhase::YoungMan => "Young Man, Age 24",
AgePhase::Adult => "Adult, Age 34",
AgePhase::Older => "Older, Age 50+",
}
}
pub fn emotion_color(tag: Option<EmotionTag>) -> Color {
match tag {
None | Some(EmotionTag::Neutral) => Color::White,
Some(EmotionTag::Warm) => Color::Rgb(210, 180, 140), Some(EmotionTag::Tense) => Color::Rgb(180, 80, 60), Some(EmotionTag::Bitter) => Color::Rgb(140, 140, 140), Some(EmotionTag::Dry) => Color::Rgb(180, 160, 120), Some(EmotionTag::Grief) => Color::Rgb(100, 110, 130), Some(EmotionTag::Quiet) => Color::DarkGray,
}
}
pub fn pacing_reveal_ms(tag: PacingTag) -> u64 {
match tag {
PacingTag::Exploration => 30,
PacingTag::Pressure => 15,
PacingTag::Intimate => 50,
PacingTag::Crisis => 0, }
}
pub fn pacing_border(tag: PacingTag) -> PacingBorder {
match tag {
PacingTag::Exploration => PacingBorder::Plain,
PacingTag::Pressure => PacingBorder::Double,
PacingTag::Intimate => PacingBorder::None,
PacingTag::Crisis => PacingBorder::Thick,
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PacingBorder {
None,
Plain,
Double,
Thick,
}
pub fn gauge_color(current: i32, max: i32) -> Color {
if max <= 0 {
return Color::DarkGray;
}
let pct = (current as f64 / max as f64 * 100.0) as i32;
if pct > 60 {
Color::Green
} else if pct > 30 {
Color::Yellow
} else {
Color::Red
}
}
pub fn ammo_color(current: i32) -> Color {
if current > 3 { Color::White } else { Color::Red }
}
pub fn locked_style() -> Style {
Style::default().fg(Color::DarkGray)
}
pub fn lock_reason_style() -> Style {
Style::default().fg(Color::Rgb(180, 80, 60)) }
pub fn narrator_style() -> Style {
Style::default().fg(Color::Rgb(200, 200, 200))
}
pub fn body_style() -> Style {
Style::default().fg(Color::Rgb(220, 220, 220))
}
pub fn dim_style() -> Style {
Style::default().fg(Color::DarkGray)
}
pub fn echo_style() -> Style {
Style::default()
.fg(Color::Rgb(180, 160, 120))
.add_modifier(Modifier::ITALIC)
}
pub fn echo_border_style() -> Style {
Style::default().fg(Color::DarkGray)
}
pub fn title_style() -> Style {
Style::default()
.fg(Color::Rgb(200, 180, 140))
.add_modifier(Modifier::BOLD)
}