ISystemSettingsServer.cs 1015 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using Ryujinx.Core.OsHle.Ipc;
  2. using Ryujinx.Core.Settings;
  3. using System.Collections.Generic;
  4. namespace Ryujinx.Core.OsHle.Services.Set
  5. {
  6. class ISystemSettingsServer : IpcService
  7. {
  8. private Dictionary<int, ServiceProcessRequest> m_Commands;
  9. public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands;
  10. public ISystemSettingsServer()
  11. {
  12. m_Commands = new Dictionary<int, ServiceProcessRequest>()
  13. {
  14. { 23, GetColorSetId },
  15. { 24, SetColorSetId }
  16. };
  17. }
  18. public static long GetColorSetId(ServiceCtx Context)
  19. {
  20. Context.ResponseData.Write((int)Context.Ns.Settings.ThemeColor);
  21. return 0;
  22. }
  23. public static long SetColorSetId(ServiceCtx Context)
  24. {
  25. int ColorSetId = Context.RequestData.ReadInt32();
  26. Context.Ns.Settings.ThemeColor = (ColorSet)ColorSetId;
  27. return 0;
  28. }
  29. }
  30. }