From 056c790dbb205e382e4cfbec43420c9c5c0e727c Mon Sep 17 00:00:00 2001 From: Kluskey Date: Sun, 24 Mar 2024 21:35:14 -0700 Subject: [PATCH 1/2] order --- .github/ISSUE_TEMPLATE/{proposal.md => 01-proposal.md} | 0 .github/ISSUE_TEMPLATE/{bug_report.md => 02-bug_report.md} | 0 ...ng-the-lawn-green.md => 03-cleanup--keeping-the-lawn-green.md} | 0 .github/ISSUE_TEMPLATE/{docs-request.md => 04-docs-request.md} | 0 .../ISSUE_TEMPLATE/{planned-feature.md => 09-planned-feature.md} | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename .github/ISSUE_TEMPLATE/{proposal.md => 01-proposal.md} (100%) rename .github/ISSUE_TEMPLATE/{bug_report.md => 02-bug_report.md} (100%) rename .github/ISSUE_TEMPLATE/{cleanup--keeping-the-lawn-green.md => 03-cleanup--keeping-the-lawn-green.md} (100%) rename .github/ISSUE_TEMPLATE/{docs-request.md => 04-docs-request.md} (100%) rename .github/ISSUE_TEMPLATE/{planned-feature.md => 09-planned-feature.md} (100%) diff --git a/.github/ISSUE_TEMPLATE/proposal.md b/.github/ISSUE_TEMPLATE/01-proposal.md similarity index 100% rename from .github/ISSUE_TEMPLATE/proposal.md rename to .github/ISSUE_TEMPLATE/01-proposal.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/02-bug_report.md similarity index 100% rename from .github/ISSUE_TEMPLATE/bug_report.md rename to .github/ISSUE_TEMPLATE/02-bug_report.md diff --git a/.github/ISSUE_TEMPLATE/cleanup--keeping-the-lawn-green.md b/.github/ISSUE_TEMPLATE/03-cleanup--keeping-the-lawn-green.md similarity index 100% rename from .github/ISSUE_TEMPLATE/cleanup--keeping-the-lawn-green.md rename to .github/ISSUE_TEMPLATE/03-cleanup--keeping-the-lawn-green.md diff --git a/.github/ISSUE_TEMPLATE/docs-request.md b/.github/ISSUE_TEMPLATE/04-docs-request.md similarity index 100% rename from .github/ISSUE_TEMPLATE/docs-request.md rename to .github/ISSUE_TEMPLATE/04-docs-request.md diff --git a/.github/ISSUE_TEMPLATE/planned-feature.md b/.github/ISSUE_TEMPLATE/09-planned-feature.md similarity index 100% rename from .github/ISSUE_TEMPLATE/planned-feature.md rename to .github/ISSUE_TEMPLATE/09-planned-feature.md From 66c6b425051bfa2490868dfbeebeaad2086e0173 Mon Sep 17 00:00:00 2001 From: Kluskey Date: Mon, 25 Mar 2024 09:00:47 -0700 Subject: [PATCH 2/2] docs update --- mirror-docs/docs/script/gdscript.mdx | 44 +++++++++------------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/mirror-docs/docs/script/gdscript.mdx b/mirror-docs/docs/script/gdscript.mdx index 979c4b9b..665ce450 100644 --- a/mirror-docs/docs/script/gdscript.mdx +++ b/mirror-docs/docs/script/gdscript.mdx @@ -1,6 +1,6 @@ --- sidebar_position: 3.6 -title: The Mirror-flavored GDScript +title: 'Mirror-Flavored GDScript' sidebar_label: GDScript --- @@ -10,7 +10,7 @@ The Mirror provides access to the power of Godot's GDScript. This is like normal The Mirror provides GDScript primarily for existing Godot users, and as such, The Mirror's documentation will not cover every aspect of the GDScript language. For more information on GDScript, please refer to [the Godot documentation](https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_basics.html). -## The Mirror-flavored GDScript +## Mirror-Flavored GDScript You may use functions and variables just like you would in normal GDScript. As a part of The Mirror's support for multiple scripts per object, you can use members of SpaceObject the same way you use inherited members in Godot. For example, `print(position)` will print a SpaceObject's position. In this way, your GDScript code behaves as if it were directly in a script attached to the SpaceObject, without actually being attached to it. @@ -22,25 +22,17 @@ You must not write `class_name` or `extends` in your script. The Mirror's suppor Entry points can be added to a script by clicking the "Add Entry" button in the script editor. This is the same as the "Entry" section of the "Add Script Block" menu in visual scripting. These use Godot signals under the hood, but The Mirror handles the connection for you. -import AddEntry from "./img/gdscript/add_entry.webp"; +import AddEntry from './img/gdscript/add_entry.webp'; - + When an entry is connected, it will show a green arrow icon to the left of the function signature. If you do not see a green arrow, then the entry is not connected, and you may need to add it from the Add Entry menu again. To delete an entry, erase the function text, and then the signal will automatically be disconnected. The callback functions `_ready`, `_process`, and `_physics_process` are available, however others such as the input callbacks are not available. When detected, they will show a blue arrow. These are provided for convenience and compatibility with regular GDScript. Generally, the entry points added through "Add Entry" are the preferred way to receive signals from The Mirror. -import EntryIcons from "./img/gdscript/entry_icons.webp"; +import EntryIcons from './img/gdscript/entry_icons.webp'; -GDScript Editor with Entry Icons +GDScript Editor with Entry Icons ## API @@ -52,22 +44,18 @@ Many helper functions for functionality present in visual scripting are availabl Here is a simple script that counts every frame and prints to the notification area with `Notify.info`. -import CounterMember from "./img/gdscript/counter_member.webp"; +import CounterMember from './img/gdscript/counter_member.webp'; -Counter Member Example Script +Counter Member Example Script However, the above uses a member variable. This is useful for its own reasons, but it is not accessible by other scripts, it is not persistent and so will reset if the server restarts, and will reset any time you change the script. If you want a variable that is persistent, or something that can share data between scripts, you can use an object variable. You can use the `get_object_variable` and `set_object_variable` functions to access these. -import CounterObjVar from "./img/gdscript/counter_obj_var.webp"; +import CounterObjVar from './img/gdscript/counter_obj_var.webp'; Counter Object Variable Example Script The Mirror's object and global variables behave the same way in GDScript as they do in visual scripting. @@ -76,13 +64,9 @@ The Mirror's object and global variables behave the same way in GDScript as they Aside from setting variables on yourself, you can also use the `Mirror.get_object_variable` and `Mirror.set_object_variable` functions to access variables on other objects. These functions work on any node, including SpaceObjects, model subnodes, and even players. By itself, `get_object_variable(...)` is a shorthand for `Mirror.get_object_variable(target_object, ...)`. You can also use `Mirror.get_global_variable` and `Mirror.set_global_variable` to access global variables. -import HasRedKey from "./img/gdscript/has_red_key.webp"; +import HasRedKey from './img/gdscript/has_red_key.webp'; -Has Red Key Example Script +Has Red Key Example Script By default, the above script will show an "Access Denied" message if the `"has_red_key"` variable is null or false, indicating that the player does not have the red key. If another script granted the player the red key by setting `"has_red_key"` to true, then it will show an "Access Granted" message instead.