示例#1
0
        public static void UpdateGameTable()
        {
            _tableStore.Clear();
            ApplicationLibrary.Init(SwitchSettings.SwitchConfig.GameDirs, _device.System.KeySet, _device.System.State.DesiredTitleLanguage);

            foreach (ApplicationLibrary.ApplicationData AppData in ApplicationLibrary.ApplicationLibraryData)
            {
                _tableStore.AppendValues(new Gdk.Pixbuf(AppData.Icon, 75, 75), $"{AppData.TitleName}\n{AppData.TitleId.ToUpper()}", AppData.Developer, AppData.Version, AppData.TimePlayed, AppData.LastPlayed, AppData.FileExt, AppData.FileSize, AppData.Path);
            }
        }
示例#2
0
        private MainWindow(Builder builder, string[] args, Application gtkApplication) : base(builder.GetObject("_mainWin").Handle)
        {
            _renderer = new OglRenderer();

            _audioOut = InitializeAudioEngine();

            _device = new HLE.Switch(_renderer, _audioOut);

            Configuration.Load(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
            Configuration.InitialConfigure(_device);

            ApplicationLibrary.Init(SwitchSettings.SwitchConfig.GameDirs, _device.System.KeySet, _device.System.State.DesiredTitleLanguage);

            _gtkApplication = gtkApplication;

            ApplyTheme();

            if (DiscordIntegrationEnabled)
            {
                DiscordClient   = new DiscordRpcClient("568815339807309834");
                DiscordPresence = new RichPresence
                {
                    Assets = new Assets
                    {
                        LargeImageKey  = "ryujinx",
                        LargeImageText = "Ryujinx is an emulator for the Nintendo Switch"
                    },
                    Details    = "Main Menu",
                    State      = "Idling",
                    Timestamps = new Timestamps(DateTime.UtcNow)
                };

                DiscordClient.Initialize();
                DiscordClient.SetPresence(DiscordPresence);
            }

            builder.Autoconnect(this);

            DeleteEvent += Window_Close;

            _mainWin.Icon            = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.ryujinxIcon.png");
            _stopEmulation.Sensitive = false;

            if (SwitchSettings.SwitchConfig.GuiColumns[0])
            {
                _iconToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns[1])
            {
                _titleToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns[2])
            {
                _developerToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns[3])
            {
                _versionToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns[4])
            {
                _timePlayedToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns[5])
            {
                _lastPlayedToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns[6])
            {
                _fileExtToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns[7])
            {
                _fileSizeToggle.Active = true;
            }
            if (SwitchSettings.SwitchConfig.GuiColumns[8])
            {
                _pathToggle.Active = true;
            }

            if (args.Length == 1)
            {
                // Temporary code section start, remove this section when game is rendered to the GLArea in the GUI
                _box.Remove(_glScreen);

                if (SwitchSettings.SwitchConfig.GuiColumns[0])
                {
                    _gameTable.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[1])
                {
                    _gameTable.AppendColumn("Application", new CellRendererText(), "text", 1);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[2])
                {
                    _gameTable.AppendColumn("Developer", new CellRendererText(), "text", 2);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[3])
                {
                    _gameTable.AppendColumn("Version", new CellRendererText(), "text", 3);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[4])
                {
                    _gameTable.AppendColumn("Time Played", new CellRendererText(), "text", 4);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[5])
                {
                    _gameTable.AppendColumn("Last Played", new CellRendererText(), "text", 5);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[6])
                {
                    _gameTable.AppendColumn("File Ext", new CellRendererText(), "text", 6);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[7])
                {
                    _gameTable.AppendColumn("File Size", new CellRendererText(), "text", 7);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[8])
                {
                    _gameTable.AppendColumn("Path", new CellRendererText(), "text", 8);
                }

                _tableStore      = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
                _gameTable.Model = _tableStore;

                UpdateGameTable();
                // Temporary code section end
            }
            else
            {
                _box.Remove(_glScreen);

                if (SwitchSettings.SwitchConfig.GuiColumns[0])
                {
                    _gameTable.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[1])
                {
                    _gameTable.AppendColumn("Application", new CellRendererText(), "text", 1);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[2])
                {
                    _gameTable.AppendColumn("Developer", new CellRendererText(), "text", 2);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[3])
                {
                    _gameTable.AppendColumn("Version", new CellRendererText(), "text", 3);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[4])
                {
                    _gameTable.AppendColumn("Time Played", new CellRendererText(), "text", 4);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[5])
                {
                    _gameTable.AppendColumn("Last Played", new CellRendererText(), "text", 5);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[6])
                {
                    _gameTable.AppendColumn("File Ext", new CellRendererText(), "text", 6);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[7])
                {
                    _gameTable.AppendColumn("File Size", new CellRendererText(), "text", 7);
                }
                if (SwitchSettings.SwitchConfig.GuiColumns[8])
                {
                    _gameTable.AppendColumn("Path", new CellRendererText(), "text", 8);
                }

                _tableStore      = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
                _gameTable.Model = _tableStore;

                UpdateGameTable();
            }
        }