├── .gitignore
├── LICENSE.md
├── README.md
├── SystemClock.json
├── assets
├── 1x
│ └── icon.png
└── 2x
│ └── icon.png
├── localization
├── de.lua
├── en-us.lua
├── es_419.lua
├── es_ES.lua
├── fr.lua
├── id.lua
├── it.lua
├── ja.lua
├── ko.lua
├── nl.lua
├── pl.lua
├── pt_BR.lua
├── ru.lua
├── vi.lua
├── zh_CN.lua
└── zh_TW.lua
├── lovely
├── locale_modules.toml
├── modules.toml
└── settings.toml
└── src
├── clock_ui.lua
├── config.lua
├── config_ui.lua
├── core.lua
├── draggable_container.lua
├── init.lua
├── locale.lua
├── logger.lua
├── smods.lua
└── utilities.lua
/.gitignore:
--------------------------------------------------------------------------------
1 | /.vscode
2 | SystemClock.code-workspace
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SystemClock for Balatro
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | SystemClock is a mod for [Balatro](https://store.steampowered.com/app/2379780/Balatro/) which adds a draggable, resizable, customizable clock to the game screen.
12 |
13 | It includes 5 editable presets and supports a variety of time formats, UI styles, and color options.
14 |
15 | Keep track of time - don't fall into the `Black Hole`.
16 |
17 |
18 | ## Installation
19 | 1. Install [Lovely](https://github.com/ethangreen-dev/lovely-injector/releases) by following the [installation instructions here](https://github.com/ethangreen-dev/lovely-injector?tab=readme-ov-file#manual-installation).
20 | - On **Windows**, `version.dll` should be in the same folder as `Balatro.exe`
21 | - On **macOS**, `liblovely.dylib` should be in the same folder as `Balatro.app`
22 |
23 | 2. Open the **Mods** folder or create one if it does not exist.
24 | - On **Windows** this should be located at `%AppData%/Balatro/Mods`
25 | - On **macOS** this should be located at `/Users/$USER/Library/Application Support/Balatro/Mods`
26 |
27 | 3. **Install SystemClock** by copying the **SystemClock** folder **from inside** [SystemClock-version.zip](https://github.com/Breezebuilder/SystemClock/releases) into the **Mods** folder.
28 |
29 | 4. **Configure SystemClock** to your liking by **right-clicking** on the clock
30 | - With only Lovely installed, this menu can also be found at **Settings** -> **Clock**
31 | - If [Steamodded](https://github.com/Steamodded/smods) is also installed, this menu can be found at **MODS** -> **SystemClock** -> **Config** tab
32 |
33 |
34 | ## Contribute
35 | Have an idea for a feature? Found a bug?
36 | [Create an issue here](https://github.com/Breezebuilder/SystemClock/issues/)
37 |
--------------------------------------------------------------------------------
/SystemClock.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "SystemClock",
3 | "name": "SystemClock",
4 | "prefix": "sysclock",
5 | "author": ["Breezebuilder"],
6 | "description": "Shows the local time in-game. Don't fall into the Black Hole.",
7 | "priority": 100000,
8 | "main_file": "src/smods.lua",
9 | "badge_colour": "638fe1",
10 | "version": "1.7.1"
11 | }
12 |
--------------------------------------------------------------------------------
/assets/1x/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Breezebuilder/SystemClock/be74324220b42f066309dbb9edbbfd45453435d7/assets/1x/icon.png
--------------------------------------------------------------------------------
/assets/2x/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Breezebuilder/SystemClock/be74324220b42f066309dbb9edbbfd45453435d7/assets/2x/icon.png
--------------------------------------------------------------------------------
/localization/de.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:grey}Sys{C:red}tem{C:gold}uhr{}",
8 | " ",
9 | "{C:white}Zeigt die lokale Zeit im Spiel an.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 | " ",
18 | "Fallen Sie nicht in das {C:purple,E:1}Schwarze Loch{}."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "Zeit",
26 | ['sysclock_settings_tab'] = "Uhr",
27 | ['sysclock_name'] = "Systemuhr",
28 | ['sysclock_right_click_tooltip'] = {
29 | "Rechtsklick, um",
30 | "Einstellungen zu öffnen"
31 | },
32 | ['sysclock_visibility_setting'] = "Uhr anzeigen",
33 | ['sysclock_persistent_setting'] = "In Menüs anzeigen",
34 | ['sysclock_draggable_setting'] = "Verschieben erlauben",
35 | ['sysclock_preset_setting'] = 'Voreinstellung',
36 | ['sysclock_preset_default_button'] = 'Standard wiederherstellen',
37 | ['sysclock_time_format_setting'] = "Zeitformat",
38 | ['sysclock_style_setting'] = "Stil",
39 | ['sysclock_colour_setting'] = "Farbe",
40 | ['sysclock_text_colour_setting'] = "Textfarbe",
41 | ['sysclock_back_colour_setting'] = "Hintergrundfarbe",
42 | ['sysclock_size_setting'] = "Größe",
43 | ['sysclock_x_position_setting'] = "X-Position",
44 | ['sysclock_y_position_setting'] = "Y-Position",
45 | ['sysclock_styles'] = {
46 | "Einfach",
47 | "Schatten",
48 | "Durchscheinend",
49 | "Prägen",
50 | "Panel",
51 | "Zurückwurf"
52 | },
53 | ['sysclock_colours'] = {
54 | "Weiß",
55 | "Hellgrau",
56 | "Grau",
57 | "Dunkelgrau",
58 | "Schwarz",
59 | "Rot",
60 | "Orange",
61 | "Gelb",
62 | "Gold",
63 | "Grün",
64 | "Himmelblau",
65 | "Blau",
66 | "Marineblau",
67 | "Blurple",
68 | "Lila",
69 | "Lavendel",
70 | "Rosa",
71 | "Edition",
72 | "Edition dunkel",
73 | "Blind",
74 | "Blind dunkel",
75 | "Boss",
76 | "Boss dunkel"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/en-us.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:white}Shows the local time in-game.{}",
8 | " ",
9 | " ",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 | " ",
18 | "Don't fall into the {C:purple,E:1}Black Hole{}."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "Time",
26 | ['sysclock_settings_tab'] = "Clock",
27 | ['sysclock_name'] = "SystemClock",
28 | ['sysclock_right_click_tooltip'] = {
29 | "Right click to",
30 | "open settings"
31 | },
32 | ['sysclock_visibility_setting'] = "Show clock",
33 | ['sysclock_persistent_setting'] = "Show in menus",
34 | ['sysclock_draggable_setting'] = "Allow dragging",
35 | ['sysclock_preset_setting'] = 'Preset',
36 | ['sysclock_preset_default_button'] = 'Restore default',
37 | ['sysclock_time_format_setting'] = "Time format",
38 | ['sysclock_style_setting'] = "Style",
39 | ['sysclock_colour_setting'] = "Colour",
40 | ['sysclock_text_colour_setting'] = "Text colour",
41 | ['sysclock_back_colour_setting'] = "Back colour",
42 | ['sysclock_size_setting'] = "Size",
43 | ['sysclock_x_position_setting'] = "X position",
44 | ['sysclock_y_position_setting'] = "Y position",
45 | ['sysclock_styles'] = {
46 | "Simple",
47 | "Shadow",
48 | "Translucent",
49 | "Emboss",
50 | "Panel",
51 | "Throwback"
52 | },
53 | ['sysclock_colours'] = {
54 | "White",
55 | "Light grey",
56 | "Grey",
57 | "Dark grey",
58 | "Black",
59 | "Red",
60 | "Orange",
61 | "Yellow",
62 | "Gold",
63 | "Green",
64 | "Sky blue",
65 | "Blue",
66 | "Navy",
67 | "Blurple",
68 | "Purple",
69 | "Lavender",
70 | "Pink",
71 | "Edition",
72 | "Edition dark",
73 | "Blind",
74 | "Blind dark",
75 | "Boss",
76 | "Boss dark"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/es_419.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:green}Reloj{C:white}del{C:red}Sistema{}",
8 | " ",
9 | "{C:white}Muestra la hora local en el juego.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 | " ",
18 | "No caigas en el {C:purple,E:1}Agujero Negro{}."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "Hora",
26 | ['sysclock_settings_tab'] = "Reloj",
27 | ['sysclock_name'] = "Reloj del Sistema",
28 | ['sysclock_right_click_tooltip'] = {
29 | "Clic derecho para",
30 | "abrir configuración"
31 | },
32 | ['sysclock_visibility_setting'] = "Mostrar reloj",
33 | ['sysclock_persistent_setting'] = "Mostrar en menús",
34 | ['sysclock_draggable_setting'] = "Permitir arrastrar",
35 | ['sysclock_preset_setting'] = 'Preajuste',
36 | ['sysclock_preset_default_button'] = 'Restaurar predeterminado',
37 | ['sysclock_time_format_setting'] = "Formato de hora",
38 | ['sysclock_style_setting'] = "Estilo",
39 | ['sysclock_colour_setting'] = "Color",
40 | ['sysclock_text_colour_setting'] = "Color del texto",
41 | ['sysclock_back_colour_setting'] = "Color de fondo",
42 | ['sysclock_size_setting'] = "Tamaño",
43 | ['sysclock_x_position_setting'] = "Posición X",
44 | ['sysclock_y_position_setting'] = "Posición Y",
45 | ['sysclock_styles'] = {
46 | "Sencillo",
47 | "Sombra",
48 | "Translúcido",
49 | "Realzar",
50 | "Panel",
51 | "Retroceso"
52 | },
53 | ['sysclock_colours'] = {
54 | "Blanco",
55 | "Gris claro",
56 | "Gris",
57 | "Gris oscuro",
58 | "Negro",
59 | "Rojo",
60 | "Naranja",
61 | "Amarillo",
62 | "Dorado",
63 | "Verde",
64 | "Azul cielo",
65 | "Azul",
66 | "Azul marino",
67 | "Azul borroso",
68 | "Púrpura",
69 | "Lavanda",
70 | "Rosa",
71 | "Edición",
72 | "Edición oscuro",
73 | "Ciega",
74 | "Ciega oscuro",
75 | "Jefe",
76 | "Jefe oscuro"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/es_ES.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:red}Reloj{C:gold}del{C:red}Sistema{}",
8 | " ",
9 | "{C:white}Muestra la hora local en el juego.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 | " ",
18 | "No caigas en el {C:purple,E:1}Agujero Negro{}."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "Hora",
26 | ['sysclock_settings_tab'] = "Reloj",
27 | ['sysclock_name'] = "Reloj del Sistema",
28 | ['sysclock_right_click_tooltip'] = {
29 | "Clic derecho para",
30 | "abrir configuración"
31 | },
32 | ['sysclock_visibility_setting'] = "Mostrar reloj",
33 | ['sysclock_persistent_setting'] = "Mostrar en menús",
34 | ['sysclock_draggable_setting'] = "Permitir arrastrar",
35 | ['sysclock_preset_setting'] = 'Preajuste',
36 | ['sysclock_preset_default_button'] = 'Restaurar predeterminado',
37 | ['sysclock_time_format_setting'] = "Formato de hora",
38 | ['sysclock_style_setting'] = "Estilo",
39 | ['sysclock_colour_setting'] = "Color",
40 | ['sysclock_text_colour_setting'] = "Color del texto",
41 | ['sysclock_back_colour_setting'] = "Color de fondo",
42 | ['sysclock_size_setting'] = "Tamaño",
43 | ['sysclock_x_position_setting'] = "Posición X",
44 | ['sysclock_y_position_setting'] = "Posición Y",
45 | ['sysclock_styles'] = {
46 | "Sencillo",
47 | "Sombra",
48 | "Translúcido",
49 | "Realzar",
50 | "Panel",
51 | "Retroceso"
52 | },
53 | ['sysclock_colours'] = {
54 | "Blanco",
55 | "Gris claro",
56 | "Gris",
57 | "Gris oscuro",
58 | "Negro",
59 | "Rojo",
60 | "Naranja",
61 | "Amarillo",
62 | "Dorado",
63 | "Verde",
64 | "Azul cielo",
65 | "Azul",
66 | "Marino",
67 | "Azul borroso",
68 | "Púrpura",
69 | "Lavanda",
70 | "Rosa",
71 | "Edición",
72 | "Edición oscuro",
73 | "Ciega",
74 | "Ciega oscuro",
75 | "Jefe",
76 | "Jefe oscuro"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/fr.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:blue}Horl{C:white}ogeSys{C:red}tème{}",
8 | " ",
9 | "{C:white}Affiche l'heure locale dans le jeu.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 | " ",
18 | "Ne tombez pas dans le {C:purple,E:1}Trou Noir{}."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "Heure",
26 | ['sysclock_settings_tab'] = "Horloge",
27 | ['sysclock_name'] = "Horloge Système",
28 | ['sysclock_right_click_tooltip'] = {
29 | "Clic droit pour",
30 | "ouvrir les réglages"
31 | },
32 | ['sysclock_visibility_setting'] = "Afficher l'horloge",
33 | ['sysclock_persistent_setting'] = "Afficher dans les menus",
34 | ['sysclock_draggable_setting'] = "Autoriser le déplacement",
35 | ['sysclock_preset_setting'] = 'Préréglage',
36 | ['sysclock_preset_default_button'] = 'Restaurer par défaut',
37 | ['sysclock_time_format_setting'] = "Format de l'heure",
38 | ['sysclock_style_setting'] = "Style",
39 | ['sysclock_colour_setting'] = "Couleur",
40 | ['sysclock_text_colour_setting'] = "Couleur du texte",
41 | ['sysclock_back_colour_setting'] = "Couleur de fond",
42 | ['sysclock_size_setting'] = "Taille",
43 | ['sysclock_x_position_setting'] = "Position X",
44 | ['sysclock_y_position_setting'] = "Position Y",
45 | ['sysclock_styles'] = {
46 | "Simple",
47 | "Ombre",
48 | "Translucide",
49 | "Embossé",
50 | "Panneau",
51 | "Rétrolancer"
52 | },
53 | ['sysclock_colours'] = {
54 | "Blanc",
55 | "Gris clair",
56 | "Gris",
57 | "Gris foncé",
58 | "Noir",
59 | "Rouge",
60 | "Orange",
61 | "Jaune",
62 | "Or",
63 | "Vert",
64 | "Bleu ciel",
65 | "Bleu",
66 | "Marine",
67 | "Bleu royal",
68 | "Violet",
69 | "Lavande",
70 | "Rose",
71 | "Édition",
72 | "Édition foncé",
73 | "Blinde",
74 | "Blinde foncé",
75 | "Boss",
76 | "Boss foncé"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/id.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:red}Jam{C:white}Sistem{}",
8 | " ",
9 | "{C:white}Menampilkan waktu lokal dalam permainan.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 | " ",
18 | "Jangan jatuh ke dalam {C:purple,E:1}Lubang Hitam{}."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "Waktu",
26 | ['sysclock_settings_tab'] = "Jam",
27 | ['sysclock_name'] = "Jam Sistem",
28 | ['sysclock_right_click_tooltip'] = {
29 | "Klik kanan untuk",
30 | "membuka pengaturan"
31 | },
32 | ['sysclock_visibility_setting'] = "Tampilkan jam",
33 | ['sysclock_persistent_setting'] = "Tampilkan di menu",
34 | ['sysclock_draggable_setting'] = "Izinkan penarikan",
35 | ['sysclock_preset_setting'] = 'Prasetel',
36 | ['sysclock_preset_default_button'] = 'Pulihkan default',
37 | ['sysclock_time_format_setting'] = "Format waktu",
38 | ['sysclock_style_setting'] = "Gaya",
39 | ['sysclock_colour_setting'] = "Warna",
40 | ['sysclock_text_colour_setting'] = "Warna teks",
41 | ['sysclock_back_colour_setting'] = "Warna latar belakang",
42 | ['sysclock_size_setting'] = "Ukuran",
43 | ['sysclock_x_position_setting'] = "Posisi X",
44 | ['sysclock_y_position_setting'] = "Posisi Y",
45 | ['sysclock_styles'] = {
46 | "Sederhana",
47 | "Bayangan",
48 | "Transparan",
49 | "Emboss",
50 | "Panel",
51 | "Baliklempar"
52 | },
53 | ['sysclock_colours'] = {
54 | "Putih",
55 | "Abu-abu terang",
56 | "Abu-abu",
57 | "Abu-abu gelap",
58 | "Hitam",
59 | "Merah",
60 | "Oranye",
61 | "Kuning",
62 | "Emas",
63 | "Hijau",
64 | "Biru langit",
65 | "Biru",
66 | "Angkatan laut",
67 | "Biru ungu",
68 | "Ungu",
69 | "Lavender",
70 | "Merah muda",
71 | "Edisi",
72 | "Edisi gelap",
73 | "Blind",
74 | "Blind gelap",
75 | "Boss",
76 | "Boss gelap"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/it.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:green}Orologio{C:white}di{C:red}Sistema{}",
8 | " ",
9 | "{C:white}Mostra l'ora locale nel gioco.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 | " ",
18 | "Non cadere nel {C:purple,E:1}Buco Nero{}."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "Ora",
26 | ['sysclock_settings_tab'] = "Orologio",
27 | ['sysclock_name'] = "Orologio di Sistema",
28 | ['sysclock_right_click_tooltip'] = {
29 | "Click destro per",
30 | "aprire le impostazioni"
31 | },
32 | ['sysclock_visibility_setting'] = "Mostra orologio",
33 | ['sysclock_persistent_setting'] = "Mostra nei menu",
34 | ['sysclock_draggable_setting'] = "Consenti trascinamento",
35 | ['sysclock_preset_setting'] = 'Preimpostazione',
36 | ['sysclock_preset_default_button'] = 'Ripristina predefinito',
37 | ['sysclock_time_format_setting'] = "Formato orario",
38 | ['sysclock_style_setting'] = "Stile",
39 | ['sysclock_colour_setting'] = "Colore",
40 | ['sysclock_text_colour_setting'] = "Colore del testo",
41 | ['sysclock_back_colour_setting'] = "Colore di sfondo",
42 | ['sysclock_size_setting'] = "Dimensione",
43 | ['sysclock_x_position_setting'] = "Posizione X",
44 | ['sysclock_y_position_setting'] = "Posizione Y",
45 | ['sysclock_styles'] = {
46 | "Semplice",
47 | "Ombra",
48 | "Traslucido",
49 | "Rilievo",
50 | "Pannello",
51 | "Rilancio"
52 | },
53 | ['sysclock_colours'] = {
54 | "Bianco",
55 | "Grigio chiaro",
56 | "Grigio",
57 | "Grigio scuro",
58 | "Nero",
59 | "Rosso",
60 | "Arancione",
61 | "Giallo",
62 | "Oro",
63 | "Verde",
64 | "Azzurro",
65 | "Blu",
66 | "Marina",
67 | "Blu viola",
68 | "Viola",
69 | "Lavanda",
70 | "Rosa",
71 | "Edizione",
72 | "Edizione scuro",
73 | "Buio",
74 | "Buio scuro",
75 | "Boss",
76 | "Boss scuro"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/ja.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:white}システ{C:red}ムク{C:white}ロック{}",
8 | " ",
9 | "{C:white}ゲーム内で現地時間を表示します。{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 |
18 | "{C:purple,E:1}ブラックホール{}に落ちないように注意してください。"
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "時間",
26 | ['sysclock_settings_tab'] = "時計",
27 | ['sysclock_name'] = "システムクロック",
28 | ['sysclock_right_click_tooltip'] = {
29 | "右クリックで",
30 | "設定を開く"
31 | },
32 | ['sysclock_visibility_setting'] = "時計を表示",
33 | ['sysclock_persistent_setting'] = "メニューに表示",
34 | ['sysclock_draggable_setting'] = "ドラッグを許可",
35 | ['sysclock_preset_setting'] = 'プリセット',
36 | ['sysclock_preset_default_button'] = 'デフォルトに戻す',
37 | ['sysclock_time_format_setting'] = "時間形式",
38 | ['sysclock_style_setting'] = "スタイル",
39 | ['sysclock_colour_setting'] = "色",
40 | ['sysclock_text_colour_setting'] = "文字色",
41 | ['sysclock_back_colour_setting'] = "背景色",
42 | ['sysclock_size_setting'] = "サイズ",
43 | ['sysclock_x_position_setting'] = "X位置",
44 | ['sysclock_y_position_setting'] = "Y位置",
45 | ['sysclock_styles'] = {
46 | "シンプル",
47 | "シャドウ",
48 | "半透明",
49 | "エンボス",
50 | "パネル",
51 | "投げ戻し"
52 | },
53 | ['sysclock_colours'] = {
54 | "白",
55 | "亮灰色",
56 | "灰色",
57 | "鼠色",
58 | "黒",
59 | "赤",
60 | "色",
61 | "黄色",
62 | "金色",
63 | "緑",
64 | "空色",
65 | "青",
66 | "濃い青色",
67 | "青緑",
68 | "紫",
69 | "藤色",
70 | "桃色",
71 | "エディション",
72 | "エディションダーク",
73 | "ブラインド",
74 | "ブラインドダーク",
75 | "ボス",
76 | "ボスダーク"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/ko.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:red}시스템{C:blue}클럭{}",
8 | " ",
9 | "{C:white}게임 내 현지 시간을 표시합니다.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 |
18 | "{C:purple,E:1}블랙홀{}에 빠지지 마세요."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "시간",
26 | ['sysclock_settings_tab'] = "시계",
27 | ['sysclock_name'] = "시스템 클럭",
28 | ['sysclock_right_click_tooltip'] = {
29 | "우클릭하여",
30 | "설정 열기"
31 | },
32 | ['sysclock_visibility_setting'] = "시계 표시",
33 | ['sysclock_persistent_setting'] = "메뉴에 표시",
34 | ['sysclock_draggable_setting'] = "드래그 허용",
35 | ['sysclock_preset_setting'] = '프리셋',
36 | ['sysclock_preset_default_button'] = '기본값 복원',
37 | ['sysclock_time_format_setting'] = "시간 형식",
38 | ['sysclock_style_setting'] = "스타일",
39 | ['sysclock_colour_setting'] = "색상",
40 | ['sysclock_text_colour_setting'] = "텍스트 색상",
41 | ['sysclock_back_colour_setting'] = "배경 색상",
42 | ['sysclock_size_setting'] = "크기",
43 | ['sysclock_x_position_setting'] = "X 위치",
44 | ['sysclock_y_position_setting'] = "Y 위치",
45 | ['sysclock_styles'] = {
46 | "단순",
47 | "그림자",
48 | "반투명",
49 | "양각",
50 | "패널",
51 | "되던짐"
52 | },
53 | ['sysclock_colours'] = {
54 | "흰색",
55 | "밝은 회색",
56 | "회색",
57 | "어두운 회색",
58 | "검정색",
59 | "빨간색",
60 | "주황색",
61 | "노란색",
62 | "금색",
63 | "녹색",
64 | "하늘색",
65 | "파란색",
66 | "남색",
67 | "파란색 보라색",
68 | "보라색",
69 | "라벤더",
70 | "분홍색",
71 | "에디션",
72 | "에디션 어두운",
73 | "블라인드",
74 | "블라인드 어두운",
75 | "보스",
76 | "보스 어두운"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/nl.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:red}Sys{C:white}teem{C:blue}klok{}",
8 | " ",
9 | "{C:white}Toont de lokale tijd in het spel.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 | " ",
18 | "Val niet in het {C:purple,E:1}Zwarte Gat{}."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "Tijd",
26 | ['sysclock_settings_tab'] = "Klok",
27 | ['sysclock_name'] = "Systeemklok",
28 | ['sysclock_right_click_tooltip'] = {
29 | "Rechtsklik om",
30 | "instellingen te openen"
31 | },
32 | ['sysclock_visibility_setting'] = "Toon klok",
33 | ['sysclock_persistent_setting'] = "Weergeven in menu's",
34 | ['sysclock_draggable_setting'] = "Slepen toestaan",
35 | ['sysclock_preset_setting'] = 'Voorinstelling',
36 | ['sysclock_preset_default_button'] = 'Standaard herstellen',
37 | ['sysclock_time_format_setting'] = "Tijdformaat",
38 | ['sysclock_style_setting'] = "Stijl",
39 | ['sysclock_colour_setting'] = "Kleur",
40 | ['sysclock_text_colour_setting'] = "Tekstkleur",
41 | ['sysclock_back_colour_setting'] = "Achtergrondkleur",
42 | ['sysclock_size_setting'] = "Grootte",
43 | ['sysclock_x_position_setting'] = "X positie",
44 | ['sysclock_y_position_setting'] = "Y positie",
45 | ['sysclock_styles'] = {
46 | "Eenvoudig",
47 | "Schaduw",
48 | "Transparant",
49 | "Preg",
50 | "Paneel",
51 | "Terugworp"
52 | },
53 | ['sysclock_colours'] = {
54 | "Wit",
55 | "Lichtgrijs",
56 | "Grijs",
57 | "Donkergrijs",
58 | "Zwart",
59 | "Rood",
60 | "Oranje",
61 | "Geel",
62 | "Goud",
63 | "Groen",
64 | "Lichtblauw",
65 | "Blauw",
66 | "Marineblauw",
67 | "Blauw paars",
68 | "Paars",
69 | "Lavendel",
70 | "Roze",
71 | "Editie",
72 | "Editie donker",
73 | "Blind",
74 | "Blind donker",
75 | "Baas",
76 | "Baas donker"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/pl.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:white}Zegar{C:red}Systemowy{}",
8 | " ",
9 | "{C:white}Pokazuje lokalny czas w grze.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 | " ",
18 | "Nie wpadaj w {C:purple,E:1}Czarną Dziurę{}."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "Czas",
26 | ['sysclock_settings_tab'] = "Zegar",
27 | ['sysclock_name'] = "Zegar Systemowy",
28 | ['sysclock_right_click_tooltip'] = {
29 | "Prawy klik, aby",
30 | "otworzyć ustawienia"
31 | },
32 | ['sysclock_visibility_setting'] = "Pokaż zegar",
33 | ['sysclock_persistent_setting'] = "Pokaż w menu",
34 | ['sysclock_draggable_setting'] = "Zezwól na przeciąganie",
35 | ['sysclock_preset_setting'] = 'Ustawienie wstępne',
36 | ['sysclock_preset_default_button'] = 'Przywróć domyślny',
37 | ['sysclock_time_format_setting'] = "Format czasu",
38 | ['sysclock_style_setting'] = "Styl",
39 | ['sysclock_colour_setting'] = "Kolor",
40 | ['sysclock_text_colour_setting'] = "Kolor tekstu",
41 | ['sysclock_back_colour_setting'] = "Kolor tła",
42 | ['sysclock_size_setting'] = "Rozmiar",
43 | ['sysclock_x_position_setting'] = "Pozycja X",
44 | ['sysclock_y_position_setting'] = "Pozycja Y",
45 | ['sysclock_styles'] = {
46 | "Prosty",
47 | "Cień",
48 | "Przezroczysty",
49 | "Wyryć",
50 | "Panel",
51 | "Odrzut"
52 | },
53 | ['sysclock_colours'] = {
54 | "Biały",
55 | "Jasnoszary",
56 | "Szary",
57 | "Ciemnoszary",
58 | "Czarny",
59 | "Czerwony",
60 | "Pomarańczowy",
61 | "Żółty",
62 | "Złoty",
63 | "Zielony",
64 | "Jasnoniebieski",
65 | "Niebieski",
66 | "Granatowy",
67 | "Niebieski fioletowy",
68 | "Fioletowy",
69 | "Lawendowy",
70 | "Różowy",
71 | "Wersja",
72 | "Wersja ciemny",
73 | "Przeszkadzajkę",
74 | "Przeszkadzajkę ciemny",
75 | "Bossa",
76 | "Bossa ciemny"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/pt_BR.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:green}Relógio{C:gold}do{C:blue}Sistema{}",
8 | " ",
9 | "{C:white}Mostra a hora local no jogo.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 | " ",
18 | "Não caia no {C:purple,E:1}Buraco Negro{}."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "Hora",
26 | ['sysclock_settings_tab'] = "Relógio",
27 | ['sysclock_name'] = "Relógio do Sistema",
28 | ['sysclock_right_click_tooltip'] = {
29 | "Clique direito para",
30 | "abrir configurações"
31 | },
32 | ['sysclock_visibility_setting'] = "Mostrar relógio",
33 | ['sysclock_persistent_setting'] = "Mostrar nos menus",
34 | ['sysclock_draggable_setting'] = "Permitir arrastar",
35 | ['sysclock_preset_setting'] = 'Predefinição',
36 | ['sysclock_preset_default_button'] = 'Restaurar padrão',
37 | ['sysclock_time_format_setting'] = "Formato de hora",
38 | ['sysclock_style_setting'] = "Estilo",
39 | ['sysclock_colour_setting'] = "Cor",
40 | ['sysclock_text_colour_setting'] = "Cor do texto",
41 | ['sysclock_back_colour_setting'] = "Cor de fundo",
42 | ['sysclock_size_setting'] = "Tamanho",
43 | ['sysclock_x_position_setting'] = "Posição X",
44 | ['sysclock_y_position_setting'] = "Posição Y",
45 | ['sysclock_styles'] = {
46 | "Simples",
47 | "Sombra",
48 | "Translúcido",
49 | "Relevo",
50 | "Painel",
51 | "Retroarremesso"
52 | },
53 | ['sysclock_colours'] = {
54 | "Branco",
55 | "Cinza claro",
56 | "Cinza",
57 | "Cinza escuro",
58 | "Preto",
59 | "Vermelho",
60 | "Laranja",
61 | "Amarelo",
62 | "Dourado",
63 | "Verde",
64 | "Azul céu",
65 | "Azul",
66 | "Marinho",
67 | "Azul arroxeado",
68 | "Roxo",
69 | "Lavanda",
70 | "Rosa",
71 | "Edição",
72 | "Edição escuro",
73 | "Blind",
74 | "Blind escuro",
75 | "Chefe",
76 | "Chefe escuro"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/ru.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:white}Сист{C:blue}емные{C:red}часы{}",
8 | " ",
9 | "{C:white}Показывает местное время в игре.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 | " ",
18 | "Не попадайте в {C:purple,E:1}Чёрную дыру{}."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "Время",
26 | ['sysclock_settings_tab'] = "Часы",
27 | ['sysclock_name'] = "Системные часы",
28 | ['sysclock_right_click_tooltip'] = {
29 | "ПКМ, чтобы",
30 | "открыть настройки"
31 | },
32 | ['sysclock_visibility_setting'] = "Показать часы",
33 | ['sysclock_persistent_setting'] = "Показывать в меню",
34 | ['sysclock_draggable_setting'] = "Перетаскивание",
35 | ['sysclock_preset_setting'] = 'Предустановка',
36 | ['sysclock_preset_default_button'] = 'Восстановить',
37 | ['sysclock_time_format_setting'] = "Формат времени",
38 | ['sysclock_style_setting'] = "Стиль",
39 | ['sysclock_colour_setting'] = "Цвет",
40 | ['sysclock_text_colour_setting'] = "Цвет текста",
41 | ['sysclock_back_colour_setting'] = "Цвет фона",
42 | ['sysclock_size_setting'] = "Размер",
43 | ['sysclock_x_position_setting'] = "Позиция X",
44 | ['sysclock_y_position_setting'] = "Позиция Y",
45 | ['sysclock_styles'] = {
46 | "Простой",
47 | "Тень",
48 | "Полупрозрачный",
49 | "Тиснение",
50 | "Панель",
51 | "Отброс"
52 | },
53 | ['sysclock_colours'] = {
54 | "Белый",
55 | "Светло-серый",
56 | "Серый",
57 | "Тёмно-серый",
58 | "Чёрный",
59 | "Красный",
60 | "Оранжевый",
61 | "Жёлтый",
62 | "Золотой",
63 | "Зелёный",
64 | "Небесно-голубой",
65 | "Синий",
66 | "Тёмно-синий",
67 | "Сине-фиолетовый",
68 | "Фиолетовый",
69 | "Лаванда",
70 | "Розовый",
71 | "Выпуск",
72 | "Выпуск тёмный",
73 | "Блайнд",
74 | "Блайнд тёмный",
75 | "Босс",
76 | "Босс тёмный"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/vi.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:red}Đồng{C:gold}Hồ{C:red}Hệ{C:gold}Thống{}",
8 | " ",
9 | "{C:white}Xem giờ hiện tại trực tiếp trong game.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | "{C:green}Bản dịch của {C:gold}HuyTheKiller{}",
17 | " ",
18 | "Đừng để rơi vào {C:purple,E:1}Hố Đen{} nhé."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "Thời gian",
26 | ['sysclock_settings_tab'] = "Đồng hồ",
27 | ['sysclock_name'] = "Đồng Hồ Hệ Thống",
28 | ['sysclock_right_click_tooltip'] = {
29 | "Nhấp chuột phải để",
30 | "mở cài đặt"
31 | },
32 | ['sysclock_visibility_setting'] = "Hiện đồng hồ",
33 | ['sysclock_persistent_setting'] = "Xem trong menu",
34 | ['sysclock_draggable_setting'] = "Cho phép kéo thả",
35 | ['sysclock_preset_setting'] = 'Cài đặt sẵn',
36 | ['sysclock_preset_default_button'] = 'Khôi phục mặc định',
37 | ['sysclock_time_format_setting'] = "Định dạng thời gian",
38 | ['sysclock_style_setting'] = "Kiểu",
39 | ['sysclock_colour_setting'] = "Màu",
40 | ['sysclock_text_colour_setting'] = "Màu chữ",
41 | ['sysclock_back_colour_setting'] = "Màu nền",
42 | ['sysclock_size_setting'] = "Kích thước",
43 | ['sysclock_x_position_setting'] = "Vị trí X",
44 | ['sysclock_y_position_setting'] = "Vị trí Y",
45 | ['sysclock_styles'] = {
46 | "Đơn giản",
47 | "Dổ bóng",
48 | "Trong suốt",
49 | "Dập nổi",
50 | "Thêm viền",
51 | "Némlại"
52 | },
53 | ['sysclock_colours'] = {
54 | "Trắng",
55 | "Xám nhạt",
56 | "Xám",
57 | "Xám đậm",
58 | "Đen",
59 | "Đỏ",
60 | "Cam",
61 | "Vàng",
62 | "Vàng óng",
63 | "Lục",
64 | "Lục lam",
65 | "Lam",
66 | "Lam đậm",
67 | "Lam tím",
68 | "Tím",
69 | "Tím oải hương",
70 | "Hồng",
71 | "Ấn bản",
72 | "Ấn bản tối",
73 | "Blind",
74 | "Blind tối",
75 | "Boss",
76 | "Boss tối"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/zh_CN.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:red}系统时钟{}",
8 | " ",
9 | "{C:white}在游戏中显示本地时间.{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 |
18 | "不要掉进{C:purple,E:1}黑洞{}."
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "时间",
26 | ['sysclock_settings_tab'] = "时钟",
27 | ['sysclock_name'] = "系统时钟",
28 | ['sysclock_right_click_tooltip'] = {
29 | "右键点击以",
30 | "打开设置"
31 | },
32 | ['sysclock_visibility_setting'] = "显示时钟",
33 | ['sysclock_persistent_setting'] = "在菜单中显示",
34 | ['sysclock_draggable_setting'] = "允许拖动",
35 | ['sysclock_preset_setting'] = '预设',
36 | ['sysclock_preset_default_button'] = '恢复默认值',
37 | ['sysclock_time_format_setting'] = "时间格式",
38 | ['sysclock_style_setting'] = "样式",
39 | ['sysclock_colour_setting'] = "颜色",
40 | ['sysclock_text_colour_setting'] = "文字颜色",
41 | ['sysclock_back_colour_setting'] = "背景颜色",
42 | ['sysclock_size_setting'] = "大小",
43 | ['sysclock_x_position_setting'] = "X 位置",
44 | ['sysclock_y_position_setting'] = "Y 位置",
45 | ['sysclock_styles'] = {
46 | "简单",
47 | "阴影",
48 | "半透明",
49 | "压花",
50 | "面板",
51 | "回投"
52 | },
53 | ['sysclock_colours'] = {
54 | "白色",
55 | "浅灰色",
56 | "灰色",
57 | "深灰色",
58 | "黑色",
59 | "红色",
60 | "橙色",
61 | "黄色",
62 | "金色",
63 | "绿色",
64 | "天蓝色",
65 | "蓝色",
66 | "深蓝色",
67 | "蓝紫色",
68 | "紫色",
69 | "薰衣草色",
70 | "粉色",
71 | "版本",
72 | "版本深色",
73 | "盲注",
74 | "盲注深色",
75 | "Boss色",
76 | "Boss深色"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/localization/zh_TW.lua:
--------------------------------------------------------------------------------
1 | return {
2 | ['descriptions'] = {
3 | ['Mod'] = {
4 | ['SystemClock'] = {
5 | name = 'SystemClock',
6 | text = {
7 | "{C:red}系統時鐘{}",
8 | " ",
9 | "{C:white}在遊戲中顯示本地時間。{}",
10 | " ",
11 | " ",
12 | " ",
13 | " ",
14 | " ",
15 | " ",
16 | " ",
17 |
18 | "不要掉進{C:purple,E:1}黑洞{}。"
19 | }
20 | }
21 | }
22 | },
23 | ['misc'] = {
24 | ['dictionary'] = {
25 | ['sysclock_time_heading'] = "時間",
26 | ['sysclock_settings_tab'] = "時鐘",
27 | ['sysclock_name'] = "系統時鐘",
28 | ['sysclock_right_click_tooltip'] = {
29 | "右鍵點擊以",
30 | "開啟設定"
31 | },
32 | ['sysclock_visibility_setting'] = "顯示時鐘",
33 | ['sysclock_persistent_setting'] = "在選單中顯示",
34 | ['sysclock_draggable_setting'] = "允許拖動",
35 | ['sysclock_preset_setting'] = '預設',
36 | ['sysclock_preset_default_button'] = '恢復預設值',
37 | ['sysclock_time_format_setting'] = "時間格式",
38 | ['sysclock_style_setting'] = "樣式",
39 | ['sysclock_colour_setting'] = "顏色",
40 | ['sysclock_text_colour_setting'] = "文字顏色",
41 | ['sysclock_back_colour_setting'] = "背景顏色",
42 | ['sysclock_size_setting'] = "大小",
43 | ['sysclock_x_position_setting'] = "X 位置",
44 | ['sysclock_y_position_setting'] = "Y 位置",
45 | ['sysclock_styles'] = {
46 | "簡單",
47 | "陰影",
48 | "半透明",
49 | "浮雕",
50 | "面板",
51 | "回投"
52 | },
53 | ['sysclock_colours'] = {
54 | "白色",
55 | "淺灰色",
56 | "灰色",
57 | "深灰色",
58 | "黑色",
59 | "紅色",
60 | "橙色",
61 | "黃色",
62 | "金色",
63 | "綠色",
64 | "天藍色",
65 | "藍色",
66 | "海軍藍",
67 | "藍紫色",
68 | "紫色",
69 | "薰衣草色",
70 | "粉紅色",
71 | "版本",
72 | "版本深色",
73 | "盲注",
74 | "盲注深色",
75 | "Boss色",
76 | "Boss深色"
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/lovely/locale_modules.toml:
--------------------------------------------------------------------------------
1 | [manifest]
2 | version = '1.0.0'
3 | dump_lua = true
4 | priority = 1
5 |
6 | [[patches]]
7 | [patches.module]
8 | source = 'localization/de.lua'
9 | before = 'main.lua'
10 | name = 'systemclock.locale.de'
11 |
12 | [[patches]]
13 | [patches.module]
14 | source = 'localization/en-us.lua'
15 | before = 'main.lua'
16 | name = 'systemclock.locale.en-us'
17 |
18 | [[patches]]
19 | [patches.module]
20 | source = 'localization/es_419.lua'
21 | before = 'main.lua'
22 | name = 'systemclock.locale.es_419'
23 |
24 | [[patches]]
25 | [patches.module]
26 | source = 'localization/es_ES.lua'
27 | before = 'main.lua'
28 | name = 'systemclock.locale.es_es'
29 |
30 | [[patches]]
31 | [patches.module]
32 | source = 'localization/fr.lua'
33 | before = 'main.lua'
34 | name = 'systemclock.locale.fr'
35 |
36 | [[patches]]
37 | [patches.module]
38 | source = 'localization/id.lua'
39 | before = 'main.lua'
40 | name = 'systemclock.locale.id'
41 |
42 | [[patches]]
43 | [patches.module]
44 | source = 'localization/it.lua'
45 | before = 'main.lua'
46 | name = 'systemclock.locale.it'
47 |
48 | [[patches]]
49 | [patches.module]
50 | source = 'localization/ja.lua'
51 | before = 'main.lua'
52 | name = 'systemclock.locale.ja'
53 |
54 | [[patches]]
55 | [patches.module]
56 | source = 'localization/ko.lua'
57 | before = 'main.lua'
58 | name = 'systemclock.locale.ko'
59 |
60 | [[patches]]
61 | [patches.module]
62 | source = 'localization/nl.lua'
63 | before = 'main.lua'
64 | name = 'systemclock.locale.nl'
65 |
66 | [[patches]]
67 | [patches.module]
68 | source = 'localization/pl.lua'
69 | before = 'main.lua'
70 | name = 'systemclock.locale.pl'
71 |
72 | [[patches]]
73 | [patches.module]
74 | source = 'localization/pt_BR.lua'
75 | before = 'main.lua'
76 | name = 'systemclock.locale.pt_br'
77 |
78 | [[patches]]
79 | [patches.module]
80 | source = 'localization/ru.lua'
81 | before = 'main.lua'
82 | name = 'systemclock.locale.ru'
83 |
84 | [[patches]]
85 | [patches.module]
86 | source = 'localization/vi.lua'
87 | before = 'main.lua'
88 | name = 'systemclock.locale.vi'
89 |
90 | [[patches]]
91 | [patches.module]
92 | source = 'localization/zh_CN.lua'
93 | before = 'main.lua'
94 | name = 'systemclock.locale.zh_cn'
95 |
96 | [[patches]]
97 | [patches.module]
98 | source = 'localization/zh_TW.lua'
99 | before = 'main.lua'
100 | name = 'systemclock.locale.zh_tw'
101 |
--------------------------------------------------------------------------------
/lovely/modules.toml:
--------------------------------------------------------------------------------
1 | [manifest]
2 | version = '1.0.0'
3 | dump_lua = true
4 | priority = 1
5 |
6 | [[patches]]
7 | [patches.module]
8 | source = 'src/draggable_container.lua'
9 | before = 'main.lua'
10 | name = 'systemclock.draggablecontainer'
11 |
12 | [[patches]]
13 | [patches.module]
14 | source = 'src/utilities.lua'
15 | before = 'main.lua'
16 | name = 'systemclock.utilities'
17 |
18 | [[patches]]
19 | [patches.module]
20 | source = 'src/config.lua'
21 | before = 'main.lua'
22 | name = 'systemclock.config'
23 |
24 | [[patches]]
25 | [patches.module]
26 | source = 'src/config_ui.lua'
27 | before = 'main.lua'
28 | name = 'systemclock.config_ui'
29 |
30 | [[patches]]
31 | [patches.module]
32 | source = 'src/clock_ui.lua'
33 | before = 'main.lua'
34 | name = 'systemclock.clock_ui'
35 |
36 | [[patches]]
37 | [patches.module]
38 | source = 'src/locale.lua'
39 | before = 'main.lua'
40 | name = 'systemclock.locale'
41 |
42 | [[patches]]
43 | [patches.module]
44 | source = 'src/logger.lua'
45 | before = 'main.lua'
46 | name = 'systemclock.logger'
47 |
48 | [[patches]]
49 | [patches.module]
50 | source = 'src/core.lua'
51 | before = 'main.lua'
52 | name = 'systemclock.core'
53 |
54 | [[patches]]
55 | [patches.copy]
56 | target = 'main.lua'
57 | position = 'append'
58 | sources = [
59 | 'src/init.lua'
60 | ]
--------------------------------------------------------------------------------
/lovely/settings.toml:
--------------------------------------------------------------------------------
1 | [manifest]
2 | version = "1.0.0"
3 | dump_lua = true
4 | priority = 10
5 |
6 | [[patches]]
7 | [patches.pattern]
8 | target = "functions/UI_definitions.lua"
9 | match_indent = true
10 | position = "before"
11 | pattern = '''local t = create_UIBox_generic_options({back_func = 'options',contents = {create_tabs('''
12 | payload = '''
13 | if not SMODS then
14 | tabs[#tabs+1] = {
15 | label = require('systemclock.locale').translate('sysclock_settings_tab'),
16 | tab_definition_function = require('systemclock.config_ui').create_config_tab
17 | }
18 | end
19 | '''
--------------------------------------------------------------------------------
/src/clock_ui.lua:
--------------------------------------------------------------------------------
1 | local clock_ui = {}
2 |
3 | local config = require('systemclock.config')
4 | local config_ui = require('systemclock.config_ui')
5 | local locale = require('systemclock.locale')
6 | local draggable_container = require('systemclock.draggablecontainer')
7 |
8 | clock_ui.has_dynamic_shadow_colour = false
9 |
10 | clock_ui.styles = {
11 | ['simple'] = {
12 |
13 | },
14 | ['shadow'] = {
15 | text_shadow = true
16 | },
17 | ['translucent'] = {
18 | shadow_colour = G.C.UI.TRANSPARENT_DARK,
19 | shadow_padding = 0.05,
20 | text_shadow = true
21 | },
22 | ['panel'] = {
23 | shadow_colour = G.C.UI.TRANSPARENT_DARK,
24 | shadow_padding = 0.02,
25 | outer_colour_ref = 'back',
26 | outer_padding = 0.03,
27 | inner_colour = G.C.DYN_UI.BOSS_DARK,
28 | inner_padding = 0.05,
29 | text_padding = 0.05,
30 | text_shadow = true
31 | },
32 | ['emboss'] = {
33 | shadow_colour_ref = 'shadow',
34 | outer_colour_ref = 'back',
35 | emboss_amount = 0.05,
36 | inner_padding = 0.1,
37 | text_shadow = true
38 | },
39 | ['throwback'] = {
40 | shadow_colour_ref = 'shadow',
41 | outer_colour_ref = 'back',
42 | inner_colour = G.C.DYN_UI.BOSS_DARK,
43 | outer_width = 1.45,
44 | outer_height = 1.15,
45 | outer_padding = 0.01,
46 | inner_width = 1.2,
47 | inner_height = 0.7,
48 | emboss_amount = 0.05,
49 | heading_text = 'sysclock_time_heading',
50 | text_shadow = true
51 | }
52 | }
53 |
54 | local function calculate_max_text_width()
55 | local font = G.LANG.font
56 | local width = 0
57 | local string = SystemClock.get_formatted_time(SystemClock.current_format.format_string, true, SystemClock.example_time)
58 | for _, c in utf8.chars(string) do
59 | local dx = font.FONT:getWidth(c) * SystemClock.current_preset.size * G.TILESCALE * font.FONTSCALE
60 | dx = dx + 3 * G.TILESCALE * font.FONTSCALE
61 | dx = dx / (G.TILESIZE * G.TILESCALE)
62 | width = width + dx
63 | end
64 | return width
65 | end
66 |
67 | local function create_clock_h_popup(text, text_size)
68 | text_size = text_size or 0.35
69 | local rows = {}
70 |
71 | for i = 1, #text do
72 | local row = {
73 | n = G.UIT.R,
74 | config = { align = 'cm', padding = 0.05 * text_size },
75 | nodes = {
76 | {
77 | n = G.UIT.T,
78 | config = {
79 | text = text[i],
80 | shadow = true,
81 | colour = G.C.UI.TEXT_LIGHT,
82 | scale = text_size
83 | }
84 | }
85 | }
86 | }
87 | table.insert(rows, row)
88 | end
89 |
90 | local h_popup = {
91 | n = G.UIT.ROOT,
92 | config = {
93 | padding = 0.1,
94 | r = 0.1,
95 | colour = { 0.205, 0.246, 0.253, 0.9 }
96 | },
97 | nodes = {
98 | {
99 | n = G.UIT.C,
100 | nodes = rows
101 | }
102 | }
103 | }
104 |
105 | return h_popup
106 | end
107 |
108 | local function create_clock_DynaText(text_size, colours, shadow, float, silent)
109 | local dynaText = DynaText({
110 | string = { {
111 | ref_table = SystemClock,
112 | ref_value = 'time'
113 | } },
114 | colours = colours,
115 | scale = text_size,
116 | shadow = shadow,
117 | pop_in_rate = 9999999,
118 | float = float,
119 | silent = silent,
120 | })
121 |
122 | return {
123 | n = G.UIT.O,
124 | config = {
125 | align = 'cm',
126 | id = 'sysclock_clock_text',
127 | object = dynaText
128 | }
129 | }
130 | end
131 |
132 | local function create_clock_UIBox(style_name, text_size, float)
133 | style_name = style_name or 'simple'
134 | text_size = text_size or 1
135 |
136 | local colours = SystemClock.assign_clock_colours()
137 |
138 | local style = clock_ui.styles[style_name] or {}
139 |
140 | clock_ui.has_dynamic_shadow_colour = style.shadow_colour_ref == 'shadow'
141 |
142 | local panel_outer_colour = style.outer_colour or style.outer_colour_ref and colours[style.outer_colour_ref] or G.C.CLEAR
143 | local panel_inner_colour = style.inner_colour or style.inner_colour_ref and colours[style.inner_colour_ref] or G.C.CLEAR
144 | local panel_shadow_colour = style.shadow_colour or style.shadow_colour_ref and colours[style.shadow_colour_ref] or G.C.CLEAR
145 | local text_colours = style.text_colours or (style.text_colour and { style.text_colour }) or (style.text_colour_ref and { colours[style.text_colour_ref] }) or { colours.text }
146 |
147 | local text_width = math.max(style.inner_width or 0, calculate_max_text_width())
148 |
149 | return {
150 | n = G.UIT.ROOT,
151 | config = {
152 | align = 'tm',
153 | colour = panel_shadow_colour,
154 | padding = style.shadow_padding,
155 | minw = 0.1,
156 | r = 0.1
157 | },
158 | nodes = {
159 | {
160 | n = G.UIT.R,
161 | config = {
162 | align = 'cm',
163 | colour = panel_outer_colour,
164 | padding = style.outer_padding,
165 | minh = style.outer_height,
166 | minw = style.outer_width,
167 | r = 0.1
168 | },
169 | nodes = {
170 | {
171 | n = G.UIT.C,
172 | config = { padding = style.outer_padding },
173 | nodes = {
174 | style.heading_text and {
175 | n = G.UIT.R,
176 | config = {
177 | align = "cm",
178 | padding = 0.02
179 | },
180 | nodes = {
181 | {
182 | n = G.UIT.T,
183 | config = {
184 | text = locale.translate('sysclock_time_heading'),
185 | minh = 1,
186 | scale = 0.85 * 0.4,
187 | colour = G.C.UI.TEXT_LIGHT,
188 | shadow = style.text_shadow
189 | }
190 | }
191 | }
192 | },
193 | {
194 | n = G.UIT.R,
195 | config = {
196 | align = 'cm',
197 | colour = panel_inner_colour,
198 | padding = style.inner_padding,
199 | minh = style.inner_height,
200 | minw = style.inner_width,
201 | r = 0.1,
202 | },
203 | nodes = {
204 | {
205 | n = G.UIT.C,
206 | config = {
207 | align = 'cm',
208 | padding = style.text_padding,
209 | minw = text_width,
210 | r = 0.1
211 | },
212 | nodes = { create_clock_DynaText(text_size, text_colours, style.text_shadow, float, true) }
213 | }
214 | }
215 | }
216 | }
217 | }
218 | }
219 | },
220 | {
221 | n = G.UIT.R,
222 | config = { minh = style.emboss_amount }
223 | }
224 | }
225 | }
226 | end
227 |
228 | function clock_ui.reset(juice)
229 | local prev_pos
230 | if G.HUD_clock then
231 | prev_pos = { x = G.HUD_clock.T.x, y = G.HUD_clock.T.y }
232 | G.HUD_clock:remove()
233 | end
234 | if config.clock_visible and (config.clock_persistent or G.STAGE == G.STAGES.RUN or SystemClock.draw_as_popup) then
235 | local position = SystemClock.current_preset.position
236 | prev_pos = prev_pos or position
237 |
238 | local tooltip_popup = config.clock_right_click_tutorial and create_clock_h_popup(locale.translate('sysclock_right_click_tooltip'))
239 |
240 | G.HUD_clock = draggable_container(
241 | {
242 | T = { x = position.x, y = position.y },
243 | VT = { x = prev_pos.x, y = prev_pos.y },
244 | config = {
245 | major = G,
246 | bond = 'Weak',
247 | instance_type = SystemClock.draw_as_popup and 'POPUP',
248 | h_popup = tooltip_popup
249 | },
250 | definition = create_clock_UIBox(
251 | SystemClock.current_preset.style,
252 | SystemClock.current_preset.size,
253 | config_ui.is_open
254 | ),
255 | zoom = true,
256 | can_drag = config.clock_allow_drag or config_ui.is_open
257 | }
258 | )
259 |
260 | local temporary_drag = false
261 |
262 | G.HUD_clock.drag = function(self)
263 | if not config.clock_allow_drag then
264 | temporary_drag = true
265 | SystemClock.set_draggable(true, true)
266 | end
267 | draggable_container.drag(self)
268 | end
269 |
270 | G.HUD_clock.stop_drag = function(self)
271 | draggable_container.stop_drag(self)
272 | SystemClock.set_position({ x = self.T.x, y = self.T.y })
273 | if temporary_drag then
274 | SystemClock.set_draggable(false, true)
275 | temporary_drag = false
276 | end
277 | end
278 |
279 | if juice then G.HUD_clock:juice_up(0.1, 0.1) end
280 | end
281 | end
282 |
283 | return clock_ui
284 |
--------------------------------------------------------------------------------
/src/config.lua:
--------------------------------------------------------------------------------
1 | local config = {}
2 |
3 | local logger = require('systemclock.logger')
4 | local utilities = require('systemclock.utilities')
5 |
6 | local DEFAULTS = {
7 | ['config_version'] = 5,
8 | ['clock_visible'] = true,
9 | ['clock_persistent'] = true,
10 | ['clock_right_click_tutorial'] = true,
11 | ['clock_allow_drag'] = true,
12 | ['clock_preset_index'] = 1,
13 | ['clock_presets'] = {
14 | [1] = {
15 | ['format'] = 4,
16 | ['style'] = 'panel',
17 | ['size'] = 0.5,
18 | ['colours'] = {
19 | ['text'] = 'WHITE',
20 | ['back'] = 'DYN_UI.MAIN'
21 | },
22 | ['position'] = {
23 | ['x'] = 0.580,
24 | ['y'] = -0.622
25 | }
26 | },
27 | [2] = {
28 | ['format'] = 5,
29 | ['style'] = 'emboss',
30 | ['size'] = 0.4,
31 | ['colours'] = {
32 | ['text'] = 'WHITE',
33 | ['back'] = 'GREEN'
34 | },
35 | ['position'] = {
36 | ['x'] = -0.382,
37 | ['y'] = 11.653
38 | }
39 | },
40 | [3] = {
41 | ['format'] = 6,
42 | ['style'] = 'simple',
43 | ['size'] = 0.3,
44 | ['colours'] = {
45 | ['text'] = 'WHITE',
46 | ['back'] = 'DYN_UI.MAIN'
47 | },
48 | ['position'] = {
49 | ['x'] = 13.660,
50 | ['y'] = 2.660
51 | }
52 | },
53 | [4] = {
54 | ['format'] = 1,
55 | ['style'] = 'translucent',
56 | ['size'] = 0.5,
57 | ['colours'] = {
58 | ['text'] = 'WHITE',
59 | ['back'] = 'DYN_UI.MAIN'
60 | },
61 | ['position'] = {
62 | ['x'] = 17.574,
63 | ['y'] = 8.035
64 | }
65 | },
66 | [5] = {
67 | ['format'] = 3,
68 | ['style'] = 'throwback',
69 | ['size'] = 0.6,
70 | ['colours'] = {
71 | ['text'] = 'ORANGE',
72 | ['back'] = 'DYN_UI.BOSS_MAIN'
73 | },
74 | ['position'] = {
75 | ['x'] = 2.936,
76 | ['y'] = 10.394
77 | }
78 | }
79 | }
80 | }
81 |
82 | local SAVE_FILE_NAME = 'SystemClock.jkr'
83 | local SAVE_DIR = 'config'
84 | local SAVE_PATH = SAVE_DIR .. '/' .. SAVE_FILE_NAME
85 |
86 | local function serialize_config(tbl, indent)
87 | indent = indent or 1
88 | local str = "{\n"
89 |
90 | local function v_to_str(v, indent)
91 | if (type(v) == 'table') then
92 | return serialize_config(v, indent + 1)
93 | elseif (type(v) == 'number' or type(v) == 'boolean') then
94 | return tostring(v)
95 | else
96 | return "\'" .. tostring(v) .. "\'"
97 | end
98 | end
99 |
100 | for k, v in ipairs(tbl) do
101 | if type(v) ~= 'function' then
102 | str = str .. string.rep("\t", indent) .. "[" .. tostring(k) .. "] = " .. v_to_str(v, indent) .. ",\n"
103 | end
104 | end
105 |
106 | for k, v in pairs(tbl) do
107 | if type(k) == 'string' and type(v) ~= 'function' then
108 | str = str .. string.rep("\t", indent)
109 | str = str .. "[\'" .. tostring(k) .. "\'] = "
110 | str = str .. v_to_str(v, indent) .. ",\n"
111 | end
112 | end
113 |
114 | str = str .. string.rep("\t", indent - 1) .. "}"
115 | return str
116 | end
117 |
118 | function config.save()
119 | if not love.filesystem.getInfo(SAVE_DIR) then
120 | logger.log_info("Creating config folder...")
121 | local success = love.filesystem.createDirectory(SAVE_DIR)
122 | if not success then
123 | logger.log_error("Failed to create config folder")
124 | end
125 | end
126 |
127 | local success, err = love.filesystem.write(
128 | 'config/' .. SAVE_FILE_NAME,
129 | 'return ' .. serialize_config(config or config.DEFAULTS)
130 | )
131 | if not success then
132 | logger.log_error("Failed to save config file: " .. err)
133 | end
134 | end
135 |
136 | local function update_config_version()
137 | if not config then
138 | logger.log_error("Config not loaded")
139 | return
140 | end
141 |
142 | if config.clockColourIndex then
143 | logger.log_info("Transferring config settings (v1 -> v2)")
144 | config.clockTextColourRef = SystemClock.COLOUR_REFS[config.clockColourIndex]
145 | config.clockTextColourIndex = config.clockColourIndex
146 | config.clockBackColourRef = 'DYN_UI.MAIN'
147 | config.clockColourIndex = nil
148 | config.clockColour = nil
149 |
150 | config.clockConfigVersion = 2
151 | end
152 |
153 | if config.clockConfigVersion == 2 then
154 | logger.log_info("Transferring config settings (v2 -> v4)")
155 | config.clock_presets[5].format = config.clockTimeFormatIndex
156 | config.clock_presets[5].style = config.clockStyleIndex
157 | config.clock_presets[5].size = config.clockTextSize
158 | config.clock_presets[5].colours.text = config.clockTextColourRef
159 | config.clock_presets[5].colours.back = config.clockBackColourRef
160 | config.clock_presets[5].position.x = config.clockX
161 | config.clock_presets[5].position.y = config.clockY
162 | config.clock_preset_index = 5
163 | config.clock_visible = config.clockVisible
164 | config.clock_allow_drag = config.clockAllowDrag
165 | config.hour_offset = config.hourOffset
166 |
167 | config.clockTimeFormatIndex = nil
168 | config.clockStyleIndex = nil
169 | config.clockTextColourIndex = nil
170 | config.clockTextColourRef = nil
171 | config.clockBackColourIndex = nil
172 | config.clockBackColourRef = nil
173 | config.clockTextSize = nil
174 | config.clockTextSizeIndex = nil
175 | config.clockX = nil
176 | config.clockY = nil
177 | config.clockVisible = nil
178 | config.clockAllowDrag = nil
179 | config.hourOffset = nil
180 | config.clockConfigVersion = nil
181 |
182 | config.config_version = 4
183 | end
184 |
185 | if config.clockConfigVersion == 3 then
186 | logger.log_info("Transferring config settings (v3 -> v4)")
187 | config.clock_visible = config.clockVisible
188 | config.clock_allow_drag = config.clockAllowDrag
189 | config.hour_offset = config.hourOffset
190 | config.clock_preset_index = config.clockPresetIndex
191 | config.clock_presets = config.clockPresets
192 |
193 | config.clockVisible = nil
194 | config.clockAllowDrag = nil
195 | config.hourOffset = nil
196 | config.clockPresetIndex = nil
197 | config.clockPresets = nil
198 | config.clockConfigVersion = nil
199 |
200 | config.config_version = 4
201 | end
202 |
203 | if config.config_version == 4 then
204 | logger.log_info("Transferring config settings (v4 -> v5)")
205 |
206 | local v4_style_names = { 'simple', 'shadow', 'translucent', 'panel', 'emboss', 'throwback' }
207 | for _, preset in ipairs(config.clock_presets) do
208 | local style_index = preset.style
209 | preset.style = v4_style_names[style_index] or 'simple'
210 | if preset.position then
211 | preset.position.x = preset.position.x + 0.13
212 | preset.position.y = preset.position.y + 0.15
213 | end
214 | end
215 | config.config_version = 5
216 | end
217 |
218 | config.save()
219 | end
220 |
221 | function config.load()
222 | local loaded_config = {}
223 | if love.filesystem.getInfo(SAVE_PATH) then
224 | local config_contents, read_err = love.filesystem.read(SAVE_PATH)
225 | if not config_contents then
226 | logger.log_error("Failed to read config file: " .. read_err)
227 | else
228 | local success, load_err = pcall(function()
229 | loaded_config = load(config_contents, 'systemclock_load_config')()
230 | end)
231 | if not success then
232 | logger.log_error("Error loading existing config file: " .. load_err)
233 | end
234 | end
235 | end
236 |
237 | utilities.deep_merge(loaded_config, config)
238 | utilities.deep_merge(DEFAULTS, config)
239 |
240 | update_config_version()
241 |
242 | return config
243 | end
244 |
245 | function config.reset_preset(preset_index)
246 | config.clock_presets[preset_index] = utilities.deep_copy(DEFAULTS.clock_presets[preset_index])
247 | config.save()
248 | end
249 |
250 | function config.get_preset_default(preset_index)
251 | return DEFAULTS.clock_presets[preset_index]
252 | end
253 |
254 | return config
255 |
--------------------------------------------------------------------------------
/src/config_ui.lua:
--------------------------------------------------------------------------------
1 | local config_ui = {}
2 |
3 | local logger = require('systemclock.logger')
4 | local config = require('systemclock.config')
5 | local locale = require('systemclock.locale')
6 |
7 |
8 | local function create_UIBox_visibility_toggle()
9 | return {
10 | n = G.UIT.ROOT,
11 | config = { align = 'cm', colour = G.C.CLEAR },
12 | nodes = {
13 | {
14 | n = G.UIT.R,
15 | config = { align = 'cm' },
16 | nodes = {
17 | create_toggle({
18 | label = locale.translate('sysclock_visibility_setting'),
19 | w = 1.5,
20 | text_scale = 0.8,
21 | ref_table = config,
22 | ref_value = 'clock_visible',
23 | callback = SystemClock.set_visibility
24 | })
25 | }
26 | }
27 | }
28 | }
29 | end
30 |
31 | local function create_UIBox_persistent_toggle()
32 | return {
33 | n = G.UIT.ROOT,
34 | config = { align = 'cm', colour = G.C.CLEAR },
35 | nodes = {
36 | {
37 | n = G.UIT.R,
38 | config = { align = 'cm' },
39 | nodes = {
40 | create_toggle({
41 | label = locale.translate('sysclock_persistent_setting'),
42 | w = 1.5,
43 | text_scale = 0.8,
44 | ref_table = config,
45 | ref_value = 'clock_persistent',
46 | callback = SystemClock.set_persistent
47 | })
48 | }
49 | }
50 | }
51 | }
52 | end
53 |
54 | local function create_UIBox_draggable_toggle()
55 | return {
56 | n = G.UIT.ROOT,
57 | config = { align = 'cm', colour = G.C.CLEAR },
58 | nodes = {
59 | {
60 | n = G.UIT.R,
61 | config = { align = 'cm' },
62 | nodes = {
63 | create_toggle({
64 | label = locale.translate('sysclock_draggable_setting'),
65 | w = 1.5,
66 | text_scale = 0.8,
67 | ref_table = config,
68 | ref_value = 'clock_allow_drag',
69 | callback = SystemClock.set_draggable
70 | })
71 | }
72 | }
73 | }
74 | }
75 | end
76 |
77 | local function create_UIBox_position_sliders()
78 | return {
79 | n = G.UIT.ROOT,
80 | config = { align = 'cm', colour = G.C.CLEAR },
81 | nodes = {
82 | {
83 | n = G.UIT.R,
84 | config = { align = 'tm' },
85 | nodes = {
86 | create_slider({
87 | label = locale.translate('sysclock_x_position_setting'),
88 | scale = 0.8,
89 | label_scale = 0.8 * 0.5,
90 | ref_table = SystemClock.current_preset.position,
91 | ref_value = 'x',
92 | w = 4,
93 | min = -4,
94 | max = 22,
95 | step = 0.01,
96 | decimal_places = 2,
97 | callback = 'sysclock_slider_clock_position_x'
98 | })
99 | }
100 | },
101 | {
102 | n = G.UIT.R,
103 | config = { minh = 0.22 },
104 | },
105 | {
106 | n = G.UIT.R,
107 | config = { align = 'bm' },
108 | nodes = {
109 | create_slider({
110 | label = locale.translate('sysclock_y_position_setting'),
111 | scale = 0.8,
112 | label_scale = 0.8 * 0.5,
113 | ref_table = SystemClock.current_preset.position,
114 | ref_value = 'y',
115 | w = 4,
116 | min = -3,
117 | max = 13,
118 | step = 0.01,
119 | decimal_places = 2,
120 | callback = 'sysclock_slider_clock_position_y'
121 | })
122 | }
123 | }
124 | }
125 | }
126 | end
127 |
128 | local function create_UIBox_config_panel()
129 | return {
130 | n = G.UIT.ROOT,
131 | config = { align = 'cm', minw = 10, r = 0.1, emboss = 0.1, colour = G.C.GREY },
132 | nodes = {
133 | {
134 | n = G.UIT.C,
135 | config = { align = 'tm', minw = 5.2, id = 'sysclock_config_panel_column_left' },
136 | nodes = {
137 | {
138 | n = G.UIT.R,
139 | config = { align = 'tl' },
140 | nodes = {
141 | create_option_cycle({
142 | label = locale.translate('sysclock_time_format_setting'),
143 | scale = 0.8,
144 | w = 4.5,
145 | options = SystemClock.FORMAT_EXAMPLES,
146 | current_option = SystemClock.indices.format,
147 | opt_callback = 'sysclock_cycle_clock_time_format'
148 | }),
149 | }
150 | },
151 | {
152 | n = G.UIT.R,
153 | config = { minh = 1.55 },
154 | },
155 | {
156 | n = G.UIT.R,
157 | config = { align = 'bl' },
158 | nodes = {
159 | {
160 | n = G.UIT.O,
161 | config = {
162 | id = 'sysclock_config_position_sliders',
163 | object = UIBox {
164 | config = { align = 'cm', offset = { x = 0, y = 0 } },
165 | definition = create_UIBox_position_sliders()
166 | }
167 | }
168 | }
169 | }
170 | }
171 | }
172 | },
173 | {
174 | n = G.UIT.C,
175 | config = { align = 'tr', minw = 5.2, id = 'sysclock_config_panel_column_right' },
176 | nodes = {
177 | {
178 | n = G.UIT.R,
179 | config = { align = 'cr', padding = 0 },
180 | nodes = {
181 | create_option_cycle({
182 | label = locale.translate('sysclock_size_setting'),
183 | scale = 0.8,
184 | w = 4.5,
185 | options = SystemClock.TEXT_SIZES,
186 | current_option = SystemClock.indices.size,
187 | opt_callback = 'sysclock_cycle_clock_size',
188 | colour = G.C.GREEN
189 | })
190 | }
191 | },
192 | {
193 | n = G.UIT.R,
194 | config = { align = 'cr', padding = 0 },
195 | nodes = {
196 | create_option_cycle({
197 | label = locale.translate('sysclock_style_setting'),
198 | scale = 0.8,
199 | w = 4.5,
200 | options = locale.translate('sysclock_styles'),
201 | current_option = SystemClock.indices.style,
202 | opt_callback = 'sysclock_cycle_clock_style',
203 | colour = G.C.ORANGE
204 | })
205 | }
206 | },
207 | {
208 | n = G.UIT.R,
209 | config = { align = 'cr', padding = 0 },
210 | nodes = {
211 | create_option_cycle({
212 | label = locale.translate('sysclock_text_colour_setting'),
213 | scale = 0.8,
214 | w = 4.5,
215 | options = locale.translate('sysclock_colours'),
216 | current_option = SystemClock.indices.text_colour,
217 | opt_callback = 'sysclock_cycle_clock_text_colour',
218 | colour = G.C.BLUE
219 | })
220 | }
221 | },
222 | {
223 | n = G.UIT.R,
224 | config = { align = 'cr', padding = 0 },
225 | nodes = {
226 | create_option_cycle({
227 | label = locale.translate('sysclock_back_colour_setting'),
228 | scale = 0.8,
229 | w = 4.5,
230 | options = locale.translate('sysclock_colours'),
231 | current_option = SystemClock.indices.back_colour,
232 | opt_callback = 'sysclock_cycle_clock_back_colour',
233 | colour = G.C.BLUE
234 | })
235 | }
236 | }
237 | }
238 | }
239 | }
240 | }
241 | end
242 |
243 | function config_ui.create_config_tab()
244 | config_ui.is_open = true
245 | SystemClock.set_popup(true)
246 |
247 | return {
248 | n = G.UIT.ROOT,
249 | config = {
250 | r = 0.1,
251 | minh = 6,
252 | minw = 6,
253 | align = 'cm',
254 | colour = G.C.CLEAR
255 | },
256 | nodes = {
257 | {
258 | n = G.UIT.C,
259 | config = { align = 'tl', minw = 2, id = 'sysclock_config_sidebar' },
260 | nodes = {
261 | {
262 | n = G.UIT.R,
263 | config = { align = 'tr', id = 'sysclock_config_toggles' },
264 | nodes = {
265 | {
266 | n = G.UIT.C,
267 | nodes = {
268 | {
269 | n = G.UIT.R,
270 | config = { align = 'tr' },
271 | nodes = {
272 | {
273 | n = G.UIT.O,
274 | config = {
275 | id = 'sysclock_visibility_toggle',
276 | object = UIBox {
277 | config = { align = 'cm', offset = { x = 0, y = 0 } },
278 | definition = create_UIBox_visibility_toggle()
279 | }
280 | }
281 | }
282 | }
283 | },
284 | {
285 | n = G.UIT.R,
286 | config = { minh = 0.2 },
287 | },
288 | {
289 | n = G.UIT.R,
290 | config = { align = 'tr' },
291 | nodes = {
292 | {
293 | n = G.UIT.O,
294 | config = {
295 | id = 'sysclock_persistent_toggle',
296 | object = UIBox {
297 | config = { align = 'cm', offset = { x = 0, y = 0 } },
298 | definition = create_UIBox_persistent_toggle()
299 | }
300 | }
301 | }
302 | }
303 | },
304 | {
305 | n = G.UIT.R,
306 | config = { minh = 0.2 },
307 | },
308 | {
309 | n = G.UIT.R,
310 | config = { align = 'tr' },
311 | nodes = {
312 | {
313 | n = G.UIT.O,
314 | config = {
315 | id = 'sysclock_draggable_toggle',
316 | object = UIBox {
317 | config = { align = 'cm', offset = { x = 0, y = 0 } },
318 | definition = create_UIBox_draggable_toggle()
319 | }
320 | }
321 | }
322 | }
323 | },
324 | {
325 | n = G.UIT.R,
326 | config = { minh = 0.7 },
327 | },
328 | {
329 | n = G.UIT.R,
330 | config = { align = 'cm' },
331 | nodes = {
332 | create_option_cycle({
333 | label = locale.translate('sysclock_preset_setting'),
334 | scale = 0.8,
335 | text_scale = 0.7,
336 | w = 2,
337 | h = 0.8,
338 | options = { "1", "2", "3", "4", "5" },
339 | current_option = config.clock_preset_index,
340 | opt_callback = 'sysclock_cycle_clock_preset',
341 | colour = G.C.JOKER_GREY,
342 | }),
343 | }
344 | },
345 | {
346 | n = G.UIT.R,
347 | config = { minh = 0.2 }
348 | },
349 | {
350 | n = G.UIT.R,
351 | config = { align = 'cm' },
352 | nodes = {
353 | UIBox_button({
354 | button = 'sysclock_restore_preset_defaults',
355 | label = { locale.translate('sysclock_preset_default_button') },
356 | colour = G.C.JOKER_GREY,
357 | minw = 2.8,
358 | minh = 0.6,
359 | scale = 0.5 * 0.8,
360 | })
361 | }
362 | }
363 | }
364 | }
365 | }
366 | }
367 | }
368 | },
369 | {
370 | n = G.UIT.C,
371 | config = { minw = 0.2 }
372 | },
373 | {
374 | n = G.UIT.C,
375 | nodes = {
376 | {
377 | n = G.UIT.O,
378 | config = {
379 | id = 'sysclock_config_panel',
380 | object = UIBox {
381 | config = { align = 'cm', offset = { x = 0, y = 0 } },
382 | definition = create_UIBox_config_panel()
383 | }
384 | }
385 | }
386 | }
387 | }
388 | }
389 | }
390 | end
391 |
392 | local function rebuild_UIBox_element(uie_id, build_func, juice)
393 | if not G.OVERLAY_MENU or not config_ui.is_open then return end
394 | local ui_element = G.OVERLAY_MENU:get_UIE_by_ID(uie_id)
395 | if not ui_element then
396 | logger.log_warn("Could not find UIE '" .. tostring(uie_id) .. "'")
397 | return
398 | end
399 |
400 | ui_element.config.object:remove()
401 | ui_element.config.object = UIBox {
402 | config = { offset = { x = 0, y = 0 }, parent = ui_element },
403 | definition = build_func()
404 | }
405 | ui_element.UIBox:recalculate()
406 | ui_element.config.object:set_role {
407 | role_type = 'Major',
408 | major = nil
409 | }
410 |
411 | if juice then ui_element.config.object:juice_up(0.05, 0.03) end
412 | return ui_element
413 | end
414 |
415 | function config_ui.update_panel(juice)
416 | rebuild_UIBox_element('sysclock_config_panel', create_UIBox_config_panel, juice)
417 | end
418 |
419 | function config_ui.update_visibility_toggle(juice)
420 | rebuild_UIBox_element('sysclock_visibility_toggle', create_UIBox_visibility_toggle, juice)
421 | end
422 |
423 | function config_ui.update_persistent_toggle(juice)
424 | rebuild_UIBox_element('sysclock_persistent_toggle', create_UIBox_persistent_toggle, juice)
425 | end
426 |
427 | function config_ui.update_draggable_toggle(juice)
428 | rebuild_UIBox_element('sysclock_draggable_toggle', create_UIBox_draggable_toggle, juice)
429 | end
430 |
431 | function config_ui.update_position_sliders(juice)
432 | rebuild_UIBox_element('sysclock_config_position_sliders', create_UIBox_position_sliders, juice)
433 | end
434 |
435 | function config_ui.open_config_menu()
436 | if SMODS then
437 | if G.FUNCS.openModUI_SystemClock then
438 | SMODS.LAST_SELECTED_MOD_TAB = 'config'
439 | G.FUNCS.openModUI_SystemClock()
440 | local back_button_uie = G.OVERLAY_MENU and G.OVERLAY_MENU:get_UIE_by_ID('overlay_menu_back_button')
441 | if back_button_uie and G.FUNCS.exit_mods then
442 | back_button_uie.config.button = 'exit_mods'
443 | else
444 | logger.log_warn("Could not replace config back button function")
445 | logger.log_debug(" back_button_uie: " .. tostring(back_button_uie))
446 | logger.log_debug(" G.FUNCS.exit_mods: " .. tostring(G.FUNCS.exit_mods))
447 | end
448 | return
449 | else
450 | logger.log_warn("G.FUNCS.openModUI_SystemClock does not exist, falling back to vanilla config menu")
451 | end
452 | end
453 |
454 | G.FUNCS.overlay_menu(
455 | {
456 | definition = create_UIBox_generic_options({
457 | back_func = 'exit_overlay_menu',
458 | contents = {
459 | create_tabs({
460 | no_shoulders = true,
461 | colour = G.C.BOOSTER,
462 | tabs = { {
463 | label = "SystemClock",
464 | chosen = true,
465 | tab_definition_function = config_ui.create_config_tab
466 | } }
467 | })
468 | }
469 | })
470 | }
471 | )
472 | end
473 |
474 | function config_ui.close_config_menu()
475 | if config_ui.is_open then
476 | config_ui.is_open = false
477 | SystemClock.set_popup(false)
478 | end
479 | end
480 |
481 | return config_ui
482 |
--------------------------------------------------------------------------------
/src/core.lua:
--------------------------------------------------------------------------------
1 | SystemClock = {}
2 |
3 | SystemClock.CLOCK_FORMATS = {
4 | { format_string = '%I:%M %p', leading_zero = false },
5 | { format_string = '%I:%M', leading_zero = false },
6 | { format_string = '%H:%M', leading_zero = true },
7 | { format_string = '%I:%M:%S %p', leading_zero = false },
8 | { format_string = '%I:%M:%S', leading_zero = false },
9 | { format_string = '%H:%M:%S', leading_zero = true }
10 | }
11 |
12 | SystemClock.COLOUR_REFS = {
13 | 'WHITE', 'JOKER_GREY', 'GREY', 'L_BLACK', 'BLACK',
14 | 'RED', 'SECONDARY_SET.Voucher', 'ORANGE', 'GOLD', 'GREEN',
15 | 'SECONDARY_SET.Planet', 'BLUE', 'PERISHABLE', 'BOOSTER', 'PURPLE',
16 | 'SECONDARY_SET.Tarot', 'ETERNAL', 'EDITION', 'DARK_EDITION', 'DYN_UI.MAIN',
17 | 'DYN_UI.DARK', 'DYN_UI.BOSS_MAIN', 'DYN_UI.BOSS_DARK'
18 | }
19 |
20 | SystemClock.TEXT_SIZES = {
21 | 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0
22 | }
23 |
24 | SystemClock.STYLES = {
25 | 'simple', 'shadow', 'translucent', 'emboss', 'panel', 'throwback'
26 | }
27 |
28 | SystemClock.FORMAT_EXAMPLES = {}
29 |
30 | SystemClock.time = ''
31 | SystemClock.current_preset = {}
32 | SystemClock.indices = {}
33 | SystemClock.current_format = {}
34 | SystemClock.example_time = os.time({ year = 2015, month = 10, day = 21, hour = 16, min = 29, sec = 33 })
35 | SystemClock.draw_as_popup = false
36 |
37 | local config = require('systemclock.config')
38 | local clock_ui = require('systemclock.clock_ui')
39 | local config_ui = require('systemclock.config_ui')
40 | local logger = require('systemclock.logger')
41 | local utilities = require('systemclock.utilities')
42 |
43 | config.load()
44 | config.save()
45 |
46 | function SystemClock.assign_clock_colours()
47 | local text_colour = SystemClock.current_preset.colours and utilities.parse_colour(SystemClock.current_preset.colours.text) or { 1, 0, 1, 1 }
48 | local back_colour = SystemClock.current_preset.colours and utilities.parse_colour(SystemClock.current_preset.colours.back) or { 1, 0, 1, 1 }
49 | local shadow_colour = darken(back_colour, 0.3)
50 |
51 | SystemClock.colours = SystemClock.colours or {}
52 | SystemClock.colours.text = text_colour
53 | SystemClock.colours.back = back_colour
54 | SystemClock.colours.shadow = shadow_colour
55 |
56 | return SystemClock.colours
57 | end
58 |
59 | local function assign_current_format(format)
60 | format = format or SystemClock.current_preset.format or 1
61 |
62 | local format_type = type(format)
63 | if format_type == 'number' then
64 | SystemClock.current_format = SystemClock.CLOCK_FORMATS[format]
65 | elseif format_type == 'string' then
66 | SystemClock.current_format = { format_string = format, leading_zero = false }
67 | else
68 | SystemClock.current_format = SystemClock.CLOCK_FORMATS[1]
69 | end
70 | end
71 |
72 | local function assign_config_preset(preset_index)
73 | preset_index = preset_index or config.clock_preset_index or 0
74 | config.clock_preset_index = preset_index
75 |
76 | SystemClock.current_preset = config.clock_presets[preset_index]
77 | if not SystemClock.current_preset then
78 | logger.log_warn("Error loading clock preset with index " .. tostring(preset_index))
79 | SystemClock.current_preset = config.get_preset_default(1)
80 | end
81 |
82 | SystemClock.indices.format = tonumber(SystemClock.current_preset.format) or 0
83 | SystemClock.indices.style = utilities.index_of(SystemClock.STYLES, SystemClock.current_preset.style) or 0
84 | SystemClock.indices.size = utilities.index_of(SystemClock.TEXT_SIZES, SystemClock.current_preset.size) or 0
85 | SystemClock.indices.text_colour = SystemClock.current_preset.colours and utilities.index_of(SystemClock.COLOUR_REFS, SystemClock.current_preset.colours.text) or 0
86 | SystemClock.indices.back_colour = SystemClock.current_preset.colours and utilities.index_of(SystemClock.COLOUR_REFS, SystemClock.current_preset.colours.back) or 0
87 | SystemClock.draw_as_popup = (not not config.clock_persistent) or config_ui.is_open
88 |
89 | SystemClock.assign_clock_colours()
90 | assign_current_format()
91 | end
92 |
93 | function SystemClock.get_formatted_time(format_string, leading_zero, time, hour_offset)
94 | format_string = format_string or SystemClock.current_format.format_string
95 | leading_zero = leading_zero ~= nil and leading_zero or SystemClock.current_format.leading_zero
96 |
97 | if hour_offset and tonumber(hour_offset) then
98 | time = time or os.time()
99 | time = time + tonumber(hour_offset) * 3600
100 | end
101 |
102 | local formatted_time = os.date(format_string, time)
103 |
104 | if leading_zero == false then
105 | formatted_time = tostring(formatted_time):gsub("^0", "")
106 | end
107 | return formatted_time
108 | end
109 |
110 | local function generate_example_time_formats()
111 | for i, format_set in ipairs(SystemClock.CLOCK_FORMATS) do
112 | SystemClock.FORMAT_EXAMPLES[i] = SystemClock.get_formatted_time(format_set.format_string, format_set.leading_zero, SystemClock.example_time)
113 | end
114 | end
115 |
116 | assign_config_preset()
117 | generate_example_time_formats()
118 |
119 | local game_update_ref = Game.update
120 | function Game:update(dt)
121 | local ret = game_update_ref(self, dt)
122 |
123 | if config then
124 | SystemClock.time = SystemClock.get_formatted_time(nil, nil, nil, config.hour_offset)
125 |
126 | if clock_ui.has_dynamic_shadow_colour then
127 | SystemClock.colours.shadow[1] = SystemClock.colours.back[1] * 0.7
128 | SystemClock.colours.shadow[2] = SystemClock.colours.back[2] * 0.7
129 | SystemClock.colours.shadow[3] = SystemClock.colours.back[3] * 0.7
130 | end
131 | end
132 |
133 | return ret
134 | end
135 |
136 | local game_main_menu_ref = Game.main_menu
137 | function Game:main_menu(change_context)
138 | local ret = game_main_menu_ref(self, change_context)
139 | local juice_on_start = config and config.clock_right_click_tutorial
140 | clock_ui.reset(juice_on_start)
141 | return ret
142 | end
143 |
144 | local game_start_run_ref = Game.start_run
145 | function Game:start_run(args)
146 | local ret = game_start_run_ref(self, args)
147 | clock_ui.reset()
148 | return ret
149 | end
150 |
151 | local g_funcs_exit_overlay_menu_ref = G.FUNCS.exit_overlay_menu
152 | function G.FUNCS.exit_overlay_menu(e)
153 | config_ui.close_config_menu()
154 | config.save()
155 | return g_funcs_exit_overlay_menu_ref(e)
156 | end
157 |
158 | local g_funcs_set_Trance_font_ref = G.FUNCS.set_Trance_font
159 | function G.FUNCS.set_Trance_font(...)
160 | if g_funcs_set_Trance_font_ref then
161 | local ret = { g_funcs_set_Trance_font_ref(...) }
162 | clock_ui.reset()
163 | return unpack(ret)
164 | end
165 | end
166 |
167 | local controller_queue_R_cursor_press_ref = Controller.queue_R_cursor_press
168 | function Controller:queue_R_cursor_press(x, y)
169 | if G.HUD_clock and G.HUD_clock.states.hover.is then
170 | config.clock_right_click_tutorial = false
171 | if config_ui.is_open then
172 | clock_ui.reset(true)
173 | else
174 | config_ui.open_config_menu()
175 | end
176 | end
177 | return controller_queue_R_cursor_press_ref(self, x, y)
178 | end
179 |
180 | local g_funcs_change_tab_ref = G.FUNCS.change_tab
181 | function G.FUNCS.change_tab(e)
182 | config_ui.close_config_menu()
183 | return g_funcs_change_tab_ref(e)
184 | end
185 |
186 | local g_funcs_options_ref = G.FUNCS.options
187 | function G.FUNCS.options(e)
188 | config_ui.close_config_menu()
189 | return g_funcs_options_ref(e)
190 | end
191 |
192 | function SystemClock.set_popup(state)
193 | if config.clock_persistent then
194 | SystemClock.draw_as_popup = true
195 | clock_ui.reset(state)
196 | elseif SystemClock.draw_as_popup ~= state then
197 | SystemClock.draw_as_popup = state
198 | clock_ui.reset(state)
199 | end
200 | end
201 |
202 | function SystemClock.set_position(pos)
203 | SystemClock.current_preset.position = pos
204 | config.save()
205 | config_ui.update_position_sliders()
206 | end
207 |
208 | function SystemClock.set_visibility(state, juice_config)
209 | config.clock_visible = state
210 | clock_ui.reset(true)
211 | config_ui.update_visibility_toggle(juice_config)
212 | if not state and config.clock_persistent then SystemClock.set_persistent(false, true) end
213 | end
214 |
215 | function SystemClock.set_persistent(state, juice_config)
216 | config.clock_persistent = state
217 | clock_ui.reset(true)
218 | config_ui.update_persistent_toggle(juice_config)
219 | if state and not config.clock_visible then SystemClock.set_visibility(true, true) end
220 | end
221 |
222 | function SystemClock.set_draggable(state, juice)
223 | config.clock_allow_drag = state
224 | if G.HUD_clock then
225 | G.HUD_clock.states.drag.can = state or config_ui.is_open
226 | if juice then G.HUD_clock:juice_up(0.05, 0.03) end
227 | end
228 | config_ui.update_draggable_toggle(juice)
229 | end
230 |
231 | G.FUNCS.sysclock_cycle_clock_preset = function(e)
232 | assign_config_preset(e.to_key)
233 | clock_ui.reset()
234 | config_ui.update_panel(true)
235 | end
236 |
237 | G.FUNCS.sysclock_restore_preset_defaults = function(e)
238 | config.reset_preset(config.clock_preset_index)
239 | assign_config_preset()
240 | clock_ui.reset(true)
241 | config_ui.update_panel(true)
242 | end
243 |
244 | G.FUNCS.sysclock_cycle_clock_time_format = function(e)
245 | if not config.clock_visible then SystemClock.set_visibility(true, true) end
246 | SystemClock.indices.format = e.to_key
247 | SystemClock.current_preset.format = SystemClock.indices.format
248 | SystemClock.current_format = SystemClock.CLOCK_FORMATS[e.to_key]
249 | clock_ui.reset(true)
250 | end
251 |
252 | G.FUNCS.sysclock_cycle_clock_style = function(e)
253 | if not config.clock_visible then SystemClock.set_visibility(true, true) end
254 | SystemClock.indices.style = e.to_key
255 | SystemClock.current_preset.style = SystemClock.STYLES[e.to_key]
256 | clock_ui.reset(true)
257 | end
258 |
259 | G.FUNCS.sysclock_cycle_clock_text_colour = function(e)
260 | if not config.clock_visible then SystemClock.set_visibility(true, true) end
261 | SystemClock.indices.text_colour = e.to_key
262 | local text_colour_ref = SystemClock.COLOUR_REFS[e.to_key]
263 | SystemClock.current_preset.colours.text = text_colour_ref
264 | clock_ui.reset()
265 | end
266 |
267 | G.FUNCS.sysclock_cycle_clock_back_colour = function(e)
268 | if not config.clock_visible then SystemClock.set_visibility(true, true) end
269 | SystemClock.indices.back_colour = e.to_key
270 | local back_colour_ref = SystemClock.COLOUR_REFS[e.to_key]
271 | SystemClock.current_preset.colours.back = back_colour_ref
272 | clock_ui.reset()
273 | end
274 |
275 | G.FUNCS.sysclock_cycle_clock_size = function(e)
276 | if not config.clock_visible then SystemClock.set_visibility(true, true) end
277 | SystemClock.indices.size = e.to_key
278 | SystemClock.current_preset.size = e.to_val
279 | clock_ui.reset(true)
280 | end
281 |
282 | G.FUNCS.sysclock_slider_clock_position_x = function(e)
283 | if not config.clock_visible then SystemClock.set_visibility(true, true) end
284 | local x = e.ref_table[e.ref_value]
285 | if G.HUD_clock then
286 | G.HUD_clock.T.x = x
287 | end
288 | SystemClock.current_preset.position.x = x
289 | end
290 |
291 | G.FUNCS.sysclock_slider_clock_position_y = function(e)
292 | if not config.clock_visible then SystemClock.set_visibility(true, true) end
293 | local y = e.ref_table[e.ref_value]
294 | if G.HUD_clock then
295 | G.HUD_clock.T.y = y
296 | end
297 | SystemClock.current_preset.position.y = y
298 | end
299 |
300 | return SystemClock
--------------------------------------------------------------------------------
/src/draggable_container.lua:
--------------------------------------------------------------------------------
1 | -- Originally MoveableContainer from BalaLib by Toeler (https://github.com/Toeler/Balatro-HandPreview/blob/main/Mods/BalaLib/BalaLib.lua) used under GPLv3
2 | -- Modified for use in Ankh by MathIsFun0 (https://github.com/MathIsFun0/Ankh)
3 | -- Further modified for use in SystemClock
4 |
5 | local DraggableContainer = UIBox:extend()
6 | function DraggableContainer:init(args)
7 | Moveable.init(self, args)
8 |
9 | self.states.drag.can = args.can_drag or false
10 | self.states.collide.can = true
11 | self.draw_layers = {}
12 |
13 | self.definition = args.definition
14 |
15 | if args.config then
16 | self.config = args.config
17 | if self.config.h_popup then
18 | self.config.h_popup_config = self.config.h_popup_config or { align = self.T.y > G.ROOM.T.h / 2 and 'tm' or 'bm' }
19 | self.config.h_popup_config.parent = self
20 | end
21 | args.config.major = args.config.major or args.config.parent or self
22 |
23 | self:set_alignment({
24 | major = args.config.major or G,
25 | type = args.config.align or args.config.type or '',
26 | bond = args.config.bond or 'Strong',
27 | offset = args.config.offset or { x = 0, y = 0 },
28 | lr_clamp = args.config.lr_clamp
29 | })
30 | self:set_role{
31 | xy_bond = args.config.xy_bond,
32 | r_bond = args.config.r_bond,
33 | wh_bond = args.config.wh_bond or 'Weak',
34 | scale_bond = args.config.scale_bond or 'Weak'
35 | }
36 |
37 | self.states.collide.can = ((args.config.can_collide ~= nil) and args.config.can_collide) or self.states.collide.can
38 |
39 | self.parent = self.config.parent
40 | end
41 |
42 | self:set_parent_child(self.definition, nil)
43 | self.Mid = self.Mid or self.UIRoot
44 | self:calculate_xywh(self.UIRoot, self.T)
45 |
46 | self.T.w = self.UIRoot.T.w
47 | self.T.h = self.UIRoot.T.h
48 | self.UIRoot:set_wh()
49 |
50 | self.UIRoot:set_alignments()
51 |
52 | self.VT.x = args.VT.x or self.T.x
53 | self.VT.y = args.VT.y or self.T.y
54 | self.VT.w, self.VT.h = self.T.w, self.T.h
55 |
56 | if self.Mid ~= self and self.Mid.parent and false then
57 | self.VT.x = self.VT.x - self.Mid.role.offset.x + (self.Mid.parent.config.padding or 0)
58 | self.VT.y = self.VT.y - self.Mid.role.offset.y + (self.Mid.parent.config.padding or 0)
59 | end
60 |
61 | if self.alignment and self.alignment.lr_clamp then self:lr_clamp() end
62 |
63 | self.UIRoot:initialize_VT(true)
64 |
65 | self.zoom = args.zoom or args.config.zoom
66 | if self.zoom then self.UIRoot:set_zoom(true, true) end
67 |
68 | if args.config.instance_type == 'POPUP' and not self.created_on_pause then
69 | self.created_on_pause = true
70 | self.UIRoot:set_created_on_pause(true, true)
71 | end
72 |
73 | self.attention_text = 'DraggableContainer'
74 |
75 | if args.config.instance_type then
76 | table.insert(G.I[args.config.instance_type], self)
77 | else
78 | table.insert(G.I.UIBOX, self)
79 | end
80 | end
81 |
82 | function Moveable:set_zoom(state, recursive, force)
83 | if self.zoom == state and not force then return end
84 |
85 | self.zoom = state
86 | if self.config.object then self.config.object.zoom = state end
87 |
88 | if recursive and self.children then
89 | for k, v in pairs(self.children) do
90 | v:set_zoom(state, true, force)
91 | end
92 | end
93 | end
94 |
95 | function Moveable:set_created_on_pause(state, recursive, force)
96 | if self.created_on_pause == state and not force then return end
97 |
98 | self.created_on_pause = state
99 | if self.config.object then self.config.object.created_on_pause = state end
100 |
101 | if recursive and self.children then
102 | for k, v in pairs(self.children) do
103 | v:set_created_on_pause(state, true, force)
104 | end
105 | end
106 | end
107 |
108 | function Moveable:set_hover_state(state, recursive, force)
109 | if self.states.hover.is == state and not force then return end
110 |
111 | self.states.hover.is = state
112 | if self.config.object then self.config.object.states.hover.is = state end
113 |
114 | if recursive and self.children then
115 | for k, v in pairs(self.children) do
116 | v:set_hover_state(state, true, force)
117 | end
118 | end
119 | end
120 |
121 | function Moveable:set_drag_state(state, recursive, force)
122 | if self.states.drag.is == state and not force then return end
123 |
124 | self.states.drag.is = state
125 | if self.config.object then self.config.object.states.drag.is = state end
126 |
127 | if recursive and self.children then
128 | for k, v in pairs(self.children) do
129 | v:set_drag_state(state, true, force)
130 | end
131 | end
132 | end
133 |
134 | function DraggableContainer:hover()
135 | if self.states.drag.can then
136 | self:juice_up(0.05, 0.02)
137 | play_sound('chips1', math.random() * 0.1 + 0.55, 0.15)
138 | if self.zoom then
139 | self.UIRoot:set_hover_state(true, true)
140 | end
141 | end
142 |
143 | UIBox.hover(self)
144 | end
145 |
146 | function DraggableContainer:stop_hover()
147 | if self.zoom then
148 | self.UIRoot:set_hover_state(false, true)
149 | end
150 | UIBox.stop_hover(self)
151 | end
152 |
153 | function DraggableContainer:drag()
154 | if self.zoom then
155 | self.UIRoot:set_drag_state(true, true)
156 | end
157 | UIBox.drag(self)
158 | end
159 |
160 | function DraggableContainer:stop_drag()
161 | if self.zoom then
162 | self.UIRoot:set_drag_state(false, true)
163 | end
164 |
165 | if self.config.h_popup then
166 | self.config.h_popup_config.align = self.T.y > G.ROOM.T.h / 2 and 'tm' or 'bm'
167 | end
168 |
169 | UIBox.stop_drag(self)
170 | end
171 |
172 | return DraggableContainer
173 |
--------------------------------------------------------------------------------
/src/init.lua:
--------------------------------------------------------------------------------
1 | SystemClock = require('systemclock.core')
2 |
--------------------------------------------------------------------------------
/src/locale.lua:
--------------------------------------------------------------------------------
1 | local locale = {}
2 |
3 | if not SMODS then
4 | locale = {
5 | ['de'] = require('systemclock.locale.de').misc.dictionary,
6 | ['en-us'] = require('systemclock.locale.en-us').misc.dictionary,
7 | ['es_419'] = require('systemclock.locale.es_419').misc.dictionary,
8 | ['es_ES'] = require('systemclock.locale.es_es').misc.dictionary,
9 | ['fr'] = require('systemclock.locale.fr').misc.dictionary,
10 | ['id'] = require('systemclock.locale.id').misc.dictionary,
11 | ['it'] = require('systemclock.locale.it').misc.dictionary,
12 | ['ja'] = require('systemclock.locale.ja').misc.dictionary,
13 | ['ko'] = require('systemclock.locale.ko').misc.dictionary,
14 | ['nl'] = require('systemclock.locale.nl').misc.dictionary,
15 | ['pl'] = require('systemclock.locale.pl').misc.dictionary,
16 | ['pt_BR'] = require('systemclock.locale.pt_br').misc.dictionary,
17 | ['ru'] = require('systemclock.locale.ru').misc.dictionary,
18 | ['vi'] = require('systemclock.locale.vi').misc.dictionary,
19 | ['zh_CN'] = require('systemclock.locale.zh_cn').misc.dictionary,
20 | ['zh_TW'] = require('systemclock.locale.zh_tw').misc.dictionary
21 | }
22 | end
23 |
24 | function locale.translate(key)
25 | if SMODS then return localize(key) end
26 | return locale[G.SETTINGS.language][key] or locale['en-us'][key] or 'ERROR'
27 | end
28 |
29 | return locale
30 |
--------------------------------------------------------------------------------
/src/logger.lua:
--------------------------------------------------------------------------------
1 | local logger = {}
2 |
3 | function logger.log_trace(message)
4 | logger.log("TRACE", message)
5 | end
6 |
7 | function logger.log_debug(message)
8 | if G.DEBUG then logger.log("DEBUG", message) end
9 | end
10 |
11 | function logger.log_info(message)
12 | logger.log("INFO ", message)
13 | end
14 |
15 | function logger.log_warn(message)
16 | logger.log("WARN ", message)
17 | end
18 |
19 | function logger.log_error(message)
20 | logger.log("ERROR", message)
21 | end
22 |
23 | function logger.log_fatal(message)
24 | logger.log("FATAL", message)
25 | end
26 |
27 | function logger.log(level, message)
28 | if not message then return end
29 | level = level or "LOG "
30 | local date = os.date('%Y-%m-%d %H:%M:%S')
31 | print(date .. " :: " .. level .. " :: SystemClock :: " .. message)
32 | end
33 |
34 | return logger
35 |
--------------------------------------------------------------------------------
/src/smods.lua:
--------------------------------------------------------------------------------
1 | local config_ui = require('systemclock.config_ui')
2 | local config = require('systemclock.config')
3 | local logger = require('systemclock.logger')
4 |
5 | if not SMODS then
6 | logger.log_warn('SMODS initialiser could not find SMODS instance')
7 | return
8 | end
9 |
10 | SMODS.Atlas({
11 | key = 'modicon',
12 | path = 'icon.png',
13 | px = 32,
14 | py = 32
15 | })
16 |
17 | SMODS.current_mod.description_loc_vars = function(self)
18 | return {
19 | scale = 1.2,
20 | background_colour = G.C.CLEAR
21 | }
22 | end
23 |
24 | SMODS.current_mod.config_tab = config_ui.create_config_tab
25 |
26 | local g_funcs_exit_mods_ref = G.FUNCS.exit_mods
27 | function G.FUNCS.exit_mods(e)
28 | config_ui.close_config_menu()
29 | g_funcs_exit_mods_ref(e)
30 | end
31 |
32 | local g_funcs_mods_button_ref = G.FUNCS.mods_button
33 | function G.FUNCS.mods_button(e)
34 | config_ui.close_config_menu()
35 | g_funcs_mods_button_ref(e)
36 | end
37 |
38 | local smods_save_all_config_ref = SMODS.save_all_config
39 | function SMODS.save_all_config()
40 | smods_save_all_config_ref()
41 | config.save()
42 | end
43 |
--------------------------------------------------------------------------------
/src/utilities.lua:
--------------------------------------------------------------------------------
1 | local utilities = {}
2 |
3 | local DYN_UI_INITIAL_COLOURS = {
4 | ['DYN_UI.MAIN'] = mix_colours(G.C.BLUE, G.C.BLACK, 0.6),
5 | ['DYN_UI.DARK'] = mix_colours(G.C.BLUE, G.C.BLACK, 0.24),
6 | ['DYN_UI.BOSS_MAIN'] = darken(G.C.BLACK, 0.05),
7 | ['DYN_UI.BOSS_DARK'] = lighten(G.C.BLACK, 0.07)
8 | }
9 |
10 | function utilities.index_of(table, val)
11 | if not val then return nil end
12 | for i, v in ipairs(table) do
13 | if v == val then return i end
14 | end
15 |
16 | return nil
17 | end
18 |
19 | function utilities.deep_copy(source, destination)
20 | if type(source) ~= 'table' then return source end
21 |
22 | destination = destination or {}
23 | if #source > 0 then
24 | for i, v in ipairs(source) do
25 | destination[i] = utilities.deep_copy(v)
26 | end
27 | else
28 | for k, v in pairs(source) do
29 | destination[k] = utilities.deep_copy(v)
30 | end
31 | end
32 |
33 | return destination
34 | end
35 |
36 | function utilities.deep_merge(source, destination, replace)
37 | destination = destination or {}
38 |
39 | for k, v in pairs(source) do
40 | if type(v) == 'table' then
41 | if replace or destination[k] == nil then
42 | destination[k] = {}
43 | end
44 | utilities.deep_merge(v, destination[k], replace)
45 | else
46 | if replace or destination[k] == nil then
47 | destination[k] = v
48 | end
49 | end
50 | end
51 |
52 | for i, v in ipairs(source) do
53 | if type(v) == 'table' then
54 | if replace or destination[i] == nil then
55 | destination[i] = {}
56 | end
57 | utilities.deep_merge(v, destination[i], replace)
58 | else
59 | if replace or destination[i] == nil then
60 | destination[i] = v
61 | end
62 | end
63 | end
64 |
65 | return destination
66 | end
67 |
68 | function utilities.shallow_copy(source, destination)
69 | destination = destination or {}
70 | for i, v in ipairs(source) do
71 | destination[i] = v
72 | end
73 | return destination
74 | end
75 |
76 | function utilities.get_colour_from_ref(ref)
77 | if not ref or type(ref) ~= 'string' then return nil end
78 | local colour
79 |
80 | if G.STAGE == G.STAGES.MAIN_MENU then
81 | colour = DYN_UI_INITIAL_COLOURS[ref]
82 | if colour then return colour end
83 | end
84 |
85 | colour = G.C
86 | local depth = 0
87 | for obj_name in ref:gmatch("[^%.]+") do
88 | colour = colour[obj_name]
89 | depth = depth + 1
90 | if depth > 2 or not colour then return nil end
91 | end
92 |
93 | return type(colour) == 'table' and colour or nil
94 | end
95 |
96 | function utilities.parse_colour(colour_ref)
97 | if not colour_ref then return nil end
98 |
99 | local ref_type = type(colour_ref)
100 | if ref_type == 'table' and #colour_ref >= 3 then
101 | return { colour_ref[1] or 1, colour_ref[2] or 1, colour_ref[3] or 1, colour_ref[4] or 1 }
102 | elseif ref_type ~= 'string' then
103 | return nil
104 | end
105 |
106 | if string.len(colour_ref) > 6 and colour_ref:sub(1, 1) == "#" then
107 | return HEX(colour_ref:sub(2))
108 | end
109 |
110 | return utilities.get_colour_from_ref(colour_ref)
111 | end
112 |
113 | return utilities
114 |
--------------------------------------------------------------------------------