Browse Source

[added] provisions for `git_hash` build tagging and call trace

LinaHirata 6 months ago
parent
commit
21ef12d3a7
4 changed files with 30 additions and 0 deletions
  1. 2 0
      locations/loadg.qsrc
  2. 1 0
      locations/obj_din.qsrc
  3. 10 0
      locations/onobjsel.qsrc
  4. 17 0
      locations/stat_display.qsrc

+ 2 - 0
locations/loadg.qsrc

@@ -1,6 +1,8 @@
 # loadg
 
 showobjs max(1 - debug_warning_closed, loadg_show_debug)
+killvar '$git_hash'
+gs 'addbuilddate'
 gs 'saveupdater'
 
 --- loadg ---------------------------------

+ 1 - 0
locations/obj_din.qsrc

@@ -2238,6 +2238,7 @@ if $ARGS[0] = 'old':
 	addobj '<center>Add Debug Variable</center>'
 	addobj '<center>Delete Debug Variable</center>'
 	addobj '<center>Switch HTML</center>'
+	addobj '<center>Toggle Call Trace</center>'
 	if cheatTime = 1:
 		addobj '<center>-1 Hour</center>'
 		addobj '<center>+1 Hour</center>'

+ 10 - 0
locations/onobjsel.qsrc

@@ -63,6 +63,16 @@ if $selobj = '<center>Remove debug info</center>':
 	gs 'stat'
 end
 
+if $selobj = '<center>Toggle Call Trace</center>':
+	if call_trace_shown = 0:
+		call_trace_shown = 1
+		gs 'stat_display'
+	else
+		call_trace_shown = 0
+		gs 'stat'
+	end
+end
+
 unselect
 
 --- onobjsel ---------------------------------

+ 17 - 0
locations/stat_display.qsrc

@@ -1,5 +1,21 @@
 # stat_display
 !!2021/04/04
+if call_trace_shown ! 0:
+	clear
+	p '<center>'
+	if $git_hash ! '': pl '<<$git_hash>>'
+	pl iif(call_trace_manual = 0, 'auto', 'manual')
+	if call_trace_enabled = 0:
+		p '<a href="exec:call_trace_enabled = 1 & gs ''stat_display''">enable</a> | '
+	else
+		p '<a href="exec:call_trace_enabled = 0 & call_trace_shown = 0 & gs ''stat''">disable</a> | '
+	end
+	p '<a href="exec:killvar ''$call_trace'' & gs ''stat_display''">clear</a> | '
+	pl '<a href="exec:call_trace_shown = 0 & gs ''stat''">return</a></center>'
+	p $call_trace
+	exit
+end
+
 if default_status_icons = 0:set_siconht = 54
 if default_wbanner = 0:set_weatherht = 72
 if default_menu_icons = 0:set_miconht = 54
@@ -2419,6 +2435,7 @@ killvar 'stat_imgextra_msg'
 
 if Enable_statfsize > 0: $stat_msg += '</font>' & !disable this, all texts comes from pl will have the same font size, like[time]
 if Enable_faceturn = 1:	view FUNC('$face_image')
+if $git_hash ! '': $stat_msg = '<center><<$git_hash>></center><<$stat_msg>>'
 if Enable_Android = 0:
 	pl '<<$stat_msg>>'
 else