Jump to content

GuiCombo - Flag


Delta01
 Share

Recommended Posts

Hey,

Well I'm making a script that has a radio which you select 3 different options, each creating a new GUI and deleting the old one. I need to record what the last option in the Combobox was before it got changed (deleted)

I tired using an .ini file, flags etc.

Below is some of my code, when I try to save it using the ini file it only records it once, then stops.

While 1
        If GuiCtrlRead($Chars) = $Character1 AND GuiCtrlRead($Client1) = $GUI_CHECKED Then
            IniWrite($inifile, "Settings", "Client1", "Char1")
            EndIf
            If GuICtrlRead($Chars) = $Character2 AND GuiCtrlRead($Client1) = $GUI_CHECKED Then
            IniWrite($inifile, "Settings", "Client1", "Char2")
            EndIf
            If GuiCtrlRead($Chars) = $Character3 AND GuiCtrlRead($Client1) = $GUI_CHECKED Then
            IniWrite($inifile, "Settings", "Client1", "Char3")
            EndIf
[ . . . ]

    If GuiCtrlRead($Client1) = $GUI_CHECKED Then
        If $Flag1 = 1 Then
            C2Save() ;saves values
            C3Save() ;saves values
            If GuiCtrlRead($MoreClient1) = $GUI_CHECKED Then $MoreWhat = 1 ;decides which secondary tab to use
            If GuiCtrlRead($MoreClient2) = $GUI_CHECKED Then $MoreWhat = 2 ;decides which secondary tab to use
            If GuiCtrlRead($MoreClient3) = $GUI_CHECKED Then $MoreWhat = 3 ;decides which secondary tab to use
            GuiDelete($Main)
            C1MainTab() ;Makes the first tab in the gui
            If $MoreWhat = 1 Then C1MoreTab()
            If $MoreWhat = 2 Then C2MoreTab()
            If $MoreWhat = 2 Then C3MoreTab()
            ControlClick("AFK_Weaponchanger", "",  3, "left", 1, 67, 8)
            ControlClick("AFK_Weaponchanger", "",  3, "left", 1, 22, 7)     
            C1Save() ;saves all the other values
            $Flag1 = 2
            $Flag2 = 1
            $Flag3 = 1
            GuiCtrlSetState($Client1, $GUI_CHECKED)
            GuiCtrlSetState($MoreClient1, $GUI_CHECKED)
        EndIf
[ . . . ]

Yes, it reads in .ini file before making the GUI

If you need more code tell me, and please help me out.

Link to comment
Share on other sites

As far as I can tell it should work. Any suggestions?

Here is another part of the code:

$Client1Char = IniRead($inifile, "Settings", "Client1", "")
If $Client1Char = "Char1" Then
$Chars = GuiCtrlCreateCombo($Character1, 20, 70, 150, 20, $CBS_DROPDOWNLIST)
GuiCtrlSetData($Chars, $Character3 & "|" & $Character2)
EndIf
If $Client1Char = "Char2" Then
$Chars = GuiCtrlCreateCombo($Character2, 20, 70, 150, 20, $CBS_DROPDOWNLIST)
GuiCtrlSetData($Chars, $Character3 & "|" & $Character1)
EndIf
If $Client1Char = "Char3" Then
$Chars = GuiCtrlCreateCombo($Character3, 20, 70, 150, 20, $CBS_DROPDOWNLIST)
GuiCtrlSetData($Chars, $Character2 & "|" & $Character1)
EndIf
Edited by Delta01
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...