<commit_before>// namespace
var GNOVEL = GNOVEL || {};

(function() {
	"use strict";
	/**
	 *@param{page = ; type = the type of choice-dialogue, action, location; }
	 *choices = array of choices possible
	 *result = what should happen after choice selected
	 */
	/**
	 * @class  Choices
	 * @constructor
	 */
	var Choices = function(page, choices, result, params) {
		this._choices = choices;
		this._page = page;
		this._result = result;
		this._params = params || {};
		this._mouseDownListener = null;
		this._mouseMoveListener = null;

		this._choicesBox = [];
		this._uiElements = [];
		this._choosed = false;

		this._init();

		if (params != null) {
			if (params.seconds != null && params.seconds > 0) {
				this._countdown();
			}
		}

		var choices = this;
		this._mouseDownListener = function(event) {
			choices._onMouseDown(event);
		};
		this._mouseMoveListener = function(event) {
			choices._onMouseMove(event);
		};

		this._page.getOwner().addMouseDownListener(this._mouseDownListener);
		this._page.getOwner().addMouseMoveListener(this._mouseMoveListener);
	};

	Choices.prototype._init = function() {
		// add timer progress bar and choicesboxes
		var timer_material = new THREE.MeshBasicMaterial({
			color: 0xffffff,
			opacity: 0.2,
			transparent: true
		});

		if (this._params.seconds > 0) {
			var timer_plane = new THREE.PlaneBufferGeometry(20, 8);
			var timer = new THREE.Mesh(timer_plane, timer_material);
			this.timer = timer;
			timer.position.x = -390;
			timer.position.y = -350;
			timer.position.z = 75;
			this._page._addToScene(timer);
		}

		var textbox;
		var mouse = new THREE.Vector2(), hoveredChoice;
		this._mouse = mouse;
		this._hoveredChoice = hoveredChoice;
		var startx = this._params.x || -200;
		var starty = this._params.y || -200;
		var startz = this._params.z || 220;
		for (var i = 0; i < this._choices.length; i++) {
			textbox = this._page.createTextBox(this._choices[i], {
				fontsize: 46,
				borderColor: {
					r: 255,
					g: 255,
					b: 255,
					a: 0.8
				},
				backgroundColor: {
					r: 255,
					g: 255,
					b: 255,
					a: 0.8
				}
			});
			textbox.position.set(200 + startx, i * -50 + starty, startz + 10);
			textbox.name = "choices";

			// hack : because we are using Text2D, we are going to identify the raycast based on this name
			textbox.children[0].name = "choice_" + i;

			this._choicesBox.push(textbox);
			this._page._addToScene(this._choicesBox[i]);
		};
		//if location type, show
		if (this._params.type == "location") {<commit_msg>adjusted y positions of choices textbox<commit_after>// namespace
var GNOVEL = GNOVEL || {};

(function() {
	"use strict";
	/**
	 *@param{page = ; type = the type of choice-dialogue, action, location; }
	 *choices = array of choices possible
	 *result = what should happen after choice selected
	 */
	/**
	 * @class  Choices
	 * @constructor
	 */
	var Choices = function(page, choices, result, params) {
		this._choices = choices;
		this._page = page;
		this._result = result;
		this._params = params || {};
		this._mouseDownListener = null;
		this._mouseMoveListener = null;

		this._choicesBox = [];
		this._uiElements = [];
		this._choosed = false;

		this._init();

		if (params != null) {
			if (params.seconds != null && params.seconds > 0) {
				this._countdown();
			}
		}

		var choices = this;
		this._mouseDownListener = function(event) {
			choices._onMouseDown(event);
		};
		this._mouseMoveListener = function(event) {
			choices._onMouseMove(event);
		};

		this._page.getOwner().addMouseDownListener(this._mouseDownListener);
		this._page.getOwner().addMouseMoveListener(this._mouseMoveListener);
	};

	Choices.prototype._init = function() {
		// add timer progress bar and choicesboxes
		var timer_material = new THREE.MeshBasicMaterial({
			color: 0xffffff,
			opacity: 0.2,
			transparent: true
		});

		if (this._params.seconds > 0) {
			var timer_plane = new THREE.PlaneBufferGeometry(20, 8);
			var timer = new THREE.Mesh(timer_plane, timer_material);
			this.timer = timer;
			timer.position.x = -390;
			timer.position.y = -350;
			timer.position.z = 75;
			this._page._addToScene(timer);
		}

		var textbox;
		var mouse = new THREE.Vector2(), hoveredChoice;
		this._mouse = mouse;
		this._hoveredChoice = hoveredChoice;
		var startx = this._params.x || -200;
		var starty = this._params.y || -190;
		var startz = this._params.z || 220;
		for (var i = 0; i < this._choices.length; i++) {
			textbox = this._page.createTextBox(this._choices[i], {
				fontsize: 46,
				borderColor: {
					r: 255,
					g: 255,
					b: 255,
					a: 0.8
				},
				backgroundColor: {
					r: 255,
					g: 255,
					b: 255,
					a: 0.8
				}
			});
			textbox.position.set(200 + startx, i * -40 + starty, startz + 10);
			textbox.name = "choices";

			// hack : because we are using Text2D, we are going to identify the raycast based on this name
			textbox.children[0].name = "choice_" + i;

			this._choicesBox.push(textbox);
			this._page._addToScene(this._choicesBox[i]);
		};
		//if location type, show
		if (this._params.type == "location") {
{'fraction_non_alphanumeric': 0.14105594956658787, 'fraction_numerical': 0.02364066193853428, 'mean_word_length': 3.1076051779935274, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2136783', 'n_tokens_mistral': 2102, 'n_tokens_neox': 1702, 'n_words': 413}