mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
feat: add internal storage scale option to preferences window
This commit is contained in:
@@ -485,14 +485,20 @@ label:
|
|||||||
# Preferences
|
# Preferences
|
||||||
language : Language
|
language : Language
|
||||||
windows : Open sets
|
windows : Open sets
|
||||||
app language : Language of the user interface :
|
app language : Language of the user interface :
|
||||||
card display : Card Display
|
card display : Card Display
|
||||||
zoom : &Zoom :
|
storage : Storage
|
||||||
export : &Export :
|
zoom : &Zoom:
|
||||||
|
export : &Export:
|
||||||
|
scale : &Internal Scale:
|
||||||
percent of normal: % of normal size
|
percent of normal: % of normal size
|
||||||
external programs: External programs
|
external programs: External programs
|
||||||
apprentice: &Apprentice:
|
apprentice: &Apprentice:
|
||||||
apprentice exe: Apprentice Executable
|
apprentice exe: Apprentice Executable
|
||||||
|
internal scale desc:
|
||||||
|
Scale to internally store card images at.
|
||||||
|
Changing this may impact how Sharpening looks.
|
||||||
|
Does not retroactively apply to existing images.
|
||||||
check at startup: Check for new versions at startup
|
check at startup: Check for new versions at startup
|
||||||
checking requires internet:
|
checking requires internet:
|
||||||
Checking for updates requires an internet connection.
|
Checking for updates requires an internet connection.
|
||||||
@@ -675,7 +681,8 @@ title:
|
|||||||
preferences: Preferences
|
preferences: Preferences
|
||||||
global: Global
|
global: Global
|
||||||
display: Display
|
display: Display
|
||||||
directories: Directories
|
directories: Directories
|
||||||
|
internal: Internal
|
||||||
updates: Updates
|
updates: Updates
|
||||||
update check: Update Check
|
update check: Update Check
|
||||||
locate apprentice: Locate Apprentice
|
locate apprentice: Locate Apprentice
|
||||||
|
|||||||
@@ -171,7 +171,8 @@ Settings::Settings()
|
|||||||
, symbol_grid_size (30)
|
, symbol_grid_size (30)
|
||||||
, symbol_grid (true)
|
, symbol_grid (true)
|
||||||
, symbol_grid_snap (false)
|
, symbol_grid_snap (false)
|
||||||
, print_layout (LAYOUT_NO_SPACE)
|
, print_layout (LAYOUT_NO_SPACE)
|
||||||
|
, internal_scale (1.0)
|
||||||
#if USE_OLD_STYLE_UPDATE_CHECKER
|
#if USE_OLD_STYLE_UPDATE_CHECKER
|
||||||
, updates_url (_("http://magicseteditor.sourceforge.net/updates"))
|
, updates_url (_("http://magicseteditor.sourceforge.net/updates"))
|
||||||
#endif
|
#endif
|
||||||
@@ -257,7 +258,8 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(Settings) {
|
|||||||
REFLECT(symbol_grid_snap);
|
REFLECT(symbol_grid_snap);
|
||||||
REFLECT(default_game);
|
REFLECT(default_game);
|
||||||
REFLECT(print_layout);
|
REFLECT(print_layout);
|
||||||
REFLECT(apprentice_location);
|
REFLECT(apprentice_location);
|
||||||
|
REFLECT(internal_scale);
|
||||||
#if USE_OLD_STYLE_UPDATE_CHECKER
|
#if USE_OLD_STYLE_UPDATE_CHECKER
|
||||||
REFLECT(updates_url);
|
REFLECT(updates_url);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -192,7 +192,10 @@ public:
|
|||||||
|
|
||||||
// --------------------------------------------------- : Special game stuff
|
// --------------------------------------------------- : Special game stuff
|
||||||
String apprentice_location;
|
String apprentice_location;
|
||||||
|
|
||||||
|
// --------------------------------------------------- : Internal settings
|
||||||
|
double internal_scale;
|
||||||
|
|
||||||
// --------------------------------------------------- : Update checking
|
// --------------------------------------------------- : Update checking
|
||||||
#if USE_OLD_STYLE_UPDATE_CHECKER
|
#if USE_OLD_STYLE_UPDATE_CHECKER
|
||||||
String updates_url;
|
String updates_url;
|
||||||
|
|||||||
@@ -65,6 +65,21 @@ private:
|
|||||||
void updateZoom();
|
void updateZoom();
|
||||||
void onExportZoomChange(wxCommandEvent&);
|
void onExportZoomChange(wxCommandEvent&);
|
||||||
void updateExportZoom();
|
void updateExportZoom();
|
||||||
|
};
|
||||||
|
|
||||||
|
class InternalPreferencesPage : public PreferencesPage {
|
||||||
|
public:
|
||||||
|
InternalPreferencesPage(Window* parent);
|
||||||
|
void store() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_EVENT_TABLE();
|
||||||
|
|
||||||
|
wxComboBox* internal_scale;
|
||||||
|
int internal_scale_int;
|
||||||
|
|
||||||
|
void onInternalScaleChange(wxCommandEvent&);
|
||||||
|
void updateInternalScale();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Preferences page for directories of programs
|
// Preferences page for directories of programs
|
||||||
@@ -107,7 +122,8 @@ PreferencesWindow::PreferencesWindow(Window* parent)
|
|||||||
// init notebook
|
// init notebook
|
||||||
wxNotebook* nb = new wxNotebook(this, ID_NOTEBOOK);
|
wxNotebook* nb = new wxNotebook(this, ID_NOTEBOOK);
|
||||||
nb->AddPage(new GlobalPreferencesPage (nb), _TITLE_("global"));
|
nb->AddPage(new GlobalPreferencesPage (nb), _TITLE_("global"));
|
||||||
nb->AddPage(new DisplayPreferencesPage(nb), _TITLE_("display"));
|
nb->AddPage(new DisplayPreferencesPage(nb), _TITLE_("display"));
|
||||||
|
nb->AddPage(new InternalPreferencesPage(nb), _TITLE_("internal"));
|
||||||
nb->AddPage(new DirsPreferencesPage (nb), _TITLE_("directories"));
|
nb->AddPage(new DirsPreferencesPage (nb), _TITLE_("directories"));
|
||||||
nb->AddPage(new UpdatePreferencesPage (nb), _TITLE_("updates"));
|
nb->AddPage(new UpdatePreferencesPage (nb), _TITLE_("updates"));
|
||||||
|
|
||||||
@@ -184,7 +200,7 @@ void GlobalPreferencesPage::store() {
|
|||||||
// set the_locale?
|
// set the_locale?
|
||||||
// open_sets_in_new_window
|
// open_sets_in_new_window
|
||||||
settings.open_sets_in_new_window = open_sets_in_new_window->GetValue();
|
settings.open_sets_in_new_window = open_sets_in_new_window->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Preferences page : display
|
// ----------------------------------------------------------------------------- : Preferences page : display
|
||||||
|
|
||||||
@@ -293,7 +309,55 @@ BEGIN_EVENT_TABLE(DisplayPreferencesPage, wxPanel)
|
|||||||
EVT_COMBOBOX(ID_EXPORT_ZOOM, DisplayPreferencesPage::onExportZoomChange)
|
EVT_COMBOBOX(ID_EXPORT_ZOOM, DisplayPreferencesPage::onExportZoomChange)
|
||||||
EVT_TEXT_ENTER(ID_EXPORT_ZOOM, DisplayPreferencesPage::onExportZoomChange)
|
EVT_TEXT_ENTER(ID_EXPORT_ZOOM, DisplayPreferencesPage::onExportZoomChange)
|
||||||
END_EVENT_TABLE ()
|
END_EVENT_TABLE ()
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------- : Preferences page : internal
|
||||||
|
|
||||||
|
InternalPreferencesPage::InternalPreferencesPage(Window* parent) : PreferencesPage(parent) {
|
||||||
|
internal_scale = new wxComboBox(this, ID_INTERNAL_SCALE);
|
||||||
|
|
||||||
|
internal_scale_int = static_cast<int>(settings.internal_scale * 100);
|
||||||
|
internal_scale->SetValue(String::Format(_("%d%%"), internal_scale_int));
|
||||||
|
|
||||||
|
int choices[] = { 100,200 };
|
||||||
|
for (unsigned int i = 0; i < sizeof(choices) / sizeof(choices[0]); ++i) {
|
||||||
|
internal_scale->Append(String::Format(_("%d%%"), choices[i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
wxSizer* s = new wxBoxSizer(wxVERTICAL);
|
||||||
|
wxSizer* s2 = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("storage"));
|
||||||
|
wxSizer* s3 = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
s3->Add(new wxStaticText(this, wxID_ANY, _LABEL_("scale")), 0, wxALL & ~wxLEFT, 4);
|
||||||
|
s3->AddSpacer(2);
|
||||||
|
s3->Add(internal_scale);
|
||||||
|
s3->Add(new wxStaticText(this, wxID_ANY, _LABEL_("percent of normal")), 1, wxALL & ~wxRIGHT, 4);
|
||||||
|
s2->Add(s3);
|
||||||
|
s2->Add(new wxStaticText(this, wxID_ANY, _LABEL_("internal scale desc")), 0, wxALL & ~wxLEFT, 4);
|
||||||
|
s->Add(s2, 0, wxEXPAND | wxALL, 8);
|
||||||
|
s->SetSizeHints(this);
|
||||||
|
SetSizer(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InternalPreferencesPage::store() {
|
||||||
|
updateInternalScale();
|
||||||
|
settings.internal_scale = internal_scale_int / 100.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void InternalPreferencesPage::onInternalScaleChange(wxCommandEvent&) {
|
||||||
|
updateInternalScale();
|
||||||
|
}
|
||||||
|
|
||||||
|
void InternalPreferencesPage::updateInternalScale() {
|
||||||
|
String s = internal_scale->GetValue();
|
||||||
|
int i = internal_scale_int;
|
||||||
|
if (wxSscanf(s.c_str(), _("%u"), &i)) {
|
||||||
|
internal_scale_int = min(max(i, 1), 1000);
|
||||||
|
}
|
||||||
|
internal_scale->SetValue(String::Format(_("%d%%"), (int)internal_scale_int));
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(InternalPreferencesPage, wxPanel)
|
||||||
|
EVT_COMBOBOX(ID_INTERNAL_SCALE, InternalPreferencesPage::onInternalScaleChange)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Preferences page : directories
|
// ----------------------------------------------------------------------------- : Preferences page : directories
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ void ImageValueEditor::sliceImage(const Image& image) {
|
|||||||
AlphaMask mask;
|
AlphaMask mask;
|
||||||
style().mask.getNoCache(options,mask);
|
style().mask.getNoCache(options,mask);
|
||||||
// slice
|
// slice
|
||||||
RealSize desiredSliceSize = RealSize(style().getSize().width * 2, style().getSize().height * 2);
|
RealSize desiredSliceSize = RealSize(style().getSize().width * settings.internal_scale, style().getSize().height * settings.internal_scale);
|
||||||
ImageSliceWindow s(wxGetTopLevelParent(&editor()), image, desiredSliceSize, mask);
|
ImageSliceWindow s(wxGetTopLevelParent(&editor()), image, desiredSliceSize, mask);
|
||||||
// clicked ok?
|
// clicked ok?
|
||||||
if (s.ShowModal() == wxID_OK) {
|
if (s.ShowModal() == wxID_OK) {
|
||||||
|
|||||||
@@ -281,7 +281,9 @@ enum ControlID {
|
|||||||
ID_EXPORT_ZOOM_X,
|
ID_EXPORT_ZOOM_X,
|
||||||
ID_EXPORT_ZOOM_Y,
|
ID_EXPORT_ZOOM_Y,
|
||||||
ID_SHARPEN,
|
ID_SHARPEN,
|
||||||
ID_SHARPEN_AMOUNT,
|
ID_SHARPEN_AMOUNT,
|
||||||
|
// Internal window
|
||||||
|
ID_INTERNAL_SCALE,
|
||||||
// Updates window
|
// Updates window
|
||||||
ID_PACKAGE_LIST,
|
ID_PACKAGE_LIST,
|
||||||
ID_KEEP,
|
ID_KEEP,
|
||||||
|
|||||||
Reference in New Issue
Block a user