mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-25 06:04:41 +01:00
Throwdowns: plugin modes on the native Throwdowns page, which is SmokeyDawg58's logo grid
reskate.throwdowns.mode{...} adds a mode to the game's own Throwdowns page: a card on
the picker, the real Spot Battle setup page relabelled with the mode's name, logo,
description, players, timer and rows (sliders, choices, buttons), and the native start
flag. The plugin hears throwdown_mode events (opened, setting, button, placed with the
flag's position and heading, start, leave, cancelled) and runs the mode itself;
release_flag takes the flag down. The flag's queue never starts a Spot Battle: its
waiting card's Start goes to the plugin, MaxPlayers is held at 10 and it is never
relayed as a drop. After SmokeyDawg58's one_up_menu and one_up_placement
(reskate-custom-mods), generalised over a mode registry.
The page is his 4-column logo grid whether or not a plugin has a mode. Its widgets and
grid records, and the game assets it uses that only some levels load, ship in
ReSkate.dll as the throwdown_menu built-in pack, taken from his asset mod's FBMOD
(dingosdk_ebx_pick trims the asset list in place). A mode's logo is a texture path in
its own mod, so no mod edits the shared list. The FPV drone is no longer a built-in pack.
Native menu data: text initialization, change-only writes, retained array publication,
owned-model rollback. Tests: registry and setup helpers, the plugin API, a test plugin
with two modes.
This commit is contained in:
1 parent
89281f62fb
commit
0ff96018d0
33 files changed
+3013
-16
No files matched your search
@@ -2,6 +2,7 @@
|
||||
#include "native_menu_internal.h"
|
||||
#include "native_menu_dump.h"
|
||||
#include "ui_sound.h"
|
||||
#include "throwdown_menu.h"
|
||||
#include "Extension/Multiplayer/Session/session.h"
|
||||
#include "Extension/Multiplayer/Hud/game_ui_state.h"
|
||||
#include "Engine/Core/Log/logging.h"
|
||||
@@ -626,6 +627,7 @@ void tick_page(std::uintptr_t base, bool loading) noexcept {
|
||||
s.next_render = 0;
|
||||
}
|
||||
bool prepare_native_menu_level_load(std::uintptr_t base) noexcept {
|
||||
if (!release_native_throwdown_menu(base)) return false;
|
||||
if (std::all_of(page_slots.begin(), page_slots.end(), [](unsigned slot) { return page_state(slot).owned_models.empty(); }))
|
||||
return true;
|
||||
try {
|
||||
@@ -720,6 +722,7 @@ void tick_native_menu(std::uintptr_t base, bool loading) noexcept {
|
||||
// (Read here: it takes the UI model's lock, which a page's tick then holds.)
|
||||
game_in_menu.store(!loading && sample_game_ui_state(base).in_menu, std::memory_order_relaxed);
|
||||
if (lifetime.blocked()) return;
|
||||
tick_native_throwdown_menu(base, loading);
|
||||
for (unsigned slot = 0; slot < page_count; ++slot) {
|
||||
current_state = &page_state(slot);
|
||||
current_state->slot = slot;
|
||||
|
||||
Reference in new issue
Block a user