Esempio n. 1
0
        /// <summary>
        /// The main function of this class, this is where the system
        /// enters. It handles the initialization, setup of the
        /// logging subsystems, and setup of the GUI elements.
        /// </summary>
        public static void Main(string[] args)
        {
            // Set up config storage
            Game.LoadConfig();

            // Set up the Gtk and our structures
            Application.Init();

            // Create the game window and show it
            GameWindow window = new GameWindow();

            window.Show();

            Theme.GetThemes();

            // Start the Gtk application
            Application.Run();
        }
Esempio n. 2
0
        /// <summary>
        /// Constructs the dialog box.
        /// </summary>
        public ConfigDialog()
        {
            // Set up our controls
            Title = Locale.Translate("Configuration Dialog");
            AddButton("Close", ResponseType.Close);
            //Response += new ResponseHandler (on_dialog_response);

            // Add the dialog table
            LabelWidgetTable table = new LabelWidgetTable(2, 2);
            uint             row   = 0;

            VBox.Add(table);

            // Put in a list of themes
            int i = 0;

            themes = ComboBox.NewText();

            foreach (Theme theme in Theme.GetThemes())
            {
                themes.AppendText(theme.ThemeName);

                if (theme.ThemeName == Game.Config.ThemeName)
                {
                    themes.Active = 0;
                }

                i++;
            }

            themes.Changed += OnChanged;

            // Languages
            languages = ComboBox.NewText();
            languages.AppendText("en-US");
            languages.Active   = 0;
            languages.Changed += OnChanged;

            // Selection type
            selectionType            = new EnumComboBox(typeof(SelectionType));
            selectionType.ActiveEnum = Game.Config.SelectionType;
            selectionType.Changed   += OnChanged;

            // Board size
            boardSize          = new SpinButton(3f, 27f, 1f);
            boardSize.Value    = Game.Config.BoardSize;
            boardSize.Changed += OnChanged;

            // Frames per second
            fps          = new SpinButton(1f, 60f, 1f);
            fps.Value    = Game.Config.FramesPerSecond;
            fps.Changed += OnChanged;

            // Start with theme configuration
            table.AttachExpanded(row++, "Theme", themes);
            table.AttachExpanded(row++, "Board Size", boardSize);
            table.AttachExpanded(row++, "Selection Type", selectionType);
            table.AttachExpanded(row++, "Language", languages);
            table.AttachExpanded(row++, "FPS", fps);

            // Finish up
            ShowAll();
        }