mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Chatting now creates speech bubbles
This commit is contained in:

committed by
Pfauenauge90
parent
73a29b339c
commit
c65967ccdb
@ -1,5 +1,5 @@
|
||||
use crate::path::Chaser;
|
||||
use specs::{Component, Entity as EcsEntity};
|
||||
use crate::{path::Chaser, state::Time};
|
||||
use specs::{Component, Entity as EcsEntity, FlaggedStorage, HashMapStorage};
|
||||
use specs_idvs::IDVStorage;
|
||||
use vek::*;
|
||||
|
||||
@ -85,3 +85,17 @@ impl Activity {
|
||||
impl Default for Activity {
|
||||
fn default() -> Self { Activity::Idle(Vec2::zero()) }
|
||||
}
|
||||
|
||||
/// Default duration in seconds of chat bubbles
|
||||
pub const SPEECH_BUBBLE_DURATION: f64 = 5.0;
|
||||
|
||||
/// Adds a speech bubble to the entity
|
||||
#[derive(Clone, Default, Debug, Serialize, Deserialize)]
|
||||
pub struct SpeechBubble {
|
||||
pub message: String,
|
||||
pub timeout: Option<Time>,
|
||||
// TODO add icon enum for player chat type / npc quest+trade
|
||||
}
|
||||
impl Component for SpeechBubble {
|
||||
type Storage = FlaggedStorage<Self, HashMapStorage<Self>>;
|
||||
}
|
||||
|
Reference in New Issue
Block a user