mirror of
https://github.com/opentibiabr/remeres-map-editor
synced 2026-08-15 18:26:04 -04:00
Created the complete organization of npcs, that way, it is possible to create own files for npcs, no longer depending on being together with the monsters this pull request was made to be worked together with the canary project: https://github.com/opentibiabr/canary The spawns npcs is "yellow" and spawns monsters is "red" (the old) With this change, the map will automatically create an "npc.xml" the first time it is saved. It is possible to edit only the xml, it is not necessary to add or modify the npc by opening the editor map Thus, there is a script for npcs, similar to how it works with old spawns
253 lines
5.3 KiB
C++
253 lines
5.3 KiB
C++
//////////////////////////////////////////////////////////////////////
|
|
// This file is part of Remere's Map Editor
|
|
//////////////////////////////////////////////////////////////////////
|
|
// Remere's Map Editor is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// Remere's Map Editor is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef RME_SETTINGS_H_
|
|
#define RME_SETTINGS_H_
|
|
|
|
#include "main.h"
|
|
|
|
namespace Config {
|
|
enum Key {
|
|
NONE,
|
|
VERSION_ID,
|
|
|
|
USE_CUSTOM_DATA_DIRECTORY,
|
|
DATA_DIRECTORY,
|
|
EXTENSIONS_DIRECTORY,
|
|
|
|
MERGE_MOVE,
|
|
TEXTURE_MANAGEMENT,
|
|
TEXTURE_CLEAN_PULSE,
|
|
TEXTURE_CLEAN_THRESHOLD,
|
|
TEXTURE_LONGEVITY,
|
|
HARD_REFRESH_RATE,
|
|
USE_MEMCACHED_SPRITES,
|
|
USE_MEMCACHED_SPRITES_TO_SAVE,
|
|
SOFTWARE_CLEAN_THRESHOLD,
|
|
SO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GE_CHOOSE_ITEM_ICONS,
|
|
USE_LARGE_TERRAIN_TOOLBAR,
|
|
USE_LARGE_DOODAD_SIZEBAR,
|
|
USE_LARGE_ITEM_SIZEBAR,
|
|
USE_LARGE_HOUSE_SIZEBAR,
|
|
USE_LARGE_RAW_SIZEBAR,
|
|
USE_GUI_SELECTION_SHADOW,
|
|
PALETTE_COL_COUNT,
|
|
PALETTE_TERRAIN_STYLE,
|
|
PALETTE_DOODAD_STYLE,
|
|
PALETTE_ITEM_STYLE,
|
|
PALETTE_RAW_STYLE,
|
|
|
|
ASSETS_DATA_DIRS,
|
|
DEFAULT_CLIENT_VERSION,
|
|
CHECK_SIGNATURES,
|
|
|
|
CURSOR_RED,
|
|
CURSOR_GREEN,
|
|
CURSOR_BLUE,
|
|
CURSOR_ALPHA,
|
|
|
|
CURSOR_ALT_RED,
|
|
CURSOR_ALT_GREEN,
|
|
CURSOR_ALT_BLUE,
|
|
CURSOR_ALT_ALPHA,
|
|
|
|
SCREENSHOT_DIRECTORY,
|
|
SCREENSHOT_FORMAT,
|
|
|
|
MAX_SPAWN_MONSTER_RADIUS,
|
|
CURRENT_SPAWN_MONSTER_RADIUS,
|
|
AUTO_CREATE_SPAWN_MONSTER,
|
|
DEFAULT_SPAWN_MONSTER_TIME,
|
|
|
|
MAX_SPAWN_NPC_RADIUS,
|
|
CURRENT_SPAWN_NPC_RADIUS,
|
|
AUTO_CREATE_SPAWN_NPC,
|
|
DEFAULT_SPAWN_NPC_TIME,
|
|
|
|
SWITCH_MOUSEBUTTONS,
|
|
DOUBLECLICK_PROPERTIES,
|
|
LISTBOX_EATS_ALL_EVENTS,
|
|
RAW_LIKE_SIMONE,
|
|
WORKER_THREADS,
|
|
COPY_POSITION_FORMAT,
|
|
|
|
GOTO_WEBSITE_ON_BOOT,
|
|
INDIRECTORY_INSTALLATION,
|
|
AUTOCHECK_FOR_UPDATES,
|
|
ONLY_ONE_INSTANCE,
|
|
|
|
PALETTE_LAYOUT,
|
|
MINIMAP_VISIBLE,
|
|
MINIMAP_LAYOUT,
|
|
MINIMAP_UPDATE_DELAY,
|
|
MINIMAP_VIEW_BOX,
|
|
MINIMAP_EXPORT_DIR,
|
|
WINDOW_HEIGHT,
|
|
WINDOW_WIDTH,
|
|
WINDOW_MAXIMIZED,
|
|
WELCOME_DIALOG,
|
|
|
|
NUMERICAL_HOTKEYS,
|
|
RECENT_FILES,
|
|
|
|
RECENT_EDITED_MAP_PATH,
|
|
RECENT_EDITED_MAP_POSITION,
|
|
|
|
FIND_ITEM_MODE,
|
|
JUMP_TO_ITEM_MODE,
|
|
|
|
SHOW_TOOLBAR_STANDARD,
|
|
SHOW_TOOLBAR_BRUSHES,
|
|
SHOW_TOOLBAR_POSITION,
|
|
SHOW_TOOLBAR_SIZES,
|
|
TOOLBAR_STANDARD_LAYOUT,
|
|
TOOLBAR_BRUSHES_LAYOUT,
|
|
TOOLBAR_POSITION_LAYOUT,
|
|
TOOLBAR_SIZES_LAYOUT,
|
|
|
|
LAST,
|
|
};
|
|
}
|
|
|
|
class wxConfigBase;
|
|
|
|
class Settings {
|
|
public:
|
|
Settings();
|
|
~Settings();
|
|
|
|
bool getBoolean(uint32_t key) const;
|
|
int getInteger(uint32_t key) const;
|
|
float getFloat(uint32_t key) const;
|
|
std::string getString(uint32_t key) const;
|
|
|
|
void setInteger(uint32_t key, int newval);
|
|
void setFloat(uint32_t key, float newval);
|
|
void setString(uint32_t key, std::string newval);
|
|
|
|
wxConfigBase& getConfigObject();
|
|
void setDefaults() {IO(DEFAULT);}
|
|
void load();
|
|
void save(bool endoftheworld = false);
|
|
public:
|
|
enum DynamicType {
|
|
TYPE_NONE,
|
|
TYPE_STR,
|
|
TYPE_INT,
|
|
TYPE_FLOAT,
|
|
};
|
|
class DynamicValue {
|
|
public:
|
|
DynamicValue() : type(TYPE_NONE) {
|
|
intval = 0;
|
|
};
|
|
DynamicValue(DynamicType t) : type(t) {
|
|
if(t == TYPE_STR) strval = nullptr;
|
|
else if(t == TYPE_INT) intval = 0;
|
|
else if(t == TYPE_FLOAT) floatval = 0.0;
|
|
else intval = 0;
|
|
};
|
|
~DynamicValue() {
|
|
if(type == TYPE_STR)
|
|
delete strval;
|
|
}
|
|
DynamicValue(const DynamicValue& dv) : type(dv.type) {
|
|
if(dv.type == TYPE_STR) strval = newd std::string(*dv.strval);
|
|
else if(dv.type == TYPE_INT) intval = dv.intval;
|
|
else if(dv.type == TYPE_FLOAT) floatval = dv.floatval;
|
|
else intval = 0;
|
|
};
|
|
|
|
std::string str();
|
|
private:
|
|
DynamicType type;
|
|
union {
|
|
int intval;
|
|
std::string* strval;
|
|
float floatval;
|
|
};
|
|
|
|
friend class Settings;
|
|
};
|
|
private:
|
|
enum IOMode {
|
|
DEFAULT,
|
|
LOAD,
|
|
SAVE,
|
|
};
|
|
void IO(IOMode mode);
|
|
std::vector<DynamicValue> store;
|
|
#ifdef __WINDOWS__
|
|
bool use_file_cfg;
|
|
#endif
|
|
};
|
|
|
|
extern Settings g_settings;
|
|
|
|
#endif
|