331
Scripting / Re: Static List & Dynamic Selection Bar
« on: November 08, 2017, 03:07:01 AM »
Thank you, the part where it selects consoles is exactly what i want. I'll check Modified grid
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Yes, tags would definitely be a better place to store that, and that allows you to adjust your filters based on the tags! Extra is really best used for text about the game or something like that..
You can use string.find(search, startIndex) to find a substring in squirrel. Here's some info on strings for squirrel:
https://electricimp.com/docs/squirrel/string/
And here's an example flag image using tags for region:Code: [Select]local flag = fe.add_image("[!game_region]", 0, 30, 64, 64)
function game_region() {
local tags = fe.game_info(Info.Tags).tolower()
if (tags.find("usa") != null ) return "images/flags/usa.png"
else if (tags.find("japan") != null ) return "images/flags/japan.png"
else if (tags.find("europe") != null ) return "images/flags/europe.png"
else return "images/flags/unknown.png"
}
Note that tags and the find function are case-sensitive so I converted the taglist to lowercase before using find. Tags is a delimited string using semicolons, so if you needed a more exact search, you could use split() to do more with the tag list.