Fix prop renders

* Incorporate prop scaling
* Props now render to a canvas
This commit is contained in:
Evan Carroll 2026-01-23 16:00:47 -06:00
parent af89394df1
commit a2841c413d
21 changed files with 942 additions and 353 deletions

View file

@ -48,6 +48,7 @@ pub async fn get_server_prop_by_id<'e>(
default_layer,
default_emotion,
default_position,
default_scale,
is_unique,
is_transferable,
is_portable,
@ -116,20 +117,23 @@ pub async fn create_server_prop<'e>(
let is_droppable = req.droppable.unwrap_or(true);
let is_public = req.public.unwrap_or(false);
let default_scale = req.default_scale.unwrap_or(1.0);
let prop = sqlx::query_as::<_, ServerProp>(
r#"
INSERT INTO server.props (
name, slug, description, tags, asset_path,
default_layer, default_emotion, default_position,
default_scale,
is_droppable, is_public,
created_by
)
VALUES (
$1, $2, $3, $4, $5,
$6::server.avatar_layer, $7::server.emotion_state, $8,
$9, $10,
$11
$9,
$10, $11,
$12
)
RETURNING
id,
@ -142,6 +146,7 @@ pub async fn create_server_prop<'e>(
default_layer,
default_emotion,
default_position,
default_scale,
is_unique,
is_transferable,
is_portable,
@ -163,6 +168,7 @@ pub async fn create_server_prop<'e>(
.bind(&default_layer)
.bind(&default_emotion)
.bind(default_position)
.bind(default_scale)
.bind(is_droppable)
.bind(is_public)
.bind(created_by)
@ -207,20 +213,23 @@ pub async fn upsert_server_prop<'e>(
let is_droppable = req.droppable.unwrap_or(true);
let is_public = req.public.unwrap_or(false);
let default_scale = req.default_scale.unwrap_or(1.0);
let prop = sqlx::query_as::<_, ServerProp>(
r#"
INSERT INTO server.props (
name, slug, description, tags, asset_path,
default_layer, default_emotion, default_position,
default_scale,
is_droppable, is_public,
created_by
)
VALUES (
$1, $2, $3, $4, $5,
$6::server.avatar_layer, $7::server.emotion_state, $8,
$9, $10,
$11
$9,
$10, $11,
$12
)
ON CONFLICT (slug) DO UPDATE SET
name = EXCLUDED.name,
@ -230,6 +239,7 @@ pub async fn upsert_server_prop<'e>(
default_layer = EXCLUDED.default_layer,
default_emotion = EXCLUDED.default_emotion,
default_position = EXCLUDED.default_position,
default_scale = EXCLUDED.default_scale,
is_droppable = EXCLUDED.is_droppable,
is_public = EXCLUDED.is_public,
updated_at = now()
@ -244,6 +254,7 @@ pub async fn upsert_server_prop<'e>(
default_layer,
default_emotion,
default_position,
default_scale,
is_unique,
is_transferable,
is_portable,
@ -265,6 +276,7 @@ pub async fn upsert_server_prop<'e>(
.bind(&default_layer)
.bind(&default_emotion)
.bind(default_position)
.bind(default_scale)
.bind(is_droppable)
.bind(is_public)
.bind(created_by)