Files
ReSkate/Extension/UI/Overlay/scripted_pad.h
T
AyeZeeBB dce293e25d Fit Check as a plugin: screen capture, the menu's preview turned and read, and what the skater wears
Pull request 326 split into general plugin APIs and contrib/plugins/fit-check:
- reskate.capture (start, stop, discard, state, compare, kept, save): the screen
  recorded before the overlay draws, cut out by the game's depth or by colour,
  saved as GIF, APNG, PNG or WebM with an optional card; the "capture" permission.
- reskate.room.turn: a stand-in pad's stick held over to turn the menu's preview.
- reskate.menu.game and reskate.menu.grid: what the game's menu and its item grid show.
- reskate.outfit.worn, board and title: what the skater wears, by name.
- reskate.files.reveal: a data folder opened in Explorer.
The plugin finds where the turn comes round, eases the stick off, picks evenly
spaced frames and saves them with the board's parts or the outfit on the card.
2026-10-21 17:16:56 -05:00

27 lines
1.3 KiB
C++

#pragma once
#include <Windows.h>
#include <Xinput.h>
#include <cstdint>
#include <vector>
// A scripted Xbox pad for player 0, read by the game through the XInput hook (PR 297, after PR 230 by
// Norms): the character room's walk presses RB on it (Extension/World/character_room.cpp). Not for
// plugins: they never press the game's buttons.
namespace dingosdk::overlay {
struct PadStep {
std::uint32_t tick{}; // game ticks from the start of the script
XINPUT_GAMEPAD pad{};
};
// Any thread. Starts at the next game tick; each step holds until the next step's tick, so frame rate does not matter.
// After the last step the pad stays connected and neutral for 2 s.
void play_pad(std::vector<PadStep> steps);
// The game thread calls this once a game tick.
void pad_tick() noexcept;
// True when it wrote the script's pad to `state`.
bool scripted_pad(DWORD user, XINPUT_STATE &state) noexcept;
// One stick of the stand-in pad held at `value` (-1..1) for `milliseconds` more, the pad otherwise
// neutral, for turning the game menu's preview (reskate.room.turn); 0 lets go. `stick`: 0 left x,
// 1 left y, 2 right x, 3 right y. A script playing (play_pad) comes first. Any thread.
void hold_stick(int stick, float value, unsigned milliseconds) noexcept;
} // namespace dingosdk::overlay