mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-09-18 17:59:38 +00:00
catch exception in case if failed to convert
This commit is contained in:
parent
e2c81eeae7
commit
c1bacb0695
@ -2596,12 +2596,19 @@ EX void show() {
|
|||||||
dialog::addBoolItem(XLAT("in tes internal format"), arb::in(), 't');
|
dialog::addBoolItem(XLAT("in tes internal format"), arb::in(), 't');
|
||||||
dialog::add_action([] {
|
dialog::add_action([] {
|
||||||
if(!arb::in()) {
|
if(!arb::in()) {
|
||||||
|
try {
|
||||||
arb::convert::convert();
|
arb::convert::convert();
|
||||||
arb::convert::activate();
|
arb::convert::activate();
|
||||||
start_game();
|
start_game();
|
||||||
rule_status = XLAT("converted successfully -- %1 cell types", its(isize(arb::current.shapes)));
|
rule_status = XLAT("converted successfully -- %1 cell types", its(isize(arb::current.shapes)));
|
||||||
rules_known_for = "unknown";
|
rules_known_for = "unknown";
|
||||||
}
|
}
|
||||||
|
catch(hr_parse_exception& ex) {
|
||||||
|
println(hlog, "failed: ", ex.s);
|
||||||
|
rule_status = XLAT("failed to convert: ") + ex.s;
|
||||||
|
rules_known_for = "unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
else if(arb::convert::in()) {
|
else if(arb::convert::in()) {
|
||||||
stop_game();
|
stop_game();
|
||||||
geometry = arb::convert::base_geometry;
|
geometry = arb::convert::base_geometry;
|
||||||
|
Loading…
Reference in New Issue
Block a user