Cloudsx Posted March 9, 2006 Posted March 9, 2006 (edited) here is the script where i want to place the mine iron and cash expandcollapse popup#include <GUIConstants.au3> $main_GUI = GUICreate("game",350,400); will create a dialog box that when displayed is centered GUISetState (@SW_SHOW); will display an empty dialog $Cash = iniread("Resources.ini", "Resources", "Cash",0) $iron = iniread("Resources.ini", "Resources", "iron",0) $ederuim = iniread("Resources.ini", "Resources", "ederuim",0) $electricity = iniread("Resources.ini", "Resources", "electricity",0) GUICtrlCreatePic("Cash.jpg",25,10,20,20) $label_Cash = GuiCtrlCreateLabel($Cash,50,15) GUICtrlCreatePic("iron.jpg",115,10,20,20) $label_Iron = GUICtrlCreateLabel($iron,140,15) GUICtrlCreatePic("ederuim.jpg",200,10,20,20) $label_ederuim = GUICtrlCreateLabel($ederuim,225,15) GUICtrlCreatePic("electricity.jpg",275,10,20,20) $label_electricity = GUICtrlCreateLabel($electricity, 300,15) Opt("GUICoordMode",4) $gebouwen = GUICtrlCreateButton("gebouwen",290,100,60) $militair = GUICtrlCreateButton("militair",290,125,60) $voertuigen = GUICtrlCreateButton("voertuigen",290,150,60) $onderzoek = GUICtrlCreateButton("onderzoek",290,175,60) $verdediging = GUICtrlCreateButton("verdediging",290,200,61) $overzicht = GUICtrlCreateButton("overzicht",290,225,60) While 1 $msg = GUIGetMsg($main_GUI) If $msg = $GUI_EVENT_CLOSE Then If WinActive("game") then Exit If WinActive("gebouwen") then GUIDelete($2) If WinActive("militair") then GUIDelete($3) if WinActive("voertuigen") then GUIDelete($4) If WinActive("onderzoek") then GUIDelete($5) If WinActive("verdediging") then GUIDelete($6) If WinActive("overzicht") then GUIDelete($7) EndIf if $msg = $gebouwen Then GUI2Create() If $msg = $militair then Gui3create() if $msg = $voertuigen then Gui4create() If $msg = $onderzoek then Gui5create() If $msg = $verdediging then gui6create() If $msg = $overzicht then Gui7create() Wend Global $Cash = 2500, $Iron = 500 func GUI2Create() If WinExists("gebouwen") then Return 0 $2 = GUICreate("gebouwen",350,600) ;Cash Fabriek;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUICtrlCreateGroup ("Cash fabriek (lvl:"&iniread("Resources.ini", "Buildings", "cash",0)&")", 0, 0, 300, 75) GUICtrlCreatePic("cash_factory.gif",5,15,50,50) GUICtrlCreateLabel("Bouw een cash fabriek om geld te maken", 60, 15, 150,30) $radio_cash=GUICtrlCreateRadio ( "Bouw (Cash: 100) (Iron: 50)", 60, 50, 150, 15) ;Iron fabriek;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUICtrlCreateGroup ("Iron fabriek (lvl:"&iniread("Resources.ini","Buildings","Iron",0)&")" ,0,80,300,75) GUICtrlCreateLabel("Bouw iron fabriek om Iron te maken",60,100,150,30) $radio_Iron=GUICtrlCreateRadio("Bouw (Cash: 50) (Iron: 150)",60,135,150,15) ;ederuim fabriek;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUICtrlCreateGroup("ederuim mijn (lvl: "&IniRead("Resources.ini","Buildings","ederuim",0)&")" ,0,160,300,75) GUICtrlCreateLabel("Bouw een ederuim mijn om ederuim te krijgen",60,180,150,30) $radio_ederuim=GUICtrlCreateRadio("Bouw (Cash: 250) (Iron: 100)",60,215,170,15) ;electricity;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUICtrlCreateGroup ("electricity (lvl:"&iniread("Resources.ini","Buildings","electricity",0)&")" ,0,240,300,75) GUICtrlCreateLabel("Bouw electricity fabriek om stroom te leveren",60,270,150,30) $radio_Iron=GUICtrlCreateRadio("Bouw (Cash: 100) (Iron: 100)",60,290,170,15) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $button_bouw = GUICtrlCreateButton("Bouw", 1,550,50,25) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg($2) If $msg = $GUI_EVENT_CLOSE Then GUIDelete($2) reload_ini() ExitLoop EndIf If $msg = $button_bouw Then if GUICtrlRead ($radio_cash) = $GUI_CHECKED Then $Cash = $Cash-100 $Iron = $Iron-50 IniWrite ("Resources.ini", "Buildings", "cash", iniread("Resources.ini", "Buildings", "cash",0)+1) EndIf if GUICtrlRead ($radio_Iron) = $GUI_CHECKED Then $Cash = $cash-50 $Iron = $Iron-150 IniWrite ("Resources.ini", "Buildings", "iron", iniread("Resources.ini", "Buildings", "iron",0)+1) EndIf if GUICtrlRead ($radio_ederuim) = $GUI_CHECKED Then $Cash = $cash-250 $Iron = $Iron-100 IniWrite ("Resources.ini", "Buildings", "ederuim", iniread("Resources.ini", "Buildings", "ederuim",0)+1) EndIf GUIDelete($2) reload_ini() ExitLoop EndIf WEnd EndFunc Func Gui3create() If WinExists("militair") then Return $3 = GUICreate("militair",350,400) GUISetState (@SW_SHOW) EndFunc Func Gui4create() If WinExists("voertuigen") then Return $4 = GUICreate("voertuigen",350,400) GUISetState (@SW_SHOW) EndFunc Func gui5create() If WinExists("onderzoek") then Return $5 = GUICreate("onderzoek",350,400) GUISetState (@SW_SHOW) EndFunc Func gui6create() If WinExists("verdediging") then Return $6 = GUICreate("verdediging",350,400) GUISetState (@SW_SHOW) EndFunc Func gui7create() If WinExists("overzicht") then Return $7 = GUICreate("overzicht",350,400) GUISetState (@SW_SHOW) EndFunc Func reload_ini() GUICtrlSetData ($label_Cash, $Cash) GUICtrlSetData ($label_Iron, $iron) GUICtrlSetData ($label_ederuim, $ederuim) GUICtrlSetData ($label_electricity, $electricity) IniWrite ("Resources.ini", "Resources", "Cash", $Cash) IniWrite ("Resources.ini", "Resources", "iron", $iron) IniWrite ("Resources.ini", "Resources", "ederuim", $ederuim) IniWrite ("Resources.ini", "Resources", "electricity", $electricity) EndFunc plaese help me because i can't come any futher en aub help my JdeB Edited March 9, 2006 by Cloudsx
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now