mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-23 23:26:06 +02:00
On a dedicated server with object scaling off, a loaded park's scaled objects were resized anyway (and after a refused resize the pose poll saved 1x over their scale), and a scaled paste, set or undo ended in a resize the server would not take, so the edit waited on it. The placements now know whether this game may resize (set by the session from the server's setting and the role, the host and roles that may always build exempt, allowed outside a session): where it may not, objects stay 1x in the world, nothing waits on a resize, and the layout keeps their scale for when scaling is allowed again. A transaction test pastes a scaled object with scaling off.
57 lines
3.3 KiB
C++
57 lines
3.3 KiB
C++
#pragma once
|
|
#include "Engine/Game/World/park_editor.h"
|
|
#include "Extension/Objects/object_placements.h"
|
|
|
|
namespace dingosdk {
|
|
ParkEditorModel local_park_editor();
|
|
// Whether a menu shows the park list (the park editor, or World > Build). Listing the Mods folder
|
|
// walks the disk, so local_park_editor rescans it only while one does.
|
|
void set_park_mod_list_visible(bool visible) noexcept;
|
|
// Whether the local player may place objects under the lobby host's policy.
|
|
// Gates the park editor and the game's own native create/copy requests. Reset
|
|
// on disconnect; existing placed objects remain in the world.
|
|
void set_lobby_object_placement_allowed(bool enabled);
|
|
bool lobby_object_placement_allowed() noexcept;
|
|
// Whether objects may be resized in this session (a dedicated server can turn object scaling off;
|
|
// its roles that may always build are exempt). Off, a saved object's scale is kept in the layout
|
|
// but it is not resized in the world, and the world's 1x is never saved over it. On outside a session.
|
|
void set_lobby_object_scaling_allowed(bool enabled) noexcept;
|
|
bool lobby_object_scaling_allowed() noexcept;
|
|
// The session's limit on this player's objects (object_placement.h), 0 for none: the host's
|
|
// own game and a server admin's are given none. Adding an object is refused at the limit.
|
|
void set_lobby_object_limit(unsigned limit) noexcept;
|
|
unsigned lobby_object_limit() noexcept;
|
|
// Objects this player has on the current map, and whether one more would pass the limit.
|
|
std::size_t lobby_object_count();
|
|
bool lobby_object_limit_reached();
|
|
inline constexpr char object_limit_notice[] = "You have placed as many objects as this session allows each player.";
|
|
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 &);
|
|
bool queue_local_park_object_set(const EditorObjectSetRequest &);
|
|
bool queue_local_park_delete(const EditorDeleteRequest &);
|
|
void tick_local_park_editor() noexcept;
|
|
// Invoked through the console's verified game-thread dispatcher. `texts`
|
|
// carries a park mod's name, author, version and description (mod-create:
|
|
// all four; mod-details: the same after the folder in `argument`).
|
|
std::string edit_local_park(std::string_view operation, std::string_view map, std::uint64_t generation,
|
|
std::uint64_t revision, std::string_view argument,
|
|
const profile::PlacedObject &object = {},
|
|
const std::vector<std::string> &texts = {});
|
|
} // namespace dingosdk
|
|
namespace dingosdk::profile_runtime {
|
|
void initialize_park_editor(const std::filesystem::path &directory);
|
|
// The engine data root whose Mods folder holds park mods.
|
|
void set_park_mods_root(const std::filesystem::path &data_root);
|
|
void update_park_editor();
|
|
void update_park_editor_moves() noexcept;
|
|
void reset_park_editor();
|
|
bool park_editor_owns_placements();
|
|
// The layout the editor's current edit is applying (null without one). Its new objects are saved
|
|
// only when the whole edit completes, but they are live, linked objects before that.
|
|
const profile::ObjectLayout *park_editor_pending_layout();
|
|
bool park_editor_observe(std::uint64_t entity, const profile::PlacedObject &object);
|
|
void park_editor_external_change();
|
|
} // namespace dingosdk::profile_runtime
|