Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <File.au3>
- #include <Array.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <Color.au3>
- #include <ListViewConstants.au3>
- #include <GuiListView.au3>
- #include <ListboxConstants.au3>
- #include <EditConstants.au3>
- ;=========================
- Local $bodypartsArray[10] = ["BodyL","BodyR","EquipL","EquipR","EyeL","EyeR","HeadL","HeadR","Mane","Tail"]
- ;=========================
- ;file exists checks
- If FileExists(@ScriptDir) Then
- ; :)
- Else
- error("Program directory could not be found",1) ;o.o how does that even work??
- EndIf
- $selfd = @ScriptDir
- If FileExists($selfd&"\resources") Then
- ; :)
- Else
- error("Resource directory could not be found",1)
- EndIf
- $resd = $selfd&"\resources"
- SplashImageOn("", $resd&"\logo.jpg", 300,300, -1, -1,1)
- If FileExists($resd&"\temp") Then
- ; :)
- Else
- error("Temp storage folder could not be found",1)
- EndIf
- $tempd = $resd&"\temp"
- If FileExists($selfd&"\scripts") Then
- ; :)
- Else
- error("scripts folder could not be found",1)
- EndIf
- $scriptsd = $selfd&"\scripts"
- ClearAllLayers() ;replaced with only the finest function technology xD
- $filey = $tempd&"\layers\sse.txt"
- if FileExists($filey) Then
- FileDelete($filey)
- EndIf
- FileWriteLine($filey,"0")
- FileWriteLine($filey,"0")
- FileWriteLine($filey,"0")
- FileWriteLine($filey,"0")
- ;------------
- ;defaults
- If FileExists($resd&"\defaults") Then
- ; :)
- Else
- error("Defaults could not be found",1) ;what kinda person would delete it!! D:
- EndIf
- $defd = $resd&"\defaults"
- If FileExists($defd&"\d_options.cfg") Then
- ; :)
- Else
- error("Defaults could not be found",1)
- EndIf
- ;------------
- If FileExists($resd&"\clipboard") Then
- ; :)
- Else
- error("Clipboard could not be found",1)
- EndIf
- $cboard = $resd&"\clipboard"
- If FileExists($resd&"\options.cfg") Then
- ; :)
- Else
- FileCopy($defd&"\d_options.cfg", $resd&"\options.cfg")
- EndIf
- $opsdf = $defd&"\d_options.cfg"
- ;=========================
- $opsf = $resd&"\options.cfg"
- Local $ops
- _FileReadToArray($opsf, $ops)
- $opss = UBound($ops)
- If $opss >= 3 Then
- ; :)
- Else
- error("Failed to load options",1)
- EndIf
- Local $opsd
- _FileReadToArray($opsdf, $opsd)
- $opsds = UBound($opsd)
- If $opsds >= 3 Then
- ; :)
- Else
- error("Failed to load default options",1)
- EndIf
- ;=========
- Sleep(3000)
- SplashOff()
- ;=========
- $fhdir = $ops[1]
- If FileExists($fhdir) Then
- ; :)
- Else
- $fhdir = "C:\"
- EndIf
- $fhdir = FileSelectFolder("Feral Heart directory:", "C:\",0,$fhdir)
- ;=========
- ;FH dir validation
- If FileExists($fhdir) Then
- ; :)
- Else
- error("Invalid Feral Heart directory",1)
- EndIf
- If FileExists($fhdir&"\my_presets") Then
- ; :)
- Else
- error("Failed to find 'my_presets' directory",1)
- EndIf
- $fhpresetsdir = $fhdir&"\my_presets"
- ;============
- SaveOptions($fhdir,"default")
- ;=========
- ;== Gui ==
- ;=========
- $GuiWin = GUICreate("Feral Heart Preset Maker V.2.0", 820, 300,-1,-1) ; before save & load buttons 720,270
- ;== Basic ==
- GUICtrlCreateLabel("Basic",55,1,70,22,$SS_CENTER)
- GUICtrlSetFont(-1,14,-1,4)
- GUICtrlCreateLabel("Select preset slot:",1,25,110,22,$SS_CENTER)
- GUICtrlSetFont(-1,10)
- $prsslotlst = GUICtrlCreateList("", 50,40, 100, 70,$WS_VSCROLL)
- GUICtrlSetFont(-1,10)
- $resetprsbttn = GUICtrlCreateButton("Reset", 50, 110, 100, 30)
- GUICtrlSetFont(-1,13,600)
- $snewtfbasicbttn = GUICtrlCreateButton("Select new texutures(folder)", 10, 160, 170, 30)
- GUICtrlSetFont(-1,10)
- $changeprsbttn = GUICtrlCreateButton("Change", 25, 210, 140, 50)
- GUICtrlSetFont(-1,15,600)
- $saveprsbttn = GUICtrlCreateButton("Save", 35, 270, 50, 25)
- GUICtrlSetFont(-1,13,600)
- $loadprsbttn = GUICtrlCreateButton("Load", 100, 270, 55, 25)
- GUICtrlSetFont(-1,13,600)
- ;=========
- ;== Advanced ==
- GUICtrlCreateLabel("Advanced",280,1,100,22,$SS_CENTER)
- GUICtrlSetFont(-1,14,-1,4)
- $singlesidechk = GUICtrlCreateCheckbox("Single Side Editing", 400, 5, 150, 20)
- GUICtrlSetFont(-1,10)
- GUICtrlCreateLabel("Body part:",200,25,110,15,$SS_CENTER)
- GUICtrlSetFont(-1,10)
- $bodypartslst = GUICtrlCreateList("", 220,40, 100, 70)
- GUICtrlSetFont(-1,10)
- Local $size = UBound($bodypartsArray)
- for $i = 0 to $size-1
- GUICtrlSetData($bodypartslst,$bodypartsArray[$i])
- Next
- $bpprevimg = GUICtrlCreatePic("",325,25, 100,100)
- GUICtrlCreateLabel("Layers:",190,115,110,15,$SS_CENTER)
- GUICtrlSetFont(-1,10)
- $layerslst = GUICtrlCreateList("", 220,130, 100, 70,$WS_VSCROLL)
- $addlayerbttn = GUICtrlCreateButton("Add Layer", 220, 240, 100, 20)
- GUICtrlSetFont(-1,10)
- $removelayerbttn = GUICtrlCreateButton("Remove Layer", 220, 260, 100, 20)
- GUICtrlSetFont(-1,10)
- $savelayerbttn = GUICtrlCreateButton("Save Layer", 220, 280, 100, 20)
- GUICtrlSetFont(-1,10)
- $layerupbttn = GUICtrlCreateButton("^", 240, 200, 30, 20)
- $layerdownbttn = GUICtrlCreateButton("V", 275, 200, 30, 20)
- $layercopybttn = GUICtrlCreateButton("Copy", 220, 220, 50, 20)
- $layerpastebttn = GUICtrlCreateButton("Pase", 270, 220, 50, 20)
- GUICtrlSetFont(-1,10)
- GUICtrlCreateLabel("Ambient:",425,45,55,15,$SS_CENTER)
- GUICtrlSetFont(-1,10)
- $ambin1 = GUICtrlCreateInput("1.000000", 485,40,70,25)
- GUICtrlSetFont(-1,10)
- $ambin2 = GUICtrlCreateInput("1.000000", 565,40,70,25)
- GUICtrlSetFont(-1,10)
- $ambin3 = GUICtrlCreateInput("1.000000", 645,40,70,25)
- GUICtrlSetFont(-1,10)
- $ambin4 = GUICtrlCreateInput("1.000000", 725,40,70,25)
- GUICtrlSetFont(-1,10)
- GUICtrlCreateLabel("Diffuse:",425,80,55,15,$SS_CENTER)
- GUICtrlSetFont(-1,10)
- $diff1 = GUICtrlCreateInput("1.000000", 485,75,70,25)
- GUICtrlSetFont(-1,10)
- $diff2 = GUICtrlCreateInput("1.000000", 565,75,70,25)
- GUICtrlSetFont(-1,10)
- $diff3 = GUICtrlCreateInput("1.000000", 645,75,70,25)
- GUICtrlSetFont(-1,10)
- $diff4 = GUICtrlCreateInput("1.000000", 725,75,70,25)
- GUICtrlSetFont(-1,10)
- GUICtrlCreateLabel("Specular:",425,115,55,15,$SS_CENTER)
- GUICtrlSetFont(-1,10)
- $spec1 = GUICtrlCreateInput("0.050000", 485,110,70,25)
- GUICtrlSetFont(-1,10)
- $spec2 = GUICtrlCreateInput("0.050000", 565,110,70,25)
- GUICtrlSetFont(-1,10)
- $spec3 = GUICtrlCreateInput("0.050000", 645,110,70,25)
- GUICtrlSetFont(-1,10)
- $spec4 = GUICtrlCreateInput("1.000000", 725,110,70,25)
- GUICtrlSetFont(-1,10)
- GUICtrlCreateLabel("Emissive:",425,150,55,15,$SS_CENTER)
- GUICtrlSetFont(-1,10)
- $emit1 = GUICtrlCreateInput("0.000000", 485,145,70,25)
- GUICtrlSetFont(-1,10)
- $emit2 = GUICtrlCreateInput("0.000000", 565,145,70,25)
- GUICtrlSetFont(-1,10)
- $emit3 = GUICtrlCreateInput("0.000000", 645,145,70,25)
- GUICtrlSetFont(-1,10)
- $emit4 = GUICtrlCreateInput("1.000000", 725,145,70,25)
- GUICtrlSetFont(-1,10)
- $scrollanimchk = GUICtrlCreateLabel("Scroll Anim:", 470, 185, 90, 30)
- GUICtrlSetFont(-1,10)
- $scrollaniminx = GUICtrlCreateInput("0", 550, 185, 40, 20)
- GUICtrlSetFont(-1,10)
- $scrollaniminy = GUICtrlCreateInput("0", 590, 185, 40, 20)
- GUICtrlSetFont(-1,10)
- $rotateaniminchk = GUICtrlCreateLabel("Rotate Anim:", 640, 185, 90, 30)
- GUICtrlSetFont(-1,10)
- $rotateanimin = GUICtrlCreateInput("0", 730, 185, 40, 20)
- GUICtrlSetFont(-1,10)
- $sellaytxttxt = GUICtrlCreateInput("", 320, 240, 200, 20,BitOR($ES_AUTOHSCROLL,$ES_READONLY))
- GUICtrlSetFont(-1,10)
- $sellaytxtbttn = GUICtrlCreateButton("Select Layer texture", 320, 220, 200, 20)
- GUICtrlSetFont(-1,10)
- GUICtrlCreateLabel("-By JBRWolf",630,1,100,22,$SS_CENTER)
- GUICtrlSetFont(-1,10,-1,4)
- $scriptslbl = GUICtrlCreateLabel("Scripts:", 540, 235, 50, 30)
- GUICtrlSetFont(-1,10)
- $scriptslst = GUICtrlCreateListView("Scripts ", 595, 210, 100, 90,$LVS_NOCOLUMNHEADER);GUICtrlCreateList("", 595, 210, 100, 90,$WS_VSCROLL)
- $addscriptbttn = GUICtrlCreateButton("Add Script(s)", 700, 225, 110, 20)
- GUICtrlSetFont(-1,10)
- $removescriptbttn = GUICtrlCreateButton("Remove Script(s)", 700, 250, 110, 20)
- GUICtrlSetFont(-1,10)
- ;=========
- GUISetState(@SW_SHOW)
- ;=========
- ;=========
- ;=========
- Local $preslotsrl = ScanFolder($fhpresetsdir)
- $size = UBound($preslotsrl)
- $curpnum = 0
- If $size >0 Then
- For $i = 0 to UBound($preslotsrl) -1
- For $i2 = 0 to $size -1
- If $preslotsrl[$i2] == "reference" Then
- ;nuhhh xD
- Else
- $trimmed = StringTrimLeft($preslotsrl[$i2],7)
- ;MsgBox(0,"",$trimmed)
- If $trimmed == String($curpnum) Then
- GUICtrlSetData($prsslotlst, $preslotsrl[$i2]&"|")
- EndIf
- EndIf
- Next
- $curpnum += 1
- Next
- Else
- error("No preset slots found in the 'my_presets' folder", 1)
- EndIf
- ;=========
- ;=========
- ;=========
- ;=========
- ;== Main ==
- ;=========
- $lastselectedpart = ""
- $lastselectedlayer = ""
- $lastselectedpart2 = ""
- $prevselblast = ""
- $lastchk = $GUI_UNCHECKED
- While 1
- $msg = GUIGetMsg()
- If $msg == "" Then
- ;Save it doing other if checks
- Else
- If $msg == $GUI_EVENT_CLOSE Then ExitLoop
- If $msg == $resetprsbttn Then
- $selected = GUICtrlRead($prsslotlst)
- If $selected == "" Then
- error("No slot selected",0)
- Else
- $useranswer = InputBox("Reset?", "Are you sure you want to remove everything in "&$selected&" and reset it to the default?(Type 'yes' to confirm)")
- if $useranswer == "yes" Then
- ClearFolder($fhpresetsdir&"\"&$selected)
- $tempmatdir = $tempd&"\tempmat.txt"
- If FileExists($tempmatdir) Then
- FileDelete($tempmatdir)
- EndIf
- FileWriteLine($tempmatdir,"material "&$selected&"_bodyMatL")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"technique")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"pass")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture_unit")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture "&$selected&"body.jpg")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"material "&$selected&"_bodyMatR")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"technique")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"pass")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture_unit")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture "&$selected&"body.jpg")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"material "&$selected&"_headMatL")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"technique")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"pass")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture_unit")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture "&$selected&"head.jpg")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"material "&$selected&"_headMatR")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"technique")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"pass")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture_unit")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture "&$selected&"head.jpg")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"material "&$selected&"_eyeMatL")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"technique")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"pass")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture_unit")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture "&$selected&"eye.jpg")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"material "&$selected&"_eyeMatR")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"technique")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"pass")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture_unit")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture "&$selected&"eye.jpg")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"material "&$selected&"_tailMat")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"technique")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"pass")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture_unit")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture "&$selected&"tail.jpg")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"material "&$selected&"_maneMat")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"technique")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"pass")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"lighting off")
- FileWriteLine($tempmatdir,"cull_hardware none")
- FileWriteLine($tempmatdir,"cull_software none")
- FileWriteLine($tempmatdir,"cull_hardware one")
- FileWriteLine($tempmatdir,"scene_blend alpha_blend")
- FileWriteLine($tempmatdir,"depth_write off")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture "&$selected&"mane.png")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"material "&$selected&"_equipMatL")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"technique")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"pass")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture_unit")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture "&$selected&"equip.jpg")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"material "&$selected&"_equipMatR")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"technique")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"pass")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture_unit")
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"texture "&$selected&"equip.jpg")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- FileCopy($tempmatdir, $fhpresetsdir&"\"&$selected&"\"&$selected&".material")
- If FileExists($tempd&"\tempmat.txt") Then
- FileDelete($tempd&"\tempmat.txt")
- EndIf
- MsgBox(0,"Done","Successfully reset "&$selected)
- Else
- MsgBox(0,"Cancled", "Cancled reseting "&$selected)
- EndIf
- EndIf
- EndIf
- If $msg == $snewtfbasicbttn Then ;NFLU DONE :)
- Local $opsd
- _FileReadToArray($opsf, $opsd)
- ;$opsds = UBound($opsd)
- $lastprediro = $opsd[2]
- If FileExists($lastprediro) Then
- ; :)
- Else
- $lastprediro = "C:\"
- EndIf
- $netfbd = FileSelectFolder("Preset textures directory:", "C:\",0,$lastprediro)
- If FileExists($netfbd) Then
- $newpferror = 1
- $cleared = False
- Local $sizer = UBound($bodypartsArray)
- for $i = 0 to $sizer-1
- $trim = StringRight($bodypartsArray[$i],1)
- $trim = StringLower($trim)
- if $trim == "l" or $trim == "r" Then
- $srchitem = StringTrimRight($bodypartsArray[$i],1)
- Else
- $srchitem = $bodypartsArray[$i]
- EndIf
- $srchitem = StringLower($srchitem)
- $itm = GetFile($netfbd,$srchitem)
- if $itm == "" Then
- ;nupe
- Else
- $newpferror = 0
- If $cleared Then
- ;no
- Else
- $cleared = True
- SaveOptions("default",$netfbd)
- ClearAllLayers()
- $lastselectedpart = ""
- EndIf
- $f = $tempd&"\layers\"&StringLower($bodypartsArray[$i])&"\layer1.txt"
- if FileExists($f) Then
- FileDelete($f)
- EndIf
- FileWriteLine($f,stringRight($itm, 4))
- FileWriteLine($f,$netfbd&"\"&$itm)
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"0.050000")
- FileWriteLine($f,"0.050000")
- FileWriteLine($f,"0.050000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"0.000000")
- FileWriteLine($f,"0.000000")
- FileWriteLine($f,"0.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"0")
- FileWriteLine($f,"0")
- FileWriteLine($f,"0")
- FileWriteLine($f,"[scripts]")
- if stringRight($itm, 4) == ".png" Then
- FileWriteLine($f,"alpha_support")
- EndIf
- EndIf
- Next
- If $newpferror == 1 Then
- error("No textures were found in the folder "&$netfbd,0)
- EndIf
- Else
- error("Folder not found",0)
- EndIf
- EndIf
- If $msg == $addlayerbttn Then
- $selected = GUICtrlRead($bodypartslst)
- If $selected == "" Then
- ;nah
- Else
- $amo = CountFolder($tempd&"\layers\"&StringLower($selected))
- $f = $tempd&"\layers\"&StringLower($selected)&"\layer"&$amo+1&".txt"
- If FileExists($f) Then
- FileDelete($f)
- EndIf
- FileWriteLine($f,"")
- FileWriteLine($f,"")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"0.050000")
- FileWriteLine($f,"0.050000")
- FileWriteLine($f,"0.050000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"0.000000")
- FileWriteLine($f,"0.000000")
- FileWriteLine($f,"0.000000")
- FileWriteLine($f,"1.000000")
- FileWriteLine($f,"0")
- FileWriteLine($f,"0")
- FileWriteLine($f,"0")
- FileWriteLine($f,"[scripts]")
- if GuiCTRLRead($singlesidechk) = $GUI_CHECKED Then
- ;nope
- Else
- $fb = $f
- $side = StringRight(StringLower($selected),1)
- $ori = StringTrimRight(StringLower($selected),1)
- if $side == "l" Then
- $f = $tempd&"\layers\"&$ori&"r"&"\layer"&$amo+1&".txt"
- Else
- $f = $tempd&"\layers\"&$ori&"l"&"\layer"&$amo+1&".txt"
- EndIf
- If FileExists($f) Then
- FileDelete($f)
- EndIf
- If FileExists($fb) Then
- FileCopy($fb,$f)
- EndIf
- EndIf
- $lastselectedpart = ""
- EndIf
- EndIf
- If $msg = $layerupbttn Then
- $selected = GUICtrlRead($bodypartslst)
- If $selected == "" Then
- ;nah
- Else
- $selected2 = GUICtrlRead($layerslst)
- If $selected2 == "" Then
- ;nah
- Else
- $f = $tempd&"\layers\"&StringLower($selected)&"\"&$selected2
- if FileExists($f) Then
- $trim = StringTrimRight($selected2,4)
- $trim2 = StringTrimLeft($trim,5)
- $num = Int($trim2)-1
- $f2 = $tempd&"\layers\"&StringLower($selected)&"\"&"layer"&String($num)&".txt"
- if FileExists($f2) Then
- $copyloc = $tempd&"\layermovetmp.txt"
- if FileExists($copyloc) Then
- FileDelete($copyloc)
- EndIf
- FileCopy($f2,$copyloc)
- FileDelete($f2)
- FileMove($f,$f2)
- FileCopy($copyloc,$f)
- EndIf
- EndIf
- if GuiCTRLRead($singlesidechk) = $GUI_CHECKED Then
- ;nope
- Else
- $side = StringRight(StringLower($selected),1)
- $ori = StringTrimRight(StringLower($selected),1)
- if $side == "l" Then
- $f = $tempd&"\layers\"&$ori&"r"&"\"&$selected2
- $fy = $tempd&"\layers\"&$ori&"r"&"\"
- Else
- $f = $tempd&"\layers\"&$ori&"l"&"\"&$selected2
- $fy = $tempd&"\layers\"&$ori&"l"&"\"
- EndIf
- if FileExists($f) Then
- $trim = StringTrimRight($selected2,4)
- $trim2 = StringTrimLeft($trim,5)
- $num = Int($trim2)-1
- $f2 = $fy&"layer"&String($num)&".txt"
- if FileExists($f2) Then
- $copyloc = $tempd&"\layermovetmp.txt"
- if FileExists($copyloc) Then
- FileDelete($copyloc)
- EndIf
- FileCopy($f2,$copyloc)
- FileDelete($f2)
- FileMove($f,$f2)
- FileCopy($copyloc,$f)
- EndIf
- EndIf
- EndIf
- $lastselectedpart = ""
- EndIf
- EndIf
- EndIf
- If $msg = $layerdownbttn Then
- $selected = GUICtrlRead($bodypartslst)
- If $selected == "" Then
- ;nah
- Else
- $selected2 = GUICtrlRead($layerslst)
- If $selected2 == "" Then
- ;nah
- Else
- $f = $tempd&"\layers\"&StringLower($selected)&"\"&$selected2
- if FileExists($f) Then
- $trim = StringTrimRight($selected2,4)
- $trim2 = StringTrimLeft($trim,5)
- $num = Int($trim2)+1
- $f2 = $tempd&"\layers\"&StringLower($selected)&"\"&"layer"&String($num)&".txt"
- if FileExists($f2) Then
- $copyloc = $tempd&"\layermovetmp.txt"
- if FileExists($copyloc) Then
- FileDelete($copyloc)
- EndIf
- FileCopy($f2,$copyloc)
- FileDelete($f2)
- FileMove($f,$f2)
- FileCopy($copyloc,$f)
- EndIf
- EndIf
- if GuiCTRLRead($singlesidechk) = $GUI_CHECKED Then
- ;nope
- Else
- $side = StringRight(StringLower($selected),1)
- $ori = StringTrimRight(StringLower($selected),1)
- if $side == "l" Then
- $f = $tempd&"\layers\"&$ori&"r"&"\"&$selected2
- $fy = $tempd&"\layers\"&$ori&"r"&"\"
- Else
- $f = $tempd&"\layers\"&$ori&"l"&"\"&$selected2
- $fy = $tempd&"\layers\"&$ori&"l"&"\"
- EndIf
- if FileExists($f) Then
- $trim = StringTrimRight($selected2,4)
- $trim2 = StringTrimLeft($trim,5)
- $num = Int($trim2)+1
- $f2 = $fy&"layer"&String($num)&".txt"
- if FileExists($f2) Then
- $copyloc = $tempd&"\layermovetmp.txt"
- if FileExists($copyloc) Then
- FileDelete($copyloc)
- EndIf
- FileCopy($f2,$copyloc)
- FileDelete($f2)
- FileMove($f,$f2)
- FileCopy($copyloc,$f)
- EndIf
- EndIf
- EndIf
- $lastselectedpart = ""
- EndIf
- EndIf
- EndIf
- If $msg == $removelayerbttn Then
- $selected = GUICtrlRead($bodypartslst)
- If $selected == "" Then
- ;nah
- Else
- $selected2 = GUICtrlRead($layerslst)
- If $selected2 == "" Then
- ;nah
- Else
- $f = $tempd&"\layers\"&StringLower($selected)&"\"&$selected2
- $laf = $tempd&"\layers\"&StringLower($selected)
- $count = CountFolder($laf)
- $trim = StringTrimLeft($selected2,5)
- $trim2 = StringTrimRight($trim,4)
- if FileExists($f) Then
- FileDelete($f)
- EndIf
- if $count > Int($trim2) Then
- Local $layersr = ScanFolder($laf)
- $num = Int($trim2)
- for $i = 0 to UBound($layersr)-1
- for $i2 = 0 to UBound($layersr)-1
- $trimy = StringTrimLeft($layersr[$i2],5)
- $trimy2 = StringTrimRight($trimy,4)
- if Int($trimy2) > Int($trim2) Then
- If String($num) == $trimy2 Then
- $tnum = Int($trimy2)
- FileMove($laf&"\layer"&$trimy2&".txt",$laf&"\layer"&String($tnum-1)&".txt")
- EndIf
- endif
- Next
- $num += 1
- Next
- EndIf
- if GuiCTRLRead($singlesidechk) = $GUI_CHECKED Then
- ;nope
- Else
- $side = StringRight(StringLower($selected),1)
- $ori = StringTrimRight(StringLower($selected),1)
- if $side == "l" Then
- $f = $tempd&"\layers\"&$ori&"r"&"\"&$selected2
- Else
- $f = $tempd&"\layers\"&$ori&"l"&"\"&$selected2
- EndIf
- $laf = $tempd&"\layers\"&$ori&"r"
- $count = CountFolder($laf)
- $trim = StringTrimLeft($selected2,5)
- $trim2 = StringTrimRight($trim,4)
- if FileExists($f) Then
- FileDelete($f)
- EndIf
- if $count > Int($trim2) Then
- Local $layersr2 = ScanFolder($laf)
- $num = Int($trim2)
- for $i = 0 to UBound($layersr2)-1
- for $i2 = 0 to UBound($layersr2)-1
- $trimy = StringTrimLeft($layersr2[$i2],5)
- $trimy2 = StringTrimRight($trimy,4)
- if Int($trimy2) > Int($trim2) Then
- If String($num) == $trimy2 Then
- $tnum = Int($trimy2)
- FileMove($laf&"\layer"&$trimy2&".txt",$laf&"\layer"&String($tnum-1)&".txt")
- EndIf
- endif
- Next
- $num += 1
- Next
- EndIf
- EndIf
- $lastselectedpart = ""
- EndIf
- EndIf
- EndIf
- if $msg == $sellaytxtbttn Then
- Local $opsd
- _FileReadToArray($opsf, $opsd)
- $opsds = UBound($opsd)
- $lastprediro = $opsd[2]
- If FileExists($lastprediro) Then
- ; :)
- Else
- $lastprediro = "C:\"
- EndIf
- $txtfl = FileOpenDialog("Texture:", $lastprediro, "Supported Images(*.jpg;*.png)|JPEG (*.jpg*)|PNG (*.png*)")
- If FileExists($txtfl) Then
- GUICtrlSetData($sellaytxttxt,$txtfl)
- $exten = StringRight($txtfl,4)
- if $exten == ".png" Then
- Local $itmss = lvGetItms($scriptslst)
- $size = UBound($itmss)
- $there = False
- for $izzi = 0 to $size-1
- If $itmss[$izzi] == "alpha_support" Then
- $there = True
- EndIf
- Next
- if $there Then
- ;nupe
- Else
- GUICtrlCreateListViewItem("alpha_support",$scriptslst)
- EndIf
- Else
- Local $itmss = lvGetItms($scriptslst)
- $size = UBound($itmss)
- $there = False
- $pos = 0
- for $izzi = 0 to $size-1
- If $itmss[$izzi] == "alpha_support" Then
- $there = True
- $pos = $izzi
- EndIf
- Next
- if $there Then
- _GUICtrlListView_DeleteItem(GUICtrlGetHandle($scriptslst),$pos-1)
- EndIf
- EndIf
- Else
- error("Failed to find texture "&$txtfl,0)
- EndIf
- EndIf
- if $msg == $saveprsbttn Then ;NFLU DONE :D
- $dir = $selfd&"\saves"
- if FileExists($dir)Then
- ; :)
- Else
- DirCreate($dir)
- EndIf
- $savenam = InputBox("Save as", "Name:", "Untitled")
- if $savenam == "" Then
- if @error == 1 Then
- error("Cancled saving",0)
- Else
- error("Invalid input",0)
- EndIf
- Else
- $spath = $dir&"\"&$savenam
- $cango = 0
- if FileExists($spath) Then
- $useranswer = InputBox("Overwrite?", "Are you sure you want to over write the file '"&$savenam&"'(Type 'yes' to confirm)")
- if $useranswer == "yes" Then
- FileDelete($spath)
- $cango =1
- Else
- error("Cancled saving",0)
- EndIf
- Else
- $cango = 1
- EndIf
- If $cango == 1 Then
- $savefileout = DirCreate($spath)
- if $savefileout == 1 Then
- $saveerror = 0
- $lpath = $spath&"\layers"
- FCreateO($lpath)
- Local $sizer = UBound($bodypartsArray)
- for $i = 0 to $sizer-1
- FCreateO($lpath&"\"&StringLower($bodypartsArray[$i]))
- Next
- for $i = 0 to $sizer-1
- existsavee($tempd&"\layers\"&StringLower($bodypartsArray[$i]),$lpath&"\"&StringLower($bodypartsArray[$i]))
- Next
- $pathyy = $tempd&"\layers\sse.txt"
- $pathii = $spath&"\layers\sse.txt"
- if FileExists($pathyy) Then
- if FileExists($pathii) Then
- FileDelete($pathii)
- EndIf
- FileCopy($pathyy,$pathii)
- EndIf
- if $saveerror == 0 Then
- MsgBox(0,"Success","Layer information saved successfully :)")
- Else
- error("Error whilst saving layer data, some data may have not been saved",0)
- EndIf
- Else
- error("Failed to save",0)
- EndIf
- EndIf
- EndIf
- EndIf
- if $msg == $loadprsbttn Then ;NFLU DONE :DD
- $dir = $selfd&"\saves"
- if FileExists($dir) Then
- $lopath = FileSelectFolder("Load file:", $dir,0)
- if FileExists($lopath) Then
- $useranswer = InputBox("Load?", "Are you sure you want to load the save '"&$lopath&"' and replace your current layers?(Type 'yes' to confirm)")
- if $useranswer == "yes" Then
- $loaderror = 0
- $lpath = $lopath&"\layers"
- Local $sizer = UBound($bodypartsArray)
- for $i = 0 to $sizer-1
- existloade($lpath&"\"&StringLower($bodypartsArray[$i]),$tempd&"\layers\"&StringLower($bodypartsArray[$i]))
- Next
- $pathyy = $tempd&"\layers\sse.txt"
- $pathii = $lopath&"\layers\sse.txt"
- if FileExists($pathii) Then
- if FileExists($pathyy) Then
- FileDelete($pathyy)
- EndIf
- FileCopy($pathii,$pathyy)
- EndIf
- if $loaderror == 0 Then
- $lastselectedpart = ""
- MsgBox(0,"Success","Layer information loaded successfully :)")
- Else
- error("Error whilst loading layer data, some data may have not been loaded",0)
- EndIf
- Else
- error("Cancled loading",0)
- EndIf
- Else
- error("Failed to load",0)
- EndIf
- Else
- error("Failed to find saves folder",0)
- EndIf
- EndIf
- If $msg == $savelayerbttn Then ;NFLU NOTICE: Not really, just needs updating for codescodes update ;#CODESUPDATE
- $selected = GUICtrlRead($bodypartslst)
- If $selected == "" Then
- ;nah
- Else
- $selected2 = GUICtrlRead($layerslst)
- If $selected2 == "" Then
- ;nah
- Else
- $f = $tempd&"\layers\"&StringLower($selected)&"\"&$selected2
- $loc = GUICtrlRead($sellaytxttxt)
- If FileExists($loc) Then
- if FileExists($f) Then
- FileDelete($f)
- EndIf
- $type = StringRight($loc,4)
- FileWriteLine($f,$type)
- FileWriteLine($f,$loc)
- FileWriteLine($f,GUICtrlRead($ambin1))
- FileWriteLine($f,GUICtrlRead($ambin2))
- FileWriteLine($f,GUICtrlRead($ambin3))
- FileWriteLine($f,GUICtrlRead($ambin4))
- FileWriteLine($f,GUICtrlRead($diff1))
- FileWriteLine($f,GUICtrlRead($diff2))
- FileWriteLine($f,GUICtrlRead($diff3))
- FileWriteLine($f,GUICtrlRead($diff4))
- FileWriteLine($f,GUICtrlRead($spec1))
- FileWriteLine($f,GUICtrlRead($spec2))
- FileWriteLine($f,GUICtrlRead($spec3))
- FileWriteLine($f,GUICtrlRead($spec4))
- FileWriteLine($f,GUICtrlRead($emit1))
- FileWriteLine($f,GUICtrlRead($emit2))
- FileWriteLine($f,GUICtrlRead($emit3))
- FileWriteLine($f,GUICtrlRead($emit4))
- FileWriteLine($f,GUICtrlRead($scrollaniminx))
- FileWriteLine($f,GUICtrlRead($scrollaniminy))
- FileWriteLine($f,GUICtrlRead($rotateanimin))
- FileWriteLine($f,"[scripts]")
- Local $scrps = lvGetItms($scriptslst)
- $siz = UBound($scrps)
- for $i = 1 To $siz-1
- FileWriteLine($f, $scrps[$i])
- Next
- if GuiCTRLRead($singlesidechk) = $GUI_CHECKED Then
- ;nope
- Else
- $fb = $f
- $side = StringRight(StringLower($selected),1)
- $ori = StringTrimRight(StringLower($selected),1)
- if $side == "l" Then
- $f = $tempd&"\layers\"&$ori&"r"&"\"&$selected2
- Else
- $f = $tempd&"\layers\"&$ori&"l"&"\"&$selected2
- EndIf
- If FileExists($f) Then
- FileDelete($f)
- EndIf
- If FileExists($fb) Then
- FileCopy($fb,$f)
- EndIf
- EndIf
- MsgBox(0,"Saved","Layer saved successfully",2)
- Else
- error("Could not find texture.",0)
- EndIf
- ;$lastselectedpart = ""
- ;$lselectedlayer = ""
- EndIf
- EndIf
- EndIf
- If $msg == $layercopybttn Then
- $selected = GUICtrlRead($bodypartslst)
- If $selected == "" Then
- ;nah
- Else
- $selected2 = GUICtrlRead($layerslst)
- If $selected2 == "" Then
- ;nah
- Else
- $f = $tempd&"\layers\"&StringLower($selected)&"\"&$selected2
- if FileExists($f) Then
- $cf = $cboard&"\layer.txt"
- if FileExists($cf) Then
- FileDelete($cf)
- EndIf
- FileCopy($f,$cf)
- MsgBox(0,"Copied","Copied layer successfully",0.3)
- EndIf
- EndIf
- EndIf
- EndIf
- if $msg = $layerpastebttn Then
- $selected = GUICtrlRead($bodypartslst)
- If $selected == "" Then
- ;nah
- Else
- $f = $tempd&"\layers\"&StringLower($selected)&"\"
- $csource = $cboard&"\layer.txt"
- if FileExists($f) Then
- If FileExists($csource) Then
- $amo = CountFolder($f)
- $fc = $f&"\layer"&String($amo+1)&".txt"
- if FileExists($fc) Then
- FileDelete($fc)
- EndIf
- FileCopy($csource,$fc)
- if GuiCTRLRead($singlesidechk) = $GUI_CHECKED Then
- ;nope
- Else
- $side = StringRight(StringLower($selected),1)
- $ori = StringTrimRight(StringLower($selected),1)
- if $side == "l" Then
- $f = $tempd&"\layers\"&$ori&"r"&"\"
- Else
- $f = $tempd&"\layers\"&$ori&"l"&"\"
- EndIf
- $amo = CountFolder($f)
- $fc = $f&"\layer"&String($amo+1)&".txt"
- if FileExists($fc) Then
- FileDelete($fc)
- EndIf
- FileCopy($csource,$fc)
- EndIf
- $lastselectedpart = ""
- MsgBox(0,"Success","Layer pasted successfully",0.3)
- Else
- error("Clipboard is empty",0)
- EndIf
- EndIf
- EndIf
- EndIf
- if $msg = $addscriptbttn Then
- $txtfl = FileOpenDialog("Scripts:", $scriptsd, "Text Document(*.txt*)",BitOR($FD_FILEMUSTEXIST,$FD_MULTISELECT))
- Local $txtfls = StringSplit($txtfl,"|")
- $size = UBound($txtfls)
- if $size == 2 Then
- $str = 1
- Else
- $str = 2
- EndIf
- for $ti = $str to $size-1
- If FileExists($txtfls[$ti]) Then
- Local $szDrive, $szDir, $szFName, $szExt
- Local $TestPath = _PathSplit($txtfls[$ti], $szDrive, $szDir, $szFName, $szExt)
- GUICtrlCreateListViewItem($szFName,$scriptslst)
- Else
- error("Failed to find script"&$txtfls[$ti],0)
- EndIf
- Next
- EndIf
- if $msg = $removescriptbttn Then
- _GUICtrlListView_DeleteItemsSelected($scriptslst)
- EndIf
- $selected = GUICtrlRead($layerslst)
- If $selected == $lastselectedlayer or $selected == "" Then
- if $lastselectedlayer == "" Then
- Else
- If $selected == "" Then
- resetLayerGUI()
- $lastselectedlayer = ""
- ;$lastselectedpart2 = $selected2
- EndIf
- EndIf
- ;nope
- Else
- $selected2 = GUICtrlRead($bodypartslst)
- ;error($selected2,0)
- ;error($lastselectedpart,0)
- If $selected2 == $lastselectedpart2 Then
- loadLayer($selected2,$selected)
- $lastselectedlayer = $selected
- $lastselectedpart2 = $selected2
- Else
- resetLayerGUI()
- $lastselectedlayer = ""
- ;error($selected2,0)
- $lastselectedpart2 = $selected2
- EndIf
- EndIf
- $selected = GUICtrlRead($bodypartslst)
- If $selected == $lastselectedpart Then
- ;nope
- Else
- loadLayers($selected)
- chkLoad($selected)
- $lastselectedpart = $selected
- EndIf
- $selected = GUICtrlRead($bodypartslst)
- If $selected == $prevselblast Then
- ;nuh
- Else
- $prevselblast = $selected
- GUICtrlSetImage($bpprevimg,$resd&"\"&StringLower($selected)&".jpg")
- endif
- $sele = GUICtrlRead($singlesidechk)
- $selected = GUICtrlRead($bodypartslst)
- if $sele == $lastchk Then
- Else
- $it = StringLower($selected)
- $sv = "0"
- $lastchk = $sele
- if $sele == $GUI_CHECKED Then
- $sv = "1"
- Else
- $sv = "0"
- EndIf
- Switch $it
- Case "bodyl"
- SaveSSE($sv,"","","")
- Case "bodyr"
- SaveSSE($sv,"","","")
- Case "equipl"
- SaveSSE("",$sv,"","")
- Case "equipr"
- SaveSSE("",$sv,"","")
- Case "eyel"
- SaveSSE("","",$sv,"")
- Case "eyer"
- SaveSSE("","",$sv,"")
- Case "headl"
- SaveSSE("","","",$sv)
- Case "headr"
- SaveSSE("","","",$sv)
- EndSwitch
- EndIf
- if $msg == $changeprsbttn Then ;NFLU, Main one have fun JBR :o this is like time travelling but also sad because you're speaking to yourself o3o ;#CODESUPDATE
- $selectedsl = GUICtrlRead($prsslotlst)
- If $selectedsl == "" Then
- error("No slot selected",0)
- Else
- $useranswer = InputBox("Change?", "Are you sure you want to remove everything in "&$selectedsl&" and replace it with the new textures and material file?(Type 'yes' to confirm)")
- if $useranswer == "yes" Then
- $error = 0
- $cngerr = 1
- $done = 0
- $tempmatdir = ""
- $presetloc = ""
- Local $sizer = UBound($bodypartsArray)
- for $i = 0 to $sizer-1
- $lyrs = ScanFolder($tempd&"\layers\"&StringLower($bodypartsArray[$i]))
- _ArraySort($lyrs)
- $szs = UBound($lyrs)
- If $szs < 2 Then
- ;err
- Else
- $cngerr = 0
- If $done == 0 Then
- $done = 1
- $presetloc = $fhpresetsdir&"\"&$selectedsl
- ClearFolder($presetloc)
- $tempmatdir = $tempd&"\tempmatfin.txt"
- If FileExists($tempmatdir) Then
- FileDelete($tempmatdir)
- EndIf
- EndIf
- $attm = StringRight($bodypartsArray[$i],1)
- $attm = StringLower($attm)
- $single = 0
- $nam = ""
- If $attm == "l" Or $attm == "r" Then
- if StringLower($bodypartsArray[$i]) == "tail" Then
- $nam = $bodypartsArray[$i]
- $attm = ""
- Else
- $nam = StringTrimRight($bodypartsArray[$i],1)
- $single = 1
- EndIf
- Else
- $nam = $bodypartsArray[$i]
- $attm = ""
- EndIf
- $nam = StringLower($nam)
- FileWriteLine($tempmatdir,"material "&$selectedsl&"_"&$nam&"Mat"&StringUpper($attm))
- FileWriteLine($tempmatdir,"{")
- FileWriteLine($tempmatdir,"technique")
- FileWriteLine($tempmatdir,"{")
- For $i2 = 0 to $szs-1
- If $i2 == 0 Then
- ;nuh
- Else
- $read = $tempd&"\layers\"&StringLower($bodypartsArray[$i])&"\"&$lyrs[$i2]
- Local $info
- _FileReadToArray($read, $info)
- $type =$info[1]
- $loc = $info[2]
- If FileExists($loc) Then
- Local $szDrive, $szDir, $szFName, $szExt
- Local $TestPath = _PathSplit($loc, $szDrive, $szDir, $szFName, $szExt)
- if ischecked(StringLower($bodypartsArray[$i])) Then
- $f = $presetloc&"\"&$selectedsl&StringLower($bodypartsArray[$i])&"layer_"&$i2&$szExt
- Else
- $f = $presetloc&"\"&$selectedsl&$nam&"layer_"&$i2&$szExt
- EndIf
- if FileExists($f) Then
- FileDelete($f)
- EndIf
- FileCopy($loc, $f)
- if ischecked(StringLower($bodypartsArray[$i])) Then
- $txtvars = $selectedsl&StringLower($bodypartsArray[$i])&"layer_"&$i2&$szExt
- Else
- $txtvars = $selectedsl&$nam&"layer_"&$i2&$szExt
- EndIf
- $exvars = $szExt
- $pnumvars = StringTrimLeft($selectedsl,7)
- $bpvars = StringLower($bodypartsArray[$i])
- $lnumvars = $i2
- $sidevars = $attm
- $bpsvars = $nam
- Local $s_pass[1]
- Local $s_bpass[1]
- Local $s_tu[1]
- Local $s_a_tu[1]
- Local $scriptslv = lfGetScripts($read)
- $sizei = UBound($scriptslv)
- for $izi = 0 to $sizei-1
- if $scriptslv[$izi] == "" Then
- Else
- $scriptloc = $scriptsd&"\"&$scriptslv[$izi]&".txt"
- if FileExists($scriptloc) then
- scriptRead($scriptloc)
- EndIf
- EndIf
- Next
- FileWriteLine($tempmatdir,"pass")
- FileWriteLine($tempmatdir,"{")
- ;ambient 1.000000 1.000000 1.000000 1.000000
- ;diffuse 1.000000 1.000000 1.000000 1.000000
- ;specular 0.050000 0.050000 0.050000 1.000000
- ;emissive 1.000000 1.000000 1.000000 1.000000
- $sizey = UBound($s_bpass)
- for $iri = 0 to $sizey -1
- $liney = $s_bpass[$iri]
- if $liney == "" Then
- Else
- $liney = InsertVars($liney,$txtvars,$exvars,$pnumvars,$bpvars,$bpsvars,$sidevars,$lnumvars) ;herreee
- FileWriteLine($tempmatdir,$liney)
- EndIf
- Next
- FileWriteLine($tempmatdir,"ambient "&$info[3]&" "&$info[4]&" "&$info[5]&" "&$info[6])
- FileWriteLine($tempmatdir,"diffuse "&$info[7]&" "&$info[8]&" "&$info[9]&" "&$info[10])
- FileWriteLine($tempmatdir,"specular "&$info[11]&" "&$info[12]&" "&$info[13]&" "&$info[14])
- FileWriteLine($tempmatdir,"emissive "&$info[15]&" "&$info[16]&" "&$info[17]&" "&$info[18])
- $sizey = UBound($s_pass)
- for $iri = 0 to $sizey -1
- $liney = $s_pass[$iri]
- if $liney == "" Then
- Else
- $liney = InsertVars($liney,$txtvars,$exvars,$pnumvars,$bpvars,$bpsvars,$sidevars,$lnumvars) ;herreee
- FileWriteLine($tempmatdir,$liney)
- EndIf
- Next
- FileWriteLine($tempmatdir,"texture_unit")
- FileWriteLine($tempmatdir,"{")
- if ischecked(StringLower($bodypartsArray[$i])) Then
- FileWriteLine($tempmatdir,"texture "&$selectedsl&StringLower($bodypartsArray[$i])&"layer_"&$i2&$szExt)
- Else
- FileWriteLine($tempmatdir,"texture "&$selectedsl&$nam&"layer_"&$i2&$szExt)
- EndIf
- if $info[19] == "0" and $info[20] == "0" Then
- ;nope
- Else
- FileWriteLine($tempmatdir,"scroll_anim "&$info[19]&" "&$info[20])
- EndIf
- if $info[21] == "0" Then
- ;nope
- Else
- FileWriteLine($tempmatdir,"rotate_anim "&$info[21])
- EndIf
- $sizey = UBound($s_tu)
- for $iri = 0 to $sizey -1
- $liney = $s_tu[$iri]
- if $liney == "" Then
- Else
- $liney = InsertVars($liney,$txtvars,$exvars,$pnumvars,$bpvars,$bpsvars,$sidevars,$lnumvars) ;herreee
- FileWriteLine($tempmatdir,$liney)
- EndIf
- Next
- FileWriteLine($tempmatdir,"}")
- $sizey = UBound($s_a_tu)
- for $iri = 0 to $sizey -1
- $liney = $s_a_tu[$iri]
- if $liney == "" Then
- Else
- $liney = InsertVars($liney,$txtvars,$exvars,$pnumvars,$bpvars,$bpsvars,$sidevars,$lnumvars) ;herreee
- FileWriteLine($tempmatdir,$liney)
- EndIf
- Next
- FileWriteLine($tempmatdir,"}")
- Else
- If $error == 0 Then
- error("Error loading textures",0)
- $error = 1
- EndIf
- EndIf
- EndIf
- Next
- FileWriteLine($tempmatdir,"}")
- FileWriteLine($tempmatdir,"}")
- EndIf
- Next
- if $cngerr == 1 Then
- error("No textures found",0)
- EndIf
- If $error == 0 Then
- FileCopy($tempmatdir, $fhpresetsdir&"\"&$selectedsl&"\"&$selectedsl&".material")
- If FileExists($tempmatdir) Then
- FileDelete($tempmatdir)
- EndIf
- MsgBox(0,"Done","Successfully changed "&$selectedsl)
- EndIf
- EndIf
- EndIf
- EndIf
- EndIf
- WEnd
- ;=========
- ;=========
- ;=========
- Func loadLayers($part)
- Local $l = $tempd&"\layers\"&StringLower($part)
- Local $layers = ScanFolder($l)
- Local $size = UBound($layers)
- Local $curlnum = 0
- GUICtrlSetData($layerslst, "")
- If $size >0 Then
- For $i = 0 to $size -1
- ;MsgBox(0,"",String($curlnum))
- For $i2 = 0 to $size -1
- Local $trimmed = StringTrimLeft($layers[$i2],5)
- if StringTrimRight($trimmed,4) == String($curlnum) Then
- GUICtrlSetData($layerslst, $layers[$i2]&"|")
- EndIf
- Next
- $curlnum += 1
- Next
- Else
- GUICtrlSetData($layerslst, "")
- EndIf
- EndFunc
- Func loadLayer($part,$layer) ;#CODESUPDATE
- Local $l = $tempd&"\layers\"&StringLower($part)&"\"&$layer
- If FileExists($l) Then
- Local $layerinfo
- _FileReadToArray($l, $layerinfo)
- GUICtrlSetData($sellaytxttxt,$layerinfo[2])
- GUICtrlSetData($ambin1,$layerinfo[3])
- GUICtrlSetData($ambin2,$layerinfo[4])
- GUICtrlSetData($ambin3,$layerinfo[5])
- GUICtrlSetData($ambin4,$layerinfo[6])
- GUICtrlSetData($diff1,$layerinfo[7])
- GUICtrlSetData($diff2,$layerinfo[8])
- GUICtrlSetData($diff3,$layerinfo[9])
- GUICtrlSetData($diff4,$layerinfo[10])
- GUICtrlSetData($spec1,$layerinfo[11])
- GUICtrlSetData($spec2,$layerinfo[12])
- GUICtrlSetData($spec3,$layerinfo[13])
- GUICtrlSetData($spec4,$layerinfo[14])
- GUICtrlSetData($emit1,$layerinfo[15])
- GUICtrlSetData($emit2,$layerinfo[16])
- GUICtrlSetData($emit3,$layerinfo[17])
- GUICtrlSetData($emit4,$layerinfo[18])
- GUICtrlSetData($scrollaniminx,$layerinfo[19])
- GUICtrlSetData($scrollaniminy,$layerinfo[20])
- GUICtrlSetData($rotateanimin,$layerinfo[21])
- lvDelAll($scriptslst)
- Local $scriptslv = lfGetScripts($l)
- $sizei = UBound($scriptslv)
- for $izi = 0 to $sizei-1
- if $scriptslv[$izi] == "" Then
- Else
- GUICtrlCreateListViewItem($scriptslv[$izi],$scriptslst)
- EndIf
- Next
- EndIf
- EndFunc
- Func isTexture($ittxt,$word)
- $exit = stringRight($ittxt, 4)
- $findit = StringInStr($ittxt,$word,0)
- if $findit == 0 Then
- ; o.o
- Else
- if $exit == ".png" or $exit == ".jpg" Then
- return True ;it's a texture!!! :D paty!!
- EndIf
- EndIf
- return False ;de cake is a lie
- EndFunc
- Func error($msg,$crash) ;cuz you're just too lazy to keep writing msgbox and exit :D
- if $crash == 1 Then
- MsgBox(48,"Crash",$msg) ;CRASHHH AHH people gonna freak when day see dis :D hopefully they won't o3o
- Exit
- Else
- MsgBox(48,"Error",$msg) ;ERROR oh noez D:
- EndIf
- EndFunc
- Func SaveOptions($o1,$o2) ;why did I even make this function o.o eh Still need it though bro, don't delete
- Local $opsd2
- _FileReadToArray($opsf, $opsd2)
- If $o1 == "default" Then
- $o1 = $opsd2[1]
- EndIf
- If $o2 == "default" Then
- $o2 = $opsd2[2]
- EndIf
- If FileExists($opsf) Then
- FileDelete($opsf)
- EndIf
- FileWriteLine($opsf,$o1)
- FileWriteLine($opsf,$o2)
- EndFunc
- Func chkLoad($bitm)
- Local $seeo
- $se = $tempd&"\layers\sse.txt"
- $it = StringLower($bitm)
- _FileReadToArray($se, $seeo)
- $check = False
- $num = 0
- Switch $it
- Case "bodyl"
- $num = 1
- Case "bodyr"
- $num = 1
- Case "equipl"
- $num = 2
- Case "equipr"
- $num = 2
- Case "eyel"
- $num = 3
- Case "eyer"
- $num = 3
- Case "headl"
- $num = 4
- Case "headr"
- $num = 4
- Case Else
- $num = 0
- $check = True
- EndSwitch
- if $num == 0 Then
- Else
- if $seeo[$num] == "0" Then
- $check = False
- Else
- $check = True
- EndIf
- EndIf
- if $check Then
- GUICtrlSetState($singlesidechk, $GUI_CHECKED)
- Else
- GUICtrlSetState($singlesidechk, $GUI_UNCHECKED)
- EndIf
- EndFunc
- Func SaveSSE($a,$b,$c,$d) ;why did I even make this function o.o eh Still need it though bro, don't delete
- Local $seeo
- $se = $tempd&"\layers\sse.txt"
- _FileReadToArray($se, $seeo)
- If $a == "" Then
- $a = $seeo[1]
- EndIf
- If $b == "" Then
- $b = $seeo[2]
- EndIf
- If $c == "" Then
- $c = $seeo[3]
- EndIf
- If $d == "" Then
- $d = $seeo[4]
- EndIf
- If FileExists($se) Then
- FileDelete($se)
- EndIf
- FileWriteLine($se,$a)
- FileWriteLine($se,$b)
- FileWriteLine($se,$c)
- FileWriteLine($se,$d)
- EndFunc
- Func GetFile($SourceFolder,$gfwrd) ;dis is a handy dandy function :D
- Local $Search
- Local $File
- Local $FileAttributes
- Local $FullFilePath
- Local $scanfolderarray[1]
- $Search = FileFindFirstFile($SourceFolder & "\*.*")
- Local $result = ""
- While 1
- If $Search = -1 Then
- ExitLoop
- EndIf
- $File = FileFindNextFile($Search)
- If @error Then ExitLoop
- $FullFilePath = $SourceFolder & "\" & $File
- If isTexture($File,$gfwrd) Then
- $result = $File
- ExitLoop
- EndIf
- WEnd
- FileClose($Search)
- Return $result
- EndFunc
- Func ScanFolder($SourceFolder) ;returns an array of the folder items (File name only cuz you have to know the source to import anyway duh)
- Local $Search
- Local $File
- Local $FileAttributes
- Local $FullFilePath
- Local $scanfolderarray[1]
- $Search = FileFindFirstFile($SourceFolder & "\*.*")
- While 1
- If $Search = -1 Then
- ExitLoop
- EndIf
- $File = FileFindNextFile($Search)
- If @error Then ExitLoop
- $FullFilePath = $SourceFolder & "\" & $File
- $FileAttributes = FileGetAttrib($FullFilePath)
- ;If StringInStr($FileAttributes,"D") Then
- _ArrayInsert($scanfolderarray, 1, $File)
- ;EndIf
- WEnd
- FileClose($Search)
- Return $scanfolderarray
- EndFunc
- Func CopyFolderFiles($OldFolder, $NewFolder) ;handy dandy :D
- Local $files = ScanFolder($OldFolder)
- Local $size = UBound($files)
- If $size > 0 Then
- for $iz = 0 to $size-1
- $f = $NewFolder&"\"&$files[$iz]
- If FileExists($f) Then
- FileDelete($f)
- EndIf
- FileCopy($OldFolder&"\"&$files[$iz],$NewFolder) ;de oldy folder is old
- Next
- EndIf
- EndFunc
- Func CountFolder($SourceFolder) ;how many things are in this folder? and no JBR it does not start at 0, get your numbers right xD
- Local $Search
- Local $File
- Local $FileAttributes
- Local $FullFilePath
- Local $count = 0
- $Search = FileFindFirstFile($SourceFolder & "\*.*")
- While 1
- If $Search = -1 Then
- ExitLoop
- EndIf
- $File = FileFindNextFile($Search)
- If @error Then ExitLoop
- $FullFilePath = $SourceFolder & "\" & $File
- $FileAttributes = FileGetAttrib($FullFilePath)
- ;If StringInStr($FileAttributes,"D") Then
- $count += 1
- ;EndIf
- WEnd
- FileClose($Search)
- Return $count
- EndFunc
- Func ClearFolder($SourceFolder) ;bye bye D:
- Local $Search
- Local $File
- Local $FileAttributes
- Local $FullFilePath
- $Search = FileFindFirstFile($SourceFolder & "\*.*")
- While 1
- If $Search = -1 Then
- ExitLoop
- EndIf
- $File = FileFindNextFile($Search)
- If @error Then ExitLoop
- $FullFilePath = $SourceFolder & "\" & $File
- $FileAttributes = FileGetAttrib($FullFilePath)
- If StringInStr($FileAttributes,"D") Then
- ScanFolder($FullFilePath)
- Else
- FileDelete($FullFilePath)
- EndIf
- WEnd
- FileClose($Search)
- EndFunc
- Func FCreateO($fcodir) ;create a dir and remove and creat again if already exists
- if FileExists($fcodir) Then
- FileDelete($fcodir)
- EndIf
- DirCreate($fcodir)
- EndFunc
- Func existloade($a,$b) ;kinda inefficient coding but who's gonna question it :D
- if FileExists($a) AND FileExists($b) Then
- CopyFolderFiles($a,$b)
- Else
- $loaderror = 1
- EndIf
- EndFunc
- Func existsavee($a,$b) ;same as load but save duhh
- if FileExists($a) AND FileExists($b) Then
- CopyFolderFiles($a,$b)
- Else
- $saveerror = 1
- EndIf
- EndFunc
- Func ClearAllLayers() ; :O why dey removing all the layers like that o3o
- Local $size = UBound($bodypartsArray)
- for $i = 0 to $size-1
- ClearFolder($tempd&"\layers\"&StringLower($bodypartsArray[$i]))
- Next
- EndFunc
- Func resetLayerGUI() ;I prefered the default values better, let's reset them! :D
- GUICtrlSetData($sellaytxttxt,"")
- GUICtrlSetData($ambin1,"1.000000")
- GUICtrlSetData($ambin2,"1.000000")
- GUICtrlSetData($ambin3,"1.000000")
- GUICtrlSetData($ambin4,"1.000000")
- GUICtrlSetData($diff1,"1.000000")
- GUICtrlSetData($diff2,"1.000000")
- GUICtrlSetData($diff3,"1.000000")
- GUICtrlSetData($diff4,"1.000000")
- GUICtrlSetData($spec1,"0.050000")
- GUICtrlSetData($spec2,"0.050000")
- GUICtrlSetData($spec3,"0.050000")
- GUICtrlSetData($spec4,"1.000000")
- GUICtrlSetData($emit1,"0.000000")
- GUICtrlSetData($emit2,"0.000000")
- GUICtrlSetData($emit3,"0.000000")
- GUICtrlSetData($emit4,"1.000000")
- GUICtrlSetData($rotateanimin,0)
- GUICtrlSetData($scrollaniminx,0)
- GUICtrlSetData($scrollaniminy,0)
- lvDelAll($scriptslst)
- EndFunc
- Func lvDelAll($lv)
- _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($lv))
- EndFunc
- Func lvGetItms($lv)
- Local $arraytmp[1]
- $len = ControlListView("","",$lv,"GetItemCount")
- for $lvtmi = 0 to $len-1
- Local $txter = ControlListView("","",$lv,"GetText",$lvtmi,0)
- _ArrayAdd($arraytmp,$txter)
- Next
- return $arraytmp
- EndFunc
- Func lfGetScripts($lf)
- If FileExists($lf) Then
- Local $layerinfo
- Local $arraytmp[1]
- Local $strt
- _FileReadToArray($lf, $layerinfo)
- if FileReadLine($lf, 22) == "[scripts]" Then
- $strt = 22
- Else
- $strt = 0
- For $izy = 1 to _FileCountLines($lf)
- $line = FileReadLine($lf, $izy)
- if $izy == "[scripts]" Then
- $strt = $izy
- EndIf
- Next
- EndIf
- If $strt == 0 Then
- Return $arraytmp
- Else
- For $izy = $strt+1 to _FileCountLines($lf)
- $line = FileReadLine($lf, $izy)
- if $line == "" Then
- Else
- _ArrayAdd($arraytmp,$line)
- EndIf
- Next
- Return $arraytmp
- EndIf
- EndIf
- EndFunc
- Func scriptRead($scrpath)
- $section = "NULL"
- For $iyi = 1 to _FileCountLines($scrpath)
- $line = FileReadLine($scrpath, $iyi)
- if $line == "" Then
- ;no
- Else
- if StringLeft($line,9) == "[SECTION]" Then
- $section = StringTrimLeft($line,9)
- Else
- if $section == "NULL" Then
- Else
- Switch $section
- Case "pass"
- _ArrayAdd($s_pass,$line)
- Case "bpass"
- _ArrayAdd($s_bpass,$line)
- Case "tu"
- _ArrayAdd($s_tu,$line)
- Case "a_tu"
- _ArrayAdd($s_a_tu,$line)
- EndSwitch
- EndIf
- EndIf
- EndIf
- Next
- EndFunc
- Func FCap($stringy)
- Local $letteree = StringLeft($stringy,1)
- Local $trimee = StringTrimLeft($stringy,1)
- $letteree = StringUpper($letteree)
- Return $letteree&$trimee
- EndFunc
- Func ECap($stringy)
- Local $letteree = StringRight($stringy,1)
- Local $trimee = StringTrimRight($stringy,1)
- $letteree = StringUpper($letteree)
- Return $trimee&$letteree
- EndFunc
- Func InsertVars($stringer,$texture,$ex,$pnum,$bp,$bps,$sd,$lnum)
- $stringer = StringReplace($stringer,"{pnum}",$pnum)
- $stringer = StringReplace($stringer,"{bp}",$bp)
- Local $lowerbps = StringLower($bps)
- Local $fbps = FCap($bps)
- $stringer = StringReplace($stringer,"{bpc}",$fbps&StringUpper($sd))
- $stringer = StringReplace($stringer,"{bps}",$lowerbps)
- $stringer = StringReplace($stringer,"{bpsc}",$fbps)
- $stringer = StringReplace($stringer,"{sd}",StringLower($sd))
- $stringer = StringReplace($stringer,"{sdc}",StringUpper($sd))
- $stringer = StringReplace($stringer,"{texture}",$texture)
- $stringer = StringReplace($stringer,"{ex}",$ex)
- $stringer = StringReplace($stringer,"{lnum}",$lnum)
- Return $stringer
- EndFunc
- Func ischecked($part)
- Local $seeo
- $se = $tempd&"\layers\sse.txt"
- $it = StringLower($part)
- _FileReadToArray($se, $seeo)
- $check = False
- $num = 0
- Switch $it
- Case "bodyl"
- $num = 1
- Case "bodyr"
- $num = 1
- Case "equipl"
- $num = 2
- Case "equipr"
- $num = 2
- Case "eyel"
- $num = 3
- Case "eyer"
- $num = 3
- Case "headl"
- $num = 4
- Case "headr"
- $num = 4
- Case Else
- $num = 0
- $check = True
- EndSwitch
- if $num == 0 Then
- Else
- if $seeo[$num] == "0" Then
- $check = False
- Else
- $check = True
- EndIf
- EndIf
- Return $check
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement