mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'coffee-compiler/localize_singleplayer_server_name' into 'master'
Localize singleplayer server name in char selection See merge request veloren/veloren!4533
This commit is contained in:
commit
2746d8403e
@ -41,6 +41,8 @@ const BANLIST_FILENAME: &str = "banlist.ron";
|
||||
const SERVER_DESCRIPTION_FILENAME: &str = "description.ron";
|
||||
const ADMINS_FILENAME: &str = "admins.ron";
|
||||
|
||||
pub const SINGLEPLAYER_SERVER_NAME: &str = "Singleplayer";
|
||||
|
||||
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
|
||||
pub enum ServerBattleMode {
|
||||
Global(BattleMode),
|
||||
@ -308,7 +310,7 @@ impl Settings {
|
||||
} else {
|
||||
DEFAULT_WORLD_SEED
|
||||
},
|
||||
server_name: "Singleplayer".to_owned(),
|
||||
server_name: SINGLEPLAYER_SERVER_NAME.to_owned(),
|
||||
max_players: 100,
|
||||
max_view_distance: None,
|
||||
client_timeout: Duration::from_secs(180),
|
||||
|
@ -41,6 +41,7 @@ use iced::{
|
||||
button, scrollable, slider, text_input, Align, Button, Color, Column, Container,
|
||||
HorizontalAlignment, Length, Row, Scrollable, Slider, Space, Text, TextInput,
|
||||
};
|
||||
use server::settings::SINGLEPLAYER_SERVER_NAME;
|
||||
use std::sync::Arc;
|
||||
use vek::{Rgba, Vec2};
|
||||
|
||||
@ -535,11 +536,15 @@ impl Controls {
|
||||
*info_content = None;
|
||||
}
|
||||
|
||||
let server_name = if client.server_info().name == SINGLEPLAYER_SERVER_NAME {
|
||||
&i18n.get_msg("common-singleplayer").to_string()
|
||||
} else {
|
||||
&client.server_info().name
|
||||
};
|
||||
|
||||
let server = Container::new(
|
||||
Column::with_children(vec![
|
||||
Text::new(&client.server_info().name)
|
||||
.size(fonts.cyri.scale(25))
|
||||
.into(),
|
||||
Text::new(server_name).size(fonts.cyri.scale(25)).into(),
|
||||
// TODO: show additional server info here
|
||||
Space::new(Length::Fill, Length::Units(25)).into(),
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user