Xenon257R / blue-archive-rainmeter

A Blue Archive themed Rainmeter suite for your Windows desktop.
MIT License
110 stars 4 forks source link

Color Setting/Edit Database not working #13

Closed kigaaa closed 10 months ago

kigaaa commented 11 months ago

I got an issue simmilar to the one in #5 but ive already tried reinstalling rainmeter and the skins, downloading lua manually and also changing the directory folder for the skins, yet its still not working. 665fe26cbc5f7684354bd130831fb13 I also took screenshots of the rainmeter log if thats helpful. b4fdd103fc2be41056144fede11000e 67ccaa6ab5d59587eeb9794974072d7

Xenon257R commented 11 months ago

Hi, sorry for the late reply, but I'll try my best to get to the bottom of this.

The screenshots are helpful, and I've listed below my best guesses so far as to why this is happening. I tried to be as thorough as possible with my thoughts so that if they are wrong, you can help correct wrong assumptions or figure out new theories as to why you're encountering this issue.

You have mentioned that you have tried everything that was suggested in #5. So, if we rule out all those possible reasons, I am led to believe that some crucial files may be missing and/or corrupted in the BlueArchive\@Resources\json\ directory. We can also be fully certain Lua is functional, as your Premium skin that lists your storage space appears to be working - in #5, this was actually broken. This skin uses a Lua script!


First, I know you specified that you tried changing the directory of your Skins, but I want to be ABSOLUTELY certain that: 1) You tried changing the directory to a non-cloud-storage directory. 2) You moved the location of the Skins folder, and NOT the Rainmeter app folder.

If you are uncertain you did it right, share with me the full filepath (every one that you tried) to the Skins directory - for example: C:\Users\[USERNAME]\Documents\Rainmeter\Skins\. You can censor your PC's username if you want to. Remember, this is the Skins directory, not the Rainmeter one, which by default is usually under C:\Program Files\Rainmeter, and that should not be influencing the bug. If you're uncertain of this, you can change the program's directory too - better safe than sorry, after all. I want to confidently rule out the likes of OneDrive, for example.

If you have made certain of the above points, we can fully rule out Rainmeter's finnicky behavior with weird directories.


Second, check that your BlueArchive\@Resources\json\ directory has all of the following files:

BlueArchive
|_@Resources
  |_json
    |_aronagrid.json
    |_dungeonlist.json
    |_layout.json
    |_manga.json
    |_note.json
    |_premium.json
    |_presets.json
    |_questlist.json
    |_raidlist.json
    |_shoplist.json
    |_steamevent.json
    |_youtube.json

If I had to wager a guess, if you tried Sub Hubs (right-clicking your File Explorer skin), it should be broken too: image image Your screen should be missing the two cells highlighted in red above. You can click the Home button at the top left to return to your home screen.

If you've checked that all files are accounted for and they are not missing, I have attached a clean copy of the json directory here in a zip file that you can download.

Before replacing the files, if your json directory does have the files, make a backup of the (presumably) corrupt files and send it to me so I can take a look.

Now, replace all the contents of that folder with the contents of the zipped file and see if anything changes.

If at this point the issue still persists, let me know - this is all I can infer at the moment, and ruling out possibilities like this will help me get closer to the root of the issue. It will help to clarify what worked and what didn't from what you tried, and clarify which of my assumptions were found to be true or not.

kigaaa commented 11 months ago

Ok, it didnt work.

I've checked the first step, and im certain that there is no problem with the directory folder. the skin folder is in documents and the rainmeter settings didnt have any problems.

My json folder had all of the listed files and i've tried replacing them with the one you sent me, and this is my old json folder here: jsoncopy.zip But after replacing files nothing changed.

Also, heres a picture of my subhub which doesnt really look like a subhub. a47b3604b09bcc37ea88438be67c8ac

Xenon257R commented 11 months ago

I compared your .zip file to a fresh copy, and it looks like both directories and their contents are exactly the same, so we can now rule out .json files being corrupt.

I thought of other possibilities on my end as to why this might be an issue, and I noticed on your screenshot that you set your weather to Shanghai. I am going to assume that your PC's Username (C:/Users/[USERNAME]) is in Chinese or other Unicode characters, as it appears that Lua doesn't natively support Unicode characters in filepaths due to how their io.open function works. This can make sense as the error logs you provided are indicating "missing" files, when in truth the path is impossible for Lua to traverse. You also mentioned your Skins is in the default Documents folder, which guarantees that your username is in the filepath (C:\Users\[UNICODE_USERNAME]\Documents\Skins).

If you want to double-check this yourself, I have a commented out line of code in @Resources\lua\lib\jsonhandler.lua on lines 20-23 that looks like:

    if not file then
        -- print('Unable to open file at ' .. filepath)
        return
    end

remove the -- at line 21 to un-comment the code, and when you refresh your Rainmeter suite you should get error logs that read somewhat similar to:

Unable to open file at C:\Users\[USERNAME]\Documents\Rainmeter\Skins\BlueArchive\@Resources\json\youtube.json

This way, we can identify whether the displayed filepath is correct & navigates correctly to their respective .json files and Lua just doesn't know how to handle Unicode directories.

Whether the above is true or not, at least try moving your skins folder directly to your C:\ drive (i.e. C:\Skins\BlueArchive) where we are free of risk of Unicode directories and see if that works (if you haven't tried that already). Make sure you update your SkinPath variable and refresh the Rainmeter app after making your changes. Currently, the only solutions I've found thus far to support Unicode directories only work partially (e.g. accented letters like ó and ñ, but not Asian characters).

If my guess is correct, I hope the solution above works for you!

kigaaa commented 11 months ago

You were partially correct, my PC username was in chinese so i changed the directory straight to the c drive and refreshed rainmeter, but unfortunately, nothing changed- it still had all of the errors before and i checked the error log and it was exactly the same as when it started.

Ive also checked basically everything related to rainmeter to see if there were any non unicode characters but i couldnt find any.

Xenon257R commented 11 months ago

That's strange - can you double-check the [directory] error log after your changes? I mentioned that in @Resources\lua\lib\jsonhandler.lua, if you uncomment a line of code a new error message should pop up. Actually, to have a more verbose error log, I attached a debug version of the jsonhandler.lua script in a .zip file here. Replace it with the one in your directory (keep the original as a backup you can restore after this), and refresh ONE faulty skin.

Open the debug log window, click Clear so it's empty, then refresh specifically the YouTubeBubble skin (right-click > Refresh Skin). Hopefully, you should get a debug similar to the one I show below to share with me so we can directly confirm that the filepath Lua is searching 100% matches the directory you moved your Skins to and it just can't parse it. You will have to do this check yourself; make sure the filepath outputted by A Filepath highlighted in the Failure screenshot below (not R Filepath; it's perfectly fine if it matches though) is exactly where youtube.json is located after your move.

Success: image

Failure: image

Notice I temporarily ticked off "Error" in the Failure sample - since we've established the error log we are receiving is the exact same output every time thus far, you can switch it off for a moment so the debug I wrote can be a clean output.

Sorry I don't have another idea at the moment; I just want to be certain that the solution I provided was not working and would like to see the verbose error logs to fully rule it out before moving on to a different solution.

kigaaa commented 11 months ago

I just tried doing what you told me to, but it seems to me that the debug jsonhandler is not working for me, and there arent any debug type messages in the log.

This screenshot is my log after i refreshed the youtube bubble after using the debug jsonhandler youve sent. The line of code you said also has been uncommented. image

Xenon257R commented 11 months ago

That's a very interesting output, and you might be right in thinking your jsonhandler just isn't working. So from what I can tell, the respective auxiliary Lua scripts don't appear to get a chance to even start working at all, whether it be just one or multiple of them. I patched up a verbose youtube.lua script here to replace the same file found in BlueArchive\@Resources\lua\; this debug script will hopefully identify the problem before the breakpoint at line 146 (158 in the debug version), and I'd like for you to share those details with me. Don't forget to double-check and censor sensitive info before doing so. Keep the verbose jsonhandler.lua from earlier in this debug as well.

Success sample: image

My best guess at the current state is that there is an initialization problem; if we can identify the exact nature of it, I think it can be resolved.

kigaaa commented 11 months ago

Sorry for not repling for so long, theres some personal issues going on right now and my pc is not with me, and i dont think i'll be available for another week or 2.

kigaaa commented 10 months ago

I just got back, and It just somehow started working. I dont know how, but it did. The color settings and the youtube bubble are all functioning perfectly now. I guess that closes this problmen now?

Xenon257R commented 10 months ago

Huh, that's a nice surprise - I guess your directory changes and other adjustments took a computer restart to properly apply or something to that nature, but we will probably never know for sure.

Well, it's good news regardless! I will close this issue now, and anyone who encounters this issue like yours can always start a new issue thread or reopen this one. Enjoy the suite, and best of luck in customizing it to your preferences!

Don't forget to restore the original .lua files with the original ones if you care about the debug clogging up with messages too, unless that was somehow the reason the issue fixed itself.