Chatting now creates speech bubbles

This commit is contained in:
CapsizeGlimmer
2020-05-24 18:18:41 -04:00
committed by Pfauenauge90
parent 73a29b339c
commit c65967ccdb
11 changed files with 184 additions and 97 deletions

View File

@ -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>>;
}