Skip to content

Commit f7bd301

Browse files
authored
Create README.md
1 parent eeec09d commit f7bd301

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

README.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
2+
# CSM Too Much Information HUD
3+
4+
Minetest Client Side Mod HUD with rearrangeable modules. Choose which to load and at runtime, choose to hide or show them.
5+
6+
Targeted at developers and testers that like a bit more information.
7+
8+
Since the data you want to see, is different depending on what is being investigated, two methods of selection are offered:
9+
10+
1. in ``init.lua`` by un-/commenting the modules you want loaded.
11+
2. during runtime, the ``.tmi`` command invokes a formspec from which the modules can be toggled. They can run in the background while not being displayed on HUD.
12+
13+
## Out-of-the-box-modules
14+
```
15+
| Module | Description |
16+
--------------------------------------------------------------------------
17+
| serverInfo | server ip, protocol version etc. |
18+
| wieldedItem | description, wear and other info about wielded item |
19+
| v1 | velocity: vX, vY, vZ |
20+
| v2 | velocity: vXZ, vXYZ |
21+
| vM | max velocity: vX, vY, vZ, vXZ, vXYZ |
22+
| countDig | dig counter with speed and max |
23+
| countPlace | build counter with speed and max |
24+
| countUse | use counter |
25+
| countDigAndPlace | combined count of digs and builds |
26+
| time | in-game time in 24h format |
27+
| timeElapsed | real time passed |
28+
| pos | current positon in nodes and mapblocks |
29+
```
30+
31+
## Installing the CSM
32+
Depending on your OS and build/install of Minetest the location is different. The folder you are looking for is called ``clientmods``.
33+
1. Inside the ``clientmods`` folder create one called something like ``tooMuchInfo``.
34+
2. Download and extract the mod files
35+
3. and move them into the folder you created in step 1.
36+
4. Optionally disable and/or re-order the modules you don't want in ``init.lua``, and change parameters like colour.
37+
5. Turn on client side mods in your minetest settings. From the menu go to settings > all settings > client > enable_client_modding.
38+
6. Join or start a session and log back out. (This adds a line to mods.conf: ``load_mod_toomuchinfo = false``)
39+
7. In ``clientmods/mods.conf`` change the line ``load_mod_toomuchinfo = false`` to ``load_mod_toomuchinfo = true``
40+
8. Join or start a session and enjoy
41+
42+
## Adding your own modules
43+
44+
Prepending the filename with ``module_`` is recomended. Add it to the load portion of ``init.lua``
45+
You can use this module template:
46+
```lua
47+
tModule = {
48+
id = 'moduleID', -- Unique module identifier. (String) {IDs beginning with '__' are reserved}
49+
title = 'Module Name', -- Title to show on toggle formspec. (String)
50+
updateWhenHidden = false, -- run update() even if hidden
51+
value = '---', -- current/default valuestring to display if onUpdate is not a function. (String)
52+
onClear = nil, -- function to clear/reset or nil. When set, adds a button to formspec. This hook is called when button is pressed.
53+
onDealoc = nil, -- function to run on shutdown or nil. E.g. to save data.
54+
onHide = nil, -- function or nil. Called when module is deactivated in formspec
55+
onInit = nil, -- function to run on startup or nil.
56+
-- E.g. to read values from datastore.
57+
-- Can be called multiple times per session.
58+
-- Check tmi.modules[index].bInitDone field to detect repeated call
59+
-- or manipulate it in another hook to request a re-init
60+
onReveal = nil, -- function or nil. Called when module is activated in formspec
61+
onUpdate = nil, -- function to, update and return value, Is called at interval
62+
-- or nil --> value field is used
63+
})
64+
tmi.addModule(tModule)
65+
```
66+
Call ``tmi.addModule(tModule)`` to register your module.
67+
68+
If your module provides a function for the onClear field, that function will be called when button in formspec is pressed. Generally it is used to reset values but you could also use it to toggle between values or open another setting formspec.
69+
70+
71+

0 commit comments

Comments
 (0)