示例#1
0
void BootMode::_ReloadTranslatableMenus()
{
    _SetupMainMenu();
    _SetupOptionsMenu();
    _SetupVideoOptionsMenu();
    _SetupAudioOptionsMenu();
    _SetupKeySettingsMenu();
    _SetupJoySettingsMenu();
    _SetupResolutionMenu();
}
示例#2
0
BootMode::BootMode() :
    GameMode(MODE_MANAGER_BOOT_MODE),
    _boot_state(BOOT_STATE_INTRO),
    _exiting_to_new_game(false),
    _new_game_called(false),
    _menu_handler(this),
    _menu_bar_alpha(0.0f),
    _help_text_alpha(0.0f)
{
    _current_instance = this;

#ifdef DEBUG_FEATURES
    _debug_script_menu_open = false;

    // List the debug scripts
    _debug_scripts = vt_utils::ListDirectory("data/debug", ".lua");

    _debug_script_menu.SetPosition(512.0f, 128.0f);
    _debug_script_menu.SetTextStyle(TextStyle("text24"));
    _debug_script_menu.SetAlignment(VIDEO_X_CENTER, VIDEO_Y_CENTER);
    _debug_script_menu.SetOptionAlignment(VIDEO_X_CENTER, VIDEO_Y_CENTER);
    _debug_script_menu.SetSelectMode(VIDEO_SELECT_SINGLE);
    _debug_script_menu.SetHorizontalWrapMode(VIDEO_WRAP_MODE_STRAIGHT);
    _debug_script_menu.SetCursorOffset(-50.0f, -28.0f);
    _debug_script_menu.SetSkipDisabled(true);

    _debug_script_menu.ClearOptions();
    float debug_win_height = 20.0f * static_cast<float>(_debug_scripts.size());
    _debug_script_menu.SetDimensions(300.0f, debug_win_height > 600.0f ? 600.0f : debug_win_height,
                                     1, 255, 1, _debug_scripts.size());
    for (std::string file : _debug_scripts)
        _debug_script_menu.AddOption(vt_utils::MakeUnicodeString(file));

    // Create the debug window used as background
    _debug_scripts_window.Create(400.0f, 550.0f);
    _debug_scripts_window.SetPosition(310.0f, 58.0f);
    _debug_scripts_window.Hide();
#endif

    // Remove potential previous ambient overlays
    VideoManager->DisableFadeEffect();

    // Note: Not translated on purpose.
    _version_text.SetStyle(TextStyle("text18"));
    std::string version_string = "Version 1.0.0 - Development version";

    // NOTE: Only leave the " - " part for releases.
    version_string.append(" - ");
    version_string.append(__DATE__);
    _version_text.SetText(MakeUnicodeString(version_string));

    // Get rid of the old table to make sure no old data is used.
    ScriptManager->DropGlobalTable("boot");

    // Test the existence and validity of the boot script.
    ReadScriptDescriptor boot_script;
    if(!boot_script.OpenFile("data/boot_menu/boot.lua")) {
        PRINT_ERROR << "Failed to load boot data file" << std::endl;
        SystemManager->ExitGame();
        return;
    }

    // Open the boot table spacename
    if(boot_script.OpenTablespace().empty()) {
        PRINT_ERROR << "The boot script file has not set a correct tablespace" << std::endl;
        SystemManager->ExitGame();
        return;
    }
    boot_script.CloseTable(); // The namespace
    boot_script.CloseFile();

    // Trigger the Initialize functions in the scene script component
    GetScriptSupervisor().AddScript("data/boot_menu/boot.lua");
    GetScriptSupervisor().Initialize(this);

    // Load the menu bar and the help text
    _menu_bar.Load("data/gui/battle/battle_bottom_menu.png", 1024, 128);

    _SetupMainMenu();

    _f1_help_text.SetStyle(TextStyle("text18"));

    // The timer that will be used to display the menu bar and the help text
    _boot_timer.Initialize(14000);
    _boot_timer.EnableManualUpdate();
    _boot_timer.Run();

    // Preload new game sound
    AudioManager->LoadSound("data/sounds/new_game.wav", this);
}
示例#3
0
void BootMode::ReloadTranslatedTexts()
{
    _SetupMainMenu();
}
示例#4
0
BootMode::BootMode() :
    _boot_state(BOOT_STATE_INTRO),
    _exiting_to_new_game(false),
    _has_modified_settings(false),
    _first_run(false),
    _key_setting_function(NULL),
    _joy_setting_function(NULL),
    _joy_axis_setting_function(NULL),
    _message_window(ustring(), 210.0f, 733.0f),
    _menu_bar_alpha(0.0f),
    _help_text_alpha(0.0f)
{
    // Remove potential previous ambient overlays
    VideoManager->DisableFadeEffect();

    IF_PRINT_DEBUG(BOOT_DEBUG) << "BootMode constructor invoked" << std::endl;
    mode_type = MODE_MANAGER_BOOT_MODE;

    // Note: Not translated on purpose.
    _version_text.SetStyle(TextStyle("text18"));
    std::string version_string = "Development Release - ";
    version_string.append(__DATE__);
    _version_text.SetText(MakeUnicodeString(version_string));

    // Get rid of the old table to make sure no old data is used.
    ScriptManager->DropGlobalTable("boot");

    // Test the existence and validity of the boot script.
    ReadScriptDescriptor boot_script;
    if(!boot_script.OpenFile("dat/config/boot.lua")) {
        PRINT_ERROR << "Failed to load boot data file" << std::endl;
        SystemManager->ExitGame();
        return;
    }

    // Open the boot table spacename
    if(boot_script.OpenTablespace().empty()) {
        PRINT_ERROR << "The boot script file has not set a correct tablespace" << std::endl;
        SystemManager->ExitGame();
        return;
    }
    boot_script.CloseTable(); // The namespace
    boot_script.CloseFile();

    // Trigger the Initialize functions in the scene script component
    GetScriptSupervisor().AddScript("dat/config/boot.lua");
    GetScriptSupervisor().Initialize(this);

    _options_window.Create(300.0f, 550.0f);
    _options_window.SetPosition(360.0f, 188.0f);
    _options_window.SetDisplayMode(VIDEO_MENU_INSTANT);
    _options_window.Hide();

    // Setup all boot menu options and properties
    _SetupMainMenu();
    _SetupOptionsMenu();
    _SetupVideoOptionsMenu();
    _SetupAudioOptionsMenu();
    _SetupLanguageOptionsMenu();
    _SetupKeySettingsMenu();
    _SetupJoySettingsMenu();
    _SetupResolutionMenu();
    _active_menu = &_main_menu;

    // make sure message window is not visible
    _message_window.Hide();

    // Load the menu bar and the help text
    _menu_bar.Load("img/menus/battle_bottom_menu.png", 1024, 128);

    _f1_help_text.SetStyle(TextStyle("text18"));

    // The timer that will be used to display the menu bar and the help text
    _boot_timer.Initialize(14000);
    _boot_timer.EnableManualUpdate();
    _boot_timer.Run();

    // Preload test sound
    AudioManager->LoadSound("snd/volume_test.wav", this);
    // Preload main sounds
    AudioManager->LoadSound("snd/confirm.wav", this);
    AudioManager->LoadSound("snd/cancel.wav", this);
    AudioManager->LoadSound("snd/bump.wav", this);
    AudioManager->LoadSound("snd/new_game.wav", this);
} // BootMode::BootMode()