[WIP] NEW INGAME MENU

Post Reply
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

[WIP] NEW INGAME MENU

Post by ezee »

:idea: I try to create a MENU that we could use with the " ESC " key in game .
Because actually , we have no way to return to the MAIN MENU .

The way i want to make it will use a new variable of type Gamestate
enum Gamestate{QUIT,MENU,LOAD,RUNNING};//ADD BY EZEE
That Gamestate will be added and stored in the game_data_t struct :
/* All global data is stored in a variable of this type */
typedef struct
{
char use_textures;
char use_animations;
char use_videos;
char use_sprites;
char use_logos;
char use_ship_textures;
char use_planet_textures;
int audio_frequency_mode; //0==11025/8 1==22050/8 2==44100/8 3==11025/16 4==22050/16 5==44100/16
int sound_enabled;
int music_enabled;
int sound_volume;
int music_volume;
int max_sound_sources;
int warning_level;
int capture_mouse;
float MouseSensitivityX;
float MouseSensitivityY;
float detaillevel; /*how much the LOD calculation gets multiplied by...higher="bigger" */
int y_resolution;
int x_resolution;
float znear;
float zfar;
float fov;
float aspect;
float difficulty;
char vsdebug;
Gamestate state;//Added by ezee
} game_data_t; //we could add a gamestate here so i did it
Also needed , a new entry in the CommandMap
commandMap["BackToMenu"] =CockpitKeys::Menu;// New menu by ezee
I created a new CockpitKeys fonction to change the state of the game engine :
//NEW MENU SYSTEM BY EZEE
void Menu(const KBData&, KBSTATE newState)
{
if (newState == PRESS)
{
g_game.state=MENU;
printf( "********** MENU BY EZEE ****************\n" );
QuitNow(g_game.state);//we should go to the menu now
}
I have also made a binding in the vegastrike.config file for the Menu :
<bind key="space" modifier="none" command="BackToMenu" />
Note that the key i used is just because it's easy for test .
You will assign the key you want . ( it could also work with the actual ESC , i will try
that also )

I just tried it , and i've seen the Menu that is harcoded in the c++ !
But it freezed ... I think i must stop the render before , i don't know .

Oh yeah , i forgot to say that i have modified also the CockpitKeys's namespace
by tweaking the QuitNow() fonction :
//could be reused with a state like enum{quit,menu)
//okay , done
//OLD WAS void QuitNow()
//ezee

void QuitNow(Gamestate state)
{
//menu stuff
if(g_game.state==MENU)
{

UniverseUtil::startMenuInterface(true);
return;
}


// old code
if (!cleanexit)
{
cleanexit = true;
if (Network == NULL && game_options.write_savegame_on_exit)
_Universe->WriteSaveGame( true ); //gotta do important stuff first
for (unsigned int i = 0; i < active_missions.size(); i++)
if (active_missions)
active_missions->DirectorEnd();
if (forcefeedback)
{
delete forcefeedback;
forcefeedback = NULL;
}
VSExit(g_game.state);//this way we have exit to menu enabled
}
}


The freeze is caused by :
//menu stuff
if(g_game.state==MENU)
{

UniverseUtil::startMenuInterface(true);
return;
}


i set
startMenuInterface(false);

this time and that WORKS !
:D

Well , mouse moove = ok , i just pressed quit , and have a clean exit .
:wink:

the stdout :

In path d:\program\experimental\Data
Windows version 5 1
Vega Strike
See http://www.gnu.org/copyleft/gpl.html for license details.

Using .vegastrike as the home directory
['d:\\program\\experimental\\Data\\python27.zip', 'D:\\program files\\Lib', 'D:\\program files\\DLLs', 'D:\\program files\\Lib\\lib-tk', '', 'd:\\program\\experimental\\Data']
['d:\\program\\experimental\\Data\\modules\\builtin', 'd:\\program\\experimental\\Data\\modules\\quests', 'd:\\program\\experimental\\Data\\modules\\missions', 'd:\\program\\experimental\\Data\\modules\\ai', 'd:\\program\\experimental\\Data\\modules', 'd:\\program\\experimental\\Data\\bases', 'd:\\program\\experimental\\Data\\python27.zip', 'D:\\program files\\Lib', 'D:\\program files\\DLLs', 'D:\\program files\\Lib\\lib-tk', '', 'd:\\program\\experimental\\Data']
1 joysticks were found.

The names of the joysticks are:
SideWinder Joystick
axes: 3 buttons: 8 hats: 0
using NV_CUBE_MAP
Compiling python module modules/dj.py
Initializing optimizer
Compilation of technique fixed successful
Compilation of technique default successful
Compilation of technique default_simple successful
MASK is introduced by ezee !
pox 119990000000.000000 -9000000.000000 -109990000000.000000
INFO: Missing video stream preintro.ogv
INFO: Missing video stream intro.ogv
Force feedback support disabled when compiled
Loading active missions True
IS NOW AT Special/Empty

Launching bases for Special/Empty
Adding news
conditioning
nonzeroing
New selection: 0
Error: Cannot Open Unit Llama.begin from save file Autosave.
Compilation of technique earth successful
Compilation of technique fireglass successful
using NV_CUBE_MAP
MASK is introduced by ezee !
Loading active missions True
Special/Empty IS NOW AT Crucible/Cephid_17
Special
Showing splash screen!
Launching bases for Crucible/Cephid_17
Adding news
conditioning
nonzeroing
conditioning
nonzeroing
finding nonloaded quest
quest_tutorial
finding quest
quest_tutorial
nonpfact
********** MENU BY EZEE ****************
Thank you for playing!
Writing Save Game Autosave


THAT WORRRRRRRRRRKSSSSSSSSSSS !!
thank you jymmy -> https://www.youtube.com/watch?v=jvXKOreEK84
:lol:

I now make a video to show you .
:wink:

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: [WIP] NEW INGAME MENU

Post by ezee »

Last edited by ezee on Sun Mar 23, 2014 5:40 pm, edited 1 time in total.

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: [WIP] NEW INGAME MENU

Post by loki1950 »

Nice but there should be an option to view the keymap as it is currently so maybe a second key press to get the menu,now when you see the keymap pressing Q quits the game.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: [WIP RELEASED !] NEW INGAME MENU

Post by ezee »

:!: My system is working fine !

When you press ESC , you have the keymap picture .
If you press Q , you go to the menu .
From the menu , you can quit .

And the second binding ( space key here ) is working too !
That is better because you don't always want to see the keymap but directly go to the thing
you want ( using spec ... :lol: )

I have tested to click in the multiplayer button , everything is nominal .
8)

You can download the src in my git account ( initially based on SVn Tag 0.5.1rc1):
https://github.com/Ezeer/VegaStrike_win32FR
:wink:

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: [WIP] NEW INGAME MENU

Post by loki1950 »

Great I was just checking that there was there same functionality.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: [WIP] NEW INGAME MENU

Post by ezee »

No problem Loki !
It's good to know that you are aware .
:wink:

Edit : :idea: Do you know why the youtube videos don't work in every forums ?

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: [WIP] NEW INGAME MENU

Post by ezee »

The next step is to add a button for having access to the Base computer or a similar
interface , to be able to load a previous game ( or a mission or quest ? )
I will study that today .
:)

edit : I added a load scenario button :
//add load game by ezee

NewButton *LoadGame = new NewButton;
LoadGame->setRect( Rect( -.75, .2, 1.5, .15 ) );
LoadGame->setColor( GFXColor( 0, 1, 1, .1 ) );
LoadGame->setTextColor( GUI_OPAQUE_WHITE() );
LoadGame->setDownColor( GFXColor( 0, 1, 1, .4 ) );
LoadGame->setDownTextColor( GFXColor( .2, .2, .2 ) );
LoadGame->setFont( Font( .07, 1 ) );
LoadGame->setCommand( "LoadGame" );
LoadGame->setLabel( "Load a scenario" );
mainMenuGroup->addChild( LoadGame );
Image

but not yet functional , i'm working on it .
:wink:

It may be the time to talk about the design :

We keep the same or we try an other one ?
Feel free to show me your ideas if you have . :)

reedit :TWEAK !

While i was trying to access the base's computer via my menu button ,
i have done this ;
case MENU:

//UniverseUtil::startMenuInterface(false);-->show the menu disabled
BaseUtil::LoadBaseInterface( "Atlantis" );--> load the base interface
So basically , instead of showing the previous menu page , it loads a base .
My idea is to use a special base , and to use it as special menu .
INSTEAD OF HACKING THE SAVED FILE WITH A TEXT EDITOR , PEOPO COULD TWEAK
THEIR ACCOUNT HERE :idea:
We could make special rooms for Audio options , Player Options , etc ...
Last edited by ezee on Mon Mar 24, 2014 8:37 pm, edited 1 time in total.

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: [WIP] NEW INGAME MENU

Post by ezee »

Back to the classic menu we want .
I just added a method for the "LoadGame" menu button
template < >
const GameMenu::WctlTableEntry WctlBase< GameMenu >::WctlCommandTable[] = {
GameMenu::WctlTableEntry( "SinglePlayer", "", &GameMenu::processSinglePlayerButton ),
GameMenu::WctlTableEntry( "ShowJoinServer", "", &GameMenu::processMultiPlayerHostButton ),
GameMenu::WctlTableEntry( "ShowJoinAccount", "", &GameMenu::processMultiPlayerAcctButton ),
GameMenu::WctlTableEntry( "ShowMultiPlayer", "", &GameMenu::processMultiPlayerButton ),
GameMenu::WctlTableEntry( "ExitGame", "", &GameMenu::processExitGameButton ),
GameMenu::WctlTableEntry( "JoinGame", "", &GameMenu::processJoinGameButton ),
GameMenu::WctlTableEntry( "ReturnMainMenu", "", &GameMenu::processMainMenuButton ),
GameMenu::WctlTableEntry( "LoadGame", "", &GameMenu::processLoadGameButton ),
GameMenu::WctlTableEntry( "", "", NULL )
};
And i will create a new menu page , similar to the multiplayer page , but with a specific layout .
:idea: We could for exemple display a picture that is linked to a mission or quest , and that is displayed
when you click over .

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: [WIP] NEW INGAME MENU

Post by ezee »

I have made the new page , with back to main menu button .
Still have to learn how to implement a list box , fill the box with saved files or scripts files , same
for ImageBox .

But i'm confident that this is possible to have soon a useful and pretty new interface .
Ace and HellCat are some very good programmers , and even if it's hard to
understand their programming rules , i learn a lot doing that stuff in VS .
All the controls are here , waiting to be used by someone .
Thank you bro's and respect .
:wink:

Edit : that's my dedicace to you the blues brothers :
https://www.youtube.com/watch?v=XzcWwmwChVE&feature=kp
8)

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: [WIP] NEW INGAME MENU

Post by ezee »

:!: Implementation of ImageBox in the " Load game " page is working now .
( Loading + drawing = ok , need to test different formats )

Working code :
//New GameMenu::createLoadGameControls by ezee
void GameMenu::createLoadGameControls( GroupControl *LoadGamePage, std::vector< unsigned int > *inputqueue )
{
//rock and roll now by ezee
//not fully working yet
//image loading is ok
//draw ops too , need more testing with formats ( .image are white ... )

StaticImageDisplay* imagebox;//will contain the art associated with a mission or quest
imagebox=new StaticImageDisplay();
imagebox->setRect(Rect::Rect(0,0,256,256));//will be updated soon with textures info
std::string path("noise.png");

imagebox->setId("imagebox");///give it a name
//to be optimized later ok ?
if(imagebox->setTexture(path))
printf("texture for load_menu loaded !\n");
else
printf("texture for load_menu FAILED !\n");

LoadGamePage->addChild( imagebox );// add it to mama page

GFXColor color( 1, .5, 0, .1 );
//load button.
NewButton *loadagame = new NewButton;
loadagame->setRect( Rect( -.50, .7, .37, .09 ) );
loadagame->setLabel( "load a game" );
loadagame->setCommand( "ShowJoinAccount" );

loadagame->setColor( GFXColor( color.r, color.g, color.b, .25 ) );
loadagame->setTextColor( GUI_OPAQUE_WHITE() );
loadagame->setDownColor( GFXColor( color.r, color.g, color.b, .5 ) );
loadagame->setDownTextColor( GUI_OPAQUE_BLACK() );
loadagame->setHighlightColor( GFXColor( color.r, color.g, color.b, .4 ) );
loadagame->setFont( Font( .07 ) );
LoadGamePage->addChild( loadagame );


}
And the diff for that update :
https://github.com/Ezeer/VegaStrike_win ... 103c0e3442

I will post a new demo video soon .
:D

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: [WIP] NEW INGAME MENU

Post by ezee »

:!: Before the video , some goodnews :

I FIGURED OUT HOW POS AND SCALE WORKS FOR TEXTURES ON SCREEN :
But there is still the old " bug " of inverted textures , so i commented the code to help the coders to
work with artists :
//HOW SIZE AND POS WORKS IN VS :
//WARNING FOR ARTISTS : The texture appear upside down ... will try to fix eh eh
//SAY YOU HAVE
// imagebox->setRect(Rect( -1, -1, 0.2, 0.2 ) )
//MEAN " LEFT CORNER BOTTOM , 20% of original size "
//ezee
imagebox->setRect(Rect( 0, 0, 0.5, 0.5 ) );//center of screen 50% scale
I'm gonna make this preview video now , then make a new diff .
:)

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

[WIP-VIDEO] NEW INGAME MENU

Post by ezee »

:!: The new video preview :
[youtube]http://youtu.be/CuOV-wjZPI4[/youtube]
https://www.youtube.com/watch?v=CuOV-wj ... e=youtu.be
:D

Edit : Latest diff : https://github.com/Ezeer/VegaStrike_win ... 2cc6b0054d

reedit : :idea: Make a brand new class
InGameMenu : publicGameMenu
that will introduce :
_ Sound for buttons
_ Animation
_ ListBox with picture to describe a mission or quest .

This kind of menu will use the first c++ menu's GUI system , that is really well written and
that was never fully used . So i basically try to use all i can ( that is , the source code is
a cockpit , and i trigger all the switchs to see what happens . :lol: )

I'm working in the listbox right now .
The plan is to scan a folder and extract the filenames .
By selecting a filename , you will see the picture associated with the mission ( and yeah ,
i could even read the file and give a short description of the mission too ...
Well , i have a lot of good :idea: , and happy to going ahead .
:wink:

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: [WIP] NEW INGAME MENU

Post by TBeholder »

But does it require a separate class? Baseinterface can do a lot... and also would help to move the issues like keyboard help with shown (and later configured) current bindings mostly into the province of slower, local and flexible Python code where it belongs. Same with mission selection, no?
As a prototype for default graphics, "premium_pad.png" would fit best, IMHO.

Then all we'll need is to move navscreen there too, and a way to link several instances of baseinterface with different owners: pad - ship - base (with basecomputer and navscreen elements accessible via nodes of all 3), and to have both convenient maps and stats screens available both in flight and obn base, and the basic version of "walkable ships" feature pretty much implemented - needs only mapping a few plain screens, some of which are already here (e.g. airlock of Commercial Center station).
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: [WIP] NEW INGAME MENU VIDEO

Post by ezee »

Hi .

I want to break free .
:lol:

nah , but the GUI C++ of Vegastrike is very cool and was never used i guess like i will .
Very cool features are there , hidden .
Just have a look to that design i'm working on :
NEW VIDEO :
https://www.youtube.com/watch?v=9KpLtYp ... e=youtu.be

Baseinterface ? Yeah , but i will work in that later .
:wink:

edit : Why an other class ?

I have many reasons to do that , but the first is to try to keep intact the base architecture of the GUI , written by Ace123 i guess .
The design is flexible and robust , and allow more complex menus build on it .
I don't want to change the root , but build on it .

The second reason is that i have in mind to make tools for vegastrike , and in // make
my own space game engine . I take from Vegastrike some good parts , in exchange i build
classes that can be used to improve/update the original engine .
Example : You used to call Gamenu:: for the ( not so :wink: ) basic 2005 menu stuff , you will just have to use InGameMenu or GameMenu2 for having access to 2014 compatible stuff .

For the menu part , i want to implement a PageMaker for example , that could read XML
file , and help to design menus without compile time . ( keep the good scripting side of VS)
Associate a sound with a button , automatic layer management etc ...
That could make a part of an SDK for Vegastrike ( software development Kit ) , with compiled libs to simplify the project management ( with sources to keep the cross platform dev possible ).

VegaStrike is a full game , not a gameEngine .
But i'm searching the gameEngine in VS , to be able to work on his multiples aspects .
The Network will be the more difficult part . ( for me indeed , gl is tricky also )

So now , the menu system is a friendly way to improve my c++ skills and better merge myself with the original author's spirit and this beautiful piece of software .
:D

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: [WIP] NEW INGAME MENU

Post by ezee »

:!: Prologue:
As i think there is a lack of information about how VS works internally , i choose again to share with you my observation.

About the default menu system :

The initial menu page is in reality a modified base : http://sourceforge.net/p/vegastrike/cod ... in_menu.py
I don't know why this design was chosen long time ago , probably to have an access to load saved games via the computer methods . Anyway ...

I've found today a line of c++ code that allow me to load my InGameMenu BEFORE the base main-menu.

Located in void bootstrap_first_loop() , main.cpp :
static bool isgamemenu = XMLSupport::parse_bool( vs_config->getVariable( "graphics", "main_menu", "false" ) );
The normal mode use isgamemenu=false ;
That mean that if the var "main_menu" don't exist int he vsconfig file , the default option applied is " false " .
And without surprise , this option is not yet defined in vegastrike.config

TO OFFICIAL DEVS:
PLEASE CONSIDER THAT THIS SHOULD BE FIXED !
WE HAVE C++ CODE THAT IS HARD CODED BECAUSE OF THAT .

THE FIX IS TO ADD THIS LINE :
<var name="main_menu" value="false"/>
IN THE "graphics" section of vegastrike.config .
Example:
<section name="graphics">
<var name="main_menu" value="false"/>
...
...
This way , from the user point of view , nothing change , the game will load as always .
BUT THIS VAR IS AN IMPORTANT SWITCH BETWEEN TWO GAME DESIGN .
ONCE SHE EXISTS , SHE CAN BE USED . :!:
So please think about it ... give a chance to the c++ gamemenu . :)

:!: Actual issues with isgamemenu=true
With isgamemenu=true , what happens is that the gamemenu loads .
But when we click " Single Player " , what is loaded is the main-menu base !
:lol:

The Snake eat its tail . :roll:
I will have to explore deeper the obscures caves of VS to remedy to that problem too .

Second issue is that "Neon effect " don't work at this stage in the code loop .
More info later , thx .

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: [WIP] NEW INGAME MENU

Post by ezee »

Good news .
It is possible to use the original c++ menu to replace the main_menu.py by doing the following :

_Step 1 :
Go to vegastrike.config , and add this line in the "graphics" section :
<section name="graphics">
<var name="main_menu" value="true"/>
...
...
_Step 2 :
If you want to bypass the main_menu.py when you press "Single Player " in the c++ menu ,
change this line in the vegastrike.config file
<section name="general">
<var name="times_to_show_help_screen" value="-1"/>
<var name="dockingtime" value="20"/>
<var name="remember_savegame" value="false"/>
<var name="load_last_savegame" value="false"/>
<var name="write_savegame_on_exit" value="false"/>
<var name="debug_config" value="false"/>
<var name="debug_fs" value="0"/> <!-- set to 3 for most comprehensive debugging-->
<var name="default_mission" value="test/tutorial.mission"/><!-- old: value="main_menu.mission" -->
you can change the mission by your prefered , just explore the missions folder . :wink:
But the tutorial is perfect for the new comers .

That should work , and give you a preview of a menu with buttons .
And soon come my very cool menu with the same background that main_py , but with buttons etc ... last video preview -> https://www.youtube.com/watch?v=9KpLtYp ... e=youtu.be
8)

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
Posts: 703
Joined: Tue Feb 11, 2014 12:47 am
Location: FRANCE
Contact:

Re: [WIP] NEW INGAME MENU

Post by ezee »

:idea: More about the use of C++GUI in Vegastrike :
The base's computer actually uses the same classes than the Menu .


For me , that mean that i have some working example of what the GUI is able to do .
And i will use the existing code to create my menu's page layers .
This way , i later will be able to make the Menu and the Computer have unified design .
With that design idea , it is possible to customize the appearance of the base's computer too ,
depending in wich alien system you are ( from color ranges to a lot of things ) .

But the art will be the second step , i need to learn how to manage all the controls first .
EXAMPLE :

I plan to be able to use a mission selector , and to read some data then display it as text in the
Load menu's page .
How the computer do it with " News" :
//Load the controls for the News display.
void BaseComputer::loadLoadSaveControls( void )
{
SimplePicker *picker = static_cast< SimplePicker* > ( window()->findControlById( "LoadSavePicker" ) );
assert( picker != NULL );
picker->clear();
//Get news from save game.
Unit *playerUnit = m_player.GetUnit();
if (playerUnit) {
struct dirent **dirlist;
std::string savedir = VSFileSystem::homedir+"/save/";
int ret = scandir( savedir.c_str(), &dirlist, nodirs, (scancompare)&datesort );
while (ret-- > 0)
picker->addCell( new SimplePickerCell( dirlist[ret]->d_name ) );
}

//Make sure the description is empty.
StaticDisplay *desc = static_cast< StaticDisplay* > ( window()->findControlById( "Description" ) );
assert( desc != NULL );
desc->setText( "" );

//Make the title right.
recalcTitle();
}
I have good information now to deal with saved games and more .
You too .
:wink:

Code: Select all

 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }
Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: [WIP] NEW INGAME MENU

Post by klauss »

That reminds me, the base interface exposed to Python lacks any simple interface for those complex text-based layouts. While you can put any kind of text anywhere and handle the clicks (ie: you have all the primitives you need to build anything), doing so with the primitives is hard work. It would be nice if some of those complex text controls could be exposed to Python, to simplify some text-based screens.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
TBeholder
Elite Venturer
Elite Venturer
Posts: 753
Joined: Sat Apr 15, 2006 2:40 am
Location: chthonic safety

Re: [WIP] NEW INGAME MENU

Post by TBeholder »

So... PyGTK? Then a lot of it may be be a simple gtkrc. One can do more with Glade and mucking around than just with mucking around, and all that. :wink: Also, perhaps then PyGlade can be tweaked to generate ready-to-use bases WYSIWYG?
"Two Eyes Good, Eleven Eyes Better." -Michele Carter
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: [WIP] NEW INGAME MENU

Post by klauss »

I don't think you can use GTK in-game
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Post Reply