mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-23 21:05:58 +02:00
Plugins register modes (card, replaces, order, flag, players) and publish documents through reskate.throwdowns.ui: the setup page, the waiting card, HUD slots themed on the game's HUD_<theme>_* widgets, the match panel, flags and match restrictions. SmokeyDawg58's native plumbing (throwdown_menu.cpp and its .inl files) renders them and posts throwdown_ui events back. kit::flag is the one native flag registration. General services added for it: reskate.files, reskate.ui.dialog, reskate.skater push/hold/bone_cam, reskate.camera.pad_flight, reskate.physics competition, reskate.session.world, reskate.tricks feed/gesture, and world entities. His ten modes are now Lua in his plugin: the rules, referee and wire (td/rules, referee, wire), and every page and HUD document (td/ui*.lua). Extension/Modes and reskate.modes are gone, along with every race and 1-UP branch in the SDK. The plugin test drives each mode through kit events. A native setup page is never written to while it closes into flag placement: its rows are not republished, the stock page is put back once the exit is over, and the stock Players slider is left alone while a plugin flag is out. This fixes the crashes on the Deathrace button and on 1-UP's Confirm.
24 lines
1.2 KiB
C++
24 lines
1.2 KiB
C++
#pragma once
|
|
#include <string_view>
|
|
|
|
namespace dingosdk::multiplayer::menu_data {
|
|
enum class NativeSetupRole { other, players, timer, rounds };
|
|
|
|
// The stock Spot Battle setup rows, by their authored localization keys or the
|
|
// English captions the page can already show when it becomes ready. Only the
|
|
// stock captions: once relabelled from a plugin's setup document a row is known
|
|
// by its presenter, not its text.
|
|
inline NativeSetupRole native_setup_role(std::string_view text) noexcept {
|
|
if(text=="ID_SETTINGS_PLAYERS" || text=="Players")return NativeSetupRole::players;
|
|
if(text=="ID_LABEL_TURNTIMER" || text=="ID_LABEL_DURATION" || text=="Turn Timer" ||
|
|
text=="Timer" || text=="Duration")return NativeSetupRole::timer;
|
|
if(text=="ID_LABEL_ROUNDS" || text=="Rounds")return NativeSetupRole::rounds;
|
|
return NativeSetupRole::other;
|
|
}
|
|
// A stock row's id in a setup document's hide_native list and setup_row events.
|
|
inline constexpr std::string_view native_setup_role_id(NativeSetupRole role) noexcept {
|
|
return role==NativeSetupRole::players?"players":role==NativeSetupRole::timer?"timer":
|
|
role==NativeSetupRole::rounds?"rounds":"";
|
|
}
|
|
} // namespace dingosdk::multiplayer::menu_data
|