So what im trying to do is to make a info system without the info tab. (stats,inventory,skills etc..) using the interface with grids and buttons.
now, what i have is one grid. set up under the buttons for stats,inventory and skills, how do i get it so change between stats inventory and skills upon clicking the buttons.. do i need 3 different grids to display the different information. or is there a way to make this one grid display everything(one at a time(not stats, inventory at the same time)) upon request(clicking the stats or inventory button) ?
ID:159068
May 19 2009, 12:50 am
|
|
In response to GhostAnime
|
|
kk, thanks.. will try to do so.
if everything fails to work how i want it i'll just use the statpanel instead. |
Narutostory wrote:
or is there a way to make this one grid display everything(one at a time(not stats, inventory at the same time)) upon request(clicking the stats or inventory button) ? Of course there is. Unlike with, say, info controls, you have a great amount of control over grid controls. You can make them update when you want, and how you want. There's no reason you couldn't use one grid to do this (you could even do this with an info control, too); all you need to do is to change how you're updating it, and it will display something else... tadah! Just keep track of the player's current choice with a var on that player (don't put this somewhere like the base /mob branch as NPCs don't need it). Here's an illustration: client Note if I did something like the above I'd use #define macros to name the numbers for clarity and convenience, but I didn't want to needlessly complexify the code. That looks like this, though: #define DISP_STATS 1 |
And then update each grid panel when needed.
Example:
For the inventory grid, and possibly skills, update it when an item enters a /mob (via Entered())and re-output (after resizing the cells to 0) the inventory items upon the item leaving a person's content (via Exited()).
For stats... for the love of efficient programming, make generalized procedures. Ex: mob.TakeHP(); this way you can have all the stuff that happens to a mob when HP is taken off (ex: updating health HUD, death checking and outputting the current health to the stats grid), you will need it only in one place instead of a zetta amount of places (I am looking Zeta).