infra(api-gdext): 🧱 Update Rust GDExtension API functions and bindings for Godot Engine compatibility
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
eb8b82700c
commit
a9fc57d981
1 changed files with 17 additions and 0 deletions
|
|
@ -3776,6 +3776,23 @@ impl GdGameState {
|
|||
true
|
||||
}
|
||||
|
||||
/// List every registered AI controller id (sorted, ascending).
|
||||
/// Bridges `mc_player_api::registered_ids` to GDScript so the
|
||||
/// game-setup screen (Stage 8) can populate its per-slot
|
||||
/// "AI Controller" dropdowns without hardcoding the id list.
|
||||
///
|
||||
/// At engine boot the registry contains `"scripted:default"`;
|
||||
/// `ModLoader` (Stage 5) registers additional ids before this
|
||||
/// is read.
|
||||
#[func]
|
||||
fn registered_controller_ids() -> PackedStringArray {
|
||||
let mut out = PackedStringArray::new();
|
||||
for id in mc_player_api::registered_ids() {
|
||||
out.push(&GString::from(id));
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// Current turn number.
|
||||
#[func]
|
||||
fn turn(&self) -> i64 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue