map shortnames/identifiers
This commit is contained in:
parent
849a554055
commit
9fb791039f
12 changed files with 80 additions and 26 deletions
|
|
@ -12,7 +12,7 @@ pub enum FarlookResult {
|
|||
|
||||
pub fn show_farlook(gs: &mut State, ctx: &mut Rltk) -> FarlookResult {
|
||||
let runstate = gs.ecs.fetch::<RunState>();
|
||||
let (min_x, _max_x, min_y, _max_y, x_offset, y_offset) = get_screen_bounds(&gs.ecs, ctx);
|
||||
let (_min_x, _max_x, _min_y, _max_y, x_offset, y_offset) = get_screen_bounds(&gs.ecs, ctx);
|
||||
|
||||
ctx.print_color(
|
||||
1 + x_offset,
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ use super::{
|
|||
State,
|
||||
Viewshed,
|
||||
BUC,
|
||||
get_local_col,
|
||||
};
|
||||
use crate::data::entity::CARRY_CAPACITY_PER_STRENGTH;
|
||||
use rltk::prelude::*;
|
||||
|
|
@ -323,17 +324,12 @@ pub fn draw_ui(ecs: &World, ctx: &mut Rltk) {
|
|||
|
||||
// Render id
|
||||
let map = ecs.fetch::<Map>();
|
||||
let id = format!("D{}", map.id);
|
||||
ctx.print_color_right(70, 54, RGB::named(rltk::YELLOW), RGB::named(rltk::BLACK), &id);
|
||||
let id = if map.depth > 0 { format!("{}{}", map.short_name, map.depth) } else { format!("{}", map.short_name) };
|
||||
ctx.print_color_right(70, 54, get_local_col(map.id), RGB::named(rltk::BLACK), &id);
|
||||
|
||||
// Render turn
|
||||
ctx.print_color_right(
|
||||
64,
|
||||
54,
|
||||
RGB::named(rltk::YELLOW),
|
||||
RGB::named(rltk::BLACK),
|
||||
&format!("T{}", crate::gamelog::get_event_count(EVENT::COUNT_TURN))
|
||||
);
|
||||
let turns = crate::gamelog::get_event_count(EVENT::COUNT_TURN);
|
||||
ctx.print_color_right(69 - id.len(), 54, RGB::named(rltk::YELLOW), RGB::named(rltk::BLACK), &format!("T{}", turns));
|
||||
|
||||
// Boxes and tooltips last, so they draw over everything else.
|
||||
ctx.draw_hollow_box(0, 0, 70, 8, RGB::named(rltk::WHITE), RGB::named(rltk::BLACK)); // Log box
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue