preferences.h

main 179 lines · 5.6 KB Raw
Alex Alex Commit Map Editor 18/10/2026 23:40
1//////////////////////////////////////////////////////////////////////
2// This file is part of Remere's Map Editor
3//////////////////////////////////////////////////////////////////////
4// Remere's Map Editor is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Remere's Map Editor is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//////////////////////////////////////////////////////////////////////
17
18#ifndef RME_PREFERENCES_WINDOW_H_
19#define RME_PREFERENCES_WINDOW_H_
20
21#include "main.h"
22#include <wx/listbook.h>
23#include <wx/collpane.h>
24#include <wx/clrpicker.h>
25#include "gui.h"
26
27class PreferencesWindow : public wxDialog {
28public:
29 explicit PreferencesWindow(wxWindow* parent) :
30 PreferencesWindow(parent, false) {};
31 PreferencesWindow(wxWindow* parent, bool clientVersionSelected);
32 virtual ~PreferencesWindow();
33
34 void OnClickDefaults(wxCommandEvent&);
35 void OnClickApply(wxCommandEvent&);
36 void OnClickOK(wxCommandEvent&);
37 void OnClickCancel(wxCommandEvent&);
38
39 void OnCollapsiblePane(wxCollapsiblePaneEvent&);
40
41 void UpdateClientOverride();
42
43protected:
44 void SetDefaults();
45 void Apply();
46 void SaveValues();
47
48 wxBookCtrl* book;
49
50 // General
51 wxCheckBox* always_make_backup_chkbox;
52 wxCheckBox* create_on_startup_chkbox;
53 wxCheckBox* update_check_on_startup_chkbox;
54 wxCheckBox* only_one_instance_chkbox;
55 wxCheckBox* show_welcome_dialog_chkbox;
56 wxCheckBox* enable_tileset_editing_chkbox;
57 wxSpinCtrl* undo_size_spin;
58 wxSpinCtrl* undo_mem_size_spin;
59 wxSpinCtrl* worker_threads_spin;
60 wxSpinCtrl* replace_size_spin;
61 wxRadioBox* position_format;
62
63 // Editor
64 wxCheckBox* group_actions_chkbox;
65 wxCheckBox* duplicate_id_warn_chkbox;
66 wxCheckBox* house_remove_chkbox;
67 wxCheckBox* auto_assign_doors_chkbox;
68 wxCheckBox* eraser_leave_unique_chkbox;
69 wxCheckBox* doodad_erase_same_chkbox;
70 wxCheckBox* auto_create_spawn_chkbox;
71 wxCheckBox* allow_multiple_orderitems_chkbox;
72 wxCheckBox* merge_move_chkbox;
73 wxCheckBox* merge_paste_chkbox;
74
75 // Graphics
76 wxCheckBox* icon_selection_shadow_chkbox;
77 wxChoice* icon_background_choice;
78 wxCheckBox* use_memcached_chkbox;
79 wxDirPickerCtrl* screenshot_directory_picker;
80 wxChoice* screenshot_format_choice;
81 wxCheckBox* hide_items_when_zoomed_chkbox;
82 wxColourPickerCtrl* cursor_color_pick;
83 wxColourPickerCtrl* cursor_alt_color_pick;
84 wxCheckBox* dark_mode_chkbox;
85 wxCheckBox* dark_mode_color_enabled_chkbox;
86 wxColourPickerCtrl* dark_mode_color_pick;
87 /*
88 wxCheckBox* texture_managment_chkbox;
89 wxSpinCtrl* clean_interval_spin;
90 wxSpinCtrl* texture_longevity_spin;
91 wxSpinCtrl* texture_threshold_spin;
92 wxSpinCtrl* software_threshold_spin;
93 wxSpinCtrl* software_clean_amount_spin;
94 */
95
96 // Automagic
97 wxCheckBox* automagic_enabled_chkbox;
98 wxCheckBox* same_ground_type_chkbox;
99 wxCheckBox* walls_repel_borders_chkbox;
100 wxCheckBox* layer_carpets_chkbox;
101 wxCheckBox* borderize_delete_chkbox;
102 wxCheckBox* borderize_paste_chkbox;
103 wxCheckBox* borderize_drag_chkbox;
104 wxSpinCtrl* borderize_drag_threshold_spin;
105 wxSpinCtrl* borderize_paste_threshold_spin;
106
107 wxCheckBox* custom_border_checkbox;
108 wxStaticText* custom_border_id_label;
109 wxSpinCtrl* custom_border_id_spin;
110
111 // Interface
112 wxChoice* terrain_palette_style_choice;
113 wxChoice* collection_palette_style_choice;
114 wxChoice* doodad_palette_style_choice;
115 wxChoice* item_palette_style_choice;
116 wxChoice* raw_palette_style_choice;
117
118 wxCheckBox* large_terrain_tools_chkbox;
119 wxCheckBox* large_collection_tools_chkbox;
120 wxCheckBox* large_doodad_sizebar_chkbox;
121 wxCheckBox* large_item_sizebar_chkbox;
122 wxCheckBox* large_house_sizebar_chkbox;
123 wxCheckBox* large_raw_sizebar_chkbox;
124 wxCheckBox* large_container_icons_chkbox;
125 wxCheckBox* large_pick_item_icons_chkbox;
126
127 wxCheckBox* switch_mousebtn_chkbox;
128 wxCheckBox* doubleclick_properties_chkbox;
129 wxCheckBox* inversed_scroll_chkbox;
130 wxSlider* scroll_speed_slider;
131 wxSlider* zoom_speed_slider;
132
133 // Client info
134 wxChoice* default_version_choice;
135 std::vector<wxDirPickerCtrl*> version_dir_pickers;
136 wxCheckBox* check_sigs_chkbox;
137
138 // Create controls
139 wxChoice* AddPaletteStyleChoice(wxWindow* parent, wxSizer* sizer, const wxString& short_description, const wxString& description, const std::string& setting);
140 void SetPaletteStyleChoice(wxChoice* ctrl, int key);
141
142 // Create windows
143 wxNotebookPage* CreateGeneralPage();
144 wxNotebookPage* CreateGraphicsPage();
145 wxNotebookPage* CreateUIPage();
146 wxNotebookPage* CreateEditorPage();
147 wxNotebookPage* CreateClientPage();
148 wxNotebookPage* CreateLODPage();
149 wxNotebookPage* CreateAutomagicPage();
150
151 // Helper method to update the UI state of dark mode controls
152 void UpdateDarkModeUI();
153
154 // Add with other checkbox declarations
155 wxCheckBox* auto_select_raw_chkbox;
156 wxCheckBox* autosave_chkbox;
157 wxSpinCtrl* autosave_interval_spin;
158
159 // LOD settings
160 wxSpinCtrl* tooltip_max_zoom_spin;
161 wxSpinCtrl* ground_only_threshold_spin;
162 wxSpinCtrl* item_display_threshold_spin;
163 wxSpinCtrl* special_features_threshold_spin;
164 wxSpinCtrl* animation_threshold_spin;
165 wxSpinCtrl* effects_threshold_spin;
166 wxSpinCtrl* light_threshold_spin;
167 wxSpinCtrl* shade_threshold_spin;
168 wxSpinCtrl* town_zone_threshold_spin;
169 wxSpinCtrl* grid_threshold_spin;
170
171 // Palette grid settings
172 wxSpinCtrl* chunk_size_spin;
173 wxSpinCtrl* visible_rows_margin_spin;
174
175 DECLARE_EVENT_TABLE()
176};
177
178#endif
179
Top