From 940a6310c2b540e1ef077602a63e50bef958da4f Mon Sep 17 00:00:00 2001 From: YYBartT Date: Tue, 27 Feb 2024 18:21:18 +0100 Subject: [PATCH 1/2] [General]Mac IDE: Shift-Option-ArrowKeys not behaving as expected during text entry. YoYoGames/GameMaker-Bugs#2438 * Updated keyboard shortcuts page using script, key combinations for this issue are marked "unlisted" though * Updated script a tiny bit to support trailing commas (making it a bit more robust) --- .../GenerateKeyboardShortcutTableFromJson.py | 26 +++++++++++++++---- .../IDE_Navigation/Keyboard_Shortcuts.htm | 26 +++++++++++++------ 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/Manual/GenerateKeyboardShortcutTableFromJson.py b/Manual/GenerateKeyboardShortcutTableFromJson.py index 28d0d4595..6181cfc65 100644 --- a/Manual/GenerateKeyboardShortcutTableFromJson.py +++ b/Manual/GenerateKeyboardShortcutTableFromJson.py @@ -3,15 +3,30 @@ ### Provide the full directory path to the .json files as the command line argument. ### The output HTML file will also be placed there. ### For example: CMD > python GenerateKeyboardShortcutTableFromJson.py "C:/Users/Dev/Documents/Manual/" -name_as_desc +### +### You can provide an optional argument: +### +### -name_as_desc: Add this to write the hotkey's name as the description. ### -### Important: The JSON cannot contain trailing commas, this isn't supported -### using the built-in json module. +### Important: Technically, the JSON cannot contain trailing commas, this isn't supported +### using the built-in json module. Though it is supported through the yy_load function. ### import sys import json +import re from collections import OrderedDict +def yy_load(file): + """ Load json from a file that possibly contains trailing commas """ + # Do some tricky regex substitution + # so we can use the json module + data_string = ''.join(file.readlines()) + data_string = re.sub("(,)(\s*[]}])","\g<2>", data_string) + + # Now we can import using the json module + return json.loads(data_string) + # Utility functions def get_combo_string(combo): if not combo: @@ -42,9 +57,10 @@ def get_combo_string(combo): shortcuts_per_location = OrderedDict() # stores shortcuts under locations # First read the Windows defaults file -with open(fdir + "/" + fname_win_hotkeys, 'r') as f: +with open(fdir + "/" + fname_win_hotkeys, 'r', encoding="utf-8") as f: # Load all the data - input = json.load(f) + # input = json.load(f) # risk of errors if trailing commas are present + input = yy_load(f) # regex-replace variety that fixes things # Add items under their respective locations (i.e. "group" per location) for shortcut in input: @@ -84,7 +100,7 @@ def get_combo_string(combo): # Then add the combos in the macOS defaults file with open(fdir + "/" + fname_mac_hotkeys, 'r') as f: # Load all the data - input = json.load(f) + input = yy_load(f) # Add items under their respective locations for shortcut in input: diff --git a/Manual/contents/IDE_Navigation/Keyboard_Shortcuts.htm b/Manual/contents/IDE_Navigation/Keyboard_Shortcuts.htm index 06204950c..42c347178 100644 --- a/Manual/contents/IDE_Navigation/Keyboard_Shortcuts.htm +++ b/Manual/contents/IDE_Navigation/Keyboard_Shortcuts.htm @@ -39,7 +39,7 @@

Global

Scope Description - + Control + Equals Command + Equals Global @@ -702,7 +702,7 @@

Room Editor

Scope Description - + Control + R Command + R Room Editor @@ -891,8 +891,12 @@

Room Editor

Paint With Resource - Control + Alt - Command + Alt + Control + Left
+ Control + Right
+ Control + Up
+ Control + Down + Command + Alt
+ Alt + Command Room Editor Paint With Resource Precise Item Placement @@ -908,6 +912,12 @@

Room Editor

Room Editor Select Override + + Shift +   + Room Editor + Select Tile Brush Subsection +

Sequence Editor

@@ -1308,7 +1318,7 @@

Image Editor

Scope Description - + Space   Image Editor @@ -1657,7 +1667,7 @@

Sprite Editor

Scope Description - + Space   Sprite Editor @@ -1716,7 +1726,7 @@

Object Editor

Scope Description - + Space   Object Editor @@ -1946,7 +1956,7 @@

Tile Set Editor

Scope Description - + Control + Shift + I Command + Shift + I Tile Set Editor From 2126e666d00f37bccc84d1bcbe5581d5eedda1f9 Mon Sep 17 00:00:00 2001 From: gurpreetsinghmatharoo Date: Wed, 28 Feb 2024 13:57:10 +0530 Subject: [PATCH 2/2] [General] Mention that path position is updated post-Step https://github.com/YoYoGames/GameMaker/issues/3645 --- .../GML_Reference/Asset_Management/Paths/path_start.htm | 9 +++++---- .../The_Asset_Editors/Object_Properties/Event_Order.htm | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Paths/path_start.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Paths/path_start.htm index 32664a2b5..6f830bff7 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Paths/path_start.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Paths/path_start.htm @@ -20,6 +20,7 @@

path_start

A path is created from a series of defining points that are linked together and then used to plan the movements of an instance. They can be created with code, or in The Path Editor and they are assigned to an instance to use in the game. You would then use this function to tell your instance which path to follow, what speed to follow the path (measured in pixels per step), how to behave when it reaches the end of the path, and whether to follow the absolute or relative path position. This last part means that it either starts and follows the path exactly as you designed and placed it in The Path Editor (absolute), or it starts and follows the path from the position at which the instance was created (relative).

Relative or Absolute path examplesAs you can see in the above image, the two instances are following the same path started with path_start, but one of the instances is following the absolute path while the other is following the relative path. It should be noted that when absolute is set to false (i.e. relative) the instance will "jump" to the start of the path no matter where in the room it is placed.

The constants used to define the behaviour of the instance when it reaches the end of the path are given on this page.

+

 When following a path, an instance's position is updated after the Step event, so during the Step event its x and y position will be the same as its xprevious and yprevious (unless manually modified in the Begin Step or Step events).

 

Syntax:

path_start(path, speed, endaction, absolute);

@@ -32,22 +33,22 @@

Syntax:

path - Path Asset + Path Asset The path index to start. speed - Real + Real The speed of which to follow the path in pixels per step, negative meaning going backwards. endaction - Path End Action Constant + Path End Action Constant What to do when the end of the path is reached. absolute - Boolean + Boolean Whether the calling instance should follow the absolute path as it is defined in The Path Editor (true) or a relative path to its current position (false). diff --git a/Manual/contents/The_Asset_Editors/Object_Properties/Event_Order.htm b/Manual/contents/The_Asset_Editors/Object_Properties/Event_Order.htm index 9f1fae2b5..d4cd04a5d 100644 --- a/Manual/contents/The_Asset_Editors/Object_Properties/Event_Order.htm +++ b/Manual/contents/The_Asset_Editors/Object_Properties/Event_Order.htm @@ -55,7 +55,7 @@

Every Step/Frame

  • Alarms
  • -
  • Step Event (note that the Step event is executed just before instances are put in their new positions)
  • +
  • Step Event (note that the Step event is executed just before instances are put in their new positions, including when following a path)
  • End Step Event
  • After all Step events come all Draw events. These are also always dealt with in the same order as follows (except for the Window Resize event, which is triggered differently):