mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add a dark mode to speech bubbles; consistantly use 'speech bubble' instead of 'chat bubble'
This commit is contained in:
parent
c65967ccdb
commit
3c07d02218
BIN
assets/voxygen/element/frames/bubble_dark/bottom.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/bubble_dark/bottom.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/frames/bubble_dark/bottom_left.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/bubble_dark/bottom_left.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/frames/bubble_dark/bottom_right.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/bubble_dark/bottom_right.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/frames/bubble_dark/left.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/bubble_dark/left.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/frames/bubble_dark/mid.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/bubble_dark/mid.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/frames/bubble_dark/right.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/bubble_dark/right.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/frames/bubble_dark/tail.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/bubble_dark/tail.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/frames/bubble_dark/top.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/bubble_dark/top.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/frames/bubble_dark/top_left.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/bubble_dark/top_left.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/frames/bubble_dark/top_right.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/bubble_dark/top_right.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -238,6 +238,7 @@ Enjoy your stay in the World of Veloren."#,
|
|||||||
"hud.settings.cumulated_damage": "Cumulated Damage",
|
"hud.settings.cumulated_damage": "Cumulated Damage",
|
||||||
"hud.settings.incoming_damage": "Incoming Damage",
|
"hud.settings.incoming_damage": "Incoming Damage",
|
||||||
"hud.settings.cumulated_incoming_damage": "Cumulated Incoming Damage",
|
"hud.settings.cumulated_incoming_damage": "Cumulated Incoming Damage",
|
||||||
|
"hud.settings.speech_bubble_dark_mode": "Speech Bubble Dark Mode",
|
||||||
"hud.settings.energybar_numbers": "Energybar Numbers",
|
"hud.settings.energybar_numbers": "Energybar Numbers",
|
||||||
"hud.settings.values": "Values",
|
"hud.settings.values": "Values",
|
||||||
"hud.settings.percentages": "Percentages",
|
"hud.settings.percentages": "Percentages",
|
||||||
|
@ -86,7 +86,7 @@ impl Default for Activity {
|
|||||||
fn default() -> Self { Activity::Idle(Vec2::zero()) }
|
fn default() -> Self { Activity::Idle(Vec2::zero()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Default duration in seconds of chat bubbles
|
/// Default duration in seconds of speech bubbles
|
||||||
pub const SPEECH_BUBBLE_DURATION: f64 = 5.0;
|
pub const SPEECH_BUBBLE_DURATION: f64 = 5.0;
|
||||||
|
|
||||||
/// Adds a speech bubble to the entity
|
/// Adds a speech bubble to the entity
|
||||||
|
@ -272,17 +272,28 @@ image_ids! {
|
|||||||
progress_frame: "voxygen.element.frames.progress_bar",
|
progress_frame: "voxygen.element.frames.progress_bar",
|
||||||
progress: "voxygen.element.misc_bg.progress",
|
progress: "voxygen.element.misc_bg.progress",
|
||||||
|
|
||||||
// Chat bubbles
|
// Speech bubbles
|
||||||
chat_bubble_top_left: "voxygen.element.frames.bubble.top_left",
|
speech_bubble_top_left: "voxygen.element.frames.bubble.top_left",
|
||||||
chat_bubble_top: "voxygen.element.frames.bubble.top",
|
speech_bubble_top: "voxygen.element.frames.bubble.top",
|
||||||
chat_bubble_top_right: "voxygen.element.frames.bubble.top_right",
|
speech_bubble_top_right: "voxygen.element.frames.bubble.top_right",
|
||||||
chat_bubble_left: "voxygen.element.frames.bubble.left",
|
speech_bubble_left: "voxygen.element.frames.bubble.left",
|
||||||
chat_bubble_mid: "voxygen.element.frames.bubble.mid",
|
speech_bubble_mid: "voxygen.element.frames.bubble.mid",
|
||||||
chat_bubble_right: "voxygen.element.frames.bubble.right",
|
speech_bubble_right: "voxygen.element.frames.bubble.right",
|
||||||
chat_bubble_bottom_left: "voxygen.element.frames.bubble.bottom_left",
|
speech_bubble_bottom_left: "voxygen.element.frames.bubble.bottom_left",
|
||||||
chat_bubble_bottom: "voxygen.element.frames.bubble.bottom",
|
speech_bubble_bottom: "voxygen.element.frames.bubble.bottom",
|
||||||
chat_bubble_bottom_right: "voxygen.element.frames.bubble.bottom_right",
|
speech_bubble_bottom_right: "voxygen.element.frames.bubble.bottom_right",
|
||||||
chat_bubble_tail: "voxygen.element.frames.bubble.tail",
|
speech_bubble_tail: "voxygen.element.frames.bubble.tail",
|
||||||
|
|
||||||
|
dark_bubble_top_left: "voxygen.element.frames.bubble_dark.top_left",
|
||||||
|
dark_bubble_top: "voxygen.element.frames.bubble_dark.top",
|
||||||
|
dark_bubble_top_right: "voxygen.element.frames.bubble_dark.top_right",
|
||||||
|
dark_bubble_left: "voxygen.element.frames.bubble_dark.left",
|
||||||
|
dark_bubble_mid: "voxygen.element.frames.bubble_dark.mid",
|
||||||
|
dark_bubble_right: "voxygen.element.frames.bubble_dark.right",
|
||||||
|
dark_bubble_bottom_left: "voxygen.element.frames.bubble_dark.bottom_left",
|
||||||
|
dark_bubble_bottom: "voxygen.element.frames.bubble_dark.bottom",
|
||||||
|
dark_bubble_bottom_right: "voxygen.element.frames.bubble_dark.bottom_right",
|
||||||
|
dark_bubble_tail: "voxygen.element.frames.bubble_dark.tail",
|
||||||
|
|
||||||
<BlankGraphic>
|
<BlankGraphic>
|
||||||
nothing: (),
|
nothing: (),
|
||||||
|
@ -235,6 +235,7 @@ pub enum Event {
|
|||||||
Sct(bool),
|
Sct(bool),
|
||||||
SctPlayerBatch(bool),
|
SctPlayerBatch(bool),
|
||||||
SctDamageBatch(bool),
|
SctDamageBatch(bool),
|
||||||
|
SpeechBubbleDarkMode(bool),
|
||||||
ToggleDebug(bool),
|
ToggleDebug(bool),
|
||||||
UiScale(ScaleChange),
|
UiScale(ScaleChange),
|
||||||
CharacterSelection,
|
CharacterSelection,
|
||||||
@ -944,13 +945,14 @@ impl Hud {
|
|||||||
);
|
);
|
||||||
let ingame_pos = pos + Vec3::unit_z() * height_offset;
|
let ingame_pos = pos + Vec3::unit_z() * height_offset;
|
||||||
|
|
||||||
// Chat bubble, name, level, and hp bars
|
// Speech bubble, name, level, and hp bars
|
||||||
overhead::Overhead::new(
|
overhead::Overhead::new(
|
||||||
&name,
|
&name,
|
||||||
bubble,
|
bubble,
|
||||||
stats,
|
stats,
|
||||||
energy,
|
energy,
|
||||||
own_level,
|
own_level,
|
||||||
|
&global_state.settings.gameplay,
|
||||||
self.pulse,
|
self.pulse,
|
||||||
&self.imgs,
|
&self.imgs,
|
||||||
&self.fonts,
|
&self.fonts,
|
||||||
@ -1626,6 +1628,9 @@ impl Hud {
|
|||||||
.set(self.ids.settings_window, ui_widgets)
|
.set(self.ids.settings_window, ui_widgets)
|
||||||
{
|
{
|
||||||
match event {
|
match event {
|
||||||
|
settings_window::Event::SpeechBubbleDarkMode(sbdm) => {
|
||||||
|
events.push(Event::SpeechBubbleDarkMode(sbdm));
|
||||||
|
},
|
||||||
settings_window::Event::Sct(sct) => {
|
settings_window::Event::Sct(sct) => {
|
||||||
events.push(Event::Sct(sct));
|
events.push(Event::Sct(sct));
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
use super::{img_ids::Imgs, HP_COLOR, LOW_HP_COLOR, MANA_COLOR};
|
use super::{img_ids::Imgs, HP_COLOR, LOW_HP_COLOR, MANA_COLOR};
|
||||||
use crate::ui::{fonts::ConrodVoxygenFonts, Ingameable};
|
use crate::{
|
||||||
|
settings::GameplaySettings,
|
||||||
|
ui::{fonts::ConrodVoxygenFonts, Ingameable},
|
||||||
|
};
|
||||||
use common::comp::{Energy, SpeechBubble, Stats};
|
use common::comp::{Energy, SpeechBubble, Stats};
|
||||||
use conrod_core::{
|
use conrod_core::{
|
||||||
position::Align,
|
position::Align,
|
||||||
@ -9,19 +12,19 @@ use conrod_core::{
|
|||||||
|
|
||||||
widget_ids! {
|
widget_ids! {
|
||||||
struct Ids {
|
struct Ids {
|
||||||
// Chat bubble
|
// Speech bubble
|
||||||
chat_bubble_text,
|
speech_bubble_text,
|
||||||
chat_bubble_text2,
|
speech_bubble_text2,
|
||||||
chat_bubble_top_left,
|
speech_bubble_top_left,
|
||||||
chat_bubble_top,
|
speech_bubble_top,
|
||||||
chat_bubble_top_right,
|
speech_bubble_top_right,
|
||||||
chat_bubble_left,
|
speech_bubble_left,
|
||||||
chat_bubble_mid,
|
speech_bubble_mid,
|
||||||
chat_bubble_right,
|
speech_bubble_right,
|
||||||
chat_bubble_bottom_left,
|
speech_bubble_bottom_left,
|
||||||
chat_bubble_bottom,
|
speech_bubble_bottom,
|
||||||
chat_bubble_bottom_right,
|
speech_bubble_bottom_right,
|
||||||
chat_bubble_tail,
|
speech_bubble_tail,
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
name_bg,
|
name_bg,
|
||||||
@ -46,6 +49,7 @@ pub struct Overhead<'a> {
|
|||||||
stats: &'a Stats,
|
stats: &'a Stats,
|
||||||
energy: &'a Energy,
|
energy: &'a Energy,
|
||||||
own_level: u32,
|
own_level: u32,
|
||||||
|
settings: &'a GameplaySettings,
|
||||||
pulse: f32,
|
pulse: f32,
|
||||||
imgs: &'a Imgs,
|
imgs: &'a Imgs,
|
||||||
fonts: &'a ConrodVoxygenFonts,
|
fonts: &'a ConrodVoxygenFonts,
|
||||||
@ -60,6 +64,7 @@ impl<'a> Overhead<'a> {
|
|||||||
stats: &'a Stats,
|
stats: &'a Stats,
|
||||||
energy: &'a Energy,
|
energy: &'a Energy,
|
||||||
own_level: u32,
|
own_level: u32,
|
||||||
|
settings: &'a GameplaySettings,
|
||||||
pulse: f32,
|
pulse: f32,
|
||||||
imgs: &'a Imgs,
|
imgs: &'a Imgs,
|
||||||
fonts: &'a ConrodVoxygenFonts,
|
fonts: &'a ConrodVoxygenFonts,
|
||||||
@ -70,6 +75,7 @@ impl<'a> Overhead<'a> {
|
|||||||
stats,
|
stats,
|
||||||
energy,
|
energy,
|
||||||
own_level,
|
own_level,
|
||||||
|
settings,
|
||||||
pulse,
|
pulse,
|
||||||
imgs,
|
imgs,
|
||||||
fonts,
|
fonts,
|
||||||
@ -130,77 +136,122 @@ impl<'a> Widget for Overhead<'a> {
|
|||||||
.x_y(0.0, MANA_BAR_Y + 50.0)
|
.x_y(0.0, MANA_BAR_Y + 50.0)
|
||||||
.set(state.ids.name, ui);
|
.set(state.ids.name, ui);
|
||||||
|
|
||||||
|
// Speech bubble
|
||||||
if let Some(bubble) = self.bubble {
|
if let Some(bubble) = self.bubble {
|
||||||
// Speech bubble
|
let dark_mode = self.settings.speech_bubble_dark_mode;
|
||||||
let mut text = Text::new(&bubble.message)
|
let mut text = Text::new(&bubble.message)
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
.font_size(18)
|
.font_size(18)
|
||||||
.color(Color::Rgba(0.0, 0.0, 0.0, 1.0))
|
|
||||||
.up_from(state.ids.name, 10.0)
|
.up_from(state.ids.name, 10.0)
|
||||||
.x_align_to(state.ids.name, Align::Middle)
|
.x_align_to(state.ids.name, Align::Middle)
|
||||||
.parent(id);
|
.parent(id);
|
||||||
|
text = if dark_mode {
|
||||||
|
text.color(Color::Rgba(1.0, 1.0, 1.0, 1.0))
|
||||||
|
} else {
|
||||||
|
text.color(Color::Rgba(0.0, 0.0, 0.0, 1.0))
|
||||||
|
};
|
||||||
if let Some(w) = text.get_w(ui) {
|
if let Some(w) = text.get_w(ui) {
|
||||||
if w > 250.0 {
|
if w > 250.0 {
|
||||||
text = text.w(250.0);
|
text = text.w(250.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Image::new(self.imgs.chat_bubble_top_left)
|
Image::new(if dark_mode {
|
||||||
.w_h(10.0, 10.0)
|
self.imgs.dark_bubble_top_left
|
||||||
.top_left_with_margin_on(state.ids.chat_bubble_text, -10.0)
|
} else {
|
||||||
.parent(id)
|
self.imgs.speech_bubble_top_left
|
||||||
.set(state.ids.chat_bubble_top_left, ui);
|
})
|
||||||
Image::new(self.imgs.chat_bubble_top)
|
.w_h(10.0, 10.0)
|
||||||
.h(10.0)
|
.top_left_with_margin_on(state.ids.speech_bubble_text, -10.0)
|
||||||
.w_of(state.ids.chat_bubble_text)
|
.parent(id)
|
||||||
.mid_top_with_margin_on(state.ids.chat_bubble_text, -10.0)
|
.set(state.ids.speech_bubble_top_left, ui);
|
||||||
.parent(id)
|
Image::new(if dark_mode {
|
||||||
.set(state.ids.chat_bubble_top, ui);
|
self.imgs.dark_bubble_top
|
||||||
Image::new(self.imgs.chat_bubble_top_right)
|
} else {
|
||||||
.w_h(10.0, 10.0)
|
self.imgs.speech_bubble_top
|
||||||
.top_right_with_margin_on(state.ids.chat_bubble_text, -10.0)
|
})
|
||||||
.parent(id)
|
.h(10.0)
|
||||||
.set(state.ids.chat_bubble_top_right, ui);
|
.w_of(state.ids.speech_bubble_text)
|
||||||
Image::new(self.imgs.chat_bubble_left)
|
.mid_top_with_margin_on(state.ids.speech_bubble_text, -10.0)
|
||||||
.w(10.0)
|
.parent(id)
|
||||||
.h_of(state.ids.chat_bubble_text)
|
.set(state.ids.speech_bubble_top, ui);
|
||||||
.mid_left_with_margin_on(state.ids.chat_bubble_text, -10.0)
|
Image::new(if dark_mode {
|
||||||
.parent(id)
|
self.imgs.dark_bubble_top_right
|
||||||
.set(state.ids.chat_bubble_left, ui);
|
} else {
|
||||||
Image::new(self.imgs.chat_bubble_mid)
|
self.imgs.speech_bubble_top_right
|
||||||
.wh_of(state.ids.chat_bubble_text)
|
})
|
||||||
.top_left_of(state.ids.chat_bubble_text)
|
.w_h(10.0, 10.0)
|
||||||
.parent(id)
|
.top_right_with_margin_on(state.ids.speech_bubble_text, -10.0)
|
||||||
.set(state.ids.chat_bubble_mid, ui);
|
.parent(id)
|
||||||
Image::new(self.imgs.chat_bubble_right)
|
.set(state.ids.speech_bubble_top_right, ui);
|
||||||
.w(10.0)
|
Image::new(if dark_mode {
|
||||||
.h_of(state.ids.chat_bubble_text)
|
self.imgs.dark_bubble_left
|
||||||
.mid_right_with_margin_on(state.ids.chat_bubble_text, -10.0)
|
} else {
|
||||||
.parent(id)
|
self.imgs.speech_bubble_left
|
||||||
.set(state.ids.chat_bubble_right, ui);
|
})
|
||||||
Image::new(self.imgs.chat_bubble_bottom_left)
|
.w(10.0)
|
||||||
.w_h(10.0, 10.0)
|
.h_of(state.ids.speech_bubble_text)
|
||||||
.bottom_left_with_margin_on(state.ids.chat_bubble_text, -10.0)
|
.mid_left_with_margin_on(state.ids.speech_bubble_text, -10.0)
|
||||||
.parent(id)
|
.parent(id)
|
||||||
.set(state.ids.chat_bubble_bottom_left, ui);
|
.set(state.ids.speech_bubble_left, ui);
|
||||||
Image::new(self.imgs.chat_bubble_bottom)
|
Image::new(if dark_mode {
|
||||||
.h(10.0)
|
self.imgs.dark_bubble_mid
|
||||||
.w_of(state.ids.chat_bubble_text)
|
} else {
|
||||||
.mid_bottom_with_margin_on(state.ids.chat_bubble_text, -10.0)
|
self.imgs.speech_bubble_mid
|
||||||
.parent(id)
|
})
|
||||||
.set(state.ids.chat_bubble_bottom, ui);
|
.wh_of(state.ids.speech_bubble_text)
|
||||||
Image::new(self.imgs.chat_bubble_bottom_right)
|
.top_left_of(state.ids.speech_bubble_text)
|
||||||
.w_h(10.0, 10.0)
|
.parent(id)
|
||||||
.bottom_right_with_margin_on(state.ids.chat_bubble_text, -10.0)
|
.set(state.ids.speech_bubble_mid, ui);
|
||||||
.parent(id)
|
Image::new(if dark_mode {
|
||||||
.set(state.ids.chat_bubble_bottom_right, ui);
|
self.imgs.dark_bubble_right
|
||||||
let tail = Image::new(self.imgs.chat_bubble_tail)
|
} else {
|
||||||
.w_h(11.0, 16.0)
|
self.imgs.speech_bubble_right
|
||||||
.mid_bottom_with_margin_on(state.ids.chat_bubble_text, -16.0)
|
})
|
||||||
.parent(id);
|
.w(10.0)
|
||||||
|
.h_of(state.ids.speech_bubble_text)
|
||||||
|
.mid_right_with_margin_on(state.ids.speech_bubble_text, -10.0)
|
||||||
|
.parent(id)
|
||||||
|
.set(state.ids.speech_bubble_right, ui);
|
||||||
|
Image::new(if dark_mode {
|
||||||
|
self.imgs.dark_bubble_bottom_left
|
||||||
|
} else {
|
||||||
|
self.imgs.speech_bubble_bottom_left
|
||||||
|
})
|
||||||
|
.w_h(10.0, 10.0)
|
||||||
|
.bottom_left_with_margin_on(state.ids.speech_bubble_text, -10.0)
|
||||||
|
.parent(id)
|
||||||
|
.set(state.ids.speech_bubble_bottom_left, ui);
|
||||||
|
Image::new(if dark_mode {
|
||||||
|
self.imgs.dark_bubble_bottom
|
||||||
|
} else {
|
||||||
|
self.imgs.speech_bubble_bottom
|
||||||
|
})
|
||||||
|
.h(10.0)
|
||||||
|
.w_of(state.ids.speech_bubble_text)
|
||||||
|
.mid_bottom_with_margin_on(state.ids.speech_bubble_text, -10.0)
|
||||||
|
.parent(id)
|
||||||
|
.set(state.ids.speech_bubble_bottom, ui);
|
||||||
|
Image::new(if dark_mode {
|
||||||
|
self.imgs.dark_bubble_bottom_right
|
||||||
|
} else {
|
||||||
|
self.imgs.speech_bubble_bottom_right
|
||||||
|
})
|
||||||
|
.w_h(10.0, 10.0)
|
||||||
|
.bottom_right_with_margin_on(state.ids.speech_bubble_text, -10.0)
|
||||||
|
.parent(id)
|
||||||
|
.set(state.ids.speech_bubble_bottom_right, ui);
|
||||||
|
let tail = Image::new(if dark_mode {
|
||||||
|
self.imgs.dark_bubble_tail
|
||||||
|
} else {
|
||||||
|
self.imgs.speech_bubble_tail
|
||||||
|
})
|
||||||
|
.w_h(11.0, 16.0)
|
||||||
|
.mid_bottom_with_margin_on(state.ids.speech_bubble_text, -16.0)
|
||||||
|
.parent(id);
|
||||||
// Move text to front (conrod depth is lowest first; not a z-index)
|
// Move text to front (conrod depth is lowest first; not a z-index)
|
||||||
tail.set(state.ids.chat_bubble_tail, ui);
|
tail.set(state.ids.speech_bubble_tail, ui);
|
||||||
text.depth(tail.get_depth() - 1.0)
|
text.depth(tail.get_depth() - 1.0)
|
||||||
.set(state.ids.chat_bubble_text, ui);
|
.set(state.ids.speech_bubble_text, ui);
|
||||||
}
|
}
|
||||||
|
|
||||||
let hp_percentage =
|
let hp_percentage =
|
||||||
|
@ -153,6 +153,8 @@ widget_ids! {
|
|||||||
sct_num_dur_text,
|
sct_num_dur_text,
|
||||||
sct_num_dur_slider,
|
sct_num_dur_slider,
|
||||||
sct_num_dur_value,
|
sct_num_dur_value,
|
||||||
|
speech_bubble_dark_mode_text,
|
||||||
|
speech_bubble_dark_mode_button,
|
||||||
free_look_behavior_text,
|
free_look_behavior_text,
|
||||||
free_look_behavior_list
|
free_look_behavior_list
|
||||||
}
|
}
|
||||||
@ -235,6 +237,7 @@ pub enum Event {
|
|||||||
Sct(bool),
|
Sct(bool),
|
||||||
SctPlayerBatch(bool),
|
SctPlayerBatch(bool),
|
||||||
SctDamageBatch(bool),
|
SctDamageBatch(bool),
|
||||||
|
SpeechBubbleDarkMode(bool),
|
||||||
ChangeLanguage(LanguageMetadata),
|
ChangeLanguage(LanguageMetadata),
|
||||||
ChangeBinding(GameInput),
|
ChangeBinding(GameInput),
|
||||||
ChangeFreeLookBehavior(PressBehavior),
|
ChangeFreeLookBehavior(PressBehavior),
|
||||||
@ -943,17 +946,45 @@ impl<'a> Widget for SettingsWindow<'a> {
|
|||||||
.set(state.ids.sct_batch_inc_text, ui);
|
.set(state.ids.sct_batch_inc_text, ui);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Speech bubble dark mode
|
||||||
|
let speech_bubble_dark_mode = ToggleButton::new(
|
||||||
|
self.global_state.settings.gameplay.speech_bubble_dark_mode,
|
||||||
|
self.imgs.checkbox,
|
||||||
|
self.imgs.checkbox_checked,
|
||||||
|
)
|
||||||
|
.down_from(
|
||||||
|
if self.global_state.settings.gameplay.sct {
|
||||||
|
state.ids.sct_batch_inc_radio
|
||||||
|
} else {
|
||||||
|
state.ids.sct_show_radio
|
||||||
|
},
|
||||||
|
20.0,
|
||||||
|
)
|
||||||
|
.x(0.0)
|
||||||
|
.w_h(18.0, 18.0)
|
||||||
|
.hover_images(self.imgs.checkbox_mo, self.imgs.checkbox_checked_mo)
|
||||||
|
.press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked)
|
||||||
|
.set(state.ids.speech_bubble_dark_mode_button, ui);
|
||||||
|
if self.global_state.settings.gameplay.speech_bubble_dark_mode
|
||||||
|
!= speech_bubble_dark_mode
|
||||||
|
{
|
||||||
|
events.push(Event::SpeechBubbleDarkMode(speech_bubble_dark_mode));
|
||||||
|
}
|
||||||
|
Text::new(
|
||||||
|
&self
|
||||||
|
.localized_strings
|
||||||
|
.get("hud.settings.speech_bubble_dark_mode"),
|
||||||
|
)
|
||||||
|
.right_from(state.ids.speech_bubble_dark_mode_button, 10.0)
|
||||||
|
.font_size(self.fonts.cyri.scale(18))
|
||||||
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
|
.color(TEXT_COLOR)
|
||||||
|
.set(state.ids.speech_bubble_dark_mode_text, ui);
|
||||||
|
|
||||||
// Energybars Numbers
|
// Energybars Numbers
|
||||||
// Hotbar text
|
// Hotbar text
|
||||||
Text::new(&self.localized_strings.get("hud.settings.energybar_numbers"))
|
Text::new(&self.localized_strings.get("hud.settings.energybar_numbers"))
|
||||||
.down_from(
|
.down_from(state.ids.speech_bubble_dark_mode_button, 20.0)
|
||||||
if self.global_state.settings.gameplay.sct {
|
|
||||||
state.ids.sct_batch_inc_radio
|
|
||||||
} else {
|
|
||||||
state.ids.sct_show_radio
|
|
||||||
},
|
|
||||||
20.0,
|
|
||||||
)
|
|
||||||
.font_size(self.fonts.cyri.scale(18))
|
.font_size(self.fonts.cyri.scale(18))
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
.color(TEXT_COLOR)
|
.color(TEXT_COLOR)
|
||||||
|
@ -594,6 +594,10 @@ impl PlayState for SessionState {
|
|||||||
global_state.settings.gameplay.sct_damage_batch = sct_damage_batch;
|
global_state.settings.gameplay.sct_damage_batch = sct_damage_batch;
|
||||||
global_state.settings.save_to_file_warn();
|
global_state.settings.save_to_file_warn();
|
||||||
},
|
},
|
||||||
|
HudEvent::SpeechBubbleDarkMode(sbdm) => {
|
||||||
|
global_state.settings.gameplay.speech_bubble_dark_mode = sbdm;
|
||||||
|
global_state.settings.save_to_file_warn();
|
||||||
|
},
|
||||||
HudEvent::ToggleDebug(toggle_debug) => {
|
HudEvent::ToggleDebug(toggle_debug) => {
|
||||||
global_state.settings.gameplay.toggle_debug = toggle_debug;
|
global_state.settings.gameplay.toggle_debug = toggle_debug;
|
||||||
global_state.settings.save_to_file_warn();
|
global_state.settings.save_to_file_warn();
|
||||||
|
@ -455,6 +455,7 @@ pub struct GameplaySettings {
|
|||||||
pub sct: bool,
|
pub sct: bool,
|
||||||
pub sct_player_batch: bool,
|
pub sct_player_batch: bool,
|
||||||
pub sct_damage_batch: bool,
|
pub sct_damage_batch: bool,
|
||||||
|
pub speech_bubble_dark_mode: bool,
|
||||||
pub mouse_y_inversion: bool,
|
pub mouse_y_inversion: bool,
|
||||||
pub smooth_pan_enable: bool,
|
pub smooth_pan_enable: bool,
|
||||||
pub crosshair_transp: f32,
|
pub crosshair_transp: f32,
|
||||||
@ -480,6 +481,7 @@ impl Default for GameplaySettings {
|
|||||||
sct: true,
|
sct: true,
|
||||||
sct_player_batch: true,
|
sct_player_batch: true,
|
||||||
sct_damage_batch: false,
|
sct_damage_batch: false,
|
||||||
|
speech_bubble_dark_mode: false,
|
||||||
crosshair_transp: 0.6,
|
crosshair_transp: 0.6,
|
||||||
chat_transp: 0.4,
|
chat_transp: 0.4,
|
||||||
crosshair_type: CrosshairType::Round,
|
crosshair_type: CrosshairType::Round,
|
||||||
|
Loading…
Reference in New Issue
Block a user