View Single Post
02-25-24, 10:55 PM   #48
Hubb777
A Flamescale Wyrmkin
 
Hubb777's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2024
Posts: 122
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