Exemplo n.º 1
0
        public static bool DoMigrationForStartup(Window parentWindow, Switch device)
        {
            try
            {
                Migration migration = new Migration(device);
                int       saveCount = migration.Migrate();

                using MessageDialog dialogSuccess = new MessageDialog(parentWindow, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, null)
                      {
                          Title = "Migration Success",
                          Icon  = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png"),
                          Text  = $"Data migration was successful. {saveCount} saves were migrated.",
                      };

                dialogSuccess.Run();

                // Reload key set after migration to be sure to catch the keys in the system directory.
                device.System.LoadKeySet();

                return(true);
            }
            catch (HorizonResultException ex)
            {
                GtkDialog.CreateErrorDialog(ex.Message);

                return(false);
            }
        }
Exemplo n.º 2
0
        public void Initialize(Switch device, List <InputConfig> inputConfig, bool enableKeyboard)
        {
            _device = device;
            _device.Configuration.RefreshInputConfig = RefreshInputConfigForHLE;

            ReloadConfiguration(inputConfig, enableKeyboard);
        }
Exemplo n.º 3
0
        public void Initialize(Switch device, List <InputConfig> inputConfigs, bool enableKeyboard, bool enableMouse)
        {
            Device = device;

            IRenderer renderer = Device.Gpu.Renderer;

            if (renderer is ThreadedRenderer tr)
            {
                renderer = tr.BaseRenderer;
            }

            Renderer = renderer;

            NpadManager.Initialize(device, inputConfigs, enableKeyboard, enableMouse);
            TouchScreenManager.Initialize(device);
        }
Exemplo n.º 4
0
 public Migration(Switch device)
 {
     Device = device;
 }
Exemplo n.º 5
0
        public void ExecuteProgram(Switch device, ProgramSpecifyKind kind, ulong value)
        {
            device.Configuration.UserChannelPersistence.ExecuteProgram(kind, value);

            Exit();
        }