mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-26 03:17:39 +00:00 
			
		
		
		
	set_help_to for stronger prevention about obsolete help messages
This commit is contained in:
		
							
								
								
									
										13
									
								
								help.cpp
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								help.cpp
									
									
									
									
									
								
							| @@ -807,6 +807,10 @@ int windtotal; | |||||||
|  |  | ||||||
| EX hookset<void(cell*)> hooks_mouseover; | EX hookset<void(cell*)> hooks_mouseover; | ||||||
|  |  | ||||||
|  | template<class T> void set_help_to(T t) {  | ||||||
|  |   help = bygen([t] { gotoHelpFor(t); }); | ||||||
|  |   } | ||||||
|  |  | ||||||
| EX void describeMouseover() { | EX void describeMouseover() { | ||||||
|   DEBBI(DF_GRAPH, ("describeMouseover")); |   DEBBI(DF_GRAPH, ("describeMouseover")); | ||||||
|  |  | ||||||
| @@ -815,7 +819,7 @@ EX void describeMouseover() { | |||||||
|   if(!c || instat || getcstat != '-') { } |   if(!c || instat || getcstat != '-') { } | ||||||
|   else if(c->wall != waInvisibleFloor) { |   else if(c->wall != waInvisibleFloor) { | ||||||
|     out = XLAT1(linf[c->land].name); |     out = XLAT1(linf[c->land].name); | ||||||
|     help = bygen([c] () { gotoHelpFor(c->land); }); |     set_help_to(c->land); | ||||||
|      |      | ||||||
|     if(WDIM == 3 && isGravityLand(c->land)) out += " [" + its(gravityLevel(c)) + "]"; |     if(WDIM == 3 && isGravityLand(c->land)) out += " [" + its(gravityLevel(c)) + "]"; | ||||||
|      |      | ||||||
| @@ -912,7 +916,7 @@ EX void describeMouseover() { | |||||||
|         if(c->wall != waSea && c->wall != waPalace && c->wall != waDeadfloor) |         if(c->wall != waSea && c->wall != waPalace && c->wall != waDeadfloor) | ||||||
|         if(!((c->wall == waCavefloor || c->wall == waCavewall) && (c->land == laEmerald || c->land == laCaves))) |         if(!((c->wall == waCavefloor || c->wall == waCavewall) && (c->land == laEmerald || c->land == laCaves))) | ||||||
|         if(!((isAlch(c->wall) && c->land == laAlchemist))) |         if(!((isAlch(c->wall) && c->land == laAlchemist))) | ||||||
|           help = bygen([c] () { gotoHelpFor(c->wall); }); |           set_help_to(c->wall); | ||||||
|       } |       } | ||||||
|      |      | ||||||
|     if(isActivable(c)) out += XLAT(" (touch to activate)"); |     if(isActivable(c)) out += XLAT(" (touch to activate)"); | ||||||
| @@ -937,7 +941,7 @@ EX void describeMouseover() { | |||||||
|       if(c->monst == moTortoise && tortoise::seek())  |       if(c->monst == moTortoise && tortoise::seek())  | ||||||
|         out += " " + tortoise::measure(tortoise::getb(c)); |         out += " " + tortoise::measure(tortoise::getb(c)); | ||||||
|          |          | ||||||
|       help = bygen([c] () { gotoHelpFor(c->monst); }); |       set_help_to(c->monst); | ||||||
|       } |       } | ||||||
|    |    | ||||||
|     if(c->item && !itemHiddenFromSight(c)) { |     if(c->item && !itemHiddenFromSight(c)) { | ||||||
| @@ -950,8 +954,7 @@ EX void describeMouseover() { | |||||||
|         } |         } | ||||||
|       if(c->item == itBabyTortoise && tortoise::seek())  |       if(c->item == itBabyTortoise && tortoise::seek())  | ||||||
|         out += " " + tortoise::measure(tortoise::babymap[c]); |         out += " " + tortoise::measure(tortoise::babymap[c]); | ||||||
|       if(!c->monst)  |       if(!c->monst) set_help_to(c->item); | ||||||
|         help = bygen([c] () { gotoHelpFor(c->item); }); |  | ||||||
|       } |       } | ||||||
|      |      | ||||||
|     if(isPlayerOn(c) && !shmup::on) out += XLAT(", you"), help = generateHelpForMonster(moPlayer); |     if(isPlayerOn(c) && !shmup::on) out += XLAT(", you"), help = generateHelpForMonster(moPlayer); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue