ソースを参照

[added] notification log

LinaHirata 7 ヶ月 前
コミット
6e53ce3208
3 ファイル変更43 行追加9 行削除
  1. 26 2
      locations/journal.qsrc
  2. 14 4
      locations/notification.qsrc
  3. 3 3
      locations/stat_display.qsrc

+ 26 - 2
locations/journal.qsrc

@@ -37,11 +37,12 @@ end
 if $ARGS[0]='journalmenu':
 	*clr & cla
 	gs 'stat'
+	*nl
 	if $start_type[1] ! 'nomagic':
-        $tablebody = '<tr><th><a href="exec:menutrack = 0 & gs ''journal'', ''magictab''">Magic</a></th><th><a href="exec:menutrack = 1 & gs ''Journal'', ''housingtab''">Housing</a></th><th><a href="exec:menutrack = 2 & gs ''journal_work'', ''start''">Work</a></th><th><a href="exec:menutrack = 2 & gs ''journal_quests'', ''start''">Quests</a></th><th><a href="exec:menutrack = 4 & gs ''journal'', ''relationstab''">Relations</a></th><th><a href="exec:menutrack = 5 & gs ''journal'', ''generaltab''">Game Information</a></th><th><a href="exec:menutrack = 6 & gs ''journal'', ''notestab''">Notes</a></th></tr>'
+        $tablebody = '<tr><th><a href="exec:menutrack = 0 & gs ''journal'', ''magictab''">Magic</a></th><th><a href="exec:menutrack = 1 & gs ''Journal'', ''housingtab''">Housing</a></th><th><a href="exec:menutrack = 2 & gs ''journal_work'', ''start''">Work</a></th><th><a href="exec:menutrack = 2 & gs ''journal_quests'', ''start''">Quests</a></th><th><a href="exec:menutrack = 4 & gs ''journal'', ''relationstab''">Relations</a></th><th><a href="exec:menutrack = 5 & gs ''journal'', ''generaltab''">Game Information</a></th><th><a href="exec:menutrack = 6 & gs ''journal'', ''notestab''">Notes</a></th><th><a href="exec:menutrack = 7 & gs ''journal'', ''notification_log''">Notifications</a></th></tr>'
     
     else
-        $tablebody ='<tr><th><a href="exec:menutrack = 1 & gs ''Journal'', ''housingtab''">Housing</a></th><th><a href="exec:menutrack = 2 & gs ''journal_work'', ''start''">Work</a></th><th><a href="exec:menutrack = 2 & gs ''journal_quests'', ''start''">Quests</a></th><th><a href="exec:menutrack = 4 & gs ''journal'', ''relationstab''">Relations</a></th><th><a href="exec:menutrack = 5 & gs ''journal'', ''generaltab''">Game Information</a></th><th><a href="exec:menutrack = 6 & gs ''journal'', ''notestab''">Notes</a></th></tr>'
+        $tablebody ='<tr><th><a href="exec:menutrack = 1 & gs ''Journal'', ''housingtab''">Housing</a></th><th><a href="exec:menutrack = 2 & gs ''journal_work'', ''start''">Work</a></th><th><a href="exec:menutrack = 2 & gs ''journal_quests'', ''start''">Quests</a></th><th><a href="exec:menutrack = 4 & gs ''journal'', ''relationstab''">Relations</a></th><th><a href="exec:menutrack = 5 & gs ''journal'', ''generaltab''">Game Information</a></th><th><a href="exec:menutrack = 6 & gs ''journal'', ''notestab''">Notes</a></th><th><a href="exec:menutrack = 7 & gs ''journal'', ''notification_log''">Notifications</a></th></tr>'
     ! menu
     end
 	!display the table here.
@@ -479,6 +480,29 @@ if $ARGS[0] = 'notestab':
 !! notes
 end
 
+!!---------------------------------!!
+!!          notifications          !!
+!!---------------------------------!!
+
+
+if $ARGS[0] = 'notification_log':
+	$jumploc = 'notification_log'
+	gs 'journal', 'journalmenu'
+	'<center><h2>Notifications</h2></center>'
+	*nl
+	!! DEBUG
+	!!'<a href="exec: notif_debug_counter += 1 & gs ''notification'', ''add'', ''test message <<notif_debug_counter>>'' & gt ''journal'',''notification_log''">DEBUG</a>'
+	if $notification_log[0] ! '':
+		notification_log_loop_index = arrsize('$notification_log') - 1
+		:notification_log_loop
+		*pl $notification_log[notification_log_loop_index]
+		*nl
+		if notification_log_loop_index > 0: notification_log_loop_index -= 1 & jump 'notification_log_loop'
+	else
+		'Notification log is empty.'
+	end
+end
+
 !! ---- Other Sections ---- 
 
 

+ 14 - 4
locations/notification.qsrc

@@ -18,15 +18,25 @@ if $ARGS[0] = 'update_display':
 		$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'
+		$stat_msg = replace($stat_msg, $notification_message[0])
 	end
 	clr & pl '<<$stat_msg>>'
 end
 
+!! adds a notification to the queue
+!! message string can contain html tags like format or maybe even links
+!! i think links should work, or an image with link embedded in it
+!! theoretically all the techniques used in stat_display should work
+!! use: gs 'notification', 'add', 'message string'
 if $ARGS[0] = 'add':
-	$notification_message[] = '<td><<$ARGS[1]>></td>'
+	$temp_notification_message = '<table><tr><td><<$ARGS[1]>></td></tr></table>'
+
+	$notification_message[] = $temp_notification_message
+	$notification_log[] = '<<$mid(100+hour,2,2)>>:<<$mid(100+minut,2,2)>> <<day>><<$date_suffix>> <<$month>> <<year>>'+$temp_notification_message
+
+	killvar '$temp_notification_message'
+
+	if arrsize('$notification_log') > 30: killvar '$notification_log', 0
 end
 
 --- notification ---------------------------------

+ 3 - 3
locations/stat_display.qsrc

@@ -82,12 +82,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>'
 
 if $notification_message[0] ! '':
-	$stat_msg += '<table><tr><<$notification_message[0]>></tr></table>'
+	$stat_msg += '<<$notification_message[0]>>'
 	notification_shown[0] = 1
-else
-	$stat_msg += '<table><tr><td><a href="exec:msg ''<<$weather>>''"><<$weatherImage>></a></td><td><<$temperature>></td></tr></table>'
 end
 
+$stat_msg += '<table><tr><td><a href="exec:msg ''<<$weather>>''"><<$weatherImage>></a></td><td><<$temperature>></td></tr></table>'
+
 if Enable_statfsize>0: $stat_msg = '<font size=<<Enable_statfsize>>><<$stat_msg>>'
 
 $stat_disable_msg = 'Menu is disabled for this event.'