mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	camera_speed and camera_rot_speed configurable from menu, also they work where they should now
This commit is contained in:
		
							
								
								
									
										18
									
								
								config.cpp
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								config.cpp
									
									
									
									
									
								
							| @@ -686,6 +686,9 @@ EX void initConfig() { | ||||
|   addsaver(berger_limit, "berger_limit"); | ||||
|    | ||||
|   addsaverenum(centering, "centering"); | ||||
|    | ||||
|   addsaver(camera_speed, "camera-speed", 1); | ||||
|   addsaver(camera_rot_speed, "camera-rot-speed", 1); | ||||
|  | ||||
|   callhooks(hooks_configfile); | ||||
|  | ||||
| @@ -1109,6 +1112,19 @@ EX void showGraphConfig() { | ||||
| #endif | ||||
|  | ||||
|   dialog::addSelItem(XLAT("scrolling speed"), fts(vid.sspeed), 'a'); | ||||
|  | ||||
|   dialog::addSelItem(XLAT("camera movement speed"), fts(camera_speed), 'c'); | ||||
|   dialog::add_action([] {  | ||||
|     dialog::editNumber(camera_speed, -10, 10, 0.1, 1, XLAT("camera movement speed"),  | ||||
|       "This affects:\n\nin 2D: scrolling with arrow keys and Wheel Up\n\nin 3D: camera movement with Home/End." | ||||
|       ); | ||||
|     }); | ||||
|   dialog::addSelItem(XLAT("camera rotation speed"), fts(camera_rot_speed), 'r'); | ||||
|   dialog::add_action([] {  | ||||
|     dialog::editNumber(camera_rot_speed, -10, 10, 0.1, 1, XLAT("camera rotation speed"),  | ||||
|       "This affects view rotation with Page Up/Down, and in 3D, camera rotation with arrow keys or mouse." | ||||
|       ); | ||||
|     }); | ||||
|      | ||||
|   dialog::addSelItem(XLAT("movement animation speed"), fts(vid.mspeed), 'm'); | ||||
|  | ||||
| @@ -2708,6 +2724,8 @@ EX unordered_map<string, ld&> params = { | ||||
|   {"loxidromic", pconf.loximuthal_parameter}, | ||||
|   {"miller", pconf.miller_parameter}, | ||||
|   {"winkel", pconf.winkel_parameter}, | ||||
|   {"camspd", camera_speed}, | ||||
|   {"camrot", camera_rot_speed}, | ||||
|   {"levellines", levellines}, | ||||
|   #endif | ||||
|   }; | ||||
|   | ||||
| @@ -329,6 +329,7 @@ EX void full_forward_camera(ld t) { | ||||
|  | ||||
| EX void full_rotate_camera(int dir, ld val) { | ||||
|   if(rug::rug_control() && lshiftclick) { | ||||
|     val *= camera_rot_speed; | ||||
|     hyperpoint h; | ||||
|     if(nonisotropic) { | ||||
|       transmatrix T2 = eupush( tC0(view_inverse(View)) ); | ||||
| @@ -350,6 +351,7 @@ EX void full_rotate_camera(int dir, ld val) { | ||||
|     crystal::apply_rotation(cspin(dir, 2, val * camera_rot_speed)); | ||||
|   #endif | ||||
|   else if(GDIM == 3) { | ||||
|     val *= camera_rot_speed; | ||||
|     if(keep_vertical()) { | ||||
|       hyperpoint vv = vertical_vector(); | ||||
|       ld alpha = -atan2(vv[2], vv[1]); | ||||
| @@ -372,7 +374,7 @@ EX void full_rotate_camera(int dir, ld val) { | ||||
|  | ||||
| EX void full_rotate_view(ld h, ld v) { | ||||
|   if(history::on && !rug::rug_control()) | ||||
|     models::rotation += h; | ||||
|     models::rotation += h * camera_rot_speed; | ||||
|   else { | ||||
|     rotate_view(spin(v * camera_rot_speed)); | ||||
|     didsomething = true; | ||||
| @@ -413,7 +415,7 @@ EX void handlePanning(int sym, int uni) { | ||||
|     ld jx = (mousex - current_display->xcenter - .0) / current_display->radius / 10; | ||||
|     ld jy = (mousey - current_display->ycenter - .0) / current_display->radius / 10; | ||||
|     playermoved = false; | ||||
|     rotate_view(gpushxto0(hpxy(jx, jy))); | ||||
|     rotate_view(gpushxto0(hpxy(jx * camera_speed, jy * camera_speed))); | ||||
|     sym = 1; | ||||
|     } | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue