working theming

This commit is contained in:
SpikeHD
2022-06-02 19:03:32 -07:00
parent e3aade7955
commit 8d8b617198
7 changed files with 144 additions and 16 deletions

View File

@@ -16,8 +16,9 @@
"grasscutter_jar": "Set Grasscutter JAR",
"java_path": "Set Custom Java Path",
"grasscutter_with_game": "Automatically launch Grasscutter with game",
"language": "Select Language (requires restart)",
"background": "Set Custom Background (link or image file)"
"language": "Select Language",
"background": "Set Custom Background (link or image file)",
"theme": "Set Theme"
},
"downloads": {
"grasscutter_stable_data": "Download Grasscutter Stable Data",

View File

@@ -50,6 +50,7 @@ fn main() {
system_helpers::run_jar,
system_helpers::open_in_browser,
system_helpers::copy_file,
system_helpers::install_location,
proxy::set_proxy_addr,
proxy::generate_ca_files,
unzip::unzip,
@@ -145,8 +146,8 @@ async fn req_get(url: String) -> String {
}
#[tauri::command]
async fn get_theme_list() -> Vec<HashMap<String, String>> {
let theme_loc = format!("{}/themes", system_helpers::install_location());
async fn get_theme_list(dataDir: String) -> Vec<HashMap<String, String>> {
let theme_loc = format!("{}/themes", dataDir);
// Ensure folder exists
if !std::path::Path::new(&theme_loc).exists() {

View File

@@ -77,6 +77,7 @@ pub fn copy_file(path: String, new_path: String) -> bool {
}
}
#[tauri::command]
pub fn install_location() -> String {
let mut exe_path = std::env::current_exe().unwrap();