68 lines
1.4 KiB
GDScript
68 lines
1.4 KiB
GDScript
extends Object
|
||
class_name DanceRoutines
|
||
|
||
## Five authored emotes available through the radial wheel.
|
||
##
|
||
## Every entry names an imported motion-capture clip. The previous version
|
||
## synthesized five routines by oscillating individual bones over one dance
|
||
## clip; that produced the programmer-animation quality this project is moving
|
||
## away from. Network IDs stay stable so existing peers and saved selections
|
||
## remain compatible.
|
||
const ROUTINES := [
|
||
{
|
||
"id": "two_step",
|
||
"name": "Dance",
|
||
"icon": "♪",
|
||
"clip": "Dance",
|
||
},
|
||
{
|
||
"id": "body_wave",
|
||
"name": "Chest Stretch",
|
||
"icon": "◆",
|
||
"clip": "EmoteStretch",
|
||
},
|
||
{
|
||
"id": "robot",
|
||
"name": "Call Out",
|
||
"icon": "!",
|
||
"clip": "EmoteCall",
|
||
},
|
||
{
|
||
"id": "bounce",
|
||
"name": "Yes!",
|
||
"icon": "✓",
|
||
"clip": "EmoteYes",
|
||
},
|
||
{
|
||
"id": "spin",
|
||
"name": "No",
|
||
"icon": "×",
|
||
"clip": "EmoteNo",
|
||
},
|
||
]
|
||
|
||
|
||
static func count() -> int:
|
||
return ROUTINES.size()
|
||
|
||
|
||
static func get_routine(index: int) -> Dictionary:
|
||
if ROUTINES.is_empty():
|
||
return {}
|
||
return ROUTINES[posmod(index, ROUTINES.size())]
|
||
|
||
|
||
static func clip_of(index: int) -> String:
|
||
return String(get_routine(index).get("clip", "Dance"))
|
||
|
||
|
||
static func name_of(index: int) -> String:
|
||
return String(get_routine(index).get("name", ""))
|
||
|
||
|
||
static func index_of(id: String) -> int:
|
||
for i in ROUTINES.size():
|
||
if ROUTINES[i]["id"] == id:
|
||
return i
|
||
return 0
|