View Single Post
  #28  
Unread 03-09-2005, 04:55 AM
Talyns's Avatar
Talyns Talyns is offline
A Griffon
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Jul 2004
Server: Everfrost
Posts: 604
Default

Quote:
Originally Posted by Quib
Alright, I'll script the Close and Minimize buttons using OnActivate; please suggest some code for the default Minimize button(well, buttons since it's 2). I have a good idea of what I'd do with it, but want your feedback.
I'm attaching yet another version of this system.. You can view the changes I made to the buttons there.. I will explain the changes I would make/made here..

The changes to the EQ2Map are minimal:
mainhud_map:
Added 3 lines of code..
You can find them by searching for TM_ ..
The code is support for the callback system and the showing of the plugins page..
and the include for plugins.xml...

window_titlebar.xml changes:
All buttons in titlebar: (To make them pressable through script)
Changed OnPress to OnActivate and added the line Activated=false as the last call in the scripts..

RestoreButton: (To support the Plugins OnEvent Callbacks)
Added Parent.Parent.TM_Plugins.OnRestoreWindow.Activated=true to the second to last call in the OnActivate Script..

MinimizeButton: (To support the Plugins OnEvent Callbacks)
Added Parent.Parent.TM_Plugins.OnMinimizeWindow.Activated=true to the second to last call in the OnActivate Script..

CloseButton: (To make it always close the window no matter what plugin is installed)
The script looks like this now:
OnActivate="Activated=false Parent.Parent.OnHide=TM_OnHideBackup Parent.Parent.Visible=false Parent.Parent.OnHide=' ' TM_OnHideBackup=Parent.Parent.OnHide"


Quote:
Why do you need an underlay? Couldn't your script just use the stuff inside of MapBorder to make an underlay (by moving/resizing it)?
This is what I ended up doing.. I was overthinking it..

Quote:
Explain what you mean by OnTitlebar and OnFrame.
I was going to add Callback events for when the Titlebar or Frame changed it's visible state.. I decided to skip it for now.. If there's ever a need for it.. It can be added later..

Quote:
Not really sure what this was in reply too so I don't understand the exmaple. I know by using includes outside of page objects you'll avoid a level of using Parent.
Sorry I think I read your reply wrong just ignore it..

Quote:
The reason I say it's inefficient, is you're calling an include which will just call 5 more includes. That's ~16% less efficient than just directly calling the 5 includes. Likewise, calling one parent plugin object that'll call all the plugins themselves (to distribute the OnEvent calls) adds a layer of calls that just doesn't need to be there. I don't mind bulking up the main page objects OnEvents with calls directly to the plugins; the main page's calls are already massive.
I thought about it and have come to the conclusion it doesn't matter where the pages go or get included.. As long as they get in there.. I guess either way is just as flexible.. In the new version I got going all the plugins are children of that master page.. The master page takes care of all the callbacks to the plugins.. The main map code just has to perform callbacks on one page that way.. All of this is for the sake of modularity. Seperates it as much as possible..

It's up to you if you want to bulk up the OnEvents code.. I perfer seperating it the way I have it now though..

I included the minimap and 3 other plugins in the zip as examples.. The minimap is now contained in one page.. But, I still have it seperated into 3 files.. The minimap plugin uses the OnRestoreWindow and OnMinimizeWindow events.. the Minimize/Restore with keyboard plugin uses the OnHideWindow callback event.. The other two use the OnShow event to make a change to the map (like the current plugin system)

Edit: Updated Attachment.. made a quick change:
Note: This should be installed over the same eq2map version I've been using for all attachments thus far.
Edit: Updated Attachment again the min/restore with keyboard plugin wasn't working right..
Attached Files
File Type: zip _eq2map_proposal_plugins_2c.zip (11.8 KB, 435 views)
__________________
Talyns

Last edited by Talyns : 03-09-2005 at 06:20 AM.
Reply With Quote