mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-17 17:27:19 +02:00
The ReSkate menu now has two styles, switched with View / F11 or the buttons in its top bar and saved with the profile (`ui fullscreen`): - Window: the mouse menu as before, with a side rail of pages in groups. - Full screen: made for a controller, in the pause menu's look. Pages across the top (LB / RB), each page's sections as the ONLINE page's tabs (LT / RT), button prompts at the bottom, the pause menu's sounds, and the pause menu's own Multiplayer pages as ONLINE. The pages are regrouped: HOME (quick switches and a tile for each page), MAP, BUILD, SKATER (freecam, first person, cheats), SANDBOX (once Trainer), ADDONS (drone, Board Break, Road Rash, Hall of Meat, grind exits, music), ONLINE, PROGRESS, MODS, SETTINGS, DEVELOPER. Full screen, every shared control is drawn for a pad: switches and option rows changed with left / right one step a press, sliders as steppers that repeat when held, rows of buttons, and pages that scroll with the right stick. Search boxes and typed values stay in the window. A pad press takes the menu's focus back and hides the pointer until the mouse moves. Also: map pictures in the map picker (official loading screens, a mod's icon) with a search box in the window, Splash and Tutorial Island left out of it; number boxes beside the window's sliders; the binds in groups, with an action bind to open the menu (`menu`); a menu size for each style (`ui scalefull`); the time of day stepping from the one last asked for.
148 lines
8.0 KiB
C++
148 lines
8.0 KiB
C++
#pragma once
|
|
#include <cstdint>
|
|
#include <filesystem>
|
|
#include <string>
|
|
#include <optional>
|
|
#include <string_view>
|
|
#include <vector>
|
|
#include "Engine/Game/World/park_rotation.h"
|
|
#include "Engine/Game/World/world_layers.h"
|
|
#include "Engine/Game/World/world_controls.h"
|
|
#include "Engine/Game/Rendering/graphics_controls.h"
|
|
#include "Engine/Game/Profile/player_card.h"
|
|
#include "Engine/Game/Profile/progression.h"
|
|
#include "Engine/Game/Profile/object_persistence_model.h"
|
|
#include "Engine/Game/World/park_editor.h"
|
|
#include "Engine/Game/Input/controller_bindings.h"
|
|
#include "Engine/Game/UI/menu_scale.h"
|
|
#include "Engine/Core/Json/json.h"
|
|
#include <utility>
|
|
namespace dingosdk {
|
|
struct LocalProfileAccess {
|
|
bool neighborhoods{};
|
|
bool preset_slots{};
|
|
bool bus_stops{};
|
|
bool neighborhood_ranks{};
|
|
bool cosmetics{};
|
|
};
|
|
LocalProfileAccess local_profile_access() noexcept;
|
|
bool local_profile_owns_entitlement(std::string_view id) noexcept;
|
|
// Called on the game-update thread after native item data becomes available.
|
|
void update_local_customization() noexcept;
|
|
// Cancel asset-backed service callbacks before native level teardown.
|
|
void local_profile_before_level_transition(unsigned next) noexcept;
|
|
using LocalLocationTravelQueue = bool (*)(const char* map);
|
|
void set_local_location_travel_queue(LocalLocationTravelQueue) noexcept;
|
|
std::uint32_t local_customization_selected_preset() noexcept;
|
|
// Whether a saved outfit can be loaded yet: a cosmetics catalog has been read
|
|
// this session to check it against, or nothing is saved. The game builds every
|
|
// slot up to the selected one when a slot is selected and does not ask again,
|
|
// so the first selection waits for this.
|
|
bool local_customization_outfits_loadable() noexcept;
|
|
void observe_local_customization_selection(std::int32_t index) noexcept;
|
|
struct LocalMissionRow {
|
|
std::string id, group;
|
|
int completed{-1}; // -1: no saved override; 0/1: explicit profile state.
|
|
};
|
|
struct LocalMissions {
|
|
bool available{};
|
|
std::vector<LocalMissionRow> rows;
|
|
std::string feedback;
|
|
};
|
|
LocalMissions local_profile_missions();
|
|
ProgressionModel local_profile_progression();
|
|
ObjectPersistenceModel local_profile_object_persistence();
|
|
ParkEditorModel local_park_editor();
|
|
void set_park_mod_list_visible(bool visible) noexcept;
|
|
bool queue_local_park_surface(const EditorSurfaceRequest &);
|
|
bool queue_local_park_preview(const EditorPreviewRequest &);
|
|
bool queue_local_park_selection(const EditorSelectionRequest &);
|
|
bool queue_local_park_paste(const EditorPasteRequest &);
|
|
void tick_local_park_editor() noexcept;
|
|
ControllerBindingsModel local_profile_controller_bindings();
|
|
bool set_local_freecam_controller(bool);
|
|
bool local_freecam_controller();
|
|
bool set_local_freecam_controller_binding(std::uint32_t);
|
|
bool set_local_freecam_binding(std::uint32_t);
|
|
bool set_local_tp_to_freecam_binding(std::uint32_t);
|
|
// The player's binding for Yes (or No) in a dedicated server's vote; 0 clears it.
|
|
bool set_local_vote_binding(bool yes, std::uint32_t);
|
|
// One of action_binds (controller_bindings.h), by its place there; 0 clears it.
|
|
bool set_local_action_binding(std::size_t index, std::uint32_t);
|
|
bool set_local_noclip_binding(std::uint32_t);
|
|
bool set_local_forward_velocity_binding(std::uint32_t);
|
|
bool set_local_up_velocity_binding(std::uint32_t);
|
|
bool set_local_offboard_up_velocity_binding(std::uint32_t);
|
|
bool set_local_object_persistence(bool enabled);
|
|
bool clear_local_persisted_objects(std::string_view map);
|
|
bool delete_local_placed_object(std::string_view map, std::uint64_t token);
|
|
bool teleport_to_local_placed_object(std::string_view map, std::uint64_t token);
|
|
// Teleports the local skater to a world position (sent within 5 s, when the skater can be
|
|
// moved). False when the game's teleport is unavailable.
|
|
bool teleport_local_skater(const std::array<float, 3>& position);
|
|
// The highest collision surface straight down at (x, z) between world heights `top` and
|
|
// `bottom`, from the client physics world (the park editor's native ray). Empty when nothing
|
|
// is there yet (collision still streaming) or the query is unavailable. Client update thread.
|
|
std::optional<float> local_ground_height(float x, float z, float top, float bottom);
|
|
// The first collision surface along the line from `from` to `to` (world positions), from the same
|
|
// client physics world. Empty when the line is clear, collision is still streaming, or the query
|
|
// is unavailable. Client update thread.
|
|
std::optional<std::array<float, 3>> local_surface_hit(const std::array<float, 3>& from, const std::array<float, 3>& to);
|
|
// Small allowlisted progression commands, executed on the game update thread.
|
|
bool set_local_progression(const std::vector<std::string>& arguments);
|
|
// Small ReSkate-owned booleans saved beside the profile under a "ReSkate."
|
|
// prefix. Absent until first written; never exposed to the game's own settings.
|
|
namespace profile_runtime {
|
|
bool local_profile_store_ready() noexcept;
|
|
std::optional<bool> local_preference(std::string_view key) noexcept;
|
|
void set_local_preference(std::string_view key, bool value) noexcept;
|
|
// The same "ReSkate." store for numbers and text. A key keeps the type it was
|
|
// first saved with. set_local_values saves several at once (one transaction).
|
|
std::optional<Json> local_value(std::string_view key) noexcept;
|
|
void set_local_values(const std::vector<std::pair<std::string, Json>>& values) noexcept;
|
|
// ReSkate menu scale, clamped to a legible range. Cached so the overlay can
|
|
// read it every frame without touching the database.
|
|
// The ReSkate menu's size: the window's, or (`fullscreen`) the full screen menu's.
|
|
float local_menu_scale(bool fullscreen = false) noexcept;
|
|
bool set_local_menu_scale(float value, bool fullscreen = false) noexcept;
|
|
// Whether the ReSkate menu fills the screen (made for a controller) or is a window. Cached likewise.
|
|
bool local_menu_fullscreen() noexcept;
|
|
void set_local_menu_fullscreen(bool fullscreen) noexcept;
|
|
// The game's camera height option (UseHighCam, true is the high camera) as the game writes it,
|
|
// which its camera height button does: the listener returns the height to keep instead. Runs on
|
|
// the thread that writes the option.
|
|
using CameraHeightWrite = bool (*)(bool high) noexcept;
|
|
void set_camera_height_write_listener(CameraHeightWrite listener) noexcept;
|
|
}
|
|
PlayerCardModel local_profile_player_card();
|
|
// Renames only the local RIP Card. An empty name restores the Steam name.
|
|
bool set_local_player_card_name(std::string_view name);
|
|
ParksModel local_profile_parks();
|
|
bool set_local_park(std::string_view lot, std::string_view layout);
|
|
bool load_random_local_parks();
|
|
bool set_local_park_randomize_on_launch(bool enabled);
|
|
// Transient lobby authority. Guest choices never overwrite saved preferences.
|
|
void set_lobby_park_mode(bool active, bool guest);
|
|
void apply_host_park_choices(const ParkChoices& choices);
|
|
WorldLayersModel local_profile_world_layers();
|
|
void apply_host_world_layers(bool forced, const WorldLayerChoices& choices);
|
|
// Runtime-only hint for a manifest-backed standalone level whose deliberately
|
|
// reduced donor graph has no canonical retail map anchor.
|
|
void set_local_world_layer_map_hint(WorldMap map) noexcept;
|
|
bool set_local_world_layer(std::string_view layer, std::string_view mode);
|
|
bool restore_local_world_layers(std::string_view map);
|
|
// Execute on the already-verified client update thread, including transitions.
|
|
WorldControlsModel local_profile_world_controls();
|
|
GraphicsControlsModel local_profile_graphics_controls();
|
|
void update_local_graphics_controls() noexcept;
|
|
bool set_local_graphics_control(std::string_view key, int value);
|
|
bool set_local_world_control(std::string_view key, float value);
|
|
bool set_local_atmosphere_control(std::string_view key, std::string_view value);
|
|
bool reset_local_atmosphere_controls(unsigned kind);
|
|
void update_local_world_controls(WorldMap map) noexcept;
|
|
// Execute on the game update thread, never from ImGui's Present callback.
|
|
bool set_local_mission_completed(std::string_view id, bool completed);
|
|
bool initialize_local_profile(std::uintptr_t image_base, bool authored_offline,
|
|
const std::filesystem::path& path);
|
|
}
|