Add themes to assets

This commit is contained in:
iota97 2022-02-14 07:37:56 +01:00
parent 65b7b65bcd
commit e5843160fe
7 changed files with 66 additions and 28 deletions

View File

@ -2261,6 +2261,7 @@ set(NativeAssets
assets/debugger
assets/lang
assets/shaders
assets/themes
assets/Roboto-Condensed.ttf
assets/7z.png
assets/compat.ini
@ -2367,6 +2368,7 @@ if(TargetBin)
file(GLOB_RECURSE FLASH0_FILES assets/flash0/*)
file(GLOB_RECURSE LANG_FILES assets/lang/*)
file(GLOB_RECURSE SHADER_FILES assets/shaders/*)
file(GLOB_RECURSE THEME_FILE assets/themes/*)
file(GLOB_RECURSE DEBUGGER_FILES assets/debugger/*)
if(NOT IOS)
@ -2375,14 +2377,15 @@ if(TargetBin)
set_source_files_properties(${FLASH0_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/flash0/font")
set_source_files_properties(${LANG_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/lang")
set_source_files_properties(${SHADER_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/shaders")
set_source_files_properties(${THEME_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/themes")
set_source_files_properties(${DEBUGGER_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/debugger")
endif()
if(IOS)
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${BigFontAssets} ${SHADER_FILES} ${DEBUGGER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource} "ios/Settings.bundle" "ios/Launch Screen.storyboard")
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${BigFontAssets} ${SHADER_FILES} ${THEME_FILE} ${DEBUGGER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource} "ios/Settings.bundle" "ios/Launch Screen.storyboard")
file(INSTALL "${CMAKE_SOURCE_DIR}/ext/vulkan/iOS/Frameworks/libMoltenVK.dylib" DESTINATION "${CMAKE_BINARY_DIR}/PPSSPP.app/Frameworks/")
else()
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${BigFontAssets} ${SHADER_FILES} ${DEBUGGER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource})
add_executable(${TargetBin} MACOSX_BUNDLE ${ICON_PATH_ABS} ${NativeAssets} ${BigFontAssets} ${SHADER_FILES} ${THEME_FILE} ${DEBUGGER_FILES} ${FLASH0_FILES} ${LANG_FILES} ${NativeAppSource})
file(INSTALL "${CMAKE_SOURCE_DIR}/ext/vulkan/macOS/Frameworks/libMoltenVK.dylib" DESTINATION "${CMAKE_BINARY_DIR}/PPSSPPSDL.app/Contents/Frameworks/")
if(TARGET SDL2::SDL2 AND NOT USING_QT_UI)
add_custom_command(TARGET ${TargetBin} POST_BUILD COMMAND /bin/bash "${CMAKE_SOURCE_DIR}/SDL/macbundle.sh" "${CMAKE_BINARY_DIR}/PPSSPPSDL.app")

View File

@ -81,6 +81,7 @@ static void LoadThemeInfo(const std::vector<Path> &directories) {
def.name = "Default";
themeInfos.push_back(def);
// This will update the theme if already present, as such default in assets/theme will get priority if exist
auto appendTheme = [&](const ThemeInfo &info) {
auto beginErase = std::remove(themeInfos.begin(), themeInfos.end(), info.name);
if (beginErase != themeInfos.end()) {
@ -122,34 +123,34 @@ static void LoadThemeInfo(const std::vector<Path> &directories) {
ThemeInfo info;
section.Get("Name", &info.name, section.name().c_str());
section.Get("ItemStyleFg", &info.uItemStyleFg, 0xFFFFFFFF);
section.Get("ItemStyleBg", &info.uItemStyleBg, 0x55000000);
section.Get("ItemFocusedStyleFg", &info.uItemFocusedStyleFg, 0xFFFFFFFF);
section.Get("ItemFocusedStyleBg", &info.uItemFocusedStyleBg, 0xFFEDC24C);
section.Get("ItemDownStyleFg", &info.uItemDownStyleFg, 0xFFFFFFFF);
section.Get("ItemDownStyleBg", &info.uItemDownStyleBg, 0xFFBD9939);
section.Get("ItemDisabledStyleFg", &info.uItemDisabledStyleFg, 0x80EEEEEE);
section.Get("ItemDisabledStyleBg", &info.uItemDisabledStyleBg, 0x55E0D4AF);
section.Get("ItemHighlightedStyleFg", &info.uItemHighlightedStyleFg, 0xFFFFFFFF);
section.Get("ItemHighlightedStyleBg", &info.uItemHighlightedStyleBg, 0x55BDBB39);
section.Get("ItemStyleFg", &info.uItemStyleFg, info.uItemStyleFg);
section.Get("ItemStyleBg", &info.uItemStyleBg, info.uItemStyleBg);
section.Get("ItemFocusedStyleFg", &info.uItemFocusedStyleFg, info.uItemFocusedStyleFg);
section.Get("ItemFocusedStyleBg", &info.uItemFocusedStyleBg, info.uItemFocusedStyleBg);
section.Get("ItemDownStyleFg", &info.uItemDownStyleFg, info.uItemDownStyleFg);
section.Get("ItemDownStyleBg", &info.uItemDownStyleBg, info.uItemDownStyleBg);
section.Get("ItemDisabledStyleFg", &info.uItemDisabledStyleFg, info.uItemDisabledStyleFg);
section.Get("ItemDisabledStyleBg", &info.uItemDisabledStyleBg, info.uItemDisabledStyleBg);
section.Get("ItemHighlightedStyleFg", &info.uItemHighlightedStyleFg, info.uItemHighlightedStyleFg);
section.Get("ItemHighlightedStyleBg", &info.uItemHighlightedStyleBg, info.uItemHighlightedStyleBg);
section.Get("ButtonStyleFg", &info.uButtonStyleFg, 0xFFFFFFFF);
section.Get("ButtonStyleBg", &info.uButtonStyleBg, 0x55000000);
section.Get("ButtonFocusedStyleFg", &info.uButtonFocusedStyleFg, 0xFFFFFFFF);
section.Get("ButtonFocusedStyleBg", &info.uButtonFocusedStyleBg, 0xFFBD9939);
section.Get("ButtonDownStyleFg", &info.uButtonDownStyleFg, 0xFFFFFFFF);
section.Get("ButtonDownStyleBg", &info.uButtonDownStyleBg, 0xFFBD9939);
section.Get("ButtonDisabledStyleFg", &info.uButtonDisabledStyleFg, 0x80EEEEEE);
section.Get("ButtonDisabledStyleBg", &info.uButtonDisabledStyleBg, 0x55E0D4AF);
section.Get("ButtonHighlightedStyleFg", &info.uButtonHighlightedStyleFg, 0xFFFFFFFF);
section.Get("ButtonHighlightedStyleBg", &info.uButtonHighlightedStyleBg, 0x55BDBB39);
section.Get("ButtonStyleFg", &info.uButtonStyleFg, info.uButtonStyleFg);
section.Get("ButtonStyleBg", &info.uButtonStyleBg, info.uButtonStyleBg);
section.Get("ButtonFocusedStyleFg", &info.uButtonFocusedStyleFg, info.uButtonFocusedStyleFg);
section.Get("ButtonFocusedStyleBg", &info.uButtonFocusedStyleBg, info.uButtonFocusedStyleBg);
section.Get("ButtonDownStyleFg", &info.uButtonDownStyleFg, info.uButtonDownStyleFg);
section.Get("ButtonDownStyleBg", &info.uButtonDownStyleBg, info.uButtonDownStyleBg);
section.Get("ButtonDisabledStyleFg", &info.uButtonDisabledStyleFg, info.uButtonDisabledStyleFg);
section.Get("ButtonDisabledStyleBg", &info.uButtonDisabledStyleBg, info.uButtonDisabledStyleBg);
section.Get("ButtonHighlightedStyleFg", &info.uButtonHighlightedStyleFg, info.uButtonHighlightedStyleFg);
section.Get("ButtonHighlightedStyleBg", &info.uButtonHighlightedStyleBg, info.uButtonHighlightedStyleBg);
section.Get("HeaderStyleFg", &info.uHeaderStyleFg, 0xFFFFFFFF);
section.Get("InfoStyleFg", &info.uInfoStyleFg, 0xFFFFFFFF);
section.Get("InfoStyleBg", &info.uInfoStyleBg, 0x00000000);
section.Get("PopupTitleStyleFg", &info.uPopupTitleStyleFg, 0xFFE3BE59);
section.Get("PopupStyleFg", &info.uPopupStyleFg, 0xFFFFFFFF);
section.Get("PopupStyleBg", &info.uPopupStyleBg, 0xFF303030);
section.Get("HeaderStyleFg", &info.uHeaderStyleFg, info.uHeaderStyleFg);
section.Get("InfoStyleFg", &info.uInfoStyleFg, info.uInfoStyleFg);
section.Get("InfoStyleBg", &info.uInfoStyleBg, info.uInfoStyleBg);
section.Get("PopupTitleStyleFg", &info.uPopupTitleStyleFg, info.uPopupTitleStyleFg);
section.Get("PopupStyleFg", &info.uPopupStyleFg, info.uPopupStyleFg);
section.Get("PopupStyleBg", &info.uPopupStyleBg, info.uPopupStyleBg);
appendTheme(info);
}

View File

@ -17,6 +17,9 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <string>
#include <vector>
#include "Common/UI/Context.h"
void ReloadAllThemeInfo();

View File

@ -2,6 +2,7 @@ mkdir assets > nul
xcopy ..\assets\flash0 assets\flash0\ /s /y <d.txt
xcopy ..\assets\lang assets\lang\ /s /y <d.txt
xcopy ..\assets\shaders assets\shaders\ /s /y <d.txt
xcopy ..\assets\themes assets\themes\ /s /y <d.txt
copy ..\assets\*.ini assets\
copy ..\assets\Roboto-Condensed.ttf assets\Roboto-Condensed.ttf
copy ..\assets\*.png assets\

View File

@ -2,6 +2,7 @@ mkdir -p assets
cp -r ../assets/flash0 assets/
cp -r ../assets/lang assets/
cp -r ../assets/shaders assets/
cp -r ../assets/themes assets/
cp -r ../assets/debugger assets/
cp ../assets/*.ini assets/
cp ../assets/Roboto-Condensed.ttf assets/Roboto-Condensed.ttf

View File

@ -0,0 +1,28 @@
[Default]
Name = Default
ItemStyleFg = 0xffffffff
ItemStyleBg = 0x55000000
ItemFocusedStyleFg = 0xffffffff
ItemFocusedStyleBg = 0xffedc24c
ItemDownStyleFg = 0xffffffff
ItemDownStyleBg = 0xffbd9939
ItemDisabledStyleFg = 0x80eeeeee
ItemDisabledStyleBg = 0x55e0d4af
ItemHighlightedStyleFg = 0xffffffff
ItemHighlightedStyleBg = 0x55bdbb39
ButtonStyleFg = 0xffffffff
ButtonStyleBg = 0x55000000
ButtonFocusedStyleFg = 0xffffffff
ButtonFocusedStyleBg = 0xffedc24c
ButtonDownStyleFg = 0xffffffff
ButtonDownStyleBg = 0xffbd9939
ButtonDisabledStyleFg = 0x80eeeeee
ButtonDisabledStyleBg = 0x55e0d4af
ButtonHighlightedStyleFg = 0xffffffff
ButtonHighlightedStyleBg = 0x55bdbb39
HeaderStyleFg = 0xffffffff
InfoStyleFg = 0xffffffff
InfoStyleBg = 0x00000000
PopupTitleStyleFg = 0xffe3be59
PopupStyleFg = 0xffffffff
PopupStyleBg = 0xff303030

View File

@ -74,6 +74,7 @@ Source: "README.md"; DestName: "README.txt"; DestDir: "{app}"; Flags: isreadme
Source: "notinstalled.txt"; DestName: "installed.txt"; DestDir: "{app}";
Source: "assets\*.*"; DestDir: "{app}\assets"
Source: "assets\shaders\*.*"; DestDir: "{app}\assets\shaders"
Source: "assets\themes\*.*"; DestDir: "{app}\assets\themes"
Source: "assets\debugger\*"; DestDir: "{app}\assets\debugger"; Flags: recursesubdirs
Source: "assets\lang\*.ini"; DestDir: "{app}\assets\lang"
Source: "assets\flash0\font\*.*"; DestDir: "{app}\assets\flash0\font"