Optimized Docs (#7)

Authored-by: Dennis Ploeger <develop@dieploegers.de>
This commit is contained in:
Dennis Ploeger
2021-06-22 23:06:20 +02:00
committed by GitHub
parent d5a0022b7b
commit 58d880101d
111 changed files with 6362 additions and 801 deletions

View File

@@ -1,8 +1,10 @@
# `camera_set_limits camlimits_id`
#
# Sets the camera limits to the one defined under `camlimits_id` in ESCRoom's
# camera_limits array.
# - camlimits_id : int : id of the camera limits to apply (defined in ESCRoom's
# camera_limits array)
#
# @ESC
extends ESCBaseCommand
class_name CameraSetLimitsCommand

View File

@@ -1,6 +1,8 @@
# `enable_terrain node_name`
#
# Enable the ESCTerrain's NavigationPolygonInstance defined by given node name.
# Disables previously activated NavigationPolygonInstance.
#
# @ESC
extends ESCBaseCommand
class_name EnableTerrainCommand

View File

@@ -4,20 +4,27 @@ class_name ESCCondition
# Valid comparison types
enum {COMPARISON_NONE, COMPARISON_EQ, COMPARISON_GT, COMPARISON_LT}
enum {
COMPARISON_NONE,
COMPARISON_EQ,
COMPARISON_GT,
COMPARISON_LT,
COMPARISON_ACTIVITY
}
# Regex that matches condition lines
const REGEX = \
'^(?<is_negated>!)?(?<comparison>eq|gt|lt)? ?' +\
'(?<is_inventory>i\/)?(?<flag>[^ ]+)( (?<comparison_value>.+))?$'
'^(?<is_negated>!)?(?<comparison>eq|gt|lt)? ?(?<is_inventory>i\/)?' + \
'(?<is_activity>a\/)?(?<flag>[^ ]+)( (?<comparison_value>.+))?$'
const COMPARISON_DESCRIPTION = [
"Checking if %s %s %s true%s",
"Checking if %s %s %s equals %s",
"Checking if %s %s %s greater than %s",
"Checking if %s %s %s less than %s"
"Checking if %s %s %s less than %s",
"Checking if %s is %s active%s"
]
@@ -73,6 +80,8 @@ func _init(comparison_string: String):
)
if "is_inventory" in result.names:
self.inventory = true
if "is_activity" in result.names:
self.comparison = COMPARISON_ACTIVITY
if "flag" in result.names:
self.flag = escoria.utils.get_re_group(result, "flag")
else:
@@ -93,7 +102,8 @@ func run() -> bool:
"inventory item" if self.inventory else "global value",
self.flag,
"is not" if self.negated else "is",
"" if self.comparison == COMPARISON_NONE else self.comparison_value
"" if self.comparison in [COMPARISON_NONE, COMPARISON_ACTIVITY] \
else self.comparison_value
]
)
@@ -119,6 +129,10 @@ func run() -> bool:
escoria.globals_manager.get_global(global_name) < \
self.comparison_value:
return_value = true
elif self.comparison == COMPARISON_ACTIVITY and \
escoria.object_manager.has_object(global_name) and \
escoria.object_manager.get_object(global_name).active:
return_value = true
if self.negated:
return_value = not return_value

View File

@@ -15,6 +15,7 @@ const END_REGEX = \
# Dialog type
# FIXME, currently unused, but needs reimplementation
var type: String = ""
# Avatar used in the dialog