mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-23 23:26:06 +02:00
Plugins: what the Filmer needs as a plugin: carry, who sees a pose, a step in the camera cycle
PR 343's Filmer becomes a Luau plugin mod (kept in contrib/plugins/filmer) on general APIs instead of
its own C++:
- reskate.skater.carry: something held out in one or both hands and aimed, the body crouched (feet
kept) and hunched over it, turned on the spot after it (Extension/Skater/carry.cpp, from the PR's
filmer_hold.cpp, with tests)
- shown = "everyone" | "others" | "me" on skater.pose, reach and carry: the pose sent to the other
players and the one drawn here are split when asked
- reskate.camera.cycle and the camera_cycle event: a plugin's camera as the last step of the camera
height button's cycle, after first person
- reskate.session.nametags(false) holds the names over the other players off
- board.hide(bone, {others = true}) hides it in the board the others are sent too (a sent-pose filter)
- outfit.set takes hand wear slots; input.bind takes an action with no key of its own
This commit is contained in:
1 parent
8ede361755
commit
118c489fdb
25 files changed
+1449
-89
No files matched your search
@@ -1276,12 +1276,22 @@ constexpr ULONGLONG cycle_flags_lifetime_ms = 250;
|
||||
bool first_person_camera_height_write(bool high) noexcept {
|
||||
const auto published = cycle_published.load(std::memory_order_acquire);
|
||||
const auto flags = cycle_flags.load(std::memory_order_acquire);
|
||||
// A plugin's camera in the cycle (reskate.camera.cycle), last; its flags come from the plugin runtime.
|
||||
auto& plugin = first_person::plugin_link;
|
||||
const auto plugin_published = plugin.published.load(std::memory_order_acquire);
|
||||
const auto plugin_flags = plugin.flags.load(std::memory_order_acquire);
|
||||
const auto now = GetTickCount64();
|
||||
if (now < published || now - published > cycle_flags_lifetime_ms) return high;
|
||||
const bool fresh = now >= published && now - published <= cycle_flags_lifetime_ms;
|
||||
const bool plugin_fresh = now >= plugin_published && now - plugin_published <= cycle_flags_lifetime_ms;
|
||||
if (!fresh && !plugin_fresh) return high;
|
||||
const auto write = first_person::cycle_height_write(
|
||||
{(flags & cycle_enabled) != 0, (flags & cycle_first_person) != 0, (flags & cycle_can_enter) != 0}, high);
|
||||
{fresh && (flags & cycle_enabled) != 0, fresh && (flags & cycle_first_person) != 0, fresh && (flags & cycle_can_enter) != 0,
|
||||
plugin_fresh && (plugin_flags & first_person::plugin_flag_enabled) != 0, plugin_fresh && (plugin_flags & first_person::plugin_flag_on) != 0,
|
||||
plugin_fresh && (plugin_flags & first_person::plugin_flag_can_enter) != 0},
|
||||
high);
|
||||
if (write.step != first_person::CycleStep::none)
|
||||
cycle_request.store(static_cast<std::uint8_t>(write.step), std::memory_order_release);
|
||||
if (write.plugin != first_person::CycleStep::none) plugin.request.store(static_cast<std::uint8_t>(write.plugin), std::memory_order_release);
|
||||
return write.high;
|
||||
}
|
||||
void first_person_cycle_tick(SourceTrial& trial, std::uintptr_t client, bool can_control, bool phase, DWORD error) {
|
||||
|
||||
Reference in new issue
Block a user