Jump to content

Open a window,... enter language,.. then go on to next window.


Recommended Posts

I already have the second window working,... from line 34 onward ... but now I want to add provisions for French or English,... so I thought I'd bring up a 1st window that asks for French or English ...

then define 6 variables (either in french or english) that are used in the second window ...

Obviously this isn't working ... :bye:

maybe something to do with "on event mode" or "how to gracefully receive input from one window , close it, and open a new window" .. :oops:

Any help is greatly appreciated ... as I can't seem to figure out how to do this.

thanks

Allen

#include <GUIConstantsEx.au3>
Dim $lg1, $lg2, $lg3, $lg4, $lg5, $lg6
Opt("GUIOnEventMode", 1)
$mainwindow = GUICreate("Language Selector", 200, 100)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
$frenchbutton = GUICtrlCreateButton("French ", 50, 30, 50)
$englishbutton = GUICtrlCreateButton("English", 50, 60, 50)
GUICtrlSetOnEvent($frenchbutton, "frenchButton")
GUICtrlSetOnEvent($englishbutton, "englishButton")
GUISetState(@SW_SHOW)
;
;
While 1
  Sleep(1000)  ; Idle around
WEnd
;
;
Func frenchButton()
$lg1 = "Selectionner un eskin Eversion pour votre démo sur le PC:"
$lg2 = "Notes: TRAILERS, APPS & WEATHER ne fontionneront pas"
$lg3 = "       Utilisation (Touches de Navigation), plus (=+) (,<) (Entrée) et (Retour Arrière) dans le eskins."
$lg4 = "Evstreamed (default) "
$lg5 = "evZap! (default) "
EndFunc
;
Func englishButton()
$lg1 = "Please select an Eversion eskin to demo on your PC:"
$lg2 = "Notes: TRAILERS, APPS & WEATHER are non functioning"
$lg3 = "Use (Arrow Keys), plus (=+) (,<) (Enter) and (Backspace) inside eskins."
$lg4 = "Evstreamed (par défaut) "
$lg5 = "evZap! (par défaut) "
EndFunc
;
;
Opt("GUIOnEventMode", 1)
$mainwindow1 = GUICreate("Eversion Eskin Demonstrator", 600, 430)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUICtrlCreateLabel( $lg1, 30, 10)
GUICtrlCreateLabel( $lg2, 30, 30)
GUICtrlCreateLabel( $lg3, 30, 50)
$evstreamedbutton = GUICtrlCreateButton( $lg4, 150, 100, 300)
$evzapbutton = GUICtrlCreateButton( $lg6, 150, 130, 300)
$legionbutton = GUICtrlCreateButton("evZap! w/ legion overlay ", 150, 160, 300)
$legionkeepbutton = GUICtrlCreateButton("evZap! w/ legion overlay w/keepwall ", 150, 190, 300)
$legion2button = GUICtrlCreateButton("evZap! w/ legion2 overlay ", 150, 220, 300)
$legion2keepbutton = GUICtrlCreateButton("evZap! w/ legion2 overlay w/keepwall ", 150, 250, 300)
$legion4button = GUICtrlCreateButton("evZap! w/ legion4 overlay ", 150, 280, 300)
$peoplemodbutton = GUICtrlCreateButton("evZap! w/ People Mod ", 150, 310, 300)
$terranovabutton = GUICtrlCreateButton("terraNOVA ", 150, 340, 300)
$evhellbutton = GUICtrlCreateButton("evHell (box cover) ", 150, 370, 300)
;$frenchbutton = GUICtrlCreateButton("French ", 50, 50, 50)
GUICtrlSetOnEvent($evstreamedbutton, "evstreamedButton")
GUICtrlSetOnEvent($evzapbutton, "evzapButton")
GUICtrlSetOnEvent($legionbutton, "legionButton")
GUICtrlSetOnEvent($legionkeepbutton, "legionkeepButton")
GUICtrlSetOnEvent($legion2button, "legion2Button")
GUICtrlSetOnEvent($legion2keepbutton, "legion2keepButton")
GUICtrlSetOnEvent($legion4button, "legion4Button")
GUICtrlSetOnEvent($peoplemodbutton, "peoplemodButton")
GUICtrlSetOnEvent($terranovabutton, "terranovaButton")
GUICtrlSetOnEvent($evhellbutton, "evhellButton")
;GUICtrlSetOnEvent($frenchbutton, "frenchButton")
GUISetState(@SW_SHOW)
While 1
  Sleep(1000)  ; Idle around
WEnd
Func evstreamedButton()
$done = FileCopy (".\skin_settings\esettings_evstreamed.xml", ".\Jukebox\eversion\settings\esettings.xml", 1)
While  $done = 0
WEnd
ShellExecute(".\Jukebox\eversion.swf")
WinWaitActive("Adobe Flash Player Security")
Send("{ENTER}")
EndFunc
Func evzapButton()
$done = FileCopy (".\skin_settings\esettings_evzap.xml", ".\Jukebox\eversion\settings\esettings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\settings_evzap.xml", ".\Jukebox\evZap\settings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\home.default.control", ".\Jukebox\evZap\home.control", 1)
While  $done = 0
WEnd
ShellExecute(".\Jukebox\eversion.swf")
WinWaitActive("Adobe Flash Player Security")
Send("{ENTER}")
EndFunc
Func legionButton()
$done = FileCopy (".\skin_settings\esettings_evzap.xml", ".\Jukebox\eversion\settings\esettings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\settings_legion.xml", ".\Jukebox\evZap\settings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\home.legion.control", ".\Jukebox\evZap\home.control", 1)
While  $done = 0
WEnd
ShellExecute(".\Jukebox\eversion.swf")
WinWaitActive("Adobe Flash Player Security")
Send("{ENTER}")
EndFunc
Func legionkeepButton()
$done = FileCopy (".\skin_settings\esettings_evzap.xml", ".\Jukebox\eversion\settings\esettings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\settings_legionexp.xml", ".\Jukebox\evZap\settings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\home.legion.control", ".\Jukebox\evZap\home.control", 1)
While  $done = 0
WEnd
ShellExecute(".\Jukebox\eversion.swf")
WinWaitActive("Adobe Flash Player Security")
Send("{ENTER}")
EndFunc
Func legion2Button()
$done = FileCopy (".\skin_settings\esettings_evzap.xml", ".\Jukebox\eversion\settings\esettings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\settings_legion2.xml", ".\Jukebox\evZap\settings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\home.legion.control", ".\Jukebox\evZap\home.control", 1)
While  $done = 0
WEnd
ShellExecute(".\Jukebox\eversion.swf")
WinWaitActive("Adobe Flash Player Security")
Send("{ENTER}")
EndFunc
Func legion2keepButton()
$done = FileCopy (".\skin_settings\esettings_evzap.xml", ".\Jukebox\eversion\settings\esettings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\settings_legion2exp.xml", ".\Jukebox\evZap\settings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\home.legion.control", ".\Jukebox\evZap\home.control", 1)
While  $done = 0
WEnd
ShellExecute(".\Jukebox\eversion.swf")
WinWaitActive("Adobe Flash Player Security")
Send("{ENTER}")
EndFunc
Func legion4Button()
$done = FileCopy (".\skin_settings\esettings_evzap.xml", ".\Jukebox\eversion\settings\esettings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\settings_legion4.xml", ".\Jukebox\evZap\settings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\home.legion.control", ".\Jukebox\evZap\home.control", 1)
While  $done = 0
WEnd
ShellExecute(".\Jukebox\eversion.swf")
WinWaitActive("Adobe Flash Player Security")
Send("{ENTER}")
EndFunc
Func peoplemodButton()
$done = FileCopy (".\skin_settings\esettings_evzap.xml", ".\Jukebox\eversion\settings\esettings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\settings_peoplemod.xml", ".\Jukebox\evZap\settings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".\skin_settings\home.peoplemod.control", ".\Jukebox\evZap\home.control", 1)
While  $done = 0
WEnd
ShellExecute(".\Jukebox\eversion.swf")
WinWaitActive("Adobe Flash Player Security")
Send("{ENTER}")
EndFunc
Func terranovaButton()
$done = FileCopy (".\skin_settings\esettings_terraNOVA.xml", ".\Jukebox\eversion\settings\esettings.xml", 1)
While  $done = 0
WEnd
ShellExecute(".\Jukebox\eversion.swf")
WinWaitActive("Adobe Flash Player Security")
Send("{ENTER}")
EndFunc
Func evhellButton()
ShellExecute(".\evHell\Jukebox\eversion.swf")
WinWaitActive("Adobe Flash Player Security")
Send("{ENTER}")
EndFunc
Func CLOSEClicked()
  ;Note: a cette étape @GUI_CTRLID sera équivalent à $GUI_EVENT_CLOSE,
  ;et @GUI_WINHANDLE sera équivalent à $mainwindow
  ;MsgBox(0, "GUI Event", "Clic pour Fermer! Sortie...")
  Exit
EndFunc
Link to comment
Share on other sites

While $lg1 = ""
Sleep(100) ; Idle around
WEnd

You have to check in this loop if something happened in window 1, in this case, if the variable $lg1 is empty or filled.

Only then you will proceed to the next GUI.

This is a crappy solution, better use a designated global variable.

Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite
Link to comment
Share on other sites

lol its no sorcery, just define a unique global variable eg. $bLangSel = 0 on top of your script.

Then set this variable in both frenchButton() and englishButton() to true.

in the while loop replace

$lg1 = ""

with:

not $bLangSel

Dont get me wrong, this is not necessary, it works now like it is. But only for this task. If you want for example add other buttons with other functions, you would have to set $lg1 to any value just to get to the next gui.

Or if you want to be able to change the language while the 2nd GUI is already open, stuff like that.

Then it would be better not to use while loops but create all GUIs at beginning and use GuiSetState(@SW_SHOW) to show or hide those windows when you need them.

Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite
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...