Add debug hud #2459

Merged
cora merged 8 commits from debug_hud into master 2022-07-19 11:29:37 +02:00
Contributor

Import the existing debug hud from mcl5 making these additions:

  • Setting persistence through player meta instead of mod storage
  • Added api to register custom debug fields:
mcl_info.register_debug_field(name,{
	level = n, --debug level to see the field
	func = function() end, --function that returns the debug info as string to be shown 
})
  • Added 4 such custom fields for nodeinfo about node at feet and the one below and made what it previously showed use the api as well.

Todo:

  • Save setting in player meta instead of mod storage
  • Add custom debug field api
  • Document api

Testing

  • Run /debug 4 to see full debug hud (needs debug priv).
  • /debug 3 should show you biome and coords but not nodes
  • and /debug 2 should show only coords
  • while 0 and 1 currently show nothing.
Import the existing debug hud from mcl5 making these additions: * Setting persistence through player meta instead of mod storage * Added api to register custom debug fields: ```lua mcl_info.register_debug_field(name,{ level = n, --debug level to see the field func = function() end, --function that returns the debug info as string to be shown }) ``` * Added 4 such custom fields for nodeinfo about node at feet and the one below and made what it previously showed use the api as well. ### Todo: - [x] Save setting in player meta instead of mod storage - [x] Add custom debug field api - [x] Document api ### Testing * Run /debug 4 to see full debug hud (needs debug priv). * /debug 3 should show you biome and coords but not nodes * and /debug 2 should show only coords * while 0 and 1 currently show nothing.
cora changed title from WIP: Add debug hud to Add debug hud 2022-07-18 22:15:30 +02:00

it would be nice if it included information for the node pointed at.

it would be nice if it included information for the node pointed at.
Author
Contributor

well that would need to be done with a raycast i think. I only implemented things that were readily available through the engine here. This is mostly about the debug hud and making it extensible - you can easily write such a function yourself now without having to deal with hud code hehe

besides it shows pointed nodes in f5 debug already

well that would need to be done with a raycast i think. I only implemented things that were readily available through the engine here. This is mostly about the debug hud and making it extensible - you can easily write such a function yourself now without having to deal with hud code hehe besides it shows pointed nodes in f5 debug already
cora force-pushed debug_hud from 7c14b18b0b to 459cbf8363 2022-07-18 22:56:12 +02:00 Compare
Contributor

Awesome! This is a great step towards having #2251 done. There's plenty of useful information the players need for certain use cases, but also when testing/debugging stuff.

Awesome! This is a great step towards having #2251 done. There's plenty of useful information the players need for certain use cases, but also when testing/debugging stuff.
MysticTempest approved these changes 2022-07-19 08:00:52 +02:00
cora force-pushed debug_hud from 459cbf8363 to 37114e7d1a 2022-07-19 11:26:57 +02:00 Compare
cora merged commit e03801d45d into master 2022-07-19 11:29:37 +02:00
cora deleted branch debug_hud 2022-07-19 11:29:42 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#2459
No description provided.