diff --git a/resources/[jobs]/[civ]/wasabi_fishing/client/client.lua b/resources/[jobs]/[civ]/wasabi_fishing/client/client.lua index cd99c1856..ddccb7a3d 100644 --- a/resources/[jobs]/[civ]/wasabi_fishing/client/client.lua +++ b/resources/[jobs]/[civ]/wasabi_fishing/client/client.lua @@ -51,6 +51,7 @@ if Config.sellShop.enabled then end) end +-- Function to select bait from available options -- Function to select bait from available options local function SelectBait() local availableBaits = {} @@ -72,46 +73,26 @@ local function SelectBait() return availableBaits[1] end - -- Create a menu for bait selection using lib.registerMenu instead - local options = {} - for _, bait in pairs(availableBaits) do - table.insert(options, { - title = bait.label, - description = 'Catch Bonus: +' .. bait.catchBonus .. '% | Loss Chance: ' .. bait.loseChance .. '%' - }) + -- Create a notification about available baits + local baitNames = "" + for i, bait in ipairs(availableBaits) do + if i > 1 then baitNames = baitNames .. ", " end + baitNames = baitNames .. bait.label end - local selectedBait = nil + TriggerEvent('wasabi_fishing:notify', 'Available Baits', 'You have: ' .. baitNames, 'inform') - lib.registerMenu({ - id = 'bait_selection_menu', - title = 'Select Fishing Bait', - position = 'top-right', - options = options, - onSelect = function(selected) - selectedBait = availableBaits[selected] - end, - onClose = function() - -- Do nothing, selectedBait will remain nil - end - }) + -- Just use the best bait available (highest catch bonus) + table.sort(availableBaits, function(a, b) + return a.catchBonus > b.catchBonus + end) - lib.showMenu('bait_selection_menu') - - -- Wait for selection with a timeout - local startTime = GetGameTimer() - while selectedBait == nil do - Wait(100) - -- Timeout after 15 seconds - if GetGameTimer() - startTime > 15000 then - return availableBaits[1] -- Default to first bait if no selection - end - end - - return selectedBait + TriggerEvent('wasabi_fishing:notify', 'Selected Bait', 'Using ' .. availableBaits[1].label .. ' (best available)', 'inform') + return availableBaits[1] end + -- Function to handle the fishing process local function StartFishingProcess(selectedBait, waterLoc) fishing = true