Jump to content

Gui closes immediately


Arterie
 Share

Recommended Posts

Problem is the gui closes immediately

Here's my code:

#include <GuiConstants.au3>
#include <Process.au3>


If RegRead("HKEY_CURRENT_USER\Software\texturemaker", "steamdir") = "" Then
    RegWrite("HKEY_CURRENT_USER\Software\texturemaker", "steamdir", "REG_SZ", "C:\Programme\Steam\SteamApps\Arterie")
EndIf

If RegRead("HKEY_CURRENT_USER\Software\texturemaker", "picdir") = "" Then
    RegWrite("HKEY_CURRENT_USER\Software\texturemaker", "picdir", "REG_SZ", "C:\Dokumente und Einstellungen\Arterie\Eigene Dateien\Eigene Bilder\textur.tga")
EndIf



$picdir = RegRead("HKEY_CURRENT_USER\Software\texturemaker", "picdir")
$steamdir = RegRead("HKEY_CURRENT_USER\Software\texturemaker", "steamdir")
$game = "Counter-Strike: Source"
GUICreate("Arterie's Texture maker", 500, 290)

GUICtrlCreateGroup("Steamdirection", 5, 5, 490, 35, 0x2000)
$labelsteam = GUICtrlCreateLabel($steamdir, 10, 18, 400, 18)
$setsteamdir = GUICtrlCreateButton("Set Steamdir", 410, 15, 80, 20)
GUICtrlSetTip($setsteamdir, "Until you reached accountname")
GUICtrlSetTip($labelsteam, $steamdir)

GUICtrlCreateGroup("Picturedirection", 5, 45, 490, 35)
$labelpic = GUICtrlCreateLabel($picdir, 10, 58, 400, 18)
$setpicdir = GUICtrlCreateButton("Set picturedir", 410, 55, 80, 20)
GUICtrlSetTip($labelpic, $picdir)
GUICtrlSetTip($setpicdir, "Format: *.tga;Readem for detailed help.")

GUICtrlCreateGroup("Game", 5, 85, 490, 70)
$listgame = GUICtrlCreateList("Counter-Strike: Source", 10, 100, 200, 55)
$item2 = GUICtrlSetData($listgame, "Half-Life 2: Dm")
$item3 = GUICtrlSetData($listgame, "DoD: Source")

GUICtrlCreateGroup("Vmf file", 5, 160, 370, 125)
$listvmf = GUICtrlCreateList("LightmappedGeneric", 10, 178, 150, 100)
$picinput = GUICtrlCreateInput("Has to be the same as the name of the picture", 165, 196, 200, 18)
GUICtrlCreateLabel("The name of the *.vmf file:", 165, 178, 150, 18)


$create = GUICtrlCreateButton("Create Texture", 380, 160, 115, 20)
$readme = GUICtrlCreateButton("Readme", 380, 185, 115, 20)
$exit = GUICtrlCreateButton("Exit", 380, 265, 115, 20)

GUISetState()
While 1
    Sleep(10)
    $msg = GUIGetMsg()
    $game = GUICtrlRead($listgame)
    $vmffile = GUICtrlRead($listvmf)
    $name = GUICtrlRead($picinput)
    Select
        Case $msg = $setsteamdir
            $steamdir1 = FileSelectFolder("Select accountname", "C:\")
            If $steamdir1 = "" Then
                MsgBox(64, "Select accountname", "No new direction set")
            Else
                $steamdir = $steamdir1
                GUICtrlSetTip($labelsteam, $steamdir)
                RegWrite("HKEY_CURRENT_USER\Software\texturemaker", "steamdir", "REG_SZ", $steamdir)
                
            EndIf
        Case $msg = $setpicdir
            $picdir1 = FileOpenDialog("Choose picture", "C:\", "Truevision Targa (*.tga)")
            If $picdir1 = "" Then
                MsgBox(64, "Choose picture", "No picture set")
            Else
                $picdir = $picdir1
                GUICtrlSetTip($labelpic, $picdir)
                RegWrite("HKEY_CURRENT_USER\Software\texturemaker", "picdir", "REG_SZ", $picdir)
            EndIf
            
        Case $msg = $readme
            If FileExists("readme.txt") Then
                FileOpen("readme.txt")
            Else
                MsgBox(48, "Readme", "No readme in scriptdirection.Please look at www.avmapping.de.vu for downloading" & @CRLF & "the file.")
            EndIf
            
        Case $msg = $GUI_EVENT_CLOSE Or $exit
            GUIDelete()
            Exit
    EndSelect
WEnd

(Why doesn't the autoit tags work?)

Edited by Arterie
Link to comment
Share on other sites

you have a wend, where is your while?

look at the following line closely

Case $msg = $GUI_EVENT_CLOSE Or $exit
Edited by GaryFrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...