Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LUA Error on Mouseover Faction Reputation Tokens at the Command Board #36

Open
fubaWoW opened this issue Nov 17, 2024 · 0 comments
Open

Comments

@fubaWoW
Copy link

fubaWoW commented Nov 17, 2024

Hi there,

The following Error occurs when Mouseover "Faction Reputation Tokens" at the Command Board:

11x OrderHallCommander/missionlist.lua:321: attempt to call global 'GetFactionInfoByID' (a nil value)
[string "@OrderHallCommander/missionlist.lua"]:321: in function <OrderHallCommander/missionlist.lua:313>
[string "=(tail call)"]: ?
[string "=[C]"]: ?

Locals:
self = <table> {
 modules = <table> {
 }
 enabledState = true
 defaultModuleLibraries = <table> {
 }
 baseName = "OrderHallCommander"
 orderedModules = <table> {
 }
 hooks = <table> {
 }
 defaultModuleState = true
 name = "OrderHallCommander_Missionlist"
 moduleName = "Missionlist"
}
this = Frame {
 Quantity = FontString {
 }
 itemID = 146950
 IconBorder = Texture {
 }
 IconOverlay = Texture {
 }
 itemLink = "|cff0070dd|Hitem:146950::::::::80:253:::::::::|h[Legionfall Insignia]|h|r"
 Icon = Texture {
 }
}
tip = GameTooltip {
 ItemTooltip = Frame {
 }
 AllTheThingsOnTooltipClearedHook = true
 shadow = Frame {
 }
 BottomOverlay = Texture {
 }
 NineSlice = Frame {
 }
 textLeft1Font = "GameTooltipHeaderText"
 hasMoney = 1
 textRight2Font = "GameTooltipText"
 windInspectLoaded = false
 TopOverlay = Texture {
 }
 TextLeft1 = GameTooltipTextLeft1 {
 }
 StatusBar = GameTooltipStatusBar {
 }
 __windShadow = 1
 ARKTTD = <table> {
 }
 numMoneyFrames = 2
 PixelSnapDisabled = true
 shouldRefreshData = false
 processingInfo = <table> {
 }
 infoList = <table> {
 }
 supportsDataRefresh = true
 CIMI_tooltipWritten = false
 petIcon = Texture {
 }
 factionFrame = Texture {
 }
 waitingForData = false
 shoppingTooltips = <table> {
 }
 updateTooltipTimer = 0.162000
 TextRight1 = GameTooltipTextRight1 {
 }
 supportsItemComparison = true
 textRight1Font = "GameTooltipHeaderText"
 layoutType = "TooltipDefaultLayout"
 textLeft2Font = "GameTooltipText"
 TextRight2 = GameTooltipTextRight2 {
 }
 TextLeft2 = GameTooltipTextLeft2 {
 }
}
factionID = 2045
(*temporary) = nil
(*temporary) = 2045
(*temporary) = "attempt to call global 'GetFactionInfoByID' (a nil value)"
addon = <table> {
 modules = <table> {
 }
 allEquipments = <table> {
 }
 hooks = <table> {
 }
 db = <table> {
 }
 revision = "962c914"
 name = "OrderHallCommander"
 defaultModuleState = true
 resourceFormat = "Cost: %d"
 CfgRel = 146
 ProfileOpts = <table> {
 }
 lastsection = "Release Notes"
 help = <table> {
 }
 prettyversion = "2.5.0 (Revision: 962c914)"
 version = "2.5.0"
 ItemOrder = <table> {
 }
 enabledState = true
 allReputationGain = <table> {
 }
 DbDefaults = <table> {
 }
 OptionsTable = <table> {
 }
 numericversion = 0
 _Apply = <table> {
 }
 baseName = "OrderHallCommander"
 MenuLevels = <table> {
 }
 allArtifactPower = <table> {
 }
 wowhead_update = 1512310641
 CfgDlg = "OrderHallCommander"
 defaultModuleLibraries = <table> {
 }
 die = false
 orderedModules = <table> {
 }
 lastChange = 238177.879000
}
artinfo = "*Artifact shown value is the base value without considering knowledge multiplier"
C = <table> {
 silver = <table> {
 }
 cyan = <table> {
 }
 grey = <table> {
 }
 azure = <table> {
 }
 white = <table> {
 }
 green = <table> {
 }
 epic = <table> {
 }
 yellow = <table> {
 }
 orange = <table> {
 }
 red = <table> {
 }
}

To fix it, replace in missionlist.lua the function function module:RewardWarning(this) with this one:

function module:RewardWarning(this)
	if this.itemID  then
		local tip=GameTooltip
		if addon.allArtifactPower[this.itemID] then
			tip:AddLine(artinfo,C.Artifact())
		end
		local factionID=addon.allReputationGain[this.itemID]
		if factionID then
		  local factiondata = C_Reputation.GetFactionDataByID(factionID)		  
		  if factiondata and factiondata.name and factiondata.reaction then
			local faction = factiondata.name
		    local level = _G['FACTION_STANDING_LABEL' .. factiondata.reaction]
		    tip:AddLine(FACTION_STANDING_CHANGED:format(C(level,"GREEN"),C(faction,"GREEN")),C.Orange())
		  end
    end
		tip:AddLine(safeformat(L["%s for a wowhead link popup"],SHIFT_KEY_TEXT .. KEY_BUTTON1))
		tip:Show()
	end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant