From ac51afa63f7021edacc08b0102071f34fcba96bc Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Mon, 28 Feb 2022 20:34:53 -0600 Subject: [PATCH] i don't know how to spell --- run_tree/scenes/quick_save_new.scene | 4 +-- .../components/{patreon.onyx => patron.onyx} | 30 +++++++++---------- .../schematics/{patreon.onyx => patron.onyx} | 6 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) rename src/entity/components/{patreon.onyx => patron.onyx} (82%) rename src/entity/schematics/{patreon.onyx => patron.onyx} (81%) diff --git a/run_tree/scenes/quick_save_new.scene b/run_tree/scenes/quick_save_new.scene index 1884503..829da2f 100644 --- a/run_tree/scenes/quick_save_new.scene +++ b/run_tree/scenes/quick_save_new.scene @@ -119,7 +119,7 @@ color.a = 1.0000 item = "beer" max_timeout = 2.0000 -[Patreon] +[Patron] id = 22 flags = 3 pos.x = 388.6049 @@ -132,7 +132,7 @@ color.r = 1.0000 color.g = 0.0000 color.b = 0.0000 color.a = 1.0000 -:PatreonComponent +:PatronComponent state = 0 seat_location.x = 400.0000 seat_location.y = 400.0000 diff --git a/src/entity/components/patreon.onyx b/src/entity/components/patron.onyx similarity index 82% rename from src/entity/components/patreon.onyx rename to src/entity/components/patron.onyx index 4f35f82..184f2a4 100644 --- a/src/entity/components/patreon.onyx +++ b/src/entity/components/patron.onyx @@ -1,7 +1,7 @@ use package core -#local Patreon_State :: enum { +#local Patron_State :: enum { Walking_To_Seat; Waiting_To_Place_Order; Waiting_For_Order; @@ -9,22 +9,22 @@ use package core Leaving; } -PatreonComponent :: struct { +PatronComponent :: struct { use component: Component; - state := Patreon_State.Waiting_To_Place_Order; + state := Patron_State.Waiting_To_Place_Order; seat_location: Vector2; order_item: str; order_show_animation: f32; holding: Entity_ID; consume_timeout: f32; - init :: (use this: ^PatreonComponent) { + init :: (use this: ^PatronComponent) { order_item = "beer"; seat_location = .{ 400, 400 }; } - added :: (use this: ^PatreonComponent, entity: ^Entity) { + added :: (use this: ^PatronComponent, entity: ^Entity) { entity.flags |= .Interactable; scene->create_and_add(entity, InteractableComponent) { @@ -32,7 +32,7 @@ PatreonComponent :: struct { } } - update :: (use this: ^PatreonComponent, entity: ^Entity, dt: f32) { + update :: (use this: ^PatronComponent, entity: ^Entity, dt: f32) { if state == .Walking_To_Seat { delta := Vector2.norm(seat_location - entity.pos) * 100; entity.pos += delta * dt; @@ -68,13 +68,13 @@ PatreonComponent :: struct { } interact :: (entity: ^Entity, interactor: ^Entity) { - patreon := entity->get(PatreonComponent); + patron := entity->get(PatronComponent); - switch patreon.state { + switch patron.state { case .Waiting_To_Place_Order { if interactor->has(PlayerComponent) { - patreon.state = .Waiting_For_Order; - patreon.order_show_animation = 1.0f; + patron.state = .Waiting_For_Order; + patron.order_show_animation = 1.0f; } } @@ -84,10 +84,10 @@ PatreonComponent :: struct { if player_comp.holding == Entity_Nothing do return; if item := scene->get(player_comp.holding); item->has(ItemComponent) { item_comp := item->get(ItemComponent); - if item_comp.item == patreon.order_item { - patreon.state = .Consuming_Order; - patreon.consume_timeout = 10; - patreon.holding = player_comp.holding; + if item_comp.item == patron.order_item { + patron.state = .Consuming_Order; + patron.consume_timeout = 10; + patron.holding = player_comp.holding; player_comp.holding = Entity_Nothing; } } @@ -95,7 +95,7 @@ PatreonComponent :: struct { } } - post_render :: (use this: ^PatreonComponent, entity: ^Entity) { + post_render :: (use this: ^PatronComponent, entity: ^Entity) { r := entity->get_rect(); r = Rect.{ r.x + (r.w - 24) / 2, r.y - r.h / 2 - 16, 24, 24 }; diff --git a/src/entity/schematics/patreon.onyx b/src/entity/schematics/patron.onyx similarity index 81% rename from src/entity/schematics/patreon.onyx rename to src/entity/schematics/patron.onyx index b83056f..f2aa238 100644 --- a/src/entity/schematics/patreon.onyx +++ b/src/entity/schematics/patron.onyx @@ -1,9 +1,9 @@ use package core -Patreon :: struct { +Patron :: struct { #struct_tag Entity_Schematic.{ - (scene) => Patreon.create(scene, .{0,0}) + (scene) => Patron.create(scene, .{0,0}) } create :: (scene: ^Entity_Manager, pos: Vector2) -> ^Entity { @@ -17,7 +17,7 @@ Patreon :: struct { comp.color = .{1, 0, 0}; } - scene->create_and_add(this, PatreonComponent) {} + scene->create_and_add(this, PatronComponent) {} return this; } -- 2.25.1