Código:
from tkinter import *import subprocess
# Botão Jogar
def jogar():
subprocess.call("main.exe", shell=True)
# Botão Salvar
def salvar():
subprocess.run("Config.reg", shell=True)
resol = open('Config.reg', 'w')
resol.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"LangSelection"="Por"')
resol.close()
# Botão Resoluções
def resolu():
resol = open('Config.reg', 'at')
resol.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"Resolution"=dword:00000000\n')
resol.close()
def resolu1():
resol = open('Config.reg', 'at')
resol.write('\nWindows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"Resolution"=dword:00000001')
resol.close()
def resolu2():
resol = open('Config.reg', 'at')
resol.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"Resolution"=dword:00000002\n')
resol.close()
def resolu3():
resol = open('Config.reg', 'at')
resol.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"Resolution"=dword:0000003\n')
resol.close()
def resolu4():
resol = open('Config.reg', 'at')
resol.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"Resolution"=dword:0000004\n')
resol.close()
def resolu5():
resol = open('Config.reg', 'at')
resol.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"Resolution"=dword:0000005\n')
resol.close()
def resolu6():
resol = open('Config.reg', 'at')
resol.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"Resolution"=dword:0000006\n')
resol.close()
def resolu7():
resol = open('Config.reg', 'at')
resol.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"Resolution"=dword:0000007\n')
resol.close()
def resolu8():
resol = open('Config.reg', 'at')
resol.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"Resolution"=dword:0000008\n')
resol.close()
# Botão Músicas
def musicaON():
resol = open('Config.reg', 'at')
resol.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"MusicOnOFF"=dword:00000001\n')
resol.close()
def musicaOFF():
resol = open('Config.reg', 'at')
resol.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"MusicOnOFF"=dword:00000000\n')
resol.close()
# Botão Idiomas
def linEng():
lingua = open('Config.reg', 'at')
lingua.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"LangSelection"="Eng"\n')
lingua.close()
def linPor():
lingua = open('Config.reg', 'at')
lingua.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"LangSelection"="Por"\n')
lingua.close()
def linSpn():
lingua = open('Config.reg', 'at')
lingua.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"LangSelection"="Spn"\n')
lingua.close()
# Botão Sons
def sonOff():
son = open('Config.reg', 'at')
son.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"SoundOnOFF"=dword:00000000\n "VolumeLevel"=dword:00000000"\n')
son.close()
def sonOn():
son = open('Config.reg', 'at')
son.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"SoundOnOFF"=dword:00000001\n "VolumeLevel"=dword:00000001"\n')
son.close()
def janelaOFF():
windows = open('Config.reg', 'at')
windows.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"WindowMode"=dword:00000000\n')
windows.close()
def janelaON():
windows = open('Config.reg', 'at')
windows.write('Windows Registry Editor Version 5.00\n\n[HKEY_CURRENT_USER\Software\Webzen\Mu\Config]\n"WindowMode"=dword:00000001\n')
windows.close()
# Layout de opções
menu = Tk()
menu.geometry('400x600+750+100')
menu.title('Launcher PerfectZone')
menu.iconbitmap(default='img\\ico.ico')
#Foto PZ
logo = PhotoImage(file='img\\logo.png')
logoposição = Label(menu, image=logo)
logoposição.place(width=400, height=780, x=0, y=135)
#Credito
cred = Label(menu, text='By kingrox')
cred.place(x=330, y=570)
# Campo de nickName
nick = LabelFrame(menu, text='Nome')
nick.place(width=140, height=55, x=15, y=10)
nickN = Label(menu, text='Digite seu nome')
nickN = Entry(menu)
nickN.place(width=120, height=20, x=25, y=30)
ok = Button(menu, text='JOGAR', command=jogar)
ok.place(width=100, height=40, x=170, y=20)
cancelar = Button(menu, text='SALVAR', command=salvar)
cancelar.place(width=100, height=40, x=280, y=20)
# Botão linguagem
lin = LabelFrame(menu, text='Selecione a Lingua')
lin.place(width=370, height=65, x=15, y=80)
linP = Button(menu, text='Português', command=linPor)
linP.place(width=100, height=30, x=27, y=100)
linE = Button(menu, text='Espanhol', command=linSpn)
linE.place(width=100, height=30, x=147, y=100)
linF = Button(menu, text='Inglês', command=linEng)
linF.place(width=100, height=30, x=267, y=100)
# Resoluções
reso = LabelFrame(menu, text='Selecione a resolução!')
reso.place(width=370, height=85, x=15, y=155)
reso1 = Button(menu, text='640x480', command=resolu)
reso1.place(width=70, height=30, x=16, y=175)
reso2 = Button(menu, text='800x600', command=resolu1)
reso2.place(width=70, height=30, x=85, y=175)
reso3 = Button(menu, text='1024x768', command=resolu2)
reso3.place(width=70, height=30, x=155, y=175)
reso4 = Button(menu, text='1280x1024', command=resolu3)
reso4.place(width=70, height=30, x=230, y=175)
reso5 = Button(menu, text='1360x768', command=resolu4)
reso5.place(width=70, height=30, x=310, y=175)
reso6 = Button(menu, text='1440x900', command=resolu5)
reso6.place(width=70, height=30, x=50, y=205)
reso7 = Button(menu, text='1600x900', command=resolu6)
reso7.place(width=70, height=30, x=125, y=205)
reso8 = Button(menu, text='1680x1050', command=resolu7)
reso8.place(width=72, height=30, x=200, y=205)
reso9 = Button(menu, text='1920x1080', command=resolu8)
reso9.place(width=72, height=30, x=275, y=205)
# Botão de som
som = LabelFrame(menu, text='Ativar e desativar o som!')
som.place(width=370, height=65, x=15, y=250)
somON = Button(menu, text='Ativar som (ON)', command=sonOn)
somON.place(width=140, height=30, x=45, y=270)
somOFF = Button(menu, text='Desativar som (OFF)', command=sonOff)
somOFF.place(width=140, height=30, x=205, y=270)
# Botão de Música
music = LabelFrame(menu, text='Ativar e desativar a música!')
music.place(width=370, height=65, x=15, y=325)
musicON = Button(menu, text='Ativar música (ON)', command=musicaON)
musicON.place(width=140, height=30, x=45, y=345)
musicOFF = Button(menu, text='Desativar música (OFF)', command=musicaOFF)
musicOFF.place(width=140, height=30, x=205, y=345)
# Botão de Janela
janela = LabelFrame(menu, text='Ativar e desativar a Janela')
janela.place(width=370, height=65, x=15, y=400)
janelaON = Button(menu, text='Janela (ON)', command=janelaON)
janelaON.place(width=140, height=30, x=45, y=425)
janelaOFF = Button(menu, text='Janela (OFF)', command=janelaOFF)
janelaOFF.place(width=140, height=30, x=205, y=425)
menu.mainloop()