mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Compare commits
5 Commits
ae02c71be6
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| d9b58bb5eb | |||
| 512a237f39 | |||
| 1a64496206 | |||
| 23463c4b96 | |||
| 6f526a81f1 |
+3
-4
@@ -27,10 +27,9 @@ if( NOT HUNSPELL_FOUND )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# You will most likely get a message about being unable to open hunspell-1.7.lib because pkgconf forgets to add the actual path to
|
||||
# HUNSPELL_LIBRARIES. If so, uncomment the below line and point it to the correct vcpkg root folder/library. (For debug builds, add "debug\\" just before "lib\\")
|
||||
# You will most likely get a message about being unable to open hunspell-1.7.lib because pkgconf forgets to add the actual path to HUNSPELL_LIBRARIES.
|
||||
# If so, uncomment the below line and point it to the correct vcpkg root folder/library. (For debug builds, add "debug\\" just before "lib\\")
|
||||
#set(HUNSPELL_LIBRARIES "C:\\PATH\\TO\\ROOT\\vcpkg\\installed\\${VCPKG_TARGET_TRIPLET}\\lib\\hunspell-1.7.lib")
|
||||
message("-- Does this have a full path? If not, and it's just a file name, it's broken: Found Hunspell at ${HUNSPELL_LIBRARIES}")
|
||||
|
||||
include_directories("${PROJECT_BINARY_DIR}/src")
|
||||
include_directories("${PROJECT_SOURCE_DIR}/src")
|
||||
@@ -143,4 +142,4 @@ endif()
|
||||
include(test/tests.cmake)
|
||||
|
||||
# Debug Message
|
||||
message("-- Does this have a full path? If not, and it's just a file name, it's broken: Found Hunspell at ${HUNSPELL_LIBRARIES}")
|
||||
message("-- Does this have a full path? If not, and it's just a file name, it's broken: ${HUNSPELL_LIBRARIES}")
|
||||
|
||||
+3
-3
@@ -202,11 +202,11 @@ void Set::validate(Version file_app_version) {
|
||||
*/
|
||||
|
||||
// we want at least one card
|
||||
if (cards.empty()) cards.push_back(make_intrusive<Card>(*game));
|
||||
if (cards.empty()) cards.push_back(make_intrusive<Card>(*game));
|
||||
// build uid map
|
||||
buildUIDMap();
|
||||
// update scripts
|
||||
script_manager->updateAll();
|
||||
// build uid map
|
||||
buildUIDMap();
|
||||
// update_cards_scripts
|
||||
// first apply all the stylesheet scripts that are older than the first game script
|
||||
// then apply the first game script
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
// ----------------------------------------------------------------------------- : ExportCardSelectionChoice
|
||||
|
||||
CardLinkWindow::CardLinkWindow(Window* parent, const SetP& set, const CardP& selected_card, bool sizer)
|
||||
: wxDialog(parent, wxID_ANY, _TITLE_("link cards"), wxPoint(400,-1), wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||
: wxDialog(parent, wxID_ANY, _TITLE_("link cards"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
||||
, set(set), parent(parent), selected_card(selected_card)
|
||||
{
|
||||
// init controls
|
||||
|
||||
@@ -533,7 +533,8 @@ bool CardListBase::canLink() const {
|
||||
return card->findFreeLink(card->uid, set->card_uids) >= 0;
|
||||
}
|
||||
bool CardListBase::doLink() {
|
||||
CardLinkWindow wnd(this, set, getCard());
|
||||
CardLinkWindow wnd(this, set, getCard());
|
||||
wnd.CentreOnParent();
|
||||
if (wnd.ShowModal() == wxID_OK) {
|
||||
// The actual linking is done in this window's onOk function
|
||||
return true;
|
||||
|
||||
@@ -58,7 +58,8 @@ void TextCtrl::updateSize() {
|
||||
ValueViewer& viewer = *viewers.front();
|
||||
viewer.bounding_box.width = cs.GetWidth() - 2;
|
||||
viewer.bounding_box.height = cs.GetHeight() - 2;
|
||||
viewers.front()->getEditor()->determineSize(true);
|
||||
viewers.front()->getEditor()->determineSize(true);
|
||||
InvalidateBestSize();
|
||||
}
|
||||
|
||||
void TextCtrl::setValue(String* value, bool untagged) {
|
||||
|
||||
@@ -60,29 +60,32 @@ void KeywordsPanel::initControls() {
|
||||
sp = new wxBoxSizer(wxVERTICAL);
|
||||
sp->Add(fixed, 0, wxEXPAND); sp->Show(fixed,false);
|
||||
wxSizer* s1 = new wxBoxSizer(wxVERTICAL);
|
||||
s1->Add(new wxStaticText(panel, wxID_ANY, _LABEL_("keyword")+_(":")), 0, wxTOP, 2);
|
||||
s1->Add(keyword, 1, wxEXPAND | wxTOP, 2);
|
||||
s1->Add(new wxStaticText(panel, wxID_ANY, _LABEL_("mode")+_(":")), 0, wxTOP, 2);
|
||||
s1->Add(mode, 0, wxEXPAND | wxTOP, 2);
|
||||
s1->Add(new wxStaticText(panel, wxID_ANY, _LABEL_("keyword")+_(":")), 0, wxTOP | wxLEFT, 4);
|
||||
s1->Add(keyword, 0, wxEXPAND | wxTOP | wxLEFT, 4);
|
||||
sp->Add(s1, 0, wxEXPAND | wxRIGHT, 4);
|
||||
sp->Add(new wxStaticLine(panel), 0, wxEXPAND | wxTOP | wxBOTTOM, 8);
|
||||
sp->Add(new wxStaticLine(panel), 0, wxEXPAND | wxTOP | wxBOTTOM, 16);
|
||||
wxSizer* s9 = new wxBoxSizer(wxVERTICAL);
|
||||
s9->Add(new wxStaticText(panel, wxID_ANY, _LABEL_("mode")+_(":")), 0, wxTOP | wxLEFT, 4);
|
||||
s9->Add(mode, 0, wxEXPAND | wxTOP | wxLEFT, 4);
|
||||
sp->Add(s9, 0, wxEXPAND | wxRIGHT, 4);
|
||||
sp->Add(new wxStaticLine(panel), 0, wxEXPAND | wxTOP | wxBOTTOM, 16);
|
||||
wxSizer* s2 = new wxBoxSizer(wxVERTICAL);
|
||||
s2->Add(new wxStaticText(panel, wxID_ANY, _LABEL_("match")+_(":")), 0);
|
||||
s2->Add(match, 1, wxEXPAND | wxTOP, 2);
|
||||
s2->Add(add_param, 0, wxALIGN_LEFT | wxTOP, 2);
|
||||
s2->Add(new wxStaticText(panel, wxID_ANY, _LABEL_("match")+_(":")), 0, wxTOP | wxLEFT, 4);
|
||||
s2->Add(match, 0, wxEXPAND | wxTOP | wxLEFT, 4);
|
||||
s2->Add(add_param, 0, wxALIGN_LEFT | wxTOP | wxLEFT, 4);
|
||||
sp->Add(s2, 0, wxEXPAND | wxRIGHT, 4);
|
||||
sp->Add(new wxStaticLine(panel), 0, wxEXPAND | wxTOP | wxBOTTOM, 8);
|
||||
sp->Add(new wxStaticLine(panel), 0, wxEXPAND | wxTOP | wxBOTTOM, 16);
|
||||
wxSizer* s3 = new wxBoxSizer(wxVERTICAL);
|
||||
s3->Add(new wxStaticText(panel, wxID_ANY, _LABEL_("reminder")+_(":")), 0);
|
||||
s3->Add(reminder, 1, wxEXPAND | wxTOP, 2);
|
||||
s3->Add(ref_param, 0, wxALIGN_LEFT | wxTOP, 2);
|
||||
s3->Add(errors, 0, wxEXPAND | wxTOP, 4);
|
||||
s3->Add(new wxStaticText(panel, wxID_ANY, _LABEL_("reminder")+_(":")), 0, wxTOP | wxLEFT, 4);
|
||||
s3->Add(reminder, 1, wxEXPAND | wxTOP | wxLEFT, 4);
|
||||
s3->Add(ref_param, 0, wxALIGN_LEFT | wxTOP | wxLEFT, 4);
|
||||
s3->Add(errors, 0, wxEXPAND | wxTOP | wxLEFT, 4);
|
||||
//s3->Add(new wxStaticText(panel, wxID_ANY, _("Example:")), 0, wxTOP, 6);
|
||||
sp->Add(s3, 1, wxEXPAND | wxRIGHT, 4);
|
||||
sp->Add(new wxStaticLine(panel), 0, wxEXPAND | wxTOP | wxBOTTOM, 8);
|
||||
sp->Add(new wxStaticLine(panel), 0, wxEXPAND | wxTOP | wxBOTTOM, 16);
|
||||
wxSizer* s4 = new wxBoxSizer(wxVERTICAL);
|
||||
s4->Add(new wxStaticText(panel, wxID_ANY, _LABEL_("rules")+_(":")), 0);
|
||||
s4->Add(rules, 1, wxEXPAND | wxTOP, 2);
|
||||
s4->Add(new wxStaticText(panel, wxID_ANY, _LABEL_("rules")+_(":")), 0, wxTOP | wxLEFT, 4);
|
||||
s4->Add(rules, 1, wxEXPAND | wxTOP | wxLEFT, 4);
|
||||
sp->Add(s4, 1, wxEXPAND | wxRIGHT, 4);
|
||||
panel->SetSizer(sp);
|
||||
// init splitter
|
||||
|
||||
+11
-3
@@ -665,12 +665,13 @@ void TextValueEditor::draw(RotatedDC& dc) {
|
||||
}
|
||||
}
|
||||
|
||||
void TextValueEditor::redrawSelection(size_t old_selection_start_i, size_t old_selection_end_i, bool old_drop_down_shown) {
|
||||
void TextValueEditor::redrawSelection(size_t old_selection_start_i, size_t old_selection_end_i, bool old_drop_down_shown) {
|
||||
// Hide caret
|
||||
if (isCurrent()) {
|
||||
wxCaret* caret = editor().GetCaret();
|
||||
if (caret->IsVisible()) caret->Hide();
|
||||
}
|
||||
}
|
||||
#ifdef __WXMSW__
|
||||
// Destroy the clientDC before reshowing the caret, prevent flicker on MSW
|
||||
{
|
||||
// Move selection
|
||||
@@ -701,7 +702,14 @@ void TextValueEditor::redrawSelection(size_t old_selection_start_i, size_t old_s
|
||||
// redraw drop down indicators
|
||||
drawWordListIndicators(dc, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
scroll_with_cursor = true;
|
||||
if (ensureCaretVisible()) {
|
||||
updateScrollbar();
|
||||
}
|
||||
redraw();
|
||||
#endif
|
||||
if (isCurrent()) {
|
||||
showCaret();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
// ----------------------------------------------------------------------------- : JSON to String
|
||||
|
||||
void pretty_print(std::ostream& os, const boost::json::value& jv, std::string* indent)
|
||||
void pretty_print(std::ostringstream& os, const boost::json::value& jv, std::string* indent)
|
||||
{
|
||||
std::string indent_;
|
||||
if(! indent)
|
||||
@@ -94,10 +94,24 @@ void pretty_print(std::ostream& os, const boost::json::value& jv, std::string* i
|
||||
|
||||
case boost::json::kind::uint64:
|
||||
case boost::json::kind::int64:
|
||||
case boost::json::kind::double_:
|
||||
os << jv;
|
||||
break;
|
||||
|
||||
case boost::json::kind::double_: {
|
||||
std::ostringstream oss;
|
||||
oss << std::fixed << std::setprecision(10) << jv.as_double();
|
||||
std::string str = oss.str();
|
||||
// remove trailing zeros
|
||||
if (str.find('.') != std::string::npos) {
|
||||
str.erase(str.find_last_not_of('0') + 1);
|
||||
if (str.back() == '.') {
|
||||
str.pop_back();
|
||||
}
|
||||
}
|
||||
os << str;
|
||||
break;
|
||||
}
|
||||
|
||||
case boost::json::kind::bool_:
|
||||
if(jv.get_bool())
|
||||
os << "true";
|
||||
|
||||
@@ -280,7 +280,7 @@ void RotatedDC::DrawRoundedRectangle(const RealRect& r, double radius) {
|
||||
void RotatedDC::DrawInvertRectangle(const RealRect& r) {
|
||||
wxRect r_ext = trRectToBB(r);
|
||||
|
||||
wxBitmap bmp(r_ext.width, r_ext.height, 24);
|
||||
wxBitmap bmp(r_ext.width, r_ext.height, 24);
|
||||
wxMemoryDC memDC(bmp);
|
||||
memDC.Blit(0, 0, r_ext.width, r_ext.height, &dc, r_ext.x, r_ext.y);
|
||||
memDC.SelectObject(wxNullBitmap);
|
||||
|
||||
Reference in New Issue
Block a user