Hi,
at the moment I have an object (objectX) that reflects whatever inventory graphic is currently active.
I usually do this inventory item by inventory item and change objectX's graphic accordainly.
What would be the best way to change objectX to reflect active inventory graphic without have to list each one?
cheers for any help
thanks
I think this:
if (player.ActiveInventory != null)
{
objectX.Graphic = player.ActiveInventory.Graphic;
}
else
{
objectX.Graphic = N; // where N is a "no item" graphic.
}
Thanks Crimson (nod)
Of course I overlooked one thing, my inventory items have a black background whereas their cursor images have not :~(
This sorts out that issue:
objectX.Graphic=player.ActiveInventory.CursorGraphic;
Happy days (laugh)
EDIT: Secondary question regarding above:
cCharles.Say("I don't think %d will do much",player.activeinv);
Shows inventory ID whereas I would like the Inventory NAME ie Grease, Cloth etc etc
As like: "I don't think Cloth will do much"
cheers
I'm surfing using my mobile atm. So, I can't test it. But the code should be something along the lines of:
cCharles.Say("I don't think %s will do much", player.ActiveInventory.Name);
(laugh) Just beat me too the punch Adeel...
Already implemented..
;)
Glad to hear that you had already figured it out! :)