From 9f4a4eaa06f3d0136de9088c0e60a0c077248c91 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Fri, 20 Dec 2019 18:04:24 +0100 Subject: remove hard coded palette IDs Now that the API actually returns the proper palette IDs, we can use those values instead of relying on the hard coded values. This also gets rid of the make_table script that was mostly hackish anyway, and the lazy static HashMap. --- src/main.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 395e683..47ccabd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,8 +10,6 @@ extern crate reqwest; extern crate rusttype; extern crate termcolor; extern crate xdg; -#[macro_use] -extern crate lazy_static; use std::error::Error as StdError; use std::fmt; @@ -37,7 +35,7 @@ mod render; use clap::{App, Arg, ArgMatches}; use api::{Api, Profession, Skill}; -use bt::{BuildTemplate, ExtraData, Legend, TraitChoice, Traitline}; +use bt::{BuildTemplate, ExtraData, Legend, TraitChoice, Traitline, CODE_REVENANT}; use render::RenderError; /// The name of this application. @@ -182,10 +180,6 @@ fn run_searching(api: &mut Api, matches: &ArgMatches) -> MainResult MainResult>(); - let extra_data = if prof_enum == bt::Profession::Revenant { + let extra_data = if profession.code == CODE_REVENANT { let mut array_legends = [Legend::None; 4]; for (i, l) in legends.iter().enumerate() { array_legends[i] = *l; @@ -206,7 +200,7 @@ fn run_searching(api: &mut Api, matches: &ArgMatches) -> MainResult>) @@ -240,7 +234,7 @@ fn run_searching(api: &mut Api, matches: &ArgMatches) -> MainResult MainResult<()> { if !matches.is_present("quiet") { println!("Image saved in {}", filename); } - }, + } Err(RenderError::EmptyBuild) => (), Err(err) => { eprintln!("Image could not be rendered:"); -- cgit v1.2.3