Files
ReSkate/Extension/Customization/item_browser.h
T
AyeZeeBB 89a97caed7 Plugins: an item grid's own list and marks, items worn on top, keys kept from the game, the menu's category icons
General APIs from pull request 269 (the player's own item tabs and outfit layers), whose tabs,
panels and prompts are now a plugin's (contrib/plugins/item-tabs, kept on this machine):
- reskate.menu.grid_show(keys): a plugin's list in the item grid that has the focus, drawn from
  every grid of the screen; reskate.menu.grid_mark(keys): the game's check on tiles. menu.grid()
  also says whether a list shows, whether it is empty, and where the grid's own prompts end.
- reskate.outfit.on_top(items) and on_top_state(): items worn on top of the outfit in the slots it
  leaves empty, the item given the slot's category, a slot tried and left if the game reports a
  failed load (ReSkate.layer_slots.txt remembers which load where); paid store items refused.
  Part of the shared outfit service, with reskate.outfit.set.
- reskate.input.game_keys(keys): presses the game does not see, by any way it reads the keyboard;
  "Delete" is a key name.
- d:game_image draws the customization menu's 17 category icons ("cas_tops", ...).
dingosdk_plugin_tests skips the test of a contrib plugin that is not on this machine.
2026-10-21 19:18:01 -05:00

53 lines
2.8 KiB
C++

#pragma once
#include "item_browser_order.h"
#include <cstdint>
#include <optional>
#include <string>
#include <string_view>
#include <vector>
// 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, focused_category;
std::vector<std::string> grid_keys; // every item of the grid that has the focus
bool focused_favorite{};
bool showing{}; // a plugin's list is shown in the grid that has the focus (show_items)
bool held{}; // that list has nothing in it: the grid keeps one tile only for the game's highlight
};
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;
// A plugin's own list in the item grid that has the focus: these items (keys), in this order, taken
// from every item grid of the screen (the game keeps them all, one per tab), less what the search
// leaves out; nullopt gives the grid back. One owner at a time: empty when taken, else why not. Any thread.
std::string show_items(std::string owner, std::optional<std::vector<std::string>> keys);
// The game's check mark on these items' tiles, where the rarity icon is (it wins over a favorite's
// star); each owner's own list, replaced. Any thread.
void mark_items(std::string owner, std::vector<std::string> keys);
// Lets go of what `owner` asked for (a plugin that stops). Any thread.
void release_owner(std::string_view owner);
// An item's title as an item grid showed it this session (mods' items too), or empty. Any thread.
std::string known_title(std::string_view key);
// 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