Browse Source

[fixed] Code Simplification for begin UI

Ethan99 10 months ago
parent
commit
cb5d8065a4
3 changed files with 28 additions and 74 deletions
  1. 4 3
      glife.qproj
  2. 17 71
      locations/begin.qsrc
  3. 7 0
      locations/checkimg.qsrc

+ 4 - 3
glife.qproj

@@ -53,6 +53,7 @@
 		<Location name="homes_properties_attr"/>
 	</Folder>
 	<Folder name="Functions">
+		<Location name="checkimg"/>
 		<Location name="indik"/>
 		<Location name="indiktab"/>
 		<Location name="shortgs"/>
@@ -553,7 +554,7 @@
 		<Location name="anushapt"/>
 		<Location name="anush_bedroom"/>
 		<Location name="anush_bedroom_city"/>
-		<Location name="anushaptbr"/> 
+		<Location name="anushaptbr"/>
 		<Location name="anushkachat"/>
 		<Location name="anushkachat_city"/>
 		<Location name="anushkamaksim"/>
@@ -848,7 +849,7 @@
 		<Location name="music_bedroompractice"/>
 		<Location name="music_onlinemusic"/>
  		<Location name="music_gigstarts"/>
-   		<Location name="music_guitarlesson"/>   
+   		<Location name="music_guitarlesson"/>
    		<Location name="music_buskingevents"/>
 		<Location name="music_delparco"/>
 		<Location name="music_checks"/>
@@ -982,7 +983,7 @@
 		<Location name="cfnm"/>
 		<Location name="stwork"/>
 		<Location name="stwork2"/>
-		<Location name="hookahlounge"/>	
+		<Location name="hookahlounge"/>
 	</Folder>
 	<Folder name="City_Island">
 		<Location name="city_island"/>

+ 17 - 71
locations/begin.qsrc

@@ -31,86 +31,32 @@ if $ARGS[0] = 'start':
 
 	$start_text = '<TD>School</TD>'
 
-	if $start_type = 'sg':
-		$start_text += '<TD><center><img src="images/system/icons/check.png" height="50"></center></TD>'
-	else
-		$start_text += '<TD><center><a href="exec:$start_type = ''sg'' & gt ''begin'', ''start''"><img src="images/system/icons/uncheck.png" height="50"></a></center></TD>'
-	end
-
-	if $start_type = 'sg_m':
-		$start_text += '<TD><center><img src="images/system/icons/check.png" height="50"></center></TD>'
-	else
-		$start_text += '<TD><center><a href="exec:$start_type = ''sg_m'' & gt ''begin'', ''start''"><img src="images/system/icons/uncheck.png" height="50"></a></center></TD>'
-	end
-
-	if $start_type = 'sg_tg':
-		$start_text += '<TD><center><img src="images/system/icons/check.png" height="50"></center></TD><TR>'
-	else
-		$start_text += '<TD><center><a href="exec:$start_type = ''sg_tg'' & gt ''begin'', ''start''"><img src="images/system/icons/uncheck.png" height="50"></a></center></TD><TR>'
-	end
-
-	$start_text += '<TD>City</TD>'
-
-	if $start_type = 'city':
-		$start_text += '<TD><center><img src="images/system/icons/check.png" height="50"></center></TD>'
-	else
-		$start_text += '<TD><center><a href="exec:$start_type = ''city'' & gt ''begin'', ''start''"><img src="images/system/icons/uncheck.png" height="50"></a></center></TD>'
-	end
-
-	if $start_type = 'city_m':
-		$start_text += '<TD><center><img src="images/system/icons/check.png" height="50"></center></TD>'
-	else
-		$start_text += '<TD><center><a href="exec:$start_type = ''city_m'' & gt ''begin'', ''start''"><img src="images/system/icons/uncheck.png" height="50"></a></center></TD>'
-	end
+	$start_text += func('checkimg',$start_type,'sg')
+	$start_text += func('checkimg',$start_type,'sg_m')
+	$start_text += func('checkimg',$start_type,'sg_tg')
 
-	if $start_type = 'city_tg':
-		$start_text += '<TD><center><img src="images/system/icons/check.png" height="50"></center></TD><TR>'
-	else
-		$start_text += '<TD><center><a href="exec:$start_type = ''city_tg'' & gt ''begin'', ''start''"><img src="images/system/icons/uncheck.png" height="50"></a></center></TD><TR>'
-	end
+	$start_text += '<TR><TD>City</TD>'
 
-	$start_text += '<TD>University</TD>'
+	$start_text += func('checkimg',$start_type,'city')
+	$start_text += func('checkimg',$start_type,'city_m')
+	$start_text += func('checkimg',$start_type,'city_tg')
 
-	if $start_type = 'uni':
-		$start_text += '<TD><center><img src="images/system/icons/check.png" height="50"></center></TD>'
-	else
-		$start_text += '<TD><center><a href="exec:$start_type = ''uni'' & gt ''begin'', ''start''"><img src="images/system/icons/uncheck.png" height="50"></a></center></TD>'
-	end
-
-	if $start_type = 'uni_m':
-		$start_text += '<TD><center><img src="images/system/icons/check.png" height="50"></center></TD>'
-	else
-		$start_text += '<TD><center><a href="exec:$start_type = ''uni_m'' & gt ''begin'', ''start''"><img src="images/system/icons/uncheck.png" height="50"></a></center></TD>'
-	end
+	$start_text += '<TR><TD>University</TD>'
 
-	if $start_type = 'uni_tg':
-		$start_text += '<TD><img src="images/system/icons/check.png" height="50"></center></TD>'
-	else
-		$start_text += '<TD><center><a href="exec:$start_type = ''uni_tg'' & gt ''begin'', ''start''"><img src="images/system/icons/uncheck.png" height="50"></a></center></TD>'
-	end
+	$start_text += func('checkimg',$start_type,'uni')
+	$start_text += func('checkimg',$start_type,'uni_m')
+	$start_text += func('checkimg',$start_type,'uni_tg')
 
 	$start_text
 
 	'</table></center>'
-	
+
 	if $start_type = 'sg' or $start_type = 'sg_m':
 		act '<center><b>Start</b></center>': gt 'intro_sg', 'start'
-	elseif $start_type = 'sg_tg':
-		act '<center><b>Start</b></center>': gt 'intro_sg_tg', 'start'
-	elseif $start_type = 'city':
-		act '<center><b>Start</b></center>': gt 'intro_city', 'start'
-	elseif $start_type = 'city_m':
-		act '<center><b>Start</b></center>': gt 'intro_city_m', 'start'
-	elseif $start_type = 'city_tg':
-		act '<center><b>Start</b></center>': gt 'intro_city_tg', 'start'
-	elseif $start_type = 'uni':
-		act '<center><b>Start</b></center>': gt 'intro_uni', 'start'
-	elseif $start_type = 'uni_m':
-		act '<center><b>Start</b></center>': gt 'intro_uni_m', 'start'
-	elseif $start_type = 'uni_tg':
-		act '<center><b>Start</b></center>': gt 'intro_uni_tg', 'start'
+	elseif $start_type ! '':
+		act '<center><b>Start</b></center>': gt 'intro_'+$start_type, 'start'
 	end
-	
+
 	act '<center><b>Change game settings</b></center>': settingmode = 1 & gs '$menu_setting'
 end
 
@@ -123,10 +69,10 @@ if $ARGS[0] = 'warning':
 	*nl
 	*nl
 	'<center><img <<$set_imgh>> src="images/system/1_openings/warning.jpg" ></center>'
-	
+
 	act '<center><b>Continue</b></center>': gt 'begin','real_character'
 end
-	
+
 if $ARGS[0] = 'real_character':
 	$BACKIMAGE = ''
 	cls

+ 7 - 0
locations/checkimg.qsrc

@@ -0,0 +1,7 @@
+#checkimg
+if $ARGS[0]=$ARGS[1]:
+	$result = '<TD><center><img src="images/system/icons/check.png" height="50"></center></TD>'
+else
+	$result = '<TD><center><a href="exec:$start_type = '''+$ARGS[1]+''' & gt ''begin'', ''start''"><img src="images/system/icons/uncheck.png" height="50"></a></center></TD>'
+end
+--- checkimg ---------------------------------