String Manipulation
#1
Hi guys hope you can help me once again

I'm trying to remove part of a label. I know that part only can be [Fav] or [Broken]

On a program Addon, when I add something to the favorites it puts [Fav] on the label. I'm making a skin, so I have a indicator for that and already know how to show it.
But I want to remove the [fav] or [broken] or other [ ] from showing. How can I do it?

Show indicator
PHP Code:
<control type="image">
            <
centerright>110</centerright>
                        <
centertop>32</centertop>
                        <
width>32</width>
                        <
height>32</height>
                        <
aspectratio aligny="top">keep</aspectratio>
                        <
texture>indicator/fav.png</texture>
                        <
visible>String.Contains(ListItem.Title,"Fav")</visible>
    </
control

Thanks for the help in advance
Best regards
Reply
#2
nope, it's not possible to modify labels.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Well, I'm sorry to ear that Wink
thanks for the help ronie
Reply
#4
Skin helper has a strip string function. However, because it sets the output string as a window property, you wont be able to use it inside list/panel containers - only outside them in info panels etc. so not sure if that is useful to you or not.

Code:
RunScript(script.skin.helper.service,action=stripstring,splitchar=[splitter text],string=[your string],output=[your window prop])

See this page for more details (its about 2/3 of the way down the page) -- https://github.com/marcelveldt/script.sk...wiki/Tools

EDIT: Thinking about this more, it probably isn't useful at all seeing as you would have to run the script everytime you change items in the list. Could be useful for an info dialog though (call onload).
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#5
From what I read, it doesn't help on label, but thanks for the help. The developer needs to make a variable for the status, to be listed.
Reply
#6
Sorry for the double Post. How can I handle an [ or an ] in a string, if I put this String.Contains(ListItem.Title,"[Fav]") doesn't work but without the brackets it works. already tried to make two more functions with only a bracket in it but it doesn't work. I know how to handle in C and others, but not on xml
Reply
#7
$ESCINFO["[FAV]"] might work
Reply
#8
(2017-01-21, 10:17)badaas Wrote: $ESCINFO["[FAV]"] might work

It didn't work, but thanks for he help
Reply
#9
Have you tried single quotes rather than double quotes e.g. '[FAV]'
It's a long shot but sometimes that is what is needed.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#10
(2017-01-22, 01:42)jurialmunkey Wrote: Have you tried single quotes rather than double quotes e.g. '[FAV]'
It's a long shot but sometimes that is what is needed.
I already tried with single quotes, the function doesn't work with those. Thanks again
Reply
#11
This is an AEL based thing, the prefixes are determined by AEL in the title formatting. Don't bother trying to work around them. I'm almost certain Wintermute0110 has chosen this method because it is the only way so far to immediately display the ROM status visually as skins don't have another method as of yet. He mentioned previously we are working on methods to bring this into a better visual presentation skinwise when that is determined fully, those changes can be shared with others such as yourself.

Until then, you're just gonna have to put up with it unless he changes the title formatting.
Reply

Logout Mark Read Team Forum Stats Members Help
String Manipulation0