Kiatra / ChocolateBar

ChocolateBar is a World of Warcraft addons to display plugins in a bar on top or bottom of your screen
https://www.wowace.com/projects/chocolatebar
18 stars 9 forks source link

Compatibility with Plater #2

Closed Morketh closed 1 year ago

Morketh commented 4 years ago

I seem to be having a problem with Plater + Chocolate Bar. when i grab a broker with Plater turned on chocolate bar crashes and throws an error.

Date: 2020-01-21 21:41:08
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\ChocolateBar\Chocolate.lua line 325:
   Action[FrameMeasurement] failed because[Can't measure restricted regions]: attempted from: NamePlate1PlaterUnitFrame:GetPoint().
Debug:
   [string "=[C]"]: ?
   [string "=[C]"]: GetPoint()
   [string "@ChocolateBar\Chocolate.lua"]:325:
      ChocolateBar\Chocolate.lua:307
Locals:

AddOns:
  Swatter, v8.2.6511 (SwimmingSeadragon)
  MECsGarrisonResources, v1.5
  MECsOil, v1.5
  MECsTimeWarpedBadge, v1.1
  Accountant, v8.0.1.17
  Atlas, vv1.47.00
  AtlasBattlegrounds, vv1.46.00
  AtlasBurningCrusade, vv1.47.00
  AtlasCataclysm, vv1.47.00
  AtlasClassicWoW, vv1.47.00
  AtlasClassOrderHalls, vv1.47.00
  AtlasDungeonLocs, vv1.47.00
  AtlasLegion, vv1.47.00
  AtlasMistsofPandaria, vv1.47.00
  AtlasOutdoorRaids, vv1.47.01
  AtlasScenarios, vv1.44.00
  AtlasTransportation, vv1.47.00
  AtlasWarlordsofDraenor, vv1.47.00
  AtlasWorldEvents, vv3.26
  AtlasWrathoftheLichKing, vv1.47.00
  AtlasLoot, vv8.11.00
  AtlasLootBattleforAzeroth, vv8.11.00
  AtlasLootBurningCrusade, vv8.11.00
  AtlasLootCataclysm, vv8.11.00
  AtlasLootClassic, vv8.11.00
  AtlasLootLegion, vv8.11.00
  AtlasLootMistsofPandaria, vv8.11.00
  AtlasLootWarlordsofDraenor, vv8.11.00
  AtlasLootWrathoftheLichKing, vv8.11.00
  AutoReagentBank, v2
  AutoRepair, v
  BadPet, vv1.0.13
  BagBrother, v
  Bagnon, v8.3.1
  BagnonBoE, v1.0
  BagnonGarbage, v1.0
  BagnonItemLevel, v1.0
  Bartender4, v4.8.9
  BrokerDurabilityInfo, vv1.29
  BrokerEverything, v3.9.2-release
  BrokerEverythingConfig, v0.1
  BrokerAnything, vv1.13
  Carbonite, vv8.3.0.1
  CarboniteInfo, vv8.3.0.1
  CarboniteNotes, vv8.3.0.1
  CarboniteQuests, vv8.3.0.1
  CarboniteSocial, vv8.3.0.1
  CarboniteWeekly, vv8.3.0.1
  CarboniteTimelessIsleChests, v1.03
  CensusPlus, v8.0.
  ChocolateBar, vv3.3.3
  CursorCompanion, v
  GarrisonCommanderBroker, v3.2.4 1.1.0
  GatherMate2, v1.45.5
  GTFO, v4.52.1
  GuildRosterManager, v1.831
  GuildTithe, vrelease_v2.5.15
  HandyNotes, vv1.5.9
  HandyNotesBattleForAzerothTreasures, v1
  HandyNotesLegionTreasures, v1
  HandyNotesLorewalkers, v1
  HandyNotesLostAndFound, v1
  HandynotesPandaria, v1.3.1
  HandyNotesTreasureHunter, v1
  HealBotData, v8.3.0.0
  HealBoten, v8.3.0.0
  HealBotOptions, v8.3.0.0
  HunterPets, v1.5.34
  HunterPetsOwned, v1.1
  HunterPetsUI, v1
  idTip, v8.1.4
  junkdrop, vv1.1
  LibClassicDurations, v1.41
  LibDFramework10, v
  LootHistory, vv3.8
  Masque, v8.2.8
  MoveAnything, v17.1.0
  NPCScan, v8.0.1.13
  OPie, vWalnut 6
  Overachiever, v1.0.8
  OverachieverCache, v1.0.8
  PassLoot, v4.4
  PassLootItemScales, v1.1
  Pawn, v2.3.18
  PersonalLootHelper, v2.21
  Plater, v
  Prat30, v3.7.46
  Prat30Libraries, v
  Recount, vv8.3.0a
  Routes, vv1.6.3
  SexyReputation, v1.0.aa52f31dfabb035c34612971081e9b6745f96de5
  SlideBar, v8.2.6509 (SwimmingSeadragon)
  SYH, v
  TomTom, vv80300-1.1.0
  TradeSkillMaster, vv4.9.17
  TradeSkillMasterAppHelper, vv4.0.7
  TradeSkillMasterAuctionDB, vv3.1.20
  TradeSkillMasterAuctioning, vv3.0.17
  WowLua, vv80000-1.0.0
  BlizRuntimeLib_enUS v8.3.0.80300 <none>
  (ck=a9f)

EDIT: Forking Repo to see if i can figure it out.

Kiatra commented 4 years ago

Did you figure it out?

Caeldeth commented 4 years ago

With the updates from curseforge comments, attempting to move plugins throws this error:

1x ChocolateBar\DragAndDrop.lua:86: attempt to index upvalue 'focus' (a nil value)
[string "@ChocolateBar\DragAndDrop.lua"]:86: in function `Stop'
[string "@ChocolateBar\Chocolate.lua"]:347: in function <ChocolateBar\Chocolate.lua:341>

Locals:
self = <table> {
 Start = <function> defined @ChocolateBar\DragAndDrop.lua:67
 UnregisterFrame = <function> defined @ChocolateBar\DragAndDrop.lua:63
 Stop = <function> defined @ChocolateBar\DragAndDrop.lua:79
 RegisterFrame = <function> defined @ChocolateBar\DragAndDrop.lua:54
}
frame = ChocolateGallywix_Azerite_Ledger {
 BottomLeftCorner = <unnamed> {
 }
 OnBackdropLoaded = <function> defined @SharedXML\Backdrop.lua:205
 GetBackdropColor = <function> defined @SharedXML\Backdrop.lua:443
 SetBackdropBorderColor = <function> defined @SharedXML\Backdrop.lua:475
 icon = <unnamed> {
 }
 obj = <table> {
 }
 text = <unnamed> {
 }
 SetBackdrop = <function> defined @SharedXML\Backdrop.lua:382
 ClearBackdrop = <function> defined @SharedXML\Backdrop.lua:335
 GetBackdropBorderColor = <function> defined @SharedXML\Backdrop.lua:462
 GetBackdrop = <function> defined @SharedXML\Backdrop.lua:400
 bar = ChocolateBar1 {
 }
 SetBorderBlendMode = <function> defined @SharedXML\Backdrop.lua:319
 highlight = <function> defined @ChocolateBar\Chocolate.lua:355
 Update = <function> defined @ChocolateBar\Chocolate.lua:300
 isMoving = false
 settings = <table> {
 }
 OnBackdropSizeChanged = <function> defined @SharedXML\Backdrop.lua:235
 HasBackdropInfo = <function> defined @SharedXML\Backdrop.lua:331
 Center = <unnamed> {
 }
 RightEdge = <unnamed> {
 }
 GetEdgeSize = <function> defined @SharedXML\Backdrop.lua:241
 labelText = ""
 0 = <userdata>
 TopEdge = <unnamed> {
 }
 BottomEdge = <unnamed> {
 }
 name = "Gallywix_Azerite_Ledger"
 BottomRightCorner = <unnamed> {
 }
 TopRightCorner = <unnamed> {
 }
 TopLeftCorner = <unnamed> {
 }
 SetupTextureCoordinates = <function> defined @SharedXML\Backdrop.lua:267
 backdropInfo = <table> {
 }
 SetupPieceVisuals = <function> defined @SharedXML\Backdrop.lua:299
 SetBackdropColor = <function> defined @SharedXML\Backdrop.lua:452
 LeftEdge = <unnamed> {
 }
 ApplyBackdrop = <function> defined @SharedXML\Backdrop.lua:347
}
(*temporary) = nil
(*temporary) = nil
(*temporary) = "OnUpdate"
(*temporary) = nil
(*temporary) = <userdata>
(*temporary) = nil
(*temporary) = ChocolateBar2 {
 0 = <userdata>
 UpdateBar = <function> defined @ChocolateBar\Bar.lua:428
 tempHide = false
 GetFocus = <function> defined @ChocolateBar\Bar.lua:421
 OnBackdropLoaded = <function> defined @SharedXML\Backdrop.lua:205
 GetBackdropColor = <function> defined @SharedXML\Backdrop.lua:443
 autohide = false
 Drop = <function> defined @ChocolateBar\Bar.lua:394
 UpdateColors = <function> defined @ChocolateBar\Bar.lua:121
 SetBackdropBorderColor = <function> defined @SharedXML\Backdrop.lua:475
 UpdateStrata = <function> defined @ChocolateBar\Bar.lua:76
 New = <function> defined @ChocolateBar\Bar.lua:28
 EatChocolatePiece = <function> defined @ChocolateBar\Bar.lua:184
 chocoMostRight = ChocolateBroker_ProfessionsMenu {
 }
 chocolist = <table> {
 }
 ApplyBackdrop = <function> defined @SharedXML\Backdrop.lua:347
 SetBackdrop = <function> defined @SharedXML\Backdrop.lua:382
 ClearBackdrop = <function> defined @SharedXML\Backdrop.lua:335
 LoseFocus = <function> defined @ChocolateBar\Bar.lua:417
 GetBackdropBorderColor = <function> defined @SharedXML\Backdrop.lua:462
 GetBackdrop = <function> defined @SharedXML\Backdrop.lua:400
 listCenter = <table> {
 }
 chocoMostLeft = ChocolateScrap {
 }
 UpdateDragChocolate = <function> defined @ChocolateBar\Bar.lua:346
 SetBorderBlendMode = <function> defined @SharedXML\Backdrop.lua:319
 Center = <unnamed> {
 }
 RightEdge = <unnamed> {
 }
 UpdateScale = <function> defined @ChocolateBar\Bar.lua:105
 LeftEdge = <unnamed

Disabling plater and reloading allows plugin movement like normal. Accessing options from interface menu and toggling MoreChocolate brings the bars back, but they are do not respond to mouse clicks (things such as clock still update)

Daeveren commented 3 years ago

I was getting this error for a while and it drove me crazy not being able to move the plugins. Was not thinking it would not throw the error if I'd disable Plater, so glad I found this! So is this from ChocolateBar and can be fixed? Or should we open an issue on the Plater issue tracker?

alexandre-mckinnon commented 2 years ago

From what I gather, IsForbidden() is not always correct, or doing getpoints on some plater related frame would still cause taint error. My workaround was to remove the piece of code related to hide libqtip and libtablet tooltips in Chocolate.lua around line 328 to 340:

        OnLeave(frame)
        -- hide libqtip and libtablet tooltips
        -- local kids = {_G.UIParent:GetChildren()}
        -- for _, child in ipairs(kids) do
        --  if not child:IsForbidden() then
        --      for i = 1, child:GetNumPoints() do
        --          local _,relativeTo,_,_,_ = child:GetPoint(i)
        --          if relativeTo == frame then
        --              child:Hide()
        --          end
        --      end
        --  end
        -- end

It fixed the issue with plater in 9.2.7. It's probably causing a but for libqtip and libtablet, but I didn't see any issue (I might not have a addon to test that).

I also added some null check when bugsac reports something. Often there are problems during the loading screen, e.g. in Chocolate.lua around line 357:

ChocolateBar.dropFrames:Hide() changes to

if ChocolateBar.dropFrames ~= nil then
    ChocolateBar.dropFrames:Hide()
end
Kiatra commented 1 year ago

The ChocolateBar.dropFrames should never be nil. Seems the be the case due to another error.

As for hiding the libqtip and libtablet tooltips when dragging, yes strange that checking for IsForbidden() is not correct. I can add IsProtected() and see if that helps.

Kiatra commented 1 year ago

Just installed Platter and IsProtected() does not fix the issue.

Kiatra commented 1 year ago

Fixed in v3.9.3