Initial copy of business card prop with profile
This commit is contained in:
parent
4f0f88504a
commit
9541fb1927
16 changed files with 1193 additions and 71 deletions
|
|
@ -62,6 +62,7 @@ pub fn RealmSceneViewer(
|
|||
#[prop(optional, into)] on_prop_move: Option<Callback<(Uuid, f64, f64)>>,
|
||||
#[prop(optional, into)] on_prop_lock_toggle: Option<Callback<(Uuid, bool)>>,
|
||||
#[prop(optional, into)] on_prop_delete: Option<Callback<Uuid>>,
|
||||
#[prop(optional, into)] on_view_prop_state: Option<Callback<Uuid>>,
|
||||
) -> impl IntoView {
|
||||
let is_guest = is_guest.unwrap_or_else(|| Signal::derive(|| false));
|
||||
let settings = settings.unwrap_or_else(|| Signal::derive(ViewerSettings::default));
|
||||
|
|
@ -608,6 +609,8 @@ pub fn RealmSceneViewer(
|
|||
let is_mod = is_moderator.map(|s| s.get()).unwrap_or(false);
|
||||
let is_locked = prop_context_is_locked.get();
|
||||
let mut items = Vec::new();
|
||||
// Always show View Info for props (to view state/business cards)
|
||||
items.push(ContextMenuItem { label: "View Info".to_string(), action: "view_info".to_string() });
|
||||
if !is_locked || is_mod {
|
||||
items.push(ContextMenuItem { label: "Pick Up".to_string(), action: "pick_up".to_string() });
|
||||
items.push(ContextMenuItem { label: "Move".to_string(), action: "move".to_string() });
|
||||
|
|
@ -626,8 +629,16 @@ pub fn RealmSceneViewer(
|
|||
let on_prop_lock_toggle = on_prop_lock_toggle.clone();
|
||||
let on_prop_click = on_prop_click.clone();
|
||||
let on_prop_delete = on_prop_delete.clone();
|
||||
let on_view_prop_state = on_view_prop_state.clone();
|
||||
move |action: String| {
|
||||
match action.as_str() {
|
||||
"view_info" => {
|
||||
if let Some(prop_id) = prop_context_menu_target.get() {
|
||||
if let Some(ref callback) = on_view_prop_state {
|
||||
callback.run(prop_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
"pick_up" => {
|
||||
if let Some(prop_id) = prop_context_menu_target.get() {
|
||||
on_prop_click.run(prop_id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue