mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-04-26 04:33:11 +00:00
dialog:: mouse control in matrix dialog
This commit is contained in:
parent
3a3317d0be
commit
9ab2b2bbd8
@ -702,7 +702,7 @@ EX int sc_ticks, sc_ticks2;
|
|||||||
|
|
||||||
EX bool mouseaiming(bool shmupon) {
|
EX bool mouseaiming(bool shmupon) {
|
||||||
return
|
return
|
||||||
(GDIM == 3 && !shmupon) || (rug::rugged && (lctrlclick ^ rug::mouse_control_rug));
|
(GDIM == 3 && !shmupon) || (rug::rugged && (lctrlclick ^ rug::mouse_control_rug)) || (cmode & sm::MOUSEAIM);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* visualization only -- the HyperRogue movement keys should move the camera */
|
/* visualization only -- the HyperRogue movement keys should move the camera */
|
||||||
@ -753,6 +753,7 @@ EX void mainloopiter() {
|
|||||||
|
|
||||||
mousepan = cmode & sm::NORMAL;
|
mousepan = cmode & sm::NORMAL;
|
||||||
if((cmode & sm::PANNING) && !hiliteclick) mousepan = true;
|
if((cmode & sm::PANNING) && !hiliteclick) mousepan = true;
|
||||||
|
if(cmode & sm::MOUSEAIM) mousepan = true;
|
||||||
if(cmode & sm::SHOWCURSOR) mousepan = false;
|
if(cmode & sm::SHOWCURSOR) mousepan = false;
|
||||||
mousepan = mousepan && mouseaiming(false) && mouseaim_sensitivity;
|
mousepan = mousepan && mouseaiming(false) && mouseaim_sensitivity;
|
||||||
if(mousepan != oldmousepan) {
|
if(mousepan != oldmousepan) {
|
||||||
@ -907,7 +908,7 @@ EX void mainloopiter() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(mouseaiming(shmup::on)) {
|
if(mouseaiming(shmup::on) && !(cmode & sm::MOUSEAIM)) {
|
||||||
#if CAP_MOUSEGRAB
|
#if CAP_MOUSEGRAB
|
||||||
rug::using_rugview urv;
|
rug::using_rugview urv;
|
||||||
dynamicval<bool> ds(didsomething, didsomething);
|
dynamicval<bool> ds(didsomething, didsomething);
|
||||||
|
@ -1178,6 +1178,15 @@ EX namespace dialog {
|
|||||||
rot_but(0, 2, "rotate in XZ", 'y');
|
rot_but(0, 2, "rotate in XZ", 'y');
|
||||||
rot_but(1, 2, "rotate in YZ", 'x');
|
rot_but(1, 2, "rotate in YZ", 'x');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addBoolItem("mouse control", dialogflags & sm::MOUSEAIM, 'm');
|
||||||
|
dialog::add_action([this] { dialogflags ^= sm::MOUSEAIM; });
|
||||||
|
if(dialogflags & sm::MOUSEAIM) {
|
||||||
|
*edit_matrix = cspin(0, 2, mouseaim_x) * *edit_matrix;
|
||||||
|
*edit_matrix = cspin(1, 2, mouseaim_y) * *edit_matrix;
|
||||||
|
mouseaim_x = mouseaim_y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
static string formula;
|
static string formula;
|
||||||
formula = "?";
|
formula = "?";
|
||||||
anims::get_parameter_animation(anims::find_param(edit_matrix), formula);
|
anims::get_parameter_animation(anims::find_param(edit_matrix), formula);
|
||||||
|
@ -5791,6 +5791,7 @@ namespace sm {
|
|||||||
static const int EDIT_BEFORE_WALLS = (1<<25); // mouseover targets before walls
|
static const int EDIT_BEFORE_WALLS = (1<<25); // mouseover targets before walls
|
||||||
static const int EDIT_INSIDE_WALLS = (1<<26); // mouseover targets inside walls
|
static const int EDIT_INSIDE_WALLS = (1<<26); // mouseover targets inside walls
|
||||||
static const int DIALOG_WIDE = (1<<27); // make dialogs wide
|
static const int DIALOG_WIDE = (1<<27); // make dialogs wide
|
||||||
|
static const int MOUSEAIM = (1<<28); // mouse aiming active here
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user