Hacking App to download covers for nand

spayrosam

Well-Known Member
OP
Member
Joined
Jun 2, 2009
Messages
756
Trophies
0
Location
Gafsa
Website
Visit site
XP
309
Country
Is there any app to download covers for nand?

Edit: 30-12-2011

I have done so!
Old Version
ncd.png


To make a good start! B-)
Download (Nand covers Downloader) NCD V1a http://www.mediafire...kretayad5r15mbc


ncdn12.png


Changelog:
* ADDED
- Trailers search
- Game info download
- You can use right/left/Double mouse click (listview)
* Some fixes

Download (Nand covers Downloader) NCD V1.2 http://www.mediafire...1dsb5ysvskeuovi

Source code
Code:
#NoTrayIcon
#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Version=beta
#AutoIt3Wrapper_icon=icon.ico
#AutoIt3Wrapper_outfile=Nand Covers Downloader.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Comment=MNand Covers Downloader
#AutoIt3Wrapper_Res_Description=Nand Covers Downloader
#AutoIt3Wrapper_Res_Fileversion=1.2.0.0
#AutoIt3Wrapper_Res_ProductVersion=1.2.0.0
#AutoIt3Wrapper_Res_LegalCopyright=Copyright © 2009 - © 2012 Spayrosam (Samir.L)
#AutoIt3Wrapper_Res_Field=CompanyName|Spayrosam
#AutoIt3Wrapper_Res_Field=ProductName|Nand Covers Downloader
#AutoIt3Wrapper_Res_Field=ProductVersion|1.2.0.0
#AutoIt3Wrapper_Res_Field=Nand Covers Downloader|1.2.0.0
#AutoIt3Wrapper_Run_AU3Check=n
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <File.au3>
#include <Array.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <ListViewConstants.au3>
#include <String.au3>
#include <GuiEdit.au3>
#include <GDIPlus.au3>


Local $NandFolderState = 0, $CoverFolderState = 0, $iNumber = 0, $CancellString = " "
Global $cancelState = 0

Global $TrailersFound[1][3], $Tempdir = @TempDir & "\Tempfiles", $Trailersfile = $Tempdir & "\~.xml", $Nowcontrol = 0, $Control[14][3], $Nowcontrol = 0
DirRemove($Tempdir)
DirCreate($Tempdir)

$DataDir = @ScriptDir & "\Data"
$ConfigINI = $DataDir & "\NCD.ini"
If FileExists($DataDir) = 0 Then DirCreate($DataDir)
;=============================================mainGui============================
$Gui = GUICreate("Nand Covers Downloader", 940, 620, -1, -1)

$Settingmenu = GUICtrlCreateMenu("&Settings")
$SettingLang = GUICtrlCreateMenuItem("Langauges Stettings", $Settingmenu)
GUICtrlSetState(-1, $GUI_DEFBUTTON)

GUICtrlCreateGroup("", 5, 5, 460, 40)
$NandFolder = GUICtrlCreateButton("Nand Path", 10, 15, 120, 25)
$NandFolderinput = GUICtrlCreateInput("", 130, 15, 330, 25, $ES_READONLY)
If FileExists(IniRead($ConfigINI, "Conf", "Nand Path", "")) Then
GUICtrlSetData($NandFolderinput, IniRead($ConfigINI, "Conf", "Nand Path", ""))
Local $path = IniRead($ConfigINI, "Conf", "Nand Path", "")
$NandFolderState = 1
EndIf

GUICtrlCreateGroup("", 475, 5, 460, 40)
$CoverFolder = GUICtrlCreateButton("Covers Path", 480, 15, 120, 25)
$CoverFolderInput = GUICtrlCreateInput("", 600, 15, 330, 25, $ES_READONLY)
If FileExists(IniRead($ConfigINI, "Conf", "Covers Path", "")) Then
GUICtrlSetData($CoverFolderInput, IniRead($ConfigINI, "Conf", "Covers Path", ""))
Local $SaveFolder = IniRead($ConfigINI, "Conf", "Covers Path", "")
EndIf

$LabeLLang = GUICtrlCreateLabel("Language", 10, 55, 60, 17)

$LangBox = GUICtrlCreateCombo("", 70, 52, 60, 25)
GUICtrlSetData(-1, "EN|FR|DE|ES|IT|NL|PT|US|JA|KO|ZH", IniRead($ConfigINI, "Conf", "Language", "EN"))

$LabelType = GUICtrlCreateLabel("Cover Type", 150, 55, 60, 17)
$CoverTypeBox = GUICtrlCreateCombo("", 210, 52, 60, 27)
GUICtrlSetData(-1, "Full|Front|3D|Disc", IniRead($ConfigINI, "Conf", "Cover Type", "Full"))

$loadnand = GUICtrlCreateButton("Load nand dump", 280, 50, 122, 25)

$Select = GUICtrlCreateButton("Select", 412, 50, 122, 25)
Local $Selectmenu = GUICtrlCreateContextMenu($Select)
Local $SelectALL = GUICtrlCreateMenuItem("ALL", $Selectmenu)
Local $SelectNone = GUICtrlCreateMenuItem("None", $Selectmenu)
Local $SelectMissing = GUICtrlCreateMenuItem("Missing", $Selectmenu)
Local $SelectInvert = GUICtrlCreateMenuItem("Invert selection", $Selectmenu)

$Initialising = GUICtrlCreateButton("Check downloads", 546, 50, 122, 25)

$StartDownload = GUICtrlCreateButton("Download Covers", 679, 50, 122, 25)

$Cancel = GUICtrlCreateButton("Cancel", 811, 50, 122, 25)

$listview = GUICtrlCreateListView("", 10, 80, 920, 450, -1, BitOR($LVS_SORTASCENDING, $LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_REGIONAL, $LVS_EX_CHECKBOXES))
$listviewHandle = GUICtrlGetHandle($listview)
_GUICtrlListView_AddColumn($listview, "Folder Name", 80)
_GUICtrlListView_AddColumn($listview, "ID", 70)
_GUICtrlListView_AddColumn($listview, "Name", 200)
_GUICtrlListView_AddColumn($listview, "Type", 100)
_GUICtrlListView_AddColumn($listview, "Region", 100)
_GUICtrlListView_AddColumn($listview, "Title size (Kb)", 100)
_GUICtrlListView_AddColumn($listview, "Cover Lang", 100)
_GUICtrlListView_AddColumn($listview, "Covers Size (Kb)", 100)
_GUICtrlListView_AddColumn($listview, "State", 100)
_GUICtrlListView_AddColumn($listview, "", 0)
_GUICtrlListView_AddColumn($listview, "", 0)

Local $contextmenu = GUICtrlCreateContextMenu($listview)
Local $OpentitleFolder = GUICtrlCreateMenuItem("Open title folder", $contextmenu)
Local $Deletetitle = GUICtrlCreateMenuItem("Delete", $contextmenu)
Local $GettitleInfo = GUICtrlCreateMenuItem("Title Information", $contextmenu)
Local $GettitleTrailers = GUICtrlCreateMenuItem("Title Trailers", $contextmenu)

GUICtrlSetState($OpentitleFolder, $GUI_DISABLE)
GUICtrlSetState($Deletetitle, $GUI_DISABLE)
GUICtrlSetState($GettitleInfo, $GUI_DISABLE)

$State = GUICtrlCreateLabel("State", 10, 545, 920, 25, BitOR($SS_CENTER, $SS_CENTERIMAGE))

$progress = GUICtrlCreateProgress(10, 570, 920, 20)
GUISetState(@SW_SHOW, $Gui)
$SettingsGui = GUICreate("", 145, 320, 10, 50, $WS_POPUP, BitOR($WS_EX_DLGMODALFRAME, $WS_EX_MDICHILD), $Gui)

GUICtrlCreateGroup("Preferred region order", 5, 5, 135, 280)
$LangOption = GUICtrlCreateListView('', 10, 20, 125, 260)
$LangOptionHandle = GUICtrlGetHandle($LangOption)

$PreferredRegion = StringSplit(IniRead($ConfigINI, "Conf", "Preferred Region", "EN|FR|DE|ES|IT|NL|PT|US|JA|KO|ZH"), "|", 0)
_GUICtrlListView_AddColumn($LangOption, "Region", 120)
If $PreferredRegion[0] = 11 Then
Else
MsgBox(16, "Error!", $ConfigINI & " is corrupted !" & @CRLF & "Repairing corrupted file..", 5, $Gui)
IniWrite($ConfigINI, "Conf", "Preferred Region", "EN|FR|DE|ES|IT|NL|PT|US|JA|KO|ZH")
$PreferredRegion = StringSplit(IniRead($ConfigINI, "Conf", "Preferred Region", "EN|FR|DE|ES|IT|NL|PT|US|JA|KO|ZH"), "|", 0)
EndIf
GUICtrlCreateListViewItem($PreferredRegion[1], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[2], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[3], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[4], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[5], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[6], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[7], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[8], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[9], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[10], $LangOption)
GUICtrlCreateListViewItem($PreferredRegion[11], $LangOption)
$LangSave = GUICtrlCreateButton("Save", 10, 290, 125, 25)
GUISetState(@SW_HIDE, $SettingsGui)

;=============================================InfoGui============================
$GameInfoGui = GUICreate("Title Information", 580, 405, 200, 100, BitAND($GUI_SS_DEFAULT_GUI, BitNOT($WS_MINIMIZEBOX)), BitOR($WS_EX_DLGMODALFRAME, $WS_EX_MDICHILD), $Gui)
;GUISetBkColor(0x91c1ff)
$IDInfo = GUICtrlCreateLabel("ID: ", 10, 25, 60, 25)
$IDGetInfo = GUICtrlCreateInput("", 80, 20, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$regionInfo = GUICtrlCreateLabel("Region: ", 10, 50, 60, 25)
$regionGetInfo = GUICtrlCreateInput("", 80, 45, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$typeInfo = GUICtrlCreateLabel("Type: ", 10, 75, 60, 25)
$typeGetInfo = GUICtrlCreateInput("", 80, 70, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$languagesInfo = GUICtrlCreateLabel("Languages: ", 10, 100, 60, 25)
$languagesGetInfo = GUICtrlCreateInput("", 80, 95, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$developerInfo = GUICtrlCreateLabel("Developer: ", 10, 125, 60, 25)
$developerGetInfo = GUICtrlCreateInput("", 80, 120, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$publisherInfo = GUICtrlCreateLabel("Publisher: ", 10, 150, 60, 25)
$publisherGetInfo = GUICtrlCreateInput("", 80, 145, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$genreInfo = GUICtrlCreateLabel("Genre: ", 10, 175, 60, 25)
$genreGetInfo = GUICtrlCreateInput("", 80, 170, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$ratingInfo = GUICtrlCreateLabel("Rating: ", 10, 200, 60, 25)
$ratingGetInfo = GUICtrlCreateInput("", 80, 195, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$contentInfo = GUICtrlCreateLabel("Content: ", 10, 225, 60, 25)
$contentGetInfo = GUICtrlCreateInput("", 80, 220, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$playersInfo = GUICtrlCreateLabel("Players: ", 10, 250, 60, 25)
$playersGetInfo = GUICtrlCreateInput("", 80, 245, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$reqaccessoriesInfo = GUICtrlCreateLabel("Accessories: ", 10, 275, 60, 25)
$reqaccessoriesGetInfo = GUICtrlCreateInput("", 80, 270, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$onlineplayersInfo = GUICtrlCreateLabel("Online players: ", 10, 300, 70, 25)
$onlineplayersGetInfo = GUICtrlCreateInput("", 80, 295, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$sizeInfo = GUICtrlCreateLabel("Size: ", 10, 325, 60, 18)
$sizeGetInfo = GUICtrlCreateInput("", 80, 320, 120, 20, $ES_READONLY + $ES_AUTOHSCROLL)

$titleGame = GUICtrlCreateInput("", 210, 20, 360, 25, $ES_READONLY)
GUICtrlSetFont(-1, 13, 200, 1, "")

$DescripGetInfo = GUICtrlCreateEdit("", 210, 65, 360, 335, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_READONLY)
GUICtrlSetFont(-1, 12, 200, 1, "")

$inputID = GUICtrlCreateLabel("Input:", 10, 350, 50, 18)
$inputGetID = GUICtrlCreateInput("WDMP", 40, 345, 60, 21, $ES_UPPERCASE + $ES_CENTER)
GUICtrlSetLimit(-1, 6)

$Lang = GUICtrlCreateLabel("Languag:", 110, 350, 45, 18)
$LangGet = GUICtrlCreateCombo("", 160, 345, 40, 18)
GUICtrlSetData(-1, "EN|FR|DE|ES|IT|NL|PT", "EN")

$DownloadBTN = GUICtrlCreateButton("Download Infos", 10, 375, 190, 25)
GUISetState(@SW_HIDE, $GameInfoGui)

;=============================================TrailersGui============================
$GUITrailers = GUICreate("Title Trailers", 660, 560, 200, -50, BitAND($GUI_SS_DEFAULT_GUI, BitNOT($WS_MINIMIZEBOX)), BitOR($WS_EX_DLGMODALFRAME, $WS_EX_MDICHILD), $Gui)
GUICtrlCreateGroup("Search", 10, 5, 430, 40)
$inputTrailers = GUICtrlCreateInput("Mario kart", 20, 17, 250, 22)
$BTNSearchTrailers = GUICtrlCreateButton("Search", 280, 15, 150, 25)

GUICtrlCreateGroup("Results", 10, 50, 640, 500)
Local $cordY = 65
For $i = 0 To 13
If $i < 4 Then
$cordX = 20
ElseIf $i = 4 Then
$cordX = 230
$cordY = 65
ElseIf $i = 8 Then
$cordX = 440
$cordY = 65
ElseIf $i < 8 And $i > 4 Then
$cordX = 230
Else
$cordX = 440
EndIf
$Control[$i][0] = GUICtrlCreateLabel("", $cordX, $cordY, 200, 15)
$Control[$i][1] = GUICtrlCreatePic("", $cordX, $cordY + 15, 70, 100)
$Control[$i][2] = GUICtrlCreateLabel("", $cordX, $cordY + 15, 1, 1)
$cordY += 120
Next

GUISetState(@SW_HIDE, $GUITrailers)

_GDIPlus_Startup()
GUIRegisterMsg($WM_NOTIFY, '_DragListView')
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
If WinActive($Gui, "") <> 0 Then
DirRemove($Tempdir)
_GDIPlus_Shutdown()
Exit
ElseIf WinActive($GameInfoGui, "") = $GameInfoGui Then
GUISetState(@SW_HIDE, $GameInfoGui)
Else
GUISetState(@SW_HIDE, $GUITrailers)
EndIf
;=============================================SettingsGui============================
Case $SettingLang
GUISetState(@SW_SHOW, $SettingsGui)
Case $LangSave
Local $Preferred = ""
For $PR = 0 To 10
$Preferred &= "|" & _GUICtrlListView_GetItemText($LangOption, $PR, 0)
Next
IniWrite($ConfigINI, "Conf", "Preferred Region", StringTrimLeft($Preferred, 1))
GUISetState(@SW_HIDE, $SettingsGui)
;=============================================mainGui============================
Case $loadnand
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listview))
$cancelState = 0
_Main()
Case $Select
ShowMenu($Gui, $nMsg, $Selectmenu)
Case $NandFolder
Local $path = FileSelectFolder("Choose a folder. (Nand)", @DesktopDir, 1, "", $Gui)
If @error <> 1 Then
If StringRegExpReplace($path, "^.*\\(.*)$", "$1") = "Nand" Then
IniWrite($ConfigINI, "Conf", "Nand Path", $path)
$NandFolderState = 1
_GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($listview))
GUICtrlSetData($NandFolderinput, $path)
GUICtrlSetState($OpentitleFolder, $GUI_DISABLE)
GUICtrlSetState($Deletetitle, $GUI_DISABLE)
GUICtrlSetState($GettitleInfo, $GUI_DISABLE)
Else
$NandFolderState = 0
GUICtrlSetData($NandFolderinput, "")
MsgBox(48, "Wrong folder!", "Navigate to 'Nand' folder (USB\nand)")
EndIf
Else
If FileExists(IniRead($ConfigINI, "Conf", "Nand Path", "")) Then
GUICtrlSetData($NandFolderinput, IniRead($ConfigINI, "Conf", "Nand Path", ""))
Local $path = IniRead($ConfigINI, "Conf", "Nand Path", "")
$NandFolderState = 1
EndIf
MsgBox(48, "Cancelled", "Navigate to 'Nand' folder (USB\nand)")
EndIf
Case $CoverFolder
_SaveFolder()
Case $LangBox
If FileExists($DataDir & "\title_" & GUICtrlRead($LangBox) & ".ini") = 0 Then
$DownloadtitleSize = InetGetSize("http://www.gametdb.com/titles.txt?LANG=" & GUICtrlRead($LangBox))
$Downloadtitle = InetGet("http://www.gametdb.com/titles.txt?LANG=" & GUICtrlRead($LangBox), $DataDir & "\title_" & GUICtrlRead($LangBox) & ".ini", 1, 1)
Do
$aInfo = InetGetInfo($Downloadtitle)
$iPercent = Round($aInfo[0] / $DownloadtitleSize * 100, 1)
GUICtrlSetData($progress, $iPercent)
GUICtrlSetData($State, "Download " & GUICtrlRead($LangBox) & " title" & StringFormat("%s / %s", $aInfo[0], $DownloadtitleSize))
Until $aInfo[2]
Sleep(250)
If $aInfo[3] Then GUICtrlSetData($progress, 100)
InetClose($Downloadtitle)
EndIf
IniWrite($ConfigINI, "Conf", "Language", GUICtrlRead($LangBox))
Case $CoverTypeBox
IniWrite($ConfigINI, "Conf", "Cover Type", GUICtrlRead($CoverTypeBox))
Case $SelectALL
$CountTitle = _GUICtrlListView_GetItemCount($listview) - 1
For $i = 0 To $CountTitle
_GUICtrlListView_SetItemChecked($listview, $i, True)
Next
Case $SelectNone
$CountTitle = _GUICtrlListView_GetItemCount($listview) - 1
For $i = 0 To $CountTitle
_GUICtrlListView_SetItemChecked($listview, $i, False)
Next
Case $SelectMissing
If FileExists(GUICtrlRead($CoverFolderInput)) And GUICtrlRead($CoverFolderInput) <> '' Then
$CountTitle = _GUICtrlListView_GetItemCount($listview) - 1
For $i = 0 To $CountTitle
$ID4or6String = _GUICtrlListView_GetItemText($listview, $i, 1) & '*.png'
If FileExists(GUICtrlRead($CoverFolderInput) & '\' & $ID4or6String) = 1 Then
_GUICtrlListView_SetItemChecked($listview, $i, False)
Else
_GUICtrlListView_SetItemChecked($listview, $i, True)
EndIf
Next
EndIf
Case $SelectInvert
$CountTitle = _GUICtrlListView_GetItemCount($listview) - 1
For $i = 0 To $CountTitle
If _GUICtrlListView_GetItemChecked($listview, $i) = True Then
_GUICtrlListView_SetItemChecked($listview, $i, False)
ElseIf _GUICtrlListView_GetItemChecked($listview, $i) = False Then
_GUICtrlListView_SetItemChecked($listview, $i, True)
EndIf
Next
Case $Initialising
$cancelState = 0
$CountTitle = _GUICtrlListView_GetItemCount($listview) - 1
For $Del = 0 To $CountTitle
If _GUICtrlListView_GetItemChecked($listview, $Del) = True Then
_GUICtrlListView_SetItemText($listview, $Del, "", 6)
_GUICtrlListView_SetItemText($listview, $Del, "", 7)
_GUICtrlListView_SetItemText($listview, $Del, "", 8)
_GUICtrlListView_SetItemText($listview, $Del, "", 9)
EndIf
Next
Local $TotalDownload = 0
For $CnT = 0 To $CountTitle
If $cancelState = 1 Then
$CancellString = "Check downloads"
ExitLoop
EndIf
If _GUICtrlListView_GetItemChecked($listview, $CnT) = True Then
GetCovers(_GUICtrlListView_GetItemText($listview, $CnT, 1), $CountTitle + 1, $CnT)
EndIf
Next
GUICtrlSetData($progress, 100)
Case $StartDownload
Local $TotalDownload = 0, $TotalSize = 0
$cancelState = 0
$CountTitle = _GUICtrlListView_GetItemCount($listview) - 1
Local $TotalDownload = 0
For $CnT = 0 To $CountTitle
If _GUICtrlListView_GetItemChecked($listview, $CnT) = True Then
If _GUICtrlListView_GetItemText($listview, $CnT, 7) > 0 Then
$TotalSize += _GUICtrlListView_GetItemText($listview, $CnT, 7)
$TotalDownload += 1
EndIf
EndIf
Next
If GUICtrlRead($CoverTypeBox) = "Full" Then
$TypeDown = "coverfullHQ"
ElseIf GUICtrlRead($CoverTypeBox) = "Front" Then
$TypeDown = "cover"
ElseIf GUICtrlRead($CoverTypeBox) = "3D" Then
$TypeDown = "cover3D"
ElseIf GUICtrlRead($CoverTypeBox) = "Disc" Then
$TypeDown = "disc"; disccustom
EndIf
If MsgBox(4, "Info", "Size of remote files: " & $TotalSize & " Kb" & @CR & "Total Download: " & $TotalDownload & @CR & "Download now?", Default, $Gui) = 6 Then
For $CnT = 0 To $CountTitle
If $cancelState = 1 Then
$CancellString = "Download covers"
ExitLoop
EndIf
If _GUICtrlListView_GetItemChecked($listview, $CnT) = True Then
If _GUICtrlListView_GetItemText($listview, $CnT, 7) <> 0 Then
Local $CoverUrl = "http://art.gametdb.com/wii/" & $TypeDown & "/" & _GUICtrlListView_GetItemText($listview, $CnT, 6) & "/" & _GUICtrlListView_GetItemText($listview, $CnT, 9) & ".png"
If GUICtrlRead($CoverFolderInput) = "" Then
_SaveFolder()
Else
Local $CoverUrlSaveFile = GUICtrlRead($CoverFolderInput) & "\" & StringLeft(_GUICtrlListView_GetItemText($listview, $CnT, 1), 4) & ".png"
DownloadCovers($CoverUrl, $CoverUrlSaveFile, $CountTitle, $CnT)
EndIf
Else
_GUICtrlListView_SetItemText($listview, $CnT, "****", 8)
EndIf
EndIf
GUICtrlSetData($progress, $CnT * 100 / $CountTitle)
Next
EndIf
;=============================================ListviewCTRL============================
Case $OpentitleFolder
$Select = _GUICtrlListView_GetSelectedIndices($listview, True)
If $Select[0] > 0 Then
If _GUICtrlListView_GetItemText($listview, $Select[1], 0) <> "" Then
ShellExecute(GUICtrlRead($NandFolderinput) & "\title\" & _GUICtrlListView_GetItemText($listview, $Select[1], 10) & "\" & _GUICtrlListView_GetItemText($listview, $Select[1], 0))
EndIf
EndIf
Case $Deletetitle
$Select = _GUICtrlListView_GetSelectedIndices($listview, True)
If $Select[0] > 0 Then
If _GUICtrlListView_GetItemText($listview, $Select[1], 0) <> "" Then
If MsgBox(36, "Delete Title", "Are you sure you want to remove : " & _GUICtrlListView_GetItemText($listview, $Select[1], 2) & "!", Default, $Gui) = 6 Then
If WinExists(GUICtrlRead($NandFolderinput) & "\title\" & _GUICtrlListView_GetItemText($listview, $Select[1], 10) & "\" & _GUICtrlListView_GetItemText($listview, $Select[1], 0)) Then
WinClose(_GUICtrlListView_GetItemText($listview, $Select[1], 0))
EndIf
DirRemove(GUICtrlRead($NandFolderinput) & "\title\" & _GUICtrlListView_GetItemText($listview, $Select[1], 10) & "\" & _GUICtrlListView_GetItemText($listview, $Select[1], 0), 1)
FileDelete(GUICtrlRead($NandFolderinput) & "\ticket\" & _GUICtrlListView_GetItemText($listview, $Select[1], 10) & "\" & _GUICtrlListView_GetItemText($listview, $Select[1], 0) & ".tik")
_GUICtrlListView_DeleteItem(GUICtrlGetHandle($listview), $Select[1])
EndIf
EndIf
Else
GUICtrlSetState($OpentitleFolder, $GUI_DISABLE)
GUICtrlSetState($Deletetitle, $GUI_DISABLE)
GUICtrlSetState($GettitleInfo, $GUI_DISABLE)
EndIf

;=============================================InfoGui============================
Case $DownloadBTN
_GetAllInfos()
Case $LangGet
_setInformation()
Case $GettitleInfo
GUISetState(@SW_SHOW, $GameInfoGui)
$Select = _GUICtrlListView_GetSelectedIndices($listview, True)
If $Select[0] > 0 Then
If _GUICtrlListView_GetItemText($listview, $Select[1], 0) <> "" Then
GUICtrlSetData($inputGetID, _GUICtrlListView_GetItemText($listview, $Select[1], 1))
EndIf
EndIf
If GUICtrlRead($LangBox) = "US" Or GUICtrlRead($LangBox) = "JA" Or GUICtrlRead($LangBox) = "KO" Or GUICtrlRead($LangBox) = "ZH" Then
GUICtrlSetData($LangGet, "EN")
Else
GUICtrlSetData($LangGet, GUICtrlRead($LangBox))
EndIf
_setInformation()
;=============================================TrailersGui============================
Case $Control[0][1] To $Control[11][1]
$CursorInfo = GUIGetCursorInfo($GUITrailers)
For $i = 0 To 11
If $CursorInfo[4] = $Control[$i][1] And $CursorInfo[2] = 1 Then
If MsgBox(36, "Open URL", "Would you like to open " & GUICtrlRead($Control[$i][0]) & " ?" & @CRLF & @CRLF & "URL : " & GUICtrlRead($Control[$i][2]), Default, $GUITrailers) = 6 Then
ShellExecute(GUICtrlRead($Control[$i][2]))
EndIf
EndIf
Next
Case $GettitleTrailers
$Select = _GUICtrlListView_GetSelectedIndices($listview, True)
If $Select[0] > 0 Then
If _GUICtrlListView_GetItemText($listview, $Select[1], 0) <> "" Then
GUICtrlSetData($inputTrailers, _GUICtrlListView_GetItemText($listview, $Select[1], 2) & " " & _GUICtrlListView_GetItemText($listview, $Select[1], 3))
EndIf
EndIf
GUISetState(@SW_SHOW, $GUITrailers)
For $i = 0 To 11
GUICtrlSetData($Control[$i][0], '')
GUICtrlSetImage($Control[$i][1], '')
Next
$FoundTrailers = _searchTrailers()
For $iFT = 0 To UBound($FoundTrailers) - 1
If $iFT < 12 Then _AddControlTrailers($FoundTrailers[$iFT][0] & "|" & $FoundTrailers[$iFT][1] & "|" & $FoundTrailers[$iFT][2], $iFT)
Next
Case $BTNSearchTrailers
For $i = 0 To 11
GUICtrlSetData($Control[$i][0], '')
GUICtrlSetImage($Control[$i][1], '')
Next
$FoundTrailers = _searchTrailers()
For $iFT = 0 To UBound($FoundTrailers) - 1
If $iFT < 12 Then _AddControlTrailers($FoundTrailers[$iFT][0] & "|" & $FoundTrailers[$iFT][1] & "|" & $FoundTrailers[$iFT][2], $iFT)
Next
EndSwitch
WEnd
;=============================================mainGui============================
Func _SaveFolder()
Local $SaveFolder = FileSelectFolder("Choose a folder. (Covers)", @DesktopDir, 1)
If @error <> 1 Then
$CoverFolderState = 1
GUICtrlSetData($CoverFolderInput, $SaveFolder)
IniWrite($ConfigINI, "Conf", "Covers Path", $SaveFolder)
Else
$CoverFolderState = 0
GUICtrlSetData($CoverFolderInput, "")
EndIf
EndFunc   ;==>_SaveFolder

Func DownloadCovers($LinkCover, $saveCover, $progTota, $ProgPart)
$DownloadCoverSize = InetGetSize($LinkCover)
$DownloadCover = InetGet($LinkCover, $saveCover, 1, 1)
Do
$aInfo = InetGetInfo($DownloadCover)
$iPercent = Round($aInfo[0] / $DownloadCoverSize * 100, 1)
_GUICtrlListView_SetItemText($listview, $ProgPart, $iPercent & "%", 8)
Until $aInfo[2]
InetClose($DownloadCover)
GUICtrlSetData($State, "Game N': " & $ProgPart & " / " & $progTota & "     |     " & $LinkCover)

EndFunc   ;==>DownloadCovers

Func _Main()
Local $LangDown = GUICtrlRead($LangBox)
Global $FileListNand[1], $FileListNandGameID[1][3], $FileListNandGameALLID[1][2], $DownloadID[1]
If $NandFolderState = 1 Then
Local $NewNumber = 0
$FileListRead = _FileListToArray($path & "\title", "*", 2)
If @error <> 1 Then
ReDim $FileListNand[$FileListRead[0] + 1]

For $Nn = 1 To $FileListRead[0]
If StringLeft($FileListRead[$Nn], 4) = "0001" Then
$FileListNandGame = _FileListToArray($path & "\title\" & $FileListRead[$Nn], "*", 2)
If @error <> 1 Then
ReDim $FileListNandGameID[$FileListNandGame[0] + $NewNumber + 1][3]
$FileListNandGameID[0][0] = $NewNumber
For $GI = 1 To $FileListNandGame[0]
$FileListNandGameID[$GI + $NewNumber][0] = $FileListNandGame[$GI]
$FileListNandGameID[$GI + $NewNumber][1] = StringUpper(BinaryToString("0x" & $FileListNandGame[$GI]))
$FileListNandGameID[$GI + $NewNumber][2] = $FileListRead[$Nn]
Next
$NewNumber += $FileListNandGame[0]
$FileListNandGameID[0][0] = $NewNumber
EndIf
EndIf
Next
$iNumber = 0
If $FileListNandGameID[0][0] >= 1 Then
For $iFol = 1 To $FileListNandGameID[0][0]
If $cancelState = 1 Then
$CancellString = "Load nand dump"
ExitLoop
EndIf
_searchGameID($FileListNandGameID[$iFol][2], $FileListNandGameID[$iFol][0], $FileListNandGameID[$iFol][1], $FileListNandGameID[0][0])
Next
EndIf
If _GUICtrlListView_GetItemCount($listview) > 0 Then
GUICtrlSetState($OpentitleFolder, $GUI_ENABLE)
GUICtrlSetState($Deletetitle, $GUI_ENABLE)
GUICtrlSetState($GettitleInfo, $GUI_ENABLE)
EndIf
EndIf
EndIf
;_ArrayDisplay($FileListNandGameID, "FileList")
EndFunc   ;==>_Main

Func GetCovers($IDToChek, $progTota, $ProgPart)
Local $CoversTitleFound = 0
$LangDown = GUICtrlRead($LangBox)
If GUICtrlRead($CoverTypeBox) = "Full" Then
$TypeDown = "coverfullHQ"
ElseIf GUICtrlRead($CoverTypeBox) = "Front" Then
$TypeDown = "cover"
ElseIf GUICtrlRead($CoverTypeBox) = "3D" Then
$TypeDown = "cover3D"
ElseIf GUICtrlRead($CoverTypeBox) = "Disc" Then
$TypeDown = "disc"; disccustom
EndIf
Local $nSize = InetGetSize("http://art.gametdb.com/wii/" & $TypeDown & "/" & $LangDown & "/" & $IDToChek & ".png")
If @error = 0 Then
$TotalDownload += 1
GUICtrlSetData($State, "Game N': " & $ProgPart & " / " & $progTota & "     |     http://art.gametdb.com/wii/" & $TypeDown & "/" & $LangDown & "/" & $IDToChek & ".png")
GUICtrlSetData($progress, $ProgPart * 100 / $progTota)
_GUICtrlListView_AddSubItem($listview, $ProgPart, $LangDown, 6, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, Round($nSize / 1024), 7, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, $IDToChek, 9, 1)
$CoversTitleFound = 1
Else

For $NewL = 0 To 10
$NowStringLang = _GUICtrlListView_GetItemText($LangOption, $NewL, 0)
If $NowStringLang = "EN" Or $NowStringLang = "FR" Or $NowStringLang = "DE" Or $NowStringLang = "ES" Or _
$NowStringLang = "IT" Or $NowStringLang = "NL" Or $NowStringLang = "PT" Then
$RegionID = "P"
ElseIf $NowStringLang = "US" Then
$RegionID = "E"
ElseIf $NowStringLang = "JA" Then
$RegionID = "J"
ElseIf $NowStringLang = "KO" Then
$RegionID = "K"
ElseIf $NowStringLang = "ZH" Then
$RegionID = "W"
EndIf
Local $NewIDREgion = ""
$splitIDToChek = StringSplit($IDToChek, "")
For $SSID = 1 To $splitIDToChek[0]
If $SSID = 4 Then
$NewIDREgion &= $RegionID
Else
$NewIDREgion &= $splitIDToChek[$SSID]
EndIf
Next

Local $nCOVERSSize = InetGetSize("http://art.gametdb.com/wii/" & $TypeDown & "/" & $NowStringLang & "/" & $NewIDREgion & ".png")
If @error = 0 Then
$TotalDownload += 1
GUICtrlSetData($progress, $ProgPart * 100 / $progTota)
_GUICtrlListView_AddSubItem($listview, $ProgPart, $NowStringLang, 6, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, Round($nCOVERSSize / 1024), 7, 1)
$CoversTitleFound = 1
_GUICtrlListView_AddSubItem($listview, $ProgPart, $NewIDREgion, 9, 1)
ExitLoop
EndIf
;MsgBox(0, "", $NowStringLang)
GUICtrlSetData($State, "Game N': " & $ProgPart & " / " & $progTota & "     |     http://art.gametdb.com/wii/" & $TypeDown & "/" & $NowStringLang & "/" & $NewIDREgion & ".png")
Next
If $CoversTitleFound = 0 Then
GUICtrlSetData($State, "Game N': " & $ProgPart & " / " & $progTota & "     |     http://art.gametdb.com/wii/" & $TypeDown & "/" & $LangDown & "/" & $IDToChek & ".png")
GUICtrlSetData($progress, $ProgPart * 100 / $progTota)
_GUICtrlListView_AddSubItem($listview, $ProgPart, "Not found", 6, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, 0, 7, 1)
_GUICtrlListView_AddSubItem($listview, $ProgPart, $IDToChek, 9, 1)
EndIf
EndIf


EndFunc   ;==>GetCovers


Func _searchGameID($foldernameMain, $foldername, $name_to_search, $iToNumber)
$iNumber += 1
GUICtrlSetData($State, "File N' " & $iNumber & " / " & $iToNumber & "    |    " & "Load: '" & $foldername & " : " & $name_to_search & "'")
$iPercent = Round($iNumber / $iToNumber * 100, 1)
GUICtrlSetData($progress, $iPercent)

$foldernameSize = DirGetSize($path & "\title\" & $foldernameMain & "\" & $foldername)
$foldernameTicketSize = FileGetSize($path & "\ticket\" & $foldernameMain & "\" & $foldername & ".tik")
If $foldernameSize > 0 Then
If FileExists($DataDir & "\title_" & GUICtrlRead($LangBox) & ".ini.") <> 0 Then
Local $hFile = FileOpen($DataDir & "\title_" & GUICtrlRead($LangBox) & ".ini.", 0)
If $hFile <> -1 Then
Local $Titlefound = 0
While True
$searchItem = FileReadLine($hFile)
If @error Then ExitLoop
If StringInStr($searchItem, "=") Then
Local $ID_To_search = StringSplit($searchItem, "=", 0)
If StringInStr($ID_To_search[1], $name_to_search) Then
Local $Title_To_search = StringSplit($searchItem, "=", 0)
If StringLeft($Title_To_search[2], 1) = " " Then $Title_To_search[2] = StringTrimLeft($Title_To_search[2], 1)
If StringRight($Title_To_search[1], 1) = " " Then $Title_To_search[1] = StringTrimRight($Title_To_search[1], 1)
$item_count = _GUICtrlListView_GetItemCount($listview)
_GUICtrlListView_AddItem($listview, $foldername, $item_count)
_GUICtrlListView_AddSubItem($listview, $item_count, $Title_To_search[1], 1, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, $Title_To_search[2], 2, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, _GetGameType($Title_To_search[1]), 3, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, _GetRegion($Title_To_search[1]), 4, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, Round(($foldernameSize + $foldernameTicketSize) / 1024, 2), 5, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, $foldernameMain, 10, 1)
$Titlefound = 1
EndIf
EndIf
WEnd
FileClose($hFile)
If $Titlefound = 0 And FileExists($path & "\title\" & $foldernameMain & "\" & $foldername & "\content\*.app") Then
$item_count = _GUICtrlListView_GetItemCount($listview)
_GUICtrlListView_AddItem($listview, $foldername, $item_count)
$IDBinarystring = StringUpper(BinaryToString("0x" & $foldername))
_GUICtrlListView_AddSubItem($listview, $item_count, $IDBinarystring, 1, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, "", 2, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, _GetGameType($IDBinarystring), 3, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, _GetRegion($IDBinarystring), 4, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, Round(($foldernameSize + $foldernameTicketSize) / 1024, 2), 5, 1)
_GUICtrlListView_AddSubItem($listview, $item_count, $foldernameMain, 10, 1)
EndIf
EndIf
EndIf
EndIf
EndFunc   ;==>_searchGameID

Func _GetGameType($IDFound)
Local $SetGameType = ""
$GetGameType = StringLeft($IDFound, 1)
If $GetGameType = "W" Then
$SetGameType = "WiiWare"
ElseIf $GetGameType = "N" Then
$SetGameType = "Nintendo64"
ElseIf $GetGameType = "J" Then
$SetGameType = "SNES"
ElseIf $GetGameType = "F" Then
$SetGameType = "NES"
ElseIf $GetGameType = "A" Then
$GetGameType_A = StringLeft($IDFound, 2)
If $GetGameType_A = "A6" Then
$SetGameType = "Arcade"
ElseIf $GetGameType_A = "A7" Then
$SetGameType = "Arcade-Namco"
Else
$SetGameType = "custom"
EndIf
ElseIf $GetGameType = "P" Then
$SetGameType = "TurboGrafx16"
ElseIf $GetGameType = "Q" Then
$SetGameType = "TurboGrafxCD"
ElseIf $GetGameType = "C" Then
$SetGameType = "Commodore"
ElseIf $GetGameType = "E" Then ;EA
$SetGameType = "NeoGeo"
ElseIf $GetGameType = "M" Then
$SetGameType = "SegaMegaDrive"
ElseIf $GetGameType = "L" Then
$SetGameType = "SegaMasterSystem"
ElseIf $GetGameType = "R" Or $GetGameType = "S" Or $GetGameType = "A" Then
$SetGameType = "Wii"
ElseIf $GetGameType = "G" Or $GetGameType = "D" Then
$SetGameType = "GameCube"
ElseIf $GetGameType = "H" Then
$SetGameType = "General Channel"
ElseIf $GetGameType = "X" Then
$SetGameType = "WiiWare - Demos "
Else
$SetGameType = "custom"
EndIf
Return $SetGameType
EndFunc   ;==>_GetGameType

Func _GetRegion($IDFound)
Global $UserSearchRegion = "Unknow"
If StringRight(StringLeft($IDFound, 4), 1) = "A" Then
$UserSearchRegion = "All regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "D" Then
$UserSearchRegion = "German-speaking regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "E" Then
$UserSearchRegion = "USA"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "F" Then
$UserSearchRegion = "French-speaking regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "I" Then
$UserSearchRegion = "Italian-speaking regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "J" Then
$UserSearchRegion = "Japan"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "K" Then
$UserSearchRegion = "Korea"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "L" Then
$UserSearchRegion = "Japanese Import to Europe"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "M" Then
$UserSearchRegion = "American Import to Europe"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "N" Then
$UserSearchRegion = "Japanese Import to USA"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "P" Then
$UserSearchRegion = "Europe"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "S" Then
$UserSearchRegion = "Spanish-speaking regions"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "Q" Then
$UserSearchRegion = "Korea with Japanese language"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "T" Then
$UserSearchRegion = "Korea with English language"
ElseIf StringRight(StringLeft($IDFound, 4), 1) = "X" Then
$UserSearchRegion = "Not a real region code"
EndIf
Return $UserSearchRegion
EndFunc   ;==>_GetRegion

Func ShowMenu($hWnd, $CtrlID, $nContextID)
Local $arPos, $x, $y
Local $hMenu = GUICtrlGetHandle($nContextID)
$arPos = ControlGetPos($hWnd, "", $CtrlID)
$x = $arPos[0]
$y = $arPos[1] + $arPos[3]
ClientToScreen($hWnd, $x, $y)
TrackPopupMenu($hWnd, $hMenu, $x, $y)
EndFunc   ;==>ShowMenu

Func ClientToScreen($hWnd, ByRef $x, ByRef $y)
Local $stPoint = DllStructCreate("int;int")
DllStructSetData($stPoint, 1, $x)
DllStructSetData($stPoint, 2, $y)
DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))
$x = DllStructGetData($stPoint, 1)
$y = DllStructGetData($stPoint, 2)
$stPoint = 0
EndFunc   ;==>ClientToScreen

Func TrackPopupMenu($hWnd, $hMenu, $x, $y)
DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $x, "int", $y, "hwnd", $hWnd, "ptr", 0)
EndFunc   ;==>TrackPopupMenu

;=============================================SettingsGui============================
Func _DragListView($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iwParam
Local Static $iStartIndex = -1, $iEndIndex = -1, $sItemText = "", $fLVDrag = False
Switch $iMsg
Case $WM_MOUSEMOVE
Local $aHit = _GUICtrlListView_HitTest($LangOptionHandle)
If IsArray($aHit) Then _GUICtrlListView_SetItemFocused($LangOptionHandle, $aHit[0])
Case $WM_NOTIFY
Local $tNMHDR, $hWndFrom, $iCode, $iNewItem, $tNMLISTVIEW
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, 'hWndFrom'))
$iCode = DllStructGetData($tNMHDR, 'Code')
Switch $hWndFrom
Case $LangOptionHandle
Switch $iCode
Case $LVN_BEGINDRAG
If Not $fLVDrag Then
$tNMLISTVIEW = DllStructCreate($tagNMLISTVIEW, $ilParam)
$iStartIndex = DllStructGetData($tNMLISTVIEW, 'Item')
$sItemText = _GUICtrlListView_GetItemTextString($LangOptionHandle, $iStartIndex)
$fLVDrag = True
GUIRegisterMsg($WM_MOUSEMOVE, '_DragListView')
EndIf
Case $LVN_HOTTRACK
If $fLVDrag Then
$tNMLISTVIEW = DllStructCreate($tagNMLISTVIEW, $ilParam)
$iEndIndex = DllStructGetData($tNMLISTVIEW, 'Item')
$fLVDrag = False
GUIRegisterMsg($WM_MOUSEMOVE, '')
Select
Case $iStartIndex < $iEndIndex
$iNewItem = _GUICtrlListView_InsertItem($LangOptionHandle, "", $iEndIndex + 1)
_GUICtrlListView_SetItemText($LangOptionHandle, $iNewItem, $sItemText, -1)
_GUICtrlListView_SetItemSelected($LangOptionHandle, $iNewItem, True, True)
_GUICtrlListView_DeleteItem($LangOptionHandle, $iStartIndex)
Case $iStartIndex > $iEndIndex
_GUICtrlListView_DeleteItem($LangOptionHandle, $iStartIndex)
$iNewItem = _GUICtrlListView_InsertItem($LangOptionHandle, "", $iEndIndex)
_GUICtrlListView_SetItemText($LangOptionHandle, $iNewItem, $sItemText, -1)
_GUICtrlListView_SetItemSelected($LangOptionHandle, $iNewItem, True, True)
EndSelect
EndIf
EndSwitch
Case $listviewHandle
Switch $iCode
Case $NM_DBLCLK
If _GUICtrlListView_GetItemCount($listview) > 0 Then
GUISetState(@SW_SHOW, $GameInfoGui)
$Select = _GUICtrlListView_GetSelectedIndices($listview, True)
If $Select[0] > 0 Then
If _GUICtrlListView_GetItemText($listview, $Select[1], 0) <> "" Then
GUICtrlSetData($inputGetID, _GUICtrlListView_GetItemText($listview, $Select[1], 1))
EndIf
EndIf
If GUICtrlRead($LangBox) = "US" Or GUICtrlRead($LangBox) = "JA" Or GUICtrlRead($LangBox) = "KO" Or GUICtrlRead($LangBox) = "ZH" Then
GUICtrlSetData($LangGet, "EN")
Else
GUICtrlSetData($LangGet, GUICtrlRead($LangBox))
EndIf
_setInformation()
EndIf
EndSwitch
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc   ;==>_DragListView

Func _WM_COMMAND($hWnd, $nMsg, $wParam, $lParam)
Local $hButton = GUICtrlGetHandle($Cancel)
Switch $lParam
Case $hButton
$cancelState = 1
GUICtrlSetData($progress, 0)
GUICtrlSetData($State, $CancellString & " : Operation cancelled by user")
EndSwitch
EndFunc   ;==>_WM_COMMAND

;=============================================InfoGui============================
Func _GetAllInfos()
$resultRechercher = GUICtrlRead($inputGetID)
$HTML = _HTML_GetSource("http://www.gametdb.com/Wii/" & $resultRechercher)
FileDelete(@TempDir & "\~tmp")
FileWrite(@TempDir & "\~tmp", _HTML_GetText($HTML, "body", "", "id", 0, 12))
;;EN
Strip_desc_title("EN", "FR", $resultRechercher)
;;FR
Strip_desc_title("FR", "DE", $resultRechercher)
;;DE
Strip_desc_title("DE", "ES", $resultRechercher)
;;ES
Strip_desc_title("ES", "IT", $resultRechercher)
;;IT
Strip_desc_title("IT", "NL", $resultRechercher)
;;NL
Strip_desc_title("NL", "developer", $resultRechercher)
;;
Strip_desc_title("PT", "developer", $resultRechercher)

Start_Strip_MoreInfo($resultRechercher)

$Title_read = IniRead($DataDir & "\Multi.ini", $resultRechercher & "_" & GUICtrlRead($LangGet), "Title_" & $resultRechercher, "")
GUICtrlSetData($titleGame, $Title_read)

$descr_read = IniRead($DataDir & "\Multi.ini", $resultRechercher & "_" & GUICtrlRead($LangGet), "Descri", "")
$descr_read = StringReplace($descr_read, "@CRLF", @CRLF)
GUICtrlSetData($DescripGetInfo, $descr_read)

FileDelete(@TempDir & "\~tmp")
EndFunc   ;==>_GetAllInfos

Func Start_Strip_MoreInfo($resultRechercher)
$AsplitID = ''
$Asplitregion = ''
$Asplittype = ''
$Asplitlanguages = ''
$Asplitdeveloper = ''
$Asplitpublisher = ''
$Asplitgenre = ''
$Asplitrating = ''
$Asplitcontent = ''
$Asplitplayers = ''
$Asplitreqaccesso = ''
$Asplitreqaccessories = ''
$Asplitonlineplayers = ''
$Asplitsize = ''
;ID getinfo
$IDInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), 'Next' & @CRLF & 'ID', 'region')
If Not @error And IsArray($IDInfoDownload) Then
$AsplitID = _ArrayToString($IDInfoDownload)
GUICtrlSetData($IDGetInfo, StringReplace($AsplitID, @CRLF, ''))
Else
GUICtrlSetData($IDGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "ID", StringReplace($AsplitID, @CRLF, ""))
;Region getinfo
$regionInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'region', 'type')
If Not @error And IsArray($regionInfoDownload) Then
$Asplitregion = _ArrayToString($regionInfoDownload)
GUICtrlSetData($regionGetInfo, StringReplace($Asplitregion, @CRLF, ''))
Else
GUICtrlSetData($regionGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Region", StringReplace($Asplitregion, @CRLF, ""))
;type getinfo
$typeInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'type', 'languages')
If Not @error And IsArray($typeInfoDownload) Then
$Asplittype = _ArrayToString($typeInfoDownload)
GUICtrlSetData($typeGetInfo, StringReplace($Asplittype, @CRLF, ''))
Else
GUICtrlSetData($typeGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Type", StringReplace($Asplittype, @CRLF, ""))
;type getinfo
$languagesInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'languages', 'title (EN)')
If Not @error And IsArray($languagesInfoDownload) Then
$Asplitlanguages = _ArrayToString($languagesInfoDownload)
GUICtrlSetData($languagesGetInfo, StringReplace($Asplitlanguages, @CRLF, ''))
Else
GUICtrlSetData($languagesGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Languages", StringReplace($Asplitlanguages, @CRLF, ""))
;developer getinfo
$developerInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'developer', 'publisher')
If Not @error And IsArray($developerInfoDownload) Then
$Asplitdeveloper = _ArrayToString($developerInfoDownload)
GUICtrlSetData($developerGetInfo, StringReplace($Asplitdeveloper, @CRLF, ''))
Else
GUICtrlSetData($developerGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Developer", StringReplace($Asplitdeveloper, @CRLF, ""))
;publisher getinfo
$publisherInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'publisher', 'release date')
If Not @error And IsArray($publisherInfoDownload) Then
$Asplitpublisher = _ArrayToString($publisherInfoDownload)
GUICtrlSetData($publisherGetInfo, StringReplace($Asplitpublisher, @CRLF, ''))
Else
GUICtrlSetData($publisherGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Publisher", StringReplace($Asplitpublisher, @CRLF, ""))
;genre getinfo
$genreInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'genre', 'rating')
If Not @error And IsArray($genreInfoDownload) Then
$Asplitgenre = _ArrayToString($genreInfoDownload)
GUICtrlSetData($genreGetInfo, StringReplace($Asplitgenre, @CRLF, ''))
Else
GUICtrlSetData($genreGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Genre", StringReplace($Asplitgenre, @CRLF, ""))
;rating getinfo
$ratingInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'rating', 'players')
If Not @error And IsArray($ratingInfoDownload) Then
$Asplitrating = _ArrayToString($ratingInfoDownload)
If StringInStr($Asplitrating, "content") Then
$ratingInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'rating', 'content')
If Not @error And IsArray($ratingInfoDownload) Then
$Asplitrating = _ArrayToString($ratingInfoDownload)
EndIf
EndIf
GUICtrlSetData($ratingGetInfo, StringReplace($Asplitrating, @CRLF, ''))

Else
GUICtrlSetData($ratingGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Rating", StringReplace($Asplitrating, @CRLF, ""))
;content GetInfo
$contentInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'content descriptors', 'players')
If Not @error And IsArray($contentInfoDownload) Then
$Asplitcontent = _ArrayToString($contentInfoDownload)
GUICtrlSetData($contentGetInfo, StringReplace($Asplitcontent, @CRLF, ''))
Else
GUICtrlSetData($contentGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Content", StringReplace($Asplitcontent, @CRLF, ""))
;players getinfo
$playersInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'players', 'req. accessories')
If Not @error And IsArray($playersInfoDownload) Then
$Asplitplayers = _ArrayToString($playersInfoDownload)
GUICtrlSetData($playersGetInfo, StringReplace($Asplitplayers, @CRLF, ''))
Else
GUICtrlSetData($playersGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Players", StringReplace($Asplitplayers, @CRLF, ""))
;reqaccessories getinfo
$reqaccessoriesInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'req. accessories', 'online players')
If Not @error And IsArray($reqaccessoriesInfoDownload) Then
$Asplitreqaccesso = _ArrayToString($reqaccessoriesInfoDownload)
$Asplitreqaccessories = StringReplace($Asplitreqaccesso, "accessories", " ")
GUICtrlSetData($reqaccessoriesGetInfo, StringReplace($Asplitreqaccessories, @CRLF, ''))
Else
GUICtrlSetData($reqaccessoriesGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "ReqAccessories", StringReplace($Asplitreqaccessories, @CRLF, ""))
;onlineplayers getinfo
$onlineplayersInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'online players', 'online features')
If Not @error And IsArray($onlineplayersInfoDownload) Then
$Asplitonlineplayers = _ArrayToString($onlineplayersInfoDownload)
GUICtrlSetData($onlineplayersGetInfo, StringReplace($Asplitonlineplayers, @CRLF, ''))
Else
GUICtrlSetData($onlineplayersGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "OnlinePlayers", StringReplace($Asplitonlineplayers, @CRLF, ""))
;size getinfo
$sizeInfoDownload = _StringBetween(FileRead(@TempDir & "\~tmp"), @CRLF & 'size', 'crc')
If Not @error And IsArray($sizeInfoDownload) Then
$Asplitsi = _ArrayToString($sizeInfoDownload)
$Asplitsize = $Asplitsi / 1048576
GUICtrlSetData($sizeGetInfo, StringReplace($Asplitsize, @CRLF, '') & " MB")
Else
GUICtrlSetData($sizeGetInfo, "")
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Size", StringReplace($Asplitsize, @CRLF, "") & " MB")
EndFunc   ;==>Start_Strip_MoreInfo

Func Strip_desc_title($1, $2, $resultRechercher)
If Not @error Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'synopsis (' & $1 & ')')
If Not @error And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
Else
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'developer')
If Not @error And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)

If StringInStr($Asplittitle, "title (EN)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (EN)')
If Not @error And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf

If StringInStr($Asplittitle, "title (FR)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (FR)')
If Not @error And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf

If StringInStr($Asplittitle, "title (DE)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (DE)')
If Not @error And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf

If StringInStr($Asplittitle, "title (ES)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (ES)')
If Not @error And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf

If StringInStr($Asplittitle, "title (IT)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (IT)')
If Not @error And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf

If StringInStr($Asplittitle, "title (NL)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (NL)')
If Not @error And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf

If StringInStr($Asplittitle, "title (PT)") Then
$DescreptionTitle = _StringBetween(FileRead(@TempDir & "\~tmp"), 'title (' & $1 & ')', 'title (PT)')
If Not @error And IsArray($DescreptionTitle) Then
$Asplittitle = _ArrayToString($DescreptionTitle)
EndIf
EndIf

Else
$Asplittitle = "No Title Found"
EndIf
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher & "_" & $1, "Title_" & $resultRechercher, StringReplace($Asplittitle, @CRLF, ""))

$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (' & $2 & ')')
If Not @error And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
Else
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'developer')
If Not @error And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)

If StringInStr($AsplitDescr, "title (ZHCN") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (ZHCN')
If Not @error And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf

If StringInStr($AsplitDescr, "title (ZHTW") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (ZHTW')
If Not @error And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf

If StringInStr($AsplitDescr, "title (FR)") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (FR)')
If Not @error And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf

If StringInStr($AsplitDescr, "title (DE)") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (DE)')
If Not @error And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf

If StringInStr($AsplitDescr, "title (ES)") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (ES)')
If Not @error And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)

EndIf
EndIf

If StringInStr($AsplitDescr, "title (IT)") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (IT)')
If Not @error And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf

If StringInStr($AsplitDescr, "title (PT)") Then
$Descreption = _StringBetween(FileRead(@TempDir & "\~tmp"), 'synopsis (' & $1 & ')', 'title (PT)')
If Not @error And IsArray($Descreption) Then
$AsplitDescr = _ArrayToString($Descreption)
EndIf
EndIf

Else
$AsplitDescr = "No Description Found"
EndIf
EndIf

IniWrite($DataDir & "\Multi.ini", $resultRechercher & "_" & $1, "Descri", StringReplace($AsplitDescr, @CRLF, "@CRLF"))
IniWrite($DataDir & "\Multi.ini", $resultRechercher, "Downloaded at", 'Downloaded at ' & @HOUR & ':' & @MIN & " " & @MDAY & '-' & @MON & '-' & @YEAR & @CRLF)
EndIf

EndFunc   ;==>Strip_desc_title

Func _setInformation()
$resultRechercher = GUICtrlRead($inputGetID)
GUICtrlSetData($titleGame, IniRead($DataDir & "\Multi.ini", $resultRechercher & "_" & GUICtrlRead($LangGet), "Title_" & $resultRechercher, ""))
GUICtrlSetData($DescripGetInfo, StringReplace(IniRead($DataDir & "\Multi.ini", $resultRechercher & "_" & GUICtrlRead($LangGet), "Descri", ""), "@CRLF", @CRLF))
GUICtrlSetData($IDGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "ID", ""))
GUICtrlSetData($regionGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Region", ""))
GUICtrlSetData($typeGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Type", ""))
GUICtrlSetData($languagesGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Languages", ""))
GUICtrlSetData($developerGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Developer", ""))
GUICtrlSetData($publisherGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Publisher", ""))
GUICtrlSetData($genreGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Genre", ""))
GUICtrlSetData($ratingGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Rating", ""))
GUICtrlSetData($contentGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Content", ""))
GUICtrlSetData($playersGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Players", ""))
GUICtrlSetData($reqaccessoriesGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "ReqAccessories", ""))
GUICtrlSetData($onlineplayersGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "OnlinePlayers", ""))
GUICtrlSetData($sizeGetInfo, IniRead($DataDir & "\Multi.ini", $resultRechercher, "Size", ""))
EndFunc   ;==>_setInformation

;=============================================TrailersGui============================
Func _AddControlTrailers($BaseInfo, $IDCTRL)
$SplitBaseInfo = StringSplit($BaseInfo, "|", 2)
GUICtrlSetData($Control[$IDCTRL][0], $SplitBaseInfo[0])
GUICtrlSetFont($Control[$IDCTRL][0], 9, 500)
GUICtrlSetColor($Control[$IDCTRL][0], 0x0000FF)
GUICtrlSetTip($Control[$IDCTRL][0], $SplitBaseInfo[2])

$picName = StringSplit($SplitBaseInfo[1], "\|/", 0)
InetGet($SplitBaseInfo[1], $Tempdir & "\" & $picName[$picName[0]], 0, 0)
_ResizePic($Tempdir & "\" & $picName[$picName[0]], 70, 100)
GUICtrlSetImage($Control[$IDCTRL][1], $Tempdir & "\" & $picName[$picName[0]])

GUICtrlSetData($Control[$IDCTRL][2], $SplitBaseInfo[2])

EndFunc   ;==>_AddControlTrailers

Func _searchTrailers()
Global $TrailersFound[1][3]
$nametitleTrailers = StringRegExpReplace(GUICtrlRead($inputTrailers), ' ', '+')
_GetTrailersSource($nametitleTrailers)
$sourceTrailersfile = FileRead($Trailersfile)
$Foundhtml = _splitInfo($sourceTrailersfile, '<div class="content_row_super">([^*]*?)<div class="gamepage_content_row_text">')
If IsArray($Foundhtml) Then
$FoundhtmlPage = Round(StringRegExpReplace(_splitInfo($sourceTrailersfile, '<div class="reviewlist_bartext">([^*]*?)</div>', 1), '\d to \d of |\d to \d{2} of | ', '') / 10)
If Round($FoundhtmlPage / 10) > 1 Then
For $PN = 1 To Round($FoundhtmlPage / 10)
_GetTrailersSource($nametitleTrailers, $PN)
$sourceTrailersfile = FileRead($Trailersfile)
$Foundhtml = _splitInfo($sourceTrailersfile, '<div class="content_row_super">([^*]*?)<div class="gamepage_content_row_text">')

Dim $TrailersFoundPart[UBound($Foundhtml)][3]
For $i = 0 To UBound($Foundhtml) - 1
$TrailersFoundPart[$i][0] = _splitInfo($Foundhtml[$i], '.html" class="gamepage_content_row_title">([^*]*?)</a>', 1)
$TrailersFoundPart[$i][1] = 'http://gametrailers.mtvnimages.com/images/moses/boxart' & _splitInfo($Foundhtml[$i], '<img src="moses/boxart([^*]*?)"', 1)
$TrailersFoundPart[$i][2] = 'http://gametrailers.com/' & StringRegExpReplace(_splitInfo($Foundhtml[$i], 'class="search_game_row_thumb">([^*]*?)">', 1), '<a href="| ', '')
Next
Local $TrailersFound0 = UBound($TrailersFound, 0), $TrailersFoundPart0 = UBound($TrailersFoundPart, 0)
Local $TrailersFound1 = UBound($TrailersFound, 1), $TrailersFoundPart1 = UBound($TrailersFoundPart, 1)
Local $iNewSize = $TrailersFound1 + $TrailersFoundPart1
Local $TrailersFound2 = UBound($TrailersFound, 2), $TrailersFoundPart2 = UBound($TrailersFoundPart, 2)

ReDim $TrailersFound[$iNewSize][$TrailersFound2]
For $r = 0 To $TrailersFoundPart1 - 1
For $c = 0 To $TrailersFoundPart2 - 1
$TrailersFound[$TrailersFound1 + $r][$c] = $TrailersFoundPart[$r][$c]
Next
Next
$iNewSize -= 1
Next
Dim $TrailersFoundNew[UBound($TrailersFound)][3]
For $NTR = 0 To UBound($TrailersFound) - 2
$TrailersFoundNew[$NTR][0] = $TrailersFound[$NTR + 1][0]
$TrailersFoundNew[$NTR][1] = $TrailersFound[$NTR + 1][1]
$TrailersFoundNew[$NTR][2] = $TrailersFound[$NTR + 1][2]
Next
ReDim $TrailersFoundNew[UBound($TrailersFound) - 1][3]
;_ArrayDisplay($TrailersFoundNew)
Return $TrailersFoundNew
Else
Dim $TrailersFound[UBound($Foundhtml)][3]

For $i = 0 To UBound($Foundhtml) - 1
$TrailersFound[$i][0] = _splitInfo($Foundhtml[$i], '.html" class="gamepage_content_row_title">([^*]*?)</a>', 1)
$TrailersFound[$i][1] = 'http://gametrailers.mtvnimages.com/images/moses/boxart' & _splitInfo($Foundhtml[$i], '<img src="moses/boxart([^*]*?)"', 1)
$TrailersFound[$i][2] = 'http://gametrailers.com/' & StringRegExpReplace(_splitInfo($Foundhtml[$i], 'class="search_game_row_thumb">([^*]*?)">', 1), '<a href="| ', '')
Next
;_ArrayDisplay($TrailersFound)
Return $TrailersFound
EndIf
Else
MsgBox(32, "Info", "No Results Found For " & GUICtrlRead($inputTrailers), Default, $GUITrailers)
EndIf
EndFunc   ;==>_searchTrailers

Func _GetTrailersSource($trailersName, $searchPage = 1)
FileDelete($Trailersfile)
;Local $trailersHTML = InetRead("http://www.gametrailers.com/search.php?page=10&s=" & $trailersName & "&str_type=movies&ac=1", 1)
If $searchPage = 1 Then
Local $trailersHTML = InetRead("http://www.gametrailers.com/search.php?platlogic=OR&s_platforms[wii]=on&s_platforms[vcon]=on&s_platforms[wiiware]=on&genrelogic=OR&ggenres[all]=on&release_year=any&orderby=dls&s_order=DESC&search_type=advanced&s=" & $trailersName, 1)
Else
Local $trailersHTML = InetRead("http://www.gametrailers.com/search.php?" & "page=" & ($searchPage * 10) & "&" & "platlogic=OR&s_platforms[wii]=on&s_platforms[vcon]=on&s_platforms[wiiware]=on&genrelogic=OR&ggenres[all]=on&release_year=any&orderby=dls&s_order=DESC&search_type=advanced&s=" & $trailersName, 1)
EndIf
$trailersHTML = BinaryToString($trailersHTML)
$trailersHTML = StringRegExpReplace($trailersHTML, '[\r\n\t]', " ")
$trailersHTML = StringRegExpReplace($trailersHTML, '(?i)<script.*?>.*?</script>', "")
FileWrite($Trailersfile, $trailersHTML)
EndFunc   ;==>_GetTrailersSource


Func _splitInfo($Mainstring, $Childstring, $ReturnT = 0)
$Arraystring = StringRegExp($Mainstring, $Childstring, 3)
If IsArray($Arraystring) Then
If UBound($Arraystring) - 1 > 1 Then
EndIf
If $ReturnT = 0 Then
Return $Arraystring
Else
Return StringRegExpReplace($Arraystring[0], '  ', '')
EndIf
Else
Return ""
EndIf
EndFunc   ;==>_splitInfo

Func _ResizePic($PicFile, $PicW, $PicH)
Global $Gui
Dim $ReturnData[3]
Local $BTNImage = _GDIPlus_ImageLoadFromFile($PicFile)
Local $BTNImageW = _GDIPlus_ImageGetWidth($BTNImage)
Local $BTNImageH = _GDIPlus_ImageGetHeight($BTNImage)
$graphicsRes = _GDIPlus_GraphicsCreateFromHWND($Gui)
$BitmapRes = _GDIPlus_BitmapCreateFromGraphics($PicW, $PicH, $graphicsRes)
$GraphicRes = _GDIPlus_ImageGetGraphicsContext($BitmapRes)
_GDIPlus_GraphicsDrawImageRect($GraphicRes, $BTNImage, 0, 0, $PicW, $PicH)
_GDIPlus_ImageDispose($BTNImage)
_GDIPlus_GraphicsDispose($graphicsRes)
_GDIPlus_GraphicsDispose($GraphicRes)

$ReturnData[0] = $BitmapRes
$ReturnData[1] = $BTNImageW
$ReturnData[2] = $BTNImageH
_GDIPlus_ImageSaveToFile($BitmapRes, $PicFile)
_GDIPlus_BitmapDispose($BitmapRes)
;Return $ReturnData
EndFunc   ;==>_ResizePic

;=============================================Func Part============================
; _HTML_GetText / _HTML_GetSource / __HTML_Filter created by Thorsten Willert
Func _HTML_GetSource($sURL)
Local $sHTML = InetRead($sURL, 1)
If @error Then Return SetError(@error, @extended, "")
$sHTML = BinaryToString($sHTML)
$sHTML = StringRegExpReplace($sHTML, '[\r\n\t]', " ")
$sHTML = StringRegExpReplace($sHTML, '(?i)<script.*?>.*?</script>', "")
Return $sHTML
EndFunc   ;==>_HTML_GetSource

Func _HTML_GetText($sHTML, $sTag, $sValue = "", $sAttribute = "id", $iIndex = 0, $iFilter = 30)

Local $sE1

If $sValue And $sAttribute Then
$iIndex = $iIndex * 2 + 1
$sE1 = '(?i)<' & $sTag & '\s+.*?' & $sAttribute & '\s*=\s*("|''|)' & __HTML_Search($sValue) & '\1.*?>(.*?)</' & $sTag & '>'
Else
$sE1 = '(?i)<' & $sTag & '.*?>(.*?)</' & $sTag & '>'
EndIf

ConsoleWrite("_HTML_GetText: " & $sE1 & @CRLF)

Local $r = StringRegExp($sHTML, $sE1, 3)
If @error = 2 Then
ConsoleWriteError("_HTML_GetText: Error in expression: " & $sE1 & @CRLF)
Return SetError(1, 0, "")
EndIf

Local $iE = UBound($r)
If $iE = 0 Or $iIndex >= $iE Then Return SetError(1, 0, "")
If $iFilter Then __HTML_Filter($r[$iIndex], $iFilter)
Return $r[$iIndex]
EndFunc   ;==>_HTML_GetText

Func __HTML_Filter(ByRef $sString, $iMode = 0)
If $iMode = 0 Then Return $sString
;16 simple HTML tag / entities converter
If $iMode >= 16 And $iMode < 32 Then
Local $aEntities[96][2] = [[""", 34],["&", 38],["<", 60],[">", 62],[" ", 3],[" ", 32] _
,["¡", 161],["¢", 162],["£", 163],["¤", 164],["¥", 165],["¦", 166] _
,["§", 167],["¨", 168],["©", 169],["ª", 170],["¬", 172],["­", 173] _
,["®", 174],["¯", 175],["°", 176],["±", 177],["²", 178],["³", 179] _
,["´", 180],["µ", 181],["¶", 182],["·", 183],["¸", 184],["¹", 185] _
,["º", 186],["»", 187],["¼", 188],["½", 189],["¾", 190],["¿", 191] _
,["À", 192],["Á", 193],["Ã", 195],["Ä", 196],["Å", 197],["Æ", 198] _
,["Ç", 199],["È", 200],["É", 201],["Ê", 202],["Ì", 204],["Í", 205] _
,["Î", 206],["Ï", 207],["Ð", 208],["Ñ", 209],["Ò", 210],["Ó", 211] _
,["Ô", 212],["Õ", 213],["Ö", 214],["×", 215],["Ø", 216],["Ù", 217] _
,["Ú", 218],["Û", 219],["Ü", 220],["Ý", 221],["Þ", 222],["ß", 223] _
,["à", 224],["á", 225],["â", 226],["ã", 227],["ä", 228],["å", 229] _
,["æ", 230],["ç", 231],["è", 232],["é", 233],["ê", 234],["ë", 235] _
,["ì", 236],["í", 237],["î", 238],["ï", 239],["ð", 240],["ñ", 241] _
,["ò", 242],["ó", 243],["ô", 244],["õ", 245],["ö", 246],["÷", 247] _
,["ø", 248],["ù", 249],["ú", 250],["û", 251],["ü", 252],["þ", 254]]
$sString = StringRegExpReplace($sString, '(?i)<p.*?>', @CRLF & @CRLF)
$sString = StringRegExpReplace($sString, '(?i)
', @CRLF)
Local $iE = UBound($aEntities) - 1
For $x = 0 To $iE
$sString = StringReplace($sString, $aEntities[$x][0], Chr($aEntities[$x][1]), 0, 2)
Next
For $x = 32 To 255
$sString = StringReplace($sString, "&#" & $x & ";", Chr($x))
Next
$iMode -= 16
EndIf
;8 Tag filter
If $iMode >= 8 And $iMode < 16 Then
;$sString = StringRegExpReplace($sString, '<script.*?>.*?</script>', "")
$sString = StringRegExpReplace($sString, "<[^>]*>", @CRLF)
$iMode -= 8
EndIf
; 4 remove all double cr, lf
If $iMode >= 4 And $iMode < 8 Then
$sString = StringRegExpReplace($sString, "([ \t]*[\n\r]+[ \t]*)", @CRLF)
$sString = StringRegExpReplace($sString, "[\n\r]+", @CRLF)
$iMode -= 4
EndIf
; 2 remove all double withespaces
If $iMode = 2 Or $iMode = 3 Then
$sString = StringRegExpReplace($sString, "[[:blank:]]+", " ")
$sString = StringRegExpReplace($sString, "\n[[:blank:]]+", @CRLF)
$sString = StringRegExpReplace($sString, "[[:blank:]]+\n", "")
$iMode -= 2
EndIf
; 1 remove all non ASCII
If $iMode = 1 Then
$sString = StringRegExpReplace($sString, "[^\x00-\x7F]", " ")
EndIf

Return $sString
EndFunc   ;==>__HTML_Filter

@[member ='error'] in code box means @error
- Select button and download button are fixed (only source code)


ncdv14.png


Changelog:
* ADDED
- More Game info
* Some fixes

Download (Nand covers Downloader) NCD V1.4 & Source code & Test Nand http://www.mediafire.com/?b8z021p92842gol
 

spayrosam

Well-Known Member
OP
Member
Joined
Jun 2, 2009
Messages
756
Trophies
0
Location
Gafsa
Website
Visit site
XP
309
Country
nand-emu
download title covers for the nand-emu (Download HQ/Front/3D/Disc with windows)
If the software does not exist, i'll write it
Planned Future:
- show title name and ID
- Covers Lang
- Show title Type and Region
Another idea..
 

Lucif3r

Well-Known Member
Member
Joined
Sep 10, 2011
Messages
1,468
Trophies
0
XP
228
Country
Um..... what?
Sounds more like you want to download covers for games......... like pretty much every usb loader do...
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
Pretty sure he wants a Windows based manager for channels installed on a virtual NAND (e.g. for use with *NEEK or Tiiforce or something) that can download covers from the internet to display in said manager.
 

JoostinOnline

Certified Crash Test Dummy
Member
Joined
Apr 2, 2011
Messages
11,005
Trophies
1
Location
The Twilight Zone
Website
www.hacksden.com
XP
4,338
Country
United States
Pretty sure he wants a Windows based manager for channels installed on a virtual NAND (e.g. for use with *NEEK or Tiiforce or something) that can download covers from the internet to display in said manager.
From now on your job is to translate what spayrosam says, lol.
 

spayrosam

Well-Known Member
OP
Member
Joined
Jun 2, 2009
Messages
756
Trophies
0
Location
Gafsa
Website
Visit site
XP
309
Country
;)
Idea
1- choose Lang
2- Load Nand
3- Download all covers (if the choosen Cover Lang does not exist, download another Lang (the most covers are in FR Lang))
4- Done

Edit:
100 lines of code:)
 

Lucif3r

Well-Known Member
Member
Joined
Sep 10, 2011
Messages
1,468
Trophies
0
XP
228
Country
Whaaaaaaaaaaaaaaaaaat?
Im sorry but Im really trying here.... What the FUCK are you talking about? Try to at least put SOME effort writing in an understandable language.
Theres no point posting... whatever it is youre posting... when noone understands you and have to guess wtf youre on about.
 

JoostinOnline

Certified Crash Test Dummy
Member
Joined
Apr 2, 2011
Messages
11,005
Trophies
1
Location
The Twilight Zone
Website
www.hacksden.com
XP
4,338
Country
United States
Whaaaaaaaaaaaaaaaaaat?
Im sorry but Im really trying here.... What the FUCK are you talking about? Try to at least put SOME effort writing in an understandable language.
Theres no point posting... whatever it is youre posting... when noone understands you and have to guess wtf youre on about.
He wants to make a program that searches a NAND dump for all installed channels, then downloads covers for each of them so they can be used with Triforce or something.
 

shortz1994

Well-Known Member
Member
Joined
Jan 21, 2011
Messages
1,340
Trophies
0
XP
369
Country
United States
from what i'm reading, syro want's some thing like what wiiflow has. were you download all the covers for games.
to *neeks. not sure but doesn't joyflow already do this. or you can just transfer the game covers over from the folder the game covers are stored for usb loading.( wiiflow,cfg an/or gx).
why not get crapp to work on *neeks, that would be better, cause then you wouldn't need cover, you could just launch from a channel. instead of the overlay, that works when it wants to.(atleast on my end.)
 
  • Like
Reactions: 1 person

Hielkenator

Well-Known Member
Member
Joined
Feb 7, 2010
Messages
4,210
Trophies
0
XP
679
Country
Netherlands
I'd assume this is for people who don't have wifi or a LAN connection for their Wii.

Wiibackupmanager, cfg configurator etc can download all cover for the games you have on your HDD if your Wii is not connected to your network.

When your Wii is connected all avaiable inmages can be downloaded from the various loaders from the standard game tdb.
 

Hielkenator

Well-Known Member
Member
Joined
Feb 7, 2010
Messages
4,210
Trophies
0
XP
679
Country
Netherlands
Not for channels in an emunand.

So basicly he wants to make a cover download app only for emuchannels and for people that have their Wii offline?
.......
some people might be happy with such a thing, but mind that a lot of covers are unavailable.
I wish someone invested some time into showing the official banner upon loading the games.....
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • K3Nv2 @ K3Nv2:
    @Sicklyboy, $150 isn't that bad for a jtag slim on ebay
  • Veho @ Veho:
    I only wish it was actually playable.
  • Veho @ Veho:
    There's a guy on the Tube of You that makes playable mechanical arcade games out of Lego. This could work on the same principle.
  • Veho @ Veho:
    Just a couple of guys taking their manatee out for some fresh air, why you have to molest them?
  • Veho @ Veho:
    Stupid Chinese shop switched their shipping company and this one is slooooooow.
  • LeoTCK @ LeoTCK:
    STOP BUYING CHINESE CRAP THEN
  • LeoTCK @ LeoTCK:
    SUPPORT LOCAL PRODUCTS, MAKE REVOLUTION
  • LeoTCK @ LeoTCK:
    THEY KEEP REMOVING LOCAL SHIt AND REPLACING WItH INFERIOR CHINESE CRAP
  • LeoTCK @ LeoTCK:
    THATS WHY MY PARTNER CANT GET A GOOTWEAR HIS SIZE ANYMORE
  • LeoTCK @ LeoTCK:
    HE HAS BIG FOOT AND BIG DUCK
  • LeoTCK @ LeoTCK:
    d*ck i mean*
  • LeoTCK @ LeoTCK:
    lol
  • Veho @ Veho:
    Mkay.
  • Veho @ Veho:
    I just ordered another package from China just to spite you.
  • SylverReZ @ SylverReZ:
    Communism lol
  • SylverReZ @ SylverReZ:
    OUR products
  • The Real Jdbye @ The Real Jdbye:
    @LeoTCK actually good quality products are dying out because they can't compete with dropshipped chinese crap
    +2
  • BakerMan @ BakerMan:
    @LeoTCK is your partner the sascrotch or smth?
  • Xdqwerty @ Xdqwerty:
    Good morning
  • Xdqwerty @ Xdqwerty:
    Out of nowhere I got several scars on my forearm and part of my arm and it really itches.
  • AdRoz78 @ AdRoz78:
    Hey, I bought a modchip today and it says "New 2040plus" in the top left corner. Is this a legit chip or was I scammed?
    AdRoz78 @ AdRoz78: Hey, I bought a modchip today and it says "New 2040plus" in the top left corner. Is this a legit...