mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
group leader colouring, offset fix when debug menu is open,
fixed social tab visuals text width limit group interaction wording, group window adjustments
This commit is contained in:
parent
28a8f847cc
commit
14b0d9a7fe
BIN
assets/voxygen/element/misc_bg/social_tab_online.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/misc_bg/social_tab_online.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -69,6 +69,7 @@ VoxygenLocalization(
|
|||||||
"common.error": "Fehler",
|
"common.error": "Fehler",
|
||||||
"common.fatal_error": "Fataler Fehler",
|
"common.fatal_error": "Fataler Fehler",
|
||||||
"common.decline": "Ablehnen",
|
"common.decline": "Ablehnen",
|
||||||
|
"common.you": "Ihr",
|
||||||
/// End Common section
|
/// End Common section
|
||||||
|
|
||||||
// Message when connection to the server is lost
|
// Message when connection to the server is lost
|
||||||
@ -321,15 +322,17 @@ magischen Gegenstände ergattern?"#,
|
|||||||
"hud.social.zone" : "Gebiet",
|
"hud.social.zone" : "Gebiet",
|
||||||
|
|
||||||
"hud.group": "Gruppe",
|
"hud.group": "Gruppe",
|
||||||
"hud.group.invite": "Einladen",
|
"hud.group.invite_to_join": "{name} lädt euch in seine Gruppe ein!",
|
||||||
"hud.group.leave": "Verlassen",
|
"hud.group.invite": "Einladen",
|
||||||
"hud.group.add_friend": "Freund hinzufügen",
|
"hud.group.kick": "Kicken",
|
||||||
"hud.group.assign_leader": "Anführer",
|
"hud.group.assign_leader": "Anführer",
|
||||||
"hud.group.kick": "Entfernen",
|
"hud.group.leave": "Gruppe Verlassen",
|
||||||
"hud.group.invite_to_join": "{name} hat euch zu seiner Gruppe eingeladen!",
|
|
||||||
"hud.group.dead" : "Tot",
|
"hud.group.dead" : "Tot",
|
||||||
"hud.group.out_of_range": "Außer Reichweite",
|
"hud.group.out_of_range": "Außer Reichweite",
|
||||||
|
"hud.group.add_friend": "Freund hinzufügen",
|
||||||
"hud.group.link_group": "Gruppen verbinden",
|
"hud.group.link_group": "Gruppen verbinden",
|
||||||
|
"hud.group.in_menu": "In Menü",
|
||||||
|
"hud.group.members": "Gruppen Mitglieder",
|
||||||
|
|
||||||
"hud.crafting": "Herstellen",
|
"hud.crafting": "Herstellen",
|
||||||
"hud.crafting.recipes": "Rezepte",
|
"hud.crafting.recipes": "Rezepte",
|
||||||
@ -394,6 +397,7 @@ magischen Gegenstände ergattern?"#,
|
|||||||
"gameinput.dance": "Tanzen",
|
"gameinput.dance": "Tanzen",
|
||||||
"gameinput.declinegroupinvite": "Ablehnen",
|
"gameinput.declinegroupinvite": "Ablehnen",
|
||||||
"gameinput.acceptgroupinvite": "Annehmen",
|
"gameinput.acceptgroupinvite": "Annehmen",
|
||||||
|
"gameinput.select": "Auswählen",
|
||||||
|
|
||||||
/// End GameInput section
|
/// End GameInput section
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ pub fn handle_group(server: &mut Server, entity: specs::Entity, manip: GroupMani
|
|||||||
if let Some(client) = clients.get_mut(entity) {
|
if let Some(client) = clients.get_mut(entity) {
|
||||||
client.notify(
|
client.notify(
|
||||||
ChatType::Meta
|
ChatType::Meta
|
||||||
.server_msg("Invite failed, target does not exist".to_owned()),
|
.server_msg("Invite failed, target does not exist.".to_owned()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -54,7 +54,7 @@ pub fn handle_group(server: &mut Server, entity: specs::Entity, manip: GroupMani
|
|||||||
if client.invited_to_group.is_some() {
|
if client.invited_to_group.is_some() {
|
||||||
already_has_invite = true;
|
already_has_invite = true;
|
||||||
} else {
|
} else {
|
||||||
client.notify(ServerMsg::GroupInvite((*inviter_uid)));
|
client.notify(ServerMsg::GroupInvite(*inviter_uid));
|
||||||
client.invited_to_group = Some(entity);
|
client.invited_to_group = Some(entity);
|
||||||
}
|
}
|
||||||
// Would be cool to do this in agent system (e.g. add an invited
|
// Would be cool to do this in agent system (e.g. add an invited
|
||||||
@ -72,15 +72,16 @@ pub fn handle_group(server: &mut Server, entity: specs::Entity, manip: GroupMani
|
|||||||
.write_storage()
|
.write_storage()
|
||||||
.insert(invitee, comp::Agent::default());
|
.insert(invitee, comp::Agent::default());
|
||||||
} else if let Some(client) = clients.get_mut(entity) {
|
} else if let Some(client) = clients.get_mut(entity) {
|
||||||
client.notify(ChatType::Meta.server_msg("Invite rejected".to_owned()));
|
client.notify(ChatType::Meta.server_msg("Invite rejected.".to_owned()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if already_has_invite {
|
if already_has_invite {
|
||||||
// Inform inviter that there is already an invite
|
// Inform inviter that there is already an invite
|
||||||
if let Some(client) = clients.get_mut(entity) {
|
if let Some(client) = clients.get_mut(entity) {
|
||||||
client.notify(ChatType::Meta.server_msg(
|
client.notify(
|
||||||
"Invite failed target already has a pending invite".to_owned(),
|
ChatType::Meta
|
||||||
));
|
.server_msg("This player already has a pending invite.".to_owned()),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +144,7 @@ pub fn handle_group(server: &mut Server, entity: specs::Entity, manip: GroupMani
|
|||||||
// Inform inviter of rejection
|
// Inform inviter of rejection
|
||||||
if let Some(client) = clients.get_mut(inviter) {
|
if let Some(client) = clients.get_mut(inviter) {
|
||||||
// TODO: say who declined the invite
|
// TODO: say who declined the invite
|
||||||
client.notify(ChatType::Meta.server_msg("Invite declined".to_owned()));
|
client.notify(ChatType::Meta.server_msg("Invite declined.".to_owned()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -181,7 +182,7 @@ pub fn handle_group(server: &mut Server, entity: specs::Entity, manip: GroupMani
|
|||||||
if let Some(client) = clients.get_mut(entity) {
|
if let Some(client) = clients.get_mut(entity) {
|
||||||
client.notify(
|
client.notify(
|
||||||
ChatType::Meta
|
ChatType::Meta
|
||||||
.server_msg("Kick failed, target does not exist".to_owned()),
|
.server_msg("Kick failed, target does not exist.".to_owned()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -193,7 +194,7 @@ pub fn handle_group(server: &mut Server, entity: specs::Entity, manip: GroupMani
|
|||||||
{
|
{
|
||||||
if let Some(client) = clients.get_mut(entity) {
|
if let Some(client) = clients.get_mut(entity) {
|
||||||
client.notify(
|
client.notify(
|
||||||
ChatType::Meta.server_msg("Kick failed, can't kick pet".to_owned()),
|
ChatType::Meta.server_msg("Kick failed, you can't kick pets.".to_owned()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -202,7 +203,8 @@ pub fn handle_group(server: &mut Server, entity: specs::Entity, manip: GroupMani
|
|||||||
if uids.get(entity).map_or(false, |u| *u == uid) {
|
if uids.get(entity).map_or(false, |u| *u == uid) {
|
||||||
if let Some(client) = clients.get_mut(entity) {
|
if let Some(client) = clients.get_mut(entity) {
|
||||||
client.notify(
|
client.notify(
|
||||||
ChatType::Meta.server_msg("Kick failed, can't kick yourself".to_owned()),
|
ChatType::Meta
|
||||||
|
.server_msg("Kick failed, you can't kick yourself.".to_owned()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -238,19 +240,20 @@ pub fn handle_group(server: &mut Server, entity: specs::Entity, manip: GroupMani
|
|||||||
// Tell them the have been kicked
|
// Tell them the have been kicked
|
||||||
if let Some(client) = clients.get_mut(target) {
|
if let Some(client) = clients.get_mut(target) {
|
||||||
client.notify(
|
client.notify(
|
||||||
ChatType::Meta.server_msg("The group leader kicked you".to_owned()),
|
ChatType::Meta
|
||||||
|
.server_msg("You were removed from the group.".to_owned()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// Tell kicker that they were succesful
|
// Tell kicker that they were succesful
|
||||||
if let Some(client) = clients.get_mut(entity) {
|
if let Some(client) = clients.get_mut(entity) {
|
||||||
client.notify(ChatType::Meta.server_msg("Kick complete".to_owned()));
|
client.notify(ChatType::Meta.server_msg("Player kicked.".to_owned()));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Some(_) => {
|
Some(_) => {
|
||||||
// Inform kicker that they are not the leader
|
// Inform kicker that they are not the leader
|
||||||
if let Some(client) = clients.get_mut(entity) {
|
if let Some(client) = clients.get_mut(entity) {
|
||||||
client.notify(ChatType::Meta.server_msg(
|
client.notify(ChatType::Meta.server_msg(
|
||||||
"Kick failed: you are not the leader of the target's group".to_owned(),
|
"Kick failed: You are not the leader of the target's group.".to_owned(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -259,7 +262,7 @@ pub fn handle_group(server: &mut Server, entity: specs::Entity, manip: GroupMani
|
|||||||
if let Some(client) = clients.get_mut(entity) {
|
if let Some(client) = clients.get_mut(entity) {
|
||||||
client.notify(
|
client.notify(
|
||||||
ChatType::Meta.server_msg(
|
ChatType::Meta.server_msg(
|
||||||
"Kick failed: your target is not in a group".to_owned(),
|
"Kick failed: Your target is not in a group.".to_owned(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -309,14 +312,16 @@ pub fn handle_group(server: &mut Server, entity: specs::Entity, manip: GroupMani
|
|||||||
);
|
);
|
||||||
// Tell them they are the leader
|
// Tell them they are the leader
|
||||||
if let Some(client) = clients.get_mut(target) {
|
if let Some(client) = clients.get_mut(target) {
|
||||||
client.notify(ChatType::Meta.server_msg(
|
client.notify(
|
||||||
"The group leader has passed leadership to you".to_owned(),
|
ChatType::Meta.server_msg("You are the group leader now.".to_owned()),
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
// Tell the old leader that the transfer was succesful
|
// Tell the old leader that the transfer was succesful
|
||||||
if let Some(client) = clients.get_mut(target) {
|
if let Some(client) = clients.get_mut(target) {
|
||||||
client
|
client.notify(
|
||||||
.notify(ChatType::Meta.server_msg("Leadership transferred".to_owned()));
|
ChatType::Meta
|
||||||
|
.server_msg("You are no longer the group leader.".to_owned()),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Some(_) => {
|
Some(_) => {
|
||||||
@ -324,7 +329,7 @@ pub fn handle_group(server: &mut Server, entity: specs::Entity, manip: GroupMani
|
|||||||
if let Some(client) = clients.get_mut(entity) {
|
if let Some(client) = clients.get_mut(entity) {
|
||||||
client.notify(
|
client.notify(
|
||||||
ChatType::Meta.server_msg(
|
ChatType::Meta.server_msg(
|
||||||
"Transfer failed: you are not the leader of the target's group"
|
"Transfer failed: You are not the leader of the target's group."
|
||||||
.to_owned(),
|
.to_owned(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -334,7 +339,7 @@ pub fn handle_group(server: &mut Server, entity: specs::Entity, manip: GroupMani
|
|||||||
// Inform transferer that the target is not in a group
|
// Inform transferer that the target is not in a group
|
||||||
if let Some(client) = clients.get_mut(entity) {
|
if let Some(client) = clients.get_mut(entity) {
|
||||||
client.notify(ChatType::Meta.server_msg(
|
client.notify(ChatType::Meta.server_msg(
|
||||||
"Transfer failed: your target is not in a group".to_owned(),
|
"Transfer failed: Your target is not in a group.".to_owned(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::{
|
use super::{
|
||||||
img_ids::Imgs, Show, BLACK, GROUP_COLOR, HP_COLOR, KILL_COLOR, LOW_HP_COLOR, MANA_COLOR,
|
img_ids::Imgs, Show, BLACK, ERROR_COLOR, GROUP_COLOR, HP_COLOR, KILL_COLOR, LOW_HP_COLOR,
|
||||||
TEXT_COLOR, TEXT_COLOR_GREY, UI_HIGHLIGHT_0, UI_MAIN,
|
MANA_COLOR, TEXT_COLOR, TEXT_COLOR_GREY, UI_HIGHLIGHT_0, UI_MAIN,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -25,7 +25,7 @@ widget_ids! {
|
|||||||
group_button,
|
group_button,
|
||||||
bg,
|
bg,
|
||||||
title,
|
title,
|
||||||
close,
|
title_bg,
|
||||||
btn_bg,
|
btn_bg,
|
||||||
btn_friend,
|
btn_friend,
|
||||||
btn_leader,
|
btn_leader,
|
||||||
@ -35,7 +35,6 @@ widget_ids! {
|
|||||||
scroll_area,
|
scroll_area,
|
||||||
scrollbar,
|
scrollbar,
|
||||||
members[],
|
members[],
|
||||||
invite_bubble,
|
|
||||||
bubble_frame,
|
bubble_frame,
|
||||||
btn_accept,
|
btn_accept,
|
||||||
btn_decline,
|
btn_decline,
|
||||||
@ -178,8 +177,8 @@ impl<'a> Widget for Group<'a> {
|
|||||||
// broken
|
// broken
|
||||||
if self.show.group_menu || open_invite.is_some() {
|
if self.show.group_menu || open_invite.is_some() {
|
||||||
// Frame
|
// Frame
|
||||||
Rectangle::fill_with([220.0, 165.0], color::Color::Rgba(0.0, 0.0, 0.0, 0.8))
|
Rectangle::fill_with([220.0, 140.0], color::Color::Rgba(0.0, 0.0, 0.0, 0.8))
|
||||||
.bottom_left_with_margins_on(ui.window, 220.0, 10.0)
|
.bottom_left_with_margins_on(ui.window, 108.0, 490.0)
|
||||||
.crop_kids()
|
.crop_kids()
|
||||||
.set(state.ids.bg, ui);
|
.set(state.ids.bg, ui);
|
||||||
}
|
}
|
||||||
@ -187,7 +186,7 @@ impl<'a> Widget for Group<'a> {
|
|||||||
// Group Menu button
|
// Group Menu button
|
||||||
Button::image(self.imgs.group_icon)
|
Button::image(self.imgs.group_icon)
|
||||||
.w_h(49.0, 26.0)
|
.w_h(49.0, 26.0)
|
||||||
.bottom_left_with_margins_on(ui.window, 190.0, 10.0)
|
.bottom_left_with_margins_on(ui.window, 10.0, 490.0)
|
||||||
.set(state.ids.group_button, ui);
|
.set(state.ids.group_button, ui);
|
||||||
// Show timeout bar
|
// Show timeout bar
|
||||||
let max_time = 90.0;
|
let max_time = 90.0;
|
||||||
@ -213,7 +212,7 @@ impl<'a> Widget for Group<'a> {
|
|||||||
self.imgs.group_icon
|
self.imgs.group_icon
|
||||||
})
|
})
|
||||||
.w_h(49.0, 26.0)
|
.w_h(49.0, 26.0)
|
||||||
.bottom_left_with_margins_on(ui.window, 190.0, 10.0)
|
.bottom_left_with_margins_on(ui.window, 10.0, 490.0)
|
||||||
.hover_image(self.imgs.group_icon_hover)
|
.hover_image(self.imgs.group_icon_hover)
|
||||||
.press_image(self.imgs.group_icon_press)
|
.press_image(self.imgs.group_icon_press)
|
||||||
.set(state.ids.group_button, ui)
|
.set(state.ids.group_button, ui)
|
||||||
@ -221,6 +220,18 @@ impl<'a> Widget for Group<'a> {
|
|||||||
{
|
{
|
||||||
self.show.group_menu = !self.show.group_menu;
|
self.show.group_menu = !self.show.group_menu;
|
||||||
};
|
};
|
||||||
|
Text::new(&group_name)
|
||||||
|
.up_from(state.ids.group_button, 5.0)
|
||||||
|
.font_size(14)
|
||||||
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
|
.color(BLACK)
|
||||||
|
.set(state.ids.title_bg, ui);
|
||||||
|
Text::new(&group_name)
|
||||||
|
.bottom_right_with_margins_on(state.ids.title_bg, 1.0, 1.0)
|
||||||
|
.font_size(14)
|
||||||
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
|
.color(TEXT_COLOR)
|
||||||
|
.set(state.ids.title, ui);
|
||||||
// Member panels
|
// Member panels
|
||||||
let group_size = group_members.len();
|
let group_size = group_members.len();
|
||||||
if state.ids.member_panels_bg.len() < group_size {
|
if state.ids.member_panels_bg.len() < group_size {
|
||||||
@ -298,7 +309,7 @@ impl<'a> Widget for Group<'a> {
|
|||||||
|
|
||||||
// change panel positions when debug info is shown
|
// change panel positions when debug info is shown
|
||||||
let offset = if self.global_state.settings.gameplay.toggle_debug {
|
let offset = if self.global_state.settings.gameplay.toggle_debug {
|
||||||
240.0
|
290.0
|
||||||
} else {
|
} else {
|
||||||
110.0
|
110.0
|
||||||
};
|
};
|
||||||
@ -316,10 +327,15 @@ impl<'a> Widget for Group<'a> {
|
|||||||
21..=40 => LOW_HP_COLOR,
|
21..=40 => LOW_HP_COLOR,
|
||||||
_ => HP_COLOR,
|
_ => HP_COLOR,
|
||||||
};
|
};
|
||||||
|
let lead = if uid == leader { true } else { false };
|
||||||
// Don't show panel for the player!
|
// Don't show panel for the player!
|
||||||
// Panel BG
|
// Panel BG
|
||||||
back.w_h(152.0, 36.0)
|
back.w_h(152.0, 36.0)
|
||||||
.color(Some(TEXT_COLOR))
|
.color(if lead {
|
||||||
|
Some(ERROR_COLOR)
|
||||||
|
} else {
|
||||||
|
Some(TEXT_COLOR)
|
||||||
|
})
|
||||||
.set(state.ids.member_panels_bg[i], ui);
|
.set(state.ids.member_panels_bg[i], ui);
|
||||||
// Health
|
// Health
|
||||||
Image::new(self.imgs.bar_content)
|
Image::new(self.imgs.bar_content)
|
||||||
@ -375,12 +391,14 @@ impl<'a> Widget for Group<'a> {
|
|||||||
.font_size(20)
|
.font_size(20)
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
.color(BLACK)
|
.color(BLACK)
|
||||||
|
.w(300.0) // limit name length display
|
||||||
.set(state.ids.member_panels_txt_bg[i], ui);
|
.set(state.ids.member_panels_txt_bg[i], ui);
|
||||||
Text::new(&char_name)
|
Text::new(&char_name)
|
||||||
.bottom_left_with_margins_on(state.ids.member_panels_txt_bg[i], 2.0, 2.0)
|
.bottom_left_with_margins_on(state.ids.member_panels_txt_bg[i], 2.0, 2.0)
|
||||||
.font_size(20)
|
.font_size(20)
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
.color(GROUP_COLOR)
|
.color(if lead { ERROR_COLOR } else { GROUP_COLOR })
|
||||||
|
.w(300.0) // limit name length display
|
||||||
.set(state.ids.member_panels_txt[i], ui);
|
.set(state.ids.member_panels_txt[i], ui);
|
||||||
if let Some(energy) = energy {
|
if let Some(energy) = energy {
|
||||||
let stam_perc = energy.current() as f64 / energy.maximum() as f64;
|
let stam_perc = energy.current() as f64 / energy.maximum() as f64;
|
||||||
@ -434,19 +452,13 @@ impl<'a> Widget for Group<'a> {
|
|||||||
|
|
||||||
if self.show.group_menu {
|
if self.show.group_menu {
|
||||||
let selected = state.selected_member;
|
let selected = state.selected_member;
|
||||||
Text::new(&group_name)
|
if Button::image(self.imgs.button) // Change button behaviour and style when the friendslist is working
|
||||||
.mid_top_with_margin_on(state.ids.bg, 2.0)
|
|
||||||
.font_size(20)
|
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
|
||||||
.color(TEXT_COLOR)
|
|
||||||
.set(state.ids.title, ui);
|
|
||||||
if Button::image(self.imgs.button)
|
|
||||||
.w_h(90.0, 22.0)
|
.w_h(90.0, 22.0)
|
||||||
.top_right_with_margins_on(state.ids.bg, 30.0, 5.0)
|
.top_right_with_margins_on(state.ids.bg, 5.0, 5.0)
|
||||||
.hover_image(self.imgs.button) // Change this when the friendslist is working
|
.hover_image(self.imgs.button)
|
||||||
.press_image(self.imgs.button) // Change this when the friendslist is working
|
.press_image(self.imgs.button)
|
||||||
.label_color(TEXT_COLOR_GREY) // Change this when the friendslist is working
|
.label_color(TEXT_COLOR_GREY)
|
||||||
.image_color (TEXT_COLOR_GREY) // Change this when the friendslist is working
|
.image_color(TEXT_COLOR_GREY)
|
||||||
.label(&self.localized_strings.get("hud.group.add_friend"))
|
.label(&self.localized_strings.get("hud.group.add_friend"))
|
||||||
.label_font_id(self.fonts.cyri.conrod_id)
|
.label_font_id(self.fonts.cyri.conrod_id)
|
||||||
.label_font_size(self.fonts.cyri.scale(10))
|
.label_font_size(self.fonts.cyri.scale(10))
|
||||||
@ -495,19 +507,19 @@ impl<'a> Widget for Group<'a> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
if Button::image(self.imgs.button)
|
if Button::image(self.imgs.button)
|
||||||
.w_h(90.0, 22.0)
|
.w_h(90.0, 22.0)
|
||||||
.mid_bottom_with_margin_on(state.ids.btn_leader, -27.0)
|
.mid_bottom_with_margin_on(state.ids.btn_leader, -27.0)
|
||||||
.hover_image(self.imgs.button)
|
.hover_image(self.imgs.button)
|
||||||
.press_image(self.imgs.button)
|
.press_image(self.imgs.button)
|
||||||
.label(&self.localized_strings.get("hud.group.link_group"))
|
.label(&self.localized_strings.get("hud.group.link_group"))
|
||||||
.hover_image(self.imgs.button) // Change this when the friendslist is working
|
.hover_image(self.imgs.button)
|
||||||
.press_image(self.imgs.button) // Change this when the friendslist is working
|
.press_image(self.imgs.button)
|
||||||
.label_color(TEXT_COLOR_GREY) // Change this when the friendslist is working
|
.label_color(TEXT_COLOR_GREY)
|
||||||
.image_color (TEXT_COLOR_GREY) // Change this when the friendslist is working
|
.image_color(TEXT_COLOR_GREY)
|
||||||
.label_font_id(self.fonts.cyri.conrod_id)
|
.label_font_id(self.fonts.cyri.conrod_id)
|
||||||
.label_font_size(self.fonts.cyri.scale(10))
|
.label_font_size(self.fonts.cyri.scale(10))
|
||||||
.set(state.ids.btn_link, ui)
|
.set(state.ids.btn_link, ui)
|
||||||
.was_clicked()
|
.was_clicked()
|
||||||
{};
|
{};
|
||||||
if Button::image(self.imgs.button)
|
if Button::image(self.imgs.button)
|
||||||
.w_h(90.0, 22.0)
|
.w_h(90.0, 22.0)
|
||||||
@ -546,8 +558,8 @@ impl<'a> Widget for Group<'a> {
|
|||||||
}
|
}
|
||||||
// Scrollable area for group member names
|
// Scrollable area for group member names
|
||||||
Rectangle::fill_with([110.0, 135.0], color::TRANSPARENT)
|
Rectangle::fill_with([110.0, 135.0], color::TRANSPARENT)
|
||||||
.top_left_with_margins_on(state.ids.bg, 30.0, 5.0)
|
.top_left_with_margins_on(state.ids.bg, 5.0, 5.0)
|
||||||
.scroll_kids()
|
.crop_kids()
|
||||||
.scroll_kids_vertically()
|
.scroll_kids_vertically()
|
||||||
.set(state.ids.scroll_area, ui);
|
.set(state.ids.scroll_area, ui);
|
||||||
Scrollbar::y_axis(state.ids.scroll_area)
|
Scrollbar::y_axis(state.ids.scroll_area)
|
||||||
@ -558,7 +570,6 @@ impl<'a> Widget for Group<'a> {
|
|||||||
for (i, &uid) in group_members.iter().copied().enumerate() {
|
for (i, &uid) in group_members.iter().copied().enumerate() {
|
||||||
let selected = state.selected_member.map_or(false, |u| u == uid);
|
let selected = state.selected_member.map_or(false, |u| u == uid);
|
||||||
let char_name = uid_to_name_text(uid, &self.client);
|
let char_name = uid_to_name_text(uid, &self.client);
|
||||||
|
|
||||||
// TODO: Do something special visually if uid == leader
|
// TODO: Do something special visually if uid == leader
|
||||||
if Button::image(if selected {
|
if Button::image(if selected {
|
||||||
self.imgs.selection
|
self.imgs.selection
|
||||||
@ -578,7 +589,11 @@ impl<'a> Widget for Group<'a> {
|
|||||||
.crop_kids()
|
.crop_kids()
|
||||||
.label_x(Relative::Place(Place::Start(Some(4.0))))
|
.label_x(Relative::Place(Place::Start(Some(4.0))))
|
||||||
.label(&char_name)
|
.label(&char_name)
|
||||||
.label_color(TEXT_COLOR)
|
.label_color(if uid == leader {
|
||||||
|
ERROR_COLOR
|
||||||
|
} else {
|
||||||
|
TEXT_COLOR
|
||||||
|
})
|
||||||
.label_font_id(self.fonts.cyri.conrod_id)
|
.label_font_id(self.fonts.cyri.conrod_id)
|
||||||
.label_font_size(self.fonts.cyri.scale(12))
|
.label_font_size(self.fonts.cyri.scale(12))
|
||||||
.set(state.ids.members[i], ui)
|
.set(state.ids.members[i], ui)
|
||||||
@ -609,10 +624,11 @@ impl<'a> Widget for Group<'a> {
|
|||||||
.get("hud.group.invite_to_join")
|
.get("hud.group.invite_to_join")
|
||||||
.replace("{name}", &name);
|
.replace("{name}", &name);
|
||||||
Text::new(&invite_text)
|
Text::new(&invite_text)
|
||||||
.mid_top_with_margin_on(state.ids.bg, 20.0)
|
.mid_top_with_margin_on(state.ids.bg, 5.0)
|
||||||
.font_size(12)
|
.font_size(12)
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
.color(TEXT_COLOR)
|
.color(TEXT_COLOR)
|
||||||
|
.w(165.0) // Text stays within frame
|
||||||
.set(state.ids.title, ui);
|
.set(state.ids.title, ui);
|
||||||
// Accept Button
|
// Accept Button
|
||||||
let accept_key = self
|
let accept_key = self
|
||||||
@ -632,7 +648,7 @@ impl<'a> Widget for Group<'a> {
|
|||||||
))
|
))
|
||||||
.label_color(TEXT_COLOR)
|
.label_color(TEXT_COLOR)
|
||||||
.label_font_id(self.fonts.cyri.conrod_id)
|
.label_font_id(self.fonts.cyri.conrod_id)
|
||||||
.label_font_size(self.fonts.cyri.scale(15))
|
.label_font_size(self.fonts.cyri.scale(12))
|
||||||
.set(state.ids.btn_accept, ui)
|
.set(state.ids.btn_accept, ui)
|
||||||
.was_clicked()
|
.was_clicked()
|
||||||
{
|
{
|
||||||
@ -657,7 +673,7 @@ impl<'a> Widget for Group<'a> {
|
|||||||
))
|
))
|
||||||
.label_color(TEXT_COLOR)
|
.label_color(TEXT_COLOR)
|
||||||
.label_font_id(self.fonts.cyri.conrod_id)
|
.label_font_id(self.fonts.cyri.conrod_id)
|
||||||
.label_font_size(self.fonts.cyri.scale(15))
|
.label_font_size(self.fonts.cyri.scale(12))
|
||||||
.set(state.ids.btn_decline, ui)
|
.set(state.ids.btn_decline, ui)
|
||||||
.was_clicked()
|
.was_clicked()
|
||||||
{
|
{
|
||||||
|
@ -66,6 +66,7 @@ image_ids! {
|
|||||||
social_frame_fact: "voxygen.element.misc_bg.social_frame",
|
social_frame_fact: "voxygen.element.misc_bg.social_frame",
|
||||||
social_bg_fact: "voxygen.element.misc_bg.social_bg",
|
social_bg_fact: "voxygen.element.misc_bg.social_bg",
|
||||||
social_tab_act: "voxygen.element.buttons.social_tab_active",
|
social_tab_act: "voxygen.element.buttons.social_tab_active",
|
||||||
|
social_tab_online: "voxygen.element.misc_bg.social_tab_online",
|
||||||
social_tab_inact: "voxygen.element.buttons.social_tab_inactive",
|
social_tab_inact: "voxygen.element.buttons.social_tab_inactive",
|
||||||
social_tab_inact_hover: "voxygen.element.buttons.social_tab_inactive",
|
social_tab_inact_hover: "voxygen.element.buttons.social_tab_inactive",
|
||||||
social_tab_inact_press: "voxygen.element.buttons.social_tab_inactive",
|
social_tab_inact_press: "voxygen.element.buttons.social_tab_inactive",
|
||||||
|
@ -27,7 +27,6 @@ widget_ids! {
|
|||||||
scrollbar,
|
scrollbar,
|
||||||
online_align,
|
online_align,
|
||||||
online_tab,
|
online_tab,
|
||||||
online_tab_icon,
|
|
||||||
names_align,
|
names_align,
|
||||||
name_txt,
|
name_txt,
|
||||||
player_levels[],
|
player_levels[],
|
||||||
@ -205,18 +204,10 @@ impl<'a> Widget for Social<'a> {
|
|||||||
// Tabs Buttons
|
// Tabs Buttons
|
||||||
// Online Tab Button
|
// Online Tab Button
|
||||||
if Button::image(match &self.show.social_tab {
|
if Button::image(match &self.show.social_tab {
|
||||||
SocialTab::Online => self.imgs.social_tab_act,
|
SocialTab::Online => self.imgs.social_tab_online,
|
||||||
_ => self.imgs.social_tab_inact,
|
_ => self.imgs.social_tab_inact,
|
||||||
})
|
})
|
||||||
.w_h(30.0, 44.0)
|
.w_h(30.0, 44.0)
|
||||||
.hover_image(match &self.show.social_tab {
|
|
||||||
SocialTab::Online => self.imgs.social_tab_act,
|
|
||||||
_ => self.imgs.social_tab_inact_hover,
|
|
||||||
})
|
|
||||||
.press_image(match &self.show.social_tab {
|
|
||||||
SocialTab::Online => self.imgs.social_tab_act,
|
|
||||||
_ => self.imgs.social_tab_inact_press,
|
|
||||||
})
|
|
||||||
.image_color(match &self.show.social_tab {
|
.image_color(match &self.show.social_tab {
|
||||||
SocialTab::Online => UI_MAIN,
|
SocialTab::Online => UI_MAIN,
|
||||||
_ => Color::Rgba(1.0, 1.0, 1.0, 0.6),
|
_ => Color::Rgba(1.0, 1.0, 1.0, 0.6),
|
||||||
@ -227,14 +218,6 @@ impl<'a> Widget for Social<'a> {
|
|||||||
{
|
{
|
||||||
events.push(Event::ChangeSocialTab(SocialTab::Online));
|
events.push(Event::ChangeSocialTab(SocialTab::Online));
|
||||||
}
|
}
|
||||||
Image::new(self.imgs.chat_online_small)
|
|
||||||
.w_h(20.0, 20.0)
|
|
||||||
.top_right_with_margins_on(state.ids.online_tab, 12.0, 7.0)
|
|
||||||
.color(match &self.show.social_tab {
|
|
||||||
SocialTab::Online => Some(TEXT_COLOR),
|
|
||||||
_ => Some(UI_MAIN),
|
|
||||||
})
|
|
||||||
.set(state.ids.online_tab_icon, ui);
|
|
||||||
// Friends Tab Button
|
// Friends Tab Button
|
||||||
if Button::image(match &self.show.social_tab {
|
if Button::image(match &self.show.social_tab {
|
||||||
SocialTab::Friends => self.imgs.social_tab_act,
|
SocialTab::Friends => self.imgs.social_tab_act,
|
||||||
|
Loading…
Reference in New Issue
Block a user