Download
(7 Kb)
Download
Updated: 07/14/24 03:45 AM
Pictures
File Info
Compatibility:
Gold Road (10.0.0)
Updated:07/14/24 03:45 AM
Created:07/14/24 03:45 AM
Monthly downloads:24
Total downloads:31
Favorites:1
MD5:
10.0.0
Fish Log  Less than 3 days old!
Version: 1.1
by: Adeptus333 [More]
A fish tracking add-on that displays metrics:

- Announces catches in the chat log.
- Shows how many fish have been caught since install, over sessions.
- Shows how many fish have been caught in the current session.
- How long you've been fishing.
- Etc.

Commands include:

- '/fishlog'
- '/fishlogglobal'
- '/fishstats'
Optional Files (0)


Post A Reply Comment Options
Unread Yesterday, 05:06 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 5098
File comments: 6181
Uploads: 78
Hi welcome to ESO addon development.
Please remove any hidden files and folders from your zip file prior to uploading it:
.idea/

IntelliJ IDEA project files

You can upload the same version and cleaned zip again by enabling the checkbox "ignore version" and unchecking the checkbox "archive file"


Edit:
This is wrong!
Lua Code:
  1. FishLog_SavedVariables = FishLog_SavedVariables or {
  2.     globalFishCounts = {},  -- Global fish counts across sessions
  3.     totalFishCaught = 0  -- Total fish caught across sessions
  4. }

1st FishLog_SavedVariables is not available prior to your addon's EVENT_ADD_ON_LOADED so this will always be nil and create the table with your contents there.
2nd If you want to set default values to the table do that after EVENT_ADD_ON_LOADED either via ZO_SavedVars wrapper or manually as you do not seem to be using ZO_SavedVars warapper

e.g.
Lua Code:
  1. --Somewhere at the top e.g. replace the line FishLog_SavedVariables = FishLog_SavedVariables or { with
  2. local defaultSV = {
  3.     globalFishCounts = {},  -- Global fish counts across sessions
  4.     totalFishCaught = 0  -- Total fish caught across sessions
  5. }
  6.  
  7. --At your EVENT_ADD_ON_LOADED:
  8. function FishLog.OnAddOnLoaded(event, addonName)
  9.     if addonName == FishLog.name then
  10.         EVENT_MANAGER:UnregisterForEvent(FishLog.name, EVENT_ADD_ON_LOADED)
  11.  
  12.         if ZO_IsTableEmpty(FishLog_SavedVariables) then
  13.             FishLog_SavedVariables = defaultSV
  14.         end
  15.        
  16.         EVENT_MANAGER:RegisterForEvent(FishLog.name, EVENT_PLAYER_ACTIVATED, FishLog.StartNewSession)
  17.         EVENT_MANAGER:RegisterForEvent(FishLog.name, EVENT_INVENTORY_SINGLE_SLOT_UPDATE, FishLog.OnInventoryUpdate)
  18.         EVENT_MANAGER:RegisterForEvent(FishLog.name, EVENT_FISHING_LURE_SET, FishLog.OnBaitSet)
  19.        
  20.         SLASH_COMMANDS["/fishlog"] = FishLog.ShowFishLog
  21.         SLASH_COMMANDS["/fishlogglobal"] = FishLog.ShowFishLogGlobal
  22.         SLASH_COMMANDS["/fishstats"] = FishLog.ShowStats
  23.     end
  24. end

Also PLEASE do not create global functions like dee (too short and non unique name!)
Make them local OR add your addon name in front like FishLog_dee or better add it to your table FishLog
like function FishLog.dee() ... end
local dee = FishLog.dee



As your addon only seems to support English language please add that to your description so ppl do not install it if they think it supports any other ESO official language like German, French, Spanish, Russian or Chinese too.

btw: Your SavedVariables currently will be the same on EU and NA and PTS server! So beware, you will be overwriting them...
And you do not track ANY @accountname in your savedvars!!! So any accountwill overwrite the other :-(

You really should use ZO_SavedVars:NewAccountWide wrapper to make the SV account and maybe even server dependent via GetWorldName() function like explained here:
https://wiki.esoui.com/Storing_data_and_accessing_files

Thank you
Last edited by Baertram : 07/14/24 at 06:29 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: