1
0
Эх сурвалжийг харах

Merge branch 'master' of https://git.tfgames.site/Kevin_Smarts/glife

anjuna krokus 7 сар өмнө
parent
commit
d0b14475c0

+ 1 - 0
glife.qproj

@@ -29,6 +29,7 @@
 		<Location name="mod_setting"/>
 		<Location name="$difficulty"/>
 		<Location name="UnitAppearance"/>
+		<Location name="notification"/>
 	</Folder>
 	<Folder name="Stats">
 		<Location name="DNA"/>

+ 1 - 0
locations/counter.qsrc

@@ -1,6 +1,7 @@
 # counter
 
 if music_loop = 1 and $track_loop ! '': play $track_loop, volume
+gs 'notification', 'counter'
 
 --- counter ---------------------------------
 

+ 19 - 13
locations/fertility.qsrc

@@ -33,12 +33,13 @@ if $ARGS[0] = 'auto_pill' and tabletkichday < daystart:
 	if tabletkicheck = 1:
 		if mc_inventory['contraceptive_pill'] = 0 and pillsleft[ptype] = 0:
 			tabletkicheck = 0
-			'You are out of birth control pills.'
+			gs 'notification', 'add', 'You are out of birth control pills.'
 			tabletkipi = -5
+			jump 'auto_pill_break_goto'
 		elseif mc_inventory['contraceptive_pill'] = 0 and pillsleft[ptype] = 28:
-			'You have just opened your last package of birth control pills. You need to buy more.'
+			gs 'notification', 'add', 'You have just opened your last package of birth control pills. You need to buy more.'
 		elseif mc_inventory['contraceptive_pill'] = 0 and pillsleft[ptype] <= 5:
-			'You are running out of birth control pills, you only have a few left.'
+			gs 'notification', 'add', 'You are running out of birth control pills, you only have a few left.'
 		end
 
 		birth_control['using_bc'] = 3
@@ -60,13 +61,17 @@ if $ARGS[0] = 'auto_pill' and tabletkichday < daystart:
 		if tabletkiap < 300:
 			if tabletkipd > -10:
 				if pcs_willpwr < willpowermax / 4:
-					msg 'You stare at your package of birth control pills, you know you should take one but you can''t quite work up enough effort to care.'
+					!msg 'You stare at your package of birth control pills, you know you should take one but you can''t quite work up enough effort to care.'
+					gs 'notification', 'add', 'You stare at your package of birth control pills, you know you should take one but you can''t quite work up enough effort to care.'
 				elseif pcs_mood < 10:
-					msg 'You stare at your package of birth control pills, but you don''t open it.'
+					!msg 'You stare at your package of birth control pills, but you don''t open it.'
+					gs 'notification', 'add', 'You stare at your package of birth control pills, but you don''t open it.'
 				elseif pcs_sleep < 10:
-					msg 'You fumble with your birth control pills, trying to get a pill out. You finally give up too tired to manage it.'
+					!msg 'You fumble with your birth control pills, trying to get a pill out. You finally give up too tired to manage it.'
+					gs 'notification', 'add', 'You fumble with your birth control pills, trying to get a pill out. You finally give up too tired to manage it.'
 				else
-					msg 'You just realized you forgot to take your birth control pill today.'
+					!msg 'You just realized you forgot to take your birth control pill today.'
+					gs 'notification', 'add', 'You just realized you forgot to take your birth control pill today.'
 				end
 			end
 			tabletkipt = 2
@@ -89,27 +94,27 @@ if $ARGS[0] = 'auto_pill' and tabletkichday < daystart:
 				end
 
 				if tabletkipd > -10:
-					'You find yourself holding the bottle of birth control pills, you cannot remember if you took one or not.'
+					gs 'notification', 'add', 'You find yourself holding the bottle of birth control pills, you cannot remember if you took one or not.'
 				end
 				if tabletkipd > 0:
 					if rand(0,9) = 0:
 						if tabletkipt < 0:
-							'You don''t think you have taken your pill today.'
+							gs 'notification', 'add', 'You don''t think you have taken your pill today.'
 						else
 							pilldaychk = daystart
-							'You think you have taken your pill today.'
+							gs 'notification', 'add', 'You think you have taken your pill today.'
 						end
 					else
 						if tabletkipt > 0:
-							'You don''t think you have taken your pill today.'
+							gs 'notification', 'add', 'You don''t think you have taken your pill today.'
 						else
 							pilldaychk = daystart
-							'You think you have taken your pill today.'
+							gs 'notification', 'add', 'You think you have taken your pill today.'
 						end
 					end
 				end
 			else
-				'You take your birth control pill for the day.'
+				gs 'notification', 'add', 'You take your birth control pill for the day.'
 				pilldaychk = daystart
 				gs 'din_bad','takepill'
 				if rand(0,7) = 0 and tabletkiday >= (daystart - 1): tabletkipd += 1
@@ -144,6 +149,7 @@ if $ARGS[0] = 'auto_pill' and tabletkichday < daystart:
 	end
 
 	gs 'fertility', 'update'
+	:auto_pill_break_goto
 end
 
 if $ARGS[0] = 'daily_update':

+ 32 - 0
locations/notification.qsrc

@@ -0,0 +1,32 @@
+# notification
+
+if $ARGS[0] = 'counter':
+	!! DEBUG:
+	!!'<<$notification_message[0]>>; <<notification_shown[0]>>; <<_n_timer>>'
+
+	if $notification_message[0] ! '' and notification_shown[0] = 1: _n_timer += 1
+	if _n_timer > 5:
+		gs 'notification', 'update_display'
+		killvar '$notification_message', 0
+		killvar 'notification_shown', 0
+		_n_timer = 0
+	end
+end
+
+if $ARGS[0] = 'update_display':
+	if $notification_message[1] ! '':
+		$stat_msg = replace($stat_msg, $notification_message[0], $notification_message[1])
+		notification_shown[1] = 1
+	else
+		$temp_str = '<td><a href="exec:msg ''<<$weather>>''"><<$weatherImage>></a></td><td><<$temperature>></td>'
+		$stat_msg = replace($stat_msg, $notification_message[0], $temp_str)
+		killvar '$temp_str'
+	end
+	clr & pl '<<$stat_msg>>'
+end
+
+if $ARGS[0] = 'add':
+	$notification_message[] = '<td><<$ARGS[1]>></td>'
+end
+
+--- notification ---------------------------------

+ 6 - 1
locations/stat_display.qsrc

@@ -81,7 +81,12 @@ if Enable_statimg_loc = 1: $stat_msg = '<<$stat_imgtool_msg>><br><<$stat_imgextr
 
 $stat_android = '<b><<$mid(100+hour,2,2)>>:<<$mid(100+minut,2,2)>></b>'
 
-$stat_msg += '<table><tr><td><a href="exec:msg ''<<$weather>>''"><<$weatherImage>></a></td><td><<$temperature>></td></tr></table>'
+if $notification_message[0] ! '':
+	$stat_msg += '<table><tr><<$notification_message[0]>></tr></table>'
+	notification_shown[0] = 1
+else
+	$stat_msg += '<table><tr><td><a href="exec:msg ''<<$weather>>''"><<$weatherImage>></a></td><td><<$temperature>></td></tr></table>'
+end
 
 if Enable_statfsize>0: $stat_msg = '<font size=<<Enable_statfsize>>><<$stat_msg>>'