<commit_before>#import time
import threading
import sys
import os

import pygame

from UIComponent import *
from utilities import *

class Program():

	def __init__(self):
		
		# constants
		self.WIN_TITLE = "RPG_Title"
		self.WIN_WIDTH = 1024
		self.WIN_HEIGHT = 576
		self.WIN_ICON_FILENAME = "\\Icon.png"
		self.FILL_COLOR = (0, 0, 0)
		
		# core variables
		self.isRunning = True
		self.isInGame = False
		self.uiComponents = []
		self.hoveredUI = None
		
		# in game
		self.player = None
		self.entities = []
		
		# pygame initialization
		pygame.init()
		
		self.pygameSurface = pygame.display.set_mode((self.WIN_WIDTH, self.WIN_HEIGHT))
		pygame.display.set_caption(self.WIN_TITLE)
		pygame.display.set_icon(load_img(self.WIN_ICON_FILENAME))
		
		# make the ui
		u = UIComponent()
		u.set_pos(400, 400)
		u.set_size(100, 100)
		self.uiComponents.append(u)
		
		u2 = UIComponent()
		u2.set_pos(380, 380)
		u2.set_size(100, 100)
		self.color = GRAY
		self.borderColor = WHITE
		self.uiComponents.append(u2)
		
		# begin the main program
		
		self.drawThread = threading.Thread(target=self.draw_loop)
		#self.drawThread.setDaemon(True)
		# threads should be killed manually
		self.drawThread.start()
		self.event_loop()

	def close(self):
		self.isRunning = False
		
		# kill any threads here
		self.drawThread.join()
		
		pygame.quit()
		sys.exit(0)

	def __is_mouse_over__(self, mX, mY, transform):
		ret = False
		
		xCondition = mX <= transform.get_pos_x() + transform.get_size_x() and mX > transform.get_pos_x()
		yCondition = mY <= transform.get_pos_y() + transform.get_size_y() and mY > transform.get_pos_y()
		
		ret = xCondition and yCondition
		return ret
	
	def event_loop(self):
		while self.isRunning:
<<<<<<< HEAD
			
			"""for ui in reversed(self.uiComponents):
				if !self.hoveredUI:
					if __is_mouse__
					self.hoveredUI = ui
					ui.on_hover_begin()
					break"""
			
=======
			mX, mY = pygame.mouse.get_pos()
		
			for ui in reversed(self.uiComponents):
				"""if self.hoveredUI:
					if not self.__is_mouse_over__(mX, mY, self.hoveredUI):
						self.hoveredUI.on_hover_end()
						self.hoveredUI = None
				else:
					if self.__is_mouse_over__(mX, mY, ui):
						self.hoveredUI = ui
						ui.on_hover_begin()
						break"""
				if self.__is_mouse_over__(mX, mY, ui):
					if self.hoveredUI == ui:
						pass
					else:
						self.hoveredUI = ui
						ui.on_hover_begin()
				else:
					pass
					
>>>>>>> refs/remotes/origin/JasonMilhavensBranch
			
			
			for event in pygame.event.get():
				if event.type == pygame.QUIT:
					self.close()
				elif event.type == pygame.MOUSEBUTTONDOWN:
					#mX = event.pos[0]
					#mY = event.pos[1]
					<commit_msg>Fixed merge conflict?<commit_after>#import time
import threading
import sys
import os

import pygame

from UIComponent import *
from utilities import *

class Program():

	def __init__(self):
		
		# constants
		self.WIN_TITLE = "RPG_Title"
		self.WIN_WIDTH = 1024
		self.WIN_HEIGHT = 576
		self.WIN_ICON_FILENAME = "\\Icon.png"
		self.FILL_COLOR = (0, 0, 0)
		
		# core variables
		self.isRunning = True
		self.isInGame = False
		self.uiComponents = []
		self.hoveredUI = None
		
		# in game
		self.player = None
		self.entities = []
		
		# pygame initialization
		pygame.init()
		
		self.pygameSurface = pygame.display.set_mode((self.WIN_WIDTH, self.WIN_HEIGHT))
		pygame.display.set_caption(self.WIN_TITLE)
		pygame.display.set_icon(load_img(self.WIN_ICON_FILENAME))
		
		# make the ui
		u = UIComponent()
		u.set_pos(400, 400)
		u.set_size(100, 100)
		self.uiComponents.append(u)
		
		u2 = UIComponent()
		u2.set_pos(380, 380)
		u2.set_size(100, 100)
		self.color = GRAY
		self.borderColor = WHITE
		self.uiComponents.append(u2)
		
		# begin the main program
		
		self.drawThread = threading.Thread(target=self.draw_loop)
		#self.drawThread.setDaemon(True)
		# threads should be killed manually
		self.drawThread.start()
		self.event_loop()

	def close(self):
		self.isRunning = False
		
		# kill any threads here
		self.drawThread.join()
		
		pygame.quit()
		sys.exit(0)

	def __is_mouse_over__(self, mX, mY, transform):
		ret = False
		
		xCondition = mX <= transform.get_pos_x() + transform.get_size_x() and mX > transform.get_pos_x()
		yCondition = mY <= transform.get_pos_y() + transform.get_size_y() and mY > transform.get_pos_y()
		
		ret = xCondition and yCondition
		return ret
	
	def event_loop(self):
		while self.isRunning:
			mX, mY = pygame.mouse.get_pos()
			"""for ui in reversed(self.uiComponents):
				if !self.hoveredUI:
					if __is_mouse__
					self.hoveredUI = ui
					ui.on_hover_begin()
					break"""
		
			for ui in reversed(self.uiComponents):
				"""if self.hoveredUI:
					if not self.__is_mouse_over__(mX, mY, self.hoveredUI):
						self.hoveredUI.on_hover_end()
						self.hoveredUI = None
				else:
					if self.__is_mouse_over__(mX, mY, ui):
						self.hoveredUI = ui
						ui.on_hover_begin()
						break"""
				if self.__is_mouse_over__(mX, mY, ui):
					if self.hoveredUI == ui:
						pass
					else:
						self.hoveredUI = ui
						ui.on_hover_begin()
				else:
					pass
			
			
			for event in pygame.event.get():
				if event.type == pygame.QUIT:
					self.close()
				elif event.type == pygame.MOUSEBUTTONDOWN:
{'fraction_non_alphanumeric': 0.11669213139801375, 'fraction_numerical': 0.015278838808250574, 'mean_word_length': 3.069153069153069, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '1410054', 'n_tokens_mistral': 2407, 'n_tokens_neox': 1907, 'n_words': 398}