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:
Patrick 'Quezler' Mounier
2021-02-07 19:27:09 +01:00
committed by GitHub
parent 1acc771edc
commit 292f771eb1

View File

@@ -428,6 +428,12 @@ public class Block extends UnlockableContent{
TextureRegion reg = getRequestRegion(req, list);
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);
}