1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-25 22:18:30 +02:00
Commit Graph

2821 Commits

Author SHA1 Message Date
Dav999
f420b08a0b Fix translator credits headers being forced to 8x8 font
The header "Translators", as well as the language names, were using
PR_FONT_8X8, even though it was translatable text. This is now fixed.
(Also, the CJK spacing for the language names is now higher because
that looked nicer)
2023-12-15 20:00:05 -08:00
Dav999
abf12632bb Load plain font.png beyond U+007F
VVVVVV 2.2 only supported displaying characters 00-7F with its font
system. VVVVVV 2.3 added support for unicode, by supplying a font.txt
with all the characters that are in the font image. But 2.3 made
another change that I didn't immediately realize, even after reading
the code: if font.txt is not present, then the font is not assumed to
have _only_ 00-7F, but _all_ of unicode, as far as the image dimensions
allow.

However, an inconsistency I _did_ notice is how unknown characters
would be rendered in 2.3. If a font had a font.txt, then any unknown
characters would be shown as a '?'. If a font had no font.txt however,
then suddenly any unknown characters would just come out as a space.
I fixed this behavior with the new font system; but what was actually
happening for characters to come out blank is that characters up to
U+00FF, which _were_ technically in the font image but as fully
transparent, would be shown as they were in the image, and characters
beyond U+00FF wouldn't be shown since they were outside of the image.

I don't really want to show blank characters for any character between
80-FF if it is technically inside the image, because pretty much every
single ASCII-only font.png in existence (including the one in data.zip)
contains a blank lower half, just because the font in the game had
always had this specific resolution. (We didn't want to do things that
might crash the game because something was different from what it
expected...)

We have had some confusing occasions before with the old behavior where
the fonts weren't correctly packaged or something (like when the
Catalan translator was sent the first version of the translator pack,
or when people customize their fonts wrong) and special characters were
just blank spaces.

So, instead, for characters beyond 7F, I decided to consider them part
of the font, as long as they are not blank. That means, if a character
beyond the ASCII range has any (non-alpha-0) pixels, then it will be
added, otherwise it won't be. This is just to handle legacy fonts, and
the case where all fonts are missing and the one from data.zip is used;
new fonts should just use .fontmeta or .txt to define their characters.
2023-12-15 19:54:33 -08:00
Dav999
c2ad3d3b97 Clarify translators and programmers READMEs
The top of the programmers readme now says that you need the
translators readme to translate the game into a new language. Also,
since language file syncing now works to populate an empty language
folder, document that in the translators readme as well.
2023-12-15 19:48:55 -08:00
Dav999
6377fd5e73 Make language sync support creating blank language files
Two translators thus far have tried to populate initial language files
by creating a blank folder and then using the in-game sync option. For
example, see #1078.

That is not how the sync option was intended to be used, but it's
really close to getting everything, so I decided to just complete the
support by making sure numbers.xml is copied from English, and making
sure meta.xml is filled in with English text and not text from an
arbitrary language. Also, minor detail on plural form 1 being set to 1
by default if reset, so strings_plural.xml is fully consistent too.
2023-12-15 19:48:55 -08:00
Dav999
66ba557c4d Fix binding menu allowing you to lock yourself out of the game
Or well, lock yourself out if you don't have (easy) access to a
keyboard, like on Steam Deck.

In 2.3, this problem used to be much worse, since you could bind any
button to "menu" - which is actually also "return" in menus - and that
button could then no longer be bound to any other action, because
exiting the bindings menu had priority over assigning a different
binding. The result would be that people could have all their buttons
bound to "escape" with no way of undoing it or using their controllers
at all other than manually going into their config file to change it.

In 2.4, the most important bugs in the bindings menu are fixed, but
it's still possible to remove all your bindings from the "flip"
(confirm) action, meaning you can't navigate the menus anymore with a
controller to fix your bindings or even do anything.

There is one interesting part to all this: if an action has no buttons
bound to it at all when the game is started, then that action is
populated with the default button for that action. This is done for
each action separately, without accounting for the case where the
default button was already bound to another action which was not empty.
(This is something that the binding menu does try to prevent).
Therefore, having no buttons bound to "flip" while having A and B bound
to "menu", would result in A being bound to "flip" and A and B bound to
"menu".

That would still make you unable to enter the gamepad menu, since both
"confirm" and "return" are pressed in a row.

This commit fixes the specific situation where flip/confirm buttons are
also bound to menu/return, by removing all buttons that are in the flip
button list from the menu list. This means that, on Steam Deck, you can
still go to your bindings menu.
2023-12-15 19:44:51 -08:00
AllyTally
9782b450ef Fix broken warp background check
Seems like I made a mistake while originally writing the "make
autotiling base" code. This commit fixes the warp background turning
into solid tiles when you switch to a different tileset.
2023-12-15 19:40:07 -08:00
AllyTally
03bc9566fb Make outside background tiles ignore solid walls
This was the behavior in the old autotiling system, so this brings that
behavior back.
2023-12-15 19:40:07 -08:00
TerryCavanagh
d314672614 whoops 2023-12-12 15:19:21 +01:00
TerryCavanagh
b11d33f353 updated Italian localisation credits 2023-12-12 10:22:44 +01:00
TerryCavanagh
7e000a9668 minor updates to Italian 2023-12-12 10:17:22 +01:00
TerryCavanagh
4005fe9725 updates to Korean
from our translator, based on TARI1237KR's feedback
2023-12-11 10:42:45 +01:00
TerryCavanagh
912e621259 minor updates to Welsh, German, Japanese, Polish and Silesian 2023-12-06 19:20:28 +01:00
TerryCavanagh
9a40993b5f Add localisation credits to main menu credits
In addition, this adds Ally and mothbeanie to the Localisation
Implementation page credits. Also updated the game complete credits!
2023-12-05 16:14:06 -08:00
TerryCavanagh
e754654926 Change Spanish name in meta.xml to Español (es)
might consider adding an Español (latam) edit next year, but this is
enough for 2.4. We're using "Español (es)" instead of "Castellano"
because our translator prefers it
2023-12-05 16:14:01 -08:00
Reese Rivers
79376ae82e Initial implementation of localisation credits
This commit adds translation credits to the game's end credits
screen. Note that this is not implemented into the menu credits
screen yet. The translator name list is subject to tweaks, and
additionally some localised strings ("Localisation Project Led by"
and "Pan-European Font Design by") run off the screen in some
languages (Catalan, Spanish, Irish, Italian, Dutch, European
Portuguese and Ukrainian) and will need to be addressed later.
2023-12-05 16:13:03 -08:00
TerryCavanagh
c660000292 updated İZLE sprite for turkish
as approved by our translator
2023-12-05 16:46:41 +01:00
Dav999
8f7d0f4913 Make some minor refinements to Dutch translation
I put a main focus on the first cutscenes in the game, changing the
first "Uh oh..." from something like "Oh dear..." to "Oh no..." to make
sure it always sounds right. (The real translation of "Uh oh" is "O-o",
but that seemed too easy to read wrong for the first line in the game
that I wanted to avoid it altogether.)
2023-12-05 16:41:05 +01:00
Dav999
d745bf2e6c Restore correct LIES/TRUTH for Korean
This reverts the Korean sprites in commit
6a8db6a22d.

How many times did we accidentally flip these around now lol
2023-12-05 15:33:20 +01:00
Dav999
2533e144b6 Fix centering of game complete texts if level font != interface font
Textboxes created with graphics.createtextboxflipme() use PR_FONT_LEVEL
by default, but can be overridden with graphics.textboxprintflags() to,
for example, set PR_FONT_INTERFACE. This happens for the textboxes on
the Game Complete screen, which use interface text. The textboxes are
centered by setting the X position to -1 though, which means they're
solely centered based on the width of the first line, in the level
font (because the font hasn't been changed to the interface font yet).

Normally, this isn't a problem, because in the main game (where the
Game Complete screen usually appears), the level font is always equal
to the interface font. However, in custom levels you can still get it
(by calling gamestate 3500) and in that case some of the text may be
misaligned. This change fixes that by adding graphics.textboxcenterx()
to these textboxes.

As far as I can tell, these are the only textboxes that are centered
by just x=-1 despite changing the font afterwards.
2023-12-04 19:49:17 -08:00
Dav999
3c49be7d81 Fix ACCIÓN having changed to ACTION in Spanish 2023-12-04 19:45:01 -08:00
Ethan Lee
2d1009e815 Add "type:" override check for virtual Sony gamepads.
Fixes #1056
2023-12-01 12:08:26 -05:00
AllyTally
b23983c0b8 Fix BG tile bug from switching from pink SS
If you had a pink space station background, and switched to a different
tileset, some solid tiles would be placed instead. This commit fixes
that by transforming the room into the basic autotiling tiles before
changing the tileset itself. The reason why I chose this solution is
because it will help with a future change, being unhardcoding warp zone
backgrounds (which'll help with custom autotiling, if that becomes a
thing.)
2023-11-30 19:17:52 -08:00
AllyTally
96d36f86f0 Change 0s to 713 for lab background
This is so it gets treated as a background tile, so background tiles
don't get thrown away when you shift tilesets.
2023-11-30 19:17:52 -08:00
Dav999
bafd494a67 Polish: Change roomname Ostrzeżenie to Przestroga 2023-11-30 14:59:30 -08:00
Dav999
10ed1079ae Fix "he'd be a a big help" typo
Now that the language files are fairly stable, we should be able to do
this without any accidental reverts taking place (if any do happen, it
should be easy to see and prevent)
2023-11-30 08:38:40 -08:00
Dav999
a111576a98 Correct one letter's capitalization in German
It's a menu option, so it should be uncapitalized, like all other menu
options.
2023-11-29 17:56:58 -08:00
Reese Rivers
80626d358c Fixed duplicated/shifted characters 2023-11-29 10:24:07 -08:00
Dav999
02e15ed829 Italian: Fix in-game timer ON/OFF being reversed 2023-11-29 09:52:14 -08:00
Dav999
1ae9370a72 Japanese: apply change from 凄い to すごい 2023-11-29 09:52:14 -08:00
Misa
af35be5bb6 Name conditionals in text box loop
With the recent change to drawing overlays (images and sprites) from
PR #1058, it's starting to get a bit hairy. This names the conditionals
responsible for determining if the text box is transparent (checking
that all of its RGB is 0) and if overlays should be drawn or not (which
is now either when it's opaque or transparent).
2023-11-28 19:07:49 -08:00
Reese Rivers
44a889efeb Changed timing of textsprites in transparent textboxes
Textsprites and textimages no longer wait for the opacity
value in order to display within transparent textboxes.
Text sprites in normal opaque textboxes are not affected
by this change.
2023-11-28 19:07:49 -08:00
Reese Rivers
2e950fc935 Update Space Station font to latest version 2023-11-28 18:11:42 -08:00
AllyTally
041a81d8de Fix incorrect tiles in outside BG autotiling 2023-11-28 17:21:02 -08:00
Dav999
133adba10e Fix remaining audio speedup/slowdown bug
Fixes #1057.

Based on Ethan's hunch, I simply removed the format comparison that
decides whether to halt and restart, or reuse the voice. Voices are
now always restarted when playing a new track.

This also simplifies the code somewhat: `MusicTrack::musicVoiceFormat`
was now no longer used, and an `if (!IsHalted())` was no longer
necessary because `Halt()` already does that. So those are now removed
as well.
2023-11-28 20:16:38 -05:00
Dav999
456a81df67 Add spaces at the end of "TEMPS :" string (and MORTS and BLINGS)
This string is used both in time trials (alongside "MORTS :" and
"BLINGS :") as well as outside time trials if you enable the in-game
timer. In English, this looks like "TIME:1:23.45". Since French adds
a space before the colon, it will look like "TEMPS :1:23.45" instead.
Therefore, I've added a space after the colon as well.
2023-11-27 18:45:09 -08:00
Dav999
d49fb7eb2e Apply changes to two terminal textboxes in Japanese
These are to make the textboxes not overlap with the header, by making
them wrap to less lines.
2023-11-27 15:22:22 -08:00
Dav999
61c5e18413 Fix position of crewmate in "You have rescued a crew member!" box
At first my CJK changes also misaligned this sprite, and my solution
that time was to position the textbox higher depending on the height
of the textbox, so it would be centered around the crewmate sprite
(which stayed at a hardcoded place onscreen). Recently, #987 changed
these sprites to be relative to the position of the textbox instead of
relative to the screen, which is much more logical, but it stopped
centering these sprites again. But it's an easy fix: simply account for
the extra-added height when adding the sprite in.
2023-11-27 15:02:47 -08:00
Misa
c9fd9e7924 README: Delete section on compiler quirks
This hasn't been relevant for years now. Even in 2.3, this wasn't
relevant, but we added a disclaimer saying that it only applies to 2.2.

But now issue #1052 has been opened specifically pointing to this
section as something that should be removed. Therefore, I'm removing it.
2023-11-27 13:43:23 -08:00
Misa
70357a65bf Fix regression: Warp BG lerps in reverse direction
This fixes a regression caused by PR #923 (the PR that moved rendering
to be GPU-based) where the interpolation of the horizontal and vertical
warp backgrounds (in over-30-FPS mode) was in the wrong direction, which
makes them look blurry.

This happens because the arguments to the `lerp` function were in the
wrong, reverse order.

On the VVVVVV Discord server, Ally raised the argument that they were in
the same order before she made the changes; therefore the previous code
was also incorrect and it wasn't her fault. However, this argument is
incorrect, because in that case, the reverse order _is_ the correct
order.

The reason that it's now the wrong order is because the output of `lerp`
is now being used as the argument to a source rectangle. Previously, the
output of `lerp` was being used as the offset argument to
`ScrollSurface`, which is analogous to being a destination rectangle.

Fixes #1038.
2023-11-27 13:29:06 -08:00
Ethan Lee
8426e0930d VS2010 buildfixes.
The main issue was mostly that we have to build C files as C++ in some
cases, and extern "C" wasn't being used everywhere, so linker errors
popped up. The rest is the usual tedious VS2010 stuff like casting void*
to other stuff, so this commit as a whole is pretty boring!
2023-11-27 12:09:42 -05:00
TerryCavanagh
4725bc4d5e minor change to SIM enemy sprite in pt_BR and pt_PT 2023-11-25 23:31:51 +01:00
TerryCavanagh
0d13a1d38b small update to Polish (changed roomname Aleja Woronicza -> Taśmy prawdy) 2023-11-25 17:08:36 +01:00
TerryCavanagh
46df77e837 minor fixes for Turkish and Esperanto 2023-11-25 16:07:29 +01:00
David Galiev
c27f35b15d Fix some Russian strings 2023-11-25 15:21:47 +01:00
TerryCavanagh
6bbc649269 minor fixes for Polish and Silesian 2023-11-25 15:21:47 +01:00
TerryCavanagh
432487b2d9 Final strings for Polish and Silesian 2023-11-25 15:21:47 +01:00
TerryCavanagh
081b8938b6 minor fixes for Irish
fixed checkpoint letter S being wrong upside down, changed the "big C thing" cutscene
2023-11-25 15:21:47 +01:00
TerryCavanagh
6a8db6a22d Enemy graphics for all other languages*
*subject to changes

Also, Traditional Chinese is current using the Simplified Chinese graphics, which is acceptable but not ideal:

Obey -> 服從 (ok to use simplified 服从)
Lies -> 謊言 (ok to use simplified 谎言)

The other words are the same for Simplified Chinese and Traditional Chinese.
2023-11-25 15:21:47 +01:00
TerryCavanagh
268564cadc minor fix for Esperanto (checkpoint c -> k) 2023-11-25 15:21:47 +01:00
TerryCavanagh
e1eaaaed32 minor fix for Spanish
whoops
2023-11-25 15:21:47 +01:00
TerryCavanagh
b2d15c0bba Final strings for Spanish 2023-11-25 15:21:47 +01:00
TerryCavanagh
5a95040a4d Enemy graphics for Korean 2023-11-25 15:21:47 +01:00
TerryCavanagh
83b9db71ee Final strings for French 2023-11-25 15:21:47 +01:00
TerryCavanagh
f5b9c3b09e Final strings for European Portuguese 2023-11-25 15:21:47 +01:00
TerryCavanagh
43cb7a5cde Final strings for Welsh 2023-11-25 15:21:47 +01:00
TerryCavanagh
085b2d5987 minor fix for Japanese 2023-11-25 15:21:47 +01:00
TerryCavanagh
61d14ce2af Enemy graphics for Japanese
These depend on pull request https://github.com/TerryCavanagh/VVVVVV/pull/1031 - if the format or implementation changes, I'll update the branch to match!
2023-11-25 15:21:47 +01:00
TerryCavanagh
99dd10b158 Final strings for Japanese 2023-11-25 15:21:47 +01:00
TerryCavanagh
48d9ab3083 Final strings for Brazilian Portuguese 2023-11-25 15:21:47 +01:00
TerryCavanagh
195b375d2e minor fixes for Ukrainian 2023-11-25 15:21:47 +01:00
Dav999
2db9eaa9a2 Final strings for Esperanto (credits part) 2023-11-25 15:21:47 +01:00
TerryCavanagh
7ad96c6d43 Final strings for Ukrainian 2023-11-25 15:21:47 +01:00
TerryCavanagh
9bea54578e Squashed commit of the following:
commit 3d6802add8
Author: Dav999 <dav999.tolp@gmail.com>
Date:   Thu Oct 19 17:16:01 2023 +0200

    Change AVOID to FAINIC in Irish

commit 21fd84f479
Author: Dav999 <dav999.tolp@gmail.com>
Date:   Thu Oct 19 17:04:27 2023 +0200

    Partial final strings for Esperanto

    This does not yet include the new localization credits, but I already
    had all the other strings.

commit 45382a358c
Author: Dav999 <dav999.tolp@gmail.com>
Date:   Thu Oct 19 17:01:30 2023 +0200

    Final strings for Dutch

    I also decided to change AVOID from ONTWIJKEN to ONTWIJK, to make it
    a bit more fitting as if it's an actual word enemy with length
    restrictions, heh. (Not that it's an abbreviation - it's just an
    imperative instead of an infinitive. And those terms I had to look up)
2023-11-25 15:21:47 +01:00
TerryCavanagh
dcb447b4f3 Final strings for Italian 2023-11-25 15:21:47 +01:00
TerryCavanagh
0cfce45ec6 Final strings for Turkish 2023-11-25 15:21:47 +01:00
TerryCavanagh
faa4266eb7 Final strings for Traditional Chinese 2023-11-25 15:21:47 +01:00
TerryCavanagh
3c4337eca6 Minor fixes for German and Irish 2023-11-25 15:21:47 +01:00
TerryCavanagh
ea7f6982db Final strings for Irish 2023-11-25 15:21:47 +01:00
TerryCavanagh
822aec9d10 Final strings for German 2023-11-25 15:21:47 +01:00
TerryCavanagh
0ae927eb3b Changed to Simplified Chinese to match enemy graphic changes 2023-11-25 15:21:47 +01:00
TerryCavanagh
5ca49e607e Final strings for Simplified Chinese 2023-11-25 15:21:47 +01:00
TerryCavanagh
e30dd618d2 Final strings for Catalan, Russian and Korean
more incoming
2023-11-25 15:21:47 +01:00
AllyTally
b7a8bb138c Unhardcode TAB in translation strings
In case we want to make it rebindable in the future, we shouldn't make
translators retranslate these strings.
2023-11-19 17:34:23 -08:00
AllyTally
4df35da0e4 Fix debugging in the tower, update wording
Fixes debugging mouse targets and rendering in the tower. This also
changes "movement" to "gameplay" in the TAB hint.
2023-11-19 17:34:23 -08:00
AllyTally
0804f2d0c0 Add warp background as general information 2023-11-19 17:34:23 -08:00
AllyTally
f7ca850017 Update to latest commit 2023-11-19 17:34:23 -08:00
AllyTally
6b7bf44402 Add gravity line true hitbox visuals 2023-11-19 17:34:23 -08:00
AllyTally
55a05342e9 Replace manual check with SDL_PointInRect 2023-11-19 17:34:23 -08:00
AllyTally
63620efac8 Fix moving entities flashing in over 30fps mode 2023-11-19 17:34:23 -08:00
Ally
689768b8ca Fix issues
Co-authored-by: Dav999 <44736680+Dav999-v@users.noreply.github.com>
2023-11-19 17:34:23 -08:00
AllyTally
aff4d2012c Add -leveldebugger flag
This commit adds the `-leveldebugger` flag so you can use it while
playtesting from a different editor program, such as Ved.
2023-11-19 17:34:23 -08:00
AllyTally
c62da1c9a0 Add flag display by holding U 2023-11-19 17:34:23 -08:00
AllyTally
fd2f738145 Debug lines while not hovering
This commit adds new debug lines while you're NOT hovering over an
entity or a block. Additionally, coordinates are now displayed smaller,
to not take up as much vertical space.
2023-11-19 17:34:23 -08:00
AllyTally
be77047440 Add more info, add lang string 2023-11-19 17:34:23 -08:00
AllyTally
91f87fa126 Add level debugger screen
The level debugger is toggleable in playtesting mode by pressing Y.
You can toggle whether or not the game is paused inside of the debugger
by pressing TAB. The debugger screen allows you to see entity and block
properties, and allows you to move them around.
2023-11-19 17:34:23 -08:00
Dav999
3c4ed36418 Translate hardest room at display time instead of at time of death
The hardest room used to be stored as a room name in whatever language
it was in when you last died enough times to break the record (before
localization, that was always English). Even after localization became
a thing we could get away with this since we only had a single font,
but now we might have actual question marks appearing when the new font
doesn't support characters from the old language.

Therefore, this commit adds more info about the hardest room to save
files - everything that is needed to know in order to do the
translation at display time. These are hardestroom_x and hardestroom_y
for the room coordinates, as well as hardestroom_specialname to mark
special names, in addition to changing the stored room name back to
English. I've also added hardestroom_finalstretch in case we later
decide to drop the English name as a key and rely on just the
coordinates (even though I think that change itself would be more
complicated than any simplification it would accomplish, and I don't
think it's necessary, but better to have it if we do need it later)
2023-11-19 16:47:52 -08:00
Dav999
e0e902d717 Change levelstats data type from vector to map
As described in #1016, there used to be a bug that inflated
levelstats.vvv in 2.3, which was fixed in 2.4, but there was no way
for inflated files to get smaller yet.

This commit changes the storage of levelstats from a std::vector of
structs to a std::map, so that uniqueness is guaranteed and thus the
stats can be optimized automatically. And it also simplifies *and*
optimizes the code that handles the levelstats - no more big loops that
iterated over every element to find the matching level.
(Farewell to the "life optimisation and all that" comment, too)

I tested this with both my own levelstats.vvv, as well as some inflated
ones (including Balneor's 93 MB one) and saw this code correctly reduce
the filesize and speed up the levels list.

Fixes #1016.
2023-11-19 16:18:54 -08:00
Dav999
82240d262b Game::loadcustomlevelstats: move some declarations to later in function
The declarations of `std::vector<std::string> customlevelnames` and
`std::vector<int> customlevelscores` are made quite early in the
function, commented with "Old system", but the place where the old
system is processed is after a big chunk of code that processes the new
system (and indeed never uses these vectors). So for readability,
they're now closer to where they're used.
2023-11-19 16:18:54 -08:00
mothbeanie
58c006f61f decrease map cursor margin on smaller map sizes 2023-11-19 15:59:27 -08:00
mothbeanie
94ece095ed PR_BOR8 -> PR_FULLBOR, border8 -> full_border 2023-11-19 15:59:27 -08:00
mothbeanie
947d716be6 remove tile_offset (no longer used) 2023-11-19 15:59:27 -08:00
mothbeanie
3a3ec659d6 Add translingual map legend code + border8 2023-11-19 15:59:27 -08:00
mothbeanie
7840f72389 Add translingual map legend characters to font 2023-11-19 15:59:27 -08:00
AllyTally
103b4d36a1 Add textimage for levelcomplete and gamecomplete
`levelcomplete` and `gamecomplete` were hardcoded using textbox colors
which were offset by 1. This PR fixes that, no longer requiring
slightly-off colors, and instead adding a new property to textboxes
which tell the game to display either level complete or game complete.
2023-11-19 15:07:25 -08:00
AllyTally
b5c9508dd4 Finish implementing sprites in textboxes
This commit adjusts the Y position for flip-mode, and makes the main
game use this new system.
2023-11-19 15:07:25 -08:00
AllyTally
76ea4488af Initial implementation of textbox sprites
This commit adds a system for displaying sprites in textboxes, meant to
replace the hardcoded system in the main game. This does not support
levelcomplete.png and gamecomplete.png yet, which will most likely just
be special cases.
2023-11-19 15:07:25 -08:00
Dav999
187fd85e14 Change saved <summary> tag back to English
This ensures loading a 2.4 save in the English-only 2.3 or earlier
doesn't result in missing characters because a translated area name
appears in the save file. We are not reading from <summary> anymore
in 2.4.

The way this is done is by not translating the area names inside
mapclass::currentarea(), but at the callsites other than the one which
saves the <summary>.
2023-11-19 13:49:59 -08:00
Dav999
ac7fe4475c Remove more tele/quick variables duplicating info in struct Summary
For both `tele` and `quick`, I removed these attributes of class Game:
- std::string *_gametime
- int *_trinkets
- std::string *_currentarea
- bool *_crewstats[numcrew]

All this info can now be gotten from members of Game::last_telesave and
Game::last_telesave. I've also cleaned up the continue menu to not have
all the display code appear twice (once for telesave and once for
quicksave).

RIP "Error! Error!" though lol
2023-11-19 13:49:59 -08:00
Dav999
f23ffc0457 Get rid of Game::savearea (std::string)
This is what got saved to the area part of the <summary> tags, and it
was specifically set upon pressing ACTION to save in the map menu.
Which meant tsave.vvv may not get an accurate area name (notably
"nowhere" if you hadn't quicksaved before in that session) even though
it's not displayed anywhere so it didn't really matter. But this
variable can be removed - there's only one place where <summary> is
written for both quicksaves and telesaves, so that now gets the area
at saving time.

Fun fact: custom level quicksaves also have a <summary> tag, and it's
even less functional than the one in tsave.vvv, because it stores
whatever main-game area name applies to your current coordinates.
So I simply filled in the level's name instead (just like what the
actual save box says).
2023-11-19 13:49:59 -08:00
Dav999
0ea41e7913 Replace std::string Game::telesummary and Game::quicksummary by Summary
Game::telesummary and Game::quicksummary stored the summary string for
the save files - which is the <summary> tag that says something like
"Space Station, 10:30:59". The game only ever displays the quicksave
variant of these two, for "Last Save:" on the map menu's SAVE tab.
So the telesave has a <summary> too, but it's never displayed anywhere.
(In fact, the area is often set to "nowhere"...)

However, the summary strings have another function: detect that both
the telesave and quicksave exist. If a summary string for a save is
empty, then that save is considered not to exist.

I'm refactoring the summary string system, by making the new variables
Game::last_telesave and Game::last_quicksave of type struct
Game::Summary. This struct should have all data necessary to display
the summary string at runtime, and thus translate it at runtime (so
we don't store a summary in a certain language and then display it in
the wrong font later - the summary can always be in the current
language). It also has an `exists` member, to replace the need to
check for empty strings.

The <summary> tag is now completely unused, but is still written to
for older versions of the game to read.

(This commit does not add the new string to the language files, since
Terry now added it separately in his own branch)
2023-11-19 13:49:59 -08:00
Dav999
64bad7d67f Remove double NULL check in loadthissummary() 2023-11-19 13:49:59 -08:00
Dav999
61adffe6eb Remove finalmode from struct Summary
It's unused (other than some map.finalmode assignments which should not
be there) and we don't need it either. If we do, we can always readd
it.
2023-11-19 13:49:59 -08:00
Dav999
50a560dc5f Change savex and savey in struct Summary to saverx and savery
This is a bit misleading otherwise, since it is the room coordinates,
not pixel coordinates.
2023-11-19 13:49:59 -08:00
Dav999
4e5126a596 Move struct Summary from Game.cpp to Game.h
This will allow it to be used in other source files in a later commit.
2023-11-19 13:49:59 -08:00
Dav999
89a165722e Simplify mapclass::currentarea()
It used to take a single int: the area number returned by
mapclass::area(roomx, roomy). All uses of currentarea() were called
with an extra area() call as its argument. Additionally, there's a
good reason why currentarea() should have the room coordinates: in one
of the cases that it's called, there's a special case for the ship's
coordinates. This results in the SAVE screen in the map menu being able
to show "The Ship", while the continue screen shows "Dimension VVVVVV"
instead. Therefore, why not put that exception inside currentarea()
instead, and remove a few callsite map.area() wrappers by making
currentarea() take the room x and y coordinates?
2023-11-19 13:49:59 -08:00
Dav999
73911a7ada Remove game.customquicksummary
It's completely unused (apart from the variable being set in one
place). So let's get this out of the way.
2023-11-19 13:49:59 -08:00
Misa
0a72cc6614 Android: Update README.md for Maven package
Since #1047 was merged, we now make the user build the SDL prefab
themselves (as SDL does not publish Maven packages yet). Here are some
instructions for doing that.
2023-11-14 17:29:34 -08:00
leo60228
ca71410f14 Use Android SDL2 via Maven 2023-11-14 17:18:08 -08:00
Dav999
1d3173f5c1 Fix %cs showing instead of commit date on Windows (or older git?)
Whenever I'd compile on Windows, I'd see the literal text "%cs" in the
main menu instead of the commit date. I never thought much of it (at
least it runs, and the date only shows up in development builds). Now
that I've also seen a screenshot from Terry with it, I decided to look
into it further. Looks like it's a format string that our gits on
Windows aren't recognizing for whatever reason - probably because
they're too old. I have git version 2.23.0.windows.1, and checking its
help page for `git log`, under PRETTY FORMATS, %cs is missing as an
option, while some other options are still there. So the option was
probably added sometime between that version and 2.34.1, which is the
one I have on Linux, where %cs does work.

Luckily, %cd with --date=short seems equivalent, and better supported,
so we can just use that instead.
2023-11-13 14:42:48 -08:00
Misa
1e5a737089 CMake: Silence deprecation warning
Recent versions of CMake emit the following:

    CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
      Compatibility with CMake < 3.5 will be removed from a future version of
      CMake.

      Update the VERSION argument <min> value or use a ...<max> suffix to tell
      CMake that the project does not need compatibility with older versions.

Reading the documentation further, adding a max refers to the max
version compatibility of CMake _policies_. Adding a max of 3.5 makes the
warning go away, so it seems that the warning is more about policies
than anything else.

This will still work on 2.8.12 as the extra dots will be seen as a
version component separator, ignoring the max version.
2023-10-31 22:36:11 -07:00
Dav999
b3810b686d Update README-translators.txt with info about sprites translation 2023-10-31 22:31:41 -07:00
Dav999
5c7be6c1de Add Dutch translated sprites
These should be pretty finalized, and serve as a demo for this PR.
2023-10-31 22:31:41 -07:00
Dav999
9045e26d3e Add support for translatable sprites
Language folders can now have a graphics folder, with these files:
- sprites.png and flipsprites.png: spritesheets which contain
  translated versions of the word enemies and checkpoints
- spritesmask.xml: an XML file containing all the sprites that should
  be copied from the translated sprites and flipsprites images to
  the original sprites/flipsprites.

This means that the translated spritesheets don't have to contain ALL
sprites - they only have to contain the translated ones. When loading
them, the game assembles a combined spritesheet with translated sprites
replacing English ones as needed, and this sheet is used to visually
substitute the normal sprites at rendering time.

It's important to note that even if 32x32 enemies have pixel-perfect
hitboxes, this is only a visual change. This has been discussed several
times on Discord - basically we don't want to give people unfair
advantages or disadvantages because of their language setting, or
change existing gameplay and speedruns tactics, which may depend on the
exact pixel arrangements of the enemies. Therefore, the hitboxes are
still based on the English sprites. This should be basically
unnoticeable for casual players, especially with some thought from
translators and artists, but there will be an option in the speedrunner
menu to display the original sprites all the time.

I removed the `VVV_freefunc(SDL_FreeSurface, *tilesheet)` in
make_array() in Graphics.cpp, which frees grphx.im_sprites_surf and
grphx.im_flipsprites_surf. Since GraphicsResources::destroy() already
frees these, it looks like the only purpose the one in make_array()
serves is to do it earlier. But now we need them again later (when
switching languages) so let's just not free them early.
2023-10-31 22:31:41 -07:00
Dav999
8ef000554d Add "English sprites" setting
It'll start working in the next commit... See the description there.

(This commit does not add the new strings to the language files, since
Terry now added them separately in his own branch)
2023-10-31 22:31:41 -07:00
Dav999
92f9940464 Update my GitHub username and Ved repo link
I recently changed my GitHub username from Dav999-v to Daaaav, and
today I moved the Ved repo from GitGud.io to GitHub. This commit
updates the references to both my username and the Ved repository.
2023-10-28 19:04:44 -07:00
Misa
ea1a014145 Fix memory leak with ApplyFilter
The intention of the recent refactor was to make it so that the
temporary surfaces would be allocated only once, when the mode is
enabled, and be freed upon exit.

To do this, Graphics.cpp owns the pointers, and passes them to
ApplyFilter to modify. Except ApplyFilter doesn't actually modify the
pointers, because it's only a single pointer, not a pointer-to-pointer.
So every frame of rendering it would actually be creating a new surface
and leaking memory.

To fix this, they need to be pointer-to-pointer variables that get
modified.

I also added error logs in case the surface creation failed.
2023-10-27 10:25:42 -07:00
Misa
791310fa5d Provide error code if SetConsoleOutputCP fails
According to the Win32 documentation, GetLastError provides extended
error information if SetConsoleOutputCP fails.
2023-10-25 17:21:11 -07:00
Dav999
98d1a38d7f Allow UTF-8 console output on Windows (for -console)
Right now, Windows assumes all our console output is code page ????.
That means our UTF-8 output appears mangled. (I ran into this while
testing IME text input by outputting strings to the console)

For a moment I was scared we'd need to do UTF-16 conversions and call
Windows-specific print functions like WriteConsoleW() in our vlog
functions, but fortunately SetConsoleOutputCP(CP_UTF8) works just fine.
2023-10-25 17:17:49 -07:00
Dav999
36dbb0f73a Show centiseconds for best time trial times (if available)
Since VVVVVV 2.3, time trial best times are stored not just with the
number of seconds, but also the number of frames. However, there was
no room to display it with the old design of the time trials screen.
Now there is, so it can easily be displayed now with a small change!

Unset frames are stored as -1, which fits perfectly into the frames
argument of help.format_time(), because in that case the amount of
centiseconds is not shown.

It should be noted that opening VVVVVV 2.2 will instantly wipe your
frames records, as described by #1030. But many people will likely
never open 2.2 anymore.
2023-10-25 17:06:50 -07:00
Misa
a46c817c69 Clarify references to Make and Play in README
Some people might be confused by the reference to M&P in the
instructions referring to downloading data.zip (#1026).

data.zip is the same between M&P and full versions of the game and is
orthogonal to which version of the game is built. Building M&P just
requires uncommenting `#define MAKEANDPLAY` in `MakeAndPlay.h`.

So clarify that you can grab data.zip from your existing copy of the
game, or from the Make and Play _page_ (not necessarily the Make and
Play edition of the game), and add instructions for building the M&P
version.

Closes #1027.
2023-10-25 16:47:25 -07:00
Misa
9a9fb5b237 Android: README: Fix swapped h1/h2 headers
The ones I meant to be h1 appeared as h2 and vice versa. Whoops.
2023-10-25 16:44:23 -07:00
Misa
75a693347b vlog: Slim SDL.h include down to SDL_log.h
The entirety of SDL doesn't need to be included, only the SDL_log header
does.
2023-10-25 15:48:04 -07:00
Misa
f83b63142d Android: Add README.md
This serves as a file to help others in building the C++ Android version
for themselves.

These instructions are what I figured out to get it to work for me, and
should be kept up to date.
2023-10-25 15:04:12 -07:00
leo60228
d6a43fad90 Fix compiler warnings on Android 2023-10-25 14:44:34 -07:00
leo60228
246a91c45e Use existing package name to allow updates 2023-10-25 14:44:34 -07:00
leo60228
e170d19e16 make more tasks depend on zipRepoAssets 2023-10-25 14:44:34 -07:00
leo60228
6d88f8b1d6 Ignore output-metadata.json 2023-10-25 14:44:34 -07:00
leo60228
dae5f7bbd7 Use adaptive icon (legacy was chosen by mistake) 2023-10-25 14:44:34 -07:00
leo60228
4512c13507 Fix release builds (Gradle why) 2023-10-25 14:44:34 -07:00
leo60228
2986dc01d9 Add DocumentsProvider 2023-10-25 14:44:34 -07:00
leo60228
9d1d994f57 Disable editor on Android (like Steam Deck) 2023-10-25 14:44:34 -07:00
leo60228
945823ca30 Build and mount repo.zip with fonts/ and lang/ 2023-10-25 14:44:34 -07:00
leo60228
3e0cf57a99 Address review 2023-10-25 14:44:34 -07:00
leo60228
f3f9d1b523 Enable ABI splits
This is somewhat convenient for development, as it means that Android
Studio will only do a native build for the architecture of the device
being used for testing.

This is ignored for AABs, so it won't affect release builds (at least
for Google Play).
2023-10-25 14:44:34 -07:00
leo60228
4229372c2e Android port 2023-10-25 14:44:34 -07:00
Dav999
1254209a22 Apply updates to Polish and Silesian room names 2023-10-11 15:55:36 -07:00
Dav999
e847fc2d43 Add missing string in Japanese 2023-10-02 19:03:39 -07:00
Dav999
08ff09005b Apply updates to Polish and Silesian 2023-09-30 16:48:35 -07:00
Dav999
122fb53574 Apply latest fixes to some Turkish strings
This fixes some translations that were too long for the newly
translated strings.
2023-09-29 10:08:51 -07:00
Dav999
2773dd3537 Improve some Dutch menu strings
I took a very critical look at all the menus, to make sure they're all
clear and easy to read. I mainly simplified some explanations and
solved some small issues.
2023-09-28 23:00:16 -07:00
Dav999
b5032ec0c1 Bring Catalan, Dutch and Esperanto language files 100% up-to-date again
Well, 100% up-to-date with current upstream at least, there's some more
strings to be added soon, including "{area}, {time}" from #1018, a new
menu option related to translatable graphics files, and definitely some
credits stuff.
2023-09-28 23:00:16 -07:00
Dav999
ed02cac3b4 Add Silesian language files
This is the last planned language for 2.4 I think!
2023-09-28 22:54:53 -07:00
Dav999
eeec428d0b Raise limits on three strings in translation files
These were causing false alarms in translations for one reason or
another (either to force translations to not wordwrap for style
reasons, or to stay on the safe side if an adjacent string was also
long), so they can be raised now.
2023-09-20 18:38:16 -07:00
Dav999
1c934688a3 Make "{n_crew|wordy} crewmates remain" string wordwrap
It used to have a limit of 40 8x8 characters, but there's room for it
to wrap.
2023-09-20 18:38:16 -07:00
Dav999
cbdf888a40 Sync new string from #1002 into languages added by #989
These PRs were open in parallel so this simply syncs the language files
back up.
2023-09-20 18:38:16 -07:00
Dav999
5e2e9e7ce8 Update French to near-latest strings (99.9%), fix issues 2023-09-20 16:54:43 -07:00
Dav999
fcf034583b Fix possible title screen from in-game if command-line playtesting
In 8484b36198, I fixed the title screen
showing up if you go to the language screen from in-game, while not
having any language files. There was also one other possible way to get
this to happen that I missed though: if you do have language files, and
you have not set your language yet, and you start a playtest via the
command line (e.g. by using Ved), and you then change the language
from the in-game options. That is now fixed.
2023-09-20 16:20:24 -07:00
Dav999
4ae6c77110 Prevent changing language if a textbox is displayed
I really thought I was going to need to block changing the language
in-game altogether, but activity zone prompts are now fixed and the
only obvious problem I can think of right now is having a dialogue
open, so I just disable the language option if a textbox is displayed.
(like how the map menu only has the save option if a script is running)
2023-09-20 16:20:24 -07:00
Dav999
700aa4aaa0 Make activity zone prompts loc::gettext'ed at display time
The translations for the prompts used to be looked up at creation time
(when the room is loaded or the activity zone is otherwise spawned),
which meant they would persist through changing the language while
in-game. This would look especially weird when the languages you switch
between use different fonts, as the prompt would show up in the old
language in the new language's font.

This problem is now fixed by letting the activity zone block keep
around the English prompt instead of the translated prompt, and letting
the prompt be translated at display time. This fixes a big part of the
reason I was going to disable changing the language while in-game; I
might only need to do it while textboxes are active now! :)
2023-09-20 16:20:24 -07:00
Dav999
fd84922a92 Add warning messages for missing fonts/lang folders
If someone makes a build of the game without copying the correct
folders, their version will have no translations, and display some text
wrong (like credits or button glyphs, or any custom levels that rely on
characters in the fonts being there). So I added a message in the
bottom left corner of the title screen to warn for that.
2023-09-20 16:20:24 -07:00
Dav999
da13f39f5d Fix "no language files found" title screen bug
If you've never set a language before (<lang_set> is not 1), then the
language screen will show up before the title screen. Selecting the
language will then make the title screen show up.

If no language files are present, the old logic for handling this was
to simply show the language screen at startup anyway, and let it
display the error message that language files are missing, as a warning
that the game is not packaged correctly. However, this logic has two
flaws:

- If the user has ever had language files and set a language before
  (in a VVVVVV on that computer), the warning element is gone because
  the language screen is not shown in that case - the game is simply in
  English

- If the user has never set a language before, and then goes to the
  language screen later via the menu, they will be sent to the title
  screen, even if they were in-game. The main menu will also be broken.

The new way is to not show the language screen at startup if language
files are missing, and to change the logic so that you will only be
sent to the title screen if you actually haven't seen the title screen
yet.

I will also add a proper warning that fonts or language files are
missing by adding a message in the bottom left corner (in place of the
MMMMMM installed message).
2023-09-20 16:20:24 -07:00
Dav999
365ac514a6 Sync Polish strings.xml, fix small space issue
strings.xml in Polish didn't yet contain the Steam Deck strings, and a
few limits changes.

Also, "Font: " was translated as "Czcionka:", missing the space. This
is fixed now.
2023-09-20 16:10:16 -07:00
Dav999
c04549541f Apply consistency fix to "FINAL LEVEL MASTERED" in Japanese 2023-09-20 15:58:38 -07:00
Dav999
683f66b4d1 Add Polish language files
One of the last languages for 2.4!
2023-09-20 15:40:50 -07:00
Dav999
b5d13d362f Add edits to Japanese translation by KabanFriends
Japanese is 100% complete now, woo!
2023-09-20 15:29:23 -07:00
Dav999
a78b248aaf Update Turkish translation to near-latest strings (99.9%) 2023-09-20 15:29:23 -07:00
Dav999
74a94ae1a8 Reference both cases for "Complete the game" in code
We had two separate cases for translators for this string (a
"TO UNLOCK:" one and a secret lab trophy one) but I forgot to use
the latter in the code, so both places in the game were using the
former. This is now fixed.
2023-09-20 15:29:23 -07:00
Dav999
f240fc517b Update Italian translation to near-latest strings (99.9%) 2023-09-20 15:29:23 -07:00
Dav999
afc2e72897 Update European Portuguese to near-latest strings (99.9%), fix issues
Also, bumped the limit for "Font: " from 14 to 15, the Portuguese
translation is 15 characters and it just fits...
2023-09-20 15:29:23 -07:00
Dav999
4c4a745c56 Update Ukrainian translation to near-latest strings (99.9%) 2023-09-20 15:29:23 -07:00
Dav999
ce8fdc3bbb Update Esperanto language files 2023-09-20 15:29:23 -07:00
Dav999
adf56bdb93 Update Esperanto and Dutch translations to latest strings (100%)
This includes the Steam Deck editor strings.
2023-09-20 15:29:23 -07:00
Dav999
83eaba5436 Add Traditional Chinese language files
And another new language!

This uses the same font as Simplified Chinese. As such, I changed the
displayed name of the font (in the level editor) from 简体中文 to 中文.
2023-09-20 15:29:23 -07:00
Dav999
52b5b47964 Update Brazilian Portuguese translation to near-latest strings (99.9%) 2023-09-20 15:29:23 -07:00
Dav999
1fd37c3276 Add Japanese language files
Another new language! And this is a very interesting one, since it's
based on Nicalis' translation for 3DS and Switch (with their go-ahead).
Which means I had to convert between two completely different
language file formats, which was some work, but it's totally worth it!

Naturally, there are a lot of missing strings, so a translator will
still need to fill in all the blanks (and maintain the translation for
new strings of course)
2023-09-20 15:29:23 -07:00
Dav999
fb0bae7293 Apply Japanese font edits by KabanFriends
- shifted certain "small" variants of katakanas by 1px (ェ, ュ)
- made the ツ and ヅ 1px taller
2023-09-20 15:29:23 -07:00
Dav999
b2b1e47e72 Add Japanese font (8x12)
The next commit will be the initial commit adding the Japanese
translation, so here's the font!

Specifically, it's k8x12L (2021-05-05), and it can be downloaded (in
non-VVVVVV format) from https://littlelimit.net/k8x12.htm
2023-09-20 15:29:23 -07:00
Dav999
c573eb4866 Update Welsh translation to near-latest strings (99.9%), fix issues 2023-09-20 15:29:23 -07:00
Dav999
63a1380595 Update Spanish to near-latest strings (99.9%), fix activity zones 2023-09-20 15:29:23 -07:00
Dav999
711b2e1bb5 Update Russian translation to near-latest strings (99.9%)
Also, the song names are now subtitled.
2023-09-20 15:29:23 -07:00
Dav999
b45d0d8d9d Update German translation to near-latest strings (99.9%), fix issues 2023-09-20 15:29:23 -07:00
Dav999
a200a762c3 Add Korean language files
New language! This uses the 10x10 font added in the previous commit.

This has some minor changes from the delivered version:
- Synced language files, and thus added max_local attributes
- Removed leftover Catalan strings in strings_plural (and reduced to
  just one form)
- Aligned terminal_finallevel
2023-09-20 15:29:23 -07:00
Dav999
68fd718ef8 Add Korean font (10x10)
The Korean localization has been delivered (next commit), so this
commit adds the font for it! The chosen font is Galmuri 9 (specifically
GalmuriMono9, version v2.38.7). It's licensed OFL, and since I had to
convert it to VVVVVV's bespoke font format and shift characters around,
I think we are now bundling a Modified Version of the font, and it has
to use the same license. Including it as font_ko_license.txt and
clearly indicating that the copyright came from the Original Version
should be more than enough.

This version is a bit more polished than the placeholder one posted on
Discord, namely (non-CJK) characters were shifted to fit into their
10x10 bounds as much as possible, and notably the , and . characters
were shifted 2 pixels to the right.
2023-09-20 15:29:23 -07:00
Dav999
5c05c1af48 Sync language files
This adds the following new strings from #993:
- The level editor is not currently supported on Steam Deck, as it
  requires a keyboard and mouse to use.
- The level editor is not currently supported on this device, as it
  requires a keyboard and mouse to use.

Unfortunately this means most languages won't be quite 100% anymore
for a bit, and updates come in which don't have this string yet.
But at least we can track it really well. In the next couple of
commits, when a language is updated with all new strings except for
these, I'll call them 99.9% instead of 100% (I did not get an actual
percentage).
2023-09-20 15:29:23 -07:00
Dav999
d741b3aa27 Fix double return when pressing Esc in editor font menu
The line that checked if the current menu is the font menu ended up
below the code that returned a menu, so this was an easy fix.

Closes #1017.
2023-09-13 23:58:34 -07:00
AllyTally
3f69b64a09 Fix yellow lab autotiling
A few autotile entries were missing.
2023-09-09 23:04:47 -07:00
Misa
8de93cb0f4 Axe VSync hint in favor of SDL_RenderSetVSync
Originally, we were using just the hint, but this didn't work well for
toggling VSync (see #831). Then I added SDL_RenderSetVSync to SDL, and
used that instead for toggling, but we were still setting the hint on
game startup.

Now, to keep things consistent, and just to make sure we don't get any
surprising behavior should things change in the future, this makes it so
game startup uses SDL_RenderSetVSync too.
2023-09-09 20:07:55 -07:00
Misa
1bf0d11c9e Fix regression: Linear filter persistence
This fixes #1013 by axing the use of SDL_HINT_RENDER_SCALE_QUALITY and
instead using SDL_SetTextureScaleMode.

The hint is unwieldy to use, and since #923, has resulted in a
regression where starting the game in filtered mode then switching to
nearest results in scaled textures still being filtered.

The proper solution is to use SDL_SetTextureScaleMode on the two
textures that are drawn to the final screen: gameTexture and
tempShakeTexture.
2023-09-09 20:07:49 -07:00
Misa
5467dbe3d8 Remove trailing whitespace in textboxcommsrelay 2023-09-09 19:59:36 -07:00
Ally
811d2bdcf6 Re-add fixed bool
Co-authored-by: Misa Elizabeth Kai <infoteddy@infoteddy.info>
2023-09-09 19:19:57 -07:00
Ally
a72966426b Apply review suggestion from InfoTeddy
Co-authored-by: Misa Elizabeth Kai <infoteddy@infoteddy.info>
2023-09-09 19:19:57 -07:00
AllyTally
bcc302bcc2 Fix bug with destroy(moving)/destroy(disappear)
This commit fixes an obscure bug with `destroy(moving)` and
`destroy(disappear)` where, when looping through entities, the code
doesn't actually check what the entity is before trying to destroy the
block underneath it.

To fix this, we just put the block-destroying code *inside* of the
check, instead of being outside of it.

I also fixed the code style because it was horrible.
2023-09-09 19:19:57 -07:00
AllyTally
5b2fbeb6b4 Fix gravity line edgeguides 2023-09-09 16:34:26 -07:00
Dav999
d84ce6b2e8 Add limits check to roomnames and roomnames_special
I kinda forgot about these, but they should be checked.
2023-09-09 16:29:38 -07:00
Ethan Lee
c881f621a3 Handle WiiU/Switch GameCube adapter product ID 2023-09-06 09:56:49 -04:00
Dav999
135934289e Fix setfont() changing font of fading out text boxes
Closes #925.

My fix here is to delay the font change until all fading-out textboxes
have disappeared. See it as adding a sort of `untilbars` or `untilfade`
for text box fadeout, into setfont.

This doesn't prevent every possible way to change the font of an
existing textbox, but you would need to use internal scripting to still
do it (and basically be doing it on purpose) - the problem in
simplified scripting when you simply do textbox-setfont-textbox is
gone.
2023-08-30 16:19:25 -07:00
Ethan Lee
68b6bd07ba Add 8BitDo wireless Xbox product ID to detector 2023-08-28 11:25:17 -04:00
Dav999
4e7bf86722 Change editor unsupported message to only appear when editor is selected
Showing the option on the "play a level" option feels to me as though
inexperienced players would think they're not supposed to open the
player levels, because the message says editor levels are unsupported,
right? But the message is only referring to the level editor, so in my
opinion, it's clearer to only show it there.
2023-08-26 22:53:46 -07:00
AllyTally
6549dc0113 Change lab autotiling 2023-08-25 09:55:17 -07:00
AllyTally
03ee60aea6 Update editor_disabled more often, remove -enable-editor 2023-08-25 09:50:27 -07:00
AllyTally
3ca28a5944 Add check for keyboard_is_active 2023-08-25 09:50:27 -07:00
AllyTally
7f03b00635 Remove unused Unused.h includes 2023-08-25 09:50:27 -07:00
AllyTally
8f3c587f7a Replace no level editor string 2023-08-25 09:50:27 -07:00
AllyTally
4830a6e8c1 Re-add accidentally removed address lines 2023-08-25 09:50:27 -07:00
AllyTally
c4db7ca51a Check SteamDeck in keyboard_is_available 2023-08-25 09:50:27 -07:00
AllyTally
a537492d9c Remove NO_EDITOR/NO_CUSTOM_LEVELS, disable editor on Steam Deck
This commit removes the `NO_EDITOR` and `NO_CUSTOM_LEVELS` defines,
which cleans up the code a lot, and they weren't really needed anyways.

This commit also disables the editor on the Steam Deck, and adds a
program argument to re-enable the editor, `-enable-editor`.
2023-08-25 09:50:27 -07:00
Misa
880c7ad8e6 Re-add main menu credits button in M&P
For some reason, the credits button was always specifically removed from
M&P builds. After some discussion with Terry Cavanagh on the VVVVVV
Discord server, we agreed that there was no reason this should be
removed. So, it's getting put back in.
2023-08-24 08:43:04 -07:00
Ethan Lee
c44e8d056a Fix glyphs for 8BitDo Ultimate Wired Controller for Xbox 2023-08-24 09:58:22 -04:00
AllyTally
c3b0a60aa4 Only spawn activity zone if the script exists 2023-08-23 20:16:52 -07:00
AllyTally
02ace10df9 options to spawn entity 21, and no activity zone 2023-08-23 20:16:52 -07:00
AllyTally
b7da899674 Fix UB where image loading fails in certain cases 2023-08-23 17:54:21 -07:00
AllyTally
4148234225 Change if to elseif and remove return 2023-08-23 09:23:10 -07:00
AllyTally
a8bf43adcc Recache textures when returning to ingame from map
Fixes #977.
2023-08-23 09:23:10 -07:00
AllyTally
6952c58878 Fix texture cache missing in certain situations after resizing the window 2023-08-23 09:23:10 -07:00
Ethan Lee
7b40a052ed Controller layout detection 2023-08-22 15:34:03 -04:00
Misa
8e3e29a14c Generalize stretch mode mouse scaling fix
This puts the code to fix mouse coordinates in stretch mode directly
inside KeyPoll::Poll, preventing the need for any other instances of
mouse coordinate usage to copy-paste code.
2023-08-17 19:57:54 -07:00
Dav999
100662612b Apply changes to Irish language files (mainly roomnames)
- Gravity lines are now called "Línte Imtharraingthe"
- There are no longer two rooms called "V"
- Missing character in Rear Vindow fixed
2023-08-12 15:52:58 -07:00
Dav999
6fd0b19175 Fix "+1 Rank!" possibly overlapping with time trial time in CJK font
If this text on the time trial results screen would overlap with the
time value, all rank labels will be displayed on the header line
instead ("TIME TAKEN:" etc). This works because the overlap with the
time most likely only happens with CJK fonts (where the time will be
very wide because of the font size) while strings like "TIME TAKEN"
take up very little space due to only needing 4 characters or so for
the same information.
2023-08-12 15:52:58 -07:00
Dav999
e82e1ee236 Update Chinese with new strings
Also realigned the dimensional stability generator terminal, and
reduced the plural forms to just one.
2023-08-12 15:52:58 -07:00
Dav999
1b9ce57622 Add Irish translation
This is up-to-date with the newest strings.
2023-08-12 15:52:58 -07:00
Dav999
b9ef6bfc2f Fix iflang, loadtext and setfont not working with uppercase
For example, pt_PT/pt_BR needs to work as well, and now it does.
2023-08-12 15:52:58 -07:00
Dav999
8d8a5eb605 Make some minor improvements to Dutch translation
Just a few changes mainly to make some things sound more natural.
2023-08-12 15:52:58 -07:00
Dav999
3d7e9a47dd Fix various CJK positioning problems
- ERROR/WARNING screen title was overlapping with message
- Crewmate screen names and rescued statuses were overlapping with each
  other
- Textboxes on Level Complete screen were overlapping with each other
  and the crewmate was not vertically centered in the box
- Some strings were running into each other in flip mode, instead of
  being moved out of each other (PR_CJK_HIGH and PR_CJK_LOW worked the
  wrong way around because of FLIP macros being applied to Y coords)
- In-game esc menu was "bouncy" with selected menu options because of a
  hardcoded 16 pixel offset
- Bindings in the gamepad menu were overlapping with each other
- Some Super Gravitron "Best Time" labels and values were a little too
  close
2023-08-12 15:52:58 -07:00
Dav999
176555c448 Add Simplified Chinese language files
Another new language! And it's a special one, because this is the first
language that uses a non-8x8 font (see previous commit)
2023-08-12 15:52:58 -07:00
Dav999
5b16bde8a7 Add Simplified Chinese font
This will be needed for the Simplified Chinese translation, of which
the first version has just been delivered!

This is the first language with a font bigger than 8x8 (this is 12x12),
so it might be a little rough in some places. Most of the game is
already prepared for it, though!

The only changes I made from the previous version (which was uploaded
on Discord a few times and also sent to the translator) was the …
character - it's often used twice in a row, and it was a little uneven
(looking like -   -  - -   -  - instead of -  -  -  -  -  -); and the
semicolon, which was missing some pixels.
2023-08-12 15:52:58 -07:00
Dav999
37f367af85 Update Catalan language files to latest version (100%) 2023-07-01 20:08:26 -07:00
Dav999
b8dc4a0103 Accommodate for some limit breaks in Welsh
Two changes:
- The labels on the Game Complete! screen for number of trinkets/deaths
  /time etc have been moved two pixels to the right, and had their
  limits increased by 1 character
- The inaccuate limit for "quit to main menu" has been increased
2023-07-01 20:08:26 -07:00
Dav999
9335421783 Made technical fixes to several translations
These are errors and issues that have been reported, but are fixable by
us without needing to involve the translator in the fix, without too
much risk of accidentally breaking grammar rules.

The full list of fixes:
- Fixed some menus going offscreen by removing unneeded words (I'm
  fairly confident after some cross-referencing and research) in
  Portuguese BR, Portuguese PT, Spanish, and French
- Set 0 to singular in numbers.xml in Portuguese BR and French
- Removed the ** from dimensional stability generator to make it not go
  offscreen, and aligned the text better, in Portuguese BR and Spanish
- Fixed some small casing and spacing errors in Portuguese BR, French
  and Welsh. Think of misplaced spaces or sentences starting with a
  lowercase letter
- Fixed a limit break in Spanish (the menu button already drops the
  word "de" in "retraso de la entrada", so the title can too, right?)
- Corrected some typos in French and German (je continuer->je continue,
  9: Finde->9: Feinde and NENÜ->MENU)
- Fixed spacing and alignment in teletype terminals in Welsh (like the
  dimensional stability generator)
2023-07-01 20:08:26 -07:00
Dav999
2667a8a14e Add warning to volunteer translators to README-translators.txt
923efe54d6 added a note to the PR
template, but the best place is probably in the translators readme.
Hopefully this will make sure we no longer get people eager to start
a translation because nobody else had started one yet, and then have to
be disappointed with a reply from us saying we can't accept voluntary
translation contributions.
2023-07-01 20:08:26 -07:00
Dav999
9479a34904 Add Welsh language files
Another new language! It's based off of the old translator pack so
it'll need to be updated later. This commit also includes some fixes
to the originally submitted version, mainly:

- "2.0" and ".99" were broken by excel(?), now fixed
- Removed traces from extraneous rows and columns
- Small human errors

This includes the update received 2023-06-09.
2023-07-01 20:08:26 -07:00
AllyTally
fd4232e9fd Make gravity lines render when screen effects are off 2023-06-15 10:44:40 -07:00
Misa
c1a25aa4c2 CLI: Allow no music to be played if save pos used
If you provided any one of -playx, -playy, -playrx, -playry, -playgc, or
-playmusic in command-line arguments for command-line playtesting, then
the game would always try to play music, even if you passed a negative
-playmusic. This wouldn't do anything in that case, unless you had
MMMMMM installed, in which case it would play MMMMMM track 15
(Predestined Fate Final Level) due to the legacy wraparound bug.

To fix this, only play music if the track provided is greater than -1.
Additionally, to prevent it from playing Path Complete by default if you
specify any of the other save position arguments but n ot -playmusic,
it's now initialized to -1 instead of 0.
2023-06-10 11:41:32 -07:00
AllyTally
a6ff75d32e Remove unused drawing overloads 2023-06-08 15:47:39 -07:00
AllyTally
254c46b846 Fix missing parentheses 2023-06-08 15:47:39 -07:00
AllyTally
aa8e731eb9 Fix a couple issues 2023-06-08 15:47:39 -07:00
AllyTally
b533731108 More misc cleanup 2023-06-08 15:47:39 -07:00
AllyTally
8b1dcecd5a Replace drawrect with draw_rect
Turns out `graphics.drawrect` exists. Well, not anymore!
This was another function from before the renderer rewrite which tried
to draw a rectangle by using four filled rectangles. We can draw
outline rectangles properly now, so let's make sure everywhere does it!
2023-06-08 15:47:39 -07:00
AllyTally
d1b9f4f410 Some formatting fixes 2023-06-08 15:47:39 -07:00
AllyTally
d93d773a8a Remove line_rect and prect
`prect` just wasn't needed as it was used in one place, and
`line_rect` isn't used anymore.
2023-06-08 15:47:39 -07:00
AllyTally
81ad7ed9d6 Clean up background drawing code
As #974 states, the lab background only ever uses the first generated
value from `backboxint`, so let's change it to a normal variable
instead of an array. Also, stars don't need their width/height set to
2 constantly... they never change in the first place, Terry!
2023-06-08 15:47:39 -07:00
AllyTally
5089bc373e Add more draw functions, make less code use rectangles
Some code still used rectangles to draw things like lines and pixels,
so this commit adds more draw functions to support drawing lines and
pixels without directly using the renderer.

Aside from making generated minimaps draw points instead of 1x1
rectangles, this commit also batches the point drawing for an
additional speed increase.
2023-06-08 15:47:39 -07:00
Misa
dc9c51dbf3 Implement haltedsong
This fixes a bug where if a track was resumed, pausing it by unfocusing
the window (if enabled, of course) would not resume it after refocusing
the window.

This happens because resuming the music doesn't change currentsong back
from -1, and the window refocusing code checks that currentsong isn't -1
before resuming music.

haltedsong is only used when resuming music. It is set back to -1 when
resuming music or when playing a new track.
2023-06-08 15:38:26 -07:00
AllyTally
e36c2764fb Add separate tilecol max for direct mode
This commit readds the ability to select the rainbow BG in lab tileset
in direct mode.
2023-06-06 21:46:19 -07:00
AllyTally
17e0d6c330 Don't trigger UB with autotile type none 2023-06-06 21:46:19 -07:00
AllyTally
a37cb4aa5f Rewrite autotiling completely
Autotiling was a mess of functions and if chains and switch statements.
This commit makes autotiling better by assigning each direction to one
bit in a byte, giving each different combination its own value. This
value is then fed into a lookup table to give fine control on which
tiles get placed where.

The lab tileset can now use the single tiles which were before unused
in the autotiler, and the warp zone's background tool now places the
fill used in the main game.
2023-06-06 21:46:19 -07:00
Dav999
84a26986e6 Re-add chars 0x00 - 0x1F to the font
- Some levels used chars < 0x20 as non-collapsible spaces, those would
  now show up as [?]
- I recently found out how making characters < 0x20 6 pixels wide
  doesn't work if they're missing from the font altogether

Therefore, the font now starts at 0x00 again instead of 0x20, like it
used to.

Arguably it was an advantage that the game would look extremely messed
up if you made a mistake with the fonts. In particular, a common
mistake could be to copy the new Unicode font.png, but forget to copy
the corresponding font.txt. However, 2.3 didn't come with the unicode
font, 2.4 will, so it'll be a lot less common for people to need to
manually copy the font. And if they do, it's probably for their own
level, and they have something in mind for the font, and if it doesn't
work they'll know fast enough when whatever they're planning doesn't
work (and it would only affect their own level's text, not any menus).
2023-06-05 19:42:29 -07:00
Reese Rivers
d7fbab9198 Update Esperanto strings to latest version (100%) 2023-06-05 19:42:29 -07:00
Dav999
dde9cbf4c3 Update Dutch language files to latest version (100%) 2023-06-05 19:42:29 -07:00
Dav999
bd2bea5640 Add Ukrainian language files
New language! It's still based off the old translator pack so the
newest strings haven't been translated yet, but the language files are
synced and we still need to get these updated in most other languages
either way.

This does include the update delivered on 2023-05-24.
2023-06-05 19:42:29 -07:00
Dav999
8093874e84 Reword "we forgot to print an error message" error message
It now says "we forgot the error message" to be less technical.
2023-06-05 19:42:29 -07:00
Reese Rivers
a21a4c3c00 Fixed minor translation regression for Esperanto
A little while ago the term "AGOKLAVO" (action-key) was chosen to
replace the older "AGBUTONO" (action-button). However, in a recent
language update, I mistakenly used the older term in a new string.
This has been fixed.

Also note that it's written in the accusative case for this string
(with an "N" suffixed) since it is always used as the object of the
sentence where it appears ("Premu AGOKLAVON..." = "Press ACTION...").
2023-06-05 19:42:29 -07:00
Dav999
dfebb5c82c Update Catalan language files to more recent version
Some more strings have already been added since the update, but it's
easy to track.
2023-06-05 19:42:29 -07:00
Misa
cd713ebc71 Fix regression: Showing teles in customloadquick
This fixes a regression where main game teleporter icons (which would be
target icons if flag 12 was on) would be rendered on the minimap after
loading from a custom quicksave.

This is because this was always enabled when loading from a custom
quicksave, but the game didn't start rendering them until PR #898, which
de-duplicated the minimap rendering code.

The best fix here is to just not enable the teleporters when loading
from custom quicksaves.
2023-06-05 19:21:07 -07:00
Misa
404204172c Fix macOS not liking unconsequential fallthroughs
This is technically a fallthrough, but it is literally inconsequential.
Apparently, though, Apple Clang hates it.
2023-06-05 18:02:24 -07:00
Misa
8e3ec9aeef Use enums for time trial indexes
This adds an anonymous enum for time trial indexes (e.g. the bestrank,
bestlives, etc. arrays and timetriallevel), and replaces all integer
literals with them.

Just like the unlock arrays, these are indexes to an array in XML save
files, so the numbers matter, and therefore should not use strict
typechecking.
2023-06-05 17:57:23 -07:00
Misa
e931f2a4a1 Use enums for unlock, unlocknotify, unlocknum
This adds an anonymous enum for the unlock and unlocknotify arrays and
unlocknum function, and replaces all integer literals with them.

This is not named and thus cannot be used for strict typechecking
because these are actually indexes into an array in XML save files, so
the numbers themselves matter a lot.
2023-06-05 17:57:23 -07:00
Misa
14d034e4c6 Use enums for swngame
This replaces the swngame int variable with a named enum and enforces
strict typechecking on it.

Strict typechecking is okay here as the swngame variable is not part of
the API surface of the game in any way and is completely internal.

And just to make things clear, I've added a SWN_NONE enum to use for
initialization, because previously it was being initialized to 0, even
though 0 was the Gravitron.
2023-06-05 17:57:23 -07:00
Misa
414b0647aa Correct orientation of Game Saved clock in Flip Mode
The clock on the Game Saved quicksave screen has always been upside-down
in Flip Mode. And technically, the trinket was too, but this was
unnoticeable because the default trinket sprite is symmetrical.

To fix this, draw flipsprites.png if these sprites are being drawn in
Flip Mode instead of sprites.png.
2023-06-05 17:57:23 -07:00
Misa
4ea26617b8 Initialize currentsong to -1
There's not any ill effects of it being initialized to 0 that I am aware
of (because in most cases, it either gets overwritten anyways or there
isn't a track playing in the first place), but it shouldn't be 0,
because that's Path Complete, so fixing this just in case.
2023-06-05 17:57:23 -07:00
Misa
4058975ce9 Use enums for sound effects
This adds an anonymous enum for sound effects and replaces all calls to
music.playef that use integer literals.

This is not a named enum (that can be used for strict typechecking)
because sound effect IDs are essentially part of the API of the game -
many custom levels use these numbers. This is just to make the source
code more readable without needing a comment to denote what number is
what sound.
2023-06-05 17:57:23 -07:00