Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Func _Setup()
- #Region ### START Koda GUI section ### Form=
- $Form_SelectProfil = GUICreate("Sélection du profil", 260, 70, Default, Default)
- $Label_SelectProfil = GUICtrlCreateLabel("Veuillez sélectionner votre profil Automobilista", 18, 4, 217, 17)
- $ComboBox_SelectProfil = GUICtrlCreateCombo("", 18, 24, 145, 25, $CBS_DROPDOWNLIST)
- $ListProfil = _FileListToArray($AMSfolder & "\UserData\", "*", 2)
- Local $sString = ""
- For $vElement In $ListProfil
- If FileExists($AMSfolder & "\UserData\" & $vElement & "\Controller.ini") Then
- $sString = $sString & "|" & $vElement
- GUICtrlSetData($ComboBox_SelectProfil, $sString)
- EndIf
- Next
- If $sString = '' Then MsgBox(16, 'Erreur', 'Veuillez lancer votre jeu en administrateur pour avoir accès à votre profil')
- $Button_SelectProfil = GUICtrlCreateButton("OK", 166, 23, 67, 23)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- GUIDelete($Form_SelectProfil)
- ExitLoop
- Case $Button_SelectProfil
- $ProfilAMS = GUICtrlRead($ComboBox_SelectProfil)
- GUIDelete($Form_SelectProfil)
- IniWrite($GOAPPS & '\GO.Apps.ini', 'Dir', 'Profil', $ProfilAMS)
- ExitLoop
- EndSwitch
- WEnd
- EndFunc ;==>_Setup
- Func _Setup2()
- #Region ### START Koda GUI section ### Form=
- $Form_Setup2 = GUICreate("Setup", 500, 150, Default, Default)
- $TABSetup2 = GUICtrlCreateTab(0, 0, 330)
- GUICtrlCreateTabItem("Upload")
- $Label_ProfilSelect = GUICtrlCreateLabel("Profil sélectionné : " & $ProfilAMS, 175, 5)
- Global $GUIList_OurCircuit = GUICtrlCreateList("", 18, 24, 145, 100)
- Global $GUIList_OurCircuitSetup = GUICtrlCreateList("", 165, 24, 145, 100)
- $Button_UploadSetup = GUICtrlCreateButton("Upload", 185, 123, 100, 25)
- Global $ListCircuit = _FileListToArray($AMSfolder & "\UserData\" & $ProfilAMS & "\Settings\", "*", 2)
- Local $sString = ""
- For $vElement In $ListCircuit
- If IsNumber($vElement) Then
- GUICtrlSetData($GUIList_OurCircuit, "")
- Else
- $sString = $sString & "|" & $vElement
- GUICtrlSetData($GUIList_OurCircuit, $sString)
- EndIf
- Next
- GUICtrlCreateTabItem("Setup GO.Race")
- Global $GUIList_UsProfil = GUICtrlCreateList("", 18, 24, 145, 100)
- Global $GUIList_UsCircuit = GUICtrlCreateList("", 165, 24, 145, 100)
- Global $GUIList_UsCircuitSetup = GUICtrlCreateList("", 312, 24, 145, 100)
- $Button_DLSetup = GUICtrlCreateButton("Télécharger", 185, 123, 100, 25)
- $Label_ProfilSelect = GUICtrlCreateLabel("Profil sélectionné : " & $ProfilAMS, 175, 5)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- _FTP_DirSetCurrent($hConn, "/GO.Race/Setup/")
- Global $ListProfil = _FTP_ListToArray($hConn, 0)
- Local $sString = ""
- For $vElement In $ListProfil
- If IsNumber($vElement) Then
- GUICtrlSetData($GUIList_UsProfil, "")
- ElseIf $vElement = "." Then
- GUICtrlSetData($GUIList_UsProfil, "")
- ElseIf $vElement = ".." Then
- GUICtrlSetData($GUIList_UsProfil, "")
- Else
- $sString = $sString & "|" & $vElement
- GUICtrlSetData($GUIList_UsProfil, $sString)
- EndIf
- Next
- If $sString = '' Then MsgBox(16, 'Erreur', 'Une erreur est survenue, veuillez relancer GO.Apps pour avoir accès aux setups en ligne.')
- Local $changes = ""
- Local $changesProfil = ""
- Local $changesCircuit = ""
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case 0
- Local $_changes = GUICtrlRead($GUIList_OurCircuit)
- If $changes <> $_changes Then
- $changes = $_changes
- _Changes_OurCircuit()
- EndIf
- Local $_changesProfil = GUICtrlRead($GUIList_UsProfil)
- If $changesProfil <> $_changesProfil Then
- $changesProfil = $_changesProfil
- _Changes_UsProfil()
- EndIf
- Local $_changesCircuit = GUICtrlRead($GUIList_UsCircuit)
- If $changesCircuit <> $_changesCircuit Then
- $changesCircuit = $_changesCircuit
- _Changes_Us_Circuit()
- EndIf
- Case $GUI_EVENT_CLOSE
- GUIDelete($Form_Setup2)
- ExitLoop
- Case $Button_UploadSetup
- Local $Circuit = GUICtrlRead($GUIList_OurCircuit), $Setup = GUICtrlRead($GUIList_OurCircuitSetup)
- _FTP_FilePut($hConn, $AMSfolder & "\UserData\" & $ProfilAMS & "\Settings\" & $Circuit & "\" & $Setup, "/GO.Race/Setup/" & $ProfilAMS & "/" & $Circuit & "/" & $Setup)
- If @error Then
- _FTP_DirCreate($hConn, "/GO.Race/Setup/" & $ProfilAMS & "/" & $Circuit)
- If @error Then
- _FTP_DirCreate($hConn, "/GO.Race/Setup/" & $ProfilAMS)
- _FTP_DirCreate($hConn, "/GO.Race/Setup/" & $ProfilAMS & "/" & $Circuit)
- _FTP_FilePut($hConn, $AMSfolder & "\UserData\" & $ProfilAMS & "\Settings\" & $Circuit & "\" & $Setup, "/GO.Race/Setup/" & $ProfilAMS & "/" & $Circuit & "/" & $Setup)
- EndIf
- _FTP_FilePut($hConn, $AMSfolder & "\UserData\" & $ProfilAMS & "\Settings\" & $Circuit & "\" & $Setup, "/GO.Race/Setup/" & $ProfilAMS & "/" & $Circuit & "/" & $Setup)
- EndIf
- GUIDelete($Form_Setup2)
- ExitLoop
- Case $Button_DLSetup
- Local $Profil = GUICtrlRead($GUIList_UsProfil), $Circuit = GUICtrlRead($GUIList_UsCircuit), $Setup = GUICtrlRead($GUIList_UsCircuitSetup)
- If $Setup = "" Then
- MsgBox(64, "Erreur", "Aucun setup sélectionné.")
- Else
- _FTP_FileGet($hConn, "/GO.Race/Setup/" & $Profil & "/" & $Circuit & "/" & $Setup, $AMSfolder & "\UserData\" & $ProfilAMS & "\Settings\" & $Circuit & "\" & $Profil & "_" & $Setup)
- If @error Then
- MsgBox(64, "Erreur", "Le téléchargement du Setup n'a pas pu être éffectué. Veuillez rééssayer.")
- Else
- MsgBox(64, "", "Téléchargement du setup '" & $Setup & "' de " & $Profil & " terminé." & @CRLF & _
- "Il a été nommer : " & $Profil & "_" & $Setup)
- EndIf
- EndIf
- EndSwitch
- WEnd
- EndFunc ;==>_Setup2
- Func _Changes_OurCircuit()
- $ListCircuitSetup = _FileListToArray($AMSfolder & "\UserData\" & $ProfilAMS & "\Settings\" & GUICtrlRead($GUIList_OurCircuit) & "\")
- If @error Then
- GUICtrlSetData($GUIList_OurCircuitSetup, "")
- Else
- Local $sString = ""
- For $vElement In $ListCircuitSetup
- If IsNumber($vElement) Then
- GUICtrlSetData($GUIList_OurCircuitSetup, "")
- Else
- $sString = $sString & "|" & $vElement
- GUICtrlSetData($GUIList_OurCircuitSetup, $sString)
- EndIf
- Next
- EndIf
- EndFunc ;==>_Changes_OurCircuit
- Func _Changes_UsProfil()
- _FTP_DirSetCurrent($hConn, "/GO.Race/Setup/" & GUICtrlRead($GUIList_UsProfil) & "/")
- $ListProfilCircuit = _FTP_ListToArray($hConn, 0)
- Global $sString_UsProfil = ""
- For $vElement In $ListProfilCircuit
- If IsNumber($vElement) Then
- GUICtrlSetData($GUIList_UsCircuit, "")
- ElseIf $vElement = "." Then
- GUICtrlSetData($GUIList_UsCircuit, "")
- ElseIf $vElement = ".." Then
- GUICtrlSetData($GUIList_UsCircuit, "")
- Else
- $sString_UsProfil = $sString_UsProfil & "|" & $vElement
- GUICtrlSetData($GUIList_UsCircuit, $sString_UsProfil)
- EndIf
- Next
- EndFunc ;==>_Changes_UsProfil
- Func _Changes_Us_Circuit()
- _FTP_DirSetCurrent($hConn, "/GO.Race/Setup/" & GUICtrlRead($GUIList_UsProfil) & "/" & GUICtrlRead($GUIList_UsCircuit) & "/")
- If @error Then
- Else
- $ListProfilCircuitSetup = _FTP_ListToArray($hConn, 0)
- Local $sString2 = ""
- For $vElement In $ListProfilCircuitSetup
- If IsNumber($vElement) Then
- GUICtrlSetData($GUIList_UsCircuitSetup, "")
- ElseIf $vElement = "." Then
- GUICtrlSetData($GUIList_UsCircuitSetup, "")
- ElseIf $vElement = ".." Then
- GUICtrlSetData($GUIList_UsCircuitSetup, "")
- Else
- $sString2 = $sString2 & "|" & $vElement
- If $sString2 = $sString_UsProfil Then
- GUICtrlSetData($GUIList_UsCircuitSetup, "")
- Else
- GUICtrlSetData($GUIList_UsCircuitSetup, $sString2)
- EndIf
- EndIf
- Next
- EndIf
- EndFunc ;==>_Changes_Us_Circuit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement