#~~SystemClock old thread~~

1 messages · Page 1 of 1 (latest)

dusky summit
light sequoia
#

finally, I can know that it's 7 AM in the morning before closing the game

cold heron
#

keeping track of time? in my Balatro?

craggy rock
#

peak

novel stirrup
#

12 hour time typically doesn't include a leading 0 on the hour

#

ex. 4:29 PM, not 04:29 PM

dusky summit
#

That's true, I'll implement another set of formats. That's the only way that os.date actually formats hours, but it's pretty trivial to strip leading 0s

odd geyser
#

Let me know about any issues on all platforms, especially on OSX as it is currently untested on Mac hardware.
works fine on Mac
also may I put viet loc here oyes
just a random interest of mine

dusky summit
odd geyser
#

💀

#

anyway, about the dragging

#

it shows in my log that the game is unable to write on config.lua to load the same clock config on next launch, is that normal

dusky summit
#

Aha, no, that's likely an OSX-related bug. I trigger the config saving manually when the clock is dropped at a new position. The X and Y sliders in the config menu should still work though.

#

Would you mind sending the full log?

odd geyser
#

I tried to drag the clock 3 times and it sent 3 warnings about inability to write

#

and that was it

#

probably OSX-related

#

only workaround is that I change the clock to my liking in game then edit config.lua manually

dusky summit
#

Do you mean it worked fine after the 3rd time? Does it maintain the same position if you close and reopen the game?

odd geyser
#

it never worked

#

one drag equals one warning

dusky summit
#

Yep, okay. Do the X and Y sliders in the mod config menu work?

odd geyser
#

they do work

#

only dragging logs the warning

#

the slider works but it doesn't log

#

and config.lua doesn't change either way

dusky summit
#

config.lua just holds the defaults. Your user settings should be located in SystemClock.jkr, which is located within the config folder outside of the Mods folder on windows, but i'm unsure about OSX

odd geyser
#

💀

dusky summit
#

I'll read up a bit more about steammodded on OSX and try to include more diagnostics in the error message to see if I can narrow down why it can't write

spring knoll
dusky summit
#
function SystemClock.save_mod_config()
    local status, err = pcall(SMODS.save_mod_config(mod_instance))
    if status == false then
        sendErrorMessage("Failed to perform a manual mod config save.", 'SystemClock')
    end
end```
`mod_instance` is assigned to `SMODS.current_mod` at the very start of `SystemClock.lua`
#

I meant to append err on that message and totally forgot

spring knoll
#

Hmm that should be correct

dusky summit
charred timber
#

Ahh finally I can not go "OH FUCK, IT'S 7 AM I HAVE GOT TO GO TO BED"

odd geyser
dusky summit
#

Thanks!

glacial sleet
#

it'd be pcall(SMODS.save_mod_config, mod_instance)

dusky summit
#

That makes sense, thanks

thorny quarry
#

can't wait to ingrain seeing "am" constantly in my mind (its currently 1 am as im typing this)

odd geyser
dusky summit
thorny quarry
#

ill never get to play 😭

glacial sleet
dusky summit
odd geyser
#

noice

dusky summit
#

Meaning the problem will still occur, but the error report won't be broken...

glacial sleet
#

I mean there might not be a problem to begin with

odd geyser
#

I play Balatro in windowed mode so OS clock is still visible to me
having it in-game means we can easily share our timezones

glacial sleet
#

save_mod_config doesn't return a function so the old pcall always fails

odd geyser
#

the funny part is that you can imply you're having a 3am Balatro session

#

for no reason

dusky summit
#

I remember thinking "Wow, pcall must be some black magic to wrap the function like this" as I was writing it, but didn't think any further on it

glacial sleet
#

Also I'd go with not status normally instead of status == false unless you have a reason to treat nil and false differently

dusky summit
#

Yep, have changed it to not okay for readability's sake. not status didn't sit right in my mind originally, hence false. Does pcall ever return a non-boolean?

glacial sleet
#

it doesn't, but you wouldn't be able to bother me to check if it did

#

other functions with similarly shaped return values usually return nil (and the error) if something fails (for example loading a file), so it's the easier thing to just always account for both

dusky summit
#

Coming from the distant lands of C++, nullable booleans are an exotic and uncomfortable concept

glacial sleet
#

yep dynamic typing can be weird like that

dusky summit
glacial sleet
#

have we confirmed it does?

dusky summit
#

Unconfirmed, no additional data, sample size = 1

#

Just asking in case it was a known issue

glacial sleet
#

I'm not aware of such an issue, so it's probably just the pcall

dusky summit
#

Odd if so, considering it worked without error on my Windows system and the Ubuntu VM i tried

glacial sleet
#

I would expect it to always succeed but claim it failed

dusky summit
odd geyser
dusky summit
novel stirrup
#

on v1.0

glacial sleet
novel stirrup
#

mhm

dusky summit
#

Yep, fixed in v1.1.1, please download latest release

dusky summit
dusky summit
odd geyser
#

I ran SystemClock on smods-old-calc at the same time as Cryptid

#

it should work there too

cold heron
#

use refactor

dusky summit
#

That's just a note on what I developed it on, SystemClock should support everything back to Lovely 0.4 and Steamodded 1200 at least

#

The dependencies are defined as "Steamodded (>=1.0.0~ALPHA-1220a)", "Lovely (>=0.6)" but i can adjust if necessary

#

I should probably remove the Lovely dependency entirely actually, I don't have any patches

odd geyser
#

"developed on" sounds better than "developed for"

#

you got me confused there

#

I interpret it as "minimum version to run the mod on"

dusky summit
#

And it was always that way

#

It will always have had to have been true

boreal cobalt
glacial sleet
dusky summit
#

Would anyone like to share their setups? I'm implementing presets and want to see if there are any common layouts that people have settled on

frozen meteor
#

I have opted to put the clock in the bottom right, above the deck

#

I can grab a screenshot

#

@dusky summit

dusky summit
frozen meteor
#

true gamers stay up all night

#

(And yes, I prefer 24 Hour)

#

I'm very glad that it's an option

dusky summit
#

That is the correct preference, as is YYYY-MM-DD date formatting

#

I will fight anyone with the wrong preference

frozen meteor
#

well then that's a problem. I use MM/DD/YYYY

#

Like time, I can simply convert, but I'm sorry, I'm just too used to the date format

cold heron
#

YYYY/MM/DD > DD/MM/YYYY (the one i use) >>>>>>> MM/DD/YYYY

dusky summit
#

That's at 30:5:00, if i've understood your date format right

#

No, hang on, it's 30:00:5

#

Meeting at the right time might prove tricky

odd geyser
frozen meteor
chilly wagon
#

Wait this is unironically really useful

trail zodiac
#

this is actually pretty useful, thank you

#

i lose track easily and this made my life easier

chilly wagon
#

i put mine under the joker slots

#

since i look up there a lot

craggy rock
#

it looks neat

celest olive
#

Can you make user manually set their time zone?

#

I mean allow us set local time zone

dusky summit
#

It should use whatever the local time of the system is. Did you want it to show a different time?

celest olive
#

Yes

dusky summit
#

That seems like a very unusual case, why's that?

celest olive
#

A simple UTC±N is useful for me

#

Well tl;dr my device is not able to set local time and it always return UTC time

dusky summit
#

Now i'm even more intrigued. Is this a school or business provided computer that you can't configure?

celest olive
#

No, it's just windows emulator

#

It's some edge cases and I understand if you don't want to mess with it, I just thought if you can then it'll be nice

dusky summit
#

Ah, okay. I'll look into adding a custom time offset value in the config for you in 1.5.0. I won't add it to the config UI because of the niche nature of the setting, and I'd prefer to keep it fairly simple

celest olive
#

Fair enough 👌

dusky summit
# celest olive Fair enough 👌

The option should be available now if you download the latest pre-release 1.5.0~d on GitHub (Code -> Download ZIP). To change it, open %AppData%/Roaming/Balatro/config/SystemClock.jkr in a text editor and change ['hourOffset'] = 0, to whatever you like. Accepts decimals and strings, so ['hourOffset'] = 5.5, and ['hourOffset'] = '+5.5', are both valid

celest olive
dusky summit
# celest olive

Might be the result of update starting before my init has completed. I'll add some safety checks

#

Are you getting this crash every launch, or just occasionally?

celest olive
#

i think, let me check

#

hmm I cannot reproduce now

dusky summit
dusky summit
dusky summit
# celest olive Can you make user manually set their time zone?

Just realised SMODS checks types of config values and invalidates them if they don't match, so hourOffset being set to a string value like ['hourOffset'] = '+5.5' wouldn't work if it weren't also set in config.lua.
For the sake of simplicity and speed i'm going to drop support for string values (since it was broken anyway). ['hourOffset'] = 5.5 will still work as always, just make sure there's no + before the number

spring knoll
#

Plus before might still work

dusky summit
#

Doesn't appear to. I don't think Lua interprets it as a valid number

spring knoll
#

I feel like it should but Lua is funny so I never know

dusky summit
#

Almost every other language handles it explicitly, but Lua just throws an unexpected symbol error

spring knoll
#

Of course it does

dusky summit
#

I wish it did, there are times when aligning a set of numbers would look nicer as

+4.284,
-2.182

and a space just doesn't taste as nice

dusky summit
chilly wagon
#

In speedrun time, that's major

dusky summit
#

It's a whole frame saved...if you're running at 833FPS

spring knoll
#

Sub tick optimization

glacial sleet
#

a millisecond is 1/1000 of a second

#

it's not rocket science

dusky summit
dusky summit
dusky summit
dusky summit
#

New patch release. Fixed a bad function hook that was preventing other mods' hooks of Game.main_menu from being run (!). Apologies to Malverk users especially, this was causing Malverk to not initialise its texture replacements until the Texture menu was opened.
https://github.com/Breezebuilder/SystemClock/releases/tag/v1.6.3

GitHub

Fixed careless hook of G.main_menu which was breaking other mods' hooks to Game.main_menu
Removed early return condition in Controller.queue_R_cursor_press hook which could potentially cause ot...

#

With thanks to DeSynkro on GitHub for alerting me to this - I would have remained blissfully ignorant of this for a long time otherwise.

dusky summit
#

SystemClock [v.1.6.3]

#

SystemClock old thread