Example #1
0
    public SetPiecesDialog(MainMenuUi mainMenuUi)
    {
        _mainMenuUi = mainMenuUi;

        WidgetDoc doc = WidgetDoc.Load("ui/main_menu_setpieces.json");

        doc.GetButton("go").SetClickHandler(() =>
        {
            mWidget.Hide();
            LaunchScenario();
        });
        doc.GetButton("cancel").SetClickHandler(() =>
        {
            mWidget.Hide();
            _mainMenuUi.Show(MainMenuPage.MainMenu);
        });

        mListBox = doc.GetScrollView("scenariosList");

        mWidget = doc.GetRootContainer();
        mWidget.Hide();
    }
Example #2
0
    public ViewCinematicsDialog(MainMenuUi mainMenu, IDictionary <int, string> mmMes)
    {
        _mainMenu = mainMenu;

        WidgetDoc doc = WidgetDoc.Load("ui/main_menu_cinematics.json");

        doc.GetButton("view").SetClickHandler(() =>
        {
            if (mSelection < 0 || mSelection >= seenIndices.Count)
            {
                return;
            }
            var movieIdx = seenIndices[mSelection];
            if (movieIdx < 0 || movieIdx >= movieIds.Count)
            {
                return;
            }
            var movieId = movieIds[movieIdx];
            GameSystems.Movies.PlayMovieId(movieId, 0);
        });
        doc.GetButton("cancel").SetClickHandler(() =>
        {
            mWidget.Hide();
            _mainMenu.Show(MainMenuPage.Options);
        });

        mListBox = doc.GetScrollView("cinematicsList");

        mWidget = doc.GetRootContainer();
        mWidget.Hide();

        for (var i = 0; i < 24; i++)
        {
            mMovieNames[i] = mmMes[2000 + i];
        }
    }