Archived

This topic is now archived and is closed to further replies.

Re-Usable Data Dialog For Game

This topic is 5118 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to add a button to a Windows dialog app which will open another dialog window with card buttons. The user picks a few cards in the second window, then that card window is closed/hidden/minimized so he''s back to the first window. But, he then gets to go back to the card window later to pick a few more cards. Since I need to keep track of which cards were picked the first time (e.g. to disable those card buttons), what is the best way to save the info in that second window? Should I just minimize that second window after cards are chosen? How would I set up the relationship between these 2 windows best? Thanks, jim

Share this post


Link to post
Share on other sites
Great reply.

I''ll try again:

I have an app that has a main dialog window, with a button that opens a second dialog window in which the user selects cards. The user then gets taken back to the main dialog window after card selection. But, there will be several more times when the user is taken back to the cards window to select more cards. The previously selected cards must be dis-enabled so he doesn''t choose the same card twice (that I know how to do).

How should I handle the card window after cards are selected? Do I minimize it? Hide it? I know I can''t destroy it, as data needs to be maintained for each visit to the cards window.

Any ideas?

Thanks,

Matt

Share this post


Link to post
Share on other sites
I would simply store an array of card states.. used/selected/picked or unused/unselected/not picked. Then, when you open the window each time, you can load this list and figure out which cards he''s able to pick. When he picks a new card, update the array, this way, you can close the window at any time (aka, they click the X) without having to call any function to store the info... and now you''re main app window can just use this array as well so there is no reason to leave the second window open when it''s not in use.

Share this post


Link to post
Share on other sites
If I did close the cards window each time, would it slow things down too much if I have to redraw/reload all those card icons the next time cards are chosen?

Thanks alot,

Jim

Share this post


Link to post
Share on other sites
quote:
Original post by hatflyer
If I did close the cards window each time, would it slow things down too much if I have to redraw/reload all those card icons the next time cards are chosen?

Thanks alot,

Jim




Depends on how often you need this done. If it''s very common, might as well juts hide it, if it''s only once in a while, better to un-allocate the memory and re-load it when needed (most likely the icon''s, etc will still be in cache, so loading shouldn''t take long at all).

Share this post


Link to post
Share on other sites
Final Q;

How would you create the second card (dialog) window?

I was using something like:

PickCards.DoModal();

when the Cards button in the main dialog window was clicked.

Is it better to create the second cards window a different way to have more control?

Thanks,

Jim

Share this post


Link to post
Share on other sites