Install from zip-file in custom window
#1
I have a custom window with a collection of addon-related functions and locations, and I would like to have a button that invokes the "install from zip file" functionality. Is this in any way possible?

I tried a combination of ActivateWindowAndFocus and SendCick, but no dice unfortunately

Cheers
Reply
#2
Assuming you are using some type of list view for AddonBrowser and its ID is 50, the following works:

Code:
<onclick>ActivateWindow(AddonBrowser,addons://)</onclick>
<onclick>SetFocus(50,3)</onclick>
<onclick>Select</onclick>

You need to specify the "addons://" part of ActivateWindow to ensure you are at the base level of AddonBrowser, so you can't use ActivateWindowAndFocus and instead have to use SetFocus. I'm not sure if it will work for a panel view, but I think you can have multiple viewtypes as long as the SetFocus ID matches the first one (i.e. the first <view> ID is 50).

Main problem is that after you install from zip you are in AddonBrowser rather than where you were originally, though you could maybe solve this with an additional onclick that sets a window property with the return location and using an <onunload> in FileBrowser.xml to check if the property is set and then do an ActivateWindow with the property and clear it.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
I'm using a list view, so should be easy enough, cheers JM Smile
Reply
#4
You can use this too :

Code:
<onclick>SetProperty(AddonsZip,True,home)</onclick>
<onclick>ActivateWindow(addonbrowser,addons://install/,return)</onclick>
<onclick>Select</onclick>

And in your FileBrowser.xml file :

Code:
<onunload condition="!String.IsEmpty(Window(home).Property(AddonsZip))">ActivateWindow(Home)</onunload>
<onunload>ClearProperty(AddonsZip,home)</onunload>
 Estuary MOD V2 
Reply
#5
Cool, got it working Smile Cheers folks!
Reply

Logout Mark Read Team Forum Stats Members Help
Install from zip-file in custom window0