From 9658950e6a8a04d6340280b5b77ddad45472f96a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 19 May 2023 01:18:02 +0200 Subject: [PATCH] set_char_by_name --- changelog.txt | 8 ++++ config.cpp | 102 ++++++++++++++++++++++++++------------------------ 2 files changed, 61 insertions(+), 49 deletions(-) diff --git a/changelog.txt b/changelog.txt index acf0eafe..fd9ec502 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4958,3 +4958,11 @@ Other fixes: - fixed the orientation in the hat tiling - fixed bugs when regenerating a map in the hat tiling + embedding - fixed variation not showing in some geometries + +2023-05-19 01:15 Update 12.1p: +Mostly embedding-related improvements: +- embedding scale parameter now works in "lower curvature" (horospher) embedding (redundant, but useful) +- better wall shading in EuclidSquare embeddings +- many embedding-related fixes +- "Non-Euclidean Third Dimension" demo (of embeddings) in RogueViz +(also, the "imaginary" hat parameter) diff --git a/config.cpp b/config.cpp index a19cb504..fb122252 100644 --- a/config.cpp +++ b/config.cpp @@ -3773,60 +3773,64 @@ EX int read_config_args() { auto& cs = vid.cs; shift(); string s = args(); - if(s == "dodek") { - cs.charid = 4; - cs.lefthanded = false; - cs.skincolor = 0x202020FF; - cs.eyecolor = 0x20C000FF; - cs.haircolor = 0x202020FF; - cs.dresscolor =0x424242FF; - cs.swordcolor = 0xF73333FF; - } - else if(s == "rudy") { - cs.charid = 4; - cs.lefthanded = false; - cs.skincolor = 0xA44139FF; - cs.eyecolor = 0xD59533FF; - cs.haircolor = 0xC6634AFF; - cs.dresscolor =0xC6634AFF; - cs.swordcolor = 0x3CBB33FF; - } - else if(s == "running") { - cs.charid = 6; - cs.lefthanded = false; - cs.skincolor = 0xFFFFFFFF; - cs.eyecolor = 0xFF; - cs.haircolor = 0xFFFFFFFF; - cs.dresscolor =0xFFFFFFFF; - cs.swordcolor = 0xFF0000FF; - } - else if(s == "princess") { - cs.charid = 3; - cs.lefthanded = true; - cs.skincolor = 0xEFD0C9FF; - cs.haircolor = 0x301800FF; - cs.eyecolor = 0xC000FF; - cs.dresscolor = 0x408040FF; - cs.swordcolor = 0xFFFFFFFF; - } - else if(s == "worker") { - cs.charid = 2; - cs.skincolor = 0xC77A58FF; - cs.haircolor = 0x502810FF; - cs.dresscolor = 0xC0C000FF; - cs.eyecolor = 0x500040FF; - cs.swordcolor = 0x808080FF; - } - else { - cs.charid = argi(); - cs.lefthanded = cs.charid >= 10; - cs.charid %= 10; - } + set_char_by_name(cs, s); } else return 1; return 0; } +EX void set_char_by_name(charstyle& cs, const string& s) { + if(s == "dodek") { + cs.charid = 4; + cs.lefthanded = false; + cs.skincolor = 0x202020FF; + cs.eyecolor = 0x20C000FF; + cs.haircolor = 0x202020FF; + cs.dresscolor =0x424242FF; + cs.swordcolor = 0xF73333FF; + } + else if(s == "rudy") { + cs.charid = 4; + cs.lefthanded = false; + cs.skincolor = 0xA44139FF; + cs.eyecolor = 0xD59533FF; + cs.haircolor = 0xC6634AFF; + cs.dresscolor =0xC6634AFF; + cs.swordcolor = 0x3CBB33FF; + } + else if(s == "running") { + cs.charid = 6; + cs.lefthanded = false; + cs.skincolor = 0xFFFFFFFF; + cs.eyecolor = 0xFF; + cs.haircolor = 0xFFFFFFFF; + cs.dresscolor =0xFFFFFFFF; + cs.swordcolor = 0xFF0000FF; + } + else if(s == "princess") { + cs.charid = 3; + cs.lefthanded = true; + cs.skincolor = 0xEFD0C9FF; + cs.haircolor = 0x301800FF; + cs.eyecolor = 0xC000FF; + cs.dresscolor = 0x408040FF; + cs.swordcolor = 0xFFFFFFFF; + } + else if(s == "worker") { + cs.charid = 2; + cs.skincolor = 0xC77A58FF; + cs.haircolor = 0x502810FF; + cs.dresscolor = 0xC0C000FF; + cs.eyecolor = 0x500040FF; + cs.swordcolor = 0x808080FF; + } + else { + cs.charid = atoi(s.c_str()); + cs.lefthanded = cs.charid >= 10; + cs.charid %= 10; + } + } + EX int read_param_args() { const string& s = arg::args(); auto pos = s.find("=");