상속: DistinctOption
예제 #1
0
        /// <summary>
        /// Erzeugt eine neue Instanz eines ProfileSettingsScreen-Objekts und initialisiert dieses mit einem Knot3Game-Objekt.
        /// </summary>
        public GeneralSettingsScreen(GameCore game)
            : base(game)
        {
            MenuName = "General";

            InputItem playerNameInput = new InputItem (
                screen: this,
                drawOrder: DisplayLayer.ScreenUI + DisplayLayer.MenuItem,
                text: "Player Name:",
                inputText: Config.Default ["profile", "name", "Player"]
            );
            playerNameInput.OnValueSubmitted += () => {
                Config.Default ["profile", "name", String.Empty] = playerNameInput.InputText;
            };
            settingsMenu.Add (playerNameInput);

            // Languages
            LanguageOption languageOption = new LanguageOption (
                section: "language",
                name: "current",
                configFile: Config.Default
            );
            ComboBox languageItem = new ComboBox (
                screen: this,
                drawOrder: DisplayLayer.ScreenUI + DisplayLayer.MenuItem,
                text: "Language"
            );
            languageItem.AddEntries (languageOption);
            settingsMenu.Add (languageItem);
        }
예제 #2
0
        public void Init()
        {
            lang1 = new Language (file: Localizer.LanguageDirectory + "xx.ini");
            lang1.DisplayName = "XX";
            lang1.Localization ["text", "new game", ""] = "Neues Spiel";

            lang2 = new Language (file: Localizer.LanguageDirectory + "xy.ini");
            lang2.DisplayName = "XY";
            lang2.Localization ["text", "new game", ""] = "New Game";

            languageOption = new LanguageOption (
                section: "language",
                name: "current",
                configFile: Config.Default
            );
        }