First: I guess the title might be somewhat misleading but I didn't know how to phrase it short.
I'm patching together an inventory and settled for:
<<set $waffen to {
Pistole01 : {
typ: "Pistole",
name: "name 1",
cost: 64,
has: false,
description: "Text 1"
},
Gewehr01 : {
typ: "Gewehr",
name: "name 2",
cost: 122,
has: false,
description: "Text 2"
},
Pistole02 : {
typ: "Pistole",
name: "name 3",
cost: 342,
has: false,
description: "Text 3"
}
}>>
To print it in the inventory passage I use:
<<set $tmpKeys to Object.keys($waffen)>>
<<for $i to 0; $i lt $tmpKeys.length; $i++>>
<<if $waffen[$tmpKeys[$i]].has is false>>
<<print $waffen[$tmpKeys[$i]].typ>>
<<print $waffen[$tmpKeys[$i]].name>>
<<print $waffen[$tmpKeys[$i]].cost>>
<<print $waffen[$tmpKeys[$i]].has>>
<</if>>
<</for>>
<<unset $tmpKeys>>
Works fine. Now I'd like the name to be clickable. A new window (I tried dialog and ui.alert) should open and display the items description.
<<print $waffen[$tmpKeys[$i]].description>>
Any chance thats somehow possible in an easy way? My coding knowledge is basically 0 so just to get to this point took me lot of copy/pasting different kinds of code snippets to make it work.
Thanks for any help in advance!
-karg