summaryrefslogtreecommitdiff
path: root/src/main.py
blob: 1ef703961bfe31af8b89bd591d03528d0dad9fe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from common import *

class KP:
	@staticmethod
	def newMap():
		from mapdata import KPMap
		KP.map = KPMap()
	
	@staticmethod
	def run():
		KP.app = QtGui.QApplication(sys.argv)

		KP.newMap()

		from ui import KPMainWindow
		
		KP.mainWindow = KPMainWindow()
		KP.mainWindow.show()

		KP.app.exec_()
	

	@classmethod
	def icon(cls, name):
		try:
			cache = cls.iconCache
		except AttributeError:
			cache = {}
			cls.iconCache = cache

		try:
			return cache[name]
		except KeyError:
			icon = QtGui.QIcon('Resources/%s.png' % name)
			cache[name] = icon
			return icon