mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-29 05:18:03 +03:00

Creates a layer outside the game config layer system and passes it to the created gfx widows, so as to not interfere with the global config system. Supports multiple game properties being open at once. Supports editing while a game is playing, but the options only save and update the active game when the window is closed. Right-clicking will remove a property from the game ini.
31 lines
869 B
C++
31 lines
869 B
C++
// Copyright 2019 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "DolphinQt/Config/ConfigControls/ConfigInteger.h"
|
|
|
|
ConfigInteger::ConfigInteger(int minimum, int maximum, const Config::Info<int>& setting, int step)
|
|
: ConfigInteger(minimum, maximum, setting, nullptr, step)
|
|
{
|
|
}
|
|
|
|
ConfigInteger::ConfigInteger(int minimum, int maximum, const Config::Info<int>& setting,
|
|
Config::Layer* layer, int step)
|
|
: ConfigControl(setting.GetLocation(), layer), m_setting(setting)
|
|
{
|
|
setMinimum(minimum);
|
|
setMaximum(maximum);
|
|
setSingleStep(step);
|
|
setValue(ReadValue(setting));
|
|
|
|
connect(this, &ConfigInteger::valueChanged, this, &ConfigInteger::Update);
|
|
}
|
|
|
|
void ConfigInteger::Update(int value)
|
|
{
|
|
SaveValue(m_setting, value);
|
|
}
|
|
|
|
void ConfigInteger::OnConfigChanged()
|
|
{
|
|
setValue(ReadValue(m_setting));
|
|
}
|