Xenon257R / blue-archive-rainmeter

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

Weather Banner Issue #18

Closed heartpops closed 4 months ago

heartpops commented 4 months ago

Hi, I have an issue that I've never been able to figure out. I included a screenshot to show that I've never been able to get the weather function to show the correct temp, it is always at the default 70. I downloaded another weather widget to see if it was an issue on my end (also seen in the screenshot) and it seems to be working just fine. I'm sorry if there's a simple solution that I haven't thought of, any help figuring this out would be greatly appreciated.

Screenshot 2024-02-11 141549

Xenon257R commented 4 months ago

This is an extremely embarrassing mistake by me regarding data types in between bangs. Thankfully, this should be an easy fix.

In BlueArchive/PrimaryBanner/weatherbanner.ini, you will want to add a : in Lines* 71 and 77 right after WeatherTempC so that the values are treated as numbers and not strings, like so:

(Line 71) Formula=((9/5)*[WeatherTempC:])+32
...
(Line 77) Formula=[WeatherTempC:]+273.15

And that should fix the issue. I am very sorry about the bug, and I have made the changes on my end as well in preparation for a cleanup patch.


As an additional note, I also recommend changing the RegExp string in Line* 49 of the same file to the following:

RegExp=(?siU)"iconCode":(.*),.*"temperature":(-?\d*),.*"wxPhraseLong":"(.*)",.*"v3-location-point":(?(?=.*"location").*"city":"(.*)",.*"countryCode":"(.*)",)

There was an unnoticed issue of the script being unable to capture negative temperatures due to me not being in a part of the world where it gets that cold, and this new regex string fixes said issue.


* Line numbers may be slightly different if you have made modifications to the file.

Xenon257R commented 4 months ago

My apologies, it looks like this problem goes a little further than what I had initially thought above. The problem did have to do with WebParser having an inherent 0 number value that appears to take precedence over the parsed (numeric) string value when Calc measures uses them, but it was also being affected by the nature of DynamicVariables (in this case, lack thereof).

Since it requires more than a couple changes in the code, I provided a .zip file here that has an updated, clean copy of weatherbanner.ini with which you can replace the bugged one in BlueArchive/PrimaryBanner. You will have to re-pick your temperature preference and region after refreshing the suite. I hope that is okay with you.

Xenon257R commented 4 months ago

I have just published a v1.1.3 update for the suite, and the fix to this issue has been addressed in it. You can install the new patch (after reviewing the Rainmeter-specific Issue #7) to fix this issue alongside several other changes for the suite.

Let me know if the new patch fixes your issue! If the new patch somehow still doesn't fix it on your computer, reopen this issue and please provide a copy of your (new & tried) weatherbanner.ini file in a .zip file with any other additional details that you think may be valuable and I will look into it further.