mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
CTRL+, and CTRL+. to modify platv
`platv` is a room property that controls platform speed, and it has always worked (other than some weird storage issues due to a bug). However, the editor has no way to edit it currently, so people had to resort to editing the level file by hand, or with a third-party tool. This commit simply adds an easy way to modify platform speed.
This commit is contained in:
parent
d328be2a03
commit
f3cf771cc8
2 changed files with 32 additions and 2 deletions
|
@ -630,6 +630,7 @@
|
|||
<string english="Now using {area} Tileset" translation="" explanation="level editor, user changed the tileset of the room to {area} (like Ship, Lab, etc)" max="38*3"/>
|
||||
<string english="Tileset Colour Changed" translation="" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
|
||||
<string english="Enemy Type Changed" translation="" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
|
||||
<string english="Platform speed is now {speed}" translation="" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
|
||||
<string english="Reloaded resources" translation="" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
|
||||
<string english="ERROR: Invalid format" translation="" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
|
||||
<string english="Loaded map: {filename}.vvvvvv" translation="" explanation="successfully loaded level file" max="38*3"/>
|
||||
|
|
|
@ -2771,17 +2771,46 @@ static void handle_draw_input()
|
|||
ed.x_modifier = key.keymap[SDLK_x];
|
||||
ed.z_modifier = key.keymap[SDLK_z];
|
||||
|
||||
const int room = ed.levx + ed.levy * cl.maxwidth;
|
||||
const int plat_speed = cl.roomproperties[room].platv;
|
||||
|
||||
if (key.keymap[SDLK_COMMA])
|
||||
{
|
||||
ed.current_tool = (EditorTools) POS_MOD(ed.current_tool - 1, NUM_EditorTools);
|
||||
if (key.keymap[SDLK_LCTRL] || key.keymap[SDLK_RCTRL])
|
||||
{
|
||||
cl.roomproperties[room].platv = plat_speed - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ed.current_tool = (EditorTools) POS_MOD(ed.current_tool - 1, NUM_EditorTools);
|
||||
}
|
||||
ed.keydelay = 6;
|
||||
}
|
||||
else if (key.keymap[SDLK_PERIOD])
|
||||
{
|
||||
ed.current_tool = (EditorTools) POS_MOD(ed.current_tool + 1, NUM_EditorTools);
|
||||
if (key.keymap[SDLK_LCTRL] || key.keymap[SDLK_RCTRL])
|
||||
{
|
||||
cl.roomproperties[room].platv = plat_speed + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ed.current_tool = (EditorTools) POS_MOD(ed.current_tool + 1, NUM_EditorTools);
|
||||
}
|
||||
ed.keydelay = 6;
|
||||
}
|
||||
|
||||
if (plat_speed != cl.roomproperties[room].platv)
|
||||
{
|
||||
char buffer[3 * SCREEN_WIDTH_CHARS + 1];
|
||||
vformat_buf(
|
||||
buffer, sizeof(buffer),
|
||||
loc::gettext("Platform speed is now {speed}"),
|
||||
"speed:int",
|
||||
cl.roomproperties[room].platv
|
||||
);
|
||||
ed.show_note(buffer);
|
||||
}
|
||||
|
||||
if (key.keymap[SDLK_SPACE])
|
||||
{
|
||||
ed.toolbox_open = !ed.toolbox_open;
|
||||
|
|
Loading…
Reference in a new issue