mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-24 07:26:13 +02:00
- overlay: reskate.on("draw", function(d) ...) each tick, with text, rect, line, circle, poly
and world_text, world_line, world_circle (projected through the camera as the frame draws),
size and world_to_screen; 4000 shapes a frame. reskate.ui.toast through ReSkate's notices, three
in 5 s. Images are left for later: they need texture slots in the overlay's renderer.
- menu: reskate.menu.panel(title, build) on a new PLUGINS tab of the ADDONS page, with heading,
label, separator, button, toggle, slider and dropdown, built ten times a second while it shows.
- audio.ui: the game's menu sounds by name, ten a second. mods.read: installed(name) and list(),
from the discovery thread's scan.
- session.read: active, is_dedicated, players, me, host, and player_joined / player_left.
net.session: send(to, message) to the same plugin on other games (by its manifest.json name) in
the session's throwdown packets, tagged 0xD1 (plugin_wire.h); 4 KB each, 16 KB a second.
- The overlay and the host share plugin_ui.h (shapes, panels, actions) and plugin_camera.h.
- Fixed: the overlay asked ImGui for the window's size before its context existed, which crashed
on the first frames; it now reads the size from the context.
- reskate-test has overlay (ptest hud), menu, audio, mods and session (ptest ping) modules;
reskate-hostile has draw-flood, toast-spam, sound-spam, message-flood and panel-loop.
Checked in game: ptest all 62 passed, 0 failed; the test HUD, the PLUGINS tab and its panel; every
hostile attack stopped or refused, trick-loop and panel-loop included. Not yet: ptest ping with a
second player.
33 lines
1.5 KiB
C++
33 lines
1.5 KiB
C++
#pragma once
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
// Plugins in the game (Extension/Plugins): Luau scripts in mods, each in its own sandboxed VM
|
|
// (plugin_vm.h), run on the client tick. A thread looks for plugins every 2 s, so a mod switched
|
|
// on or off, or a plugin's files changed, takes effect without a restart.
|
|
//
|
|
// Every function but start is for the client thread, the one that runs console commands.
|
|
namespace dingosdk::plugins {
|
|
// Once, at startup, with the game's image base (the score HUD is read from it). Plugins load at the
|
|
// first client tick after discovery finds them.
|
|
bool start(std::uintptr_t image_base) noexcept;
|
|
void on_client_tick() noexcept;
|
|
// The level being played, or empty without one: plugins hear level_loaded and level_unloading.
|
|
void set_level(std::string_view level) noexcept;
|
|
// Runs a plugin's console command when the text starts with one. False when none matched, and
|
|
// the text goes to ReSkate's own commands.
|
|
bool run_console(const std::string& text) noexcept;
|
|
// The session's throwdown packets that are plugin messages (plugin_wire.h), and those plugins send.
|
|
// Client thread, from the session's tick.
|
|
void receive_message(std::uint64_t sender, const std::vector<std::uint8_t>& bytes) noexcept;
|
|
std::vector<std::vector<std::uint8_t>> take_outgoing() noexcept;
|
|
// The `plugin` console commands.
|
|
std::string describe();
|
|
std::string list_commands();
|
|
std::string reload(std::string_view id);
|
|
std::string switch_off(std::string_view id);
|
|
std::string switch_on(std::string_view id);
|
|
}
|