Hallo Leute!
Ich brauche eure Hilfe! xD .. *Bin ein Anfänger ^^*
Wenn man keine Schrift auswählt kommt ein Fehler beim abspeichern (Save)??
Kann jemand so machen: Automatisch alte Einstellungen übernehmen.. xD*
Hier der Code:
Spoiler anzeigen
#include <GUIConstants.au3>
#include <Misc.au3>
#NoTrayIcon
;--------------------------------------------------------------------------
;Einstellungen
Opt("TrayMenuMode",1)
TraySetState()
TraySetToolTip("Soldat Font Editor")
;--------------------------------------------------------------------------
; Ini Einstellungen
$ort = IniRead("einstellungen.ini", "SPEICHER", "Lesen", "NotFound")
$schreiben = IniRead("einstellungen.ini", "SPEICHER", "Schreiben", "NotFound")
$version = IniRead("version.ini", "VERSION", "Beta", "NotFound")
$plugins = IniRead("plugins.ini", "PLUGINS", "Plugin", "NotFound")
;-------------------------------------------------------------------------
; Ini Einstellungen
$inifont1 = IniRead($ort, "FONTS", "Font1", "NotFound")
$inifont2 = IniRead($ort, "FONTS", "Font2", "NotFound")
;-------------------------------------------------------------------------
; Ini Einstellungen
$inifontmenusize = IniRead($ort, "FONTS", "FontMenuSize", "NotFound")
$inifontconsole = IniRead($ort, "FONTS", "FontConsoleSize", "NotFound")
$inifontbigsize = IniRead($ort, "FONTS", "FontConsoleSize", "NotFound")
$inifontbigbold = IniRead($ort, "FONTS", "FontBigBold", "NotFound")
$inifontconsolesmallsize = IniRead($ort, "FONTS", "FontConsoleSmallSize", "NotFound")
$inifontconsolesmallbold = IniRead($ort, "FONTS", "FontConsoleSmallBold", "NotFound")
$inifontconsolebold = IniRead($ort, "FONTS", "FontConsoleBold", "NotFound")
$inifontweaponmenusize = IniRead($ort, "FONTS", "FontWeaponMenuSize", "NotFound")
$inifontweaponmenubold = IniRead($ort, "FONTS", "FontWeaponMenuBold", "NotFound")
$fontmenubold = IniRead($ort, "FONTS", "FontMenuBold", "NotFound")
$inifontkill = IniRead($ort, "FONTS", "KillConsoleNameSpace", "NotFound")
;--------------------------------------------------------------------------
; Form
#Region ### START Koda GUI section ### Form=C:\Dokumente und Einstellungen\USER\Desktop\[Tenso] Soldat Font Editor\Tenso_Editor.kxf
$Form1 = GUICreate("Soldat Font Editor", 617, 435, 197, 118)
$Label1 = GUICtrlCreateLabel("Font1", 16, 48, 39, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label2 = GUICtrlCreateLabel("Font 2:", 16, 80, 39, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label3 = GUICtrlCreateLabel("Font Menu Size:", 304, 184, 81, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label4 = GUICtrlCreateLabel("Font Console Size:", 16, 224, 93, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label5 = GUICtrlCreateLabel("Font Big Size:", 16, 112, 69, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label6 = GUICtrlCreateLabel("Font Weapon Menu Size:", 304, 48, 121, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label7 = GUICtrlCreateLabel("Font Console Small Size:", 16, 256, 120, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label8 = GUICtrlCreateLabel("Font Menu Bold:", 304, 152, 82, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label9 = GUICtrlCreateLabel("Font Console Bold:", 16, 320, 94, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label10 = GUICtrlCreateLabel("Font Big Bold:", 16, 144, 70, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label11 = GUICtrlCreateLabel("Font Weapon Menu Bold:", 304, 80, 125, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label12 = GUICtrlCreateLabel("Font Console Small Bold:", 16, 288, 121, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label13 = GUICtrlCreateLabel("Kill Console Name Space:", 16, 352, 123, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Input3 = GUICtrlCreateInput($inifontconsole, 160, 224, 121, 21)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Input4 = GUICtrlCreateInput($inifontconsolesmallsize, 160, 256, 121, 21)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label14 = GUICtrlCreateLabel("Font:", 16, 16, 32, 17)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
$Label15 = GUICtrlCreateLabel("Console:", 16, 192, 51, 17)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
$Input5 = GUICtrlCreateInput($inifontconsolesmallbold, 160, 288, 121, 21)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Input6 = GUICtrlCreateInput($inifontconsolebold, 160, 320, 121, 21)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Input7 = GUICtrlCreateInput($inifontkill, 160, 352, 121, 21)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label16 = GUICtrlCreateLabel("Weapon Menu:", 304, 16, 87, 17)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
$Label17 = GUICtrlCreateLabel("Menu:", 304, 120, 38, 17)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
$Input8 = GUICtrlCreateInput($inifontweaponmenusize, 456, 48, 121, 21)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Input9 = GUICtrlCreateInput($inifontweaponmenubold, 456, 80, 121, 21)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Input10 = GUICtrlCreateInput($fontmenubold, 456, 152, 121, 21)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Input11 = GUICtrlCreateInput($inifontmenusize, 456, 184, 121, 21)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Input12 = GUICtrlCreateInput($inifontbigsize, 160, 112, 121, 21)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Input13 = GUICtrlCreateInput($inifontbigbold, 160, 144, 121, 21)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Label18 = GUICtrlCreateLabel("Copyright by Tenso 2007", 472, 400, 125, 17)
GUICtrlSetFont(-1, 8, 400, 2, "Tahoma")
$Save = GUICtrlCreateButton("Save", 408, 296, 129, 33, 0)
$Change = GUICtrlCreateButton("Change", 160, 48, 67, 17, 0)
$Button1 = GUICtrlCreateButton("Change", 160, 80, 67, 17, 0)
$S = GUICtrlCreateButton("Font 1", 56, 48, 50, 17, 0)
$Button2 = GUICtrlCreateButton("Font 2", 56, 80, 50, 17, 0)
$Exit = GUICtrlCreateButton("Exit", 424, 400, 33, 17, 0)
$About = GUICtrlCreateButton("About", 360, 400, 51, 17, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Save
$inifont1 = IniWrite($schreiben, "FONTS", "Font1", $b_font[2])
$inifont2 = IniWrite($schreiben, "FONTS", "Font2", $a_font[2])
$inifontmenusize = IniWrite($schreiben, "FONTS", "FontMenuSize", $inifontmenusize)
$inifontconsole = IniWrite($schreiben, "FONTS", "FontConsoleSize", $inifontconsole)
$inifontbigsize = IniWrite($schreiben, "FONTS", "FontConsoleSize", $inifontbigsize)
$inifontbigbold = IniWrite($schreiben, "FONTS", "FontBigBold", $inifontbigbold)
$inifontconsolesmallsize = IniWrite($schreiben, "FONTS", "FontConsoleSmallSize", $inifontconsolesmallsize)
$inifontconsolesmallbold = IniWrite($schreiben, "FONTS", "FontConsoleSmallBold", $inifontconsolesmallbold)
$inifontconsolebold = IniWrite($schreiben, "FONTS", "FontConsoleBold", $inifontconsolebold)
$inifontweaponmenusize = IniWrite($schreiben, "FONTS", "FontWeaponMenuSize", $inifontweaponmenusize)
$inifontweaponmenubold = IniWrite($schreiben, "FONTS", "FontWeaponMenuBold", $inifontweaponmenubold)
$fontmenubold = IniWrite($schreiben, "FONTS", "FontMenuBold", $fontmenubold)
$inifontkill = IniWrite($schreiben, "FONTS", "KillConsoleNameSpace", $inifontkill)
Case $msg = $Change
$a_font = _ChooseFont($inifont1,
If (@error) Then
MsgBox(0, "", "Error _ChooseFont: " & @error)
Else
MsgBox(0, "", "Font Name: " & $a_font[2])
$a_font_schreiben = IniWrite($schreiben, "FONTS", "Font1", $a_font[2])
EndIf
Case $msg = $Button1
$b_font = _ChooseFont($inifont2,
If (@error) Then
MsgBox(0, "", "Error _ChooseFont: " & @error)
Else
MsgBox(0, "", "Font Name: " & $b_font[2])
$b_font_schreiben = IniWrite($schreiben, "FONTS", "Font1", $b_font[2])
EndIf
Case $msg = $S
MsgBox(4096, "Font1", $inifont1, 10)
Case $msg = $Exit
Exit
Case $msg = $Button2
MsgBox(4096, "Font2", $inifont2, 10)
Case $msg = $About
MsgBox(4096, "About", "Programmierer: Tesno, Version: " & $version, 10)
EndSelect
Wend
INI: einstellungen und version.
INI: font.ini unter Soldat\Txt\