Kodi Community Forum
Release Image Resource selection script - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+---- Forum: Skin helper addons (https://forum.kodi.tv/forumdisplay.php?fid=300)
+---- Thread: Release Image Resource selection script (/showthread.php?tid=239558)

Pages: 1 2 3 4 5


Image Resource selection script - ronie - 2015-09-10

in case you're interested, i've written a script that lets the user select a custom image resource addon.

the Image Resource Select Addon is available through the addon repo (for Jarvis and up).

it functions quite similar to the favourites addon. it pops-up a select dialog with all installed image resource addons of a certain type.
it will copy the selected addon to a skin string, that you can use to display the icons in your skin.

Image


RE: Custom "Get More" button - braz - 2015-09-10

I should have just waited a bit, haha. Ironically that is what my dialog looked like before I moved it into the sidebar. Will check it out, thanks!

Update: Replaced my custom dialog with the Image Resource Select script, works great!


RE: Custom "Get More" button - wyrm - 2015-09-11

Ronie,

Yet again you come to our rescue. Was just about to code a custom dialog to look after this in my skin, so thanks for saving me some time. One quick request for your script if you could please, can you include a bool to show if the image resource is a flat directory or if it has sub directories. For example some weather icon sets are just one directory containing files named 01.png thru to NA.png and some are a series of directories name 01 to NA. It would be nice to be able to choose the correct syntax on a image control without having to ask the user what type of set it is.

Wyrm (your cheeky Antipodian mate)


RE: Custom "Get More" button - wyrm - 2015-09-11

Ronie,

I guess as there are no image resources in the Isengard repo that the script is Jarvis only. I don't suppose if we asked nicely we could get the resources in Isengard repo as well? Or is there something else that is missing from Isengard to not allow this to work correctly?

Wyrm


RE: Custom "Get More" button - Martijn - 2015-09-11

(2015-09-11, 17:34)wyrm Wrote: Ronie,

I guess as there are no image resources in the Isengard repo that the script is Jarvis only. I don't suppose if we asked nicely we could get the resources in Isengard repo as well? Or is there something else that is missing from Isengard to not allow this to work correctly?

Wyrm
it just won't work as lot's of things are missing


RE: Custom "Get More" button - BigNoid - 2015-09-11

Thx ronie, when using setaddon it bothered me that all artwork packs were visible. This is much better.


RE: Custom "Get More" button - wyrm - 2015-09-12

(2015-09-11, 17:41)Martijn Wrote:
(2015-09-11, 17:34)wyrm Wrote: Ronie,

I guess as there are no image resources in the Isengard repo that the script is Jarvis only. I don't suppose if we asked nicely we could get the resources in Isengard repo as well? Or is there something else that is missing from Isengard to not allow this to work correctly?

Wyrm
it just won't work as lot's of things are missing
Martijn,

Thanks for the heads up, I guess it's back to alternate for Isengard but will definitely use for Jarvis.

Wyrm


RE: Custom "Get More" button - ronie - 2015-09-17

(2015-09-11, 09:30)wyrm Wrote: One quick request for your script if you could please, can you include a bool to show if the image resource is a flat directory or if it has sub directories. For example some weather icon sets are just one directory containing files named 01.png thru to NA.png and some are a series of directories name 01 to NA. It would be nice to be able to choose the correct syntax on a image control without having to ask the user what type of set it is.

makes sense, i've added it.
v0.0.2 will be available through the addon repo within the next day.


RE: Custom "Get More" button - braz - 2015-09-18

Thanks again for the script Ronie. Was just trying to implement weather fanart, but ran into an issue whenever trying to select resource.images.weatherfanart.multi. When I try to select it from DialogSelect.xml, the dialog stays visible and nothing happens. Then when I select a different weather fanart pack, the dialog closes and I get a notification that an error occurred (see debug log below).

Thought maybe there was an issue with my DialogSelect.xml, but tried it with another skin and had the same problem. I updated to the latest versions of the script and image pack from github. Please let me know if you need any more information. Thanks!

http://pastebin.com/EQASZk7K


RE: Custom "Get More" button - ronie - 2015-09-18

ah, thanx for the report. there's indeed some faulty code in the addon.
i'll fix it.


RE: Custom "Get More" button - braz - 2015-09-18

(2015-09-18, 22:09)ronie Wrote: ah, thanx for the report. there's indeed some faulty code in the addon.
i'll fix it.

Thanks, tested and it is working now. It doesn't appear that Skin.String(foo.multi) ever gets filled when selecting resource.images.weatherfanart.multi though. I was able to get it to work by doing a string compare between my foo.path and the addon path.


RE: Custom "Get More" button - ronie - 2015-09-18

(2015-09-18, 23:19)braz Wrote: Thanks, tested and it is working now. It doesn't appear that Skin.String(foo.multi) ever gets filled when selecting resource.images.weatherfanart.multi though. I was able to get it to work by doing a string compare between my foo.path and the addon path.

ah, it's not a skin string. i now see i have listed this incorrectly in the README file.

it's a bool (as was requested)
(2015-09-11, 09:30)wyrm Wrote: can you include a bool to show if the image resource is a flat directory

so the proper check would be: Skin.HasSetting(Foo.multi)


RE: Custom "Get More" button - braz - 2015-09-18

That's what I get for following the readme too closely, haha. Thanks for the quick fix!


RE: Custom "Get More" button - MacGyver - 2015-09-20

ronie, unless you change the line at 93
Code:
if path in MULTI:
                    xbmc.executebuiltin('Skin.SetBool(%s)' % (self.property + '.multi'))

to
Code:
if path in MULTI:
                    xbmc.executebuiltin('Skin.SetBool(%s)' % (self.property + '.multi'))
                else:
                    xbmc.executebuiltin('Skin.Reset(%s)' % (self.property + '.multi'))

then once you select a multi-image resource and it gets set to true, the setting can never be set back to false when selecting a non-multi-image pack.

Once I made the change the script worked perfectly. Thank you for making image pack selection so much easier. Smile


RE: Custom "Get More" button - ronie - 2015-09-20

heh, i was adding custom weather icon support to my skin a few hours ago.
wish i read this post before i started pulling out my hair when things didn't work out.

a fixed version is in the addon repo now btw.


in case anyone already stumbled upon the following issue,
i'll also be changing some related stuf in the openweathermap addon,
as it currently provides hardcoded paths (resource://resource.images.weathericons.default/xx.png) to weather icons.