Skip to content

Commit b3c5e1d

Browse files
committed
Update theme extensions.
1 parent f8294ba commit b3c5e1d

File tree

9 files changed

+115
-75
lines changed

9 files changed

+115
-75
lines changed

src/inibakery.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
class OrganizerCore;
99

10+
// small classes that deal with preparing profiles before runs for local saves, bsa
11+
// invalidation, etc., and providing mapping for local profile files when needed
12+
//
13+
// this class replaces the old INI Bakery plugin
14+
//
1015
class IniBakery
1116
{
1217
public:

themes/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ file(GLOB theme_directories
66

77
foreach(theme_directory ${theme_directories})
88
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${theme_directory}")
9-
install(DIRECTORY ${theme_directory} DESTINATION bin/extensions)
9+
file(READ ${theme_directory}/metadata.json JSON_METADATA)
10+
string(JSON theme_identifier GET ${JSON_METADATA} id)
11+
install(DIRECTORY ${theme_directory}/ DESTINATION bin/extensions/${theme_identifier})
1012
endif()
1113
endforeach()

themes/dark-theme/metadata.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
2-
"identifier": "dark-theme",
3-
"type": "theme",
2+
"id": "mo2-theme-dark",
43
"name": "Dark Theme",
54
"description": "Dark theme for ModOrganizer2.",
65
"version": "1.0.0",
7-
"themes": {
8-
"dark": {
9-
"name": "Dark",
10-
"path": "dark.qss"
6+
"type": "theme",
7+
"content": {
8+
"themes": {
9+
"dark": {
10+
"name": "Dark",
11+
"path": "dark.qss"
12+
}
1113
}
1214
}
1315
}

themes/dracula-theme/metadata.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
2-
"identifier": "dracula-theme",
2+
"id": "mo2-theme-dracula",
33
"type": "theme",
44
"name": "Dracula Theme",
55
"description": "Dracula theme for ModOrganizer2.",
66
"version": "1.0.0",
7-
"themes": {
8-
"dracula": {
9-
"name": "Dracula",
10-
"path": "dracula.qss"
7+
"content": {
8+
"themes": {
9+
"dracula": {
10+
"name": "Dracula",
11+
"path": "dracula.qss"
12+
}
1113
}
1214
}
1315
}

themes/make-metadata.ps1

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,46 @@
1-
$fixNames = @{
2-
dark = "Dark";
3-
dracula = "Dracula";
4-
nighteyes = "Night Eyes";
5-
parchment = "Parchment";
6-
skyrim = "Skyrim";
7-
}
8-
9-
Get-ChildItem -Directory -Exclude "vs15" | ForEach-Object {
10-
$name = $fixNames[$_.Name];
1+
Get-ChildItem -Directory | ForEach-Object {
2+
$metadata = Get-Content "$_/metadata.json" | ConvertFrom-Json
3+
$metadata
4+
$name = $metadata.identifier -replace "-themes?"
115
$data = [ordered]@{
12-
identifier = $_.Name + "-theme";
6+
id = "mo2-theme-" + $name;
137
type = "theme";
14-
name = "$name Theme";
15-
description = "$name theme for ModOrganizer2.";
8+
name = $metadata.name;
9+
description = $metadata.description;
1610
version = "1.0.0";
17-
themes = @{
18-
$_.Name = [ordered]@{
19-
name = $name;
20-
path = (Get-ChildItem $_ -Filter "*.qss")[0].Name;
21-
}
11+
content = @{
12+
themes = $metadata.themes;
2213
};
2314
}
24-
ConvertTo-Json -InputObject $data | Set-Content (Join-Path $_ "metadata.json")
15+
$data
16+
# ConvertTo-Json -InputObject $data # | Set-Content (Join-Path $_ "metadata.json")
2517
}
18+
19+
# $fixNames = @{
20+
# dark = "Dark";
21+
# dracula = "Dracula";
22+
# nighteyes = "Night Eyes";
23+
# parchment = "Parchment";
24+
# skyrim = "Skyrim";
25+
# }
26+
27+
# Get-ChildItem -Directory -Exclude "vs15" | ForEach-Object {
28+
# $name = $fixNames[$_.Name];
29+
# $data = [ordered]@{
30+
# identifier = "mo2-theme-" + $_.Name;
31+
# type = "theme";
32+
# name = "$name Theme";
33+
# description = "$name theme for ModOrganizer2.";
34+
# version = "1.0.0";
35+
# content = @{
36+
# themes = @{
37+
# $_.Name = [ordered]@{
38+
# name = $name;
39+
# path = (Get-ChildItem $_ -Filter "*.qss")[0].Name;
40+
# }
41+
# };
42+
# };
43+
# ;
44+
# }
45+
# ConvertTo-Json -InputObject $data | Set-Content (Join-Path $_ "metadata.json")
46+
# }

themes/nighteyes-theme/metadata.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
2-
"identifier": "nighteyes-theme",
2+
"id": "mo2-theme-nighteyes",
33
"type": "theme",
44
"name": "Night Eyes Theme",
55
"description": "Night Eyes theme for ModOrganizer2.",
66
"version": "1.0.0",
7-
"themes": {
8-
"nighteyes": {
9-
"name": "Night Eyes",
10-
"path": "nigheyes.qss"
7+
"content": {
8+
"themes": {
9+
"nighteyes": {
10+
"name": "Night Eyes",
11+
"path": "nigheyes.qss"
12+
}
1113
}
1214
}
1315
}

themes/parchment-theme/metadata.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
2-
"identifier": "parchment-theme",
2+
"id": "mo2-theme-parchment",
33
"type": "theme",
44
"name": "Parchment Theme",
55
"description": "Parchment theme for ModOrganizer2.",
66
"version": "1.0.0",
7-
"themes": {
8-
"parchment": {
9-
"name": "Parchment",
10-
"path": "parchment.qss"
7+
"content": {
8+
"themes": {
9+
"parchment": {
10+
"name": "Parchment",
11+
"path": "parchment.qss"
12+
}
1113
}
1214
}
1315
}

themes/skyrim-theme/metadata.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{
2-
"identifier": "skyrim-theme",
2+
"id": "mo2-theme-skyrim",
33
"type": "theme",
44
"name": "Skyrim Theme",
55
"description": "Skyrim theme for ModOrganizer2.",
66
"version": "1.0.0",
7-
"themes": {
8-
"skyrim": {
9-
"name": "Skyrim",
10-
"path": "skyrim.qss"
7+
"content": {
8+
"themes": {
9+
"skyrim": {
10+
"name": "Skyrim",
11+
"path": "skyrim.qss"
12+
}
1113
}
1214
}
1315
}

themes/vs15-themes/metadata.json

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
11
{
2-
"identifier": "vs15-dark-themes",
2+
"id": "mo2-theme-vs15-dark",
33
"type": "theme",
44
"name": "VS15 Themes",
55
"description": "Set of dark themes, inspired by Visual Studio, for ModOrganizer2.",
66
"version": "1.0.0",
7-
"themes": {
8-
"vs15-dark-blue": {
9-
"name": "VS15 - Dark Blue",
10-
"path": "vs15 Dark-Blue.qss"
11-
},
12-
"vs15-dark-green": {
13-
"name": "VS15 - Dark Green",
14-
"path": "vs15 Dark-Green.qss"
15-
},
16-
"vs15-dark-orange": {
17-
"name": "VS15 - Dark Orange",
18-
"path": "vs15 Dark-Orange.qss"
19-
},
20-
"vs15-dark-pink": {
21-
"name": "VS15 - Dark Pink",
22-
"path": "vs15 Dark-Pink.qss"
23-
},
24-
"vs15-dark-purple": {
25-
"name": "VS15 - Dark Purple",
26-
"path": "vs15 Dark-Purple.qss"
27-
},
28-
"vs15-dark-red": {
29-
"name": "VS15 - Dark Red",
30-
"path": "vs15 Dark-Red.qss"
31-
},
32-
"vs15-dark-yellow": {
33-
"name": "VS15 - Dark Yellow",
34-
"path": "vs15 Dark-Yellow.qss"
7+
"content": {
8+
"themes": {
9+
"vs15-dark-blue": {
10+
"name": "VS15 - Dark Blue",
11+
"path": "vs15 Dark-Blue.qss"
12+
},
13+
"vs15-dark-green": {
14+
"name": "VS15 - Dark Green",
15+
"path": "vs15 Dark-Green.qss"
16+
},
17+
"vs15-dark-orange": {
18+
"name": "VS15 - Dark Orange",
19+
"path": "vs15 Dark-Orange.qss"
20+
},
21+
"vs15-dark-pink": {
22+
"name": "VS15 - Dark Pink",
23+
"path": "vs15 Dark-Pink.qss"
24+
},
25+
"vs15-dark-purple": {
26+
"name": "VS15 - Dark Purple",
27+
"path": "vs15 Dark-Purple.qss"
28+
},
29+
"vs15-dark-red": {
30+
"name": "VS15 - Dark Red",
31+
"path": "vs15 Dark-Red.qss"
32+
},
33+
"vs15-dark-yellow": {
34+
"name": "VS15 - Dark Yellow",
35+
"path": "vs15 Dark-Yellow.qss"
36+
}
3537
}
3638
}
3739
}

0 commit comments

Comments
 (0)