Commit 7440e0bc authored by Tošner, Jan's avatar Tošner, Jan
Browse files

v2.0

-přidaná možnost editování neprůchozích míst
-předělaná logika neprůchozích míst
--z obdélníků na pole
parent 2d8c7db9
import pygame
import ctypes
import os
import platform
from tkinter import Tk
from tkinter.filedialog import askopenfilename, asksaveasfilename
import platform
import pygame
# Size of the screen
tk = Tk()
SCREEN_TITLE = "Map Maker"
SCREEN_WIDTH = tk.winfo_screenwidth()
SCREEN_HEIGHT = tk.winfo_screenheight()
RATIO = (1920/SCREEN_WIDTH,1080/SCREEN_HEIGHT)
RATIO = (1920 / SCREEN_WIDTH, 1080 / SCREEN_HEIGHT)
os.environ['SDL_VIDEO_WINDOW_POS'] = "0,0"
# Colors according to RGB codes
WHITE_COLOR = (255, 255, 255)
......@@ -21,8 +21,6 @@ MAXIMAL_ZOOM = 4.5
clock = pygame.time.Clock()
pygame.font.init()
font = pygame.font.SysFont("Sans", 75)
if platform.system == "Windows":
ctypes.windll.user32.SetProcessDPIAware()
def scale(surf):
......@@ -62,9 +60,18 @@ class Game:
while running:
for event in pygame.event.get():
x, y = pygame.mouse.get_pos()
l, m, r = pygame.mouse.get_pressed()
x *= RATIO[0]
y *= RATIO[1]
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
in_menu = not in_menu
if editing:
book.blocks[editing].save()
book.editing = None
editing = None
else:
in_menu = not in_menu
changed = True
if event.key == pygame.K_TAB and not in_menu:
in_book = not in_book
......@@ -72,30 +79,41 @@ class Game:
book.editing = None
editing = None
if (event.key == pygame.K_KP_ENTER or event.key == pygame.K_RETURN) and editing:
book.blocks[editing].save()
book.editing = None
editing = None
changed = True
elif editing:
if l == 1 or r ==1:
if 560 < x < 1360 and 140 < y < 940:
if l == 1:
book.blocks[editing].update_wall(x, y, "1")
changed = True
elif r == 1:
book.blocks[editing].update_wall(x, y, "0")
changed = True
elif event.type == pygame.MOUSEBUTTONDOWN:
x, y = pygame.mouse.get_pos()
l, m, r = pygame.mouse.get_pressed()
x *= RATIO[0]
y *= RATIO[1]
if in_menu and l == 1:
if in_menu and event.button == 1:
# Cross
if 1165 < x < 1165 + 75 and 160 < y < 160 + 75:
in_menu = False
changed = True
# Save
elif 789 < x < 789 + 342 and 311 < y < 311 + 135:
Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing
path = asksaveasfilename(title = "Select file",defaultextension=".png", filetypes=(("PNG (*.png)", "*.png"),("All Files", "*.*") )) # show an "Open" dialog box and return the path to the selected file
tk.withdraw() # we don't want a full GUI, so keep the root window from appearing
path = asksaveasfilename(title="Select file", defaultextension=".png", filetypes=(
("PNG (*.png)", "*.png"),
("All Files", "*.*"))) # show an "Save" dialog box and return the path to the selected file
if path:
in_menu = False
changed = True
picture.save(path)
# Load
elif 789 < x < 789 + 342 and 473 < y < 473 + 135:
Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing
path = askopenfilename(title = "Select file",defaultextension=".png", filetypes=(("PNG (*.png)", "*.png"),("All Files", "*.*") )) # show an "Open" dialog box and return the path to the selected file
tk.withdraw() # we don't want a full GUI, so keep the root window from appearing
path = askopenfilename(title="Select file", defaultextension=".png", filetypes=(
("PNG (*.png)", "*.png"),
("All Files", "*.*"))) # show an "Open" dialog box and return the path to the selected file
if path:
in_menu = False
changed = True
......@@ -103,27 +121,26 @@ class Game:
# Vypnout program
elif 789 < x < 789 + 342 and 635 < y < 635 + 135:
running = False
elif in_book and l == 1 and not editing:
#Doleva
elif in_book and event.button == 1 and not editing:
# Doleva
if 330 < x < 330 + 42 and 890 < y < 890 + 63:
if book.page != 0:
book.page += -2
changed = True
#Doprava
# Doprava
elif 1530 < x < 1530 + 42 and 890 < y < 890 + 63:
if book.page + 2 < (len(book.blocks)+14)//15:
if book.page + 2 < (len(book.blocks) + 14) // 15:
book.page += 2
changed = True
#Reload
elif 287 < x < 287 + 75 and 38 < y < 38 +75:
# Reload
elif 287 < x < 287 + 75 and 38 < y < 38 + 75:
book.load()
changed = True
else:
selected = book.select(x, y)
elif in_book and r == 1 and not editing:
editing = book.select(x,y)
elif in_book and editing:
pass #TODO označování hit boxů
elif in_book and event.button == 3 and not editing:
editing = book.select(x, y)
changed = True
elif not in_menu and not in_book:
if event.button == 4:
if picture.extend != MAXIMAL_ZOOM:
......@@ -135,21 +152,21 @@ class Game:
picture.extend -= 0.5
picture.moveext(x, y, False)
changed = True
elif l == 1:
elif event.button == 1:
if selected >= 0:
picture.put(book.blocks[selected], (x * (1/RATIO[0]), y * (1/RATIO[1])))
picture.put(book.blocks[selected], (x * (1 / RATIO[0]), y * (1 / RATIO[1])))
changed = True
if m == 1:
pygame.mouse.get_rel()
moving = True
if moving and event.type == pygame.MOUSEBUTTONUP:
l, m, r = pygame.mouse.get_pressed()
elif moving and event.type == pygame.MOUSEBUTTONUP:
if m == 0:
moving = False
if moving and not in_menu and not in_book:
elif moving and not in_menu and not in_book:
picture.move(pygame.mouse.get_rel())
changed = True
if selected != -1 and not in_book and not in_menu:
if picture.preview(book.blocks[selected], pygame.mouse.get_pos(), changed):
changed = True
......@@ -159,19 +176,17 @@ class Game:
if changed:
changed = False
picture.print(self.screen)
#self.screen.blit(self.image, (0, 0)) #Přidání rámečku
# self.screen.blit(self.image, (0, 0)) #Přidání rámečku
if in_book:
if editing:
book.set_editing(editing)
book.draw(self.screen)
if in_menu:
menu.draw(self.screen)
if editing:
book.editing = pygame.transform.scale(book.blocks[editing].icon, (800, 800))
changed = True
# Update all game graphics
pygame.display.update()
#clock.tick(self.TICK_RATE)
# clock.tick(self.TICK_RATE)
class Picture:
......@@ -181,19 +196,33 @@ class Picture:
self.extend = 1
self.surf = pygame.Surface((SCREEN_WIDTH, SCREEN_HEIGHT))
self.pic = pygame.Surface((1920, 1072))
self.ratio = ((SCREEN_WIDTH/self.pic.get_width()), (SCREEN_HEIGHT/self.pic.get_height()))
self.ratio = ((SCREEN_WIDTH / self.pic.get_width()), (SCREEN_HEIGHT / self.pic.get_height()))
self.pic.fill(WHITE_COLOR)
self.shown = self.pic.copy()
self.last_cord = (-1, -1)
self.walls = {}
self.walls = [["0"]*1920 for _ in range(1080)]
def scale(self, pic):
return pygame.transform.scale(pic, (int(SCREEN_WIDTH * self.extend), int(SCREEN_HEIGHT * self.extend)))
def load(self, path):
self.pic = pygame.image.load(path)
self.ratio = ((SCREEN_WIDTH/self.pic.get_width()), (SCREEN_HEIGHT/self.pic.get_height()))
width = self.pic.get_width()
height = self.pic.get_height()
self.ratio = ((SCREEN_WIDTH / width), (SCREEN_HEIGHT / height))
self.shown = self.pic.copy()
name = path.replace("png", "txt")
self.walls = []
if os.path.isfile(name):
with open(name, 'r', encoding='UTF-8') as f:
while True:
line = f.readline()
if line == "":
break
arr = line.split()
self.walls.append(arr)
else:
self.walls = [["0"] * width for _ in range(height)]
def move(self, pos):
x, y = self.pos
......@@ -220,7 +249,7 @@ class Picture:
self.surf.blit(self.shown, self.pos)
screen.blit(self.surf, (0, 0))
def moveext(self, x, y, zoom): #zoom = true -> making bigger; false -> making smaller
def moveext(self, x, y, zoom): # zoom = true -> making bigger; false -> making smaller
xo, yo = self.pos
if zoom:
xm = x * self.extend
......@@ -229,32 +258,28 @@ class Picture:
else:
self.moveext((x - xo) / (self.extend + 0.5), (y - yo) / (self.extend + 0.5), True)
def save(self,path):
def save(self, path):
pygame.image.save(self.pic, path)
with open(path.replace("png", "txt"), 'w', encoding='UTF-8') as f:
for key in self.walls:
string = "".join(self.walls[key])
arr = string.split(";")
for text in arr:
#text = "".join(text)
rect = text.split(",")
x = int(rect[0]) + int(key[0])
y = int(rect[1]) + int(key[1])
f.write(str(x)+ "," + str(y) + " " + rect[2] + "," + rect[3] + "\n")
for line in self.walls:
text = " ".join(line)
f.write("%s\n" % text)
def put(self, img, cord):
x, y = cord
xp, yp = self.pos
cord = (((x - xp)//(16 * self.ratio[0] * self.extend))*16, ((y - yp)//(16 * self.ratio[1] * self.extend))*16)
cord = (
((x - xp) // (16 * self.ratio[0] * self.extend)) * 16, ((y - yp) // (16 * self.ratio[1] * self.extend)) * 16)
img.draw(self.pic, cord, self.walls)
self.shown = self.scale(self.pic)
def preview(self, img, cord, changed):
if self.last_cord != (cord[0]//16*self.extend, cord[1]//16*self.extend):
if self.last_cord != (cord[0] // 16 * self.extend, cord[1] // 16 * self.extend):
self.last_cord = cord
x, y = cord
xp, yp = self.pos
cord = (((x - xp)//(16 * self.ratio[0] * self.extend))*16, ((y - yp)//(16 * self.ratio[1] * self.extend))*16)
cord = (((x - xp) // (16 * self.ratio[0] * self.extend)) * 16,
((y - yp) // (16 * self.ratio[1] * self.extend)) * 16)
if self.last_cord != cord or changed:
self.shown = self.pic.copy()
img.draw(self.shown, cord, None)
......@@ -276,7 +301,7 @@ class Menu:
self.button2 = pygame.image.load("images/GUI/plank_14.png")
self.button3 = pygame.image.load("images/GUI/plank_15.png")
self.cross = pygame.image.load("images/GUI/cross.png")
self.cross = pygame.transform.scale(self.cross, (75,75))
self.cross = pygame.transform.scale(self.cross, (75, 75))
self.surf = pygame.Surface((1920, 1080), pygame.SRCALPHA, 32)
self.surf = self.surf.convert_alpha()
......@@ -307,9 +332,8 @@ class Book:
self.reload = pygame.image.load("images/GUI/reload.png")
self.reload = pygame.transform.scale(self.reload, (75, 75))
self.editing = None
self.dict = {}
self.editing_walls = None
self.page = 0
self.cords = [(300, 100)]
self.blocks = []
self.load()
self.surf = pygame.Surface((1920, 1080), pygame.SRCALPHA, 32)
......@@ -318,12 +342,13 @@ class Book:
def draw(self, screen):
self.surf.blit(self.book, (278, 27))
self.draw_icons(self.surf, self.page)
self.draw_icons(self.surf, self.page+1)
self.draw_icons(self.surf, self.page + 1)
self.surf.blit(self.left, (330, 890))
self.surf.blit(self.right, (1530, 890))
self.surf.blit(self.reload, (287, 38))
if self.editing:
self.surf.blit(self.editing, (560, 140))
self.surf.blit(self.editing_walls, (560, 140))
screen.blit(scale(self.surf), (0, 0))
def draw_icons(self, screen, page):
......@@ -337,16 +362,10 @@ class Book:
self.blocks[3 * i + j + page * 15].draw_book(screen, (400 + j * 175, 125 + i * 175))
def load(self):
with open("src/blocks.txt", 'r', encoding='UTF-8') as f:
while True:
line = f.readline()
if line == "":
break
split = line.split()
self.dict[split[0]] = split[1]
self.blocks = []
for name in os.listdir("images/blocks"):
self.blocks.append(Block(name, self.dict.get(name, "")))
if name.endswith("png"):
self.blocks.append(Block(name))
def select(self, x, y):
if 400 < x < 500 or 1050 < x < 1150:
......@@ -377,22 +396,64 @@ class Book:
else:
return -1
def set_editing(self, index):
self.editing = pygame.transform.scale(self.blocks[index].icon, (800, 800))
block = self.blocks[index]
temp = block.icon.copy()
for y in range(block.height):
for x in range(block.width):
if block.walls[y][x] == "1":
temp.set_at((x, y), (0, 0, 0, 128))
self.editing_walls = pygame.transform.scale(temp, (800, 800))
class Block:
def __init__(self, name, param):
self.icon = pygame.image.load("images/blocks/"+name)
def __init__(self, name):
self.icon = pygame.image.load("images/blocks/" + name)
self.name = name
self.param = param.split(";")
self.width, self.height = self.icon.get_size()
self.walls = []
name = name.replace("png", "txt")
if name in os.listdir("images/blocks"):
with open("images/blocks/" + name, 'r', encoding='UTF-8') as f:
while True:
line = f.readline()
if line == "":
break
arr = line.split()
self.walls.append(arr)
else:
self.walls = [["0"] * self.width for _ in range(self.height)]
with open("images/blocks/" + name, 'w+', encoding='UTF-8') as f:
for line in self.walls:
text = " ".join(line)
f.write("%s\n" % text)
def draw_book(self, screen, cord):
icon = pygame.transform.scale(self.icon,(100, 100))
icon = pygame.transform.scale(self.icon, (100, 100))
screen.blit(icon, cord)
def update_wall(self, x, y, to):
x -= 560
y -= 140
x = int(x//(800/self.width))
y = int(y//(800/self.height))
self.walls[y][x] = to
def draw(self, surf, cord, walls):
surf.blit(self.icon, cord)
if walls != None and self.param != [""]:
walls[cord] = self.param
x, y = cord
if walls != None and self.walls != [""]:
for i in range(self.height):
for j in range(self.width):
walls[int(y)+i][int(x)+j] = self.walls[i][j]
def save(self):
with open("images/blocks/" + self.name.replace("png", "txt"), 'w+', encoding='UTF-8') as f:
for line in self.walls:
text = " ".join(line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