mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Compare commits
2 Commits
ae02c71be6
...
23463c4b96
| Author | SHA1 | Date | |
|---|---|---|---|
| 23463c4b96 | |||
| 6f526a81f1 |
@@ -20,7 +20,7 @@
|
|||||||
// ----------------------------------------------------------------------------- : ExportCardSelectionChoice
|
// ----------------------------------------------------------------------------- : ExportCardSelectionChoice
|
||||||
|
|
||||||
CardLinkWindow::CardLinkWindow(Window* parent, const SetP& set, const CardP& selected_card, bool sizer)
|
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)
|
, set(set), parent(parent), selected_card(selected_card)
|
||||||
{
|
{
|
||||||
// init controls
|
// init controls
|
||||||
|
|||||||
@@ -533,7 +533,8 @@ bool CardListBase::canLink() const {
|
|||||||
return card->findFreeLink(card->uid, set->card_uids) >= 0;
|
return card->findFreeLink(card->uid, set->card_uids) >= 0;
|
||||||
}
|
}
|
||||||
bool CardListBase::doLink() {
|
bool CardListBase::doLink() {
|
||||||
CardLinkWindow wnd(this, set, getCard());
|
CardLinkWindow wnd(this, set, getCard());
|
||||||
|
wnd.CentreOnParent();
|
||||||
if (wnd.ShowModal() == wxID_OK) {
|
if (wnd.ShowModal() == wxID_OK) {
|
||||||
// The actual linking is done in this window's onOk function
|
// The actual linking is done in this window's onOk function
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------------- : JSON to String
|
// ----------------------------------------------------------------------------- : 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_;
|
std::string indent_;
|
||||||
if(! 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::uint64:
|
||||||
case boost::json::kind::int64:
|
case boost::json::kind::int64:
|
||||||
case boost::json::kind::double_:
|
|
||||||
os << jv;
|
os << jv;
|
||||||
break;
|
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_:
|
case boost::json::kind::bool_:
|
||||||
if(jv.get_bool())
|
if(jv.get_bool())
|
||||||
os << "true";
|
os << "true";
|
||||||
|
|||||||
Reference in New Issue
Block a user