13 Commits

Author SHA1 Message Date
Michal Cieslakiewicz
cf0aa6a63c minertools: add mode label for multidevice formspec.
Labels for settings in multidevice formspec are now prepended
with MS and MF to remind that option affects only one subsystem.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-24 14:57:43 +02:00
Michal Cieslakiewicz
d111080b7f minertools: add click to window close via ESC.
fields.quit is now recognized as well and causes formspec closing
to emit click sound.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-15 10:12:24 +02:00
Michal Cieslakiewicz
e16e9ca46a minertools: OK button now exits formspec automatically.
Button definition changed to button_exit which automates windows
closing and compacts callback code.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-15 10:07:43 +02:00
Michal Cieslakiewicz
4df95a35ca minertools: return item in on_use for items with metadata.
All devices except geothermometer check and init their metadata on
first use. Therefore in on_use handler it is better to return item
not nil so tool gets updated immediately after handler routine ends.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-14 11:18:49 +02:00
Michal Cieslakiewicz
a652652310 minertools: add flashlight setting for UMG.
UMG can be a light source when enabled in mod settings. This works
with wielded_light or similar mods, otherwise it does not matter.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-12 08:50:34 +02:00
Michal Cieslakiewicz
e0fa4333ed minertools: code rewritten and reorganized.
Major changes:
* all code now in init.lua which eliminates need for global functions
  and variables
* all item-specific data is now stored within item definition
* item configuration stored in metadata
* double-click mechanics eliminated completely, device settings
  available via right-click menu (formspec)
* code reusability by various devices improved dramatically
* flashlight option removed as light level is global item property
  and cannot be set independently for each device

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-11 16:44:24 +02:00
Michal Cieslakiewicz
8dd1fbb5f0 minertools: ultimate mining gizmo (UMG) added.
Enhanced version of AMA, designed to be the ultimate mining computer module.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-06 15:31:28 +02:00
Michal Cieslakiewicz
09257d99a9 minertools: advanced mining assistant (AMA) added.
AMA is upgraded version of PMC. Ranges and sensivity
are increased.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-05 23:45:43 +02:00
Michal Cieslakiewicz
acef5d8283 minertools: personal mining computer (PMC) added.
This device is 3-in-1, it combines geothermometer,
mineral scanner and mineral finder in one compartment
while retaining each device's characteristics.
Double right-click to change device mode.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-05 23:23:57 +02:00
Michal Cieslakiewicz
b6933064a9 minertools: common code moved to functions.lua.
functions.lua file contains functions planned for reuse
with coming all-in-one devices.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-05 20:57:21 +02:00
Michal Cieslakiewicz
e828c5bac4 minertools: mineral finder added.
This tool detects selected ore in front of device
(directional scanner) but can be obstructed by obsidian
deposits to make things a little harder.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-05 16:53:00 +02:00
Michal Cieslakiewicz
73e78a64f4 minertools: portable mineral scanner added.
Handheld scanner shows ores (including obsidian) in cubic area
centered at player current position within preset range.

Left click (use) - scan for ores and send result via chat
Right click (place, secondary use) - change scan range

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-05 08:59:27 +02:00
Michal Cieslakiewicz
3b96c952d0 Geothermometer renamed to minertools, chip added.
Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2018-10-04 09:41:39 +02:00