Thread Tools Display Modes
09-11-22, 10:08 AM   #1
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,863
Dragonflight : EditMode System

I know it's unlikely, but just in case someone was fortunate to have had time to figure this out for their needs any idea why this is having a problem ?

Seeing as nUI and the new EditMode system doesn't get along at all, I have been attempting to rebuild at least some of nUI and use the EditMode system in it and thus removing the need of nUI's mover system.

Now, with the minimap having the smallest editmode setup I thought I would try to emulate what it does to do its stuff with the EditMode system.

Now, looking at ( https://github.com/Gethe/wow-ui-sour...ML/Minimap.xml / https://github.com/Gethe/wow-ui-sour...ML/Minimap.lua ) we have an inherit to a template in ( https://github.com/Gethe/wow-ui-sour...mTemplates.xml ) which has a mixin coded in ( https://github.com/Gethe/wow-ui-sour...mTemplates.lua )

But we don't stop there... inside the minimap editmode template there are a few key values set up with one of them being the Edit Mode System that is linked to it (Enum.EditModeSystem.Minimap) . Sounds good so far right ?

Lua Code:
  1. [Enum.EditModeSystem.Minimap] = {
  2.         settings = {
  3.             [Enum.EditModeMinimapSetting.HeaderUnderneath] = 0,
  4.         },
  5.         anchorInfo = {
  6.             point = "TOPRIGHT",
  7.             relativeTo = "UIParent",
  8.             relativePoint = "TOPRIGHT",
  9.             offsetX = 0,
  10.             offsetY = 0,
  11.         },
  12.     },

Wrong!

So, using this as a guide I have extracted just the dashboard display code including its scaling code and displays fine on the screen using its regular coding and .. doesn't error out when trying to use the EditMode system
Lua Code:
  1. [Enum.EditModeSystem.Dashboard] = {
  2.     settings = {
  3.         [Enum.EditModeDashboardSetting.Etc] = 0,
  4.     },
  5.     anchorInfo = {
  6.         point = "BOTTOM",
  7.         relativeTo = "UIParent",
  8.         relativePoint = "BOTTOM",
  9.         offsetX = 0,
  10.         offsetY = 0,
  11.     },
  12. }
This prompted this error: "Interface/AddOns/nUI_Dashboard/EditModeSystem.lua:2: unexpected symbol near '['" on that first line

I then copied the minimaps EditMode SystemMixin and renamed/edited it to work for the dashboard with Minimap replaced with Dashboard and HeaderUnderneath functions with an Etc function
Lua Code:
  1. EditModeDashboardSystemMixin = {};
  2.  
  3. --[[ This will ultimately call the actual frames function - in this case Etc ]]
  4. function EditModeDashboardSystemMixin:UpdateSystemSettingEtc()
  5.     self:Etc(self:GetSettingValueBool(Enum.EditModeDashboardSetting.Etc));
  6. end
  7.  
  8. --[[ This appears to update any system settings that may exist]]
  9. function EditModeDashboardSystemMixin:UpdateSystemSetting(setting, entireSystemUpdate)
  10.    
  11.     -- Update this setting for this system
  12.     EditModeSystemMixin.UpdateSystemSetting(self, setting, entireSystemUpdate);
  13.  
  14.     -- if the setting didn't change then no need to do anything
  15.     if not self:IsSettingDirty(setting) then
  16.         -- If the setting didn't change we have nothing to do
  17.         return;
  18.     end
  19.  
  20.     --[[ Assumedly each of the settings for this system needs to be checked here and the corresponding function added ]]
  21.     if setting == Enum.EditModeDashboardSetting.Etc and self:HasSetting(Enum.EditModeDashboardSetting.Etc) then
  22.         self:UpdateSystemSettingEtc();
  23.     end
  24.  
  25.     -- Finally mark everything clean
  26.     self:ClearDirtySetting(setting);
  27. end
This resulted in this error : "nUI_Dashboard: Has bad mixin: EditModeDashboardSystemMixin" which seeing as I also copied the Minimaps equivalent mixin and did the necessary changes there
Lua Code:
  1. <Ui xmlns="http://www.blizzard.com/wow/ui/"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xsi:schemaLocation="http://www.blizzard.com/wow/ui/">    
  2.     <Frame name="EditModeDashboardSystemTemplate" inherits="EditModeSystemTemplate" mixin="EditModeDashboardSystemMixin" virtual="true">
  3.         <KeyValues>
  4.             <KeyValue key="system" value="Enum.EditModeSystem.Dashboard" type="global"/>
  5.             <KeyValue key="systemNameString" value="Dashboard" type="global"/>
  6.         </KeyValues>
  7.         <Frames>
  8.             <Frame parentKey="Selection" inherits="EditModeSystemSelectionTemplate" setAllPoints="true" hidden="true"/>
  9.         </Frames>
  10.     </Frame>
  11. </Ui>

With this being the first line of my Dashboard frame setting up the appropriate files
Lua Code:
  1. <Frame name="nUI_Dashboard" frameStrata="BACKGROUND" toplevel="false" parent="UIParent" inherits="EditModeDashboardSystemTemplate" mixin="DashboardMixin" >

Now the regular mixin for this frame has no issues .. but yet the EditMode one did despite being created in the same way.

I am also not getting errors about trying to index Enum.EditModeSystem or Enum so attaching my code to it appears to be fine even though I can't find where Enum and EditModeSystem are set up so possibly behind the scenes.

So, to ask my question again. Anyone know why this could be happening ? Or have an example of how to use the EditMode system on your own frames.

Thanks.
__________________
  Reply With Quote
09-11-22, 11:14 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,304
Originally Posted by Xrystal View Post
This prompted this error: "Interface/AddOns/nUI_Dashboard/EditModeSystem.lua:2: unexpected symbol near '['" on that first line
I'm downloading the PTR right now, so it'll be a while before I can dig around it. Even so, this error is pointing out a syntax issue, you're trying to index a table that you didn't give a reference to. That's what it's complaining about when it's saying there's an unexpected "[".

Also, if you're adding things accessible by the global environment, you need to keep name collisions in mind. Generic names like Enum.EditModeSystem.Dashboard and EditModeDashboardSystemMixin are more likely to cause conflict than something that more uniquely identifies that they are from your addon.

You also may want to avoid inserting values into Blizzard enums if you're thinking of heading in that direction.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
09-11-22, 12:45 PM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,863
Start Edit
I decided to create my own table and reference that instead of the Enum path I saw their frames use. The EditMode error popped up. All I did was change from their Enum tables to my own tables. EditMode clearly doesn't want you to use their moving system it seems. Or, hopefully they just haven't finished it enough to allow addons to use it yet.
End Edit


Yeah, I noticed the first part was a table situation but putting it into a table and trying to get that table recognised by the EditMode system was even more of a problem. So back to the drawing board.

Naming aside, it's just for a test on my system, more unique naming would have applied if it ever went live as I have always done - in fact almost all of my data is local to avoid public collisions. Unfortunately almost all of nUI is fully public so I have got a fair task to correct that issue at the same time as everything else.

As to adding it to their Enums, at the moment that is the only way I can see it working.

I am just hoping I can figure out what nUI is doing that EditMode doesn't like and can fix that problem which prompted error messages like the following, otherwise I may have to do a full re-write of nUI if nUI can't handle Blizzard frame movements now if the EditMode system wants to have the only access :
Lua Code:
  1. "[ADDON_ACTION_FORBIDDEN] AddOn 'nUI' tried to call the protected function 'TargetUnit()'.",
  2. "[string \"@Interface/AddOns/!BugGrabber/BugGrabber.lua\"]:519:
  3. in function <Interface/AddOns/!BugGrabber/BugGrabber.lua:519>\n[string \"=[C]\"]:
  4. in function `TargetUnit'\n[string \"@Interface/FrameXML/EditModeManager.lua\"]:1414:
  5. in function `RefreshTargetAndFocus'\n[string \"@Interface/FrameXML/EditModeManager.lua\"]:1354:
  6. in function `OnEditModeEnter'\n[string \"@Interface/FrameXML/EditModeManager.lua\"]:162:
  7. in function `EnterEditMode'\n[string \"@Interface/FrameXML/EditModeManager.lua\"]:183:
  8. in function <Interface/FrameXML/EditModeManager.lua:181>\n[string \"=[C]\"]:
  9. in function `Show'\n[string \"@Interface/FrameXML/UIParent.lua\"]:2871:
  10. in function `SetUIPanel'\n[string \"@Interface/FrameXML/UIParent.lua\"]:2677:
  11. in function `ShowUIPanel'\n[string \"@Interface/FrameXML/UIParent.lua\"]:2581:
  12. in function <Interface/FrameXML/UIParent.lua:2577>\n[string \"=[C]\"]:
  13. in function `SetAttribute'\n[string \"@Interface/FrameXML/UIParent.lua\"]:3174:
  14. in function `ShowUIPanel'\n[string \"*:OnClick\"]:2:
  15. in function <[string \"*:OnClick\"]:1>",
__________________

Last edited by Xrystal : 09-11-22 at 01:34 PM.
  Reply With Quote
09-11-22, 11:35 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,304
From what I can see, it isn't made to handle addons, though it does send "EditMode.Enter" and "EditMode.Exit" messages through EventRegistry:TriggerEvent().
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
09-12-22, 07:14 AM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,863
Yeah I saw those. But alas doesn't help my situation. Back to the initial idea of rewriting nUI while avoiding upsetting EditMode. I'll just keep my currently working with no errors but no EditMode option for the frame in question ( with the only EditMode Code I can identify ) as back up in case it gets figured out/added later.

Thanks for taking a look see though.

Originally Posted by SDPhantom View Post
From what I can see, it isn't made to handle addons, though it does send "EditMode.Enter" and "EditMode.Exit" messages through EventRegistry:TriggerEvent().
__________________

Last edited by Xrystal : 09-12-22 at 07:19 AM.
  Reply With Quote
06-21-23, 04:58 PM   #6
Ssateneth
A Defias Bandit
Join Date: Mar 2007
Posts: 2
Sorry to necro this thread. But I use an old addon called _DevPad that I think has been broken from this EdixMode change.

I have limped it along with minor patches to keep the functionality working until now. I play WOTLK Classic. As of yesterday, there are huge problems with it. When I go into a _Devpad window (basically an instance of notepad a giant edit box), I cannot copy, paste, or delete anything. Also it will steal keybind focus forever until I log out and back in (because I would have to type /reload which I can't because keybind focus is stolen)

I have no idea how to fix this but I imagine it has something to do with this change. I am looking for someone to patch it into working condition, and I will pay $200 with paypal, venmo, cash app, or whatever you want. I am desperate
  Reply With Quote
06-21-23, 09:05 PM   #7
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
Originally Posted by Ssateneth View Post
Sorry to necro this thread. But I use an old addon called _DevPad that I think has been broken from this EdixMode change.

I have limped it along with minor patches to keep the functionality working until now. I play WOTLK Classic. As of yesterday, there are huge problems with it. When I go into a _Devpad window (basically an instance of notepad a giant edit box), I cannot copy, paste, or delete anything. Also it will steal keybind focus forever until I log out and back in (because I would have to type /reload which I can't because keybind focus is stolen)

I have no idea how to fix this but I imagine it has something to do with this change. I am looking for someone to patch it into working condition, and I will pay $200 with paypal, venmo, cash app, or whatever you want. I am desperate
Before trying to pay 3x full games worth for an old addon, may I suggest you give TinyPad or ReHack or WowLua a try?
  Reply With Quote

WoWInterface » PTR » PTR API and Graphics Changes » Dragonflight : EditMode System

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