1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-07-02 09:28:31 +02:00
Commit Graph

2838 Commits

Author SHA1 Message Date
Misa
84daa8fbc2 Call resize() before formatting text in cutscene
This fixes a problem where it would incorrectly format the text because
the width of the text box hadn't updated yet.

This fixes a bug where the jukebox informational terminal would
initially be created with too much padding in CJK languages, pushing the
text box offscreen, even though switching languages while the text box
is already open fixes it.
2024-02-02 18:57:24 -08:00
Misa
3de2c543a5 Move all other text boxes to new system
These include the room name translator text boxes (which aren't
translated) and the foundlab and foundlab2 text boxes.
2024-02-02 18:57:24 -08:00
Misa
b14ca5e366 Move Game Complete sequence to new text box system
In order to be able to retranslate the game time text box in particular,
I had to create new variables to bake the saved time, since the existing
savetime variable is just an std::string. From there, the saved time can
be retranslated on-the-fly.
2024-02-02 18:57:24 -08:00
Misa
7088858957 Add textbox indexes, update trinket/crew textboxes
This adds an attribute to textboxclass to allow a text box to keep an
index that references another text box inside the graphics.textboxes
std::vector.

This is needed because the second text box of a "You have found a
shiny trinket!" or "You have found a lost crewmate!" pair of text boxes
explicitly relies on the height of the first text box. With this, I have
moved those text boxes over to the new text box translation system.

Since the update order now matters, I added a comment to
recomputetextboxes() that clarifies that the text boxes must be updated
in linear order, starting from 0.
2024-02-02 18:57:24 -08:00
Misa
668d0c744d Add assert for giving func if it won't be used
This adds an assert to Graphics::textboxtranslate() to make sure that
callers don't accidentally provide a function when specifying a
translation type that isn't TEXTTRANSLATE_FUNCTION, because in that case
the function won't be used, and then it will make them scratch their
heads wondering why their function won't work.

And yes, I am stupid enough to blindly type TEXTTRANSLATE_CUTSCENE when
I meant to type TEXTTRANSLATE_FUNCTION. This assert has already caught
one of my mistakes. :)
2024-02-02 18:57:24 -08:00
Misa
76483f96ef Move Comms Relay text boxes to new system
These seemed annoying to do without copy-pasting, because I didn't want
to make a separate function for every single dialogue, and I didn't know
how to pass through the English text, until I realized that I can just
use the existing original.lines vector in the text box to store the
English text. After that, getting it translated on-the-fly isn't too
bad.
2024-02-02 18:57:24 -08:00
Misa
82150fd3a9 Remove unnecessary calls to resize()
Just a small optimization.

For example, consider the calls in adjust(). After the first resize(),
the lines after only change the x-position and y-position of the text
box and depend on the x-position, y-position, width, and height.
However, resize() only changes the width and height if the contents of
the text box change, which after the first call, they don't. So remove
the second call to resize(), because it's completely unnecessary.

By similar reasoning, the second calls to resize() in centerx() and
centery() are unnecessary too.
2024-02-02 18:57:24 -08:00
Misa
28df0148b1 Transfer adjust call to applyposition
This transfers the responsibility of the adjust() call to
applyposition().

This is because cutscene text boxes (TEXTTRANSLATE_CUTSCENE) will have
adjust() called, but all other text boxes won't. And I can't place the
adjust() call inside applyposition(), because adjust() also calls
applyposition(), and that leads to an infinite loop which leads to a
stack overflow, so I had to remove the applyposition() call from
adjust(), and replace the other existing call to
Graphics::textboxadjust() with Graphics::textboxapplyposition(), and
then remove Graphics::textboxadjust() function because it's no longer
used.
2024-02-02 18:57:24 -08:00
Misa
3ef089ed3d Save context of untranslated text boxes
Several text boxes in the gamestate system are unused and are
untranslated. To prevent them from becoming empty when retranslating
text boxes, we need to save their original context by calling
graphics.textboxoriginalcontextauto() (which is just
graphics.textboxoriginalcontext() but automatically saving whatever is
already in the text box at the time).
2024-02-02 18:57:24 -08:00
Misa
d989c232af Recompute text boxes in Flip Mode
With the new system of retranslating text boxes on-the-fly, this also
enables us to retranslate them whenever the player toggles Flip Mode.
This is relevant because the Intermission 1 instructional text boxes
refer to a floor when Flip Mode is off, but when it is on, it talks
about the ceiling.
2024-02-02 18:57:24 -08:00
Misa
94b9722b7b Split textwraps, move more textboxes to new system
This splits the text wrapping functionality of Graphics::textboxwrap to
a new function textboxclass::wrap, and with this new function, some more
text boxes can be moved to the new TEXTTRANSLATE_FUNCTION system.
Namely, Game Saved (specifically the game failing to save text box),
instructional text boxes in Space Station 1, and the Intermission 1
instructional text boxes.
2024-02-02 18:57:24 -08:00
Misa
de00dd4031 Save special text box state using functions
This adds a way to save the text box state of the crew remaining, ACTION
prompt, etc. text boxes by just letting there be a function that is
called to retranslate the text box when needed.

It also adds a way to ignore translating a text box and to leave it
alone, in case there's actually no text in the text box, which is the
case with Level Complete and Game Complete.

Both ways are now in an enum, TextboxTranslate. The former is
TEXTTRANSLATE_FUNCTION and the latter is TEXTTRANSLATE_NONE. The
existing way of translating text boxes became TEXTTRANSLATE_CUTSCENE,
since it's only used for cutscene scripts.

Here's a quick guide to the three ways of creating a text box now.

- TEXTTRANSLATE_NONE: You must call
  graphics.textboxoriginalcontextauto() to save the existing text to the
  original context of the text box, as that will be copied back to the
  text box after the text of the text box is updated due to not having a
  translation.
- TEXTTRANSLATE_CUTSCENE: Translates the text from cutscenes.xml, and
  overrides the spacing (padding and text centering). Shouldn't need to
  be used outside of scriptclass.
- TEXTTRANSLATE_FUNCTION: You must pass in a function that takes in a
  single parameter, a pointer to the textboxclass object to be modified.
  General advice when retranslating text is to clear the `lines` vector
  and then push_back the retranslated text. The function is also solely
  responsible for spacing.

In most cases, you will also need to call
graphics.textboxapplyposition() or graphics.textboxadjust() afterwards.
(Some text boxes shouldn't use graphics.textboxadjust() as they are
within the 10-pixel inner border around the screen that
textboxclass::adjust tries to push the text box out of.)

This commit doesn't fix every text box just yet, though. But it fixes
the Level Complete, Game Complete, crew remaining, and ACTION prompt
text boxes, for a start.
2024-02-02 18:57:24 -08:00
Misa
0ea0b8e00b Save text box centering state
This is another piece of state that needs to be kept and re-played when
switching language, because a different language could change the
dimensions of the text box, which affects how it's centered.

Also, to make sure that crewmate positions override any text centering,
the scriptclass variables textx and texty should be reset in the
position and customposition commands.
2024-02-02 18:57:24 -08:00
Misa
e8a231f2e2 Fix translating text box ignoring line limit
Originally I did a straight deep copy of the original lines, but this
ignores the limit of either 12 or 26 lines in a text box. So we defer to
addline() which will enforce the limit accordingly, just like it would
do with the original text box.
2024-02-02 18:57:24 -08:00
Misa
8b03fbd9f4 Save textbox state, allow lang switches w/ textbox
This allows switching languages while a text box is on screen by saving
the necessary state for a text box to be retranslated when the language
is switched.

This saves the state of the position and direction of the crewmate that
the text box position is based off of (if applicable), and the text
case of the text box, the script name of the script, and the original
(English) lines of the text box. I did not explicitly label the original
lines as English lines except in a main game context, because
technically, custom levels could have original lines in a different
language.

Unfortunately, this doesn't work for every text box in the game.
Notably, the Level Complete, Game Complete, number of crewmates
remaining, trinket collection, Intermission 1 guides, etc. text boxes
are special and require further fixes, but that will be coming in later
commits.
2024-02-02 18:57:24 -08:00
Misa
3b0757bd82 Add bounds check to setlinegap
This is for consistency with all other functions dealing with the latest
created text box. There are several cases in custom levels where these
functions can be called even though there are no text boxes on screen.
2024-02-02 15:00:44 -08:00
Misa
2b476bb4c1 Remove trailing whitespace on getlinegap decl 2024-02-02 14:59:52 -08:00
TerryCavanagh
69684994be added translation category support to ending credits also 2024-02-02 18:24:49 +01:00
TerryCavanagh
5f9e326b67 Added proxy string for "Editing and LQA"
I checked the pt_BR one with our translators, so that one's correct
2024-02-02 18:15:45 +01:00
TerryCavanagh
62ab594976 added Ivan Lopes and Lucas Nunes to credits 2024-02-02 17:37:23 +01:00
TerryCavanagh
9986696604 updated pt_BR translation with new proofread version 2024-02-02 16:04:24 +01:00
TerryCavanagh
2afcf85ad6 added placeholder translations for the three Spanish variants in the credits
these are proxy strings for now, will need to be replaced properly later
2024-02-01 20:25:00 +01:00
TerryCavanagh
1db33d9cb8 added Guido Di Carlo and LocQuest to credits 2024-02-01 20:23:39 +01:00
TerryCavanagh
8b73a38ed2 don't apply linegap to certain special textboxes
level complete, game complete and "You have rescued a crew member!"
2024-02-01 20:03:17 +01:00
TerryCavanagh
cc1528aacc add a one pixel gap between each line in textboxes (main game only) 2024-02-01 20:03:17 +01:00
TerryCavanagh
319ed3a22e renamed es_AR and es_419 folders 2024-02-01 11:33:51 +01:00
TerryCavanagh
b1f378de60 Added Argentine Spanish localisation 2024-01-31 18:37:31 +01:00
TerryCavanagh
a6b8b90f3c Added Latin American Spanish localisation 2024-01-31 18:36:57 +01:00
Dav999
448c4a5514 Apply updates to Arabic language files
This update was delivered earlier today!
2024-01-25 16:16:00 -08:00
Misa
1c6cfcd2a5 Remove 'all' argument from setrtl
It doesn't make sense to change the alignment of all existing text boxes
when you're not otherwise able to mutate the text. Whereas the point of
the 'all' argument in setfont is to be able to animate text boxes using
fonts.
2024-01-23 16:53:01 -08:00
Misa
a9f0d81804 Properly fix setfont/setrtl in between text boxes
There used to be a problem with the setfont and setrtl script commands.
Namely, if you used them in between text boxes naïvely, without any
careful thought, then the fading out text box would suddenly gain the
font of the new one. A kludge solution to this was implemented by simply
blocking the script until the existing text box faded out before
switching the font or RTL, and shipped for 2.4.0.

However, a better solution is to simply bake the font flags in to the
text box, so that way, if the level font switches, then the text box
keeps its font.

This is only for custom levels, because in the main game, the font in a
text box needs to be able to change depending on language. But it seems
like custom level translations weren't much on the roadmap, and so even
the existing hack didn't support changing the font based on translation
(even though translation of custom level cutscenes is supported). So
baking the font flags into the text box here doesn't make things any
worse.

It also makes things better, arguably, by allowing multiple text boxes
to exist on screen at once with different fonts.

Maybe in the future we'll need a flag that specifies that the font
should change depending on language if a translation in said language
exists for the text box, or something like that.

For people that want to override the fonts of every existing text box on
screen, you can specify "all" as the second parameter of setfont or
setrtl to do so.
2024-01-23 15:33:38 -08:00
Misa
ea8633514d Fix using int for mode indicator flags
For consistency. Print flags are supposed to be uint32_t.
2024-01-23 14:29:03 -08:00
Misa
8d2a0c2457 Allow overriding state lock in glitchrunner <= 2.2
This fixes a regression where attempting to warp to ship with a trinket
text box open in glitchrunner 2.0, and then incrementing the gamestate
afterwards, would result in a softlock. This is a speedrunning strat
that speedrunners use.

The state lock wasn't ever intended to remove any strats or anything,
just fix warping to ship under normal circumstances. So it's okay to
re-enable interrupting the state by having glitchrunner enabled.

This bug was reported by mohoc in the VVVVVV Speedrunning Discord
server.
2024-01-23 13:55:21 -08:00
Dav999
7cd1cae55a Rename capitalized no death mode in Dutch
Just like I changed the number één to be capitalized as Eén instead
of Één (due to this being a special case), I forgot to do the same
for the onelifemode.
2024-01-22 16:31:15 -08:00
Dav999
e7267c6eb6 Add missing blank lines in Irish congrats boxes
The three "Congratulations!" boxes which were supposed to have a blank
line in them didn't.
2024-01-22 16:31:15 -08:00
Dav999
5345d46c3d Fix a few spacing problems in Welsh
This involves a couple of dialog boxes ("Congratulations!" and the
jukebox) which were supposed to have blank lines, but they weren't
in the translation.
2024-01-22 16:31:15 -08:00
Dav999
1bc3e8e666 Fix Esperanto [button?] in Violet cutscene 2024-01-22 16:31:15 -08:00
Alberto Mardegan
b5abc3956c Fix loading of PNG resources on big-endian machines
LodePNG always loads PNG in big-endian RGBA format. For this reason,
when loading PNG files VVVVVV was specifying the format as ABGR and the
conversion would then be performed by SDL. However, then running on
big-endian machines, this conversion should not be performed at all, and
the surface format should then be set to RGBA.
2024-01-22 10:48:38 -05:00
Misa
32e6ab6ecd README: Add step for compiling
We recently had a user come in the VVVVVV Discord not knowing that,
after running CMake, you then need to compile the game in a separate
step. This clarifies the instructions.
2024-01-22 00:18:20 -08:00
Misa
2f217dad56 Fix segfault: unwordwrap string w/ 2 start \ns
This fixes a segmentation fault caused by an out-of-bounds indexing
caused by an attempt to unwordwrap a string that starts with two
newlines.

The problem here is that in the branch of the function
string_unwordwrap() where `consecutive_newlines == 1`, the function does
not check that the string `result` isn't empty before attempting to
index `result.size()-1`. If `result` is empty, then `result.size()` is
0, and `result.size()-1` becomes -1, and indexing a string at position
-1 is always undefined behavior.

Funnily enough, a similar indexing happens just a few lines down, but
this time, there is a check to make sure that the string isn't empty
first. I'm unsure of how Dav999 forgot that check a few lines earlier.

This situation can happen in practice, with custom level localizations.
I made a level with a filename of testloc.vvvvvv and created a file at
lang/fr/levels/testloc/custom_cutscenes.xml with the following content:

    <?xml version="1.0" encoding="UTF-8"?>
    <cutscenes>
        <cutscene id="test" explanation="">
            <dialogue speaker="cyan" english="This is text..." translation="blarg"/>
        </cutscene>
    </cutscenes>

Then I switched to French, created a script named `test`, and created a
text box that started with two newlines (so in total, the text box must
be at least 3 lines in length). Running the script triggers the segfault
when the text box is created. (Well, technically, on my machine, it
triggers an assertion fail in libstdc++ and aborts, but that's basically
the same thing.)

To fix this while still preserving the exact amount of newlines, if
`result` is empty, we add a newline instead of attempting to index the
string.
2024-01-20 17:52:17 -08:00
Dav999
ebd4fa8ad8 Clean up outdated strings
These strings had been replaced over time and the original versions
marked ***OUTDATED*** to allow for the original wordings to be reused
by the translators who had only translated the original ones.
(See lang/README-programmers.txt.)

Now, these strings have all been updated in every language, so it's
time to clean them up!
2024-01-19 16:31:39 -08:00
Dav999
403136df46 Translate new strings to Dutch 2024-01-19 16:31:39 -08:00
Dav999
5a91d09a20 Add in-game mode indications (#1096) to language files
These were not in the English or any other language files. They should
be though, so that they can be translated and generally kept track of.
These aren't urgent either, since we have proxy strings that are used
if these are untranslated.
2024-01-19 16:31:39 -08:00
Dav999
3849ed7a24 Sync language files
This hasn't been done since before we got some deliveries for 2.4,
so there are a few languages which added apostrophes as ' instead of
&apos; in the XML (which is not wrong, but it gives diff noise whenever
there's a sync since VVVVVV writes them back as &apos;...)

Also, we never synced "[Press {button} to toggle gameplay]" across
language files (now two strings with unfreeze/freeze), but that was
also a pretty last-minute string as far as I remember. Arabic did have
it because that language was added after the string was added, so it
got copied from English. I don't think this one is that urgent to
translate into every language for 2.4.1 since it's pretty well hidden
for most people, and it's surrounded by things that have to be English,
so it's as if it's supposed to be like that. Let's just include these
with whatever the next batch of strings is.
2024-01-19 16:31:39 -08:00
Dav999
60fd0bc0c2 Replace [Press {button} to toggle gameplay] by freeze/unfreeze
This is both easier for translators ("toggle" can be an annoying word)
and is useful in general because you can tell if gameplay is frozen
without having to have anything in the room that should normally be
moving but isn't.

I didn't follow the rule in lang/README-programmers.txt to keep the
original string around as ***OUTDATED*** in this case, since I know
only Arabic has it translated - we can just tell the Arabic translators
on Discord that this string was replaced.
2024-01-19 16:31:39 -08:00
Ethan Lee
afbcb3f867 Add support for GameCube glyphs.
It's kind of a bummer that L/R don't actually do anything... we should add ZL/ZR support at some point.

Also note that GameCube binds X to 'back' rather than B, this will be fixed by SDL_ActionSet for 2.5.
2024-01-18 00:10:20 -05:00
TerryCavanagh
ceaaea1597 fix Arabic credits
Eternal Dream Arabization team name was missing from the main credits page
2024-01-17 15:59:16 +01:00
Dav999
d299b42ee8 Replace Chinese font
The original Chinese font (which we call "the Indienova font") was
received from the Chinese translators directly, and didn't come with
any license or copyright information other than that it was made by
Indienova. Questions have now been raised about the actual origin of
the characters in the font, and while we do have confirmation from the
translators that we're probably in the clear, they did suggest another
font for us to use, which we're switching to to be sure.

Some background information: the ideal font would probably be Ark Pixel
(https://github.com/TakWolf/ark-pixel-font/), but this font is not
finished yet. Therefore, the creators of Ark Pixel have made a font
that can be used as a placeholder to use in the meantime, Fusion Pixel
(https://github.com/TakWolf/fusion-pixel-font), which combines some
other fonts together in order to get full coverage. This is the font
we're now switching to.

It's not _that_ simple though - the ASCII part of Fusion Pixel is kinda
bad for us using it as a monospaced font. Normally I just replace the
ASCII set by the fullwidth characters, but in this font they were
almost entirely the same. So I instead picked the fullwidth characters
from Galmuri 12px, which is one of the "fusioned" fonts. Interestingly,
we happen to also use the 10px version of this as our Korean font, and
I like these Latin letters, so yay.

I also made the call to split the Chinese font into separate variants
for Simplified and Traditional Chinese. I was aware of the problem with
the Han Unification, but the Traditional Chinese translator said the
Indienova font also contains all the Traditional Chinese characters,
and they proofread the translation, so it was probably fine. Apparently
the difference between Simplified and Traditional Chinese variants of
the same characters are not that big, and it's acceptable. But
Fusion Pixel gives us separate versions of the font for Simplified and
Traditional Chinese, so this is a chance to get it right. Just kidding,
Fusion Pixel's Traditional variant switches out many characters that
were shared between Simplified and Traditional Chinese to Japanese
variants which are noticeably different. So it would be better to keep
using the SC font for TC, just like the Indienova font is SC only.
However:  Ark Pixel does have a version with correct characters for
Traditional Chinese! So for the TC version of our font, I just took all
Chinese characters from the TC version of Ark Pixel where available.
That way, all characters I checked have changed to TC variants
correctly.
2024-01-16 16:54:28 -08:00
Dav999
52b099f7d0 Replace U+2013 (–) by standard dash in Ukrainian
The Ukrainian strings.xml turns out to have two en-dashes which are
not in the font. This commit replaces them with standard dashes.
2024-01-16 16:46:24 -08:00
TerryCavanagh
9c656fd5e1 Added SnDream to contributors
for this pull request: https://github.com/TerryCavanagh/VVVVVV/pull/1119
2024-01-16 12:05:45 +01:00
TerryCavanagh
82576c73ca Copied new localised sprites to zh_TW 2024-01-16 12:05:45 +01:00
sndream
f70eb0db86 Simplified Chinese graphics fine-tuning 2024-01-16 12:05:45 +01:00
TerryCavanagh
8dd5414e8d minor fixes for Welsh
as suggested from player feedback, confirmed by translator
2024-01-14 00:35:34 +01:00
TerryCavanagh
4acc96e707 added Space-G to contributors
for this pull request: https://github.com/TerryCavanagh/VVVVVV/pull/1114
2024-01-13 15:47:09 +01:00
Space-G
47561d44f0 Fixes some pt_BR mistranslations noted by zaratustra on Cohost 2024-01-13 15:44:46 +01:00
Space-G
e51ae2a3c5 Fixes a handful of pt_BR mistranslations 2024-01-13 15:44:46 +01:00
David Galiev
3483893a70 Add Russian translations for jukebox songs in the "NEXT UNLOCK" section 2024-01-13 15:39:03 +01:00
David Galiev
c550deca4d Fix Russian translation for Pushing Onwards editor string
This string is mistakenly using the translation for "Potential for Anything" instead
2024-01-13 15:39:03 +01:00
Misa
c0faa856e8 Japanese: Fix wrong abbreviation period in credit
"Nicalis. Inc" is incorrect, and it should be "Nicalis Inc.". The "Inc."
stands for "Incorporated".
2024-01-12 01:06:24 -08:00
Misa
84322755f2 Remove number translations that are numerals
This removes every single translation of a wordy number that just
replaces it with the numeral.

This is because the documentation in README-translators.txt specifically
says

    It's also possible to leave the translations for all the numbers
    empty. In that case, numeric forms will always be used.

However, the translators for Japanese, Korean, and European Portuguese
clearly either didn't read this, or forgot to do so.

There is a very good reason to leave them alone if you want numerals;
namely that if you fill them in, you are prone to making errors. Like,
say, Japanese translating "Twelve" as "23", which is exactly what
happened. By blanking every translation, that error is fixed.
2024-01-12 01:02:55 -08:00
TerryCavanagh
f27374d92e typo in european portuguese 2024-01-11 11:22:46 +01:00
mothbeanie
7ff2e818cd Revert text image fading
This reverts the following commits:

- 29f05c41b1
- f1bf1f683c
- a7b22919ae
- 2ed1aac67d

Recently, text images were changed to fade in with textboxes, where
before they previously appeared after the fade. This created a charming
effect where the images would appear to "load in" once the textbox
finishes fading in. This behavior really complements the retro
aesthetic the game is going for. Changing it to a fade is a needless
change in direction, as it was not a bug in the first place and looked
good already.

Additionally, custom levels have used text images (levelcomplete and
gamecomplete) in creative ways by replacing them with something else
to show as 'foreground' or as a cutscene image. Changing text images
to fade has unintended consequences for levels that have utilized
them in this fashion.
2024-01-10 17:43:03 -08:00
Misa
5e1a1f80ac Bump version to 2.4.1
The plan is for 2.4 development to continue a bit with some minor new
features. 2.4.0 was the grand release containing most of the new stuff.
2024-01-10 17:40:39 -08:00
Misa
29f05c41b1 Fix warnings when calculating image color
This fixes warnings about narrowing and missing a component of the
struct.
2024-01-10 08:27:34 -08:00
AllyTally
23915e0d22 Fix typing pipes in save/load prompts in editor
13d6b2d64c adds a check where you can't
type a pipe in script/terminal input fields anymore. It does this
completely incorrectly, checking if certain variables are set instead
of checking what's actually trying to be done.

This commit fixes that, simplifying the check a lot in the process.
2024-01-10 08:23:20 -08:00
Dav999
48a71f4c22 Last update to Arabic font 2024-01-10 08:00:04 -08:00
Misa
13d6b2d64c Disable typing pipes in script names
This disables typing the pipe character in the data fields of terminals
and script boxes. Care has been taken to make sure that it's still
possible to type pipes in room text.

This is because pipes are the line separator in the big XML tag that
stores every single script line, and thus a script name with pipes would
end up being split up after the level file has been saved and loaded
again.
2024-01-10 07:59:49 -08:00
AllyTally
f1bf1f683c Fix text images not fading
While a7b22919ae makes text sprites
modulate their RGB values, text images continued using alpha,
despite alpha blending not even being enabled, so the initial
commit didn't work right either.
2024-01-10 07:57:54 -08:00
Dav999
ff25e18945 Move author face to the right for RTL languages
This is quite a last-minute thing that was almost getting called off by
me discovering a critical segfault just now in testing this (whew) but
this shouldn't hurt.
2024-01-10 07:57:40 -08:00
Dav999
95c5bd80e1 Revert "Disable typing pipes in script names"
This reverts commit a806b072bd.

It causes an instant segfault if there's no entities or if you're not
editing terminals/script boxes or something, whatever it's not
crucial as a last-minute fix.
2024-01-10 16:42:01 +01:00
TerryCavanagh
8bfcb40a17 updates to roomnames for Arabic 2024-01-10 15:15:26 +01:00
Ethan Lee
b619f38086 Fix Switch button glyphs being double swapped 2024-01-10 09:02:09 -05:00
TerryCavanagh
99a17e7d5c added Esperanto translation for "Arabic" 2024-01-10 14:54:46 +01:00
TerryCavanagh
f0760b0192 added translation of the word "Arabic" to all* languages
*missing Esperanto, but I'll check that in later
2024-01-10 12:10:15 +01:00
TerryCavanagh
9ef531634a minor proofreading changes for Simplified Chinese 2024-01-10 11:30:25 +01:00
Misa
5948168a40 Fix delayed notification of NDM unlock
No Death Mode is intended to be unlocked by getting at least S-rank in
at least 4 time trials. Before 2.3, completing a time trial put you at
the main menu, so you would always be notified of having unlocked No
Death Mode once you went to the play menu again. But since 2.3,
completing a time trial puts you back at the Time Trial selection
screen, which isn't the play menu, so you would need to back all the way
out first in order to get the notification. And since you don't actually
unlock No Death Mode until you see the notification, this would be
required to be able to play No Death Mode.

To fix this, I decided to do something a bit kludge-y and just re-use
the code to check and unlock No Death Mode when the player presses
ACTION on the Time Trial complete screen (and there's also another path
by pressing Escape). At least I put it in a function, so it's not a pure
copy-paste, although it might as well be. I don't have time to think of
a proper solution, but it would probably involve disentangling unlock
notifications from Menu::play, for starters. But that's for later.
2024-01-10 01:33:10 -08:00
Misa
a806b072bd Disable typing pipes in script names
This disables typing the pipe character in the data fields of terminals
and script boxes. Care has been taken to make sure that it's still
possible to type pipes in room text.

This is because pipes are the line separator in the big XML tag that
stores every single script line, and thus a script name with pipes would
end up being split up after the level file has been saved and loaded
again.
2024-01-10 00:33:39 -08:00
Misa
a1c7291bc4 Don't draw mode indicator text if there is none
This makes it so that the boolean to draw mode indicator text is false
if there aren't any modes active.

Otherwise, when loading in, the in-game timer would only come in after a
few seconds instead of appearing when the fade-in finishes.
2024-01-10 00:23:40 -08:00
Misa
5e28567009 Fix pressing ESC in some menus not playing music
This fixes a bug where pressing Escape in the following menus would not
play Presenting VVVVVV (the title screen music) and would instead leave
you with silence: Game Complete, Time Trial complete, Game Over, and No
Death Mode complete.
2024-01-10 00:19:16 -08:00
Misa
67df8a9679 Add bounds check to textcase() command
This makes it so that only inputs between 1 and 255 inclusive will be
accepted. Otherwise, the command has no effect.

This is because the text case is stored as one byte in a string, and a
value of zero would be the null terminator.

We also want to minimize potential weirdness with integer wrapping if we
accept inputs from outside those bounds. While the textcase variable as
used throughout the codebase is plain unqualified `char` (which, unlike
other integers, exists in a quantum superposition of being signed and
unsigned depending on compiler, machine, and various other stuff) and so
there still might be issues there, we definitely don't want anything
higher than 255.
2024-01-09 23:57:14 -08:00
Misa
2a9003ae45 Reverse left & right nav keys in editor for RTL
If the language is RTL, then the left and right menu navigation keys
should be reversed, because the menu layout goes from right to left.

This is to be consistent with the other menus in the game. The editor is
just a special case so it was overlooked.
2024-01-09 21:05:26 -08:00
Misa
163f3a0fde Allow using W and S in editor menus
There was an inconsistency where W and S couldn't be used in place of
the Up and Down arrow keys, but this has been fixed.

This only applies where W and S otherwise are not bound to anything
else. E.g. not the main editor (where W changes the warp direction and S
saves the level) and not the script editor (where W and S can be typed
inside a script), but the script list is fine.
2024-01-09 20:54:11 -08:00
Misa
0e40892eb0 Arabic: Fix translation for Vertigo roomname
By Montassar.

Just adds a U+200F (RTL mark).
2024-01-09 20:25:15 -08:00
Dav999
ef13775456 Add Arabic language files
Here are all the language files for Arabic!
Thanks to Montassar and Seif for their hard work to localize the
entire game in such a short timespan.
2024-01-09 20:20:14 -08:00
Dav999
7b92e7af4d Update Arabic font 2024-01-09 20:20:14 -08:00
Misa
a7b22919ae Modulate text sprite RGB instead of using alpha
Using actual alpha is prone to bugs with doubling alpha, etc. if there
are multiple sprites on top of each other.
2024-01-09 19:22:40 -08:00
Misa
2ed1aac67d Fade text box overlays with text box
Currently, it's a bit jarring that text box overlays (which are text box
images, e.g. Level Complete and Game Complete, and sprites, e.g. the
crewmates) will suddenly appear when their text box has fully faded in
and suddenly disappear once it starts fading out.

This makes it so that text box overlays will be faded in and out
smoothly along with the rest of the text box fading in and out.

Transparent text boxes are not affected, as they do not fade in and out
at all. Thus, text box overlays in transparent text boxes will still
suddenly appear and disappear as usual.
2024-01-09 18:38:40 -08:00
Dav999
ba92174c71 Use wordy2 in Dutch to capitalize één as Eén
The number "one" in Dutch is "één" (silly, I know :P). Capital letters
can have accents, but there's an exception where for this specific
word, the first accent is much more often left off than not. So I'm
now using wordy2 as the uppercase variants of all the numbers, and
using that instead of the |upper flag.
2024-01-09 18:05:15 -08:00
Misa
40b0f9ec36 Account for position of prompt in mode text
I forgot that the position of the activity zone can vary based on
setactivityposition() in custom levels. So account for that.
Additionally, if the activity zone prompt is far down enough, then we
don't need to move the mode text at all.
2024-01-09 17:48:53 -08:00
Misa
18730b465e Allow taking multiple screenshots in same second
Dav999 notified me that if multiple screenshots are taken in the same
second, the second screenshot has `_2` appended to it and so on. We do
the same here by storing the current timestamp and a counter.

This doesn't prevent overwriting files if you have system time that
changes, or have multiple instances of VVVVVV running at the same time,
but my position on those cases is as follows: Don't do that.
2024-01-09 17:21:18 -08:00
Misa
d8b97db6a8 Make sure mode text is visible above act prompts
This makes the mode indicator text be visible even if there is an
activity zone prompt on screen, by making it so that it gets moved if an
activity prompt is being rendered.

This is to make sure that it's visible no matter what, even if e.g. a
custom level starts the player on an activity zone.
2024-01-09 17:06:33 -08:00
Misa
9676bf0006 Fix visual clash between timer and trophy text
Trophy text can overlap with the timer. How bad it is depends on the
localization but in English some text definitely overlaps.

Simple fix is to disable rendering the timer if we are rendering any
trophy text.
2024-01-09 16:56:38 -08:00
Misa
b3b001c2a8 Place GraphicsResources functions in header file
These are functions used in other files that are not on the
GraphicsResources class but are implemented inside the
GraphicsResources.cpp file. For some reason they were never put in the
GraphicsResources.h file until now, even though it's a perfectly good
header file to put them in.
2024-01-09 16:03:05 -08:00
Misa
10030a4340 Save screenshots with proper filenames
Filenames are timestamped now, down to the second. If you take multiple
screenshots in the same second, then the last one will overwrite the
others. This seems to be how other screenshot programs operate so I
don't think it matters if you can't take more than one per second.

Additionally, 1x screenshots (320x240) will go in the 1x/ subdirectory,
and 2x screenshots (640x480) will go in the 2x/ subdirectory.
2024-01-09 15:48:41 -08:00
Misa
40f6f83328 Add border to indicate taking screenshot
Originally, I was thinking of adding a notification text that you took a
screenshot, but this is better because it is language-agnostic and it
doesn't contribute to potential UI clutter/clashing.

It flashes yellow if the screenshot successfully saved, and red if it
didn't.
2024-01-09 15:48:41 -08:00
Misa
93ec2c6cca Upscale screenshots 2x
The plan is to have Steam screenshots always be 2x, but in the VVVVVV
screenshots directory (for F6 keybind) save both 1x and 2x.

Again, just for now, the 2x screenshot is being saved to a temporary
location for testing and will get proper timestamps later.
2024-01-09 15:48:41 -08:00
Misa
20f0fafa5e Fix screenshots in Flip Mode
One problem with internal screenshot capture is that we rely on SDL's
render subsystem to flip the screen in Flip Mode, while leaving our
actual screen untouched. Since we source the screenshot from the screen
and not what SDL renders, we need to flip the screenshot ourselves when
saving an internal capture.

To do this, we need to support 24-bit colors in DrawPixel() and
ReadPixel(). Luckily, this isn't too hard to do. A 24-bit color is just
a tuple of three bytes, and we just need to do a small amount of bitwise
math to pack/unpack them to a single integer for SDL_GetRGB() and
SDL_MapRGB().
2024-01-09 15:48:41 -08:00
Misa
ae5ef9753c Hook Steam screenshots and send internal capture
Using the Steamworks API, we can hook the screenshot function and listen
for a screenshot request callback to send in our own screenshot. This
applies the screenshot improvements to Steam screenshots as well.

Doing this requires adding some C wrapper functions, as our interface
with the Steam API is only conducted through C.
2024-01-09 15:48:41 -08:00
Misa
f05827f268 Add support for internal screenshots
"But people already have screenshot tools", you might protest. The
rationale is simple: If you play with any video setting other than 1x
windowed (no stretching and no letterbox), then your screenshot will be
too big if you want the internal resolution of 320x240, and downscaling
will be an inconvenience.

The point is to make screenshots based off of internal resolution so
they are always pixel perfect and ideally never have to be altered once
taken.

I've added the keybind of F6 to do this.

Right now it saves to a temporary test location with the same filename;
future commits will save to properly-timestamped filenames.
2024-01-09 15:48:41 -08:00
Dav999
060fe6938d Add support for right-aligned roomtext
This is mostly so people making levels in an RTL language have a more
pleasant and logical experience. If roomtext is placed in a level set
to RTL, it will get p1=1, which makes that roomtext right-aligned.
Because, imagine for English you click to place roomtext, and the text
runs left of where you clicked, which wouldn't be logical.

Since it's an entity-bound property, switching RTL on and off either in
the editor or via a script does not affect existing entities.
2024-01-09 13:13:04 -08:00