Sign in to follow this  
Followers 0
cheeseandcereal

Background Picture

11 posts in this topic

#1 ·  Posted (edited)

So I'm trying to create a background picture for my gui, but the picture keeps coming on top of the buttons. Here's the code for my GUI:

#NoTrayIcon
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:UsersDad & MomDocumentsAutoit ScriptsHunter Gametype ChangerHunter client changer.kxf
$Form1 = GUICreate("Adam's Minecraft Gametype Changer", 630, 346, 392, 196)
$MenuItem4 = GUICtrlCreateMenu("&File")
$MenuItem6 = GUICtrlCreateMenuItem("Help", $MenuItem4)
$MenuItem7 = GUICtrlCreateMenuItem("Exit", $MenuItem4)
$MenuItem5 = GUICtrlCreateMenu("&Change Mode")
$MenuItem2 = GUICtrlCreateMenuItem("Backup and Restore", $MenuItem5)
$MenuItem3 = GUICtrlCreateMenuItem("Server Gametype Changer", $MenuItem5)
GUISetBkColor(0x00FF00)
$Label1 = GUICtrlCreateLabel("Adam's Minecraft Gametype changer for Hunter", 86, 16, 456, 28)
GUICtrlSetFont(-1, 15, 800, 0, "arial")
$Button1 = GUICtrlCreateButton("1.1.0", 256, 88, 113, 41)
$Button2 = GUICtrlCreateButton("1.0.0 with mods", 256, 144, 113, 41)
$Button3 = GUICtrlCreateButton("1.0.0 without mods", 104, 144, 113, 41)
$Button4 = GUICtrlCreateButton("1.8.1 Beta", 409, 88, 113, 41)
$Label2 = GUICtrlCreateLabel($Version, 125, 48, 42, 20)
GUICtrlSetFont(-1, 10, 400, 0, "arial")
$Button6 = GUICtrlCreateButton("Start Minecraft", 178, 248, 113, 41)
$Button13 = GUICtrlCreateButton("1.2.0", 104, 88, 113, 41)
$Group1 = GUICtrlCreateGroup("Gametypes", 96, 72, 433, 121)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button14 = GUICtrlCreateButton("Start Server", 336, 248, 113, 41)
$Group2 = GUICtrlCreateGroup("Start Services", 168, 232, 289, 65)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetState(-1,$GUI_DISABLE)
$Pic1 = GUICtrlCreatePic("C:UsersDad & MomDownloadsminecraft.jpg", 0, 0, 629, 325)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

So how would I make pic1 appear behind the buttons, labels, and groups when I run the program?

Edited by cheeseandcereal

Share this post


Link to post
Share on other sites



From the Help file for GUICtrlCreatePic

If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control and create it after the others controls: GuiCtrlSetState(-1,$GUI_DISABLE).

The help file is your friend when it comes to learning this language.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yes, I saw that in the help file, and as you can see it's actually in my script (3rd to last line), but for some reasons the picture still ends up on top of the other buttons, groups, labels etc

Edited by cheeseandcereal

Share this post


Link to post
Share on other sites

the control you are trying to disable (-1) means the previously created control, which is a group, rather than a picture.

I NEVER use -1 because that may produce errors. Use the correct variable pointer to the GUI Ctrl and it will work.

#NoTrayIcon
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:UsersDad & MomDocumentsAutoit ScriptsHunter Gametype ChangerHunter client changer.kxf
$Form1 = GUICreate("Adam's Minecraft Gametype Changer", 630, 346, 392, 196)
$MenuItem4 = GUICtrlCreateMenu("&File")
$MenuItem6 = GUICtrlCreateMenuItem("Help", $MenuItem4)
$MenuItem7 = GUICtrlCreateMenuItem("Exit", $MenuItem4)
$MenuItem5 = GUICtrlCreateMenu("&Change Mode")
$MenuItem2 = GUICtrlCreateMenuItem("Backup and Restore", $MenuItem5)
$MenuItem3 = GUICtrlCreateMenuItem("Server Gametype Changer", $MenuItem5)
GUISetBkColor(0x00FF00)
$Label1 = GUICtrlCreateLabel("Adam's Minecraft Gametype changer for Hunter", 86, 16, 456, 28)
GUICtrlSetFont(-1, 15, 800, 0, "arial")
$Button1 = GUICtrlCreateButton("1.1.0", 256, 88, 113, 41)
$Button2 = GUICtrlCreateButton("1.0.0 with mods", 256, 144, 113, 41)
$Button3 = GUICtrlCreateButton("1.0.0 without mods", 104, 144, 113, 41)
$Button4 = GUICtrlCreateButton("1.8.1 Beta", 409, 88, 113, 41)
$Label2 = GUICtrlCreateLabel($Version, 125, 48, 42, 20)
GUICtrlSetFont(-1, 10, 400, 0, "arial")
$Button6 = GUICtrlCreateButton("Start Minecraft", 178, 248, 113, 41)
$Button13 = GUICtrlCreateButton("1.2.0", 104, 88, 113, 41)
$Group1 = GUICtrlCreateGroup("Gametypes", 96, 72, 433, 121)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button14 = GUICtrlCreateButton("Start Server", 336, 248, 113, 41)
$Group2 = GUICtrlCreateGroup("Start Services", 168, 232, 289, 65)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pic1 = GUICtrlCreatePic("C:UsersDad & MomDownloadsminecraft.jpg", 0, 0, 629, 325)
GUICtrlSetState($Pic1,$GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Also note that you can not set the state of a control until it has been created.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thank's fot the tips, I will keep them in mind for future programming, unfortunately, when I run this GUI (the one you have pasted in the previous post), after starting the script, the picture is all you see and the buttons only appear after dragging my mouse across them and the labels and groups never appear. any ideas? Is this abnormal?

If for some reason you need it, here is my entire script (the picture that the first GUI is referencing from $Pic1 is )

#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=HOMECOMPUTER-PCUsersAdamDocumentsAdam's file'sFun StuffPicturesminecraft2.ico
#AutoIt3Wrapper_Outfile=Gametype Changer +.exe
#AutoIt3Wrapper_Res_Comment=Adam's Minecraft Gametype Changer + for Hunter
#AutoIt3Wrapper_Res_Description=Adam Crowder
#AutoIt3Wrapper_Res_Fileversion=2.1.3
#AutoIt3Wrapper_Res_LegalCopyright=Don't need no copyright
#AutoIt3Wrapper_Res_Language=1033
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Add_Constants=n
#AutoIt3Wrapper_Tidy_Stop_OnError=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <INet.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("MustDeclareVars", 1)
Global $Button1
Global $Button2
Global $Button3
Global $Button4
Global $Button5
Global $Button6
Global $Button7
Global $Button8
Global $Button9
Global $Button10
Global $Button11
Global $Button12
Global $Button13
Global $Button14
Global $Button15
Global $Button16
Global $Button17
Global $check11
Global $check12
Global $check13
Global $check14
Global $check15
Global $check21
Global $check22
Global $check23
Global $check24
Global $check25
Global $check31
Global $check32
Global $check33
Global $check34
Global $check35
Global $check41
Global $check42
Global $check51
Global $check52
Global $check53
Global $check54
Global $check55
Global $check61
Global $check71
Global $cancel1
Global $cancel2
Global $cancel3
Global $cancel4
Global $cancel5
Global $cancel6
Global $confirm1
Global $confirm2
Global $confirm3
Global $confirm4
Global $confirm5
Global $confirm6
Global $copy1
Global $copy2
Global $copy3
Global $copy4
Global $copy5
Global $copy6
Global $copy7
Global $fail1
Global $fail2
Global $fail3
Global $fail4
Global $fail5
Global $fail6
Global $fail7
Global $fail8
Global $fail9
Global $fail10
Global $fail11
Global $fail12
Global $fail13
Global $fail14
Global $Form1
Global $Form2
Global $Form3
Global $Group1
Global $Group2
Global $Group3
Global $Input1
Global $ip
Global $Label1
Global $Label2
Global $Label3
Global $Label4
Global $Label5
Global $Label6
Global $Label7
Global $MenuItem1
Global $MenuItem2
Global $MenuItem3
Global $MenuItem4
Global $MenuItem5
Global $MenuItem6
Global $MenuItem7
Global $nMsg
Global $null
Global $Pic1
Global $SVersion
Global $SVersion1
Global $SVersion2
Global $SVersion3
Global $Version
Global $Version1
Global $Version2
Global $Version3
Global $Version4
Global $Version5
$ip = _GetIP()
$SVersion = "There was an error finding your current server version"
$SVersion1 = FileExists("C:GametypeSwitcherMinecraftVersionsServerCurrentVersion1.0.1.txt")
$SVersion2 = FileExists("C:GametypeSwitcherMinecraftVersionsServerCurrentVersion1.1.0.txt")
$SVersion3 = FileExists("C:GametypeSwitcherMinecraftVersionsServerCurrentVersion1.2.0.txt")
If $SVersion1 = 1 Then $SVersion = "Current Minecraft Server version is 1.0.1"
If $SVersion2 = 1 Then $SVersion = "Current Minecraft Server version is 1.1.0"
If $SVersion3 = 1 Then $SVersion = "Current Minecraft Server version is 1.2.0"
$Version = "There was an error finding your current version"
$Version1 = FileExists("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.1.0.txt")
$Version2 = FileExists("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.0.0mods.txt")
$Version3 = FileExists("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.0.0.txt")
$Version4 = FileExists("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.8.1Beta.txt")
$Version5 = FileExists("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.2.0.txt")
If $Version1 = 1 Then $Version = "Current Minecraft Version is 1.1.0"
If $Version2 = 1 Then $Version = "Current Minecraft Version is 1.0.0 with mods"
If $Version3 = 1 Then $Version = "Current Minecraft Version is 1.0.0 without mods"
If $Version4 = 1 Then $Version = "Current Minecraft Version is 1.8.1 Beta"
If $Version5 = 1 Then $Version = "Current Minecraft Version is 1.2.0"
#Region ### START Koda GUI section ### Form=C:UsersDad & MomDocumentsAutoit ScriptsHunter Gametype ChangerHunter client changer.kxf
$Form1 = GUICreate("Adam's Minecraft Gametype Changer", 630, 346, 392, 196)
$MenuItem4 = GUICtrlCreateMenu("&File")
$MenuItem6 = GUICtrlCreateMenuItem("Help", $MenuItem4)
$MenuItem7 = GUICtrlCreateMenuItem("Exit", $MenuItem4)
$MenuItem5 = GUICtrlCreateMenu("&Change Mode")
$MenuItem2 = GUICtrlCreateMenuItem("Backup and Restore", $MenuItem5)
$MenuItem3 = GUICtrlCreateMenuItem("Server Gametype Changer", $MenuItem5)
GUISetBkColor(0x000000)
$Label1 = GUICtrlCreateLabel("Adam's Minecraft Gametype changer for Hunter", 86, 16, 456, 28)
GUICtrlSetFont(-1, 15, 800, 0, "arial")
GUICtrlSetColor(-1, 0xFFFFFF)
$Button1 = GUICtrlCreateButton("1.1.0", 256, 88, 113, 41)
$Button2 = GUICtrlCreateButton("1.0.0 with mods", 256, 144, 113, 41)
$Button3 = GUICtrlCreateButton("1.0.0 without mods", 104, 144, 113, 41)
$Button4 = GUICtrlCreateButton("1.8.1 Beta", 409, 88, 113, 41)
$Label2 = GUICtrlCreateLabel($Version, 125, 48, 458, 20)
GUICtrlSetFont(-1, 10, 400, 0, "arial")
GUICtrlSetColor(-1, 0xFFFFFF)
$Button6 = GUICtrlCreateButton("Start Minecraft", 178, 248, 113, 41)
$Button13 = GUICtrlCreateButton("1.2.0", 104, 88, 113, 41)
$Group1 = GUICtrlCreateGroup("Gametypes", 96, 72, 433, 121)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button14 = GUICtrlCreateButton("Start Server", 336, 248, 113, 41)
$Group2 = GUICtrlCreateGroup("Start Services", 168, 232, 289, 65)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pic1 = GUICtrlCreatePic("C:UsersDad & MomDownloadsminecraft.jpg", 0, 0, 629, 325)
GUICtrlSetState($Pic1,$GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
If $nMsg = $Button1 Then Button1()
If $nMsg = $Button2 Then Button2()
If $nMsg = $Button3 Then Button3()
If $nMsg = $Button4 Then Button4()
If $nMsg = $Button6 Then Button6()
If $nMsg = $Button13 Then Button13()
If $nMsg = $Button14 Then Button14()
If $nMsg = $MenuItem2 Then MenuItem2()
If $nMsg = $MenuItem3 Then MenuItem3()
If $nMsg = $MenuItem6 Then MenuItem6()
If $nMsg = $MenuItem7 Then MenuItem7()
WEnd
Func MenuItem1()
GUIDelete($Form2)
GUIDelete($Form3)
#Region ### START Koda GUI section ### Form=C:UsersDad & MomDocumentsAutoit ScriptsHunter Gametype ChangerHunter client changer.kxf
$Form1 = GUICreate("Adam's Minecraft Gametype Changer", 630, 346, 392, 196)
$MenuItem4 = GUICtrlCreateMenu("&File")
$MenuItem6 = GUICtrlCreateMenuItem("Help", $MenuItem4)
$MenuItem7 = GUICtrlCreateMenuItem("Exit", $MenuItem4)
$MenuItem5 = GUICtrlCreateMenu("&Change Mode")
$MenuItem2 = GUICtrlCreateMenuItem("Backup and Restore", $MenuItem5)
$MenuItem3 = GUICtrlCreateMenuItem("Server Gametype Changer", $MenuItem5)
GUISetBkColor(0x000000)
$Label1 = GUICtrlCreateLabel("Adam's Minecraft Gametype changer for Hunter", 86, 16, 456, 28)
GUICtrlSetFont(-1, 15, 800, 0, "arial")
GUICtrlSetColor(-1, 0xFFFFFF)
$Button1 = GUICtrlCreateButton("1.1.0", 256, 88, 113, 41)
$Button2 = GUICtrlCreateButton("1.0.0 with mods", 256, 144, 113, 41)
$Button3 = GUICtrlCreateButton("1.0.0 without mods", 104, 144, 113, 41)
$Button4 = GUICtrlCreateButton("1.8.1 Beta", 409, 88, 113, 41)
$Label2 = GUICtrlCreateLabel($Version, 125, 48, 458, 20)
GUICtrlSetFont(-1, 10, 400, 0, "arial")
GUICtrlSetColor(-1, 0xFFFFFF)
$Button6 = GUICtrlCreateButton("Start Minecraft", 178, 248, 113, 41)
$Button13 = GUICtrlCreateButton("1.2.0", 104, 88, 113, 41)
$Group1 = GUICtrlCreateGroup("Gametypes", 96, 72, 433, 121)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button14 = GUICtrlCreateButton("Start Server", 336, 248, 113, 41)
$Group2 = GUICtrlCreateGroup("Start Services", 168, 232, 289, 65)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pic1 = GUICtrlCreatePic("C:UsersDad & MomDownloadsminecraft.jpg", 0, 0, 629, 325)
GUICtrlSetState($Pic1,$GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
If $nMsg = $Button1 Then Button1()
If $nMsg = $Button2 Then Button2()
If $nMsg = $Button3 Then Button3()
If $nMsg = $Button4 Then Button4()
If $nMsg = $Button6 Then Button6()
If $nMsg = $Button13 Then Button13()
If $nMsg = $Button14 Then Button14()
If $nMsg = $MenuItem2 Then MenuItem2()
If $nMsg = $MenuItem3 Then MenuItem3()
If $nMsg = $MenuItem6 Then MenuItem6()
If $nMsg = $MenuItem7 Then MenuItem7()
WEnd
EndFunc
Func MenuItem2()
GUIDelete($Form1)
GUIDelete($Form3)
#region ### START Koda GUI section ### Form=C:UsersDad & MomDocumentsAutoit ScriptsHunter Gametype ChangerHunter backup restore.kxf
$Form2 = GUICreate("Adams Minecraft Backup and Restore Manager", 630, 346, 392, 196)
$MenuItem4 = GUICtrlCreateMenu("&File")
$MenuItem6 = GUICtrlCreateMenuItem("Help", $MenuItem4)
$MenuItem7 = GUICtrlCreateMenuItem("Exit", $MenuItem4)
$MenuItem5 = GUICtrlCreateMenu("&Change Mode")
$MenuItem1 = GUICtrlCreateMenuItem("Client Gametype Changer", $MenuItem5)
$MenuItem3 = GUICtrlCreateMenuItem("Server Gametype Changer", $MenuItem5)
GUISetBkColor(0x00FF00)
$Group1 = GUICtrlCreateGroup("Gametype Changer Jar File Backup and Restore", 32, 40, 565, 149)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetState(-1, $GUI_HIDE)
$Label4 = GUICtrlCreateLabel("Click here to backup current jar files", 74, 122, 173, 17)
$Button7 = GUICtrlCreateButton("Jar Backup", 101, 141, 113, 41)
$Label5 = GUICtrlCreateLabel("Messed something up? Click Here", 399, 62, 165, 17)
$Button8 = GUICtrlCreateButton("Restore", 421, 79, 113, 41)
$Label6 = GUICtrlCreateLabel("If you managed to mess up the restore, click here", 356, 125, 236, 17)
$Button9 = GUICtrlCreateButton("Old Restore", 418, 141, 113, 41)
$Label7 = GUICtrlCreateLabel("If you have installed new, working mods, click here", 37, 62, 244, 17)
$Button12 = GUICtrlCreateButton("Mods Backup", 99, 79, 113, 41)
$Button10 = GUICtrlCreateButton("Backup World Saves", 145, 207, 145, 41)
$Button11 = GUICtrlCreateButton("Restore Save Backups", 337, 207, 145, 41)
$Label1 = GUICtrlCreateLabel("Adam's Minecraft Backup and Restore Manager for Hunter", 36, 7, 557, 28)
GUICtrlSetFont(-1, 15, 800, 0, "arial")
$Button6 = GUICtrlCreateButton("Start Minecraft", 178, 274, 113, 41)
$Group2 = GUICtrlCreateGroup("World Save Backup and Restore", 136, 192, 353, 65)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button14 = GUICtrlCreateButton("Start Server", 338, 274, 113, 41)
$Group3 = GUICtrlCreateGroup("Start Services", 168, 256, 289, 65)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
  $nMsg = GUIGetMsg()
  Switch $nMsg
   Case $GUI_EVENT_CLOSE
    Exit
  EndSwitch
  If $nMsg = $Button6 Then Button6()
  If $nMsg = $Button7 Then Button7()
  If $nMsg = $Button8 Then Button8()
  If $nMsg = $Button9 Then Button9()
  If $nMsg = $Button10 Then Button10()
  If $nMsg = $Button11 Then Button11()
  If $nMsg = $Button12 Then Button12()
  If $nMsg = $Button14 Then Button14()
  If $nMsg = $MenuItem1 Then MenuItem1()
  If $nMsg = $MenuItem3 Then MenuItem3()
  If $nMsg = $MenuItem6 Then MenuItem6()
  If $nMsg = $MenuItem7 Then MenuItem7()
WEnd
EndFunc   ;==>MenuItem2
Func MenuItem3()
GUIDelete($Form1)
GUIDelete($Form2)
#region ### START Koda GUI section ### Form=C:UsersDad & MomDocumentsAutoit ScriptsHunter Gametype Changerhunter server changer.kxf
$Form3 = GUICreate("Server Gametype Changer", 630, 346, 392, 196)
$MenuItem4 = GUICtrlCreateMenu("&File")
$MenuItem6 = GUICtrlCreateMenuItem("Help", $MenuItem4)
$MenuItem7 = GUICtrlCreateMenuItem("Exit", $MenuItem4)
$MenuItem5 = GUICtrlCreateMenu("&Change Mode")
$MenuItem1 = GUICtrlCreateMenuItem("Client Gametype Changer", $MenuItem5)
$MenuItem2 = GUICtrlCreateMenuItem("Backup and Restore", $MenuItem5)
GUISetBkColor(0x00FF00)
$Label1 = GUICtrlCreateLabel("Adam's Server Gametype changer for Hunter", 100, 2, 429, 28)
GUICtrlSetFont(-1, 15, 800, 0, "arial")
$Input1 = GUICtrlCreateInput("", 216, 175, 201, 25)
GUICtrlSetFont(-1, 11, 400, 0, "arial")
$Label3 = GUICtrlCreateLabel("IP Address", 223, 157, 55, 17)
$Button5 = GUICtrlCreateButton("Get IP", 286, 151, 57, 25)
$Button6 = GUICtrlCreateButton("Start Minecraft", 168, 248, 113, 41)
$Button14 = GUICtrlCreateButton("Start Server", 352, 248, 113, 41)
$Button15 = GUICtrlCreateButton("1.0.1", 258, 72, 113, 41)
$Button16 = GUICtrlCreateButton("1.1.0", 448, 72, 113, 41)
$Button17 = GUICtrlCreateButton("1.2.0 (coming soon)", 72, 72, 113, 41)
$Group1 = GUICtrlCreateGroup("Server Gametypes", 64, 56, 505, 65)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("IP Address", 200, 136, 241, 73)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Start Services", 160, 232, 313, 65)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label2 = GUICtrlCreateLabel($SVersion, 128, 32, 466, 20)
GUICtrlSetFont(-1, 10, 400, 0, "arial")
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
  $nMsg = GUIGetMsg()
  Switch $nMsg
   Case $GUI_EVENT_CLOSE
    Exit
  EndSwitch
  If $nMsg = $Button5 Then Button5()
  If $nMsg = $Button6 Then Button6()
  If $nMsg = $Button14 Then Button14()
  If $nMsg = $Button15 Then Button15()
  If $nMsg = $Button16 Then Button16()
  If $nMsg = $Button17 Then Button17()
  If $nMsg = $MenuItem1 Then MenuItem1()
  If $nMsg = $MenuItem2 Then MenuItem2()
  If $nMsg = $MenuItem6 Then MenuItem6()
  If $nMsg = $MenuItem7 Then MenuItem7()
WEnd
EndFunc   ;==>MenuItem3
Func MenuItem6()
MsgBox(0, "Help", "You should know how to run this program, I made it for you. If you are confused, just call me!")
EndFunc   ;==>MenuItem6
Func MenuItem7()
Exit
EndFunc   ;==>MenuItem7
Func Button1()
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.1.0.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.0.0mods.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.0.0.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.8.1Beta.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.2.0.txt")
$copy1 = FileCopy("C:GametypeSwitcherMinecraftVersions1.1.0minecraft.jar", "C:UsersHayes FamilyAppDataRoaming.minecraftbin", 1)
If $copy1 = 1 Then
  FileCopy("C:GametypeSwitcherMinecraftVersions1.1.01.1.0.txt", "C:GametypeSwitcherMinecraftVersionsCurrentVersion", 1)
  $Version = "Current Minecraft Version is 1.1.0"
  GUICtrlSetData($Label2, "Current Minecraft Version is 1.1.0")
  MsgBox(0, "Success", "The version transfer to Minecraft 1.1.0 was a success")
EndIf
If $copy1 = 0 Then $fail1 = MsgBox(4 + 48, "Failure", "The version transfer was a failure would you like to try again?")
If $fail1 = 6 Then Button1()
EndFunc   ;==>Button1
Func Button2()
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.1.0.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.0.0mods.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.0.0.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.8.1Beta.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.2.0.txt")
$copy2 = FileCopy("C:GametypeSwitcherMinecraftVersions1.0.0modsminecraft.jar", "C:UsersHayes FamilyAppDataRoaming.minecraftbin", 1)
If $copy1 = 1 Then
  FileCopy("C:GametypeSwitcherMinecraftVersions1.0.0mods1.0.0mods.txt", "C:GametypeSwitcherMinecraftVersionsCurrentVersion", 1)
  $Version = "Current Minecraft Version is 1.0.0 with mods"
  GUICtrlSetData($Label2, "Current Minecraft Version is 1.0.0 with mods")
  MsgBox(0, "Success", "The version transfer to Minecraft 1.0.0 with mods was a success")
EndIf
If $copy2 = 0 Then $fail2 = MsgBox(4 + 48, "Failure", "The version transfer was a failure would you like to try again?")
If $fail2 = 6 Then Button2()
EndFunc   ;==>Button2
Func Button3()
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.1.0.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.0.0mods.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.0.0.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.8.1Beta.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.2.0.txt")
$copy3 = FileCopy("C:GametypeSwitcherMinecraftVersions1.0.0minecraft.jar", "C:UsersHayes FamilyAppDataRoaming.minecraftbin", 1)
If $copy3 = 1 Then
  FileCopy("C:GametypeSwitcherMinecraftVersions1.0.01.0.0.txt", "C:GametypeSwitcherMinecraftVersionsCurrentVersion", 1)
  $Version = "Current Minecraft Version is 1.0.0 without mods"
  GUICtrlSetData($Label2, "Current Minecraft Version is 1.0.0 without mods")
  MsgBox(0, "Success", "The version transfer to Minecraft 1.0.0 without mods was a success")
EndIf
If $copy3 = 0 Then $fail3 = MsgBox(4 + 48, "Failure", "The version transfer was a failure would you like to try again?")
If $fail2 = 6 Then Button3()
EndFunc   ;==>Button3
Func Button4()
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.1.0.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.0.0mods.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.0.0.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.8.1Beta.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.2.0.txt")
$copy4 = FileCopy("C:GametypeSwitcherMinecraftVersions1.8.1minecraft.jar", "C:UsersHayes FamilyAppDataRoaming.minecraftbin", 1)
If $copy4 = 1 Then
  FileCopy("C:GametypeSwitcherMinecraftVersions1.8.11.8.1Beta.txt", "C:GametypeSwitcherMinecraftVersionsCurrentVersion", 1)
  $Version = "Current Minecraft Version is 1.8.1 Beta"
  GUICtrlSetData($Label2, "Current Minecraft Version is 1.8.1 Beta")
  MsgBox(0, "Success", "The version transfer to Minecraft 1.8.1 Beta")
EndIf
If $copy4 = 0 Then $fail4 = MsgBox(4 + 48, "Failure", "The version transfer was a failure would you like to try again?")
If $fail4 = 6 Then Button4()
EndFunc   ;==>Button4
Func Button5()
GUICtrlSetData($Input1, $ip)
EndFunc   ;==>Button5
Func Button6()
Run("cmd /c start C:GametypeSwitcherMinecraft.exe", "", @SW_HIDE)
EndFunc   ;==>Button6
Func Button7()
$confirm5 = MsgBox(4 + 64, "Confirmation", "This will backup your current jar files so that if something gets messed up, (such as gametype changer stops working because you installed bad mods and did a mods backup or you backed up a bad jar configuration) you can use this backup the current configuration for the gametype changer jar files for future restoring. *Note* This will not backup any new mods you have installed. To do that please use the mod backup function. It is recommended that you do this backup every once in a while but do not backup if something isn't working. Would you like to continue?")
If $confirm5 = 6 Then
  DirRemove("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.0.0", 1)
  DirRemove("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.0.0mods", 1)
  DirRemove("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.1.0", 1)
  DirRemove("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.8.1", 1)
  DirRemove("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.2.0", 1)
  $check31 = DirCopy("C:GametypeSwitcherMinecraftVersions1.0.0", "C:GametypeSwitcherMinecraftVersionsBackupNewBackup", 1)
  $check32 = DirCopy("C:GametypeSwitcherMinecraftVersions1.0.0mods", "C:GametypeSwitcherMinecraftVersionsBackupNewBackup", 1)
  $check33 = DirCopy("C:GametypeSwitcherMinecraftVersions1.8.1", "C:GametypeSwitcherMinecraftVersionsBackupNewBackup", 1)
  $check34 = DirCopy("C:GametypeSwitcherMinecraftVersions1.1.0", "C:GametypeSwitcherMinecraftVersionsBackupNewBackup", 1)
  $check35 = DirCopy("C:GametypeSwitcherMinecraftVersions1.2.0", "C:GametypeSwitcherMinecraftVersionsBackupNewBackup", 1)
EndIf
If $confirm5 = 7 Then $cancel2 = 1
If $check31 = 1 And $check32 = 1 And $check33 = 1 And $check34 = 1 And $check35 = 1 Then
  MsgBox(0, "Success", "The current configuration of jar file backups is complete. If something gets messed up, you can now restore from this configuration you just backed up.")
ElseIf $cancel2 = 1 Then
  Null()
Else
  $fail9 = MsgBox(4 + 16, "Failure", "Part or all of the backup was a failure. While it is not completely necessary, it is recommended that you try again. Would you like to try again?")
EndIf
If $fail9 = 6 Then Button7()
EndFunc   ;==>Button7
Func Button8()
$confirm4 = MsgBox(4 + 64, "Confirmation", "Are you sure you would like to restore your minecraft jar files? This will restore all of your minecraft jar files from the last time that you backed them up. This means that if you are currently having problems with the gametype changer function or you have destroyed a minecraft jar with mods, this should fix it. Use this function before the Old Restore function. *Note* The restore function only restores the jar files that the game changer uses, it will not restore the jar files for minecraft itself. To do that, you have to use the restore function THEN change the gametype afterwards. Continue?")
If $confirm4 = 6 Then
  DirRemove("C:GametypeSwitcherMinecraftVersions1.8.1", 1)
  DirRemove("C:GametypeSwitcherMinecraftVersions1.0.0", 1)
  DirRemove("C:GametypeSwitcherMinecraftVersions1.0.0mods", 1)
  DirRemove("C:GametypeSwitcherMinecraftVersions1.1.0", 1)
  DirRemove("C:GametypeSwitcherMinecraftVersions1.2.0", 1)
  $check21 = DirCopy("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.0.0", "C:GametypeSwitcherMinecraftVersions", 1)
  $check22 = DirCopy("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.0.0mods", "C:GametypeSwitcherMinecraftVersions", 1)
  $check23 = DirCopy("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.1.0", "C:GametypeSwitcherMinecraftVersions", 1)
  $check24 = DirCopy("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.8.1", "C:GametypeSwitcherMinecraftVersions", 1)
  $check25 = DirCopy("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.2.0", "C:GametypeSwitcherMinecraftVersions", 1)
EndIf
If $confirm4 = 7 Then $cancel1 = 1
If $check21 = 1 And $check22 = 1 And $check23 = 1 And $check24 = 1 And $check25 = 1 Then
  MsgBox(0, "Success", "The restoration of the backup for working minecraft jar files was succesful. If gametype changing was messed up or mods destroyed a minecraft jar, it should now be restored and working. If these functions still do not work, try using the old restore function.")
ElseIf $cancel1 = 1 Then
  Null()
Else
  $fail8 = MsgBox(4 + 16, "Failure", "The restoration was a failure. This means that your gametype changer functions may not work properly and it is recommended that you try again. Would you like to try again?")
EndIf
If $fail8 = 6 Then Button8()
EndFunc   ;==>Button8
Func Button9()
$confirm3 = MsgBox(4 + 64, "Confirmation", "Are you sure you would like to restore your minecraft jar files? This will restore all of your minecraft jar files from the last time that Adam saved a working copy for this program to use. This means that if you are currently having problems with the gametype changer function or you have destroyed a minecraft jar with mods, this should fix it. Only use this function if the regular restore function is not working properly. *Note* The restore function only restores the jar files that the game changer uses, it will not restore the jar files for minecraft itself. To do that, you have to use the restore function THEN change the gametype afterwards. Continue?")
If $confirm3 = 6 Then
  DirRemove("C:GametypeSwitcherMinecraftVersions1.8.1", 1)
  DirRemove("C:GametypeSwitcherMinecraftVersions1.0.0", 1)
  DirRemove("C:GametypeSwitcherMinecraftVersions1.0.0mods", 1)
  DirRemove("C:GametypeSwitcherMinecraftVersions1.1.0", 1)
  DirRemove("C:GametypeSwitcherMinecraftVersions1.2.0", 1)
  $check11 = DirCopy("C:GametypeSwitcherMinecraftVersionsBackupOldBackup1.0.0", "C:GametypeSwitcherMinecraftVersions", 1)
  $check12 = DirCopy("C:GametypeSwitcherMinecraftVersionsBackupOldBackup1.0.0mods", "C:GametypeSwitcherMinecraftVersions", 1)
  $check13 = DirCopy("C:GametypeSwitcherMinecraftVersionsBackupOldBackup1.1.0", "C:GametypeSwitcherMinecraftVersions", 1)
  $check14 = DirCopy("C:GametypeSwitcherMinecraftVersionsBackupOldBackup1.8.1", "C:GametypeSwitcherMinecraftVersions", 1)
  $check15 = DirCopy("C:GametypeSwitcherMinecraftVersionsBackupOldBackup1.2.0", "C:GametypeSwitcherMinecraftVersions", 1)
EndIf
If $confirm3 = 7 Then $cancel3 = 1
If $check11 = 1 And $check12 = 1 And $check13 = 1 And $check14 = 1 And $check15 = 1 Then
  MsgBox(0, "Success", "The restoration of the old backup for working minecraft jar files was succesful. If gametype changing was messed up or mods destroyed a minecraft jar, it should now be restored and working. The last mod installed on this restoration was the lightsaber mod.")
ElseIf $cancel3 = 1 Then
  Null()
Else
  $fail7 = MsgBox(4 + 16, "Failure", "The old restoration was a failure. This means that your gametype changer functions may not work properly and it is recommended that you try again. Would you like to try again?")
EndIf
If $fail7 = 6 Then Button9()
EndFunc   ;==>Button9
Func Button10()
$confirm1 = MsgBox(1 + 64, "World Save Backup", "This will back up your world saves for restoration and will overwrite previous world save backups")
If $confirm1 = 1 Then
  DirRemove("C:GametypeSwitcherMinecraftVersionsBackupsaves", 1)
  $copy5 = DirCopy("C:UsersHayes FamilyAppDataRoaming.minecraftsaves", "C:GametypeSwitcherMinecraftVersionsBackup", 1)
EndIf
If $confirm1 = 2 Then $cancel4 = 1
If $copy5 = 1 Then
  MsgBox(0, "Success", "The world saves backup was a success. To restore this backup of all world saves, just click the Restore Save Backups button.")
ElseIf $cancel4 = 1 Then
  Null()
ElseIf $copy5 = 0 Then
  $fail5 = MsgBox(4 + 16, "Failure", "The world saves backup was a failure. Would you like to try again?")
EndIf
If $fail5 = 6 Then Button10()
EndFunc   ;==>Button10
Func Button11()
$confirm2 = MsgBox(4 + 48, "Confirmation", "Are you sure you would like to restore save backups? If you continue then your current world saves will be deleted and and your most recent backup will be restored. These actions cannot be undone. Also, please make sure minecraft is closed before continuing. Continue?")
If $confirm2 = 6 Then
  DirRemove("C:UsersHayes FamilyAppDataRoaming.minecraftsaves", 1)
  $copy6 = DirCopy("C:GametypeSwitcherMinecraftVersionsBackupsaves", "C:UsersHayes FamilyAppDataRoaming.minecraft", 1)
EndIf
If $confirm2 = 7 Then $cancel5 = 1
If $copy6 = 1 Then
  MsgBox(0, "Success", "The world saves restoration from your previous backup was a success. All world saves have been reverted to the last time that you backed them up.")
ElseIf $cancel5 = 1 Then
  Null()
ElseIf $copy6 = 0 Then
  $fail6 = MsgBox(4 + 16, "Failure", "The world save restoration from your previous backup was a failure. This may result in damaged or lost world save files. Trying again is recommended. Do you want to try again?")
EndIf
If $fail6 = 6 Then Button11()
EndFunc   ;==>Button11
Func Button12()
$confirm6 = MsgBox(4 + 64, "Confirmation", "This will backup your current mod configuration so that when you cnange versions back to 1.0.0 with mods, any new mods you have installed will be included. This will also preform a jar backup directly after the mod backup. Before you continue please make sure your current minecraft version is 1.0.0 with the any new mods installed that you wish to backup. Also please make sure that you close out of minecraft if it is open. Would you like to continue?")
If $confirm6 = 6 Then
  $check41 = FileDelete("C:GametypeSwitcherMinecraftVersions1.0.0modsminecraft.jar")
  $check42 = FileCopy("C:UsersHayes FamilyAppDataRoaming.minecraftbinminecraft.jar", "C:GametypeSwitcherMinecraftVersions1.0.0mods", 1)
EndIf
If $confirm6 = 7 Then $cancel6 = 1
If $check41 = 1 And $check42 = 1 Then
  MsgBox(0, "Success", "The mods backup was a success. This program will now continue to preform a jar backup.")
  Jarnomsg()
ElseIf $cancel6 = 1 Then
  Null()
Else
  $fail10 = MsgBox(4 + 16, "Failure", "The mods backup was a failure. It is highly suggested that you try again otherwise gametype switching to 1.0.0 with mods may not function properly. Would you like to try again?")
EndIf
If $fail10 = 6 Then Button12()
EndFunc   ;==>Button12
Func Button13()
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.1.0.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.0.0mods.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.0.0.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.8.1Beta.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsCurrentVersion1.2.0.txt")
$copy7 = FileCopy("C:GametypeSwitcherMinecraftVersions1.2.0minecraft.jar", "C:UsersHayes FamilyAppDataRoaming.minecraftbin", 1)
If $copy7 = 1 Then
  FileCopy("C:GametypeSwitcherMinecraftVersions1.1.01.2.0.txt", "C:GametypeSwitcherMinecraftVersionsCurrentVersion", 1)
  $Version = "Current Minecraft Version is 1.2.0"
  GUICtrlSetData($Label2, "Current Minecraft Version is 1.2.0")
  MsgBox(0, "Success", "The version transfer to Minecraft 1.2.0 was a success")
EndIf
If $copy7 = 0 Then $fail12 = MsgBox(4 + 48, "Failure", "The version transfer was a failure would you like to try again?")
If $fail12 = 6 Then Button13()
EndFunc   ;==>Button13
Func Button14()
Run(@ComSpec & " /c C:GametypeSwitcherMinecraftServerServerStarter.bat")
EndFunc   ;==>Button14
Func Button15()
FileDelete("C:GametypeSwitcherMinecraftVersionsServerCurrentVersion1.0.1.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsServerCurrentVersion1.1.0.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsServerCurrentVersion1.2.0.txt")
FileDelete("C:GametypeSwitcherMinecraftServerServerStarter.bat")
$check61 = FileCopy("C:GametypeSwitcherMinecraftVersionsServer1.0.1ServerStarter.bat", "C:GametypeSwitcherMinecraftServer", 1)
If $check61 = 1 Then
  FileCopy("C:GametypeSwitcherMinecraftVersionsServer1.0.11.0.1.txt", "C:GametypeSwitcherMinecraftVersionsServerCurrentVersion", 1)
  $SVersion = "Current Minecraft Server version is 1.0.1"
  GUICtrlSetData($Label2, "Current Minecraft Server version is 1.0.1")
  MsgBox(0, "Success", "The Server Gametype successfully transferred to 1.0.1 (for minecraft clients 1.0.0)")
EndIf
If $check61 = 0 Then $fail13 = MsgBox(4 + 48, "Failure", "The Server Version Transfer was a failure would you like to try again?")
If $fail13 = 6 Then Button15()
EndFunc   ;==>Button15
Func Button16()
FileDelete("C:GametypeSwitcherMinecraftVersionsServerCurrentVersion1.0.1.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsServerCurrentVersion1.1.0.txt")
FileDelete("C:GametypeSwitcherMinecraftVersionsServerCurrentVersion1.2.0.txt")
FileDelete("C:GametypeSwitcherMinecraftServerServerStarter.bat")
$check71 = FileCopy("C:GametypeSwitcherMinecraftVersionsServer1.1.0ServerStarter.bat", "C:GametypeSwitcherMinecraftServer", 1)
If $check71 = 1 Then
  FileCopy("C:GametypeSwitcherMinecraftVersionsServer1.1.01.1.0.txt", "C:GametypeSwitcherMinecraftVersionsServerCurrentVersion", 1)
  $SVersion = "Current Minecraft Server version is 1.1.0"
  GUICtrlSetData($Label2, "Current Minecraft Server version is 1.1.0")
  MsgBox(0, "Success", "The Server Gametype successfully transferred to 1.1.0")
EndIf
If $check71 = 0 Then $fail14 = MsgBox(4 + 48, "Failure", "The Server Version Transfer was a failure would you like to try again?")
If $fail14 = 6 Then Button16()
EndFunc   ;==>Button16
Func Button17()
MsgBox(0, "Coming Soon", "This feature is coming soon")
EndFunc   ;==>Button17
Func Jarnomsg()
DirRemove("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.0.0", 1)
DirRemove("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.0.0mods", 1)
DirRemove("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.1.0", 1)
DirRemove("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.8.1", 1)
DirRemove("C:GametypeSwitcherMinecraftVersionsBackupNewBackup1.2.0", 1)
$check51 = DirCopy("C:GametypeSwitcherMinecraftVersions1.0.0", "C:GametypeSwitcherMinecraftVersionsBackupNewBackup", 1)
$check52 = DirCopy("C:GametypeSwitcherMinecraftVersions1.0.0mods", "C:GametypeSwitcherMinecraftVersionsBackupNewBackup", 1)
$check53 = DirCopy("C:GametypeSwitcherMinecraftVersions1.8.1", "C:GametypeSwitcherMinecraftVersionsBackupNewBackup", 1)
$check54 = DirCopy("C:GametypeSwitcherMinecraftVersions1.1.0", "C:GametypeSwitcherMinecraftVersionsBackupNewBackup", 1)
$check55 = DirCopy("C:GametypeSwitcherMinecraftVersions1.2.0", "C:GametypeSwitcherMinecraftVersionsBackupNewBackup", 1)
If $check51 = 1 And $check52 = 1 And $check53 = 1 And $check54 = 1 And $check55 = 1 Then
  MsgBox(0, "Success", "The current configuration of mods and jar file backups is complete. If something gets messed up, you can now restore from this configuration you just backed up.")
Else
  $fail11 = MsgBox(4 + 16, "Failure", "Part or all of the jar backup was a failure. It is highly recommended that you try again. Would you like to try again?")
EndIf
If $fail11 = 6 Then Jarnomsg()
EndFunc   ;==>Jarnomsg
Func Null()
$null = 1
EndFunc   ;==>Null
Edited by cheeseandcereal

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Ok so I've recreated the problem with a sample picture so any one with windows 7 can run this code for the GUI (with my problem):

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt( "MustDeclareVars", 1)
Global $Button1
Global $Button2
Global $Button3
Global $Button4
Global $Button6
Global $Button13
Global $Button14
Global $Form1
Global $Group1
Global $Group2
Global $Label1
Global $Label2
Global $MenuItem2
Global $MenuItem3
Global $MenuItem4
Global $MenuItem5
Global $MenuItem6
Global $MenuItem7
Global $nMsg
Global $Pic1
#Region ### START Koda GUI section ### Form=C:UsersDad & MomDocumentsAutoit ScriptsHunter Gametype ChangerHunter client changer - Copy.kxf
$Form1 = GUICreate("Adam's Minecraft Gametype Changer", 630, 346, 392, 196)
$MenuItem4 = GUICtrlCreateMenu("&File")
$MenuItem6 = GUICtrlCreateMenuItem("Help", $MenuItem4)
$MenuItem7 = GUICtrlCreateMenuItem("Exit", $MenuItem4)
$MenuItem5 = GUICtrlCreateMenu("&Change Mode")
$MenuItem2 = GUICtrlCreateMenuItem("Backup and Restore", $MenuItem5)
$MenuItem3 = GUICtrlCreateMenuItem("Server Gametype Changer", $MenuItem5)
GUISetBkColor(0x000000)
$Label1 = GUICtrlCreateLabel("Adam's Minecraft Gametype changer for Hunter", 86, 16, 456, 28)
GUICtrlSetFont(-1, 15, 800, 0, "arial")
GUICtrlSetColor(-1, 0xFFFFFF)
$Button1 = GUICtrlCreateButton("1.1.0", 256, 88, 113, 41)
$Button2 = GUICtrlCreateButton("1.0.0 with mods", 256, 144, 113, 41)
$Button3 = GUICtrlCreateButton("1.0.0 without mods", 104, 144, 113, 41)
$Button4 = GUICtrlCreateButton("1.8.1 Beta", 409, 88, 113, 41)
$Label2 = GUICtrlCreateLabel("Label2", 125, 48, 42, 20)
GUICtrlSetFont(-1, 10, 400, 0, "arial")
GUICtrlSetColor(-1, 0xFFFFFF)
$Button6 = GUICtrlCreateButton("Start Minecraft", 178, 248, 113, 41)
$Button13 = GUICtrlCreateButton("1.2.0", 104, 88, 113, 41)
$Group1 = GUICtrlCreateGroup("Gametypes", 96, 72, 433, 121)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button14 = GUICtrlCreateButton("Start Server", 336, 248, 113, 41)
$Group2 = GUICtrlCreateGroup("Start Services", 168, 232, 289, 65)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pic1 = GUICtrlCreatePic("C:UsersPublicPicturesSample PicturesPenguins.jpg", 0, 0, 629, 325, 0)
GUICtrlSetState($Pic1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
WEnd

Even though I have created the picture last, and then disabled the GUI for the $pic1 variable, when you initially start the code, you can't see anything but the picture and you can see the buttons once you mouse over them. Can anyone identify this problem? Any help would be greatly appreciated

Edited by cheeseandcereal

Share this post


Link to post
Share on other sites

cheeseandcereal,

If you create and disable the Pic control BEFORE the other controls it works as expected when I run your code. :)

I had forgotten about the "create it after the others controls" remark in the Help file - I will investigate further. Thanks for bringing it to our notice. ;)

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thank you SO MUCH. I was so confused because of that line in the help file that says create the picture after the other controls too. It works perfectly now. I can't thank you enough.

Share this post


Link to post
Share on other sites

Yes, I apologise, I should have thought of that before I updated your script. I hope I make sense in saying the following:

Controls are made on different layers. Imagine you had sheets of clear plastic, and a single sheet of paper. You place the paper down, and that is your GUI. Now, for each GUI Control, you draw a single control on a piece of the clear plastic, and place it ontop of the previous sheet. The controls have becomed layered.

As you hover over a control, it comes to the front, or in the case of the paper and plastic, it is placed on the top of the pile. However, if the control is disabled, it doesn't do this. When your GUI was created, the "background image" was the top sheet and was disabled, ultimately preventing the controls underneath it from being activated. By making this the first control created after the GUI is created, you allow for the controls to be activated.

Does that make sense? I'm not usually too good at explaining things, but I hope that did make sense.

Share this post


Link to post
Share on other sites

Yes, I apologise, I should have thought of that before I updated your script. I hope I make sense in saying the following:

Controls are made on different layers. Imagine you had sheets of clear plastic, and a single sheet of paper. You place the paper down, and that is your GUI. Now, for each GUI Control, you draw a single control on a piece of the clear plastic, and place it ontop of the previous sheet. The controls have becomed layered.

As you hover over a control, it comes to the front, or in the case of the paper and plastic, it is placed on the top of the pile. However, if the control is disabled, it doesn't do this. When your GUI was created, the "background image" was the top sheet and was disabled, ultimately preventing the controls underneath it from being activated. By making this the first control created after the GUI is created, you allow for the controls to be activated.

Does that make sense? I'm not usually too good at explaining things, but I hope that did make sense.

Yes, that makes sense and I think I understand it now. I was just confused because the help file said to create the picture control after the rest of the controls. Thanks for explaining that to me! :)

Share this post


Link to post
Share on other sites

No probs

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0