mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-24 15:56:18 +02:00
A mod's item (or one of the game's own a mod changes) keeps three empty description lines, so the game's item card, which grows upward from a fixed bottom edge, always has room in the same place; the overlay draws the mod there: its icon (decoded off the render thread into a fourth texture slot, the last 32 kept), a MOD or CHANGED BY MOD tag, its name, author, version and how many items it has. The card is placed as the game places its own, measured at many window sizes: by the smaller of its scales, a 21:9 frame centred on wider screens (the search bar follows it too). The warning sign the game's focus script gives any description is taken off that notice each tick while it shows the reserved lines. The merge's item list records each mod's version and folder (an older list falls back to the mods loaded at launch). The item grids now run every client tick instead of at the 500 ms customization pace, follow the highlight between their 40 ms passes, and let go of a grid as soon as its screen closes, so the card, the search bar and favorites keep up with the player.
37 lines
1.6 KiB
C++
37 lines
1.6 KiB
C++
#pragma once
|
|
#include "item_browser_order.h"
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
// Favorites, search and filters for the skater's item grids (Apparel, Accessories, Board, Tattoos,
|
|
// Gestures, Appearance). The grids stay the game's own: their tile rows are reordered and filtered in
|
|
// place, the way the music screen's Mods shelf filters playlist tiles (contrib/native-music-ui.md).
|
|
namespace dingosdk::overlay { struct ItemBrowserHost; }
|
|
namespace dingosdk::item_browser {
|
|
// What the overlay draws: read every presented frame (thread-safe, cheap).
|
|
struct View {
|
|
bool open{}; // an item grid has the focus
|
|
std::string search;
|
|
Filter filter{};
|
|
unsigned shown{}, total{}, favorites{}; // of the grid that has the focus
|
|
std::string focused_title, focused_key;
|
|
bool focused_favorite{};
|
|
};
|
|
View view();
|
|
// Requests from the keys, the overlay and the console; applied on the client thread.
|
|
void toggle_focused_favorite() noexcept;
|
|
void set_search(std::string text);
|
|
void set_filter(Filter filter) noexcept;
|
|
void cycle_filter() noexcept;
|
|
// The table the overlay's search bar and keys use (process lifetime).
|
|
const overlay::ItemBrowserHost* overlay_host() noexcept;
|
|
// Console research aids; their answers go to the log.
|
|
void request_status() noexcept;
|
|
void request_poke(std::string arguments);
|
|
|
|
// Client thread, from the customization update, with the profile's native mutex held.
|
|
void update(std::uintptr_t base) noexcept;
|
|
void before_level_transition(unsigned next, std::uintptr_t base) noexcept;
|
|
} // namespace dingosdk::item_browser
|