mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'angel/fix-chattype-error' into 'master'
Fixed meta chattype error on master See merge request veloren/veloren!1124
This commit is contained in:
commit
2b2e24be5e
@ -902,10 +902,10 @@ impl Client {
|
||||
},
|
||||
_ => {
|
||||
if let InventoryUpdateEvent::Collected(item) = event {
|
||||
frontend_events.push(Event::Chat {
|
||||
frontend_events.push(Event::Chat(comp::ChatMsg {
|
||||
message: format!("Picked up {}", item.name()),
|
||||
chat_type: ChatType::Meta,
|
||||
});
|
||||
chat_type: comp::ChatType::Meta,
|
||||
}));
|
||||
}
|
||||
|
||||
self.state.write_component(self.entity, inventory);
|
||||
@ -1088,6 +1088,7 @@ impl Client {
|
||||
// NPCs can't talk. Should be filtered by hud/mod.rs for voxygen and should be filtered
|
||||
// by server (due to not having a Pos) for chat-cli
|
||||
comp::ChatType::Npc(_uid, _r) => "".to_string(),
|
||||
comp::ChatType::Meta => message.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -79,6 +79,8 @@ pub enum ChatType {
|
||||
///
|
||||
/// The u16 field is a random number for selecting localization variants.
|
||||
Npc(Uid, u16),
|
||||
/// Anything else
|
||||
Meta,
|
||||
}
|
||||
|
||||
impl ChatType {
|
||||
@ -142,6 +144,7 @@ impl ChatMsg {
|
||||
ChatType::Region(_u) => SpeechBubbleType::Region,
|
||||
ChatType::World(_u) => SpeechBubbleType::World,
|
||||
ChatType::Npc(_u, _r) => SpeechBubbleType::None,
|
||||
ChatType::Meta => SpeechBubbleType::None,
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,6 +164,7 @@ impl ChatMsg {
|
||||
ChatType::Region(u) => Some(*u),
|
||||
ChatType::World(u) => Some(*u),
|
||||
ChatType::Npc(u, _r) => Some(*u),
|
||||
ChatType::Meta => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -247,6 +247,7 @@ impl StateExt for State {
|
||||
| comp::ChatType::CommandInfo
|
||||
| comp::ChatType::CommandError
|
||||
| comp::ChatType::Kill
|
||||
| comp::ChatType::Meta
|
||||
| comp::ChatType::World(_) => {
|
||||
self.notify_registered_clients(ServerMsg::ChatMsg(msg.clone()))
|
||||
},
|
||||
|
@ -489,5 +489,6 @@ fn render_chat_line(chat_type: &ChatType, imgs: &Imgs) -> (Color, conrod_core::i
|
||||
ChatType::Region(_uid) => (REGION_COLOR, imgs.chat_region_small),
|
||||
ChatType::World(_uid) => (WORLD_COLOR, imgs.chat_world_small),
|
||||
ChatType::Npc(_uid, _r) => panic!("NPCs can't talk"), // Should be filtered by hud/mod.rs
|
||||
ChatType::Meta => (INFO_COLOR, imgs.chat_command_info_small),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user