From d4a5d43988019dde849082adfa01a66fe35bd920 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 23 Apr 2025 11:55:38 +0200 Subject: [PATCH] ru:: map clicking on Poincare map editor --- rogueviz/ru/render.cpp | 5 ----- rogueviz/ru/ru.cpp | 10 ++++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/rogueviz/ru/render.cpp b/rogueviz/ru/render.cpp index 5c2316fe..84dc3431 100644 --- a/rogueviz/ru/render.cpp +++ b/rogueviz/ru/render.cpp @@ -278,11 +278,6 @@ void draw_room() { } render_room_objects(current_room); - - ld& scale = scrm.T[0][0]; - - mousepx = (mousex - current_display->xcenter) * 2 / scale / current_display->radius + screen_x/2; - mousepy = (mousey - current_display->ycenter) * 2 / scale / current_display->radius + screen_y/2; } } diff --git a/rogueviz/ru/ru.cpp b/rogueviz/ru/ru.cpp index 67a5656b..347bc9a9 100644 --- a/rogueviz/ru/ru.cpp +++ b/rogueviz/ru/ru.cpp @@ -175,11 +175,21 @@ void render_the_map() { draw_room(); drawmessages(); nomsg = false; + if(1) { + ld& scale = scrm.T[0][0]; + mousepx = (mousex - current_display->xcenter) * 2 / scale / current_display->radius + screen_x/2; + mousepy = (mousey - current_display->ycenter) * 2 / scale / current_display->radius + screen_y/2; + } dialog::add_key_action('v', [] { cmode = mode::menu; }); break; case mapmode::poincare: case mapmode::klein: gamescreen(); + if(!mouseout() && mouseover && rooms.count(mouseover)) { + current_room = &rooms[mouseover]; + auto h = inverse_shift(ggmatrix(current_room->where), mouseh); + tie(mousepx, mousepy) = from_hyper(h); + } if(cmode == mode::editmap) { getcstat = '-'; dialog::add_key_action('-', [] { if(!mouseover) return; current_room = &rooms[mouseover]; switch_mapmode_to(mapmode::standard); });