Draws team regions during schematic placement (#4588)
* Draw team regions during schematic placement * Fall back to sharded for headless * Only draw team regions if the schematic is in-world This seems better than `player != null && req.worldContext` since it wouldn't really result in any visual changes but saves some draw operations. * This seems cleaner Although the order of the 1st and 2nd if argument is debatable for performance reasons.
This commit is contained in:
committed by
GitHub
parent
1acc771edc
commit
292f771eb1
@@ -428,6 +428,12 @@ public class Block extends UnlockableContent{
|
|||||||
TextureRegion reg = getRequestRegion(req, list);
|
TextureRegion reg = getRequestRegion(req, list);
|
||||||
Draw.rect(reg, req.drawx(), req.drawy(), !rotate ? 0 : req.rotation * 90);
|
Draw.rect(reg, req.drawx(), req.drawy(), !rotate ? 0 : req.rotation * 90);
|
||||||
|
|
||||||
|
if(req.worldContext && player != null && teamRegion.found()){
|
||||||
|
if(teamRegions[player.team().id] == teamRegion) Draw.color(player.team().color);
|
||||||
|
Draw.rect(teamRegions[player.team().id], req.drawx(), req.drawy());
|
||||||
|
Draw.color();
|
||||||
|
}
|
||||||
|
|
||||||
drawRequestConfig(req, list);
|
drawRequestConfig(req, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user