zerodowned

Moderator
After doing various gumps I'm starting to notice a trend, Gumps don't like to do calculations.

If I have a string to display a number that's say A + B, and don't include a null check, it will crash the shard.
Or if I do a tiledimage with a width that's determined by A + B it won't show the image at all.

The only work around I've found is to have the calculation done inside another class, and then in the gump constructor do something like: int Amirror = otherClass.A;

My question is, am I missing something ( aka sloppy work that I'm not aware of ) or is there a better way to do this?
 
I will check out your example when you post it but I have never come across this issue before.
 
I don't think it matters, but I usually convert the divisor rather than the integral part of the equation, out of habit;

double = int / (double)int

That might be a better idea, it would stop scenarios such as (double)(int/int) where you would get the division back as a floored double due to the fact that neither of the ints are actually cast as a double, the result is.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back