config.ini editor

  • #1, by NigecMonday, 08. October 2012, 12:55 12 years ago
    I've made a little config.ini editor It can detect the vis file and the game exe, and uses drop down to alter values I'll post a link shortly

    Key Killer

    627 Posts


  • #2, by afrlmeMonday, 08. October 2012, 13:25 12 years ago
    The lazy mans approach razz

    Should be useful for anyone who doesn't know how to edit .ini files manually with notepad++ or something similar.

    Is it a standalone editor? - if so it could be adapted like one of the old dos settings menus you ran to setup your game before first run no!?

    Imperator

    7278 Posts

  • #3, by NigecMonday, 08. October 2012, 13:57 12 years ago
    Yes its standalone, it would be possible to make the GUI cutomizerable so its more of a launcher

    I've never looked into whether Visionaire's player had and command line options

    Its written with AutoIt, really simple language to learn, its a bit like Action Script 2 and C basic

    the code is like (the script the tool uses)

    [code] #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Config Utility", 615, 316, -1, -1) GUISetBkColor(0x000000) $Label1 = GUICtrlCreateLabel("Vis File", 10, 32, 56, 22) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xFFFF00) $Label2 = GUICtrlCreateLabel("Game EXE", 10, 56, 78, 22) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xFFFF00) $Label3 = GUICtrlCreateLabel("FullScreen", 10, 80, 81, 22) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xFFFF00) $Label4 = GUICtrlCreateLabel("Resolution", 10, 104, 81, 22) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xFFFF00) $Label5 = GUICtrlCreateLabel("Intro", 10, 128, 39, 22) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xFFFF00) $Label6 = GUICtrlCreateLabel("Language", 10, 152, 76, 22) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xFFFF00) $Label7 = GUICtrlCreateLabel("Log Level", 10, 176, 74, 22) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xFFFF00) $Label8 = GUICtrlCreateLabel("Music Volume", 10, 200, 104, 22) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xFFFF00) $Label9 = GUICtrlCreateLabel("Sound Volume", 10, 224, 107, 22) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xFFFF00) $Label10 = GUICtrlCreateLabel("Speech Volume", 10, 248, 116, 22) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xFFFF00) $Label11 = GUICtrlCreateLabel("Save", 10, 272, 148, 22) GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") GUICtrlSetColor(-1, 0xFFFF00) $Edit1 = GUICtrlCreateEdit("", 360, 16, 233, 241) GUICtrlSetData(-1, "") $Visfile = GUICtrlCreateInput("", 185, 32, 121, 21) $exefile = GUICtrlCreateInput("", 185, 56, 121, 21) $Screenres = GUICtrlCreateCombo("Yes", 185, 80, 121, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Yes|No") $res = GUICtrlCreateCombo("Auto", 185, 104, 121, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Auto|Desktop|Game") $intro = GUICtrlCreateCombo("Yes", 185, 128, 121, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Yes|no") $loglev = GUICtrlCreateCombo("Error", 185, 176, 121, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Info|Warning|Error") $musicv = GUICtrlCreateInput("100", 185, 200, 121, 21) $soundv = GUICtrlCreateInput("100", 185, 224, 121, 21) $speechv = GUICtrlCreateInput("100", 185, 248, 121, 21) $Button1 = GUICtrlCreateButton("save", 185, 272, 75, 25) $lang = GUICtrlCreateInput("", 185, 152, 121, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ; Shows the filenames of all files in the current directory. Local $search = FileFindFirstFile("*.vis") Local $search2 = FileFindFirstFile("*.exe") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern")

    EndIf If $search2 = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern")

    EndIf

    While 1 Local $file = FileFindNextFile($search) Local $file2 = FileFindNextFile($search2) If $file2 = "configtool.exe" Then

    Local $file2 = FileFindNextFile($search2) EndIf If @error Then ExitLoop

    GUICtrlSetData ($Visfile, $file) FileClose($search)

    GUICtrlSetData ($exefile, $file2)

    FileClose($search2)

    WEnd

    ; Close the search handle

    While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit

    Case $Edit1 Case $Visfile Case $exefile Case $Screenres Case $res Case $intro Case $loglev Case $musicv Case $soundv Case $speechv Case $lang Case $Button1

    $read1 = GUICtrlRead( $Visfile) $read2 = GUICtrlRead( $Screenres) $read3 = GUICtrlRead( $res) $read4 = GUICtrlRead( $intro) $read5 = GUICtrlRead( $loglev) $read6 = GUICtrlRead( $musicv) $read7 = GUICtrlRead( $soundv) $read8 = GUICtrlRead( $speechv) $read9 = GUICtrlRead( $lang) $line1 = "FILE = "& $read1 & @CRLF $line2 ="FULLSCREEN = " & $read2& @CRLF $line3 ="RESOLUTION = " & $read3& @CRLF $line4 ="INTRO = " & $read4& @CRLF $line5 ="LANGUAGE = " & $read9& @CRLF $line6 ="LOGLEVEL = " & $read5 &@CRLF $line7 ="MusicVolume = " & $read6 &@CRLF $line8 ="SoundVolume = " & $read7 &@CRLF $line9 ="SpeechVolume = " & $read8 &@CRLF $text = $line1 &$line2 &$line3 &$line4 & $line5 & $line6 & $line7 & $line8 & $line9 GUICtrlSetData($Edit1, $text) ; Set the edit control to have our new data! MsgBox(4096, "", "Config Data Written ") $read2 = GUICtrlRead($Edit1) $file = FileOpen( "config.ini", 10) ; which is similar to 2 + 8 (erase + create dir)

    FileWrite($file, $read2) FileClose($file) MsgBox(4096, "", "Saved " &"config.ini") If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") EndIf $ExitDialog = MsgBox(36, "Are You Sure?", "Run Game?") If $ExitDialog = 6 Then $Game = GUICtrlRead($exefile) ShellExecute($Game)

    EndIf

    EndSwitch WEnd

    [/code]

    Key Killer

    627 Posts

  • #4, by NigecMonday, 08. October 2012, 13:58 12 years ago
    it would help if it didn't have the smilies lol

    Key Killer

    627 Posts

  • #5, by NigecMonday, 08. October 2012, 14:05 12 years ago
    Here's the link: Just add the configtool.exe to the game folder where the player exe is http://dl.dropbox.com/u/26539256/configtool.zip

    Key Killer

    627 Posts

  • #6, by afrlmeMonday, 08. October 2012, 14:28 12 years ago
    Cheers - I will have a look at it wink

    Customizable launcher would be really useful for people with shitty laptops/pc's to change res / graphics options before launching the game as I've come across many a game that launched in default hi-res / best graphic settings & then had to spend 5 minutes getting into options to choose lower res & graphics (walking dead / vessel etc)

    Imperator

    7278 Posts

  • #7, by afrlmeMonday, 08. October 2012, 14:49 12 years ago
    Works fine! ***

    tested it on the glenfx demo. should probably make it self close after clicking "launch game". & maybe consider hiding the project & exe file data ... & a advanced options section for the error log option.

    Aside from that - it's all good wink

    (p.s tried editing this to my last post but it doesn't seem to want to save/update)

    Imperator

    7278 Posts

  • #8, by NigecMonday, 08. October 2012, 15:08 12 years ago
    The text area, Vis and exe names don't need to the there, its more to visually see that an exe and vis were found and the config.ini was going to be right, the various messages could also go. I could do a control key to active whether the debug and logo appear, so its a developers option, and auto close is easy

    I can't save edits either hence my two extra posts wink

    Key Killer

    627 Posts

  • #9, by afrlmeMonday, 08. October 2012, 15:24 12 years ago
    sounds good smile

    logo & dev info would go on an about section via file menu > about or on a tab.

    yep vis/exe should be hidden but log options should be shown if you check a checkbox or click a (forgotten name of it) arrow thingy that slides sections up/down. - bloody memory is terrible.

    Just keep a confirm message & let it launch game straight after or have an checkbox option for if it should launch after save?

    Imperator

    7278 Posts

  • #10, by NigecMonday, 08. October 2012, 15:45 12 years ago
    the easy way to have a logo is an image that has a common name ie logo.jpg in the folder with the game, it'll automatically load, same with an about discription could be a text file. Making it customizable would be harder as it would need a editable source and re compile

    a save or launch checkbox is easy, I love checkboxes lol

    thanks for the input mate smile

    Key Killer

    627 Posts

  • #11, by afrlmeMonday, 08. October 2012, 16:26 12 years ago
    welcomes smile

    ahh you mean the icon on the top left?

    seeing as AutoIT is a free program we can use your code to compile our own launch menus & just add credits on it for you seeing as you've done the hard work wink

    Seeing as the

     thingy isn't nulling emoticons :P 

    upload a txt file or something with the finished code wink

    Imperator

    7278 Posts