Instead of starting a new thread, I thought I'd post in this one. I am also doing a weapon description in a similar way. But I had another idea but I need some help to complete it.
In the Weapon, I have this:
PHP Code:
function onSetDescription() {
player.description = "blah, blah, blah";
}
In my Inventory, I have this for Weapon clicked:
This is the script where I need the help
PHP Code:
function onItemPressed(obj,bla,bla,bla,clickcount) {
if (clickcount == 1) {
if (IsObject("Inventory_Main")) {
new GuiBitmapCtrl("Inventory_Item_Icon") {
play("age_click");
//TRIGGER THE 'onSetDescription()' on the clicked weapon
//What code would I put to do this???
x = screenwidth/2-615+500;
y = screenheight/2-340+100;
width = height = 32;
bitmap = obj.normalbitmap;
layer = 2;
}
And of course this displays the text in the INV script:
PHP Code:
showText(213, screenwidth/2-50, screenheight/2+50, "showg", "b", "DESCRIPTION:" @(player.description));
with (findImg(212)) {
textshadow = true;
shadowoffset = "-2 2";
shadowcolors = "0 0 0";
font = "showg";
style = "b";
layer = 23;
zoom = 1;
}