2019-03-15 04:55:52 +00:00
|
|
|
use crate::{
|
2020-02-01 20:39:39 +00:00
|
|
|
i18n::{i18n_asset_key, VoxygenLocalization},
|
2019-03-15 04:55:52 +00:00
|
|
|
render::Renderer,
|
2019-05-11 14:59:48 +00:00
|
|
|
ui::{
|
|
|
|
self,
|
2020-01-26 19:29:46 +00:00
|
|
|
fonts::ConrodVoxygenFonts,
|
2019-07-27 19:26:31 +00:00
|
|
|
img_ids::{BlankGraphic, ImageGraphic, VoxelGraphic},
|
2020-02-01 20:39:39 +00:00
|
|
|
Graphic, ImageFrame, Tooltip, Ui,
|
2019-05-11 14:59:48 +00:00
|
|
|
},
|
2019-06-06 14:48:41 +00:00
|
|
|
GlobalState,
|
2019-04-19 18:14:00 +00:00
|
|
|
};
|
2020-01-10 00:33:38 +00:00
|
|
|
use common::assets::load_expect;
|
2019-03-04 07:28:16 +00:00
|
|
|
use conrod_core::{
|
2019-04-17 17:41:22 +00:00
|
|
|
color,
|
2019-03-15 04:55:52 +00:00
|
|
|
color::TRANSPARENT,
|
2019-04-28 02:12:30 +00:00
|
|
|
position::Relative,
|
2019-06-06 14:48:41 +00:00
|
|
|
widget::{text_box::Event as TextBoxEvent, Button, Image, List, Rectangle, Text, TextBox},
|
2019-04-04 13:49:31 +00:00
|
|
|
widget_ids, Borderable, Color, Colorable, Labelable, Positionable, Sizeable, Widget,
|
2019-03-04 07:28:16 +00:00
|
|
|
};
|
2020-01-10 00:33:38 +00:00
|
|
|
use rand::{seq::SliceRandom, thread_rng};
|
2019-11-23 00:51:18 +00:00
|
|
|
use std::time::Duration;
|
2019-03-04 07:28:16 +00:00
|
|
|
|
2019-03-15 04:55:52 +00:00
|
|
|
widget_ids! {
|
2019-03-04 07:28:16 +00:00
|
|
|
struct Ids {
|
|
|
|
// Background and logo
|
|
|
|
bg,
|
|
|
|
v_logo,
|
2019-03-15 04:55:52 +00:00
|
|
|
alpha_version,
|
2019-10-04 18:27:12 +00:00
|
|
|
banner,
|
|
|
|
banner_top,
|
2019-05-23 22:45:48 +00:00
|
|
|
// Disclaimer
|
|
|
|
disc_window,
|
|
|
|
disc_text_1,
|
|
|
|
disc_text_2,
|
|
|
|
disc_button,
|
|
|
|
disc_scrollbar,
|
2019-03-15 04:55:52 +00:00
|
|
|
// Login, Singleplayer
|
2019-03-04 07:28:16 +00:00
|
|
|
login_button,
|
|
|
|
login_text,
|
2019-04-17 20:38:52 +00:00
|
|
|
login_error,
|
|
|
|
login_error_bg,
|
2019-03-04 07:28:16 +00:00
|
|
|
address_text,
|
|
|
|
address_bg,
|
|
|
|
address_field,
|
|
|
|
username_text,
|
|
|
|
username_bg,
|
|
|
|
username_field,
|
2019-08-07 19:42:44 +00:00
|
|
|
password_text,
|
|
|
|
password_bg,
|
|
|
|
password_field,
|
2019-03-15 04:55:52 +00:00
|
|
|
singleplayer_button,
|
|
|
|
singleplayer_text,
|
2019-05-03 11:02:03 +00:00
|
|
|
usrnm_bg,
|
|
|
|
srvr_bg,
|
2019-08-07 19:42:44 +00:00
|
|
|
passwd_bg,
|
2019-05-17 09:22:32 +00:00
|
|
|
// Server list
|
2019-03-04 07:28:16 +00:00
|
|
|
servers_button,
|
2019-04-19 11:14:05 +00:00
|
|
|
servers_frame,
|
|
|
|
servers_text,
|
|
|
|
servers_close,
|
|
|
|
// Buttons
|
2019-03-04 07:28:16 +00:00
|
|
|
settings_button,
|
|
|
|
quit_button,
|
2019-04-15 20:51:32 +00:00
|
|
|
// Error
|
|
|
|
error_frame,
|
2019-04-17 17:41:22 +00:00
|
|
|
button_ok,
|
2019-04-24 19:55:22 +00:00
|
|
|
version,
|
2019-11-01 20:53:52 +00:00
|
|
|
// Info Window
|
|
|
|
info_frame,
|
|
|
|
info_text,
|
|
|
|
info_bottom
|
2019-03-04 07:28:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-08 18:19:57 +00:00
|
|
|
image_ids! {
|
|
|
|
struct Imgs {
|
|
|
|
<VoxelGraphic>
|
2019-08-06 06:31:48 +00:00
|
|
|
v_logo: "voxygen.element.v_logo",
|
2020-02-20 10:32:03 +00:00
|
|
|
|
2019-08-06 06:31:48 +00:00
|
|
|
disclaimer: "voxygen.element.frames.disclaimer",
|
2019-09-20 12:59:23 +00:00
|
|
|
info_frame: "voxygen.element.frames.info_frame_2",
|
2019-10-04 18:27:12 +00:00
|
|
|
banner: "voxygen.element.frames.banner",
|
2020-02-20 10:32:03 +00:00
|
|
|
|
2019-11-01 20:53:52 +00:00
|
|
|
banner_bottom: "voxygen.element.frames.banner_bottom",
|
2019-03-04 07:28:16 +00:00
|
|
|
|
2019-05-08 18:19:57 +00:00
|
|
|
<ImageGraphic>
|
2019-08-06 06:31:48 +00:00
|
|
|
bg: "voxygen.background.bg_main",
|
2020-02-20 10:32:03 +00:00
|
|
|
banner_top: "voxygen.element.frames.banner_top",
|
|
|
|
button: "voxygen.element.buttons.button",
|
|
|
|
button_hover: "voxygen.element.buttons.button_hover",
|
|
|
|
button_press: "voxygen.element.buttons.button_press",
|
|
|
|
input_bg_top: "voxygen.element.misc_bg.textbox_top",
|
|
|
|
//input_bg_mid: "voxygen.element.misc_bg.textbox_mid", <-- For password input
|
|
|
|
input_bg_bot: "voxygen.element.misc_bg.textbox_bot",
|
|
|
|
|
|
|
|
|
2019-07-27 19:26:31 +00:00
|
|
|
|
|
|
|
<BlankGraphic>
|
|
|
|
nothing: (),
|
2019-05-08 18:19:57 +00:00
|
|
|
}
|
2019-08-01 02:51:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
rotation_image_ids! {
|
|
|
|
pub struct ImgsRot {
|
|
|
|
<VoxelGraphic>
|
2019-06-22 14:30:53 +00:00
|
|
|
|
2019-08-01 02:51:40 +00:00
|
|
|
// Tooltip Test
|
2019-09-01 17:28:52 +00:00
|
|
|
tt_side: "voxygen/element/frames/tt_test_edge",
|
|
|
|
tt_corner: "voxygen/element/frames/tt_test_corner_tr",
|
2019-08-01 02:51:40 +00:00
|
|
|
}
|
2019-03-04 07:28:16 +00:00
|
|
|
}
|
|
|
|
|
2019-03-17 17:52:54 +00:00
|
|
|
pub enum Event {
|
|
|
|
LoginAttempt {
|
|
|
|
username: String,
|
2019-08-07 19:42:44 +00:00
|
|
|
password: String,
|
2019-03-17 17:52:54 +00:00
|
|
|
server_address: String,
|
|
|
|
},
|
2019-09-29 19:12:26 +00:00
|
|
|
CancelLoginAttempt,
|
2019-09-15 20:41:47 +00:00
|
|
|
#[cfg(feature = "singleplayer")]
|
2019-04-18 13:53:03 +00:00
|
|
|
StartSingleplayer,
|
2019-03-17 17:52:54 +00:00
|
|
|
Quit,
|
2019-06-10 20:44:03 +00:00
|
|
|
Settings,
|
2019-05-26 20:42:45 +00:00
|
|
|
DisclaimerClosed,
|
2019-03-17 17:52:54 +00:00
|
|
|
}
|
|
|
|
|
2019-09-29 19:12:26 +00:00
|
|
|
pub enum PopupType {
|
|
|
|
Error,
|
|
|
|
ConnectionInfo,
|
|
|
|
}
|
2020-01-10 00:33:38 +00:00
|
|
|
|
2019-09-29 19:12:26 +00:00
|
|
|
pub struct PopupData {
|
|
|
|
msg: String,
|
|
|
|
button_text: String,
|
|
|
|
popup_type: PopupType,
|
|
|
|
}
|
|
|
|
|
2019-03-04 07:28:16 +00:00
|
|
|
pub struct MainMenuUi {
|
|
|
|
ui: Ui,
|
|
|
|
ids: Ids,
|
|
|
|
imgs: Imgs,
|
2019-08-01 02:51:40 +00:00
|
|
|
rot_imgs: ImgsRot,
|
2019-03-15 04:55:52 +00:00
|
|
|
username: String,
|
2019-08-07 19:42:44 +00:00
|
|
|
password: String,
|
2019-03-04 07:28:16 +00:00
|
|
|
server_address: String,
|
2019-09-29 19:12:26 +00:00
|
|
|
popup: Option<PopupData>,
|
2019-04-14 23:28:29 +00:00
|
|
|
connecting: Option<std::time::Instant>,
|
2019-11-23 00:51:18 +00:00
|
|
|
connect: bool,
|
2019-04-19 11:14:05 +00:00
|
|
|
show_servers: bool,
|
2019-05-23 22:45:48 +00:00
|
|
|
show_disclaimer: bool,
|
2019-11-23 00:51:18 +00:00
|
|
|
time: f32,
|
2020-01-10 00:33:38 +00:00
|
|
|
bg_img_id: conrod_core::image::Id,
|
2020-01-26 19:29:46 +00:00
|
|
|
voxygen_i18n: std::sync::Arc<VoxygenLocalization>,
|
|
|
|
fonts: ConrodVoxygenFonts,
|
2019-03-04 07:28:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl MainMenuUi {
|
2019-04-18 17:40:29 +00:00
|
|
|
pub fn new(global_state: &mut GlobalState) -> Self {
|
2019-05-07 03:25:25 +00:00
|
|
|
let window = &mut global_state.window;
|
2019-04-18 17:40:29 +00:00
|
|
|
let networking = &global_state.settings.networking;
|
2019-07-26 02:28:53 +00:00
|
|
|
let gameplay = &global_state.settings.gameplay;
|
2020-01-10 00:33:38 +00:00
|
|
|
// Randomly loaded background images
|
|
|
|
let bg_imgs = [
|
|
|
|
"voxygen.background.bg_1",
|
|
|
|
"voxygen.background.bg_2",
|
|
|
|
"voxygen.background.bg_3",
|
|
|
|
"voxygen.background.bg_4",
|
|
|
|
"voxygen.background.bg_5",
|
|
|
|
"voxygen.background.bg_6",
|
|
|
|
"voxygen.background.bg_7",
|
|
|
|
"voxygen.background.bg_8",
|
|
|
|
];
|
|
|
|
let mut rng = thread_rng();
|
2019-07-26 02:28:53 +00:00
|
|
|
|
2019-03-04 07:28:16 +00:00
|
|
|
let mut ui = Ui::new(window).unwrap();
|
2019-07-26 02:28:53 +00:00
|
|
|
ui.set_scaling_mode(gameplay.ui_scale);
|
2019-03-04 07:28:16 +00:00
|
|
|
// Generate ids
|
|
|
|
let ids = Ids::new(ui.id_generator());
|
|
|
|
// Load images
|
2019-05-08 18:19:57 +00:00
|
|
|
let imgs = Imgs::load(&mut ui).expect("Failed to load images");
|
2019-08-01 02:51:40 +00:00
|
|
|
let rot_imgs = ImgsRot::load(&mut ui).expect("Failed to load images!");
|
2020-01-10 00:33:38 +00:00
|
|
|
let bg_img_id = ui.add_graphic(Graphic::Image(load_expect(
|
|
|
|
bg_imgs.choose(&mut rng).unwrap(),
|
|
|
|
)));
|
2020-01-26 19:29:46 +00:00
|
|
|
// Load language
|
|
|
|
let voxygen_i18n = load_expect::<VoxygenLocalization>(&i18n_asset_key(
|
|
|
|
&global_state.settings.language.selected_language,
|
|
|
|
));
|
|
|
|
// Load fonts.
|
|
|
|
let fonts = ConrodVoxygenFonts::load(&voxygen_i18n.fonts, &mut ui)
|
|
|
|
.expect("Impossible to load fonts!");
|
2019-04-20 22:02:48 +00:00
|
|
|
|
2019-03-04 07:28:16 +00:00
|
|
|
Self {
|
|
|
|
ui,
|
|
|
|
ids,
|
2019-05-08 18:19:57 +00:00
|
|
|
imgs,
|
2019-08-01 02:51:40 +00:00
|
|
|
rot_imgs,
|
2019-04-18 17:40:29 +00:00
|
|
|
username: networking.username.clone(),
|
2019-08-07 19:42:44 +00:00
|
|
|
password: "".to_owned(),
|
2019-04-25 08:45:01 +00:00
|
|
|
server_address: networking.servers[networking.default_server].clone(),
|
2019-09-29 19:12:26 +00:00
|
|
|
popup: None,
|
2019-04-14 23:28:29 +00:00
|
|
|
connecting: None,
|
2019-04-19 11:14:05 +00:00
|
|
|
show_servers: false,
|
2019-11-23 00:51:18 +00:00
|
|
|
connect: false,
|
|
|
|
time: 0.0,
|
2019-05-26 20:42:45 +00:00
|
|
|
show_disclaimer: global_state.settings.show_disclaimer,
|
2020-01-10 00:33:38 +00:00
|
|
|
bg_img_id,
|
2020-01-26 19:29:46 +00:00
|
|
|
voxygen_i18n,
|
|
|
|
fonts,
|
2019-03-04 07:28:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-23 00:51:18 +00:00
|
|
|
fn update_layout(&mut self, global_state: &mut GlobalState, dt: Duration) -> Vec<Event> {
|
2019-03-17 17:52:54 +00:00
|
|
|
let mut events = Vec::new();
|
2019-11-23 00:51:18 +00:00
|
|
|
self.time = self.time + dt.as_secs_f32();
|
|
|
|
let fade_msg = (self.time * 2.0).sin() * 0.5 + 0.51;
|
2019-09-18 16:46:12 +00:00
|
|
|
let (ref mut ui_widgets, ref mut _tooltip_manager) = self.ui.set_widgets();
|
2019-10-18 10:03:01 +00:00
|
|
|
let version = format!(
|
|
|
|
"{}-{}",
|
|
|
|
env!("CARGO_PKG_VERSION"),
|
|
|
|
common::util::GIT_VERSION.to_string()
|
|
|
|
);
|
2019-05-23 22:45:48 +00:00
|
|
|
const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0);
|
2019-06-22 14:30:53 +00:00
|
|
|
const TEXT_COLOR_2: Color = Color::Rgba(1.0, 1.0, 1.0, 0.2);
|
2019-11-09 23:19:41 +00:00
|
|
|
//const INACTIVE: Color = Color::Rgba(0.47, 0.47, 0.47, 0.47);
|
2020-01-17 23:43:18 +00:00
|
|
|
|
2020-01-26 19:29:46 +00:00
|
|
|
let intro_text = &self.voxygen_i18n.get("main.login_process");
|
2019-09-01 19:27:33 +00:00
|
|
|
|
|
|
|
// Tooltip
|
2019-09-18 16:46:12 +00:00
|
|
|
let _tooltip = Tooltip::new({
|
2019-09-01 19:27:33 +00:00
|
|
|
// Edge images [t, b, r, l]
|
|
|
|
// Corner images [tr, tl, br, bl]
|
|
|
|
let edge = &self.rot_imgs.tt_side;
|
|
|
|
let corner = &self.rot_imgs.tt_corner;
|
|
|
|
ImageFrame::new(
|
|
|
|
[edge.cw180, edge.none, edge.cw270, edge.cw90],
|
|
|
|
[corner.none, corner.cw270, corner.cw90, corner.cw180],
|
|
|
|
Color::Rgba(0.08, 0.07, 0.04, 1.0),
|
|
|
|
5.0,
|
|
|
|
)
|
|
|
|
})
|
2020-01-26 19:29:46 +00:00
|
|
|
.title_font_size(self.fonts.cyri.scale(15))
|
|
|
|
.desc_font_size(self.fonts.cyri.scale(10))
|
|
|
|
.font_id(self.fonts.cyri.conrod_id)
|
2019-09-01 19:27:33 +00:00
|
|
|
.title_text_color(TEXT_COLOR)
|
|
|
|
.desc_text_color(TEXT_COLOR_2);
|
|
|
|
|
2019-03-15 04:55:52 +00:00
|
|
|
// Background image, Veloren logo, Alpha-Version Label
|
2019-11-23 00:51:18 +00:00
|
|
|
Image::new(if self.connect {
|
2020-01-10 00:33:38 +00:00
|
|
|
self.bg_img_id
|
2019-11-23 00:51:18 +00:00
|
|
|
} else {
|
|
|
|
self.imgs.bg
|
|
|
|
})
|
|
|
|
.middle_of(ui_widgets.window)
|
|
|
|
.set(self.ids.bg, ui_widgets);
|
2020-01-10 00:33:38 +00:00
|
|
|
|
2019-10-18 13:51:07 +00:00
|
|
|
// Version displayed top right corner
|
|
|
|
Text::new(&version)
|
2019-11-23 00:51:18 +00:00
|
|
|
.color(TEXT_COLOR)
|
2019-08-01 17:53:34 +00:00
|
|
|
.top_right_with_margins_on(ui_widgets.window, 5.0, 5.0)
|
2020-01-26 19:29:46 +00:00
|
|
|
.font_id(self.fonts.cyri.conrod_id)
|
|
|
|
.font_size(self.fonts.cyri.scale(14))
|
2019-04-27 20:55:30 +00:00
|
|
|
.set(self.ids.version, ui_widgets);
|
2019-11-23 00:51:18 +00:00
|
|
|
// Popup (Error/Info)
|
|
|
|
if let Some(popup_data) = &self.popup {
|
|
|
|
let text = Text::new(&popup_data.msg)
|
|
|
|
.rgba(1.0, 1.0, 1.0, if self.connect { fade_msg } else { 1.0 })
|
2020-01-26 19:29:46 +00:00
|
|
|
.font_id(self.fonts.cyri.conrod_id);
|
2019-11-23 00:51:18 +00:00
|
|
|
Rectangle::fill_with([65.0 * 6.0, 140.0], color::TRANSPARENT)
|
|
|
|
.rgba(0.1, 0.1, 0.1, if self.connect { 0.0 } else { 1.0 })
|
|
|
|
.parent(ui_widgets.window)
|
|
|
|
.up_from(self.ids.banner_top, 15.0)
|
|
|
|
.set(self.ids.login_error_bg, ui_widgets);
|
|
|
|
Image::new(self.imgs.info_frame)
|
|
|
|
.w_h(65.0 * 6.0, 140.0)
|
|
|
|
.color(Some(Color::Rgba(
|
|
|
|
1.0,
|
|
|
|
1.0,
|
|
|
|
1.0,
|
|
|
|
if self.connect { 0.0 } else { 1.0 },
|
|
|
|
)))
|
|
|
|
.middle_of(self.ids.login_error_bg)
|
|
|
|
.set(self.ids.error_frame, ui_widgets);
|
|
|
|
if self.connect {
|
|
|
|
text.mid_top_with_margin_on(self.ids.error_frame, 10.0)
|
2020-01-26 19:29:46 +00:00
|
|
|
.font_id(self.fonts.alkhemi.conrod_id)
|
2019-11-23 00:51:18 +00:00
|
|
|
.bottom_left_with_margins_on(ui_widgets.window, 60.0, 60.0)
|
2020-01-26 19:29:46 +00:00
|
|
|
.font_size(self.fonts.cyri.scale(70))
|
2019-11-23 00:51:18 +00:00
|
|
|
.set(self.ids.login_error, ui_widgets);
|
|
|
|
} else {
|
|
|
|
text.mid_top_with_margin_on(self.ids.error_frame, 10.0)
|
2020-01-26 19:29:46 +00:00
|
|
|
.font_id(self.fonts.cyri.conrod_id)
|
|
|
|
.font_size(self.fonts.cyri.scale(25))
|
2019-11-23 00:51:18 +00:00
|
|
|
.set(self.ids.login_error, ui_widgets);
|
|
|
|
};
|
2019-05-03 11:02:03 +00:00
|
|
|
if Button::image(self.imgs.button)
|
2019-11-23 00:51:18 +00:00
|
|
|
.w_h(100.0, 30.0)
|
|
|
|
.mid_bottom_with_margin_on(
|
|
|
|
if self.connect {
|
|
|
|
ui_widgets.window
|
|
|
|
} else {
|
|
|
|
self.ids.login_error_bg
|
|
|
|
},
|
|
|
|
10.0,
|
|
|
|
)
|
2019-05-03 11:02:03 +00:00
|
|
|
.hover_image(self.imgs.button_hover)
|
|
|
|
.press_image(self.imgs.button_press)
|
2019-04-17 20:38:52 +00:00
|
|
|
.label_y(Relative::Scalar(2.0))
|
2019-11-23 00:51:18 +00:00
|
|
|
.label(&popup_data.button_text)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label_font_id(self.fonts.cyri.conrod_id)
|
|
|
|
.label_font_size(self.fonts.cyri.scale(15))
|
2019-11-23 00:51:18 +00:00
|
|
|
.label_color(TEXT_COLOR)
|
|
|
|
.set(self.ids.button_ok, ui_widgets)
|
2019-04-17 17:41:22 +00:00
|
|
|
.was_clicked()
|
2019-04-17 20:38:52 +00:00
|
|
|
{
|
2019-11-23 00:51:18 +00:00
|
|
|
match popup_data.popup_type {
|
|
|
|
PopupType::ConnectionInfo => {
|
|
|
|
events.push(Event::CancelLoginAttempt);
|
2020-02-01 20:39:39 +00:00
|
|
|
},
|
2019-11-23 00:51:18 +00:00
|
|
|
_ => (),
|
2019-05-23 22:45:48 +00:00
|
|
|
};
|
2019-11-23 00:51:18 +00:00
|
|
|
self.popup = None;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
if !self.connect {
|
|
|
|
Image::new(self.imgs.banner)
|
|
|
|
.w_h(65.0 * 6.0, 100.0 * 6.0)
|
|
|
|
.middle_of(self.ids.bg)
|
|
|
|
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.9)))
|
|
|
|
.set(self.ids.banner, ui_widgets);
|
|
|
|
|
|
|
|
Image::new(self.imgs.banner_top)
|
2020-02-20 10:32:03 +00:00
|
|
|
.w_h(70.0 * 6.0, 34.0)
|
|
|
|
.mid_top_with_margin_on(self.ids.banner, -34.0)
|
2019-11-23 00:51:18 +00:00
|
|
|
.set(self.ids.banner_top, ui_widgets);
|
|
|
|
|
|
|
|
// Logo
|
|
|
|
Image::new(self.imgs.v_logo)
|
|
|
|
.w_h(123.0 * 2.5, 35.0 * 2.5)
|
2020-02-20 10:32:03 +00:00
|
|
|
.mid_top_with_margin_on(self.ids.banner_top, 45.0)
|
2019-11-23 00:51:18 +00:00
|
|
|
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.95)))
|
|
|
|
.set(self.ids.v_logo, ui_widgets);
|
|
|
|
|
|
|
|
if self.show_disclaimer {
|
|
|
|
Image::new(self.imgs.disclaimer)
|
|
|
|
.w_h(1800.0, 800.0)
|
|
|
|
.middle_of(ui_widgets.window)
|
|
|
|
.scroll_kids()
|
|
|
|
.scroll_kids_vertically()
|
|
|
|
.set(self.ids.disc_window, ui_widgets);
|
|
|
|
|
2020-01-26 19:29:46 +00:00
|
|
|
Text::new(&self.voxygen_i18n.get("common.disclaimer"))
|
2019-11-23 00:51:18 +00:00
|
|
|
.top_left_with_margins_on(self.ids.disc_window, 30.0, 40.0)
|
2020-01-26 19:29:46 +00:00
|
|
|
.font_size(self.fonts.cyri.scale(35))
|
|
|
|
.font_id(self.fonts.alkhemi.conrod_id)
|
2019-11-23 00:51:18 +00:00
|
|
|
.color(TEXT_COLOR)
|
|
|
|
.set(self.ids.disc_text_1, ui_widgets);
|
2020-01-26 19:29:46 +00:00
|
|
|
Text::new(&self.voxygen_i18n.get("main.notice"))
|
2020-01-17 23:43:18 +00:00
|
|
|
.top_left_with_margins_on(self.ids.disc_window, 110.0, 40.0)
|
2020-01-26 19:29:46 +00:00
|
|
|
.font_size(self.fonts.cyri.scale(26))
|
|
|
|
.font_id(self.fonts.cyri.conrod_id)
|
2020-01-17 23:43:18 +00:00
|
|
|
.color(TEXT_COLOR)
|
|
|
|
.set(self.ids.disc_text_2, ui_widgets);
|
2019-11-23 00:51:18 +00:00
|
|
|
if Button::image(self.imgs.button)
|
|
|
|
.w_h(300.0, 50.0)
|
|
|
|
.mid_bottom_with_margin_on(self.ids.disc_window, 30.0)
|
|
|
|
.hover_image(self.imgs.button_hover)
|
|
|
|
.press_image(self.imgs.button_press)
|
|
|
|
.label_y(Relative::Scalar(2.0))
|
|
|
|
.label("Accept")
|
2020-01-26 19:29:46 +00:00
|
|
|
.label_font_size(self.fonts.cyri.scale(22))
|
2019-11-23 00:51:18 +00:00
|
|
|
.label_color(TEXT_COLOR)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label_font_id(self.fonts.cyri.conrod_id)
|
2019-11-23 00:51:18 +00:00
|
|
|
.set(self.ids.disc_button, ui_widgets)
|
|
|
|
.was_clicked()
|
|
|
|
{
|
|
|
|
self.show_disclaimer = false;
|
|
|
|
events.push(Event::DisclaimerClosed);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// TODO: Don't use macros for this?
|
|
|
|
// Input fields
|
|
|
|
// Used when the login button is pressed, or enter is pressed within input field
|
|
|
|
macro_rules! login {
|
|
|
|
() => {
|
|
|
|
self.connect = true;
|
|
|
|
self.connecting = Some(std::time::Instant::now());
|
|
|
|
self.popup = Some(PopupData {
|
2020-01-26 19:29:46 +00:00
|
|
|
msg: [self.voxygen_i18n.get("main.connecting"), "..."].concat(),
|
|
|
|
button_text: self.voxygen_i18n.get("common.cancel").to_owned(),
|
2019-11-23 00:51:18 +00:00
|
|
|
popup_type: PopupType::ConnectionInfo,
|
|
|
|
});
|
|
|
|
|
|
|
|
events.push(Event::LoginAttempt {
|
|
|
|
username: self.username.clone(),
|
|
|
|
password: self.password.clone(),
|
|
|
|
server_address: self.server_address.clone(),
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
// Info Window
|
|
|
|
Rectangle::fill_with([550.0, 200.0], color::BLACK)
|
|
|
|
.top_left_with_margins_on(ui_widgets.window, 40.0, 40.0)
|
|
|
|
.color(Color::Rgba(0.0, 0.0, 0.0, 0.95))
|
|
|
|
.set(self.ids.info_frame, ui_widgets);
|
|
|
|
Image::new(self.imgs.banner_bottom)
|
|
|
|
.mid_bottom_with_margin_on(self.ids.info_frame, -50.0)
|
|
|
|
.w_h(550.0, 50.0)
|
|
|
|
.color(Some(Color::Rgba(0.0, 0.0, 0.0, 0.95)))
|
|
|
|
.set(self.ids.info_bottom, ui_widgets);
|
|
|
|
Text::new(intro_text)
|
|
|
|
.top_left_with_margins_on(self.ids.info_frame, 15.0, 15.0)
|
2020-01-26 19:29:46 +00:00
|
|
|
.font_size(self.fonts.cyri.scale(20))
|
|
|
|
.font_id(self.fonts.cyri.conrod_id)
|
2019-11-23 00:51:18 +00:00
|
|
|
.color(TEXT_COLOR)
|
|
|
|
.set(self.ids.info_text, ui_widgets);
|
|
|
|
|
|
|
|
// Singleplayer
|
|
|
|
// Used when the singleplayer button is pressed
|
|
|
|
#[cfg(feature = "singleplayer")]
|
|
|
|
macro_rules! singleplayer {
|
|
|
|
() => {
|
|
|
|
events.push(Event::StartSingleplayer);
|
|
|
|
self.connect = true;
|
|
|
|
self.connecting = Some(std::time::Instant::now());
|
|
|
|
self.popup = Some(PopupData {
|
2020-01-26 19:29:46 +00:00
|
|
|
msg: [self.voxygen_i18n.get("main.creating_world"), "..."].concat(),
|
|
|
|
button_text: self.voxygen_i18n.get("common.cancel").to_owned(),
|
2019-11-23 00:51:18 +00:00
|
|
|
popup_type: PopupType::ConnectionInfo,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
2019-04-19 15:27:37 +00:00
|
|
|
|
2019-11-23 00:51:18 +00:00
|
|
|
// Username
|
|
|
|
Rectangle::fill_with([320.0, 50.0], color::rgba(0.0, 0.0, 0.0, 0.97))
|
|
|
|
.mid_top_with_margin_on(self.ids.banner_top, 160.0)
|
|
|
|
.set(self.ids.usrnm_bg, ui_widgets);
|
2020-02-20 10:32:03 +00:00
|
|
|
Image::new(self.imgs.input_bg_top)
|
2019-11-23 00:51:18 +00:00
|
|
|
.w_h(337.0, 67.0)
|
|
|
|
.middle_of(self.ids.usrnm_bg)
|
|
|
|
.set(self.ids.username_bg, ui_widgets);
|
|
|
|
for event in TextBox::new(&self.username)
|
|
|
|
.w_h(290.0, 30.0)
|
2020-02-20 10:32:03 +00:00
|
|
|
.mid_bottom_with_margin_on(self.ids.username_bg, 38.0 / 2.0)
|
2020-01-26 19:29:46 +00:00
|
|
|
.font_size(self.fonts.cyri.scale(22))
|
|
|
|
.font_id(self.fonts.cyri.conrod_id)
|
2019-11-23 00:51:18 +00:00
|
|
|
.text_color(TEXT_COLOR)
|
|
|
|
// transparent background
|
|
|
|
.color(TRANSPARENT)
|
|
|
|
.border_color(TRANSPARENT)
|
|
|
|
.set(self.ids.username_field, ui_widgets)
|
|
|
|
{
|
|
|
|
match event {
|
|
|
|
TextBoxEvent::Update(username) => {
|
|
|
|
// Note: TextBox limits the input string length to what fits in it
|
|
|
|
self.username = username.to_string();
|
2020-02-01 20:39:39 +00:00
|
|
|
},
|
2019-11-23 00:51:18 +00:00
|
|
|
TextBoxEvent::Enter => {
|
|
|
|
login!();
|
2020-02-01 20:39:39 +00:00
|
|
|
},
|
2019-05-23 22:45:48 +00:00
|
|
|
}
|
|
|
|
}
|
2019-11-23 00:51:18 +00:00
|
|
|
// Password
|
|
|
|
// TODO: REACTIVATE THIS WHEN A PROPER ACCOUNT SYSTEM IS IN PLACE
|
|
|
|
/*Rectangle::fill_with([320.0, 50.0], color::rgba(0.0, 0.0, 0.0, 0.97))
|
|
|
|
.down_from(self.ids.usrnm_bg, 30.0)
|
|
|
|
.set(self.ids.passwd_bg, ui_widgets);
|
2020-02-20 10:32:03 +00:00
|
|
|
Image::new(self.imgs.input_bg_mid)
|
2019-11-23 00:51:18 +00:00
|
|
|
.w_h(337.0, 67.0)
|
|
|
|
.middle_of(self.ids.passwd_bg)
|
|
|
|
.color(Some(INACTIVE))
|
|
|
|
.set(self.ids.password_bg, ui_widgets);
|
|
|
|
for event in TextBox::new(&self.password)
|
|
|
|
.w_h(290.0, 30.0)
|
|
|
|
.mid_bottom_with_margin_on(self.ids.password_bg, 44.0 / 2.0)
|
2020-01-26 19:29:46 +00:00
|
|
|
.font_size(self.fonts.cyri.scale(22))
|
|
|
|
.font_id(self.fonts.cyri.conrod_id)
|
2019-11-23 00:51:18 +00:00
|
|
|
.text_color(TEXT_COLOR)
|
|
|
|
// transparent background
|
|
|
|
.color(TRANSPARENT)
|
|
|
|
.border_color(TRANSPARENT)
|
|
|
|
.set(self.ids.password_field, ui_widgets)
|
|
|
|
{
|
|
|
|
match event {
|
|
|
|
TextBoxEvent::Update(password) => {
|
|
|
|
// Note: TextBox limits the input string length to what fits in it
|
|
|
|
self.password = password;
|
|
|
|
}
|
|
|
|
TextBoxEvent::Enter => {
|
|
|
|
login!();
|
|
|
|
}
|
2019-08-07 19:42:44 +00:00
|
|
|
}
|
2019-11-23 00:51:18 +00:00
|
|
|
}*/
|
|
|
|
if self.show_servers {
|
|
|
|
Image::new(self.imgs.info_frame)
|
|
|
|
.mid_top_with_margin_on(self.ids.username_bg, -320.0)
|
|
|
|
.w_h(400.0, 300.0)
|
|
|
|
.set(self.ids.servers_frame, ui_widgets);
|
|
|
|
|
|
|
|
let ref mut net_settings = global_state.settings.networking;
|
|
|
|
|
|
|
|
// TODO: Draw scroll bar or remove it.
|
|
|
|
let (mut items, _scrollbar) = List::flow_down(net_settings.servers.len())
|
|
|
|
.top_left_with_margins_on(self.ids.servers_frame, 0.0, 5.0)
|
|
|
|
.w_h(400.0, 300.0)
|
|
|
|
.scrollbar_next_to()
|
|
|
|
.scrollbar_thickness(18.0)
|
|
|
|
.scrollbar_color(TEXT_COLOR)
|
|
|
|
.set(self.ids.servers_text, ui_widgets);
|
|
|
|
|
|
|
|
while let Some(item) = items.next(ui_widgets) {
|
|
|
|
let mut text = "".to_string();
|
|
|
|
if &net_settings.servers[item.i] == &self.server_address {
|
|
|
|
text.push_str("-> ")
|
|
|
|
} else {
|
|
|
|
text.push_str(" ")
|
|
|
|
}
|
|
|
|
text.push_str(&net_settings.servers[item.i]);
|
|
|
|
|
|
|
|
if item
|
|
|
|
.set(
|
|
|
|
Button::image(self.imgs.nothing)
|
|
|
|
.w_h(100.0, 50.0)
|
|
|
|
.mid_top_with_margin_on(self.ids.servers_frame, 10.0)
|
|
|
|
//.hover_image(self.imgs.button_hover)
|
|
|
|
//.press_image(self.imgs.button_press)
|
|
|
|
.label_y(Relative::Scalar(2.0))
|
|
|
|
.label(&text)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label_font_size(self.fonts.cyri.scale(20))
|
|
|
|
.label_font_id(self.fonts.cyri.conrod_id)
|
2019-11-23 00:51:18 +00:00
|
|
|
.label_color(TEXT_COLOR),
|
|
|
|
ui_widgets,
|
|
|
|
)
|
|
|
|
.was_clicked()
|
|
|
|
{
|
|
|
|
self.server_address = net_settings.servers[item.i].clone();
|
|
|
|
net_settings.default_server = item.i;
|
|
|
|
}
|
2019-08-07 19:42:44 +00:00
|
|
|
}
|
2019-11-23 00:51:18 +00:00
|
|
|
|
|
|
|
if Button::image(self.imgs.button)
|
|
|
|
.w_h(200.0, 53.0)
|
|
|
|
.mid_bottom_with_margin_on(self.ids.servers_frame, 5.0)
|
|
|
|
.hover_image(self.imgs.button_hover)
|
|
|
|
.press_image(self.imgs.button_press)
|
|
|
|
.label_y(Relative::Scalar(2.0))
|
2020-01-26 19:29:46 +00:00
|
|
|
.label(&self.voxygen_i18n.get("common.close"))
|
|
|
|
.label_font_size(self.fonts.cyri.scale(20))
|
|
|
|
.label_font_id(self.fonts.cyri.conrod_id)
|
2019-11-23 00:51:18 +00:00
|
|
|
.label_color(TEXT_COLOR)
|
|
|
|
.set(self.ids.servers_close, ui_widgets)
|
|
|
|
.was_clicked()
|
|
|
|
{
|
|
|
|
self.show_servers = false
|
|
|
|
};
|
2019-08-07 19:42:44 +00:00
|
|
|
}
|
2019-11-23 00:51:18 +00:00
|
|
|
// Server address
|
|
|
|
Rectangle::fill_with([320.0, 50.0], color::rgba(0.0, 0.0, 0.0, 0.97))
|
|
|
|
.down_from(self.ids.usrnm_bg, 30.0)
|
|
|
|
.set(self.ids.srvr_bg, ui_widgets);
|
2020-02-20 10:32:03 +00:00
|
|
|
Image::new(self.imgs.input_bg_bot)
|
2019-11-23 00:51:18 +00:00
|
|
|
.w_h(337.0, 67.0)
|
|
|
|
.middle_of(self.ids.srvr_bg)
|
|
|
|
.set(self.ids.address_bg, ui_widgets);
|
|
|
|
for event in TextBox::new(&self.server_address)
|
|
|
|
.w_h(290.0, 30.0)
|
2020-02-20 10:32:03 +00:00
|
|
|
.mid_top_with_margin_on(self.ids.address_bg, 28.0 / 2.0)
|
2020-01-26 19:29:46 +00:00
|
|
|
.font_size(self.fonts.cyri.scale(22))
|
|
|
|
.font_id(self.fonts.cyri.conrod_id)
|
2019-11-23 00:51:18 +00:00
|
|
|
.text_color(TEXT_COLOR)
|
|
|
|
// transparent background
|
|
|
|
.color(TRANSPARENT)
|
|
|
|
.border_color(TRANSPARENT)
|
|
|
|
.set(self.ids.address_field, ui_widgets)
|
|
|
|
{
|
|
|
|
match event {
|
|
|
|
TextBoxEvent::Update(server_address) => {
|
|
|
|
self.server_address = server_address.to_string();
|
2020-02-01 20:39:39 +00:00
|
|
|
},
|
2019-11-23 00:51:18 +00:00
|
|
|
TextBoxEvent::Enter => {
|
|
|
|
login!();
|
2020-02-01 20:39:39 +00:00
|
|
|
},
|
2019-11-23 00:51:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Login button
|
2019-05-23 22:45:48 +00:00
|
|
|
if Button::image(self.imgs.button)
|
|
|
|
.hover_image(self.imgs.button_hover)
|
|
|
|
.press_image(self.imgs.button_press)
|
2019-11-23 00:51:18 +00:00
|
|
|
.w_h(258.0, 55.0)
|
|
|
|
.down_from(self.ids.address_bg, 20.0)
|
|
|
|
.align_middle_x_of(self.ids.address_bg)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label(&self.voxygen_i18n.get("common.multiplayer"))
|
|
|
|
.label_font_id(self.fonts.cyri.conrod_id)
|
2019-05-23 22:45:48 +00:00
|
|
|
.label_color(TEXT_COLOR)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label_font_size(self.fonts.cyri.scale(22))
|
2019-11-23 00:51:18 +00:00
|
|
|
.label_y(Relative::Scalar(5.0))
|
|
|
|
/*.with_tooltip(
|
|
|
|
tooltip_manager,
|
|
|
|
"Login",
|
|
|
|
"Click to login with the entered details",
|
|
|
|
&tooltip,
|
|
|
|
)
|
|
|
|
.tooltip_image(self.imgs.v_logo)*/
|
|
|
|
.set(self.ids.login_button, ui_widgets)
|
2019-05-23 22:45:48 +00:00
|
|
|
.was_clicked()
|
|
|
|
{
|
2019-11-23 00:51:18 +00:00
|
|
|
login!();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Singleplayer button
|
|
|
|
#[cfg(feature = "singleplayer")]
|
|
|
|
{
|
|
|
|
if Button::image(self.imgs.button)
|
|
|
|
.hover_image(self.imgs.button_hover)
|
|
|
|
.press_image(self.imgs.button_press)
|
|
|
|
.w_h(258.0, 55.0)
|
|
|
|
.down_from(self.ids.login_button, 20.0)
|
|
|
|
.align_middle_x_of(self.ids.address_bg)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label(&self.voxygen_i18n.get("common.singleplayer"))
|
|
|
|
.label_font_id(self.fonts.cyri.conrod_id)
|
2019-11-23 00:51:18 +00:00
|
|
|
.label_color(TEXT_COLOR)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label_font_size(self.fonts.cyri.scale(22))
|
2019-11-23 00:51:18 +00:00
|
|
|
.label_y(Relative::Scalar(5.0))
|
|
|
|
.label_x(Relative::Scalar(2.0))
|
|
|
|
.set(self.ids.singleplayer_button, ui_widgets)
|
2019-05-23 22:45:48 +00:00
|
|
|
.was_clicked()
|
|
|
|
{
|
2019-11-23 00:51:18 +00:00
|
|
|
singleplayer!();
|
2019-05-23 22:45:48 +00:00
|
|
|
}
|
2019-04-20 16:21:12 +00:00
|
|
|
}
|
2019-11-23 00:51:18 +00:00
|
|
|
// Quit
|
2019-05-23 22:45:48 +00:00
|
|
|
if Button::image(self.imgs.button)
|
2019-11-23 00:51:18 +00:00
|
|
|
.w_h(190.0, 40.0)
|
|
|
|
.bottom_left_with_margins_on(ui_widgets.window, 60.0, 30.0)
|
2019-05-23 22:45:48 +00:00
|
|
|
.hover_image(self.imgs.button_hover)
|
|
|
|
.press_image(self.imgs.button_press)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label(&self.voxygen_i18n.get("common.quit"))
|
|
|
|
.label_font_id(self.fonts.cyri.conrod_id)
|
2019-05-23 22:45:48 +00:00
|
|
|
.label_color(TEXT_COLOR)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label_font_size(self.fonts.cyri.scale(20))
|
2019-11-23 00:51:18 +00:00
|
|
|
.label_y(Relative::Scalar(3.0))
|
|
|
|
.set(self.ids.quit_button, ui_widgets)
|
2019-04-20 16:21:12 +00:00
|
|
|
.was_clicked()
|
|
|
|
{
|
2019-11-23 00:51:18 +00:00
|
|
|
events.push(Event::Quit);
|
2019-04-19 15:27:37 +00:00
|
|
|
}
|
|
|
|
|
2019-11-23 00:51:18 +00:00
|
|
|
// Settings
|
2019-09-15 20:41:47 +00:00
|
|
|
if Button::image(self.imgs.button)
|
2019-11-23 00:51:18 +00:00
|
|
|
.w_h(190.0, 40.0)
|
|
|
|
.up_from(self.ids.quit_button, 8.0)
|
|
|
|
//.hover_image(self.imgs.button_hover)
|
|
|
|
//.press_image(self.imgs.button_press)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label(&self.voxygen_i18n.get("common.settings"))
|
|
|
|
.label_font_id(self.fonts.cyri.conrod_id)
|
2019-11-23 00:51:18 +00:00
|
|
|
.label_color(TEXT_COLOR_2)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label_font_size(self.fonts.cyri.scale(20))
|
2019-11-23 00:51:18 +00:00
|
|
|
.label_y(Relative::Scalar(3.0))
|
|
|
|
.set(self.ids.settings_button, ui_widgets)
|
|
|
|
.was_clicked()
|
|
|
|
{
|
|
|
|
events.push(Event::Settings);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Servers
|
|
|
|
if Button::image(self.imgs.button)
|
|
|
|
.w_h(190.0, 40.0)
|
|
|
|
.up_from(self.ids.settings_button, 8.0)
|
2019-09-15 20:41:47 +00:00
|
|
|
.hover_image(self.imgs.button_hover)
|
|
|
|
.press_image(self.imgs.button_press)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label(&self.voxygen_i18n.get("common.servers"))
|
|
|
|
.label_font_id(self.fonts.cyri.conrod_id)
|
2019-09-15 20:41:47 +00:00
|
|
|
.label_color(TEXT_COLOR)
|
2020-01-26 19:29:46 +00:00
|
|
|
.label_font_size(self.fonts.cyri.scale(20))
|
2019-11-23 00:51:18 +00:00
|
|
|
.label_y(Relative::Scalar(3.0))
|
|
|
|
.set(self.ids.servers_button, ui_widgets)
|
2019-09-15 20:41:47 +00:00
|
|
|
.was_clicked()
|
|
|
|
{
|
2019-11-23 00:51:18 +00:00
|
|
|
self.show_servers = !self.show_servers;
|
|
|
|
};
|
2019-06-10 20:44:03 +00:00
|
|
|
}
|
2019-03-15 04:55:52 +00:00
|
|
|
}
|
2019-03-17 17:52:54 +00:00
|
|
|
|
|
|
|
events
|
2019-03-04 07:28:16 +00:00
|
|
|
}
|
|
|
|
|
2020-01-17 23:43:18 +00:00
|
|
|
pub fn show_info(&mut self, msg: String, button_text: String) {
|
2019-09-29 19:12:26 +00:00
|
|
|
self.popup = Some(PopupData {
|
|
|
|
msg,
|
2020-02-01 20:39:39 +00:00
|
|
|
button_text,
|
2019-09-29 19:12:26 +00:00
|
|
|
popup_type: PopupType::Error,
|
|
|
|
});
|
2019-04-14 23:28:29 +00:00
|
|
|
self.connecting = None;
|
2019-11-23 00:51:18 +00:00
|
|
|
self.connect = false;
|
2019-04-14 23:28:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn connected(&mut self) {
|
2019-09-29 19:12:26 +00:00
|
|
|
self.popup = None;
|
|
|
|
self.connecting = None;
|
2019-11-23 00:51:18 +00:00
|
|
|
self.connect = false;
|
2019-09-29 19:12:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn cancel_connection(&mut self) {
|
|
|
|
self.popup = None;
|
2019-04-14 23:28:29 +00:00
|
|
|
self.connecting = None;
|
2019-11-23 00:51:18 +00:00
|
|
|
self.connect = false;
|
2019-04-04 14:45:57 +00:00
|
|
|
}
|
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
pub fn handle_event(&mut self, event: ui::Event) { self.ui.handle_event(event); }
|
2019-03-04 07:28:16 +00:00
|
|
|
|
2019-11-23 00:51:18 +00:00
|
|
|
pub fn maintain(&mut self, global_state: &mut GlobalState, dt: Duration) -> Vec<Event> {
|
|
|
|
let events = self.update_layout(global_state, dt);
|
2019-05-20 06:09:20 +00:00
|
|
|
self.ui.maintain(global_state.window.renderer_mut(), None);
|
2019-03-17 17:52:54 +00:00
|
|
|
events
|
2019-03-04 07:28:16 +00:00
|
|
|
}
|
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
pub fn render(&self, renderer: &mut Renderer) { self.ui.render(renderer, None); }
|
2019-03-04 07:28:16 +00:00
|
|
|
}
|