Skip to content

Commit

Permalink
Update theme extensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Nov 10, 2023
1 parent f8294ba commit b3c5e1d
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 75 deletions.
5 changes: 5 additions & 0 deletions src/inibakery.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

class OrganizerCore;

// small classes that deal with preparing profiles before runs for local saves, bsa
// invalidation, etc., and providing mapping for local profile files when needed
//
// this class replaces the old INI Bakery plugin
//
class IniBakery
{
public:
Expand Down
4 changes: 3 additions & 1 deletion themes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ file(GLOB theme_directories

foreach(theme_directory ${theme_directories})
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${theme_directory}")
install(DIRECTORY ${theme_directory} DESTINATION bin/extensions)
file(READ ${theme_directory}/metadata.json JSON_METADATA)
string(JSON theme_identifier GET ${JSON_METADATA} id)
install(DIRECTORY ${theme_directory}/ DESTINATION bin/extensions/${theme_identifier})
endif()
endforeach()
14 changes: 8 additions & 6 deletions themes/dark-theme/metadata.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"identifier": "dark-theme",
"type": "theme",
"id": "mo2-theme-dark",
"name": "Dark Theme",
"description": "Dark theme for ModOrganizer2.",
"version": "1.0.0",
"themes": {
"dark": {
"name": "Dark",
"path": "dark.qss"
"type": "theme",
"content": {
"themes": {
"dark": {
"name": "Dark",
"path": "dark.qss"
}
}
}
}
12 changes: 7 additions & 5 deletions themes/dracula-theme/metadata.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"identifier": "dracula-theme",
"id": "mo2-theme-dracula",
"type": "theme",
"name": "Dracula Theme",
"description": "Dracula theme for ModOrganizer2.",
"version": "1.0.0",
"themes": {
"dracula": {
"name": "Dracula",
"path": "dracula.qss"
"content": {
"themes": {
"dracula": {
"name": "Dracula",
"path": "dracula.qss"
}
}
}
}
59 changes: 40 additions & 19 deletions themes/make-metadata.ps1
Original file line number Diff line number Diff line change
@@ -1,25 +1,46 @@
$fixNames = @{
dark = "Dark";
dracula = "Dracula";
nighteyes = "Night Eyes";
parchment = "Parchment";
skyrim = "Skyrim";
}

Get-ChildItem -Directory -Exclude "vs15" | ForEach-Object {
$name = $fixNames[$_.Name];
Get-ChildItem -Directory | ForEach-Object {
$metadata = Get-Content "$_/metadata.json" | ConvertFrom-Json
$metadata
$name = $metadata.identifier -replace "-themes?"
$data = [ordered]@{
identifier = $_.Name + "-theme";
id = "mo2-theme-" + $name;
type = "theme";
name = "$name Theme";
description = "$name theme for ModOrganizer2.";
name = $metadata.name;
description = $metadata.description;
version = "1.0.0";
themes = @{
$_.Name = [ordered]@{
name = $name;
path = (Get-ChildItem $_ -Filter "*.qss")[0].Name;
}
content = @{
themes = $metadata.themes;
};
}
ConvertTo-Json -InputObject $data | Set-Content (Join-Path $_ "metadata.json")
$data
# ConvertTo-Json -InputObject $data # | Set-Content (Join-Path $_ "metadata.json")
}

# $fixNames = @{
# dark = "Dark";
# dracula = "Dracula";
# nighteyes = "Night Eyes";
# parchment = "Parchment";
# skyrim = "Skyrim";
# }

# Get-ChildItem -Directory -Exclude "vs15" | ForEach-Object {
# $name = $fixNames[$_.Name];
# $data = [ordered]@{
# identifier = "mo2-theme-" + $_.Name;
# type = "theme";
# name = "$name Theme";
# description = "$name theme for ModOrganizer2.";
# version = "1.0.0";
# content = @{
# themes = @{
# $_.Name = [ordered]@{
# name = $name;
# path = (Get-ChildItem $_ -Filter "*.qss")[0].Name;
# }
# };
# };
# ;
# }
# ConvertTo-Json -InputObject $data | Set-Content (Join-Path $_ "metadata.json")
# }
12 changes: 7 additions & 5 deletions themes/nighteyes-theme/metadata.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"identifier": "nighteyes-theme",
"id": "mo2-theme-nighteyes",
"type": "theme",
"name": "Night Eyes Theme",
"description": "Night Eyes theme for ModOrganizer2.",
"version": "1.0.0",
"themes": {
"nighteyes": {
"name": "Night Eyes",
"path": "nigheyes.qss"
"content": {
"themes": {
"nighteyes": {
"name": "Night Eyes",
"path": "nigheyes.qss"
}
}
}
}
12 changes: 7 additions & 5 deletions themes/parchment-theme/metadata.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"identifier": "parchment-theme",
"id": "mo2-theme-parchment",
"type": "theme",
"name": "Parchment Theme",
"description": "Parchment theme for ModOrganizer2.",
"version": "1.0.0",
"themes": {
"parchment": {
"name": "Parchment",
"path": "parchment.qss"
"content": {
"themes": {
"parchment": {
"name": "Parchment",
"path": "parchment.qss"
}
}
}
}
12 changes: 7 additions & 5 deletions themes/skyrim-theme/metadata.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"identifier": "skyrim-theme",
"id": "mo2-theme-skyrim",
"type": "theme",
"name": "Skyrim Theme",
"description": "Skyrim theme for ModOrganizer2.",
"version": "1.0.0",
"themes": {
"skyrim": {
"name": "Skyrim",
"path": "skyrim.qss"
"content": {
"themes": {
"skyrim": {
"name": "Skyrim",
"path": "skyrim.qss"
}
}
}
}
60 changes: 31 additions & 29 deletions themes/vs15-themes/metadata.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
{
"identifier": "vs15-dark-themes",
"id": "mo2-theme-vs15-dark",
"type": "theme",
"name": "VS15 Themes",
"description": "Set of dark themes, inspired by Visual Studio, for ModOrganizer2.",
"version": "1.0.0",
"themes": {
"vs15-dark-blue": {
"name": "VS15 - Dark Blue",
"path": "vs15 Dark-Blue.qss"
},
"vs15-dark-green": {
"name": "VS15 - Dark Green",
"path": "vs15 Dark-Green.qss"
},
"vs15-dark-orange": {
"name": "VS15 - Dark Orange",
"path": "vs15 Dark-Orange.qss"
},
"vs15-dark-pink": {
"name": "VS15 - Dark Pink",
"path": "vs15 Dark-Pink.qss"
},
"vs15-dark-purple": {
"name": "VS15 - Dark Purple",
"path": "vs15 Dark-Purple.qss"
},
"vs15-dark-red": {
"name": "VS15 - Dark Red",
"path": "vs15 Dark-Red.qss"
},
"vs15-dark-yellow": {
"name": "VS15 - Dark Yellow",
"path": "vs15 Dark-Yellow.qss"
"content": {
"themes": {
"vs15-dark-blue": {
"name": "VS15 - Dark Blue",
"path": "vs15 Dark-Blue.qss"
},
"vs15-dark-green": {
"name": "VS15 - Dark Green",
"path": "vs15 Dark-Green.qss"
},
"vs15-dark-orange": {
"name": "VS15 - Dark Orange",
"path": "vs15 Dark-Orange.qss"
},
"vs15-dark-pink": {
"name": "VS15 - Dark Pink",
"path": "vs15 Dark-Pink.qss"
},
"vs15-dark-purple": {
"name": "VS15 - Dark Purple",
"path": "vs15 Dark-Purple.qss"
},
"vs15-dark-red": {
"name": "VS15 - Dark Red",
"path": "vs15 Dark-Red.qss"
},
"vs15-dark-yellow": {
"name": "VS15 - Dark Yellow",
"path": "vs15 Dark-Yellow.qss"
}
}
}
}

0 comments on commit b3c5e1d

Please sign in to comment.