<header>	
	<var vMapProvTemp=1>	
	<var vMapSwitchTmp=1>
</header>

<state st_MapChanger>
	<uselayer ui_Header/>
	<uselayer ui_Background/>
    	<uselayer ui_Title/>
    	<uselayer ui_Footer/>
	<uselayer ui_MapChanger/>
	<uselayer ui_bottom/>
	<script init>  
	  	Title.SET "Map Changer"	
;mod MB ajout
	  	Title2.SET "Map Changer"	
	</script>

	<script done>
	</script>
</state>

<script d_MapChangerInit override>
	NEXTSTATE st_MapChanger
</script>

<script sc_dj_change_maps>
    	vMapProvTemp.SET $1
	run 'INITMESSAGEBOX 2 "NOTE:\n Program will be restarted for changes to take effect." sc_dj_change_maps_set'
</script>

<script sc_dj_change_maps_set>
	run sc_dj_change_provider vMapProvTemp 
</script>

<script sc_dj_change_provider>
	runif $1 1 'GETSYSENTRY "1" "switchmap" "" vMapSwitchTmp'
	else_runif $1 2 'GETSYSENTRY "2" "switchmap" "" vMapSwitchTmp'

	runif vMapSwitchTmp "" sc_TimeredPrevState
	termif vMapSwitchTmp ""

	GETSYSENTRY "changer" "switchmap" "Extension\MapChanger\MapChanger.exe" vMapChanger
	vMapProvider.SET vMapProvTemp
	START_APPLICATION vMapChanger vMapSwitchTmp
20	run 'START_APPLICATION "Extension\Restart.exe" ""'
</script>

<script sc_TimeredPrevState>
	10 PREVSTATE
</script>

