From 22d9a7dcd28acc56867d7cb6174c54725dfb585d Mon Sep 17 00:00:00 2001 From: Monty Marz Date: Fri, 20 Nov 2020 15:01:04 +0100 Subject: [PATCH] translations, fixes --- assets/voxygen/element/map/castle_bg.png | Bin 0 -> 1901 bytes assets/voxygen/element/map/dungeon_bg.png | Bin 0 -> 2226 bytes assets/voxygen/element/map/dungeon_bg2.png | Bin 0 -> 1896 bytes assets/voxygen/element/map/town_bg.png | Bin 0 -> 1906 bytes assets/voxygen/i18n/de_DE.ron | 13 ++- assets/voxygen/i18n/en.ron | 12 +++ voxygen/src/hud/img_ids.rs | 3 + voxygen/src/hud/map.rs | 96 ++++++++++++--------- voxygen/src/hud/minimap.rs | 81 +++++++++++------ voxygen/src/hud/mod.rs | 17 ++-- 10 files changed, 142 insertions(+), 80 deletions(-) create mode 100644 assets/voxygen/element/map/castle_bg.png create mode 100644 assets/voxygen/element/map/dungeon_bg.png create mode 100644 assets/voxygen/element/map/dungeon_bg2.png create mode 100644 assets/voxygen/element/map/town_bg.png diff --git a/assets/voxygen/element/map/castle_bg.png b/assets/voxygen/element/map/castle_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..e01024d07f77a278d2edeb22fdc9d2efcee96c88 GIT binary patch literal 1901 zcmcIl%WvF795x_rA1J6mQA$Onkt?Jk7<*>?wrZkuH)&R4)3DvDLE^xyXS{1=?J>5K z-9%jAf+8MA4u}h=N5q9A5*)bn4?yC;nG2Vy91s$RGTs*{+J*>(<;QsDoA3Ai9y4>e zwRwH%?8UQ+qAWEx8g2PKUp=R5^8L}_r6u_}lWn|FD9V%1R?lO~r=ML=l-jp(XS>{P zz2=7^(I^vLu8opRq7~)p$|$4Z4lhBM_u@2A?|t)~3St(hx2+axWp&<f-MKMK?_uP@tGx2}RQq}&PA)yg2)Zf$|O$T_ez1Ve-f za6Ap$rs=w`0D=h8k)vY-3GtEbTLze3s}V(h*FH%QJ=sFTy;|%2=eJVx(QMTL!9BI&mS%=Co-s4U-I*KBAe9 zHB`AY1GZYnLz85VF3Pn%X=SQ+A#u^!&$!;^h1ktQzP88H^770W3+HpQ-Fz_il!ZDU z@I=B2DGbj|WqnbKqAwod$9#D1P3G5gPD_z@gc!^cwKZb_glGs{xgDoW42zd4Mbinq zK}#N}Rn{QJ5Stxh_}KQ5@iM|bLKA39)&Zj>eHcto2NU10<^2#?usGU33AEMnn`u$f zG~~@jph{6%95b0s*EUgPL(@bUI@F}l#U_H06Lk$_n#?71tV_;sh;X+GUp0SHwoHVQ zV;&*j3~iSht_w{=I>@leAw|T75wZ>JIF>^Qp0VA?W4UtZ;3#XQib+PpaHwI12pUmn zL5G+Y^z1H&w#Q9IE$VV&sepxkB=UsHI*Ak7<9e3%RPdLYx)_MOC76u4akRf#uW#id ziU)F_XkWhunrn3%d$tXUhO4rdGNij3aUpZOKV3*S`P=^l4Zvia-skYT!(r zcE=0Cd@_e7w8K7^q{mdr1XhTs9MYVx_GC)_u?qD^i7)8h@zN>6c9jlj*^vjCXEI1F z*MTOXxJ!{|N8FjY{=Z0{hBfTdw8!NRtE>OPnG==!qC6~Efd3{Bi=EM{jdfCC`rnIh zJa%LgmWdp9$(_Aw&W{xNGe4AgD&v&PBj@|mKmR6=t6R;+YR7##{Qbd$l_xArPSvve zhwW3#Od-!-IQQ$_cWPI_ou?x3=DFqdA3wZt>Gj$(AH4tZyB&PqYp*Z8U}d9=ca`Tp n{{gY(FP1;K^Z1u9+P9F>_~RGy(;)b|IuM&{n~kroz4hLoDh5el literal 0 HcmV?d00001 diff --git a/assets/voxygen/element/map/dungeon_bg.png b/assets/voxygen/element/map/dungeon_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..9a6292d24ca7f35811078e2b025249ad91c781c3 GIT binary patch literal 2226 zcmcIm4Q$j@96vN+IKt2X0s^CSjDgte=k@Li2X1%!IN6OcW*7-7ukE|7*`ydV!HVp$}q9TbzAjCj`#lQlDkN|#=AQ7VIbiw$#-A*tA35iYGzP|T+ zzyI(5@!o4oX-VOP^k>o?4#$LGQJ@UHC)@Y9vFMp-nKc2up3sX{n-0hLN%lR)(bh4| z;TZdsQeI(Igo*`8i#maIm&{EM6Mdfm97GOoWw+>cf9NcnHT7*@v%kg{YA3 zhgC{Zy#ZI&my}EO)sk1nmoC8;#|1s(gl)?#bVAF>(q=&lJ_Sve(W+)LOekPv9OxwNq->W)fT7TXq0wjxZCd%Y$VyW0sKjP@oes$|XlgZv z1oLa5YGsWWlcm&Ly~c_y?jCA%7+j3>L5QNsLi4h_@BsvshL zK$Q%`Of781fB|zWQA+-^3d#G4H$m-#rPH(+mM8`iye!j%SLDKk$cr=)c8MO2rX`V~ zP)`3x=}B&>3aFJ3?XV>N=*~P`xsT?|C=2jW@-VtHq`k2YR~Y&4;u{*fYZFF^9O^-Emd?VZayf4`I+Y#l$TZ*cNP=fuvw^qgxmOLiTe+1r%& z&Dv{%KWk?5?Cx2o)aHh9*QdYm>6opVmANaje`+4-z8*fid9}Ijs ze`RJ4+p&D-KG(&!n!Y>NfARB-!os}nbDQ@apt9v7dlKJnxS4qM>diH`^t~iiw4=D8 z|I+-0UHu<+)SbWPKP*Voa*l3$Cv(+_3)N-Jk&iNhC$)@Io4uzN$OFf$<8y_B=X$p9 zowvNbOaI|=`qQ$Tg{=j1er${bA<|Rhxf+JTT=vG<#INfLdyx7vVzeEYO ze1B~HmE!4Dp*^dozE<46@lM)r4L7!Y5MK7)?lV^^W>4(7xOPV4mW(tlGSC-Eyxkjb za*ez2)cKclns?t>va|J%(?^%QUvhm)=E=sv(*uVF+&9Ok?do15G(NV*{;LS)mjrtA H*1qvK-gf#+ literal 0 HcmV?d00001 diff --git a/assets/voxygen/element/map/dungeon_bg2.png b/assets/voxygen/element/map/dungeon_bg2.png new file mode 100644 index 0000000000000000000000000000000000000000..cbca31c83577d1b1753201a48e236a3467d78f31 GIT binary patch literal 1896 zcmcIlJ&fE$6gEwi961W0h(Jh|gG5j=_KfZIdaZ1ZyWJ(X0w1f(iX15rh>I72k*0uH0p}OOD)P~H2>gX6T zj7_y#(}`o-u6s!}v55^_H3&wg>0!sKSnBMjfwzo@-gfiVnJ@UNYyF}~J;N9dhx*Xc zW!5uDtyVLzX_zJg1j@%rK}RUb&(9f}B4=5Y7LiQUl92{-uc&LFbQ(gOE@+c{mL^D; zF`}tKbXGR~`aO9);tRKz-k9 zCwV~=Cfd!q2BP#R;$A>1A$G8f95V=!71%Cv!w{oTP`fIyU8_{Xi7v2jO14*~ue6`G zEtd>978&w{B}$tR0a=Ku*k&l8tcI+R6T&QR5zOaoZ)6ed96C74TB_o}D5|zuA+(C@ zkeG;2o1!3aK$UG#%VpfO1k+T`yijH_g+7U5+7m{a^fdJ!H4QnCnJ+oy+&VhnZZtZX z45I-oaHsr|4ofb^IynZj}z7DJke^&XVuKfBO)l=z(PA1|GdAY|AS$l;uzT40AL zZ~}tDO5oa1)xgAb9{T?xeU?_%r%6x132SJNAI!B(}Ta( z{=BUlmY2*m&CbFv0I_bYA)5(v8Ej-nox%T>0wE+23BHcOQHZrT4yn^ZA{_ lJLCQLKm8>mhktzc_RUY6-=F&S;<&sE+pVqUosD;H{tf8ORc!zO literal 0 HcmV?d00001 diff --git a/assets/voxygen/element/map/town_bg.png b/assets/voxygen/element/map/town_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..d0d41fe6983c8b476dae5e4787bd71e487416810 GIT binary patch literal 1906 zcmcIlPl(+_9FC03LLuJp>lOTu(z34^pUp-h5#G>9kc@RbPpx$)y{<)Ryx)gknm&wdG-+aH{ z@0*#OmF08ua}Ul*k~H6H`m5r7qIza$#Q(LOhv&uXSk`=|kfh`HSI<4t>(?KUq?wQ7 z_FB0XTyP0bR7`ou)IpL7v?QH6GsrMmXQdpnPMmtmFCTuQ$T9VlOI84btiif*b311j zx0l;wd!0B`IdfV*HE;z%!b&U;l3rT415X+9x}sfmYl=LClLbf8mwtL1PHm%b}d65{}i!WP9t~Ke`>sz`0|u)S!S-L_4|Fb zZ>T))Xu9J#8blgGKp;S|m6mt_(qdu4;Io3{aaP7Wl`BRZ@{Q6{gwjz6Nj9ZTi*cGn z!n6U-G+l*NNE2WX91Km8DY__^HpMDqz55au?X8SytE}J~IblniEG-u%i%~M2n{DL1 zVWgC3tj7`oD}*q8x>VNXB`>=C4slF}r_p3?BWJked7Jazq);mp78xNG%8y-&Q_B0r zQT9h~?tmS)(5T(X3b?YIt!@3oL&@eHGkO={X)CSCm5OG2aVO<~U67zjdHmdYh z^GCL&oCuC-hFm)`F-6P(js;C%)=e8Y7+D~!N5rul1M1NzO2PJY9*doWdwW?cRa7t< zMhzP#fxw7}1!~B&fMbUY*bXx(ws4&xOOYvYBc3N%_#{qnhiO^bQRIKrG>$X*z?da*oor;ACo zDLjQ#ZeUaycgOpr`EUV^X!~6zNDpwy2v+c@?Bkp*c0@`3(}mid#20w;VCfj@c2y2w z*^vXNV^V;vdJUMu8X<;`9kJRZ^#4WrIIX0M(+(3Stft(3Fo(1Ies$Pq1Kv#?_76s@ z4%U&ww11m#IJV~y7KI#kiIcr*POlX4F};*nD)N+zE6029(bvRvb-Cp)w(Hk^{^r>^ zNuE9W=|_LP3EpU4_z5riH?ID!A5~tRJ-P76`Cp&^>hmktcW=Dt{PFe7Lp!gWp1b_k z2Pf|P@rd>9{Q2_u&08m5{`0fq``_M|zPokrOKQ-zmE&K1B Hy>j($Jj7Pq literal 0 HcmV?d00001 diff --git a/assets/voxygen/i18n/de_DE.ron b/assets/voxygen/i18n/de_DE.ron index 10503168d1..fb2229d7b2 100644 --- a/assets/voxygen/i18n/de_DE.ron +++ b/assets/voxygen/i18n/de_DE.ron @@ -400,8 +400,17 @@ magischen Gegenstände ergattern?"#, "hud.free_look_indicator": "Freie Sicht aktiv", "hud.auto_walk_indicator": "Automatisches Laufen aktiv", - - + "hud.map.difficulty": "Schwierigkeit", + "hud.map.towns": "Dörfer", + "hud.map.castles": "Festungen", + "hud.map.dungeons": "Dungeons", + "hud.map.town": "Dorf", + "hud.map.castle": "Festung", + "hud.map.dungeon": "Dungeon", + "hud.map.difficulty_dungeon": "Dungeon\n\nSchwierigkeit: {difficulty}", + "hud.map.drag": "Ziehen", + "hud.map.zoom": "Zoomen", + "hud.map.recenter": "Zurücksetzen", /// End HUD section /// Start GameInput section diff --git a/assets/voxygen/i18n/en.ron b/assets/voxygen/i18n/en.ron index 09cb53c1ef..5b58e3ec5e 100644 --- a/assets/voxygen/i18n/en.ron +++ b/assets/voxygen/i18n/en.ron @@ -414,6 +414,18 @@ magically infused items?"#, "hud.free_look_indicator": "Free look active. Press {key} to disable.", "hud.auto_walk_indicator": "Auto walk active", + "hud.map.difficulty": "Difficulty", + "hud.map.towns": "Towns", + "hud.map.castles": "Castles", + "hud.map.dungeons": "Dungeons", + "hud.map.town": "Town", + "hud.map.castle": "Castle", + "hud.map.dungeon": "Dungeon", + "hud.map.difficulty_dungeon": "Dungeon\n\nDifficulty: {difficulty}", + "hud.map.drag": "Drag", + "hud.map.zoom": "Zoom", + "hud.map.recenter": "Recenter", + /// End HUD section diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index bf82db204d..fe9f525e2e 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -203,10 +203,13 @@ image_ids! { map_dif_5: "voxygen.element.map.dif_5", mmap_site_town: "voxygen.element.map.town", mmap_site_town_hover: "voxygen.element.map.town_hover", + mmap_site_town_bg: "voxygen.element.map.town_bg", mmap_site_dungeon: "voxygen.element.map.dungeon", mmap_site_dungeon_hover: "voxygen.element.map.dungeon_hover", + mmap_site_dungeon_bg: "voxygen.element.map.dungeon_bg", mmap_site_castle: "voxygen.element.map.castle", mmap_site_castle_hover: "voxygen.element.map.castle_hover", + mmap_site_castle_bg: "voxygen.element.map.castle_bg", // Window Parts window_3: "voxygen.element.frames.window_3", diff --git a/voxygen/src/hud/map.rs b/voxygen/src/hud/map.rs index d3749045de..1bc2ab3615 100644 --- a/voxygen/src/hud/map.rs +++ b/voxygen/src/hud/map.rs @@ -143,6 +143,7 @@ impl<'a> Widget for Map<'a> { let show_dungeons = self.global_state.settings.gameplay.map_show_dungeons; let show_castles = self.global_state.settings.gameplay.map_show_castles; let mut events = Vec::new(); + let i18n = &self.localized_strings; // Tooltips let site_tooltip = Tooltip::new({ // Edge images [t, b, r, l] @@ -191,7 +192,7 @@ impl<'a> Widget for Map<'a> { .set(state.ids.icon, ui); // Map Title - Text::new(self.localized_strings.get("hud.map.map_title")) + Text::new(i18n.get("hud.map.map_title")) .mid_top_with_margin_on(state.ids.frame, 3.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(29)) @@ -199,7 +200,7 @@ impl<'a> Widget for Map<'a> { .set(state.ids.map_title, ui); // Questlog Title - Text::new(self.localized_strings.get("hud.map.qlog_title")) + Text::new(i18n.get("hud.map.qlog_title")) .mid_top_with_margin_on(state.ids.qlog_align, 6.0) .font_id(self.fonts.cyri.conrod_id) .font_size(self.fonts.cyri.scale(21)) @@ -343,7 +344,7 @@ impl<'a> Widget for Map<'a> { { events.push(Event::ShowDifficulties(!show_difficulty)); } - Text::new("Difficulty") + Text::new(i18n.get("hud.map.difficulty")) .right_from(state.ids.show_difficulty_box, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -377,7 +378,7 @@ impl<'a> Widget for Map<'a> { { events.push(Event::ShowTowns(!show_towns)); } - Text::new("Towns") + Text::new(i18n.get("hud.map.towns")) .right_from(state.ids.show_towns_box, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -411,7 +412,7 @@ impl<'a> Widget for Map<'a> { { events.push(Event::ShowCastles(!show_castles)); } - Text::new("Castles") + Text::new(i18n.get("hud.map.castles")) .right_from(state.ids.show_castles_box, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -445,7 +446,7 @@ impl<'a> Widget for Map<'a> { { events.push(Event::ShowDungeons(!show_dungeons)); } - Text::new("Dungeons") + Text::new(i18n.get("hud.map.dungeons")) .right_from(state.ids.show_dungeons_box, 10.0) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -484,18 +485,23 @@ impl<'a> Widget for Map<'a> { { continue; } - let title = site.name - .as_ref() - .map(|s| s.as_str()) - .unwrap_or_else(|| match &site.kind { - SiteKind::Town => "Town", - SiteKind::Dungeon { .. } => "Dungeon", - SiteKind::Castle => "Castle", - }); + let title = + site.name + .as_ref() + .map(|s| s.as_str()) + .unwrap_or_else(|| match &site.kind { + SiteKind::Town => i18n.get("hud.map.town"), + SiteKind::Dungeon { .. } => i18n.get("hud.map.dungeon"), + SiteKind::Castle => i18n.get("hud.map.castle"), + }); let (difficulty, desc) = match &site.kind { - SiteKind::Town => (0, "Town".to_string()), - SiteKind::Dungeon { difficulty } => (*difficulty, format!("Dungeon, difficulty {}", difficulty)), - SiteKind::Castle => (0, "Castle".to_string()), + SiteKind::Town => (0, i18n.get("hud.map.town").to_string()), + SiteKind::Dungeon { difficulty } => ( + *difficulty, + i18n.get("hud.map.difficulty_dungeon") + .replace("{difficulty}", difficulty.to_string().as_str()), + ), + SiteKind::Castle => (0, i18n.get("hud.map.castle").to_string()), }; let site_btn = Button::image(match &site.kind { SiteKind::Town => { @@ -538,14 +544,18 @@ impl<'a> Widget for Map<'a> { title, &desc, &site_tooltip, - match difficulty { - 1 => QUALITY_LOW, - 2 => QUALITY_COMMON, - 3 => QUALITY_MODERATE, - 4 => QUALITY_HIGH, - 5 => QUALITY_EPIC, - 6 => QUALITY_DEBUG, - _ => TEXT_COLOR, + match &site.kind { + SiteKind::Town => TEXT_COLOR, + SiteKind::Castle => TEXT_COLOR, + SiteKind::Dungeon { .. } => match difficulty { + 0 => QUALITY_LOW, + 1 => QUALITY_COMMON, + 2 => QUALITY_MODERATE, + 3 => QUALITY_HIGH, + 4 => QUALITY_EPIC, + 5 => QUALITY_DEBUG, + _ => TEXT_COLOR, + }, }, ); // Only display sites that are toggled on @@ -572,33 +582,33 @@ impl<'a> Widget for Map<'a> { if show_difficulty { let size = 1.8; // Size factor for difficulty indicators let dif_img = Image::new(match difficulty { - 1 => self.imgs.map_dif_0, - 2 => self.imgs.map_dif_1, - 3 => self.imgs.map_dif_2, - 4 => self.imgs.map_dif_3, - 5 => self.imgs.map_dif_4, - 6 => self.imgs.map_dif_5, + 0 => self.imgs.map_dif_0, + 1 => self.imgs.map_dif_1, + 2 => self.imgs.map_dif_2, + 3 => self.imgs.map_dif_3, + 4 => self.imgs.map_dif_4, + 5 => self.imgs.map_dif_5, _ => self.imgs.nothing, }) .mid_top_with_margin_on(state.ids.mmap_site_icons[i], match difficulty { - 6 => -12.0 * size, + 5 => -12.0 * size, _ => -4.0 * size, }) .w(match difficulty { - 6 => 12.0 * size, + 5 => 12.0 * size, _ => 4.0 * size * difficulty as f64, }) .h(match difficulty { - 6 => 12.0 * size, + 5 => 12.0 * size, _ => 4.0 * size, }) .color(Some(match difficulty { - 1 => QUALITY_LOW, - 2 => QUALITY_COMMON, - 3 => QUALITY_MODERATE, - 4 => QUALITY_HIGH, - 5 => QUALITY_EPIC, - 6 => TEXT_COLOR, + 0 => QUALITY_LOW, + 1 => QUALITY_COMMON, + 2 => QUALITY_MODERATE, + 3 => QUALITY_HIGH, + 4 => QUALITY_EPIC, + 5 => QUALITY_DEBUG, _ => TEXT_COLOR, })); match &site.kind { @@ -672,7 +682,7 @@ impl<'a> Widget for Map<'a> { } else { self.imgs.button }) - .label("Recenter") + .label(i18n.get("hud.map.recenter")) .label_y(conrod_core::position::Relative::Scalar(1.0)) .label_color(if recenter { TEXT_COLOR @@ -697,7 +707,7 @@ impl<'a> Widget for Map<'a> { .w_h(icon_size.x, icon_size.y) .color(Some(UI_HIGHLIGHT_0)) .set(state.ids.drag_ico, ui); - Text::new("Drag") + Text::new(i18n.get("hud.map.drag")) .right_from(state.ids.drag_ico, tweak!(5.0)) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) @@ -709,7 +719,7 @@ impl<'a> Widget for Map<'a> { .w_h(icon_size.x, icon_size.y) .color(Some(UI_HIGHLIGHT_0)) .set(state.ids.zoom_ico, ui); - Text::new("Zoom") + Text::new(i18n.get("hud.map.zoom")) .right_from(state.ids.zoom_ico, tweak!(5.0)) .font_size(self.fonts.cyri.scale(14)) .font_id(self.fonts.cyri.conrod_id) diff --git a/voxygen/src/hud/minimap.rs b/voxygen/src/hud/minimap.rs index 804efc933d..98dec7dc4f 100644 --- a/voxygen/src/hud/minimap.rs +++ b/voxygen/src/hud/minimap.rs @@ -1,7 +1,7 @@ use super::{ img_ids::{Imgs, ImgsRot}, - Show, TEXT_COLOR, UI_HIGHLIGHT_0, UI_MAIN, -}; + Show, TEXT_COLOR, UI_HIGHLIGHT_0, UI_MAIN, QUALITY_COMMON, QUALITY_DEBUG, QUALITY_EPIC, QUALITY_HIGH, QUALITY_LOW, QUALITY_MODERATE, + }; use crate::ui::{fonts::Fonts, img_ids}; use client::{self, Client}; use common::{comp, msg::world_msg::SiteKind, terrain::TerrainChunkSize, vol::RectVolSize}; @@ -10,7 +10,7 @@ use conrod_core::{ widget::{self, Button, Image, Rectangle, Text}, widget_ids, Color, Colorable, Positionable, Sizeable, Widget, WidgetCommon, }; -use inline_tweak::*; + use specs::WorldExt; use vek::*; @@ -29,6 +29,7 @@ widget_ids! { mmap_east, mmap_south, mmap_west, + mmap_site_icons_bgs[], mmap_site_icons[], } } @@ -233,7 +234,15 @@ impl<'a> Widget for MiniMap<'a> { .resize(self.client.sites().len(), &mut ui.widget_id_generator()) }); } - for (i, site) in self.client.sites().iter().enumerate() { + if state.ids.mmap_site_icons_bgs.len() < self.client.sites().len() { + state.update(|state| { + state + .ids + .mmap_site_icons_bgs + .resize(self.client.sites().len(), &mut ui.widget_id_generator()) + }); + } + for (i, site) in self.client.sites().iter().enumerate() { let rwpos = site.wpos.map(|e| e as f32) - player_pos; let rcpos = rwpos.map2(TerrainChunkSize::RECT_SIZE, |e, sz| e / sz as f32) * state.zoom as f32 @@ -251,19 +260,42 @@ impl<'a> Widget for MiniMap<'a> { } Image::new(match &site.kind { - SiteKind::Town => self.imgs.mmap_site_town, - SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon, - SiteKind::Castle => self.imgs.mmap_site_castle, + SiteKind::Town => self.imgs.mmap_site_town_bg, + SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon_bg, + SiteKind::Castle => self.imgs.mmap_site_castle_bg, }) .x_y_position_relative_to( state.ids.grid, position::Relative::Scalar(rpos.x as f64), position::Relative::Scalar(rpos.y as f64), ) - .w_h(20.0 * tweak!(1.0), 20.0 * tweak!(1.0)) - .color(Some(UI_HIGHLIGHT_0)) + .w_h(20.0, 20.0) + .color(Some( + match &site.kind { + SiteKind::Town => Color::Rgba(1.0, 1.0, 1.0, 0.0), + SiteKind::Castle => Color::Rgba(1.0, 1.0, 1.0, 0.0), + SiteKind::Dungeon { difficulty } => match difficulty { + 0 => QUALITY_LOW, + 1 => QUALITY_COMMON, + 2 => QUALITY_MODERATE, + 3 => QUALITY_HIGH, + 4 => QUALITY_EPIC, + 5 => QUALITY_DEBUG, + _ => Color::Rgba(1.0, 1.0, 1.0, 0.0), + }, + },)) .floating(true) .parent(ui.window) + .set(state.ids.mmap_site_icons_bgs[i], ui); + Image::new(match &site.kind { + SiteKind::Town => self.imgs.mmap_site_town, + SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon, + SiteKind::Castle => self.imgs.mmap_site_castle, + }) + .middle_of(state.ids.mmap_site_icons_bgs[i]) + .w_h(20.0, 20.0) + .color(Some(UI_HIGHLIGHT_0)) + .floating(true) .set(state.ids.mmap_site_icons[i], ui); } @@ -331,26 +363,25 @@ impl<'a> Widget for MiniMap<'a> { // TODO: Subregion name display // Title - - match self.client.current_chunk() { - Some(chunk) => - { - // Count characters in the name to avoid clipping with the name display - let name_len = chunk.meta().name().chars().count(); - Text::new(chunk.meta().name()) - .mid_top_with_margin_on(state.ids.mmap_frame, match name_len { - 16..=30 => 4.0, - _ => 2.0, - }) - .font_size(self.fonts.cyri.scale( - match name_len { + + match self.client.current_chunk() { + Some(chunk) => { + // Count characters in the name to avoid clipping with the name display + let name_len = chunk.meta().name().chars().count(); + Text::new(chunk.meta().name()) + .mid_top_with_margin_on(state.ids.mmap_frame, match name_len { + 16..=30 => 4.0, + _ => 2.0, + }) + .font_size(self.fonts.cyri.scale(match name_len { 0..=16 => 18, 16..=30 => 14, _ => 14, })) - .font_id(self.fonts.cyri.conrod_id) - .color(TEXT_COLOR) - .set(state.ids.mmap_location, ui)}, + .font_id(self.fonts.cyri.conrod_id) + .color(TEXT_COLOR) + .set(state.ids.mmap_location, ui) + }, None => Text::new(" ") .mid_top_with_margin_on(state.ids.mmap_frame, 0.0) .font_size(self.fonts.cyri.scale(18)) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 32fea5beae..718dca3a8a 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -49,8 +49,6 @@ use crate::{ i18n::{i18n_asset_key, LanguageMetadata, Localization}, render::{Consts, Globals, RenderMode, Renderer}, scene::camera::{self, Camera}, - - ui::{fonts::Fonts, img_ids::Rotations, slot, Graphic, Ingameable, ScaleMode, Ui}, window::{Event as WinEvent, FullScreenSettings, GameInput}, GlobalState, @@ -67,9 +65,9 @@ use common::{ span, sync::Uid, terrain::TerrainChunk, + util::srgba_to_linear, vol::RectRasterableVol, }; -use common::util::srgba_to_linear; use conrod_core::{ text::cursor::Index, widget::{self, Button, Image, Text}, @@ -455,7 +453,7 @@ pub struct Show { want_grab: bool, stats: bool, free_look: bool, - auto_walk: bool, + auto_walk: bool, } impl Show { fn bag(&mut self, open: bool) { @@ -717,7 +715,7 @@ impl Hud { ingame: true, stats: false, free_look: false, - auto_walk: false, + auto_walk: false, }, to_focus: None, //never_show: false, @@ -2250,7 +2248,7 @@ impl Hud { } // Map if self.show.map { - for event in Map::new( + for event in Map::new( client, &self.imgs, &self.rot_imgs, @@ -2289,13 +2287,12 @@ impl Hud { }, } } - } - else { + } else { // Reset the map position when it's not showing - let drag = &global_state.settings.gameplay.map_drag; + let drag = &global_state.settings.gameplay.map_drag; if drag.x != 0.0 || drag.y != 0.0 { events.push(Event::MapDrag(drag - drag)) - } + } } if self.show.esc_menu {