From f4282e1118331232eac0ebf33880b29b50a8fb30 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 27 Oct 2022 00:01:32 +0200 Subject: [PATCH] intra:: create/manage portal maps from the map editor --- intra.cpp | 19 +++++++++++++++++++ mapeditor.cpp | 10 ++++++++++ 2 files changed, 29 insertions(+) diff --git a/intra.cpp b/intra.cpp index 4774d81b..46259bab 100644 --- a/intra.cpp +++ b/intra.cpp @@ -661,6 +661,25 @@ EX string portal_help = "Non-Euclidean Geometries' for some portals that work.\n\n" ; +EX void become_menu() { + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(); + dialog::init(XLAT("Become a portal map")); + dialog::addHelp(XLAT(portal_help)); + dialog::addItem(XLAT("yes, that's what I want"), 'y'); + dialog::add_action([] { + intra::become(); + intra::start(); + game_keys_scroll = true; + mapeditor::drawplayer = false; + popScreen(); + pushScreen(show_portals); + }); + + dialog::addBack(); + dialog::display(); + } + int edit_spin; EX void world_list() { diff --git a/mapeditor.cpp b/mapeditor.cpp index 3e49b3c8..e655a813 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -3242,6 +3242,16 @@ EX namespace mapeditor { add_edit(game_keys_scroll); dialog::addInfo(XLAT("hint: shift+A to enter the map editor")); + if(WDIM == 3 && !intra::in) { + dialog::addBoolItem(XLAT("become a portal map"), intra::in, 'm'); + dialog::add_action_push(intra::become_menu); + } + + if(WDIM == 3 && intra::in) { + dialog::addItem(XLAT("manage portals"), 'm'); + dialog::add_action_push(intra::show_portals); + } + dialog::addItem(XLAT("change the pattern/color of new Canvas cells"), 'c'); dialog::add_action_push(patterns::showPrePatternNoninstant);