Core utilities for Godot 4.x addons by Standstill Digital Media.
Standstill Core provides shared classes used by Dingus and Buttered Sausage. Install this addon first if you're using either of those projects.
- Download or clone this repository
- Copy the
addons/SSDMCorefolder into your project'saddons/directory - No plugin activation required - classes are available globally via
class_name
Severity levels for categorizing operation results and messages.
enum Level {
SUCCESS, # Operation completed successfully
INFO, # Informational message
WARNING, # Warning - operation succeeded with caveats
ERROR # Error - operation failed
}A result object implementing the Result pattern for fluent error handling. Encapsulates operation outcomes with message, data, error code, and severity.
# Static constructors
var result = SSDMResult.success("File saved successfully", saved_data)
var result = SSDMResult.failure("Could not open file", null, ERR_FILE_NOT_FOUND)
var result = SSDMResult.warning("File saved with warnings")
var result = SSDMResult.info("Processing started")Chain methods to accumulate details:
var result = SSDMResult.success("Batch operation complete")
.with_info("Processed 10 files")
.with_warning("2 files were skipped")
.with_error("1 file failed to save", ERR_FILE_CANT_WRITE)Convert between result states while preserving accumulated details:
var result = SSDMResult.success("Starting operation")
.with_info("Step 1 complete")
.with_info("Step 2 complete")
.to_failure("Step 3 failed", ERR_INVALID_DATA)Combine results from nested operations:
func process_all() -> SSDMResult:
var result = SSDMResult.success("All items processed")
for item in items:
var item_result = process_item(item)
if not item_result.is_success():
result.merge_from(item_result, false) # Keep our message, add their details
if result.has_details():
result.to_warning("Completed with issues")
return resultif result.is_success():
print(result.data)
else:
print("Error: ", result.message)
for detail in result.details:
print(" - ", detail.message)- Dingus: Requires Standstill Core. Uses SSDMResult for resource manager operations.
- Buttered Sausage: Requires Standstill Core. Can display SSDMResult objects as animated message panels via
ButteredSausageDisplay.populate_from_result(result).
CC0 1.0 Universal (CC0 1.0) Public Domain Dedication - See LICENSE file for details.