Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Aug 19, 2024
2 parents dbde70c + 9f71d44 commit e444e35
Show file tree
Hide file tree
Showing 61 changed files with 366 additions and 107 deletions.
16 changes: 1 addition & 15 deletions Manual/GenerateKeyboardShortcutTableFromJson.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
### -update_rh_vars: Add this to update the RoboHelp variables
### A RH variable is written (or updated if exists) for every Win/Mac shortcut
### For example: Hotkey_Create_Asset_Win, Hotkey_Create_Asset_Mac
###
### 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
Expand All @@ -30,16 +27,6 @@
# Unique modifier keys
mods = set()

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, replace_in_names=[]):
global mods
Expand Down Expand Up @@ -114,8 +101,7 @@ def get_combo_string(combo, replace_in_names=[]):
# Read the defaults file
with open(fpath_win, 'r', encoding="utf-8") as f:
# Load all the data
# input = json.load(f) # risk of errors if trailing commas are present
input = yy_load(f) # regex-replace variety that fixes things
input = json.load(f) # risk of errors if trailing commas are present

# Add items under their respective locations (i.e. "group" per location)
for shortcut in input:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h4>Zwroty:</h4>
<p> </p>
<h4>Przykład:</h4>
<p class="code">var asset_sprite = layer_sprite_get_id(layer, &quot;gfc_Trees&quot;);<br />
if (layer_sprite_get_angle(asset_sprite) != 0) <br />
if (layer_sprite_get_angle(asset_sprite) != 0)<br />
{<br />
    layer_sprite_angle(asset_sprite, 0);<br />
}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h4>Zwroty:</h4>
<p> </p>
<h4>Przykład:</h4>
<p class="code">var s = layer_sprite_get_id(layer, global.Asset_sprite);<br />
if (layer_sprite_get_sprite(s) != spr_Nighttime) <br />
if (layer_sprite_get_sprite(s) != spr_Nighttime)<br />
{<br />
    layer_sprite_change(s, spr_nighttime);<br />
}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h4>Zwroty:</h4>
<h4>Przykład:</h4>
<p class="code">var lay_id = layer_get_id(&quot;sprite_sky&quot;);<br />
var spr_id = layer_sprite_get_id(lay_id, &quot;Clouds&quot;);<br />
if (layer_sprite_get_alpha(spr_id) &lt; 0.1) <br />
if (layer_sprite_get_alpha(spr_id) &lt; 0.1)<br />
{<br />
    layer_sprite_destroy(spr_id);<br />
}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h4>Zwroty:</h4>
<h4>Przykład:</h4>
<p class="code">var lay_id = layer_get_id(&quot;sprite_sky&quot;);<br />
var spr_id = layer_sprite_get_id(lay_id, &quot;Clouds&quot;);<br />
if (layer_sprite_get_angle(spr_id) != 0) <br />
if (layer_sprite_get_angle(spr_id) != 0)<br />
{<br />
    layer_sprite_yscale(spr_id, 0);<br />
}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h4>Zwroty:</h4>
<h4>Przykład:</h4>
<p class="code">var lay_id = layer_get_id(&quot;sprite_sky&quot;);<br />
var back_id = layer_sprite_get_id(lay_id, &quot;Clouds&quot;);<br />
if (layer_sprite_get_blend(back_id) == c_white) <br />
if (layer_sprite_get_blend(back_id) == c_white)<br />
{<br />
    layer_sprite_blend(back_id, make_colour_rgb(random(255), random(255), 255));<br />
}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>layer_sprite_get_id</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>layer_sprite_get_index</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down Expand Up @@ -39,7 +39,7 @@ <h4>Zwroty:</h4>
<h4>Przykład:</h4>
<p class="code">var lay_id = layer_get_id(&quot;sprite_sky&quot;);<br />
var spr_id = layer_sprite_get_id(lay_id, &quot;Clouds&quot;);<br />
if (layer_sprite_get_index(spr_id) &lt; 4) <br />
if (layer_sprite_get_index(spr_id) &lt; 4)<br />
{<br />
    layer_sprite_index(spr_id, 4);<br />
}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>layer_sprite_get_speed</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down Expand Up @@ -39,7 +39,7 @@ <h4>Zwroty:</h4>
<h4>Przykład:</h4>
<p class="code">var lay_id = layer_get_id(&quot;sprite_sky&quot;);<br />
var spr_id = layer_sprite_get_id(lay_id, &quot;Clouds&quot;);<br />
if (layer_sprite_get_speed(spr_id) &gt; 0) <br />
if (layer_sprite_get_speed(spr_id) &gt; 0)<br />
{<br />
    layer_sprite_speed(spr_id, 0);<br />
}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>layer_sprite_get_x</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down Expand Up @@ -39,7 +39,7 @@ <h4>Zwroty:</h4>
<h4>Przykład:</h4>
<p class="code">var lay_id = layer_get_id(&quot;sprite_sky&quot;);<br />
var spr_id = layer_sprite_get_id(lay_id, &quot;Clouds&quot;);<br />
if (layer_sprite_get_x(spr_id) &lt; 0) <br />
if (layer_sprite_get_x(spr_id) &lt; 0)<br />
{<br />
    layer_sprite_x(spr_id, room_width);<br />
}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>layer_sprite_get_xscale</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down Expand Up @@ -39,7 +39,7 @@ <h4>Zwroty:</h4>
<h4>Przykład:</h4>
<p class="code">var lay_id = layer_get_id(&quot;sprite_sky&quot;);<br />
var spr_id = layer_sprite_get_id(lay_id, &quot;Clouds&quot;);<br />
if (layer_sprite_get_xscale(spr_id) != 1) <br />
if (layer_sprite_get_xscale(spr_id) != 1)<br />
{<br />
    layer_sprite_xscale(spr_id, 1);<br />
}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h4>Zwroty:</h4>
<h4>Przykład:</h4>
<p class="code">var lay_id = layer_get_id(&quot;sprite_sky&quot;);<br />
var spr_id = layer_sprite_get_id(lay_id, &quot;Clouds&quot;);<br />
if (layer_sprite_get_y(spr_id) &lt; 0) <br />
if (layer_sprite_get_y(spr_id) &lt; 0)<br />
{<br />
    layer_sprite_y(spr_id, room_height);<br />
}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>layer_sprite_get_yscale</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down Expand Up @@ -39,7 +39,7 @@ <h4>Zwroty:</h4>
<h4>Przykład:</h4>
<p class="code">var lay_id = layer_get_id(&quot;sprite_sky&quot;);<br />
var spr_id = layer_sprite_get_id(lay_id, &quot;Clouds&quot;);<br />
if (layer_sprite_get_yscale(spr_id) != 1) <br />
if (layer_sprite_get_yscale(spr_id) != 1)<br />
{<br />
    layer_sprite_yscale(spr_id, 1);<br />
}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>skeleton_skin_create</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" type="text/css" href="../../../../../../assets/css/default.css" />
<script src="../../../../../../assets/scripts/main_script.js" type="module"></script>
<meta name="rh-authors" content="Bart Teunis" />
Expand All @@ -15,9 +15,9 @@
</head>
<body>
<h1><span data-field="title" data-format="default">skeleton_skin_create</span></h1>
<p>This function creates a new <a href="http://esotericsoftware.com/spine-runtime-skins">runtime skin</a> for skeletal animation sprites through code.</p>
<p>The new skin is created with the name that you provide and takes a list of existing skins in the skeletal animation sprite. The attachments that are linked to these skins are included in the new skin. By combining existing skins in this way you can create custom characters (by <a href="http://esotericsoftware.com/spine-runtime-skins#Grouping-attachments">grouping attachments</a>).</p>
<p>Creating a skin in this way corresponds visually to <i>pinning</i> a combination of existing skins in the <a href="http://en.esotericsoftware.com/spine-skins-view#Pinned-skins">Skins view</a> of the animation tool.</p>
<p>This function creates a new <a href="https://esotericsoftware.com/spine-runtime-skins">runtime skin</a> for skeletal animation sprites through code.</p>
<p>The new skin is created with the name that you provide and takes a list of existing skins in the skeletal animation sprite. The attachments that are linked to these skins are included in the new skin. By combining existing skins in this way you can create custom characters (by <a href="https://esotericsoftware.com/spine-runtime-skins#Grouping-attachments">grouping attachments</a>).</p>
<p>Creating a skin in this way corresponds visually to <i>pinning</i> a combination of existing skins in the <a href="https://en.esotericsoftware.com/spine-skins-view#Pinned-skins">Skins view</a> of the animation tool.</p>
<p class="note"><span data-conref="../../../../../../assets/snippets/Tag_important.hts"> </span> For skins created using this function you have to pass the struct that it returns to <a data-xref="{title}" href="skeleton_skin_set.htm">skeleton_skin_set</a> instead of the skin name.</p>
<p> </p>
<h4>Syntax:</h4>
Expand All @@ -36,19 +36,19 @@ <h4>Syntax:</h4>
</tr>
<tr>
<td>name</td>
<td><span data-keyref="Type_String"><a href="../../../../../../../GameMaker_Language/GML_Overview/Data_Types.htm" target="_blank">String</a></span></td>
<td><span data-keyref="Type_String"><a href="../../../../../GML_Overview/Data_Types.htm" target="_blank">String</a></span></td>
<td>The name of the new skin</td>
</tr>
<tr>
<td>skins</td>
<td><span data-keyref="Type_Array"><a href="../../../../../../../GameMaker_Language/GML_Overview/Arrays.htm" target="_blank">Array</a></span></td>
<td>An array of names (as <span data-keyref="Type_String"><a href="../../../../../../../GameMaker_Language/GML_Overview/Data_Types.htm" target="_blank">String</a></span>) of existing skins in the skeletal animation sprite that will be used in the new skin.</td>
<td><span data-keyref="Type_Array"><a href="../../../../../GML_Overview/Arrays.htm" target="_blank">Array</a></span></td>
<td>An array of names (as <span data-keyref="Type_String"><a href="../../../../../GML_Overview/Data_Types.htm" target="_blank">String</a></span>) of existing skins in the skeletal animation sprite that will be used in the new skin.</td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Struct_Skeleton_Skin"><a href="../../../../../../../GameMaker_Language/GML_Reference/Asset_Management/Sprites/Skeletal_Animation/Skins/skeleton_skin_create.htm" target="_blank">Skeleton Skin Struct</a></span></p>
<p class="code"><span data-keyref="Type_Struct_Skeleton_Skin"><a href="skeleton_skin_create.htm" target="_blank">Skeleton Skin Struct</a></span></p>
<p> </p>
<h4>Example:</h4>
<p class="code">var skin = <span data-field="title" data-format="default">skeleton_skin_create</span>(&quot;new_skin&quot;, [&quot;hat/red&quot;, &quot;shirt/green&quot;, &quot;trousers/blue&quot;]);<br />
Expand All @@ -64,7 +64,7 @@ <h4>Example:</h4>
<div>Next: <a data-xref="{title}" href="skeleton_skin_set.htm">skeleton_skin_set</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2022 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
skeleton_skin_create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ <h4>Przykład rozszerzony:</h4>
<p class="code">var i_d = ds_map_find_value(async_load, &quot;id&quot;);<br />
if (i_d == msg) <br />
{<br />
    if (ds_map_find_value(async_load, &quot;status&quot;)) <br />
    if (ds_map_find_value(async_load, &quot;status&quot;))<br />
    {<br />
        global.Age = ds_map_find_value(async_load, &quot;value&quot;);<br />
        global.age = ds_map_find_value(async_load, &quot;value&quot;);<br />
    }<br />
}</p>
<p>Powyższy kod sprawdza, czy klucz &quot;<span class="inline">id</span>&quot; zwróconej strony <span class="inline">DS Map</span> jest zgodny z wartością przechowywaną w zmiennej &quot;msg&quot;. Jeśli są one takie same, sprawdza, czy naciśnięto klawisz &quot;OK&quot; (a nie zamknięto/anulowano okno) i jeśli zwróci <span class="inline">true</span>, ustawia zmienną globalną na podstawie zwróconej liczby całkowitej.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ <h4>Zwroty:</h4>
<h4>Przykład rozszerzony:</h4>
<p>W <b>zdarzeniu create</b> (na przykład) strony <span class="notranslate">object</span>, która kontroluje logowanie naszego użytkownika, znalazłby się następujący kod:</p>
<p class="code">ini_open(&quot;Profile.ini&quot;);<br />
u = ini_read_string(&quot;User&quot;,&quot;0&quot;,&quot;&quot;);<br />
p = ini_read_string(&quot;User&quot;,&quot;1&quot;,&quot;&quot;);<br />
u = ini_read_string(&quot;User&quot;, &quot;0&quot;, &quot;&quot;);<br />
p = ini_read_string(&quot;User&quot;, &quot;1&quot;, &quot;&quot;);<br />
ini_close();<br />
login = get_login_async(u,p);</p>
<p>Powyższy kod otwiera plik ini (lub tworzy go, jeśli nie istnieje) i pobiera nazwę oraz hasło zapisane w tym pliku. Jeśli nie istnieją, zwracana jest domyślnie pusta strona <span class="notranslate">string</span> (&quot;&quot;). Wartości te są następnie wykorzystywane w <span class="inline">get_login_async()</span> do zapytania użytkownika o nazwę użytkownika i hasło, przy czym indeks żądania jest przechowywany w zmiennej &quot;login&quot;. Należy pamiętać, że podczas oczekiwania na podanie przez użytkownika niezbędnych informacji gra i jej wydarzenia będą przebiegać normalnie.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h4>Przykład rozszerzony:</h4>
    {<br />
        if (ds_map_find_value(async_load, &quot;result&quot;) != &quot;&quot;)<br />
        {<br />
            global.Name = ds_map_find_value(async_load, &quot;result&quot;);<br />
            global.name = ds_map_find_value(async_load, &quot;result&quot;);<br />
        }<br />
    }<br />
}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h4>Przykład rozszerzony:</h4>
i_d = ds_map_find_value(async_load, &quot;id&quot;);<br />
if (i_d == msg) <br />
{<br />
    if (ds_map_find_value(async_load, &quot;status&quot;)) <br />
    if (ds_map_find_value(async_load, &quot;status&quot;))<br />
    {<br />
        url_open(&quot;https://play.google.com/store&quot;);<br />
    }<br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ <h4>Przykład rozszerzony:</h4>
i_d = ds_map_find_value(async_load, &quot;id&quot;);<br />
if (i_d == msg) <br />
{<br />
    if (ds_map_find_value(async_load, &quot;status&quot;)) <br />
    if (ds_map_find_value(async_load, &quot;status&quot;))<br />
    {<br />
        coins -= armour[0,5];<br />
        global.protection += armour[0,0];<br />
        coins -= armour[0, 5];<br />
        global.protection += armour[0, 0];<br />
    }<br />
}</p>
<p>Powyższy kod sprawdza, czy klucz &quot;id&quot; zwróconego adresu <span class="inline">DS Map</span> jest zgodny z wartością zapisaną w zmiennej &quot;msg&quot;. Jeśli są one takie same, sprawdza, czy został naciśnięty jeden z dwóch przycisków, a jeśli zwróci <span class="inline">true</span>, odejmie wartość ze zmiennej i doda ją również do zmiennej globalnej.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Facebook</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../assets/css/default.css" type="text/css" />
<script src="../../../../assets/scripts/main_script.js"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,8 @@ <h4>Przykład rozszerzony:</h4>
<p>Powyższy kod przekaże adres <span class="notranslate">string</span> przechowywany w zmiennej &quot;name&quot; do podanego adresu <span class="notranslate">server</span>, a także pobierze dane z tego adresu URL, wyzwalając zdarzenie Async Event, które będzie zawierało mapę async_load DS (indeks mapy async_load będzie przechowywany w zmiennej &quot;get&quot;, dzięki czemu można sprawdzić, czy jest to właściwy callback). Wywołane zdarzenie Async Event byłoby sub-zdarzeniem <b>HTTP</b>, a w tym zdarzeniu miałbyś następujące:</p>
<p class="code">if ds_map_find_value(async_load, &quot;id&quot;) == get<br />
{<br />
    if (ds_map_find_value(async_load, &quot;status&quot;) == 0) <br />
    {<br />
        r_str = ds_map_find_value(async_load, &quot;result&quot;);<br />
    }<br />
    else<br />
    {<br />
        r_str = &quot;null&quot;;<br />
    }<br />
    var _status = async_load[? &quot;status&quot;];<br />
    var _r_str = (_status == 0) ? async_load[? &quot;result&quot;] : &quot;null&quot;;<br />
}</p>
<p>Powyższy kod najpierw sprawdzi id utworzonej mapy DS, a następnie sprawdzi &quot;status&quot; wywołania zwrotnego. Jeśli wartość jest równa 0 (sygnalizując sukces), wynik z callbacka zostanie zapisany w zmiennej do przyszłego użytku, w przeciwnym razie zmienna zostanie ustawiona na wartość domyślną (w tym przypadku &quot;null&quot;).</p>
<p> </p>
Expand Down
Loading

0 comments on commit e444e35

Please sign in to comment.