moving main menu/removing "how to play"

ABK

Well-known member
Id like to move the menu a bit, i remember there was someone who made it but i dont know where to start, there was feature that allowed us to rename menu items to different languages, is it still hardcoded?
 
there was something like this long time ago, i think in 2005 , we could use txt file to rename menu into other languages but i think it was removed later by someone, maybe it was just some unstable qucikhack.
 
(Sorry if I'm bumping old things but I was digging around for something else.)

@bWWd -Not sure if you solved this, but this is still supported by openbor. 

You need a file called translation.txt  - it looks like this.

Code:
msgid 
"This file should be place in data folder"
"msgid : this is original text in code."
"msgstr : this is your translation."
msgstr 
"Leave this blank if you don't want to translate it."
"Lines below this are what you need to modify."

msgid "  Done!"
msgstr ""
msgid " - Device Not Ready"
msgstr ""
msgid "%d%% AC Power"
msgstr ""
msgid "%i by Mod"
msgstr ""
msgid "%s - Finish Game %i Times To UnLock"
msgstr ""
msgid "%s - Finish Game To UnLock"
msgstr ""
msgid "%s KBytes"
msgstr ""
msgid "Advanced Options..."
msgstr ""
msgid "Advanced Sound Options"
msgstr ""
msgid "Analog Pad Disabled"
msgstr ""
msgid "Analog Pad Enabled"
msgstr ""
msgid "Apply"
msgstr ""
msgid "Automatic"
msgstr ""
msgid "BGM:"
msgstr ""
msgid "Back"
msgstr ""
msgid "Battery:"
msgstr ""
msgid "Bilinear"
msgstr ""
msgid "Bits:"
msgstr ""
msgid "Brightness:"
msgstr ""
msgid "CPU Speed:"
msgstr ""
msgid "Calculating..."
msgstr ""
msgid "Cancel"
msgstr ""
msgid "Charging:"
msgstr ""
msgid "Cheat Options"
msgstr ""
msgid "Cheats:"
msgstr ""
msgid "Choose Mode"
msgstr ""
msgid "Clear Bonus"
msgstr ""
msgid "Complete"
msgstr ""
msgid "Config Settings"
msgstr ""
msgid "Configuration Settings"
msgstr ""
msgid "Continue"
msgstr ""
msgid "Control Options"
msgstr ""
msgid "Control Options..."
msgstr ""
msgid "Credit %i"
msgstr ""
msgid "Credits:"
msgstr ""
msgid "Debug Info:"
msgstr ""
msgid "Disabled by Mod"
msgstr ""
msgid "Disabled"
msgstr ""
msgid "Discard"
msgstr ""
msgid "Display Mode:"
msgstr ""
msgid "Display:"
msgstr ""
msgid "Enabled by Mod"
msgstr ""
msgid "Enabled"
msgstr ""
msgid "End Game"
msgstr ""
msgid "FPS: %03d"
msgstr ""
msgid "File Logging:"
msgstr ""
msgid "Filters:"
msgstr ""
msgid "Free Ram: %s KBytes"
msgstr ""
msgid "Frequency:"
msgstr ""
msgid "Full"
msgstr ""
msgid "Fullscreen Type:"
msgstr ""
msgid "GAME OVER"
msgstr ""
msgid "GFX Filters:"
msgstr ""
msgid "Game Mode"
msgstr ""
msgid "GamePads Disabled"
msgstr ""
msgid "GamePads Enabled"
msgstr ""
msgid "Gamma:"
msgstr ""
msgid "Guide R/L Thumbsticks"
msgstr ""
msgid "Hall Of Fame"
msgstr ""
msgid "How To Play"
msgstr ""
msgid "Infinite Credits Off"
msgstr ""
msgid "Infinite Credits On"
msgstr ""
msgid "Infinite Health Off"
msgstr ""
msgid "Infinite Health On"
msgstr ""
msgid "Infinite Lives Off"
msgstr ""
msgid "Infinite Lives On"
msgstr ""
msgid "Level:"
msgstr ""
msgid "Life bonus"
msgstr ""
msgid "Load Game"
msgstr ""
msgid "Load Settings From Default.cfg%s"
msgstr ""
msgid "Loading..."
msgstr ""
msgid "Mode:"
msgstr ""
msgid "Music Volume:"
msgstr ""
msgid "New Game"
msgstr ""
msgid "No"
msgstr ""
msgid "Not Found!"
msgstr ""
msgid "Nunchuk Analog Disabled"
msgstr ""
msgid "Nunchuk Analog Enabled"
msgstr ""
msgid "OK"
msgstr ""
msgid "Off"
msgstr ""
msgid "On"
msgstr ""
msgid "OpenGL"
msgstr ""
msgid "Options"
msgstr ""
msgid "Overscan:"
msgstr ""
msgid "PRESS START"
msgstr ""
msgid "Pause"
msgstr ""
msgid "Player %i"
msgstr ""
msgid "Player Lives:"
msgstr ""
msgid "Players:"
msgstr ""
msgid "Please Wait"
msgstr ""
msgid "Preserve Aspect Ratio"
msgstr ""
msgid "Press R/L Thumbsticks"
msgstr ""
msgid "Press Start"
msgstr ""
msgid "Quit"
msgstr ""
msgid "Ready!"
msgstr ""
msgid "Restore OpenBoR Defaults%s"
msgstr ""
msgid "Rush Bonus"
msgstr ""
msgid "SDL"
msgstr ""
msgid "SFX Volume:"
msgstr ""
msgid "Save Settings To Default.cfg%s"
msgstr ""
msgid "Saved File:"
msgstr ""
msgid "Screen Size:"
msgstr ""
msgid "Screen:"
msgstr ""
msgid "Select Hero"
msgstr ""
msgid "Setup Player 1..."
msgstr ""
msgid "Setup Player 2..."
msgstr ""
msgid "Setup Player 3..."
msgstr ""
msgid "Setup Player 4..."
msgstr ""
msgid "Show Titles:"
msgstr ""
msgid "Simple"
msgstr ""
msgid "Sound Options"
msgstr ""
msgid "Sound Options..."
msgstr ""
msgid "Sound Volume:"
msgstr ""
msgid "Stage %i Complete!"
msgstr ""
msgid "Stage"
msgstr ""
msgid "Stage:"
msgstr ""
msgid "Start Game"
msgstr ""
msgid "Stretch to Screen"
msgstr ""
msgid "System Options"
msgstr ""
msgid "System Options..."
msgstr ""
msgid "TIME OVER"
msgstr ""
msgid "Total RAM:"
msgstr ""
msgid "Total Ram: %s KBytes"
msgstr ""
msgid "Total Score"
msgstr ""
msgid "Used RAM:"
msgstr ""
msgid "Used Ram: %s KBytes"
msgstr ""
msgid "Versus Damage:"
msgstr ""
msgid "Video Backend:"
msgstr ""
msgid "Video Options"
msgstr ""
msgid "Video Options..."
msgstr ""
msgid "Window Offset:"
msgstr ""
msgid "Window"
msgstr ""
msgid "Yes"
msgstr ""

"This file should be place in data folder"
"msgid : this is original text in code."
"msgstr : this is your translation."
msgstr
"Leave this blank if you don't want to translate it."
"Lines below this are what you need to modify."

In my example I've renamed "Hall of Fame" to "Hi-Scores" and rename "How to Play" to "Credits" :

Code:
msgid "Hall Of Fame"
msgstr "Hi-Scores"
msgid "How To Play"
msgstr "Credits"

(Screenshot of this in action from my WOLF3D mod) 

'Hall of Fame' is now READ THIS! - 'Hall of Fame' is now 'View Scores'
WOLF_0075.png

 
BeasTie said:

[list type=decimal]
[*]Thread resurrection is allowed, so no worries. We prefer that over double posting.
[*]I had no idea about translation - that's a pretty awesome feature. Goes to show the engine has tons of hidden gems, even to folks who have worked on it for years.
[/list]

 
Dam I wish I had mentioned sooner than.

I admit I've had confusion over the years because I would be absent from openbor for long periods.

Not sure who implemented it, but I think utunnels might of posted it on lavalit before it went down.  I can remember he would often reply to threads and post about features that no one else knew about.  This was one of the reasons I was starting to rebuild the manual/CHM help files and created the helpful links post to keep tabs on all the threads.

 
Unless you really, REALLY, want to move the menu, I would say let this go. The native menu position is hard coded based on resolution settings, and there's no way to change it, not even with script.

The only way you could do this is to use script to build your own menu entirely from nothing. That is is very difficult unless you are good with scripts and tedious to do even for expert coders.

DC
 
I looked into this msmalik681, and discovered very quickly it isn't worth it. The number of new variables, functions, and adjustments involved to make it all work is just be too much to justify. Controlling them would almost as tedious as building your own with script anyway.

Still, it might be something to consider, except that Plombo was working on an XML based menu system anyway, and I'd much rather see his completed than reinvent the wheel.

DC
 
You can do it by editing sourcecode and compiling, its easy to remove some stuff and change positions around in there, i did it like 8-10 years ago to see if its possible and wont cause big issues.But i actually dont remember if it did caused problems.
 
bWWd said:
You can do it by editing sourcecode and compiling, its easy to remove some stuff and change positions around in there, i did it like 8-10 years ago to see if its possible and wont cause big issues.But i actually dont remember if it did caused problems.
Hi bWWd
A few months ago I made some tests with the source code (build 6330) and compiled a build with no "how to play" option. Here is the file:
https://drive.google.com/file/d/1kLW7swTb21vIv1VGfK5o6iuXDOdqh7zI/view?usp=sharing

After some tests with menus in my games, I identified the OpenBOR "main menu" code inside the file "openbor.c" at the line "38538" (if you are using notepad++). Here's the code:
Code:
void openborMain(int argc, char **argv)
{
    sprite_map = NULL;
    int quit = 0;
    int relback = 1;
    int selector = 0;
    u32 introtime = 0;
    int started = 0;
    char tmpBuff[MAX_BUFFER_LEN] = {""};
    int players[MAX_PLAYERS] = {0, 0, 0, 0};
    int i;
    int argl;

    printf("OpenBoR %s, Compile Date: " __DATE__ "\n\n", VERSION);

    if(argc > 1)
    {
        argl = strlen(argv[1]);
        if(argl > 14 && !memcmp(argv[1], "offscreenkill=", 14))
        {
            DEFAULT_OFFSCREEN_KILL = getValidInt((char *)argv[1] + 14, "", "");
        }
        if(argl > 14 && !memcmp(argv[1], "showfilesused=", 14))
        {
            printFileUsageStatistics = getValidInt((char *)argv[1] + 14, "", "");
        }
    }


    modelcmdlist = createModelCommandList();
    modelstxtcmdlist = createModelstxtCommandList();
    levelcmdlist = createLevelCommandList();
    levelordercmdlist = createLevelOrderCommandList();
    createModelList();

    // Load necessary components.
    printf("Game Selected: %s\n\n", packfile);
    loadsettings();
    startup();

    if(skiptoset < 0)
    {

        // New alternative background path for PSP
        if(custBkgrds != NULL)
        {
            strcpy(tmpBuff, custBkgrds);
            strcat(tmpBuff, "logo");
            load_background(tmpBuff, 0);
        }
        else
        {
            load_cached_background("data/bgs/logo", 0);
        }

        while(_time < GAME_SPEED * 6 && !(bothnewkeys & (FLAG_ANYBUTTON | FLAG_ESC)))
        {
            update(0, 0);
        }

        music("data/music/remix", 1, 0);

        // New alternative scene path for PSP
        if(custScenes != NULL)
        {
            strcpy(tmpBuff, custScenes);
            strcat(tmpBuff, "logo.txt");
            playscene(tmpBuff);
        }
        else
        {
            playscene("data/scenes/logo.txt");
        }
    }
    clearscreen(background);

    while(!quit)
    {
        if(skiptoset < 0 && !(goto_mainmenu_flag&8))
        {
            if(_time >= introtime)
            {
                // New alternative scene path for PSP
                if(custScenes != NULL)
                {
                    strcpy(tmpBuff, custScenes);
                    strcat(tmpBuff, "intro.txt");
                    playscene(tmpBuff);
                }
                else
                {
                    playscene("data/scenes/intro.txt");
                }
                update(0, 0);
                introtime = _time + GAME_SPEED * 20;
                relback = 1;
                started = 0;
            }

            if(bothnewkeys & FLAG_ESC)
            {
                quit = 1;
            }
        }
        else
        {
            started = 1;
            relback = 0;
        }

        if (goto_mainmenu_flag != 0) goto_mainmenu_flag = 0;
        if(!started)
        {
            if((_time % GAME_SPEED) < (GAME_SPEED / 2))
            {
                _menutextm(0, 0, 0, Tr("PRESS START"));
            }
            if(bothnewkeys & (FLAG_ANYBUTTON))
            {
                started = 1;
                relback = 1;
            }
        }
        else if(skiptoset >= 0)
        {
            loadGameFile();
            playgame(players, useSet >= 0 ? useSet : skiptoset, useSave);
        }
        else
        {
            _menutextm((selector == 0), 2, 0, Tr("Start Game"));
            _menutextm((selector == 1), 3, 0, Tr("Options"));
            _menutextm((selector == 2), 4, 0, Tr("Hall Of Fame"));
            _menutextm((selector == 3), 5, 0, Tr("Quit"));
            if(selector < 0)
            {
                selector = 3;
            }
            if(selector > 3)
            {
                selector = 0;
            }

            if(bothnewkeys)
            {
                introtime = _time + GAME_SPEED * 20;
            }

            if(bothnewkeys & FLAG_MOVEUP)
            {
                --selector;
                if(SAMPLE_BEEP >= 0)
                {
                    sound_play_sample(SAMPLE_BEEP, 0, savedata.effectvol, savedata.effectvol, 100);
                }
            }
            if(bothnewkeys & FLAG_MOVEDOWN)
            {
                ++selector;
                if(SAMPLE_BEEP >= 0)
                {
                    sound_play_sample(SAMPLE_BEEP, 0, savedata.effectvol, savedata.effectvol, 100);
                }
            }
            if(bothnewkeys & (FLAG_ANYBUTTON))
            {
                if(SAMPLE_BEEP2 >= 0)
                {
                    sound_play_sample(SAMPLE_BEEP2, 0, savedata.effectvol, savedata.effectvol, 100);
                }
                switch(selector)
                {
                case 0:
                    for(i = 0; i < MAX_PLAYERS; i++)
                    {
                        players[i] = player[i].newkeys & (FLAG_ANYBUTTON);
                    }
                    relback = choose_mode(players);
                    if(relback)
                    {
                        started = 0;
                    }
                    break;
                case 1:
                    menu_options();
                    break;
                case 2:
                    hallfame(0);
                    relback = 1;
                    break;
                default:
                    quit = 1;
                    break;
                }
                introtime = _time + GAME_SPEED * 20;
            }
        }
        if(relback)
        {
            if(started)
            {
                menuScreen  = 1;
                titleScreen = 0;
                if(custBkgrds != NULL)
                {
                    strcpy(tmpBuff, custBkgrds);
                    strcat(tmpBuff, "titleb");
                    load_background(tmpBuff, 0);
                }
                else
                {
                    load_cached_background("data/bgs/titleb", 0);
                }
            }
            else
            {
                menuScreen  = 0;
                titleScreen = 1;
                if(custBkgrds != NULL)
                {
                    strcpy(tmpBuff, custBkgrds);
                    strcat(tmpBuff, "title");
                    load_background(tmpBuff, 0);
                }
                else
                {
                    load_cached_background("data/bgs/title", 0);
                }
            }

            if(!sound_query_music(NULL, NULL))
            {
                music("data/music/remix", 1, 0);
            }
            relback = 0;
        }
        update(0, 0);
    }
    borShutdown(0, DEFAULT_SHUTDOWN_MESSAGE);
}

I don't know if this change can cause some problems, but I didn't find any issues at the moment. I hope it can help you
 
Kratus said:
bWWd said:
You can do it by editing sourcecode and compiling, its easy to remove some stuff and change positions around in there, i did it like 8-10 years ago to see if its possible and wont cause big issues.But i actually dont remember if it did caused problems.
Hi bWWd
A few months ago I made some tests with the source code (build 6330) and compiled a build with no "how to play" option. Here is the file:
https://drive.google.com/file/d/1kLW7swTb21vIv1VGfK5o6iuXDOdqh7zI/view?usp=sharing

After some tests with menus in my games, I identified the OpenBOR "main menu" code inside the file "openbor.c" at the line "38538" (if you are using notepad++). Here's the code:
Code:
void openborMain(int argc, char **argv)
{
    sprite_map = NULL;
    int quit = 0;
    int relback = 1;
    int selector = 0;
    u32 introtime = 0;
    int started = 0;
    char tmpBuff[MAX_BUFFER_LEN] = {""};
    int players[MAX_PLAYERS] = {0, 0, 0, 0};
    int i;
    int argl;

    printf("OpenBoR %s, Compile Date: " __DATE__ "\n\n", VERSION);

    if(argc > 1)
    {
        argl = strlen(argv[1]);
        if(argl > 14 && !memcmp(argv[1], "offscreenkill=", 14))
        {
            DEFAULT_OFFSCREEN_KILL = getValidInt((char *)argv[1] + 14, "", "");
        }
        if(argl > 14 && !memcmp(argv[1], "showfilesused=", 14))
        {
            printFileUsageStatistics = getValidInt((char *)argv[1] + 14, "", "");
        }
    }


    modelcmdlist = createModelCommandList();
    modelstxtcmdlist = createModelstxtCommandList();
    levelcmdlist = createLevelCommandList();
    levelordercmdlist = createLevelOrderCommandList();
    createModelList();

    // Load necessary components.
    printf("Game Selected: %s\n\n", packfile);
    loadsettings();
    startup();

    if(skiptoset < 0)
    {

        // New alternative background path for PSP
        if(custBkgrds != NULL)
        {
            strcpy(tmpBuff, custBkgrds);
            strcat(tmpBuff, "logo");
            load_background(tmpBuff, 0);
        }
        else
        {
            load_cached_background("data/bgs/logo", 0);
        }

        while(_time < GAME_SPEED * 6 && !(bothnewkeys & (FLAG_ANYBUTTON | FLAG_ESC)))
        {
            update(0, 0);
        }

        music("data/music/remix", 1, 0);

        // New alternative scene path for PSP
        if(custScenes != NULL)
        {
            strcpy(tmpBuff, custScenes);
            strcat(tmpBuff, "logo.txt");
            playscene(tmpBuff);
        }
        else
        {
            playscene("data/scenes/logo.txt");
        }
    }
    clearscreen(background);

    while(!quit)
    {
        if(skiptoset < 0 && !(goto_mainmenu_flag&8))
        {
            if(_time >= introtime)
            {
                // New alternative scene path for PSP
                if(custScenes != NULL)
                {
                    strcpy(tmpBuff, custScenes);
                    strcat(tmpBuff, "intro.txt");
                    playscene(tmpBuff);
                }
                else
                {
                    playscene("data/scenes/intro.txt");
                }
                update(0, 0);
                introtime = _time + GAME_SPEED * 20;
                relback = 1;
                started = 0;
            }

            if(bothnewkeys & FLAG_ESC)
            {
                quit = 1;
            }
        }
        else
        {
            started = 1;
            relback = 0;
        }

        if (goto_mainmenu_flag != 0) goto_mainmenu_flag = 0;
        if(!started)
        {
            if((_time % GAME_SPEED) < (GAME_SPEED / 2))
            {
                _menutextm(0, 0, 0, Tr("PRESS START"));
            }
            if(bothnewkeys & (FLAG_ANYBUTTON))
            {
                started = 1;
                relback = 1;
            }
        }
        else if(skiptoset >= 0)
        {
            loadGameFile();
            playgame(players, useSet >= 0 ? useSet : skiptoset, useSave);
        }
        else
        {
            _menutextm((selector == 0), 2, 0, Tr("Start Game"));
            _menutextm((selector == 1), 3, 0, Tr("Options"));
            _menutextm((selector == 2), 4, 0, Tr("Hall Of Fame"));
            _menutextm((selector == 3), 5, 0, Tr("Quit"));
            if(selector < 0)
            {
                selector = 3;
            }
            if(selector > 3)
            {
                selector = 0;
            }

            if(bothnewkeys)
            {
                introtime = _time + GAME_SPEED * 20;
            }

            if(bothnewkeys & FLAG_MOVEUP)
            {
                --selector;
                if(SAMPLE_BEEP >= 0)
                {
                    sound_play_sample(SAMPLE_BEEP, 0, savedata.effectvol, savedata.effectvol, 100);
                }
            }
            if(bothnewkeys & FLAG_MOVEDOWN)
            {
                ++selector;
                if(SAMPLE_BEEP >= 0)
                {
                    sound_play_sample(SAMPLE_BEEP, 0, savedata.effectvol, savedata.effectvol, 100);
                }
            }
            if(bothnewkeys & (FLAG_ANYBUTTON))
            {
                if(SAMPLE_BEEP2 >= 0)
                {
                    sound_play_sample(SAMPLE_BEEP2, 0, savedata.effectvol, savedata.effectvol, 100);
                }
                switch(selector)
                {
                case 0:
                    for(i = 0; i < MAX_PLAYERS; i++)
                    {
                        players[i] = player[i].newkeys & (FLAG_ANYBUTTON);
                    }
                    relback = choose_mode(players);
                    if(relback)
                    {
                        started = 0;
                    }
                    break;
                case 1:
                    menu_options();
                    break;
                case 2:
                    hallfame(0);
                    relback = 1;
                    break;
                default:
                    quit = 1;
                    break;
                }
                introtime = _time + GAME_SPEED * 20;
            }
        }
        if(relback)
        {
            if(started)
            {
                menuScreen  = 1;
                titleScreen = 0;
                if(custBkgrds != NULL)
                {
                    strcpy(tmpBuff, custBkgrds);
                    strcat(tmpBuff, "titleb");
                    load_background(tmpBuff, 0);
                }
                else
                {
                    load_cached_background("data/bgs/titleb", 0);
                }
            }
            else
            {
                menuScreen  = 0;
                titleScreen = 1;
                if(custBkgrds != NULL)
                {
                    strcpy(tmpBuff, custBkgrds);
                    strcat(tmpBuff, "title");
                    load_background(tmpBuff, 0);
                }
                else
                {
                    load_cached_background("data/bgs/title", 0);
                }
            }

            if(!sound_query_music(NULL, NULL))
            {
                music("data/music/remix", 1, 0);
            }
            relback = 0;
        }
        update(0, 0);
    }
    borShutdown(0, DEFAULT_SHUTDOWN_MESSAGE);
}

I don't know if this change can cause some problems, but I didn't find any issues at the moment. I hope it can help you
Wow, its sounds good)

It needs to find menu positions in https://github.com/DCurrent/openbor/blob/master/engine/openbor.c file and add ability to read value from txt file (maybe data/menu.txt for example)? And then push change request in repo?
 
No worries. If someone can find a better way that doesn't have all the problems I mentioned, I'll accept it into source. But without a whole new way of thinking (see Plombo's design), I don't see it happening.

DC
 
Back
Top Bottom