
Dialogs, Etc.
#1
Posted 14 February 2005 - 05:39 AM
I just checked in some major code changes.
First the XNet is now opened from Planetscape's XNet-Button. That's what you see in the frontend, the interesting thing in the backend is, that now, you can open the XNet from everywhere and once you close it, you return to the exact same state, you opened it from (very nice if you open the XNet from an intercept craft dialog, etc).
Since this works through boost::fsm, the state being restored after xnet closes has to be in terms of fsm-states. (e.g. a dialog being shown must be a substate of the screen, etc).
Related to this, I moved the optionsdialog out from the planetscape and made it a separate class (it's really a template from which you have to derive your specialized options-dialog for your screen. Sounds worse than it is, just look at planetscape for how it's done).
This allows options-dialog to be shown from all screens and also automatically hides it when the screen is exited (hierarchical state machines rule).
Also in the code is a preliminary fadingmanager that "hopefully" will allow crossfading between screens sometime in the future. Currently it's not working though.
Thats it for now, if you have any critizism or questions, post them here please.
Rincewind
P.S: For the future, all dialogs should at least be put into separate substates. They don't have to be templated if it's sure that they will only be shown in one screen (e.g. intercept dialog, etc). If you don't template them, there's also no need to have all that separate internal fsm stuff currently in OptionsDialog.

I love boost!!! The next best thing since the invention of C++.
#2
Posted 15 February 2005 - 10:22 AM
edit:
now i can't figure out how to add events to widgets in the Options dialog. the more i look at the code, the more confusing it looks

Edited by SupSuper, 15 February 2005 - 10:58 AM.
#3
Posted 15 February 2005 - 11:07 AM
hmmm... the code does seem like a bigger mess now, but i'll eventually figure it out.
edit:
now i can't figure out how to add events to widgets in the Options dialog. the more i look at the code, the more confusing it looks
Hi,
I always knew that C++ templates were the work of the Devil,and now I’m sure :-)
-Cliff Click
The templates are a bit confusing in the beginning but once you get used to it, it's actually pretty nice.
I'll be back in about two hours. If you want to, contact me on icq then. I can try to explain it there.
Rincewind

I love boost!!! The next best thing since the invention of C++.
#4
Posted 16 February 2005 - 11:25 AM
The code is a lot cleaner now that I was able to get rid of the entire internal state machine stuff.
Also, I got rid of the back button in the sound page. Clicking the X in the corner now brings you back to the main page.
Rincewind

I love boost!!! The next best thing since the invention of C++.
#5
Posted 17 February 2005 - 06:15 AM
Should i also use fsm::event or something like this to use widgets on sound options ?? Or rather add some normal functions to OptionsDialog class?
Beetle

#6
Posted 17 February 2005 - 07:01 AM
Hi
Should i also use fsm::event or something like this to use widgets on sound options ?? Or rather add some normal functions to OptionsDialog class?
Beetle
Using fsm::event makes it more standardizes, so I would go with this. You should probably add custom_reactions to them in the SoundDialog class that call methods on the AudioSystem. This way, it's all nicely encapsulated inside the SoundOptionsDialog.
Rincewind

I love boost!!! The next best thing since the invention of C++.
#7
Posted 17 February 2005 - 07:51 AM


One more: when i quit from options dialog Planetview::publish() is called. Is this right? Since in fact palnetview is still rendering in background.
Beetle

#8
Posted 17 February 2005 - 08:52 AM
OK i have done handling functions
Now i have to find how can i add to them fsm::event state
One more: when i quit from options dialog Planetview::publish() is called. Is this right? Since in fact palnetview is still rendering in background.
Beetle
Concerning the handling functions: You have to define a new Event (look where there's struct EvExitOptions, etc).
Then you have to add them to the reactions of the SoundOptionsState (look at the definition of SoundOptionsState and the custom_reactions therein) and add a react(...) function for it to SoundOptionsState.
About publish:
No this definitly should NOT happen. Very weird. I'll take a look at it once I get home.
Greetings,
Rincewind

I love boost!!! The next best thing since the invention of C++.
#9
Posted 17 February 2005 - 02:03 PM






Can you add one empty example? Please?
Beetle

#10
Posted 01 March 2005 - 08:49 AM
OK i have done handling functions
Now i have to find how can i add to them fsm::event state
One more: when i quit from options dialog Planetview::publish() is called. Is this right? Since in fact palnetview is still rendering in background.
Beetle
Finally managed to get something done. In optionsdialog.h there's now an example event together with handling, just search for example and you should find all the places that relate to it together with some comments.
Contact me on icq or by pm if you want assistance.
About the publish, I just posted to the boost-mailinglist to see whats wrong with my code there. I think it's a bug in boost::fsm.
Rincewind

I love boost!!! The next best thing since the invention of C++.
#11
Posted 01 March 2005 - 04:05 PM






Now with compiling.
d:\Programming\Projekty\Xenocide\xenocide\src\client\ui\planetview\../optionsdialog\optionsdialog.h(57) : error C2976: 'Xenocide::Client::UI::NoOpInnerInitial' : too few template arguments
..\..\..\xenocide\src\client\ui\uimanager.h(109) : see declaration of 'Xenocide::Client::UI::NoOpInnerInitial'
d:\Programming\Projekty\Xenocide\xenocide\src\client\ui\planetview\../optionsdialog\optionsdialog.h(202) : see reference to class template instantiation 'Xenocide::Client::UI::Common::OptionsDialog<ParentState,ReturnState>' being compiled
d:\Programming\Projekty\Xenocide\xenocide\src\client\ui\planetview\../optionsdialog\optionsdialog.h(59) : error C3203: 'NoOpInnerInitial' : class template invalid as template argument for template parameter 'ReturnState', expected a real type
d:\Programming\Projekty\Xenocide\xenocide\src\client\ui\planetview\../optionsdialog\optionsdialog.h(57) : error C2976: 'Xenocide::Client::UI::NoOpInnerInitial' : too few template arguments
..\..\..\xenocide\src\client\ui\uimanager.h(109) : see declaration of 'Xenocide::Client::UI::NoOpInnerInitial'
d:\Programming\Projekty\Xenocide\xenocide\src\client\ui\planetview\../optionsdialog\optionsdialog.h(72) : see reference to class template instantiation 'Xenocide::Client::UI::Common::OptionsDialog<ParentState,ReturnState>::OptionsSoundState' being compiled
maybe we have diffrent uimanager.h ??
Beetle

#12
Posted 01 March 2005 - 05:33 PM
I still have problems
![]()
![]()
![]()
![]()
![]()
![]()
Now with compiling.d:\Programming\Projekty\Xenocide\xenocide\src\client\ui\planetview\../optionsdialog\optionsdialog.h(57) : error C2976: 'Xenocide::Client::UI::NoOpInnerInitial' : too few template arguments
..\..\..\xenocide\src\client\ui\uimanager.h(109) : see declaration of 'Xenocide::Client::UI::NoOpInnerInitial'
d:\Programming\Projekty\Xenocide\xenocide\src\client\ui\planetview\../optionsdialog\optionsdialog.h(202) : see reference to class template instantiation 'Xenocide::Client::UI::Common::OptionsDialog<ParentState,ReturnState>' being compiled
d:\Programming\Projekty\Xenocide\xenocide\src\client\ui\planetview\../optionsdialog\optionsdialog.h(59) : error C3203: 'NoOpInnerInitial' : class template invalid as template argument for template parameter 'ReturnState', expected a real type
d:\Programming\Projekty\Xenocide\xenocide\src\client\ui\planetview\../optionsdialog\optionsdialog.h(57) : error C2976: 'Xenocide::Client::UI::NoOpInnerInitial' : too few template arguments
..\..\..\xenocide\src\client\ui\uimanager.h(109) : see declaration of 'Xenocide::Client::UI::NoOpInnerInitial'
d:\Programming\Projekty\Xenocide\xenocide\src\client\ui\planetview\../optionsdialog\optionsdialog.h(72) : see reference to class template instantiation 'Xenocide::Client::UI::Common::OptionsDialog<ParentState,ReturnState>::OptionsSoundState' being compiled
maybe we have diffrent uimanager.h ??
Beetle
Yes, I forgot that one. Thats the problem if you work on too many problems at the same time. Should work now.
Rincewind

I love boost!!! The next best thing since the invention of C++.
#13
Posted 02 March 2005 - 03:34 PM




Beetle
