Sign in to follow this  
Followers 0
Daniel W.

Little wc3 savegame view

1 post in this topic

Hi,

this is just a little programm to easy delete list your wc3 savegames

#include  <GuiConstants.au3>

Global $a = 0
    
If Not FileExists( @ScriptDir & "\config.ini") Then
    _iniwrite()
EndIf

$read = IniRead( @ScriptDir & "\config.ini", "Settings", "Path", "")

GuiCreate("Warcraft 3 SaveGame Player", 447, 194,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$list = GuiCtrlCreateList("", 140, 10, 300, 197)
_findsavegames( $read )
$add = GuiCtrlCreateButton("Change Folder", 10, 10, 120, 30)
$delete = GuiCtrlCreateButton("Delete", 10, 56, 120, 30)
GUICtrlSetTip( $delete , "Note: This will delete the choosen file!")
$update = GuiCtrlCreateButton("Update", 10, 102, 120, 30)
GUICtrlSetTip( $update , "Note: " & @CRLF & "This will update the shown Savegames , " & @CRLF & "if an error has occured!")
$exit = GuiCtrlCreateButton("Exit", 10, 150, 120, 30)

GuiSetState()
While 1
    _disable()
    $msg = GuiGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $exit
            Exit
        Case $delete
            _delete()
        Case $add
            _iniwrite()
        Case $update
            _findsavegames( $read )
        Case Else
            ;;;
    EndSwitch
WEnd

Func _disable()
    If GUICtrlRead( $list ) = "" Then
        If $a = 0 Then
            GUICtrlSetState( $delete , $GUI_DISABLE )
            $a = 1
        EndIf
    ElseIf GUICtrlRead( $list ) <> "" Then
        If $a = 1 Then
            GUICtrlSetState( $delete, $GUI_ENABLE )
            $a = 0
        EndIf
    EndIf
EndFunc

Func _delete()
    Local $file = GUICtrlRead( $list )
    FileDelete(  $read  & "\" & $file )
    GUICtrlSetData( $list , "")
    _findsavegames( $read ) 
EndFunc

Func _iniwrite()
    Local  $dia = FileSelectFolder("Wc3 Folder?" , "")
    If $dia <> "" Then
        IniWrite( @ScriptDir & "\config.ini", "Settings", "Path ",  """" & $dia & """")
    EndIf
EndFunc

Func _findsavegames( $path )
    Local $first = FileFindFirstFile($read & "\*.w3z")
    Do 
        $next = FileFindNextFile( $first)
        If Not $next = "" Then
            GUICtrlSetData( $list ,$next )
        EndIf
    Until $next = ""
EndFunc

The folder must be the folder in which your savegames are :D

Regards


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

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