Skip to content

Commit

Permalink
perf: wheel (opentibiabr#3157)
Browse files Browse the repository at this point in the history
Fixes performance issues in the wheel ui, also add the disable of the apply button when the changes be applied and some functions calling order.
  • Loading branch information
phacUFPE authored and vllworldbuilding committed Jan 10, 2025
1 parent 2d5483b commit 2b069e4
Show file tree
Hide file tree
Showing 9 changed files with 340 additions and 179 deletions.
4 changes: 1 addition & 3 deletions data/scripts/actions/items/wheel_scrolls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ function scroll.onUse(player, item, fromPosition, target, toPosition, isHotkey)
end

local scrollData = promotionScrolls[item:getId()]
local scrollKV = player:kv():scoped("wheel-of-destiny"):scoped("scrolls")
if scrollKV:get(scrollData.name) then
if not player:wheelUnlockScroll(scrollData.name) then
player:sendTextMessage(MESSAGE_LOOK, "You have already deciphered this scroll.")
return true
end

scrollKV:set(scrollData.name, true)
player:sendTextMessage(MESSAGE_LOOK, "You have gained " .. scrollData.points .. " promotion points for the Wheel of Destiny by deciphering the " .. scrollData.itemName .. ".")
item:remove(1)
return true
Expand Down
Loading

0 comments on commit 2b069e4

Please sign in to comment.