Merge branch 'pfau/loading_tips' into 'master'

Loading Screen tips

See merge request veloren/veloren!1224
This commit is contained in:
Monty Marz 2020-07-23 12:10:14 +00:00
commit c903e27160
22 changed files with 177 additions and 48 deletions

View File

@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Minimap compass
- Initial crafting system implementation
- Protection stat to armor that reduces incoming damage
- Loading-Screen tips
### Changed

View File

@ -0,0 +1,12 @@
Item(
name: "Purple Cultist Cape",
description: "Smells like dark magic and candles.",
kind: Armor(
(
kind: Back(DungPurp0),
stats: (
protection: Normal(3.0),
),
)
),
)

View File

@ -62,8 +62,6 @@
(0.17, "common.items.armor.belt.cloth_blue_0"),
(0.17, "common.items.armor.belt.cloth_green_0"),
(0.17, "common.items.armor.belt.cloth_purple_0"),
(0.08, "common.items.armor.belt.cultist_belt"),
(0.08, "common.items.armor.belt.assassin"),
(0.08, "common.items.armor.belt.druid"),
(0.06, "common.items.armor.belt.leather_0"),
(0.06, "common.items.armor.belt.leather_2"),
@ -86,8 +84,6 @@
(0.025, "common.items.armor.chest.worker_red_1"),
(0.025, "common.items.armor.chest.worker_yellow_0"),
(0.025, "common.items.armor.chest.worker_yellow_1"),
(0.08, "common.items.armor.chest.cultist_chest_purple"),
(0.08, "common.items.armor.chest.assassin"),
(0.08, "common.items.armor.chest.druid"),
(0.06, "common.items.armor.chest.leather_0"),
(0.06, "common.items.armor.chest.leather_2"),
@ -100,9 +96,6 @@
(0.15, "common.items.armor.foot.cloth_blue_0"),
(0.15, "common.items.armor.foot.cloth_green_0"),
(0.15, "common.items.armor.foot.cloth_purple_0"),
(0.05, "common.items.armor.foot.jackalope_slippers"),
(0.08, "common.items.armor.foot.cultist_boots"),
(0.08, "common.items.armor.foot.assassin"),
(0.08, "common.items.armor.foot.druid"),
(0.06, "common.items.armor.foot.leather_0"),
(0.06, "common.items.armor.foot.leather_2"),
@ -116,8 +109,6 @@
(0.125, "common.items.armor.pants.cloth_green_0"),
(0.125, "common.items.armor.pants.cloth_purple_0"),
(0.125, "common.items.armor.pants.worker_blue_0"),
(0.08, "common.items.armor.pants.cultist_legs_purple"),
(0.08, "common.items.armor.pants.assassin"),
(0.08, "common.items.armor.pants.druid"),
(0.04, "common.items.armor.pants.leather_0"),
(0.04, "common.items.armor.pants.leather_2"),
@ -132,8 +123,6 @@
(0.125, "common.items.armor.shoulder.cloth_blue_1"),
(0.125, "common.items.armor.shoulder.cloth_green_0"),
(0.125, "common.items.armor.shoulder.cloth_purple_0"),
(0.06, "common.items.armor.shoulder.cultist_shoulder_purple"),
(0.06, "common.items.armor.shoulder.assassin"),
(0.06, "common.items.armor.shoulder.druidshoulder"),
(0.06, "common.items.armor.shoulder.leather_strips"),
(0.04, "common.items.armor.shoulder.leather_0"),
@ -153,8 +142,6 @@
(0.17, "common.items.armor.hand.cloth_blue_0"),
(0.17, "common.items.armor.hand.cloth_green_0"),
(0.17, "common.items.armor.hand.cloth_purple_0"),
(0.08, "common.items.armor.hand.cultist_hands_purple"),
(0.08, "common.items.armor.hand.assassin"),
(0.08, "common.items.armor.hand.druid"),
(0.06, "common.items.armor.hand.leather_0"),
(0.06, "common.items.armor.hand.leather_2"),

Binary file not shown.

Binary file not shown.

BIN
assets/voxygen/element/icons/snake.png (Stored with Git LFS)

Binary file not shown.

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

Binary file not shown.

View File

@ -408,8 +408,7 @@ magischen Gegenstände ergattern?"#,
/// End chracter selection section
/// Start character window section
"character_window.character_name": "Charakter",
// Charater stats
// Charater stats
// Character stats
"character_window.character_stats": r#"Ausdauer
Beweglichkeit
@ -428,8 +427,26 @@ Willenskraft
},
vector_map: {
"loading.tips": [
"Drückt 'G', um Eure Laterne anzuzünden.",
"Drückt 'F1', um die Standard Tastenbelegung anzuzeigen.",
"Ihr könnt /say oder /s verwenden, um den Spielern in Eurer Nähe zu schreiben.",
"Verwendet /region oder /r, um mit Spielern in Eurem Gebiet zu schreiben.",
"Mit /tell könnt ihr einem Mitspieler direkte Nachrichten schicken.",
"NPCs mit demselben Level können unterschiedlich schwierig zu besiegen sein.",
"Behaltet den Boden um euch im Blick! Dort gibt es Nahrung, Kisten und Anderes zu finden.",
"Ist Euer Inventar voll mit Nahrung? Wertet es einfach durch Crafting auf!",
"Ihr sucht nach einem Abenteuer? Dungeons sind mit braunen Markierungen auf der Karte vermerkt!",
"Vergesst nicht Eure Grafikeinstellungen anzupassen! Mit 'N' kommt ihr in die Einstellungen.",
"Zusammen kämpfen macht mehr Spaß! Drückt 'O' um Eure Mitspieler anzuzeigen.",
"Ein NPC mit einem Schädel unter seiner Lebensanzeige ist deutlich stärker als Ihr.",
"Drückt 'J' um zu tanzen. Yeah!",
"Verwendet 'L-Shift' um mit Eurem Gleiter den Himmel zu erorbern!",
"Veloren befindet sich noch in der Pre-Alpha Phase. Wir tun unser Bestes, um das Spielgefühl jeden Tag zu verbessern!",
"Ihr wünscht, Euch mit uns auszutauschen oder wollt unserem Entwickler-Team beitreten? Kommt doch einfach auf unseren Discord-Server!",
],
"npc.speech.villager_under_attack": [
"Hilfe, ich werde angegriffen!",
],
],
}
)

View File

@ -95,6 +95,7 @@ Is the client up to date?"#,
/// Start Main screen section
"main.connecting": "Connecting",
"main.creating_world": "Creating world",
"main.tip": "Tip:",
// Welcome notice that appears the first time Veloren is started
"main.notice": r#"Welcome to the alpha version of Veloren!
@ -271,6 +272,7 @@ magically infused items?"#,
"hud.settings.chat": "Chat",
"hud.settings.background_transparency": "Background Transparency",
"hud.settings.chat_character_name": "Character Names in chat",
"hud.settings.loading_tips": "Loading Screen Tips",
"hud.settings.pan_sensitivity": "Pan Sensitivity",
"hud.settings.zoom_sensitivity": "Zoom Sensitivity",
@ -408,7 +410,7 @@ magically infused items?"#,
/// Start character window section
"character_window.character_name": "Character Name",
// Charater stats
// Character stats
"character_window.character_stats": r#"Endurance
Fitness
@ -424,9 +426,29 @@ Protection
"esc_menu.logout": "Logout",
"esc_menu.quit_game": "Quit Game",
/// End Escape Menu Section
},
vector_map: {
"loading.tips": [
"Press 'G' to light your lantern.",
"Press 'F1' to see all default keybindings.",
"You can type /say or /s to only chat with players directly around you.",
"You can type /region or /r to only chat with players a couple of hundred blocks around you.",
"To send private message type /tell followed by a player name and your message.",
"NPCs with the same level can have a different difficulty.",
"Look at the ground for food, chests and other loot!",
"Inventory filled with food? Try crafting better food from it!",
"Wondering what's there to do? Dungeons are marked with brown spots on the map!",
"Don't forget to adjust the graphics for your system. Press 'N' to open the settings.",
"Playing with others is fun! Press 'O' to see who is online.",
"An NPC with a skull beneath their healthbar is quite powerful compared to yourself.",
"Press 'J' to dance. Party!",
"Press 'L-Shift' to open your Glider and conquer the skies.",
"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.",
],
"npc.speech.villager_under_attack": [
"Help, I'm under attack!",
"Help! I'm under attack!",

View File

@ -720,6 +720,10 @@
"voxel.armor.back.admin",
(0.0, 0.0, 0.0), (-90.0, 180.0, 0.0), 1.0,
),
Armor(Back(DungPurp0)): VoxTrans(
"voxel.armor.back.dung_purp-0",
(0.0, 0.0, 0.0), (-90.0, 180.0, 0.0), 1.0,
),
// Rings
Armor(Ring(Ring0)): Png(
"element.icons.ring-0",

BIN
assets/voxygen/voxel/armor/back/dung_purp-0.vox (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -12,5 +12,9 @@
vox_spec: ("armor.back.admin", (-5.0, -1.0, -11.0)),
color: None
),
DungPurp0: (
vox_spec: ("armor.back.dung_purp-0", (-5.0, -1.0, -14.0)),
color: None
),
},
))

View File

@ -306,8 +306,9 @@ pub const ALL_SHOULDERS: [Shoulder; 24] = [
pub enum Back {
Short0 = 1,
Admin = 2,
DungPurp0 = 3,
}
pub const ALL_BACKS: [Back; 2] = [Back::Short0, Back::Admin];
pub const ALL_BACKS: [Back; 3] = [Back::Short0, Back::Admin, Back::DungPurp0];
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[repr(u32)]
pub enum Ring {

View File

@ -208,7 +208,9 @@ impl<'a> System<'a> for Sys {
foot: Some(assets::load_expect_cloned(
"common.items.armor.foot.cultist_boots",
)),
back: None,
back: Some(assets::load_expect_cloned(
"common.items.armor.back.dungeon_purple_0",
)),
ring: None,
neck: None,
lantern: Some(assets::load_expect_cloned("common.items.lantern.black_0")),

View File

@ -359,7 +359,8 @@ impl Animation for AlphaAnimation {
Some(ToolKind::Staff(_)) => {
next.head.offset = Vec3::new(
0.0,
0.0 + skeleton_attr.head.0 + decel * 0.8,
0.0 + skeleton_attr.head.0, /* + decel * 0.8 */
// Had some clipping issues
skeleton_attr.head.1,
);
next.head.ori = Quaternion::rotation_z(decel * 0.25)

View File

@ -57,6 +57,9 @@ impl Animation for IdleAnimation {
next.shorts.ori = Quaternion::rotation_x(0.0);
next.shorts.scale = Vec3::one();
next.back.offset = Vec3::new(0.0, skeleton_attr.back.0, skeleton_attr.back.1);
next.back.scale = Vec3::one() * 1.02;
next.l_hand.offset = Vec3::new(
-skeleton_attr.hand.0,
skeleton_attr.hand.1 + wave_ultra_slow_cos * 0.15,

View File

@ -243,6 +243,7 @@ pub struct HudInfo {
}
pub enum Event {
ToggleTips(bool),
SendMessage(String),
AdjustMousePan(u32),
AdjustMouseZoom(u32),
@ -1716,6 +1717,9 @@ impl Hud {
},
settings_window::Event::ToggleHelp => self.show.help = !self.show.help,
settings_window::Event::ToggleDebug => self.show.debug = !self.show.debug,
settings_window::Event::ToggleTips(loading_tips) => {
events.push(Event::ToggleTips(loading_tips));
},
settings_window::Event::ChangeTab(tab) => self.show.open_setting_tab(tab),
settings_window::Event::Close => {
// Unpause the game if we are on singleplayer so that we can logout

View File

@ -51,10 +51,10 @@ widget_ids! {
languages_list,
rectangle,
general_txt,
load_tips_button,
load_tips_button_label,
debug_button,
debug_button_label,
tips_button,
tips_button_label,
interface,
language_text,
mouse_pan_slider,
@ -215,6 +215,7 @@ pub struct State {
pub enum Event {
ToggleHelp,
ToggleDebug,
ToggleTips(bool),
ToggleXpBar(XpBar),
ToggleBarNumbers(BarNumbers),
ToggleShortcutNumbers(ShortcutNumbers),
@ -399,6 +400,31 @@ impl<'a> Widget for SettingsWindow<'a> {
.color(TEXT_COLOR)
.set(state.ids.show_help_label, ui);
// Loading Screen Tips
let show_tips = ToggleButton::new(
self.global_state.settings.gameplay.loading_tips,
self.imgs.checkbox,
self.imgs.checkbox_checked,
)
.w_h(18.0, 18.0)
.down_from(state.ids.button_help, 8.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.load_tips_button, ui);
if self.global_state.settings.gameplay.loading_tips != show_tips {
events.push(Event::ToggleTips(
!self.global_state.settings.gameplay.loading_tips,
));
}
Text::new(&self.localized_strings.get("hud.settings.loading_tips"))
.right_from(state.ids.load_tips_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.load_tips_button)
.color(TEXT_COLOR)
.set(state.ids.load_tips_button_label, ui);
// Debug
let show_debug = ToggleButton::new(
self.show.debug,
@ -406,7 +432,7 @@ impl<'a> Widget for SettingsWindow<'a> {
self.imgs.checkbox_checked,
)
.w_h(18.0, 18.0)
.down_from(state.ids.button_help, 8.0)
.down_from(state.ids.load_tips_button, 8.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.debug_button, ui);

View File

@ -17,7 +17,7 @@ use conrod_core::{
widget::{text_box::Event as TextBoxEvent, Button, Image, List, Rectangle, Text, TextBox},
widget_ids, Borderable, Color, Colorable, Labelable, Positionable, Sizeable, Widget,
};
use rand::{seq::SliceRandom, thread_rng};
use rand::{seq::SliceRandom, thread_rng, Rng};
use std::time::Duration;
const COL1: Color = Color::Rgba(0.07, 0.1, 0.1, 0.9);
@ -79,6 +79,9 @@ widget_ids! {
info_bottom,
// Auth Trust Prompt
button_add_auth_trust,
// Loading Screen Tips
tip_txt_bg,
tip_txt,
}
}
@ -165,9 +168,10 @@ pub struct MainMenuUi {
bg_img_id: conrod_core::image::Id,
voxygen_i18n: std::sync::Arc<VoxygenLocalization>,
fonts: ConrodVoxygenFonts,
tip_no: u16,
}
impl MainMenuUi {
impl<'a> MainMenuUi {
pub fn new(global_state: &mut GlobalState) -> Self {
let window = &mut global_state.window;
let networking = &global_state.settings.networking;
@ -203,6 +207,7 @@ impl MainMenuUi {
let bg_img_id = ui.add_graphic(Graphic::Image(load_expect(
bg_imgs.choose(&mut rng).unwrap(),
)));
//let chosen_tip = *tips.choose(&mut rng).unwrap();
// Load language
let voxygen_i18n = load_expect::<VoxygenLocalization>(&i18n_asset_key(
&global_state.settings.language.selected_language,
@ -233,6 +238,7 @@ impl MainMenuUi {
bg_img_id,
voxygen_i18n,
fonts,
tip_no: 0,
}
}
@ -244,6 +250,13 @@ impl MainMenuUi {
self.time = self.time + dt.as_secs_f32();
let fade_msg = (self.time * 2.0).sin() * 0.5 + 0.51;
let (ref mut ui_widgets, ref mut _tooltip_manager) = self.ui.set_widgets();
let tip_msg = format!(
"{} {}",
&self.voxygen_i18n.get("main.tip"),
&self.voxygen_i18n.get_variation("loading.tips", self.tip_no),
);
let tip_show = global_state.settings.gameplay.loading_tips;
let mut rng = thread_rng();
let version = format!(
"{}-{}",
env!("CARGO_PKG_VERSION"),
@ -251,6 +264,7 @@ impl MainMenuUi {
);
const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0);
const TEXT_COLOR_2: Color = Color::Rgba(1.0, 1.0, 1.0, 0.2);
const TEXT_BG: Color = Color::Rgba(0.0, 0.0, 0.0, 1.0);
//const INACTIVE: Color = Color::Rgba(0.47, 0.47, 0.47, 0.47);
let intro_text = &self.voxygen_i18n.get("main.login_process");
@ -296,8 +310,22 @@ impl MainMenuUi {
_ => self.imgs.f5,
})
.w_h(74.0, 62.0)
.bottom_right_with_margins_on(self.ids.bg, 10.0, 10.0)
.bottom_left_with_margins_on(self.ids.bg, 10.0, 10.0)
.set(self.ids.gears, ui_widgets);
if tip_show {
Text::new(&tip_msg)
.color(TEXT_BG)
.mid_bottom_with_margin_on(ui_widgets.window, 80.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(20))
.set(self.ids.tip_txt_bg, ui_widgets);
Text::new(&tip_msg)
.color(TEXT_COLOR)
.bottom_left_with_margins_on(self.ids.tip_txt_bg, 2.0, 2.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(20))
.set(self.ids.tip_txt, ui_widgets);
};
};
// Version displayed top right corner
@ -358,16 +386,16 @@ impl MainMenuUi {
.middle_of(self.ids.login_error_bg)
.set(self.ids.error_frame, ui_widgets);
if let PopupType::ConnectionInfo = popup_type {
text.mid_top_with_margin_on(self.ids.error_frame, 10.0)
.font_id(self.fonts.alkhemi.conrod_id)
.bottom_left_with_margins_on(ui_widgets.window, 60.0, 60.0)
.font_size(self.fonts.cyri.scale(70))
.set(self.ids.login_error, ui_widgets);
/*text.mid_top_with_margin_on(self.ids.error_frame, 10.0)
.font_id(self.fonts.cyri.conrod_id)
.bottom_left_with_margins_on(self.ids.bg, 30.0, 95.0)
.font_size(self.fonts.cyri.scale(35))
.set(self.ids.login_error, ui_widgets);*/
} else {
text.mid_top_with_margin_on(self.ids.error_frame, 10.0)
.w(frame_w - 10.0 * 2.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(25))
.font_size(self.fonts.cyri.scale(20))
.set(self.ids.login_error, ui_widgets);
};
if Button::image(self.imgs.button)
@ -533,7 +561,7 @@ impl MainMenuUi {
self.connect = true;
self.connecting = Some(std::time::Instant::now());
self.popup = Some(PopupData {
msg: [self.voxygen_i18n.get("main.creating_world"), "..."].concat(),
msg: [self.voxygen_i18n.get(""), ""].concat(),
popup_type: PopupType::ConnectionInfo,
});
};
@ -716,6 +744,7 @@ impl MainMenuUi {
.set(self.ids.login_button, ui_widgets)
.was_clicked()
{
self.tip_no = rng.gen();
login!();
}
@ -737,6 +766,7 @@ impl MainMenuUi {
.set(self.ids.singleplayer_button, ui_widgets)
.was_clicked()
{
self.tip_no = rng.gen();
singleplayer!();
}
}

View File

@ -746,6 +746,10 @@ impl PlayState for SessionState {
global_state.settings.gameplay.sct_player_batch = sct_player_batch;
global_state.settings.save_to_file_warn();
},
HudEvent::ToggleTips(loading_tips) => {
global_state.settings.gameplay.loading_tips = loading_tips;
global_state.settings.save_to_file_warn();
},
HudEvent::SctDamageBatch(sct_damage_batch) => {
global_state.settings.gameplay.sct_damage_batch = sct_damage_batch;
global_state.settings.save_to_file_warn();

View File

@ -499,6 +499,7 @@ pub struct GameplaySettings {
pub auto_walk_behavior: PressBehavior,
pub stop_auto_walk_on_input: bool,
pub map_zoom: f64,
pub loading_tips: bool,
}
impl Default for GameplaySettings {
@ -528,6 +529,7 @@ impl Default for GameplaySettings {
auto_walk_behavior: PressBehavior::Toggle,
stop_auto_walk_on_input: true,
map_zoom: 4.0,
loading_tips: true,
}
}
}

View File

@ -533,6 +533,9 @@ impl Floor {
11 => comp::Item::expect_from_asset(
"common.items.weapons.sword.cultist_purp_2h-0",
),
12 => comp::Item::expect_from_asset(
"common.items.armor.back.dungeon_purple-0",
),
_ => comp::Item::expect_from_asset(
"common.items.boss_drops.exp_flask",
),