Thread Tools Display Modes
02-25-24, 08:32 AM   #1
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,909
addon.Texts can go in the same file as addon.db as that seems to be where you're putting "data". Assuming that this file is listed in the .TOC file above the other (table.lua) file so it loads first.

Lua Code:
  1. Pets:SetText(addon.Texts.Rewards[GetLocal()] or addon.Texts.Rewards.enUS) -- enUS being the default is the GetLocale() entry doesn't exist.

Goes after you've:
Lua Code:
  1. local Pets = someframe:CreateFontString(nil, somedrawlayer, somefont)

You can't fontstring:SetText(...) on a FontString that doesn't exist.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 02-25-24 at 11:32 AM.
  Reply With Quote
02-25-24, 10:55 PM   #2
Hubb777
A Flamescale Wyrmkin
 
Hubb777's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2024
Posts: 131
Originally Posted by Fizzlemizz View Post
addon.Texts can go in the same file as addon.db as that seems to be where you're putting "data". Assuming that this file is listed in the .TOC file above the other (table.lua) file so it loads first.

Lua Code:
  1. Pets:SetText(addon.Texts.Rewards[GetLocal()] or addon.Texts.Rewards.enUS) -- enUS being the default is the GetLocale() entry doesn't exist.

Goes after you've:
Lua Code:
  1. local Pets = someframe:CreateFontString(nil, somedrawlayer, somefont)

You can't fontstring:SetText(...) on a FontString that doesn't exist.
This is the code I got
Lua Code:
  1. local Pets = someframe:CreateFontString(nil, somedrawlayer, somefont)
  2. Pets:SetText(addon.Texts.Rewards[GetLocal()] or addon.Texts.Rewards.enUS)
  3. addon.Texts = {
  4.     Rewards = {
  5.         enUS = "Possible Rewards",
  6.         deDE = "German for Possible Rewards",
  7.     },
  8.     Pets = {
  9.         enUS = "List of pets",
  10.         deDE = "German List of pets",
  11.     },
  12. }
Wherever I insert it, either the button disappears or it cannot be pressed. And if everything is pressed, there is no result.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Save location via SavedVariables

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off