File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ In most cases, you can also type `\n` to go to a new line
3232
3333General syntax for ALL FILES is:
3434
35- ``` json
35+ ``` jsonc
3636{
3737 " to-show" : " name" , // spawned when pressing hotkey
3838 " to-show-alt" : " alt-name" , // spawned when holding alt and pressing hotkey
Original file line number Diff line number Diff line change @@ -25,9 +25,11 @@ std::string altShowKey = "to-show-alt";
2525// Create files if they don't exist
2626void checkMissingFiles () {
2727 Mod::get ()->getConfigDir (); // create config folder if missing
28- if (!fs::exists (CustomAlert::jsonFilePath)) fs::copy_file (Mod::get ()->getResourcesDir () / CustomAlert::jsonFileName, CustomAlert::jsonFilePath);
29- if (!fs::exists (CustomTextbox::jsonFilePath)) fs::copy_file (Mod::get ()->getResourcesDir () / CustomTextbox::jsonFileName, CustomTextbox::jsonFilePath);
30- if (!fs::exists (CustomChest::jsonFilePath)) fs::copy_file (Mod::get ()->getResourcesDir () / CustomChest::jsonFileName, CustomChest::jsonFilePath);
28+ std::error_code ec;
29+ if (!fs::exists (CustomAlert::jsonFilePath)) fs::copy_file (Mod::get ()->getResourcesDir () / CustomAlert::jsonFileName, CustomAlert::jsonFilePath, ec);
30+ if (!fs::exists (CustomTextbox::jsonFilePath)) fs::copy_file (Mod::get ()->getResourcesDir () / CustomTextbox::jsonFileName, CustomTextbox::jsonFilePath, ec);
31+ if (!fs::exists (CustomChest::jsonFilePath)) fs::copy_file (Mod::get ()->getResourcesDir () / CustomChest::jsonFileName, CustomChest::jsonFilePath, ec);
32+ if (ec) { log::error (" Filesystem error: {}" , ec.message ()); }
3133}
3234
3335void clearQueue () {
@@ -177,7 +179,6 @@ class $modify(CCKeyboardDispatcher) {
177179 }
178180};
179181
180-
181- $execute {
182+ $on_mod(Loaded) {
182183 checkMissingFiles ();
183184}
You can’t perform that action at this time.
0 commit comments