<commit_before>const buttonSizes = {
	left: {
		size: {
			width: 9,
			height: 24
		},
		offset: {
			x: 0,
			y: 0
		}
	},
	center: {
		size: {
			width: 13,
			height: 24
		},
		offset: {
			x: 9,
			y: 0
		}
	},
	right: {
		size: {
			width: 9,
			height: 24
		},
		offset: {
			x: 22,
			y: 0
		}
	}
};
const buttons = {
	blue: {
		x: 0,
		y: 65
	},
	orange: {
		x: 32,
		y: 65
	},
	red: {
		x: 64,
		y: 65
	}
};

const SCALING = 2;
const BORDER_SIZE = 7;

export class UI {
	/**
     * 
     * @param {import('./ccloader').ModLoader} modloader 
     */
	constructor(modloader) {
		this.loaded = false;
		this.modloader = modloader;
		this.container = document.getElementById('ui');

		this._loadImage();
		this.applyBindings(console);
	}

	applyBindings(console) {
		const err = console.error;
		const warn = console.warn;
		const log = console.log;

		const logFlags = localStorage.getItem('logFlags') || 3;

		if ((logFlags & 1) === 1) {
			console.error = (...msg) => {
				this.error.apply(this, msg);
				err.apply(console, msg);
			};
		}
		if ((logFlags & 2) === 2) {
			console.warn = (...msg) => {
				this.warn.apply(this, msg);
				warn.apply(console, msg);
			};
		}
		if ((logFlags & 4) === 4) {
			console.log = (...msg) => {
				this.log.apply(this, msg);
				log.apply(console, msg);
			};<commit_msg>Update ui.js<commit_after>const buttonSizes = {
	left: {
		size: {
			width: 9,
			height: 24
		},
		offset: {
			x: 0,
			y: 0
		}
	},
	center: {
		size: {
			width: 13,
			height: 24
		},
		offset: {
			x: 9,
			y: 0
		}
	},
	right: {
		size: {
			width: 9,
			height: 24
		},
		offset: {
			x: 22,
			y: 0
		}
	}
};
const buttons = {
	blue: {
		x: 0,
		y: 65
	},
	orange: {
		x: 32,
		y: 65
	},
	red: {
		x: 64,
		y: 65
	}
};

const SCALING = 2;
const BORDER_SIZE = 7;
const LOG_TYPE = {
	ERROR :  0b001,
	WARNING : 0b010,
	INFO : 0b100
};
export class UI {
	/**
     * 
     * @param {import('./ccloader').ModLoader} modloader 
     */
	constructor(modloader) {
		this.loaded = false;
		this.modloader = modloader;
		this.container = document.getElementById('ui');

		this._loadImage();
		this.applyBindings(console);
	}

	applyBindings(console) {
		const err = console.error;
		const warn = console.warn;
		const log = console.log;

		const logFlags = localStorage.getItem('logFlags') || 3;

		if (logFlags & LOG_TYPE.ERROR) {
			console.error = (...msg) => {
				this.error.apply(this, msg);
				err.apply(console, msg);
			};
		}
		if (logFlags & LOG_TYPE.WARNING) {
			console.warn = (...msg) => {
				this.warn.apply(this, msg);
				warn.apply(console, msg);
			};
		}
		if (logFlags & LOG_TYPE.INFO) {
			console.log = (...msg) => {
				this.log.apply(this, msg);
				log.apply(console, msg);
			};
{'fraction_non_alphanumeric': 0.18088612229952397, 'fraction_numerical': 0.02929329915781765, 'mean_word_length': 2.3115151515151515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7344898', 'n_tokens_mistral': 1371, 'n_tokens_neox': 1112, 'n_words': 240}