nihilistzsche / RematchElvUISkin

0 stars 2 forks source link

LUA 605 #5

Open Fleymour opened 11 months ago

Fleymour commented 11 months ago

720x RematchElvUISkin/RematchElvUISkin.lua:605: attempt to call method 'ShowDialog' (a nil value) [string "@RematchElvUISkin/RematchElvUISkin.lua"]:605: in function <RematchElvUISkin/RematchElvUISkin.lua:599>

Locals: self = Frame { 0 = } event = "PLAYER_LOGIN" majorVersion = 5 minorVersion = 0 (temporary) = nil (temporary) =

{ panelTabs = Frame { } menus =
{ } petInfo =
{ } battle =
{ } teamStrings =
{ } petCard = RematchPetCard { } allIcons =
{ } debug =
{ } layout =
{ } targetsPanel = Frame { } petMenu =
{ } petFilterMenu =
{ } teamMenu =
{ } dialog = RematchDialog { } tooltipManager =
{ } interact =
{ } abilityTooltip = RematchAbilityTooltip { } textureHighlight =
{ } roster =
{ } loadoutPanel = Frame { } petCardStats =
{ } textureDrag =
{ } speciesInfo =
{ } breedInfo =
{ } loadedTeamPanel = Frame { } events =
{ } targetData =
{ } savedTeams =
{ } utils =
{ } altInfo =
{ } send =
{ } importDialog =
{ } targetMenu =
{ } convert =
{ } saveDialog =
{ } loadedTargetPanel = Frame { } filters =
{ } queueMenu =
{ } bottombar = Frame { } savedGroups =
{ } toolbar = Frame { } loadTeam =
{ } savedTargets =
{ } collectionInfo =
{ } localization =
{ } rebuild =
{ } winrecord =
{ } optionsPanel = Frame { } queue =
{ } randomPets =
{ } scriptFilter =
{ } preferences =
{ } dragFrame = RematchDragFrame { } petTags =
{ } badges =
{ } minimap = RematchMinimapButton { } targetInfo =
{ } loadouts =
{ } settings =
{ } cardManager =
{ } toast =
{ } tooltip =
{ } teamsPanel = Frame { } teamTabs = Frame { } frame = RematchFrame { } notes = RematchNotesCard { } summaryDialog =
{ } timer =
{ } odTable =
{ } optionsList =
{ } journal =
{ } loadoutMenu =
{ } queuePanel = Frame { } dropdown =
{ } petsPanel = Frame { } miniLoadoutPanel = Frame { } constants =
{ } sort =
{ } titlebar = Frame { } main =
{ } } (temporary) = "CantElvUISkin" (temporary) = 300 (temporary) = 164 (temporary) = "Rematch Needs Updated" (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = "Okay" (*temporary) = "attempt to call method 'ShowDialog' (a nil value)" rematch =
{ panelTabs = Frame { } menus =
{ } petInfo =
{ } battle =
{ } teamStrings =
{ } petCard = RematchPetCard { } allIcons =
{ } debug =
{ } layout =
{ } targetsPanel = Frame { } petMenu =
{ } petFilterMenu =
{ } teamMenu =
{ } dialog = RematchDialog { } tooltipManager =
{ } interact =
{ } abilityTooltip = RematchAbilityTooltip { } textureHighlight =
{ } roster =
{ } loadoutPanel = Frame { } petCardStats =
{ } textureDrag =
{ } speciesInfo =
{ } breedInfo =
{ } loadedTeamPanel = Frame { } events =
{ } targetData =
{ } savedTeams =
{ } utils =
{ } altInfo =
{ } send =
{ } importDialog =
{ } targetMenu =
{ } convert =
{ } saveDialog =
{ } loadedTargetPanel = Frame { } filters =
{ } queueMenu =
{ } bottombar = Frame { } savedGroups =
{ } toolbar = Frame { } loadTeam =
{ } savedTargets =
{ } collectionInfo =
{ } localization =
{ } rebuild =
{ } winrecord =
{ } optionsPanel = Frame { } queue =
{ } randomPets =
{ } scriptFilter =
{ } preferences =
{ } dragFrame = RematchDragFrame { } petTags =
{ } badges =
{ } minimap = RematchMinimapButton { } targetInfo =
{ } loadouts =
{ } settings = <t

fubaWoW commented 11 months ago

to for this error, replace this function:

local f = CreateFrame("Frame")
f:SetScript("OnEvent", function(self, event, ...)
    rematch = Rematch
    local majorVersion, minorVersion = (GetAddOnMetadata("Rematch", "Version") or ""):match("^(%d+)%.(%d+)")
    if majorVersion then -- keeping this so dialog appears when Rematch 5.0 eventually released
        majorVersion, minorVersion = tonumber(majorVersion), tonumber(minorVersion)
        if majorVersion < 4 or majorVersion > 4 or (majorVersion == 4 and minorVersion < 3) then
            local dialog = rematch:ShowDialog("CantElvUISkin", 300, 164, "Rematch Needs Updated", nil, nil, nil, OKAY)
            dialog:ShowText(
                format(
                    "This version of Rematch ElvUI Skin supports Rematch version 4.3 through 4.9.\n\nYour Rematch is version %d.%d",
                    majorVersion,
                    minorVersion
                ),
                260,
                96,
                "TOP",
                0,
                -32
            )
            return
        else
            C_Timer.After(0, function()
                -- wait a frame for rematch to do its initialization
                if rematch.isLoaded and not self.skinDone then
                    for panel, func in pairs(skin.panels) do
                        func(rematch[panel])
                    end
                    for _, func in pairs(skin.misc) do
                        func()
                    end
                    self.skinDone = true
                    self:UnregisterAllEvents()
                end
            end)
        end
    end
end)

with this function:

local f = CreateFrame("Frame")
f:SetScript("OnEvent", function(self, event, ...)
    rematch = _G.Rematch
    local majorVersion, minorVersion = (GetAddOnMetadata("Rematch", "Version") or ""):match("^(%d+)%.(%d+)")
    if majorVersion then -- keeping this so dialog appears when Rematch 5.0 eventually released
        majorVersion, minorVersion = tonumber(majorVersion), tonumber(minorVersion)
        if majorVersion < 4 or majorVersion > 4 or (majorVersion == 4 and minorVersion < 3) then

            local CantElvUISkinDialog = {
                title = "Rematch Needs Updated",
                accept = OKAY,
                width = 260,
                height = 96,
                layout = {"Feedback","Text"},
                refreshFunc = function(self,info,subject)
                        self.Feedback:Set("warning","Rematch Version not supported!")
                        self.Text:SetText(format("This version of Rematch ElvUI Skin supports Rematch version 4.3 through 5.0.\n\nYour Rematch is version %d.%d", majorVersion, minorVersion))

                end
            }
            rematch.dialog:Register("CantElvUISkin",CantElvUISkinDialog)                        
            rematch.dialog:ShowDialog("CantElvUISkin");
        else
            C_Timer.After(0, function()
                -- wait a frame for rematch to do its initialization
                if rematch.isLoaded and not self.skinDone then
                    for panel, func in pairs(skin.panels) do
                        func(rematch[panel])
                    end
                    for _, func in pairs(skin.misc) do
                        func()
                    end
                    self.skinDone = true
                    self:UnregisterAllEvents()
                end
            end)
        end
    end
end)

!!! - BUT - !!!

It will just Fix the "Outdate" Dialog and prevent the DialogBox Error! This will NOT Fix the AddOn itself!

Seems the AddOn needs a "deeper" review as of some changes in Rematch 5.0?

Means -> For now, just Disable the AddOn and wait for "proper" Update!