Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
c381f464
There was an error fetching the commit references. Please try again later.
Commit
c381f464
authored
6 years ago
by
Zach Hilman
Browse files
Options
Downloads
Patches
Plain Diff
config: Store and load disabled add-ons list
parent
282b7e90
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/yuzu/configuration/config.cpp
+30
-0
30 additions, 0 deletions
src/yuzu/configuration/config.cpp
src/yuzu_cmd/config.cpp
+18
-0
18 additions, 0 deletions
src/yuzu_cmd/config.cpp
src/yuzu_cmd/default_ini.h
+7
-0
7 additions, 0 deletions
src/yuzu_cmd/default_ini.h
with
55 additions
and
0 deletions
src/yuzu/configuration/config.cpp
+
30
−
0
View file @
c381f464
...
@@ -444,6 +444,21 @@ void Config::ReadValues() {
...
@@ -444,6 +444,21 @@ void Config::ReadValues() {
Settings
::
values
.
yuzu_token
=
qt_config
->
value
(
"yuzu_token"
).
toString
().
toStdString
();
Settings
::
values
.
yuzu_token
=
qt_config
->
value
(
"yuzu_token"
).
toString
().
toStdString
();
qt_config
->
endGroup
();
qt_config
->
endGroup
();
const
auto
size
=
qt_config
->
beginReadArray
(
"DisabledAddOns"
);
for
(
int
i
=
0
;
i
<
size
;
++
i
)
{
qt_config
->
setArrayIndex
(
i
);
const
auto
title_id
=
qt_config
->
value
(
"title_id"
,
0
).
toULongLong
();
std
::
vector
<
std
::
string
>
out
;
const
auto
d_size
=
qt_config
->
beginReadArray
(
"disabled"
);
for
(
int
j
=
0
;
j
<
d_size
;
++
j
)
{
qt_config
->
setArrayIndex
(
j
);
out
.
push_back
(
qt_config
->
value
(
"d"
,
""
).
toString
().
toStdString
());
}
qt_config
->
endArray
();
Settings
::
values
.
disabled_addons
.
insert_or_assign
(
title_id
,
out
);
}
qt_config
->
endArray
();
qt_config
->
beginGroup
(
"UI"
);
qt_config
->
beginGroup
(
"UI"
);
UISettings
::
values
.
theme
=
qt_config
->
value
(
"theme"
,
UISettings
::
themes
[
0
].
second
).
toString
();
UISettings
::
values
.
theme
=
qt_config
->
value
(
"theme"
,
UISettings
::
themes
[
0
].
second
).
toString
();
UISettings
::
values
.
enable_discord_presence
=
UISettings
::
values
.
enable_discord_presence
=
...
@@ -650,6 +665,21 @@ void Config::SaveValues() {
...
@@ -650,6 +665,21 @@ void Config::SaveValues() {
qt_config
->
setValue
(
"yuzu_token"
,
QString
::
fromStdString
(
Settings
::
values
.
yuzu_token
));
qt_config
->
setValue
(
"yuzu_token"
,
QString
::
fromStdString
(
Settings
::
values
.
yuzu_token
));
qt_config
->
endGroup
();
qt_config
->
endGroup
();
qt_config
->
beginWriteArray
(
"DisabledAddOns"
);
int
i
=
0
;
for
(
const
auto
&
elem
:
Settings
::
values
.
disabled_addons
)
{
qt_config
->
setArrayIndex
(
i
);
qt_config
->
setValue
(
"title_id"
,
elem
.
first
);
qt_config
->
beginWriteArray
(
"disabled"
);
for
(
std
::
size_t
j
=
0
;
j
<
elem
.
second
.
size
();
++
j
)
{
qt_config
->
setArrayIndex
(
j
);
qt_config
->
setValue
(
"d"
,
QString
::
fromStdString
(
elem
.
second
[
j
]));
}
qt_config
->
endArray
();
++
i
;
}
qt_config
->
endArray
();
qt_config
->
beginGroup
(
"UI"
);
qt_config
->
beginGroup
(
"UI"
);
qt_config
->
setValue
(
"theme"
,
UISettings
::
values
.
theme
);
qt_config
->
setValue
(
"theme"
,
UISettings
::
values
.
theme
);
qt_config
->
setValue
(
"enable_discord_presence"
,
UISettings
::
values
.
enable_discord_presence
);
qt_config
->
setValue
(
"enable_discord_presence"
,
UISettings
::
values
.
enable_discord_presence
);
...
...
This diff is collapsed.
Click to expand it.
src/yuzu_cmd/config.cpp
+
18
−
0
View file @
c381f464
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
// Refer to the license.txt file included.
#include
<memory>
#include
<memory>
#include
<sstream>
#include
<SDL.h>
#include
<SDL.h>
#include
<inih/cpp/INIReader.h>
#include
<inih/cpp/INIReader.h>
#include
"common/file_util.h"
#include
"common/file_util.h"
...
@@ -369,6 +370,23 @@ void Config::ReadValues() {
...
@@ -369,6 +370,23 @@ void Config::ReadValues() {
Settings
::
values
.
dump_exefs
=
sdl2_config
->
GetBoolean
(
"Debugging"
,
"dump_exefs"
,
false
);
Settings
::
values
.
dump_exefs
=
sdl2_config
->
GetBoolean
(
"Debugging"
,
"dump_exefs"
,
false
);
Settings
::
values
.
dump_nso
=
sdl2_config
->
GetBoolean
(
"Debugging"
,
"dump_nso"
,
false
);
Settings
::
values
.
dump_nso
=
sdl2_config
->
GetBoolean
(
"Debugging"
,
"dump_nso"
,
false
);
const
auto
title_list
=
sdl2_config
->
Get
(
"AddOns"
,
"title_ids"
,
""
);
std
::
stringstream
ss
(
title_list
);
std
::
string
line
;
while
(
std
::
getline
(
ss
,
line
,
'|'
))
{
const
auto
title_id
=
std
::
stoul
(
line
,
nullptr
,
16
);
const
auto
disabled_list
=
sdl2_config
->
Get
(
"AddOns"
,
"disabled_"
+
line
,
""
);
std
::
stringstream
inner_ss
(
disabled_list
);
std
::
string
inner_line
;
std
::
vector
<
std
::
string
>
out
;
while
(
std
::
getline
(
inner_ss
,
inner_line
,
'|'
))
{
out
.
push_back
(
inner_line
);
}
Settings
::
values
.
disabled_addons
.
insert_or_assign
(
title_id
,
out
);
}
// Web Service
// Web Service
Settings
::
values
.
enable_telemetry
=
Settings
::
values
.
enable_telemetry
=
sdl2_config
->
GetBoolean
(
"WebService"
,
"enable_telemetry"
,
true
);
sdl2_config
->
GetBoolean
(
"WebService"
,
"enable_telemetry"
,
true
);
...
...
This diff is collapsed.
Click to expand it.
src/yuzu_cmd/default_ini.h
+
7
−
0
View file @
c381f464
...
@@ -221,5 +221,12 @@ web_api_url = https://api.yuzu-emu.org
...
@@ -221,5 +221,12 @@ web_api_url = https://api.yuzu-emu.org
# See https://profile.yuzu-emu.org/ for more info
# See https://profile.yuzu-emu.org/ for more info
yuzu_username =
yuzu_username =
yuzu_token =
yuzu_token =
[AddOns]
# Used to disable add-ons
# List of title IDs of games that will have add-ons disabled (separated by '|'):
title_ids =
# For each title ID, have a key/value pair called `disabled_<title_id>` equal to the names of the add-ons to disable (sep. by '|')
# e.x. disabled_0100000000010000 = Update|DLC <- disables Updates and DLC on Super Mario Odyssey
)"
;
)"
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment