duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

advancedsettingswidget.h (1121B)


      1 // SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com>
      2 // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
      3 
      4 #pragma once
      5 #include <QtCore/QVector>
      6 #include <QtWidgets/QWidget>
      7 
      8 #include "ui_advancedsettingswidget.h"
      9 
     10 class SettingsWindow;
     11 
     12 class AdvancedSettingsWidget : public QWidget
     13 {
     14   Q_OBJECT
     15 
     16 public:
     17   explicit AdvancedSettingsWidget(SettingsWindow* dialog, QWidget* parent);
     18   ~AdvancedSettingsWidget();
     19 
     20 Q_SIGNALS:
     21   void onShowDebugOptionsChanged(bool enabled);
     22 
     23 private Q_SLOTS:
     24   void onShowDebugOptionsStateChanged();
     25 
     26 private:
     27   struct TweakOption
     28   {
     29     enum class Type
     30     {
     31       Boolean,
     32       IntRange
     33     };
     34 
     35     Type type;
     36     QString description;
     37     std::string key;
     38     std::string section;
     39 
     40     union
     41     {
     42       struct
     43       {
     44         bool default_value;
     45       } boolean;
     46 
     47       struct
     48       {
     49         int min_value;
     50         int max_value;
     51         int default_value;
     52       } int_range;
     53     };
     54   };
     55 
     56   SettingsWindow* m_dialog;
     57 
     58   Ui::AdvancedSettingsWidget m_ui;
     59 
     60   QVector<TweakOption> m_tweak_options;
     61 
     62   void addTweakOptions();
     63   void onResetToDefaultClicked();
     64 };