2025-12-20 16:38:51 +03:00
|
|
|
#pragma once
|
|
|
|
|
#include <Helpers/Serializers.hpp>
|
|
|
|
|
#include <cereal/types/string.hpp>
|
|
|
|
|
#include <Helpers/NetworkingObjects/NetObjOrderedList.hpp>
|
2025-12-23 17:17:33 +03:00
|
|
|
#include "../GUIStuff/Elements/TreeListing.hpp"
|
2025-12-20 16:38:51 +03:00
|
|
|
#include "BookmarkListItem.hpp"
|
2026-01-01 22:46:02 +03:00
|
|
|
#include <Helpers/VersionNumber.hpp>
|
2025-12-20 16:38:51 +03:00
|
|
|
|
|
|
|
|
class World;
|
|
|
|
|
|
|
|
|
|
class BookmarkManager {
|
|
|
|
|
public:
|
|
|
|
|
BookmarkManager(World& w);
|
2026-01-01 22:46:02 +03:00
|
|
|
void server_init_no_file();
|
2025-12-20 16:38:51 +03:00
|
|
|
void scale_up(const WorldScalar& scaleUpAmount);
|
2025-12-21 00:33:04 +03:00
|
|
|
void setup_list_gui(const std::string& id);
|
2025-12-23 17:17:33 +03:00
|
|
|
void refresh_gui_data();
|
2026-01-01 22:46:02 +03:00
|
|
|
void save_file(cereal::PortableBinaryOutputArchive& a) const;
|
|
|
|
|
void load_file(cereal::PortableBinaryInputArchive& a, VersionNumber version);
|
2025-12-20 16:38:51 +03:00
|
|
|
|
|
|
|
|
NetworkingObjects::NetObjOwnerPtr<BookmarkListItem> bookmarkListRoot;
|
|
|
|
|
private:
|
2025-12-30 19:46:08 +03:00
|
|
|
NetworkingObjects::NetObjOrderedListIterator<BookmarkListItem> create_in_proper_position(BookmarkListItem* newItem);
|
|
|
|
|
std::optional<NetworkingObjects::NetObjOrderedListIterator<BookmarkListItem>> try_to_create_in_proper_position(BookmarkListItem* newItem);
|
2025-12-23 17:17:33 +03:00
|
|
|
GUIStuff::TreeListing::SelectionData selectionData;
|
|
|
|
|
std::unordered_set<NetworkingObjects::NetObjID> oldSelection;
|
|
|
|
|
std::string nameToEdit;
|
|
|
|
|
std::string nameForNew;
|
|
|
|
|
|
2026-01-01 22:46:02 +03:00
|
|
|
friend class BookmarkListItem;
|
|
|
|
|
|
2025-12-20 16:38:51 +03:00
|
|
|
World& world;
|
|
|
|
|
};
|