new loading screen bgs (part 1)

Add a basic random feature to char creation

loading screen bg (part 2)

loading screen changes, random button graphics
Random appearance also pick a random npc name
This commit is contained in:
Monty Marz 2020-09-18 23:17:47 +00:00
parent 6f2161c740
commit 5fe79e1c6a
57 changed files with 449 additions and 214 deletions

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("Assassin"),
stats: (
protection: Normal(0.0),
protection: Normal(1.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("Bonerattler"),
stats: (
protection: Normal(0.0),
protection: Normal(3.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("ClothBlue0"),
stats: (
protection: Normal(0.0),
protection: Normal(1.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("ClothGreen0"),
stats: (
protection: Normal(0.0),
protection: Normal(1.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("ClothPurple0"),
stats: (
protection: Normal(0.0),
protection: Normal(1.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("Cultist"),
stats: (
protection: Normal(0.0),
protection: Normal(6.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("Druid"),
stats: (
protection: Normal(0.0),
protection: Normal(2.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("Leather0"),
stats: (
protection: Normal(0.0),
protection: Normal(1.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("Leather2"),
stats: (
protection: Normal(0.0),
protection: Normal(1.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("Plate0"),
stats: (
protection: Normal(0.0),
protection: Normal(3.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("Steel0"),
stats: (
protection: Normal(0.0),
protection: Normal(4.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("Tarasque"),
stats: (
protection: Normal(0.0),
protection: Normal(3.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("Twig"),
stats: (
protection: Normal(0.0),
protection: Normal(2.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("Twigsflowers"),
stats: (
protection: Normal(0.0),
protection: Normal(2.0),
),
)
),

View File

@ -5,7 +5,7 @@ ItemDef(
(
kind: Belt("Twigsleaves"),
stats: (
protection: Normal(0.0),
protection: Normal(2.0),
),
)
),

BIN
assets/voxygen/background/bg_1.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_10.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_11.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_13.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_15.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_16.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_2.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_3.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_4.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_5.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_6.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_7.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_9.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/bg_main.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/death.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/background/hurt.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/element/frames/loading_screen/loading_bg.png (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/voxygen/element/icons/dice.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/dice_hover.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/dice_press.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/misc_bg/settings_bg.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/misc_bg/settings_frame.png (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

View File

@ -71,6 +71,14 @@ VoxygenLocalization(
"common.decline": "Ablehnen",
"common.you": "Ihr",
"common.automatic": "Auto",
"common.rand_appearance": "Zufälliges Aussehen und Name",
// Settings Window title
"common.interface_settings": "Interface Einstellungen",
"common.gameplay_settings": "Spiel Einstellungen",
"common.controls_settings": "Steuerung",
"common.video_settings": "Grafik Einstellungen",
"common.sound_settings": "Audio Einstellungen",
"common.language_settings": "Sprache",
/// End Common section
// Message when connection to the server is lost
@ -97,6 +105,7 @@ VoxygenLocalization(
"main.creating_world": "Erschaffe Welt ",
"main.tip": "Tipp:",
"hud.settings.loading_tips": "Ladebildschirm-Tipps",
"hud.settings.ambiance": "Umgebungs Beleuchtung",
/// Start Main screen section
@ -141,6 +150,8 @@ https://account.veloren.net.
"main.login.invalid_character": "Ungültiger Charakter",
"main.login.client_crashed": "Client abgestürzt",
"main.login.not_on_whitelist": "Ihr braucht einen Whitelist Eintrag durch den Server Admin",
"main.login.banned": "Ihr wurdet aus folgendem Grund gebannt",
"main.login.kicked": "Ihr wurdet aus folgendem Grund gekickt",
/// End Main screen section
@ -160,11 +171,24 @@ https://account.veloren.net.
// Chat outputs
"hud.chat.online_msg": "[{name}] ist jetzt online.",
"hud.chat.offline_msg": "[{name}] ist jetzt offline.",
"hud.chat.offline_msg": "{name} ist jetzt offline.",
"hud.chat.loot_msg": "Ihr erhaltet [{item}]",
"hud.chat.loot_fail": "Euer Inventar ist voll!",
"hud.chat.goodbye": "Verbindung getrennt.",
"hud.chat.connection_lost": "Verbindung unterbrochen. Trenne Verbindung in {time} Sekunden.",
"hud.chat.default_death_msg": "[{name}] ist gestorben",
"hud.chat.environmental_kill_msg": "[{name}] starb durch {environment}",
"hud.chat.fall_kill_msg": "[{name}] starb durch Fallschaden",
"hud.chat.suicide_msg": "[{name}] hat sich selbst getötet",
"hud.chat.pvp_melee_kill_msg": "[{attacker}] hat [{victim}] besiegt",
"hud.chat.pvp_ranged_kill_msg": "[{attacker}] hat [{victim}] aus der Ferne getötet",
"hud.chat.pvp_explosion_kill_msg": "[{attacker}] hat [{victim}] hochgejagt",
"hud.chat.npc_melee_kill_msg": "{attacker} tötete [{victim}]",
"hud.chat.npc_ranged_kill_msg": "{attacker} tötete [{victim}]",
"hud.chat.npc_explosion_kill_msg": "{attacker} hat [{victim}] hochgejagt",
// SCT outputs
"hud.sct.experience": "{amount} Erf",
@ -303,7 +327,10 @@ magischen Gegenstände ergattern?"#,
"hud.settings.resolution": "Auflösung",
"hud.settings.bit_depth": "Bittiefe",
"hud.settings.refresh_rate": "Bildwiederholrate",
"hud.settings.fullscreen": "Vollbild",
"hud.settings.fullscreen": "Vollbild",
"hud.settings.fullscreen_mode": "Vollbild-Modus",
"hud.settings.fullscreen_mode.exclusive": "Exklusiv",
"hud.settings.fullscreen_mode.borderless": "Rahmenlos",
"hud.settings.lighting_rendering_mode": "Beleuchtung",
"hud.settings.lighting_rendering_mode.ashikhmin": "Typ A",
"hud.settings.lighting_rendering_mode.blinnphong": "Typ B",
@ -314,6 +341,7 @@ magischen Gegenstände ergattern?"#,
"hud.settings.shadow_rendering_mode.map": "Voll",
"hud.settings.lod_detail": "LoD Detail",
"hud.settings.save_window_size": "Größe speichern",
"hud.settings.shadow_rendering_mode.map.resolution": "Auflösung",
"hud.settings.music_volume": "Musiklautstärke",
"hud.settings.sound_effect_volume": "Geräuschlautstärke",

View File

@ -56,6 +56,7 @@ VoxygenLocalization(
"common.controls": "Controls",
"common.video": "Graphics",
"common.sound": "Sound",
"common.languages": "Languages",
"common.resume": "Resume",
"common.characters": "Characters",
"common.close": "Close",
@ -73,6 +74,14 @@ VoxygenLocalization(
"common.fatal_error": "Fatal Error",
"common.you": "You",
"common.automatic": "Auto",
"common.random": "Random",
// Settings Window title
"common.interface_settings": "Interface Settings",
"common.gameplay_settings": "Gameplay Settings",
"common.controls_settings": "Controls Settings",
"common.video_settings": "Graphics Settings",
"common.sound_settings": "Sound Settings",
"common.language_settings": "Language Settings",
// Message when connection to the server is lost
"common.connection_lost": r#"Connection lost!
@ -92,6 +101,7 @@ Is the client up to date?"#,
"common.weapons.staff": "Staff",
"common.weapons.bow": "Bow",
"common.weapons.hammer": "Hammer",
"common.rand_appearance": "Random appearance and name",
/// End Common section
@ -161,15 +171,15 @@ https://account.veloren.net."#,
"hud.press_key_to_toggle_debug_info_fmt": "Press {key} to toggle debug info",
// Chat outputs
"hud.chat.online_msg": "[{name}] came online",
"hud.chat.offline_msg": "[{name}] went offline",
"hud.chat.online_msg": "[{name}] is online now",
"hud.chat.offline_msg": "{name} went offline",
"hud.chat.default_death_msg": "[{name}] died",
"hud.chat.environmental_kill_msg": "[{name}] died in {environment}",
"hud.chat.fall_kill_msg": "[{name}] died from fall damage",
"hud.chat.suicide_msg": "[{name}] died from self-inflicted wounds",
"hud.chat.pvp_melee_kill_msg": "[{attacker}] killed [{victim}]",
"hud.chat.pvp_melee_kill_msg": "[{attacker}] defeated [{victim}]",
"hud.chat.pvp_ranged_kill_msg": "[{attacker}] shot [{victim}]",
"hud.chat.pvp_explosion_kill_msg": "[{attacker}] blew up [{victim}]",
@ -262,7 +272,7 @@ magically infused items?"#,
"hud.map.map_title": "Map",
"hud.map.qlog_title": "Quests",
// Settings
// Settings
"hud.settings.general": "General",
"hud.settings.none": "None",
"hud.settings.press_behavior.toggle": "Toggle",
@ -309,6 +319,7 @@ magically infused items?"#,
"hud.settings.maximum_fps": "Maximum FPS",
"hud.settings.fov": "Field of View (deg)",
"hud.settings.gamma": "Gamma",
"hud.settings.ambiance": "Ambiance Brightness",
"hud.settings.antialiasing_mode": "AntiAliasing Mode",
"hud.settings.cloud_rendering_mode": "Cloud Rendering Mode",
"hud.settings.fluid_rendering_mode": "Fluid Rendering Mode",
@ -514,7 +525,7 @@ Protection
"Veloren is still in Pre-Alpha. We do our best to improve it every day!",
"If you want to join the Dev-Team or just have a chat with us join our Discord-Server.",
"You can toggle showing your amount of health on the healthbar in the settings.",
"In order to see your stats click the 'Stats' button in your inventory.",
"In order to see your stats click the 'Stats' button in the inventory.",
],
"npc.speech.villager_under_attack": [
"Help, I'm under attack!",

View File

@ -17,6 +17,7 @@ uniform u_globals {
uvec4 medium;
ivec4 select_pos;
vec4 gamma;
float ambiance;
// 0 - FirstPerson
// 1 - ThirdPerson
uint cam_mode;

View File

@ -3,6 +3,7 @@
#include <cloud.glsl>
#include <srgb.glsl>
#include <shadows.glsl>
#include <globals.glsl>
// Information about an approximately directional light, like the sun or moon.
struct DirectionalLight {
@ -307,8 +308,7 @@ float get_sun_diffuse2(DirectionalLight sun_info, DirectionalLight moon_info, ve
// float ambient_sides = 0.5 - 0.5 * min(abs(dot(-norm, sun_dir)), abs(dot(-norm, moon_dir)));
// float ambient_sides = clamp(mix(0.5, 0.0, abs(dot(-norm, sun_dir)) * mix(0.0, 1.0, abs(sun_dir.z) * 10000.0) * 10000.0), 0.0, 0.5);
// float ambient_sides = clamp(mix(0.5, 0.0, abs(dot(-norm, sun_dir)) * mix(0.0, 1.0, abs(sun_dir.z) * 10000.0) * 10000.0), 0.0, 0.5);
emitted_light = light_frac + k_a * PERSISTENT_AMBIANCE * MU_SCATTER;
emitted_light = light_frac + k_a * PERSISTENT_AMBIANCE * ambiance * 0.1 * MU_SCATTER;
// emitted_light = k_a * light_frac * (/*ambient_sides + */SUN_AMBIANCE * /*sun_light*/sun_chroma + /*vec3(moon_light)*/MOON_AMBIANCE * moon_chroma) + PERSISTENT_AMBIANCE;
reflected_light = R_t_r * (

View File

@ -1370,10 +1370,11 @@ impl Client {
ServerMsg::ExitIngameCleanup => {
self.clean_state();
},
ServerMsg::InventoryUpdate(inventory, event) => {
ServerMsg::InventoryUpdate(mut inventory, event) => {
match event {
InventoryUpdateEvent::CollectFailed => {},
_ => {
inventory.recount_items();
// Push the updated inventory component to the client
self.state.write_component(self.entity, inventory);
},

View File

@ -127,7 +127,7 @@ impl Inventory {
match self.slots.get_mut(cell) {
Some(slot) => {
let old = core::mem::replace(slot, Some(item));
if old.is_some() {
if old.is_none() {
self.recount_items();
}
Ok(old)

View File

@ -206,8 +206,8 @@ image_ids! {
window_3: "voxygen.element.frames.window_3",
esc_frame: "voxygen.element.frames.esc_menu",
// Settings
settings_frame_r: "voxygen.element.frames.settings_r",
settings_frame_l: "voxygen.element.frames.settings_l",
settings_bg: "voxygen.element.misc_bg.settings_bg",
settings_frame: "voxygen.element.misc_bg.settings_frame",
// Close-Button
close_btn: "voxygen.element.buttons.close_btn",

View File

@ -74,7 +74,6 @@ const TEXT_GRAY_COLOR: Color = Color::Rgba(0.5, 0.5, 0.5, 1.0);
const TEXT_DULL_RED_COLOR: Color = Color::Rgba(0.56, 0.2, 0.2, 1.0);
const TEXT_BG: Color = Color::Rgba(0.0, 0.0, 0.0, 1.0);
const TEXT_COLOR_GREY: Color = Color::Rgba(1.0, 1.0, 1.0, 0.5);
const MENU_BG: Color = Color::Rgba(0.0, 0.0, 0.0, 0.4);
//const TEXT_COLOR_2: Color = Color::Rgba(0.0, 0.0, 0.0, 1.0);
const TEXT_COLOR_3: Color = Color::Rgba(1.0, 1.0, 1.0, 0.1);
const TEXT_BIND_CONFLICT_COLOR: Color = Color::Rgba(1.0, 0.0, 0.0, 1.0);
@ -122,6 +121,8 @@ const DEFAULT_NPC: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0);
const UI_MAIN: Color = Color::Rgba(0.61, 0.70, 0.70, 1.0); // Greenish Blue
//const UI_MAIN: Color = Color::Rgba(0.1, 0.1, 0.1, 0.97); // Dark
const UI_HIGHLIGHT_0: Color = Color::Rgba(0.79, 1.09, 1.09, 1.0);
// Pull-Down menu BG color
const MENU_BG: Color = Color::Rgba(0.1, 0.12, 0.12, 1.0);
//const UI_DARK_0: Color = Color::Rgba(0.25, 0.37, 0.37, 1.0);
/// Distance at which nametags are visible for group members
@ -283,6 +284,7 @@ pub enum Event {
ChangeMaxFPS(u32),
ChangeFOV(u16),
ChangeGamma(f32),
ChangeAmbiance(f32),
MapZoom(f64),
AdjustWindowSize([u16; 2]),
ChangeFullscreenMode(FullScreenSettings),
@ -564,6 +566,7 @@ pub struct Hud {
tab_complete: Option<String>,
pulse: f32,
velocity: f32,
fps: f32,
voxygen_i18n: std::sync::Arc<VoxygenLocalization>,
slot_manager: slots::SlotManager,
hotbar: hotbar::State,
@ -659,6 +662,7 @@ impl Hud {
force_chat_cursor: None,
tab_complete: None,
pulse: 0.0,
fps: 0.0,
velocity: 0.0,
voxygen_i18n,
slot_manager,
@ -690,7 +694,10 @@ impl Hud {
let (ref mut ui_widgets, ref mut tooltip_manager) = self.ui.set_widgets();
// pulse time for pulsating elements
self.pulse = self.pulse + dt.as_secs_f32();
// FPS
// TODO Get actual FPS from session.rs instead of TPS from the client as they
// may be different in the future
self.fps = 1.0 / client.state().get_delta_time();
let version = format!(
"{}-{}",
env!("CARGO_PKG_VERSION"),
@ -1865,6 +1872,7 @@ impl Hud {
&self.imgs,
&self.fonts,
&self.voxygen_i18n,
self.fps,
)
.set(self.ids.settings_window, ui_widgets)
{
@ -1968,6 +1976,9 @@ impl Hud {
settings_window::Event::AdjustGamma(new_gamma) => {
events.push(Event::ChangeGamma(new_gamma));
},
settings_window::Event::AdjustAmbiance(new_ambiance) => {
events.push(Event::ChangeAmbiance(new_ambiance));
},
settings_window::Event::ChangeRenderMode(new_render_mode) => {
events.push(Event::ChangeRenderMode(new_render_mode));
},

View File

@ -1,6 +1,7 @@
use super::{
img_ids::Imgs, BarNumbers, CrosshairType, PressBehavior, ShortcutNumbers, Show, XpBar,
ERROR_COLOR, MENU_BG, TEXT_BIND_CONFLICT_COLOR, TEXT_COLOR,
CRITICAL_HP_COLOR, ERROR_COLOR, HP_COLOR, LOW_HP_COLOR, MANA_COLOR, MENU_BG,
TEXT_BIND_CONFLICT_COLOR, TEXT_COLOR, UI_HIGHLIGHT_0, UI_MAIN,
};
use crate::{
i18n::{list_localizations, LanguageMetadata, VoxygenLocalization},
@ -18,6 +19,7 @@ use conrod_core::{
};
use core::convert::TryFrom;
use inline_tweak::*;
use itertools::Itertools;
use std::iter::once;
use winit::monitor::VideoMode;
@ -26,6 +28,9 @@ const FPS_CHOICES: [u32; 11] = [15, 30, 40, 50, 60, 90, 120, 144, 240, 300, 500]
widget_ids! {
struct Ids {
frame,
tabs_align,
icon,
settings_content,
settings_content_r,
settings_icon,
@ -53,6 +58,7 @@ widget_ids! {
gameplay,
controls,
languages,
language_list[],
languages_list,
rectangle,
general_txt,
@ -92,6 +98,8 @@ widget_ids! {
sound,
test,
video,
language,
fps_counter,
vd_slider,
vd_text,
vd_value,
@ -113,6 +121,9 @@ widget_ids! {
gamma_slider,
gamma_text,
gamma_value,
ambiance_slider,
ambiance_text,
ambiance_value,
aa_mode_text,
aa_mode_list,
cloud_mode_text,
@ -204,6 +215,7 @@ pub enum SettingsTab {
Sound,
Gameplay,
Controls,
Lang,
}
#[derive(WidgetCommon)]
@ -213,6 +225,7 @@ pub struct SettingsWindow<'a> {
imgs: &'a Imgs,
fonts: &'a ConrodVoxygenFonts,
localized_strings: &'a std::sync::Arc<VoxygenLocalization>,
fps: f32,
#[conrod(common_builder)]
common: widget::CommonBuilder,
}
@ -224,6 +237,7 @@ impl<'a> SettingsWindow<'a> {
imgs: &'a Imgs,
fonts: &'a ConrodVoxygenFonts,
localized_strings: &'a std::sync::Arc<VoxygenLocalization>,
fps: f32,
) -> Self {
Self {
global_state,
@ -231,6 +245,7 @@ impl<'a> SettingsWindow<'a> {
imgs,
fonts,
localized_strings,
fps,
common: widget::CommonBuilder::default(),
}
}
@ -260,6 +275,7 @@ pub enum Event {
AdjustFOV(u16),
AdjustLodDetail(u32),
AdjustGamma(f32),
AdjustAmbiance(f32),
AdjustWindowSize([u16; 2]),
ChangeFullscreenMode(FullScreenSettings),
ToggleParticlesEnabled(bool),
@ -311,77 +327,88 @@ impl<'a> Widget for SettingsWindow<'a> {
let mut events = Vec::new();
let bar_values = self.global_state.settings.gameplay.bar_numbers;
let tab_font_scale = 18;
//let mut xp_bar = self.global_state.settings.gameplay.xp_bar;
// Frame Alignment
Rectangle::fill_with([824.0, 488.0], color::TRANSPARENT)
.middle_of(ui.window)
.set(state.ids.settings_bg, ui);
// Frame
Image::new(self.imgs.settings_frame_l)
.top_left_with_margins_on(state.ids.settings_bg, 0.0, 0.0)
.w_h(412.0, 488.0)
.set(state.ids.settings_l, ui);
Image::new(self.imgs.settings_frame_r)
.right_from(state.ids.settings_l, 0.0)
.parent(state.ids.settings_bg)
.w_h(412.0, 488.0)
.set(state.ids.settings_r, ui);
Image::new(self.imgs.settings_bg)
.w_h(1052.0, 886.0)
.mid_top_with_margin_on(ui.window, 5.0)
.color(Some(UI_MAIN))
.set(state.ids.settings_bg, ui);
Image::new(self.imgs.settings_frame)
.w_h(1052.0, 886.0)
.middle_of(state.ids.settings_bg)
.color(Some(UI_HIGHLIGHT_0))
.set(state.ids.frame, ui);
// Content Alignment
Rectangle::fill_with([198.0 * 4.0, 97.0 * 4.0], color::TRANSPARENT)
.top_right_with_margins_on(state.ids.settings_r, 21.0 * 4.0, 4.0 * 4.0)
Rectangle::fill_with([814.0, 834.0], color::TRANSPARENT)
.top_right_with_margins_on(state.ids.frame, 46.0, 2.0)
.scroll_kids()
.scroll_kids_vertically()
.set(state.ids.settings_content, ui);
Rectangle::fill_with([198.0 * 4.0 * 0.5, 97.0 * 4.0], color::TRANSPARENT)
Rectangle::fill_with([814.0 / 2.0, 834.0], color::TRANSPARENT)
.top_right_with_margins_on(state.ids.settings_content, 0.0, 0.0)
.parent(state.ids.settings_content)
.set(state.ids.settings_content_r, ui);
Scrollbar::y_axis(state.ids.settings_content)
.thickness(5.0)
.rgba(0.33, 0.33, 0.33, 1.0)
.set(state.ids.settings_scrollbar, ui);
// Tabs Content Alignment
Rectangle::fill_with([232.0, 814.0], color::TRANSPARENT)
.top_left_with_margins_on(state.ids.frame, 44.0, 2.0)
.scroll_kids()
.scroll_kids_vertically()
.set(state.ids.tabs_align, ui);
// Icon
Image::new(self.imgs.settings)
.w_h(29.0 * 1.5, 25.0 * 1.5)
.top_left_with_margins_on(state.ids.frame, 2.0, 1.0)
.set(state.ids.icon, ui);
// Title
Text::new(match self.show.settings_tab {
SettingsTab::Interface => self.localized_strings.get("common.interface_settings"),
SettingsTab::Gameplay => self.localized_strings.get("common.gameplay_settings"),
SettingsTab::Controls => self.localized_strings.get("common.controls_settings"),
SettingsTab::Video => self.localized_strings.get("common.video_settings"),
SettingsTab::Sound => self.localized_strings.get("common.sound_settings"),
SettingsTab::Lang => self.localized_strings.get("common.language_settings"),
})
.mid_top_with_margin_on(state.ids.frame, 3.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(29))
.color(TEXT_COLOR)
.set(state.ids.settings_title, ui);
// X-Button
if Button::image(self.imgs.close_button)
.w_h(28.0, 28.0)
.hover_image(self.imgs.close_button_hover)
.press_image(self.imgs.close_button_press)
.top_right_with_margins_on(state.ids.settings_r, 0.0, 0.0)
.w_h(24.0, 25.0)
.hover_image(self.imgs.close_btn_hover)
.press_image(self.imgs.close_btn_press)
.top_right_with_margins_on(state.ids.frame, 0.0, 0.0)
.set(state.ids.settings_close, ui)
.was_clicked()
{
events.push(Event::Close);
}
// Title
Text::new(&self.localized_strings.get("common.settings"))
.mid_top_with_margin_on(state.ids.settings_bg, 5.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.settings_title, ui);
// 1) Interface Tab -------------------------------
if Button::image(if let SettingsTab::Interface = self.show.settings_tab {
self.imgs.settings_button_pressed
self.imgs.selection
} else {
self.imgs.settings_button
self.imgs.nothing
})
.w_h(31.0 * 4.0, 12.0 * 4.0)
.hover_image(if let SettingsTab::Interface = self.show.settings_tab {
self.imgs.settings_button_pressed
} else {
self.imgs.settings_button_hover
})
.press_image(if let SettingsTab::Interface = self.show.settings_tab {
self.imgs.settings_button_pressed
} else {
self.imgs.settings_button_press
})
.top_left_with_margins_on(state.ids.settings_l, 8.0 * 4.0, 2.0 * 4.0)
.w_h(230.0, 48.0)
.hover_image(self.imgs.selection_hover)
.press_image(self.imgs.selection_press)
.mid_top_with_margin_on(state.ids.tabs_align, 28.0)
.label(&self.localized_strings.get("common.interface"))
.label_font_size(self.fonts.cyri.scale(14))
.label_font_size(self.fonts.cyri.scale(tab_font_scale))
.label_font_id(self.fonts.cyri.conrod_id)
.label_color(TEXT_COLOR)
.set(state.ids.interface, ui)
@ -1219,61 +1246,21 @@ impl<'a> Widget for SettingsWindow<'a> {
.set(state.ids.chat_char_name_text, ui);
// TODO Show account name in chat
// TODO Show account names in social window
// Language select drop down
Text::new(&self.localized_strings.get("common.languages"))
.down_from(state.ids.chat_char_name_button, 20.0)
.font_size(self.fonts.cyri.scale(18))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.language_text, ui);
let selected_language = &self.global_state.settings.language.selected_language;
let language_list = list_localizations();
let language_list_str: Vec<String> = language_list
.iter()
.map(|e| e.language_name.clone())
.collect();
let selected = language_list
.iter()
.position(|x| x.language_identifier.contains(selected_language));
if let Some(clicked) = DropDownList::new(&language_list_str, selected)
.down_from(state.ids.language_text, 8.0)
.w_h(200.0, 22.0)
.color(MENU_BG)
.label_color(TEXT_COLOR)
.label_font_id(self.fonts.cyri.conrod_id)
.set(state.ids.languages_list, ui)
{
events.push(Event::ChangeLanguage(Box::new(
language_list[clicked].to_owned(),
)));
}
}
// 2) Gameplay Tab --------------------------------
if Button::image(if let SettingsTab::Gameplay = self.show.settings_tab {
self.imgs.settings_button_pressed
self.imgs.selection
} else {
self.imgs.settings_button
self.imgs.nothing
})
.w_h(31.0 * 4.0, 12.0 * 4.0)
.hover_image(if let SettingsTab::Gameplay = self.show.settings_tab {
self.imgs.settings_button_pressed
} else {
self.imgs.settings_button_hover
})
.press_image(if let SettingsTab::Gameplay = self.show.settings_tab {
self.imgs.settings_button_pressed
} else {
self.imgs.settings_button_press
})
.right_from(state.ids.interface, 0.0)
.w_h(230.0, 48.0)
.hover_image(self.imgs.selection_hover)
.press_image(self.imgs.selection_press)
.down_from(state.ids.interface, 0.0)
.parent(state.ids.tabs_align)
.label(&self.localized_strings.get("common.gameplay"))
.label_font_size(self.fonts.cyri.scale(14))
.label_font_size(self.fonts.cyri.scale(tab_font_scale))
.label_font_id(self.fonts.cyri.conrod_id)
.label_color(TEXT_COLOR)
.set(state.ids.gameplay, ui)
@ -1546,24 +1533,17 @@ impl<'a> Widget for SettingsWindow<'a> {
// 3) Controls Tab --------------------------------
if Button::image(if let SettingsTab::Controls = self.show.settings_tab {
self.imgs.settings_button_pressed
self.imgs.selection
} else {
self.imgs.settings_button
self.imgs.nothing
})
.w_h(31.0 * 4.0, 12.0 * 4.0)
.hover_image(if let SettingsTab::Controls = self.show.settings_tab {
self.imgs.settings_button_pressed
} else {
self.imgs.settings_button_hover
})
.press_image(if let SettingsTab::Controls = self.show.settings_tab {
self.imgs.settings_button_pressed
} else {
self.imgs.settings_button_press
})
.right_from(state.ids.gameplay, 0.0)
.w_h(230.0, 48.0)
.hover_image(self.imgs.selection_hover)
.press_image(self.imgs.selection_press)
.down_from(state.ids.gameplay, 0.0)
.parent(state.ids.tabs_align)
.label(&self.localized_strings.get("common.controls"))
.label_font_size(self.fonts.cyri.scale(14))
.label_font_size(self.fonts.cyri.scale(tab_font_scale))
.label_font_id(self.fonts.cyri.conrod_id)
.label_color(TEXT_COLOR)
.set(state.ids.controls, ui)
@ -1685,25 +1665,17 @@ impl<'a> Widget for SettingsWindow<'a> {
// 4) Video Tab -----------------------------------
if Button::image(if let SettingsTab::Video = self.show.settings_tab {
self.imgs.settings_button_pressed
self.imgs.selection
} else {
self.imgs.settings_button
self.imgs.nothing
})
.w_h(31.0 * 4.0, 12.0 * 4.0)
.hover_image(if let SettingsTab::Video = self.show.settings_tab {
self.imgs.settings_button_pressed
} else {
self.imgs.settings_button_hover
})
.press_image(if let SettingsTab::Video = self.show.settings_tab {
self.imgs.settings_button_pressed
} else {
self.imgs.settings_button_press
})
.right_from(state.ids.controls, 0.0)
.w_h(230.0, 48.0)
.hover_image(self.imgs.selection_hover)
.press_image(self.imgs.selection_press)
.down_from(state.ids.controls, 0.0)
.parent(state.ids.tabs_align)
.label(&self.localized_strings.get("common.video"))
.parent(state.ids.settings_r)
.label_font_size(self.fonts.cyri.scale(14))
.label_font_size(self.fonts.cyri.scale(tab_font_scale))
.label_font_id(self.fonts.cyri.conrod_id)
.label_color(TEXT_COLOR)
.set(state.ids.video, ui)
@ -1714,6 +1686,20 @@ impl<'a> Widget for SettingsWindow<'a> {
// Contents
if let SettingsTab::Video = self.show.settings_tab {
// FPS/TPS Counter
//let text_col = match
let fps_col = match self.fps as i32 {
0..=14 => CRITICAL_HP_COLOR,
15..=29 => LOW_HP_COLOR,
30..=50 => HP_COLOR,
_ => MANA_COLOR,
};
Text::new(&format!("FPS: {:.0}", self.fps))
.color(fps_col)
.top_right_with_margins_on(state.ids.settings_content_r, 10.0, 10.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(18))
.set(state.ids.fps_counter, ui);
// View Distance
Text::new(&self.localized_strings.get("hud.settings.view_distance"))
.top_left_with_margins_on(state.ids.settings_content, 10.0, 10.0)
@ -1882,12 +1868,52 @@ impl<'a> Widget for SettingsWindow<'a> {
events.push(Event::AdjustGamma(2.0f32.powf(new_val as f32 / 8.0)));
}
Text::new(&format!("{}", self.global_state.settings.graphics.gamma))
Text::new(&format!("{:.2}", self.global_state.settings.graphics.gamma))
.right_from(state.ids.gamma_slider, 8.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.gamma_value, ui);
//Ambiance Brightness
// 320.0 = maximum brightness in shaders
let min_ambiance = 10.0;
let max_ambiance = 80.0;
if let Some(new_val) = ImageSlider::discrete(
self.global_state.settings.graphics.ambiance.round() as i32,
min_ambiance as i32,
max_ambiance as i32,
self.imgs.slider_indicator,
self.imgs.slider,
)
.w_h(104.0, 22.0)
.right_from(state.ids.gamma_slider, 50.0)
.track_breadth(12.0)
.slider_length(10.0)
.pad_track((5.0, 5.0))
.set(state.ids.ambiance_slider, ui)
{
events.push(Event::AdjustAmbiance(new_val as f32));
}
Text::new(&self.localized_strings.get("hud.settings.ambiance"))
.up_from(state.ids.ambiance_slider, 8.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.ambiance_text, ui);
Text::new(&format!(
"{:.0}%",
((self.global_state.settings.graphics.ambiance - min_ambiance)
/ (max_ambiance - min_ambiance)
* 100.0)
.round()
))
.right_from(state.ids.ambiance_slider, 8.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.ambiance_value, ui);
// Sprites VD
if let Some(new_val) = ImageSlider::discrete(
self.global_state.settings.graphics.sprite_render_distance,
@ -2485,15 +2511,16 @@ impl<'a> Widget for SettingsWindow<'a> {
}
// Save current screen size
if Button::image(self.imgs.settings_button)
if Button::image(self.imgs.button)
.w_h(31.0 * 5.0, 12.0 * 2.0)
.hover_image(self.imgs.settings_button_hover)
.press_image(self.imgs.settings_button_press)
.hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press)
.down_from(state.ids.fullscreen_mode_list, 12.0)
.label(&self.localized_strings.get("hud.settings.save_window_size"))
.label_font_size(self.fonts.cyri.scale(14))
.label_color(TEXT_COLOR)
.label_font_id(self.fonts.cyri.conrod_id)
.label_y(Relative::Scalar(2.0))
.set(state.ids.save_window_size_button, ui)
.was_clicked()
{
@ -2509,25 +2536,17 @@ impl<'a> Widget for SettingsWindow<'a> {
// 5) Sound Tab -----------------------------------
if Button::image(if let SettingsTab::Sound = self.show.settings_tab {
self.imgs.settings_button_pressed
self.imgs.selection
} else {
self.imgs.settings_button
self.imgs.nothing
})
.w_h(31.0 * 4.0, 12.0 * 4.0)
.hover_image(if let SettingsTab::Sound = self.show.settings_tab {
self.imgs.settings_button_pressed
} else {
self.imgs.settings_button_hover
})
.press_image(if let SettingsTab::Sound = self.show.settings_tab {
self.imgs.settings_button_pressed
} else {
self.imgs.settings_button_press
})
.right_from(state.ids.video, 0.0)
.parent(state.ids.settings_r)
.w_h(230.0, 48.0)
.hover_image(self.imgs.selection_hover)
.press_image(self.imgs.selection_press)
.down_from(state.ids.video, 0.0)
.parent(state.ids.tabs_align)
.label(&self.localized_strings.get("common.sound"))
.label_font_size(self.fonts.cyri.scale(14))
.label_font_size(self.fonts.cyri.scale(tab_font_scale))
.label_font_id(self.fonts.cyri.conrod_id)
.label_color(TEXT_COLOR)
.set(state.ids.sound, ui)
@ -2618,6 +2637,70 @@ impl<'a> Widget for SettingsWindow<'a> {
}
}
// 5) Languages Tab -----------------------------------
if Button::image(if let SettingsTab::Lang = self.show.settings_tab {
self.imgs.selection
} else {
self.imgs.nothing
})
.w_h(230.0, 48.0)
.hover_image(self.imgs.selection_hover)
.press_image(self.imgs.selection_press)
.down_from(state.ids.sound, 0.0)
.parent(state.ids.tabs_align)
.label(&self.localized_strings.get("common.languages"))
.label_font_size(self.fonts.cyri.scale(tab_font_scale))
.label_font_id(self.fonts.cyri.conrod_id)
.label_color(TEXT_COLOR)
.set(state.ids.language, ui)
.was_clicked()
{
events.push(Event::ChangeTab(SettingsTab::Lang));
}
// Contents
if let SettingsTab::Lang = self.show.settings_tab {
// List available languages
let selected_language = &self.global_state.settings.language.selected_language;
let language_list = list_localizations();
if state.ids.language_list.len() < language_list.len() {
state.update(|state| {
state
.ids
.language_list
.resize(language_list.len(), &mut ui.widget_id_generator())
});
};
for (i, language) in language_list.iter().enumerate() {
let button_w = tweak!(400.0);
let button_h = tweak!(50.0);
let button = Button::image(if selected_language == &language.language_identifier {
self.imgs.selection
} else {
self.imgs.nothing
});
let button = if i == 0 {
button.mid_top_with_margin_on(state.ids.settings_content, 20.0)
} else {
button.mid_bottom_with_margin_on(state.ids.language_list[i - 1], -button_h)
};
if button
.label(&language.language_name)
.w_h(button_w, button_h)
.hover_image(self.imgs.selection_hover)
.press_image(self.imgs.selection_press)
.label_color(TEXT_COLOR)
.label_font_size(self.fonts.cyri.scale(tweak!(22)))
.label_font_id(self.fonts.cyri.conrod_id)
.label_y(conrod_core::position::Relative::Scalar(2.0))
.set(state.ids.language_list[i], ui)
.was_clicked()
{
events.push(Event::ChangeLanguage(Box::new(language.to_owned())));
}
}
};
events
}
}

View File

@ -130,6 +130,7 @@ impl PlayState for CharSelectionState {
thread_pool: client.thread_pool(),
body: humanoid_body,
gamma: global_state.settings.graphics.gamma,
ambiance: global_state.settings.graphics.ambiance,
mouse_smoothing: global_state.settings.gameplay.smooth_pan_enable,
figure_lod_render_distance: global_state
.settings

View File

@ -14,7 +14,7 @@ use common::{
assets::Asset,
character::{Character, CharacterId, CharacterItem, MAX_CHARACTERS_PER_PLAYER},
comp::{self, humanoid},
LoadoutBuilder,
npc, LoadoutBuilder,
};
use conrod_core::{
color,
@ -25,6 +25,8 @@ use conrod_core::{
widget::{text_box::Event as TextBoxEvent, Button, Image, Rectangle, Scrollbar, Text, TextBox},
widget_ids, Borderable, Color, Colorable, Labelable, Positionable, Sizeable, UiCell, Widget,
};
//use inline_tweak::*;
use rand::{thread_rng, Rng};
use std::sync::Arc;
const STARTER_HAMMER: &str = "common.items.weapons.hammer.starter_hammer";
@ -33,6 +35,7 @@ const STARTER_AXE: &str = "common.items.weapons.axe.starter_axe";
const STARTER_STAFF: &str = "common.items.weapons.staff.starter_staff";
const STARTER_SWORD: &str = "common.items.weapons.sword.starter_sword";
const STARTER_DAGGER: &str = "common.items.weapons.dagger.starter_dagger";
//const STARTER_SCEPTRE: &str = "common.items.weapons.dagger.starter_dagger";
// UI Color-Theme
const UI_MAIN: Color = Color::Rgba(0.61, 0.70, 0.70, 1.0); // Greenish Blue
@ -151,6 +154,7 @@ widget_ids! {
species_6,
body_type_1,
body_type_2,
random_button,
// Tools
sword,
@ -209,6 +213,11 @@ image_ids! {
bow: "voxygen.element.icons.bow",
staff: "voxygen.element.icons.staff",
// Dice icons
dice: "voxygen.element.icons.dice",
dice_hover: "voxygen.element.icons.dice_hover",
dice_press: "voxygen.element.icons.dice_press",
// Species Icons
human_m: "voxygen.element.icons.human_m",
human_f: "voxygen.element.icons.human_f",
@ -858,6 +867,7 @@ impl CharSelectionUi {
loadout: _,
tool,
} => {
let mut rng = thread_rng();
let mut to_select = false;
// Back Button
if Button::image(self.imgs.button)
@ -1359,6 +1369,31 @@ impl CharSelectionUi {
{
*tool = Some(STARTER_AXE);
}
// Random button
if Button::image(self.imgs.dice)
.wh([35.0; 2])
.bottom_left_with_margins_on(self.ids.name_input, 15.0, -45.0)
.hover_image(self.imgs.dice_hover)
.press_image(self.imgs.dice_press)
.with_tooltip(
tooltip_manager,
&self.voxygen_i18n.get("common.rand_appearance"),
"",
&tooltip_human,
)
.set(self.ids.random_button, ui_widgets)
.was_clicked()
{
body.hair_style =
rng.gen_range(0, body.species.num_hair_styles(body.body_type));
body.beard = rng.gen_range(0, body.species.num_beards(body.body_type));
body.accessory = rng.gen_range(0, body.species.num_accessories(body.body_type));
body.hair_color = rng.gen_range(0, body.species.num_hair_colors());
body.skin = rng.gen_range(0, body.species.num_skin_colors());
body.eye_color = rng.gen_range(0, body.species.num_eye_colors());
body.eyes = rng.gen_range(0, body.species.num_eyes(body.body_type));
*name = npc::get_npc_name(npc::NpcKind::Humanoid).to_string();
}
// Sliders
let (cyri, cyri_size, slider_indicator, slider_range) = (
self.fonts.cyri.conrod_id,

View File

@ -18,6 +18,7 @@ use conrod_core::{
widget_ids, Borderable, Color, Colorable, Labelable, Positionable, Sizeable, Widget,
};
use image::DynamicImage;
//use inline_tweak::*;
use rand::{seq::SliceRandom, thread_rng, Rng};
use std::time::Duration;
@ -83,6 +84,10 @@ widget_ids! {
// Loading Screen Tips
tip_txt_bg,
tip_txt,
// Loading Screen Artwork
mid,
left,
right,
}
}
@ -103,6 +108,9 @@ image_ids! {
button_press: "voxygen.element.buttons.button_press",
input_bg: "voxygen.element.misc_bg.textbox_mid",
//disclaimer: "voxygen.element.frames.disclaimer",
loading_art: "voxygen.element.frames.loading_screen.loading_bg",
loading_art_l: "voxygen.element.frames.loading_screen.loading_bg_l",
loading_art_r: "voxygen.element.frames.loading_screen.loading_bg_r",
// Animation
f1: "voxygen.element.animation.gears.1",
f2: "voxygen.element.animation.gears.2",
@ -188,11 +196,11 @@ impl<'a> MainMenuUi {
"voxygen.background.bg_7",
"voxygen.background.bg_8",
"voxygen.background.bg_9",
"voxygen.background.bg_10",
//"voxygen.background.bg_10",
"voxygen.background.bg_11",
"voxygen.background.bg_12",
//"voxygen.background.bg_12",
"voxygen.background.bg_13",
"voxygen.background.bg_14",
//"voxygen.background.bg_14",
"voxygen.background.bg_15",
"voxygen.background.bg_16",
];
@ -301,6 +309,21 @@ impl<'a> MainMenuUi {
.set(self.ids.bg, ui_widgets);
if self.connect {
// Artwork
Image::new(self.imgs.loading_art)
.h(100.0)
.w_of(self.ids.bg)
.mid_bottom_of(self.ids.bg)
.set(self.ids.mid, ui_widgets);
Image::new(self.imgs.loading_art_l)
.w_h(12.0, 10.0)
.top_left_with_margins_on(self.ids.mid, 2.0, 0.0)
.set(self.ids.left, ui_widgets);
Image::new(self.imgs.loading_art_r)
.w_h(12.0, 10.0)
.top_right_with_margins_on(self.ids.mid, 2.0, 0.0)
.set(self.ids.right, ui_widgets);
// Gears Animation
self.anim_timer = (self.anim_timer + dt.as_secs_f32()) * 1.05; // Linear time function with Anim-Speed Factor
if self.anim_timer >= 4.0 {
self.anim_timer = 0.0 // Reset timer at last frame to loop
@ -313,12 +336,13 @@ impl<'a> MainMenuUi {
_ => self.imgs.f5,
})
.w_h(74.0, 62.0)
.bottom_left_with_margins_on(self.ids.bg, 10.0, 10.0)
.bottom_right_with_margins_on(self.ids.mid, 10.0, 10.0)
.set(self.ids.gears, ui_widgets);
if tip_show {
// Tips
Text::new(&tip_msg)
.color(TEXT_BG)
.mid_bottom_with_margin_on(ui_widgets.window, 80.0)
.mid_bottom_with_margin_on(self.ids.mid, 60.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(20))
.set(self.ids.tip_txt_bg, ui_widgets);

View File

@ -46,6 +46,7 @@ gfx_defines! {
medium: [u32; 4] = "medium",
select_pos: [i32; 4] = "select_pos",
gamma: [f32; 4] = "gamma",
ambiance: f32 = "ambiance",
cam_mode: u32 = "cam_mode",
sprite_render_distance: f32 = "sprite_render_distance",
}
@ -82,6 +83,7 @@ impl Globals {
medium: BlockKind,
select_pos: Option<Vec3<i32>>,
gamma: f32,
ambiance: f32,
cam_mode: CameraMode,
sprite_render_distance: f32,
) -> Self {
@ -122,6 +124,7 @@ impl Globals {
.unwrap_or(Vec4::zero())
.into_array(),
gamma: [gamma; 4],
ambiance,
cam_mode: cam_mode as u32,
sprite_render_distance,
}
@ -163,6 +166,7 @@ impl Default for Globals {
BlockKind::Air,
None,
1.0,
1.0,
CameraMode::ThirdPerson,
250.0,
)

View File

@ -109,6 +109,7 @@ pub struct SceneData<'a> {
pub tick: u64,
pub thread_pool: &'a uvth::ThreadPool,
pub gamma: f32,
pub ambiance: f32,
pub mouse_smoothing: bool,
pub sprite_render_distance: f32,
pub particles_enabled: bool,
@ -638,6 +639,7 @@ impl Scene {
.unwrap_or(BlockKind::Air),
self.select_pos.map(|e| e - focus_off.map(|e| e as i32)),
scene_data.gamma,
scene_data.ambiance,
self.camera.get_mode(),
scene_data.sprite_render_distance as f32 - 20.0,
)])

View File

@ -95,6 +95,7 @@ pub struct SceneData<'a> {
pub thread_pool: &'a uvth::ThreadPool,
pub body: Option<humanoid::Body>,
pub gamma: f32,
pub ambiance: f32,
pub figure_lod_render_distance: f32,
pub mouse_smoothing: bool,
}
@ -263,6 +264,7 @@ impl Scene {
BlockKind::Air,
None,
scene_data.gamma,
scene_data.ambiance,
self.camera.get_mode(),
250.0,
)]) {

View File

@ -958,6 +958,10 @@ impl PlayState for SessionState {
global_state.settings.graphics.gamma = new_gamma;
global_state.settings.save_to_file_warn();
},
HudEvent::ChangeAmbiance(new_ambiance) => {
global_state.settings.graphics.ambiance = new_ambiance;
global_state.settings.save_to_file_warn();
},
HudEvent::ChangeRenderMode(new_render_mode) => {
// Do this first so if it crashes the setting isn't saved :)
global_state
@ -1046,6 +1050,7 @@ impl PlayState for SessionState {
tick: client.get_tick(),
thread_pool: client.thread_pool(),
gamma: global_state.settings.graphics.gamma,
ambiance: global_state.settings.graphics.ambiance,
mouse_smoothing: global_state.settings.gameplay.smooth_pan_enable,
sprite_render_distance: global_state.settings.graphics.sprite_render_distance
as f32,
@ -1109,6 +1114,7 @@ impl PlayState for SessionState {
tick: client.get_tick(),
thread_pool: client.thread_pool(),
gamma: settings.graphics.gamma,
ambiance: settings.graphics.ambiance,
mouse_smoothing: settings.gameplay.smooth_pan_enable,
sprite_render_distance: settings.graphics.sprite_render_distance as f32,
figure_lod_render_distance: settings.graphics.figure_lod_render_distance as f32,

View File

@ -616,6 +616,7 @@ pub struct GraphicsSettings {
pub max_fps: u32,
pub fov: u16,
pub gamma: f32,
pub ambiance: f32,
pub render_mode: RenderMode,
pub window_size: [u16; 2],
pub fullscreen: FullScreenSettings,
@ -632,6 +633,7 @@ impl Default for GraphicsSettings {
max_fps: 60,
fov: 50,
gamma: 1.0,
ambiance: 20.0,
render_mode: RenderMode::default(),
window_size: [1920, 1080],
fullscreen: FullScreenSettings::default(),