From bded308f097df854797db4b65455ab9429cf9fd0 Mon Sep 17 00:00:00 2001 From: "Cyril B." <53737317+Cykyrios@users.noreply.github.com> Date: Wed, 13 Aug 2025 12:56:25 +0200 Subject: [PATCH] Use admonitions in doc comments --- .../src/buttons/insim_button/insim_button.gd | 14 +++---- .../buttons/insim_button/insim_solo_button.gd | 4 +- .../src/buttons/insim_button_manager.gd | 28 ++++++------- .../src/connection/lfs_connection.gd | 4 +- addons/godot_insim/src/insim/insim.gd | 42 +++++++++---------- .../src/insim/packet/insim_mso_packet.gd | 4 +- .../src/insim/packet/insim_sch_packet.gd | 4 +- .../src/insim/packet/insim_sfp_packet.gd | 4 +- .../src/insim/relay/insim_relay_packet.gd | 2 +- addons/godot_insim/src/lfs_packet.gd | 6 +-- addons/godot_insim/src/lyt/lyt_object.gd | 4 +- addons/godot_insim/src/outgauge/outgauge.gd | 8 ++-- addons/godot_insim/src/outsim/outsim.gd | 8 ++-- addons/godot_insim/src/pth/pth_node.gd | 8 ++-- addons/godot_insim/src/smx/smx_file.gd | 5 +-- .../godot_insim/src/text_encoding/lfs_text.gd | 11 ++--- addons/godot_insim/src/utils/gis_camera.gd | 21 +++++----- addons/godot_insim/src/utils/gis_viewer.gd | 6 +-- 18 files changed, 91 insertions(+), 92 deletions(-) diff --git a/addons/godot_insim/src/buttons/insim_button/insim_button.gd b/addons/godot_insim/src/buttons/insim_button/insim_button.gd index 87e0d1f..f3105ed 100644 --- a/addons/godot_insim/src/buttons/insim_button/insim_button.gd +++ b/addons/godot_insim/src/buttons/insim_button/insim_button.gd @@ -6,8 +6,8 @@ extends RefCounted ## existing buttons by creating and storing the object after receiving an [InSimBTNPacket]. ## Any change made should be followed by sending a new [InSimBTNPacket] to update the actual ## InSim button, which can be done by calling [method get_btn_packet].[br] -## [b]Note:[/b] This class is not intended to be used directly, you should use [InSimSoloButton] -## and [InSimMultiButton] instead when interacting with the [InSimButtonManager]. +## [note]This class is not intended to be used directly, you should use [InSimSoloButton] +## and [InSimMultiButton] instead when interacting with the [InSimButtonManager].[/note] ## If set in [member inst], the button will display everywhere - this is typically best avoided. const INST_ALWAYS_ON := 0x80 @@ -65,7 +65,7 @@ func _get_type_in(for_ucid: int) -> int: ## if relevant. If [param ignore_position_and_size] is [code]true[/code], the button's position ## and size are set to zero; this is useful to update an existing button without having to ## recreate an [InSimBTNPacket] from scratch after modifying the button.[br] -## [b]Note:[/b] This function is mainly intended for internal use by the [InSimButtonManager]. +## [note]This function is mainly intended for internal use by the [InSimButtonManager].[/note] func get_btn_packet(for_ucid: int, ignore_position_and_size := false) -> InSimBTNPacket: var packet := _get_btn_packet(for_ucid) if ignore_position_and_size: @@ -79,7 +79,7 @@ func get_btn_packet(for_ucid: int, ignore_position_and_size := false) -> InSimBT ## Returns the button's clickID. If the button can have multiple values, return ## the one corresponding to the given [param for_ucid]. See [method _get_click_id] ## for implementation.[br] -## [b]Note:[/b] The clickID is only implemented in child classes. +## [note]The clickID is only implemented in child classes.[/note] func get_click_id(for_ucid: int) -> int: return _get_click_id(for_ucid) @@ -87,7 +87,7 @@ func get_click_id(for_ucid: int) -> int: ## Returns the button's caption. If the button can have multiple values, return ## the one corresponding to the given [param for_ucid]. See [method _get_caption] ## for implementation.[br] -## [b]Note:[/b] The caption is only implemented in child classes. +## [note]The caption is only implemented in child classes.[/note] func get_caption(for_ucid: int) -> String: return _get_caption(for_ucid) @@ -95,7 +95,7 @@ func get_caption(for_ucid: int) -> String: ## Returns the button's text. If the button can have multiple values, return ## the one corresponding to the given [param for_ucid]. See [method _get_text] ## for implementation.[br] -## [b]Note:[/b] The text is only implemented in child classes. +## [note]The text is only implemented in child classes.[/note] func get_text(for_ucid: int) -> String: return _get_text(for_ucid) @@ -103,6 +103,6 @@ func get_text(for_ucid: int) -> String: ## Returns the button's type_in. If the button can have multiple values, return ## the one corresponding to the given [param for_ucid]. See [method _get_type_in] ## for implementation.[br] -## [b]Note:[/b] The type_in is only implemented in child classes. +## [note]The type_in is only implemented in child classes.[/note] func get_type_in(for_ucid: int) -> int: return _get_type_in(for_ucid) diff --git a/addons/godot_insim/src/buttons/insim_button/insim_solo_button.gd b/addons/godot_insim/src/buttons/insim_button/insim_solo_button.gd index 572581b..15aef88 100644 --- a/addons/godot_insim/src/buttons/insim_button/insim_solo_button.gd +++ b/addons/godot_insim/src/buttons/insim_button/insim_solo_button.gd @@ -13,11 +13,11 @@ var click_id := 0: set(value): click_id = clampi(value, 0, InSimButtonManager.MAX_BUTTONS - 1) ## Number of characters that can be typed in.[br] -## [b]Note:[/b] Color codes, codepage change codes, and multibyte characters all count +## [note]Color codes, codepage change codes, and multibyte characters all count ## toward that number (e.g. typing a Japanese character will add [code]^J[/code] and ## 2 more bytes (for a multibyte character) to make up one character, so your first ## Japanese character would actually cost 4 characters (bytes), and subsequent multibyte -## characters would cost an additional 2). +## characters would cost an additional 2).[/note] var type_in := 0 ## The text displayed by this button. var text := "" diff --git a/addons/godot_insim/src/buttons/insim_button_manager.gd b/addons/godot_insim/src/buttons/insim_button_manager.gd index e53ff8a..bd5762f 100644 --- a/addons/godot_insim/src/buttons/insim_button_manager.gd +++ b/addons/godot_insim/src/buttons/insim_button_manager.gd @@ -4,9 +4,9 @@ extends RefCounted ## ## This class keeps track of existing [InSimButton]s and allows manipulating buttons. ## An instance is included in the [InSim] object.[br] -## [b]Note:[/b] This class is mostly intended for internal use. You should always prefer +## [note]This class is mostly intended for internal use. You should always prefer ## using functions exposed to [InSim] where possible, and otherwise treat all properties -## as read-only. +## as read-only.[/note] ## The maximum number of buttons across all InSim apps. const MAX_BUTTONS := 240 @@ -26,14 +26,14 @@ var id_range := Vector2i(0, MAX_BUTTONS - 1): ) ## A dictionary mapping all button clickIDs for every UCID, updating every time a button ## is added, updated, or deleted through the provided methods.[br] -## [b]Warning:[/b] While you can read the current mappings by reading this property, -## you should never modify values, or you may break the button tracking. +## [warning]While you can read the current mappings by reading this property, +## you should never modify values, or you may break the button tracking.[/warning] var id_map: Dictionary[int, Array] = {} ## The list of all buttons that were created using [method add_solo_button] and ## [method add_multi_button]; calling [method delete_button] and [method delete_buttons] ## removes buttons accordingly.[br] -## [b]Warning:[/b] While you can get all buttons by reading this property, you should -## never modify values, or you may break the button tracking. +## [warning]While you can get all buttons by reading this property, you should +## never modify values, or you may break the button tracking.[/warning] var buttons: Array[InSimButton] = [] ## The list of UCIDs corresponding to players who have disabled InSim buttons (by ## pressing [kbd]Shift + I[/kbd]); adding and updating buttons should be disabled @@ -96,11 +96,11 @@ func add_multi_button( ## button will not be hidden as it usually would in some situations, like pressing ## [code]T[/code] to open the chat input box, or in the garage view; this also means ## you should use it sparingly.[br] -## [b]Tip:[/b] Use the [param button_name] parameter to organize your buttons! You can +## [tip]Use the [param button_name] parameter to organize your buttons! You can ## easily create and manage complex button hierarchies by including categories in your ## button names, like [code]menu/sub_menu/title[/code]; when you need to delete an ## entire category, you can call [method delete_buttons] and pass the list returned -## by [method get_buttons_by_prefix]. +## by [method get_buttons_by_prefix].[/tip] func add_solo_button( ucid: int, position: Vector2i, size: Vector2i, style: int, text: String, button_name := "", type_in := 0, caption := "", show_everywhere := false, @@ -186,8 +186,8 @@ func delete_buttons(to_delete: Array[InSimButton], ucids: Array[int] = []) -> Ar ## Disables button updates by adding [param ucid] to [member disabled_ucids]. Packets ## targetting [param ucid] will not be sent anymore until [method enable_buttons_for_ucid] ## is called.[br] -## [b]Note:[/b] This doesn't prevent broadcast packets ([constant InSim.UCID_ALL]) -## from being sent. +## [note]This doesn't prevent broadcast packets ([constant InSim.UCID_ALL]) from +## being sent.[/note] func disable_buttons_for_ucid(ucid: int) -> void: disabled_ucids.erase(ucid) disabled_ucids.append(ucid) @@ -212,8 +212,8 @@ func enable_buttons_for_ucid(ucid: int) -> void: ## Removes all buttons mappings for the given [param ucid]. Mainly intended for [InSim] ## to "forget" players leaving the server.[br] -## [b]Note:[/b] This doesn't clear buttons for the player with the given [param ucid], -## it simply removes internal mapppings. +## [note]This doesn't clear buttons for the player with the given [param ucid], +## it simply removes internal mapppings.[/note] func forget_buttons_for_ucid(ucid: int) -> void: var button_count := buttons.size() for i in button_count: @@ -429,8 +429,8 @@ func update_solo_button( ## an array of [InSimBTNPacket]s to be sent by [InSim]. As for [method add_multi_button], ## you can pass a [Callable] to [param text], [param caption], and [param type_in] for ## values tailored to each UCID.[br] -## [b]Note:[/b] The returned array only contains packets corresponding to buttons that -## were actually updated, to avoid sending unnecessary packets. +## [note]The returned array only contains packets corresponding to buttons that +## were actually updated, to avoid sending unnecessary packets.[/note] func update_multi_button( button: InSimMultiButton, text: Variant, caption: Variant = "", type_in: Variant = -1 ) -> Array[InSimBTNPacket]: diff --git a/addons/godot_insim/src/connection/lfs_connection.gd b/addons/godot_insim/src/connection/lfs_connection.gd index be44529..48ebda0 100644 --- a/addons/godot_insim/src/connection/lfs_connection.gd +++ b/addons/godot_insim/src/connection/lfs_connection.gd @@ -4,10 +4,10 @@ extends Node ## ## InSim initialization automatically creates either a TCP connection or a UDP connection, ## depending on parameters passed.[br] -## [b]Warning:[/b] This class is not intended to be used directly, nor are [LFSConnectionTCP] and +## [important]This class is not intended to be used directly, nor are [LFSConnectionTCP] and ## [LFSConnectionUDP]; an [LFSConnection] object is included in all protocol objects ([InSim], ## [OutGauge], [OutSim]) and is supposed to stay internal. You can use [signal InSim.timeout] -## and [member InSim.insim_connected] instead if you need to check connection status. +## and [member InSim.insim_connected] instead if you need to check connection status.[/important] @warning_ignore_start("unused_signal") signal connection_failed diff --git a/addons/godot_insim/src/insim/insim.gd b/addons/godot_insim/src/insim/insim.gd index b6f7c29..adee3a6 100644 --- a/addons/godot_insim/src/insim/insim.gd +++ b/addons/godot_insim/src/insim/insim.gd @@ -35,8 +35,8 @@ signal timeout ## Emitted when a packet is received from LFS. Specific signals are also emitted ## for each packet type.[br] -## [b]Note:[/b] When requesting UDP updates for [InSimNLPPacket] or [InSimMCIPacket], -## [signal udp_packet_received] is emitted instead of this one. +## [note]When requesting UDP updates for [InSimNLPPacket] or [InSimMCIPacket], +## [signal udp_packet_received] is emitted instead of this one.[/note] signal packet_received(packet: InSimPacket) ## Emitted when a packet is sent successfully. [param sender] can be used ## to identify the source of the packet (InSim itself, or the user application), @@ -1049,12 +1049,12 @@ func _ready() -> void: ## If, however, no player has all R3 tyres, your code will get stuck awaiting those specific ## requirements; you should generally use this method only when you know the expected packet ## will be received immediately or when that packet can be sent from other parts of your code.[br] -## [b]Danger:[/b] Awaiting a non-zero [param req_i] means the expected packet has to be requested +## [warning]Awaiting a non-zero [param req_i] means the expected packet has to be requested ## specifically; this can lead to your code being soft-locked! This is something you especially ## need to consider when using [method await_packets] or [method send_packet_await_packets]. ## Filtering results using [param details] can also lead to soft-locking when too specific; make ## sure the expected packet [i]will[/i] eventually be received, and you don't need the code -## following this call to run until the packet is received. +## following this call to run until the packet is received.[/warning] func await_packet(type: Packet, req_i := 0, details := {}) -> InSimPacket: details["req_i"] = req_i return await _await_packet(type, details) @@ -1063,10 +1063,10 @@ func await_packet(type: Packet, req_i := 0, details := {}) -> InSimPacket: ## Awaits and returns [param number] packets of the given [param type]. All packets must have ## the given [param req_i] and are further filtered by [param details]. See [method await_packet] ## for more details about filtering packets.[br] -## [b]Note:[/b] As your code awaits for the given amount of packets, this can be used to easily +## [note]As your code awaits for the given amount of packets, this can be used to easily ## wait for a specific number of events, e.g. wait until 5 players join the track after some event; ## on the other hand, it also means you can soft-lock your code, depending on where you use -## this method. +## this method.[/note] func await_packets(type: Packet, number: int, req_i := 0, details := {}) -> Array[InSimPacket]: print_verbose("Awaiting %d packet%s of type %s" % [ number, "s" if number > 1 else "", Packet.keys()[Packet.values().find(type)] @@ -1121,12 +1121,12 @@ func get_player_name(plid: int) -> String: ## Attempts to connect to InSim at the given [param address] and [param port], with the ## specified [param init_data]. If [param use_udp] is [code]true[/code], a UDP connection will be ## used instead of TCP.[br] -## [b]Note:[/b] Using TCP is generally the preferred solution to prevent missing or unordered +## [note]Using TCP is generally the preferred solution to prevent missing or unordered ## packets; UDP should be reserved for cases where you want minimal latency and don't mind losing -## some packets.[br] -## [b]Tip:[/b] You can set the [member InSimInitializationData.udp_port] to request [InSimNLPPacket] +## some packets.[/note][br] +## [tip]You can set the [member InSimInitializationData.udp_port] to request [InSimNLPPacket] ## or [InSimMCIPacket] updates via UDP while using a TCP connection for other packets. Read -## [code]InSim.txt[/code] for more details. +## [code]InSim.txt[/code] for more details.[/tip] func initialize( address: String, port: int, init_data: InSimInitializationData, use_udp := false ) -> void: @@ -1199,7 +1199,7 @@ func send_message(message: String, sender := "InSim") -> void: ## Sends a UTF8-formatted message to a specific connection, identified by its [param ucid]. ## A value of 255 will send the message to everyone.[br] -## [b]Note:[/b] On a local [InSim] instance, [method send_local_message] is called instead. +## [note]On a local [InSim] instance, [method send_local_message] is called instead.[/note] func send_message_to_connection( ucid: int, message: String, sound := InSim.MessageSound.SND_SILENT, sender := "InSim" ) -> void: @@ -1215,7 +1215,7 @@ func send_message_to_connection( ## Sends a UTF8-formatted message to a specific player, identified by their [param plid].[br] -## [b]Note:[/b] On a local [InSim] instance, [method send_local_message] is called instead. +## [note]On a local [InSim] instance, [method send_local_message] is called instead.[/note] func send_message_to_player( plid: int, message: String, sound := InSim.MessageSound.SND_SILENT, sender := "InSim" ) -> void: @@ -1330,10 +1330,10 @@ func add_multi_button( ## [param size]. Internally, this function calls [method InSimButtonManager.add_solo_button].[br] ## If you set [param type_in] to a value greater than [code]0[/code], the ## [constant InSim.ButtonStyle.ISB_CLICK] flag is automatically added to [param style].[br] -## [b]Note:[/b] This function allows you to create a single button, i.e. fixed data for +## [note]This function allows you to create a single button, i.e. fixed data for ## a given UCID (including [constant UCID_ALL]) and a given (generated) clickID. ## If you want to send a button to multiple players (or everyone), and possibly customize -## the contents for every player, use [method add_multi_button] instead. +## the contents for every player, use [method add_multi_button] instead.[/note] func add_solo_button( ucid: int, position: Vector2i, size: Vector2i, style: int, text: String, button_name := "", type_in := 0, caption := "", show_everywhere := false, sender := "InSim", @@ -1386,9 +1386,9 @@ func enable_buttons_for_ucid(ucid: int) -> void: ## [code]null[/code] if no matching button is found. If [param retry_with_ucid_all] ## is [code]true[/code], and no button was found, attempts to find the [param click_id] ## for [constant UCID_ALL].[br] -## [b]Important:[/b] If a single UCID mapping from an [InSimMultiButton] matches, +## [important]If a single UCID mapping from an [InSimMultiButton] matches, ## the button is returned, including all UCID mappings; if you are using this method -## to delete buttons, make sure not to delete more buttons than intended. +## to delete buttons, make sure not to delete more buttons than intended.[/important] func get_button_by_id(click_id: int, ucid: int, retry_with_ucid_all := false) -> InSimButton: return button_manager.get_button_by_id(click_id, ucid, retry_with_ucid_all) @@ -1397,8 +1397,8 @@ func get_button_by_id(click_id: int, ucid: int, retry_with_ucid_all := false) -> ## the given [param ucid], or [code]null[/code] if no matching button is found. ## If [param ucid] is equal to [code]-1[/code], it is ignored, and all UCIDs become valid ## for matching the button.[br] -## [b]Note:[/b] If multiple buttons have the same name, the returned button may not be -## the expected one; you should always make sure to give unique names to your buttons. +## [note]If multiple buttons have the same name, the returned button may not be the +## expected one; you should always make sure to give unique names to your buttons.[/note] func get_button_by_name(button_name: StringName, ucid := -1) -> InSimButton: return button_manager.get_button_by_name(button_name, ucid) @@ -1407,9 +1407,9 @@ func get_button_by_name(button_name: StringName, ucid := -1) -> InSimButton: ## defined by [param click_id] and [param click_max] (both ends inclusive) for the ## given [param ucids], or an empty array if no matching button is found. If [param ucids] ## is empty, all UCIDs are valid for matching.[br] -## [b]Important:[/b] If a single UCID mapping from an [InSimMultiButton] matches, -## the complete button is included in the array; if you are using this method to delete -## buttons, make sure not to delete more buttons than intended. +## [important]If a single UCID mapping from an [InSimMultiButton] matches, the complete +## button is included in the array; if you are using this method to delete buttons, +## make sure not to delete more buttons than intended.[/important] func get_buttons_by_id_range( click_id: int, click_max := 0, ucids: Array[int] = [] ) -> Array[InSimButton]: diff --git a/addons/godot_insim/src/insim/packet/insim_mso_packet.gd b/addons/godot_insim/src/insim/packet/insim_mso_packet.gd index 610bd74..e62cd37 100644 --- a/addons/godot_insim/src/insim/packet/insim_mso_packet.gd +++ b/addons/godot_insim/src/insim/packet/insim_mso_packet.gd @@ -15,8 +15,8 @@ var plid := 0 ## Player's unique id (if zero, use [member ucid]) var user_type := InSim.MessageUserValue.MSO_SYSTEM ## @experimental: This property is unreliable, use [method LFSText.get_mso_start] instead. ## First character of the actual text (after player name)[br] -## [b]Warning:[/b] If the sender's name contains non-latin or multi-byte characters, the count -## will be off. +## [warning]If the sender's name contains non-latin or multi-byte characters, the count +## will be off.[/warning] var text_start := 0 var msg := "" ## Message contents (4, 8, 12... 128 characters - last byte is zero) diff --git a/addons/godot_insim/src/insim/packet/insim_sch_packet.gd b/addons/godot_insim/src/insim/packet/insim_sch_packet.gd index 0719483..93116db 100644 --- a/addons/godot_insim/src/insim/packet/insim_sch_packet.gd +++ b/addons/godot_insim/src/insim/packet/insim_sch_packet.gd @@ -3,10 +3,10 @@ extends InSimPacket ## Single CHaracter packet ## ## This packet is sent to simulate a single key press, with optional modifiers.[br] -## [b]Note:[/b] You can send individual key presses to LFS with this packet. +## [note]You can send individual key presses to LFS with this packet. ## For standard keys (e.g. V and H) you should send a capital letter. ## This does not work with some keys like F keys, arrows or CTRL keys. -## You can also use [InSimMSTPacket] with the /press /shift /ctrl /alt commands. +## You can also use [InSimMSTPacket] with the /press /shift /ctrl /alt commands.[/note] const PACKET_SIZE := 8 ## Packet size const PACKET_TYPE := InSim.Packet.ISP_SCH ## The packet's type, see [enum InSim.Packet]. diff --git a/addons/godot_insim/src/insim/packet/insim_sfp_packet.gd b/addons/godot_insim/src/insim/packet/insim_sfp_packet.gd index 249c1be..f3975c1 100644 --- a/addons/godot_insim/src/insim/packet/insim_sfp_packet.gd +++ b/addons/godot_insim/src/insim/packet/insim_sfp_packet.gd @@ -3,10 +3,10 @@ extends InSimPacket ## State Flags Pack ## ## This packet is sent to update some [enum InSim.State] flags.[br] -## [b]Note:[/b] Only the following states can be set with this packet: +## [note]Only the following states can be set with this packet: ## [constant InSim.State.ISS_SHIFTU_NO_OPT], [constant InSim.State.ISS_SHOW_2D], ## [constant InSim.State.ISS_MPSPEEDUP], [constant InSim.State.ISS_SOUND_MUTE]; other states -## must be set by using keypresses or messages. +## must be set by using keypresses or messages.[/note] const PACKET_SIZE := 8 ## Packet size const PACKET_TYPE := InSim.Packet.ISP_SFP ## The packet's type, see [enum InSim.Packet]. diff --git a/addons/godot_insim/src/insim/relay/insim_relay_packet.gd b/addons/godot_insim/src/insim/relay/insim_relay_packet.gd index 6ff8896..4c95383 100644 --- a/addons/godot_insim/src/insim/relay/insim_relay_packet.gd +++ b/addons/godot_insim/src/insim/relay/insim_relay_packet.gd @@ -3,7 +3,7 @@ extends InSimPacket ## InSim Relay packet ## ## Base packet for InSim Relay specific packets.[br] -## [b]Note:[/b] InSim Relay packets are technically identical to standard InSim packets. +## [note]InSim Relay packets are technically identical to standard InSim packets.[/note] const RELAY_SIZE_MULTIPLIER := 1 diff --git a/addons/godot_insim/src/lfs_packet.gd b/addons/godot_insim/src/lfs_packet.gd index 57c5b8a..834f088 100644 --- a/addons/godot_insim/src/lfs_packet.gd +++ b/addons/godot_insim/src/lfs_packet.gd @@ -6,9 +6,9 @@ extends RefCounted ## facilitate reading and writing data.[br] ## This class is generally not intended to be used directly, instead prefer using [InSimPacket], ## [OutSimPacket] or [OutGaugePacket] as needed for your application.[br] -## [b]Tip:[/b] While generally not intended to be used directly, this class can be used as a -## base for custom data structures that need to be encoded with specific types: see for instance -## [CarInfo] or [PTHFile], among others. +## [tip]While generally not intended to be used directly, this class can be used as a base +## for custom data structures that need to be encoded with specific types: see for instance +## [CarInfo] or [PTHFile], among others.[/tip] ## The packet's raw data buffer. var buffer := PackedByteArray() diff --git a/addons/godot_insim/src/lyt/lyt_object.gd b/addons/godot_insim/src/lyt/lyt_object.gd index 4023d19..389dff9 100644 --- a/addons/godot_insim/src/lyt/lyt_object.gd +++ b/addons/godot_insim/src/lyt/lyt_object.gd @@ -179,8 +179,8 @@ func _update_flags() -> void: ## Override this function to define the behavior corresponding to the [LYTObject]. ## Object flags have different meanings depending on the object type.[br] -## [b]Note:[/b] Updating [code]gis_*[/code] variables from LFS-style flags is not necessary -## as those get updated via the original variables' setter functions. +## [note]Updating [code]gis_*[/code] variables from LFS-style flags is not necessary +## as those get updated via the original variables' setter functions.[/note] func _update_flags_from_gis() -> void: pass diff --git a/addons/godot_insim/src/outgauge/outgauge.gd b/addons/godot_insim/src/outgauge/outgauge.gd index f48408b..bb14a70 100644 --- a/addons/godot_insim/src/outgauge/outgauge.gd +++ b/addons/godot_insim/src/outgauge/outgauge.gd @@ -3,8 +3,8 @@ extends Node ## OutGauge interface ## ## You can add an [OutGauge] node to any scene to enable reading data from LFS.[br] -## [b]Note:[/b] OutGauge requires some setup in the [code]cfg.txt[/code] file; you can find more -## details in the [code]docs/InSim.txt[/code] file, in the section pertaining to OutGauge. +## [note]OutGauge requires some setup in the [code]cfg.txt[/code] file; you can find more +## details in the [code]docs/InSim.txt[/code] file, in the section pertaining to OutGauge.[/note] ## Emitted when a packet is received. You should connect to this signal if you plan to use OutGauge. signal packet_received(packet: OutGaugePacket) @@ -28,8 +28,8 @@ func _ready() -> void: ## Closes the [OutGauge] connection, disabling packet reading.[br] -## [b]Note:[/b] As OutGauge data is transmitted over UDP, there is no connection per se; this simply -## means the [OutGauge] instance will stop listening to packets. +## [note]As OutGauge data is transmitted over UDP, there is no connection per se; this simply +## means the [OutGauge] instance will stop listening to packets.[/note] func close() -> void: _lfs_connection._disconnect_from_host() diff --git a/addons/godot_insim/src/outsim/outsim.gd b/addons/godot_insim/src/outsim/outsim.gd index 5cc63d2..54d6db0 100644 --- a/addons/godot_insim/src/outsim/outsim.gd +++ b/addons/godot_insim/src/outsim/outsim.gd @@ -3,9 +3,9 @@ extends Node ## OutSim interface ## ## You can add an [OutSim] node to any scene to enable reading data from LFS.[br] -## [b]Note:[/b] OutSim requires some setup in the [code]cfg.txt[/code] file; you can find more +## [note]OutSim requires some setup in the [code]cfg.txt[/code] file; you can find more ## details in the [code]docs/InSim.txt[/code] file, in the section pertaining to OutSim, as well as -## the [code]docs/OutSimPack.txt[/code] for packet details. +## the [code]docs/OutSimPack.txt[/code] for packet details.[/note] ## Emitted when a packet is received. You should connect to this signal if you plan to use OutSim. signal packet_received(packet: OutSimPacket) @@ -43,8 +43,8 @@ func _ready() -> void: ## Closes the [OutSim] connection, disabling packet reading.[br] -## [b]Note:[/b] As OutSim data is transmitted over UDP, there is no connection per se; this simply -## means the [OutSim] instance will stop listening to packets. +## [note]As OutSim data is transmitted over UDP, there is no connection per se; this simply +## means the [OutSim] instance will stop listening to packets.[/note] func close() -> void: _lfs_connection._disconnect_from_host() diff --git a/addons/godot_insim/src/pth/pth_node.gd b/addons/godot_insim/src/pth/pth_node.gd index 3584493..2d1ee62 100644 --- a/addons/godot_insim/src/pth/pth_node.gd +++ b/addons/godot_insim/src/pth/pth_node.gd @@ -26,12 +26,12 @@ var limit_left := 0.0 ## Right overall limit. var limit_right := 0.0 ## Left driving area limit.[br] -## [b]Note:[/b] Official PTH files may not follow actual track limits, some corners exclude part of -## the track limits area, while others go well beyond the white lines. +## [note]Official PTH files may not follow actual track limits, some corners exclude part of +## the track limits area, while others go well beyond the white lines.[/note] var drive_left := 0.0 ## Right driving area limit.[br] -## [b]Note:[/b] Official PTH files may not follow actual track limits, some corners exclude part of -## the track limits area, while others go well beyond the white lines. +## [note]Official PTH files may not follow actual track limits, some corners exclude part of +## the track limits area, while others go well beyond the white lines.[/note] var drive_right := 0.0 ## The node's reference point, typically found on the racing line. diff --git a/addons/godot_insim/src/smx/smx_file.gd b/addons/godot_insim/src/smx/smx_file.gd index e2b2a81..bdcfbd3 100644 --- a/addons/godot_insim/src/smx/smx_file.gd +++ b/addons/godot_insim/src/smx/smx_file.gd @@ -146,11 +146,10 @@ func get_mesh() -> Node3D: ## Performs a raycast query against the SMX mesh and, if an intersection is found, updates ## the [param mesh]'s position and orientation to match the ground's altitude and normal direction. ## The base position of the raycast is determined by the [param object]'s position.[br] -## [br] -## [b]Note:[/b] A check for the non-floating status of the [param object] should be performed +## [note]A check for the non-floating status of the [param object] should be performed ## prior to calling this function; as a reminder, concrete objects are always floating, and ## other objects should only be checked for ground contact if they do not have the -## [code]0x80[/code] bit set in their [member LYTObject.flags]. +## [code]0x80[/code] bit set in their [member LYTObject.flags].[/note] func place_object_on_ground(mesh: MeshInstance3D, object: LYTObject) -> void: var raycast_result := raycast_from_position(object.gis_position) if not raycast_result.is_empty(): diff --git a/addons/godot_insim/src/text_encoding/lfs_text.gd b/addons/godot_insim/src/text_encoding/lfs_text.gd index ad0b8e2..a6ccfdf 100644 --- a/addons/godot_insim/src/text_encoding/lfs_text.gd +++ b/addons/godot_insim/src/text_encoding/lfs_text.gd @@ -10,9 +10,9 @@ extends RefCounted ## The list of color codes used by LFS; also includes the reset code, which resets the code page ## in addition to the color.[br] -## [b]Warning:[/b] You should never use the reset code when sending messages: when combined with +## [warning]You should never use the reset code when sending messages: when combined with ## code pages, it can break the formatting of the message. Always use the default code when you -## want to reset colors, and let code pages handle themselves. +## want to reset colors, and let code pages handle themselves.[/warning] enum ColorCode { BLACK, RED, @@ -398,9 +398,10 @@ static func get_regex_color_bbcode() -> RegEx: return RegEx.create_from_string(r"\[color=#([A-Fa-f\d]+)\](.+?)\[/color\]") -## Returns a regular expression matching LFS color codes ([code]^0[/code] through [code]^9[/code]). -## [br][b]Note:[/b] The expression also matches [code]^^[/code] to prevent false positives -## such as [code]^^1[/code], so results should be filtered accordingly. +## Returns a regular expression matching LFS color codes ([code]^0[/code] through +## [code]^9[/code]).[br] +## [note]The expression also matches [code]^^[/code] to prevent false positives +## such as [code]^^1[/code], so results should be filtered accordingly.[/note] static func get_regex_color_lfs() -> RegEx: return RegEx.create_from_string(r"\^(\^|\d)") diff --git a/addons/godot_insim/src/utils/gis_camera.gd b/addons/godot_insim/src/utils/gis_camera.gd index 7c1ecb0..52f74f3 100644 --- a/addons/godot_insim/src/utils/gis_camera.gd +++ b/addons/godot_insim/src/utils/gis_camera.gd @@ -5,17 +5,16 @@ extends RefCounted ## This class provides utility functions to manipulate Godot cameras from LFS via [InSimCPPPacket] ## and [code]/cp[/code] strings, and to set LFS's camera from a Godot camera.[br] ## [br] -## [b]Warning:[/b] LFS uses horizontal FoV in order to make multi-monitor setups -## easy to work with. Godot, on the other hand, defaults to vertical FoV; you can either switch -## cameras to [code]Keep Width[/code], and ignore the [code]aspect_ratio[/code] parameter in -## conversion functions (as long as your application window has the same aspect ratio as LFS), -## or keep the default [code]Keep Height[/code] and provide the aspect ratio. -## The expected use in both cases is to have the same aspect ratio on both LFS and Godot.[br] -## [br] -## [b]Tip:[/b] The functions in this class do not convert from LFS coordinates -## (Y forward, Z up) to Godot coordinates (Y up, Z backward); if you want your scene to still -## have Y up, the easiest way to obtain the expected result is to have your entire scene -## parented to a [Node3D] rotated -90 degrees. +## [warning]LFS uses horizontal FoV in order to make multi-monitor setups easy to work with. +## Godot, on the other hand, defaults to vertical FoV; you can either switch cameras to +## [code]Keep Width[/code], and ignore the [code]aspect_ratio[/code] parameter in conversion +## functions (as long as your application window has the same aspect ratio as LFS), or keep +## the default [code]Keep Height[/code] and provide the aspect ratio. The expected use in +## both cases is to have the same aspect ratio on both LFS and Godot.[/warning][br] +## [tip]The functions in this class do not convert from LFS coordinates (Y forward, Z up) +## to Godot coordinates (Y up, Z backward); if you want your scene to still have Y up, +## the easiest way to obtain the expected result is to have your entire scene parented to +## a [Node3D] rotated -90 degrees.[/tip] ## Returns a [code]/cp[/code] string that can be pasted into LFS to set its camera, ## based on the passed [param camera]. [param aspect_ratio] is used to correct for horizontal fov diff --git a/addons/godot_insim/src/utils/gis_viewer.gd b/addons/godot_insim/src/utils/gis_viewer.gd index f6102f0..d440dad 100644 --- a/addons/godot_insim/src/utils/gis_viewer.gd +++ b/addons/godot_insim/src/utils/gis_viewer.gd @@ -3,15 +3,15 @@ extends Node ## ## An autoload providing utility functions related to 2D and 3D display of [InSim] and LFS entities. ## For instance, you can generate top-down images of a track configuration's [PTHFile].[br] -## [b]Note:[/b] The GodotInSim plugin automatically enables this autoload, which means the plugin -## itself must be enabled to be able to use the provided functions. +## [note]The GodotInSim plugin automatically enables this autoload, which means the plugin +## itself must be enabled to be able to use the provided functions.[/note] ## Saves a top-down image of the PTH mesh as returned by [method PTHFile.get_2d_mesh] to a ## transparent PNG file. The final image is a [param size] pixels wide square, representing a ## 4096x4096 meter area; the default [param size] of 2048 corresponds to 2 meters per pixel.[br] ## The optional parameters allow customizing the resulting image's appearance.[br] -## [b]Note:[/b] The image size must be in the range 64-16384. +## [note]The image size must be in the range 64-16384.[/note] func save_pth_to_png( pth_file: PTHFile, image_path: String, size := 2048, include_line := true, include_road := true, include_limits := true, line_width := 1.0, line_color := Color.RED, -- GitLab