This commit is contained in:
@@ -37,6 +37,13 @@ namespace game::state::main
|
||||
|
||||
auto isImguiCaptureMouse = ImGui::GetIO().WantCaptureMouse;
|
||||
|
||||
auto isItemsLocked = character.isStageUp;
|
||||
|
||||
if (isItemsLocked)
|
||||
{
|
||||
heldItemIndex = -1;
|
||||
}
|
||||
|
||||
auto isMouseLeftClicked = ImGui::IsMouseClicked(ImGuiMouseButton_Left);
|
||||
auto isMouseLeftDown = ImGui::IsMouseDown(ImGuiMouseButton_Left);
|
||||
auto isMouseLeftReleased = ImGui::IsMouseReleased(ImGuiMouseButton_Left);
|
||||
@@ -54,7 +61,7 @@ namespace game::state::main
|
||||
if (isJustItemHeldStopped || isJustItemThrown)
|
||||
{
|
||||
cursor.queue_default_animation();
|
||||
if (!isJustItemThrown) character.queue_idle_animation();
|
||||
if (!isJustItemThrown && !isItemsLocked) character.queue_idle_animation();
|
||||
isJustItemHeldStopped = false;
|
||||
isJustItemThrown = false;
|
||||
}
|
||||
@@ -115,10 +122,10 @@ namespace game::state::main
|
||||
|
||||
auto rect = character.null_frame_rect(eatArea.nullID);
|
||||
|
||||
if (isCanEat && math::is_point_in_rectf(rect, heldItem->position))
|
||||
if (isCanEat && math::is_point_in_rectf(rect, heldItem->position) && !isItemsLocked)
|
||||
{
|
||||
character.queue_play(
|
||||
{.animation = eatArea.animation, .speedMultiplier = character.eatSpeed, .isInterruptible = false});
|
||||
{.animation = eatArea.animation, .speedMultiplier = character.eatSpeed});
|
||||
|
||||
if (character.playedEventID == eatArea.eventID)
|
||||
{
|
||||
@@ -206,7 +213,7 @@ namespace game::state::main
|
||||
|
||||
item.update();
|
||||
|
||||
if (math::is_point_in_rectf(item.rect(), cursorPosition) && !isImguiCaptureMouse)
|
||||
if (math::is_point_in_rectf(item.rect(), cursorPosition) && !isImguiCaptureMouse && !isItemsLocked)
|
||||
{
|
||||
isItemHovered = true;
|
||||
cursor.queue_play({cursorSchema.animations.hover.get()});
|
||||
|
||||
Reference in New Issue
Block a user