<commit_before>package haxepunk.debug;

import haxepunk.graphics.text.BitmapText;
import haxepunk.input.MouseManager;
import haxepunk.utils.Draw;

@:access(haxepunk.Scene)
private class LayerToggle extends Entity
{
	public var layerNumber:Null<Int>;

	var label:BitmapText;

	public function new(mouseManager:MouseManager)
	{
		super();
		label = new BitmapText("Layer", {size: 12});
		label.alpha = 0.75;
		addGraphic(label);
		width = 140;
		height = 18;
		type = mouseManager.type;
		mouseManager.add(this, null, onClick, onEnter, onExit, true);
	}

	override public function update()
	{
		visible = collidable = layerNumber != null;
		if (layerNumber != null)
		{
			var entityCount = HXP.scene._layers.exists(layerNumber) ? Lambda.count(HXP.scene._layers[layerNumber]) : 0;
			var txt = "Layer " + layerNumber + " [" + entityCount + "]";
			if (label.text != txt) label.text = txt;
			label.color = HXP.scene.layerVisible(layerNumber) ? 0x00ff00 : 0xff0000;
		}
	}

	function onClick()
	{
		if (layerNumber != null)
		{
			var display = !HXP.scene.layerVisible(layerNumber);
			HXP.scene.showLayer(layerNumber, display);
			HXP.scene.updateLists();
		}
	}

	function onEnter() label.alpha = 1;
	function onExit() label.alpha = 0.75;
}

@:access(haxepunk.Scene)
class LayerList extends EntityList<LayerToggle>
{
	var alpha:Float = 0.5;
	var mouseManager:MouseManager;
	var sceneLabel:BitmapText;
	var childY:Int = 8;

	public function new(mouseManager:MouseManager)
	{
		super();
		this.mouseManager = mouseManager;
		width = 160;
		height = 320;

		sceneLabel = new BitmapText("Scene", {size: 14});
		sceneLabel.x = 10;
		sceneLabel.y = childY;
		childY += sceneLabel.textHeight;
		graphic = sceneLabel;

		type = mouseManager.type;
		mouseManager.add(this, null, null, onEnter, onExit);
	}

	override public function update()
	{
		super.update();

		var layerCount = HXP.scene._layerList.length;
		while (entities.length < layerCount)
		{
			var toggle = new LayerToggle(mouseManager);
			add(toggle);
			toggle.localY = childY;
			childY += toggle.height + 4;
		}<commit_msg>Debug console size tweaks<commit_after>package haxepunk.debug;

import haxepunk.graphics.text.BitmapText;
import haxepunk.input.MouseManager;
import haxepunk.utils.Draw;

@:access(haxepunk.Scene)
private class LayerToggle extends Entity
{
	public var layerNumber:Null<Int>;

	var label:BitmapText;

	public function new(mouseManager:MouseManager)
	{
		super();
		label = new BitmapText("Layer", {size: 12});
		label.alpha = 0.75;
		addGraphic(label);
		width = 220;
		height = 18;
		type = mouseManager.type;
		mouseManager.add(this, null, onClick, onEnter, onExit, true);
	}

	override public function update()
	{
		visible = collidable = layerNumber != null;
		if (layerNumber != null)
		{
			var entityCount = HXP.scene._layers.exists(layerNumber) ? Lambda.count(HXP.scene._layers[layerNumber]) : 0;
			var txt = "Layer " + layerNumber + " [" + entityCount + "]";
			if (label.text != txt) label.text = txt;
			label.color = HXP.scene.layerVisible(layerNumber) ? 0x00ff00 : 0xff0000;
		}
	}

	function onClick()
	{
		if (layerNumber != null)
		{
			var display = !HXP.scene.layerVisible(layerNumber);
			HXP.scene.showLayer(layerNumber, display);
			HXP.scene.updateLists();
		}
	}

	function onEnter() label.alpha = 1;
	function onExit() label.alpha = 0.75;
}

@:access(haxepunk.Scene)
class LayerList extends EntityList<LayerToggle>
{
	var alpha:Float = 0.5;
	var mouseManager:MouseManager;
	var sceneLabel:BitmapText;
	var childY:Int = 8;

	public function new(mouseManager:MouseManager)
	{
		super();
		this.mouseManager = mouseManager;
		width = 240;
		height = 320;

		sceneLabel = new BitmapText("Scene", {size: 12});
		sceneLabel.x = 10;
		sceneLabel.y = childY;
		childY += sceneLabel.textHeight;
		graphic = sceneLabel;

		type = mouseManager.type;
		mouseManager.add(this, null, null, onEnter, onExit);
	}

	override public function update()
	{
		super.update();

		var layerCount = HXP.scene._layerList.length;
		while (entities.length < layerCount)
		{
			var toggle = new LayerToggle(mouseManager);
			add(toggle);
			toggle.localY = childY;
			childY += toggle.height + 4;
		}
{'fraction_non_alphanumeric': 0.12931034482758622, 'fraction_numerical': 0.01867816091954023, 'mean_word_length': 4.195273631840796, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1752657', 'n_tokens_mistral': 1643, 'n_tokens_neox': 1423, 'n_words': 319}