소스 검색

[Code refactor and UI improvements] Added date suffix to cheatmenu_din date and time section and index, added braces removal date in journal as per user request, refactored function evt_day_suffix to be simpler and added $debug['date_suffix'] as a failsafe to determine call failures. Found an QSP issue of not always passing variables attached to gs calls, implemented temporary carrier var to ensure tasked var returns where needed.

Myles Croft (Hooded Silence) 4 달 전
부모
커밋
4ef490f6f1
4개의 변경된 파일31개의 추가작업 그리고 34개의 파일을 삭제
  1. 11 3
      locations/Cheatmenu_din.qsrc
  2. 3 3
      locations/cikl.qsrc
  3. 13 26
      locations/emp_functions.qsrc
  4. 4 2
      locations/obj_din.qsrc

+ 11 - 3
locations/Cheatmenu_din.qsrc

@@ -249,7 +249,7 @@ if $ARGS[0] = 'index':
 	$cheatmenu['table_start']
 	'<a href="exec:dynamic $cheatmenu[''dynamic'']">Dynamic Input Command</a>'
 	'<a href="exec:gs ''fertility'',''cum_arrcheat''">OOX Debug</a>'
-	'Right now <<$week[week]>> <<$month>> <<day>> <<year>> <<hour>>:<<minut>>'
+	'Right now <<$week[week]>> <<$month>> <<day>><<$stat_day_suffix>>, <<year>> <<hour>>:<<minut>>'
 	'Jump forward <a href="exec:dynamic $cheatmenu[''quicktime''], 15 & dynamic $cheatmenu[$cheatmenu[''this_menu'']]">+15</a> minutes'
 	*nl
 	'<a href="exec:gt''pav_residential''"	>Teleport to Pavlovsk</a>'
@@ -1791,6 +1791,14 @@ if $ARGS[0] = 'time':
 	temp_month = dateVars['month']
 	$temp_month = $dateVars['month_text']
 	temp_year = dateVars['year']
+	!! Set transients as gs to emp_functions unreliable for checking day
+	transient_evt_day = day
+	gs 'emp_functions', 'evt_day_suffix', day
+	$day_suffix = $evt_suffix
+	transient_evt_day = temp_day
+	gs 'emp_functions', 'evt_day_suffix', temp_day
+	$temp_day_suffix = $evt_suffix
+	killvar '$evt_suffix'
 	gs 'daystart'
 	gs 'outdoors', 'temp_set'
 	gs 'stat'
@@ -1830,8 +1838,8 @@ if $ARGS[0] = 'time':
 		if hour > 9: $tempcurtime = '<b><<hour>>:0<<minut>></b>' else $tempcurtime = '<b>0<<hour>>:0<<minut>></b>'
 	end
 
-	'Current time: <b><<$week[week]>></b>, <b><<day>></b>. day of <b><<$month>></b>, <b><<year>></b>, <<$tempcurtime>>'
-	'Target time: <b><<$week[temp_week]>></b>, <b><<temp_day>></b>. day of <b><<$temp_month>></b>, <b><<temp_year>></b>, <<$temptime>>'
+	'Current time: <b><<$week[week]>></b>, <b><<day>><<$day_suffix>></b>, day of <b><<$month>></b>, <b><<year>></b>, <<$tempcurtime>>'
+	'Target time: <b><<$week[temp_week]>></b>, <b><<temp_day>><<$temp_day_suffix>></b>, day of <b><<$temp_month>></b>, <b><<temp_year>></b>, <<$temptime>>'
 	'Daychange: <<temp_daystart - daystart>>'
 	*nl
 	'Year:	<a href="exec:temp_daystart += 365 & dynamic $cheatmenu[''time'']">+1 Year</a>	<a href="exec:temp_daystart -= 365 & dynamic $cheatmenu[''time'']">-1 Year</a>'

+ 3 - 3
locations/cikl.qsrc

@@ -47,10 +47,10 @@ if week = 1:
 end
 
 gs 'yearstart'
-
+transient_evt_day = day
 gs 'emp_functions', 'evt_day_suffix'
-$stat_day_suffix = $date_suffix
-killvar '$date_suffix'
+$stat_day_suffix = $evt_suffix
+killvar '$evt_suffix'
 !!----------------------------------------------------------------------------
 
 !!Fame call to update all the fame variables

+ 13 - 26
locations/emp_functions.qsrc

@@ -505,43 +505,30 @@ if $ARGS[0] = 'del_evt':
 end
 
 if $ARGS[0] = 'evt_day_suffix':
-
-	if ARGS[1] ! 0:
+	if ARGS[1] ! 0 or ARGS[1] < 32:
 		query_day = ARGS[1]
-	else
+	elseif transient_evt_day ! 0 or transient_evt_day < 32:
 		query_day = transient_evt_day
+	else
+		$debug['date_suffix'] = 'Failed to set date suffix. Required Vars not set - ARGS 1: <<ARGS[1]>> / Transient: <<transient_evt_day>> / Query Day: <<query_day>>'
 	end
 	if query_day => 20 and query_day < 30:
 		test_day = query_day - 20
 	else
 		test_day = query_day
 	end
-	if transient_evt_day ! 0:
-		if test_day => 4 and test_day <= 10:
-			$evt_suffix = 'th'
-		elseif test_day = 1 or test_day = 31:
-			$evt_suffix = 'st'
-		elseif test_day = 2:
-			$evt_suffix = 'nd'
-		elseif test_day= 3:
-			$evt_suffix = 'rd'
-		else
-			$evt_suffix = 'th'
-		end
-	end
-	if day => 4 and day <=10:
-		$date_suffix = 'th'
-	elseif day = 1 or day = 21 or day = 31:
-		$date_suffix = 'st'
-	elseif day = 2 or day = 22:
-		$date_suffix = 'nd'
+	if test_day => 4 and test_day <= 10:
+		$evt_suffix = 'th'
+	elseif test_day = 1 or test_day = 31:
+		$evt_suffix = 'st'
+	elseif test_day = 2:
+		$evt_suffix = 'nd'
 	elseif test_day= 3:
-		$date_suffix = 'rd'
+		$evt_suffix = 'rd'
 	else
-		$date_suffix = 'th'
+		$evt_suffix = 'th'
 	end
-
-
+	killvar 'transient_evt_day'
 	killvar 'test_day'
 	killvar 'query_day'
 end

+ 4 - 2
locations/obj_din.qsrc

@@ -349,12 +349,14 @@ if $ARGS[0] = 'description':
 	if pcs_mass['body'] < 10 and strenbuf > 0 and dounspell = 0: '<b><font color="red">You are showing signs of malnourishment. You should probably eat more and more often.</font></b>'
 	if pcs_mass['body'] < 10 and strenbuf = 0 and dounspell = 0: '<b><font color="red">You are dangerously malnourished, which has led to a loss in muscle mass. You''re in a critical condition and likely to pass out!</font></b>'
 	if pcs_missing_teeth = 1:
-		 'You have lost <<pcs_missing_teeth>> <a href="exec:gs ''obj_din'', ''show_missing_teeth''">tooth</a>.'
+		'You have lost <<pcs_missing_teeth>> <a href="exec:gs ''obj_din'', ''show_missing_teeth''">tooth</a>.'
 	elseif pcs_missing_teeth >= 2:
 		'You have lost <<pcs_missing_teeth>>  <a href="exec:gs ''obj_din'', ''show_missing_teeth''">teeth</a>.'
 	end
 	if pcs_brace = 1:
-		'You are wearing a brace on your <a href="exec:gs ''obj_din'', ''show_teeth''">teeth</a> .'
+		gs 'daystart', 'to_date', dentistday
+		gs 'emp_functions', 'evt_day_suffix', dateVars['day']
+		'You are wearing a brace on your <a href="exec:gs ''obj_din'', ''show_teeth''">teeth</a>, you can remove them on or after the <<dateVars[''day'']>><<$evt_suffix>> <<$monthName[dateVars[''month'']]>>, <<dateVars[''year'']>>.'
 	elseif pcs_teeth = -1:
 		'You have a perfect white <a href="exec:gs ''obj_din'', ''show_teeth''">smile</a>.'
 	elseif pcs_teeth > 0: