Skip to content

Commit

Permalink
Added export function
Browse files Browse the repository at this point in the history
Unimplemented, but added export function.

Pushed so I can add a "To do list".md on github
  • Loading branch information
Nughm committed Mar 22, 2024
1 parent f4a1742 commit 90652c9
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 16 deletions.
42 changes: 38 additions & 4 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 18 additions & 12 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
pygame.init()
Width, height = 1280, 720
screen = pygame.display.set_mode((Width, height))
pygame.scrap.init()
icon = pygame.image.load("favicon.png")
pygame.display.set_icon(icon)
pygame.display.set_caption("Fetch Decode Execute GCSE LMC simulator")
Expand Down Expand Up @@ -215,15 +216,17 @@ def convass(test):
memory[i] = WordToNum[temp[0]] + temp[1]
return memory

# def export(file):
# exportstring = ""
# if file:
# for i in range(len(file)):
# exportstring += file[i]
# exportstring += "%"
# return "Copied into clipboard!"
# else:
# return "Instructions is empty..."
def export(file):
exportstring = ""
if file:
for i in range(len(file)):
for e in range(len(file[i])):
exportstring += file[i][e]
exportstring += "%"
pygame.scrap.put_text(exportstring)
return True
else:
return False



Expand Down Expand Up @@ -284,7 +287,7 @@ def convass(test):
#Instantiate dots
dot1 = dot("Red")
dot2 = dot("Red")

#phase1 items:
#DisplayTyped
Instructions = []
Expand All @@ -297,7 +300,7 @@ def convass(test):
entry_surf = pygame.surface.Surface((250, 600))
entry_surf_rect = entry_surf.get_rect(topleft = (0, 50))
entry_surf.fill("Green")
guide = base_font.render("|", False, "White")
guide = base_font.render("|", False, "Orange")
guide_rect = guide.get_rect(center = (0,0))
screen.fill("White")
entry = [[]]
Expand Down Expand Up @@ -354,6 +357,8 @@ def convass(test):
panim_surface = panim_1
gone = False

#export button

# animation for person talking
def personanimation(panim_index, panim_surface, panim):
panim_index += 0.24
Expand All @@ -376,8 +381,9 @@ def personanimation(panim_index, panim_surface, panim):
while phase1:
for event in pygame.event.get():
if event.type == pygame.QUIT:

export(entry)
pygame.quit()
# print(Instructions)
exit()

if event.type == pygame.MOUSEBUTTONDOWN:
Expand Down

0 comments on commit 90652c9

Please sign in to comment.