- 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.
globalFishCounts ={}, -- Global fish counts across sessions
totalFishCaught =0-- Total fish caught across sessions
}
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:
--Somewhere at the top e.g. replace the line FishLog_SavedVariables = FishLog_SavedVariables or { with
local defaultSV ={
globalFishCounts ={}, -- Global fish counts across sessions
totalFishCaught =0-- Total fish caught across sessions
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