mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 22:12:59 +00:00 
			
		
		
		
	you can now hold in map editor to paint multiple cells
This commit is contained in:
		| @@ -8,6 +8,8 @@ bool leftclick, rightclick, targetclick, hiliteclick, anyshiftclick, wheelclick, | |||||||
|   forcetarget, lshiftclick, lctrlclick; |   forcetarget, lshiftclick, lctrlclick; | ||||||
| bool gtouched; | bool gtouched; | ||||||
|  |  | ||||||
|  | bool holdmouse; | ||||||
|  |  | ||||||
| int getcstat, lgetcstat; ld getcshift; bool inslider; | int getcstat, lgetcstat; ld getcshift; bool inslider; | ||||||
|  |  | ||||||
| function <void(int sym, int uni)> keyhandler; | function <void(int sym, int uni)> keyhandler; | ||||||
| @@ -638,6 +640,7 @@ void mainloopiter() { | |||||||
|       mousepressed = ev.type == SDL_MOUSEBUTTONDOWN; |       mousepressed = ev.type == SDL_MOUSEBUTTONDOWN; | ||||||
|       if(mousepressed) flashMessages(); |       if(mousepressed) flashMessages(); | ||||||
|       mousing = true; |       mousing = true; | ||||||
|  |       holdmouse = false; | ||||||
|        |        | ||||||
|       bool act = false; |       bool act = false; | ||||||
|        |        | ||||||
| @@ -711,6 +714,8 @@ void mainloopiter() { | |||||||
| #endif | #endif | ||||||
|         mouseh = gethyper(mousex, mousey); |         mouseh = gethyper(mousex, mousey); | ||||||
|          |          | ||||||
|  |       if(holdmouse && getcstat == '-') sym = uni = getcstat; | ||||||
|  |  | ||||||
|       if((rightclick || (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_MMASK)) && !mouseout2() &&  |       if((rightclick || (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON_MMASK)) && !mouseout2() &&  | ||||||
|          mouseh[2] < 50 && mouseoh[2] < 50) { |          mouseh[2] < 50 && mouseoh[2] < 50) { | ||||||
|         panning(mouseoh, mouseh); |         panning(mouseoh, mouseh); | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								hyper.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								hyper.h
									
									
									
									
									
								
							| @@ -2109,3 +2109,4 @@ template<class T> void generateLandList(T t); | |||||||
| int isLandValid(eLand l); | int isLandValid(eLand l); | ||||||
|  |  | ||||||
| bool inmirrororwall(eLand l); | bool inmirrororwall(eLand l); | ||||||
|  | extern bool holdmouse; | ||||||
|   | |||||||
| @@ -422,7 +422,9 @@ namespace mapeditor { | |||||||
|              |              | ||||||
|                 else if(u < 2) return 0; |                 else if(u < 2) return 0; | ||||||
|  |  | ||||||
|  | #if LOCAL                 | ||||||
|                 printf("unhandled: u=%d\n", u); |                 printf("unhandled: u=%d\n", u); | ||||||
|  | #endif | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         return 0; |         return 0; | ||||||
| @@ -1162,9 +1164,11 @@ namespace mapeditor { | |||||||
|     handlePanning(sym, uni); |     handlePanning(sym, uni); | ||||||
|  |  | ||||||
|     // left-clicks are coded with '-', and right-clicks are coded with sym F1 |     // left-clicks are coded with '-', and right-clicks are coded with sym F1 | ||||||
|     if(uni == '-') undoLock(); |     if(uni == '-' && !holdmouse) undoLock(); | ||||||
|     if(uni == '-' && mouseover) |     if(uni == '-' && mouseover) { | ||||||
|       allInPattern(mouseover, radius, neighborId(mouseover, mouseover2)); |       allInPattern(mouseover, radius, neighborId(mouseover, mouseover2)); | ||||||
|  |       holdmouse = true; | ||||||
|  |       } | ||||||
|      |      | ||||||
|     if(mouseover) for(int i=0; i<mouseover->type; i++) createMov(mouseover, i); |     if(mouseover) for(int i=0; i<mouseover->type; i++) createMov(mouseover, i); | ||||||
|     if(uni == 'u') applyUndo(); |     if(uni == 'u') applyUndo(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue