[hudbars & bobblocks & solarmana & sprint] Prepare for 0.4.14

- For #427
This commit is contained in:
LeMagnesium 2016-04-17 18:11:33 +02:00
parent d6ed358c16
commit bd120ad481
7 changed files with 90 additions and 7 deletions

View File

@ -23,7 +23,6 @@ minetest.register_node("bobblocks:btm", {
"bobblocks_btm_sides.png", "bobblocks_btm_sides.png", "bobblocks_btm.png"},
inventory_image = "bobblocks_btm.png",
paramtype2 = "facedir",
material = minetest.digprop_dirtlike(1.0),
legacy_facedir_simple = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},

View File

@ -1,4 +1,4 @@
API documentation for the HUD bars mod 1.0.2
API documentation for the HUD bars mod 1.2.1
============================================
## Introduction
@ -59,8 +59,9 @@ manually in a reliable way.
* `text_color`: A 3-octet number defining the color of the text. The octets denote, in this order red, green and blue and range from `0x00` (complete lack of this component) to `0xFF` (full intensity of this component). Example: `0xFFFFFF` for white.
* `label`: A string which is displayed on the HUD bar itself to describe the HUD bar. Try to keep this string short.
* `textures`: A table with the following fields:
* `bar`: The file name of the bar image (as string).
* `icon`: The file name of the icon, as string. This field can be `nil`, in which case no icon will be used.
* `bar`: The file name of the bar image (as string). This is only used for the `progress_bar` bar type (see `README.txt`, settings section).
* `icon`: The file name of the icon, as string. For the `progress_bar` type, it is shown as single image left of the bar, for the two statbar bar types, it is used as the statbar icon and will be repeated. This field can be `nil`, in which case no icon will be used, but this is not recommended, because the HUD bar will be invisible if the one of the statbar bar types is used.
* `bgicon`: The file name of the background icon, it is used as the background for the modern statbar mode only. This field can be `nil`, in which case no background icon will be displayed in this mode.
* `default_start_value`: If this HUD bar is added to a player, and no initial value is specified, this value will be used as initial current value
* `default_max_value`: If this HUD bar is added to a player, and no initial maximum value is specified, this value will be used as initial maximum value
* `default_start_hidden`: The HUD bar will be initially start hidden by default when added to a player. Use `hb.unhide_hudbar` to unhide it.

View File

@ -1,6 +1,6 @@
Minetest mod: HUD bars
======================
Version: 1.0.2
Version: 1.2.1
This software uses semantic versioning, as defined by version 2.0.0 of the SemVer
standard. <http://semver.org/>
@ -27,6 +27,66 @@ set will use a default value instead.
IMPORTANT:
Keep in mind if running a server with this mod, that the custom position should be displayed correctly on every screen size!
Settings:
---------
This mod can be configured by editing minetest.conf. Currently, the following setting is recognized:
- hudbars_autohide_breath: A boolean setting, it can be either “true” or “false”. If set to “true”,
the breath bar will be automatically hidden shortly after the breathbar has been filled up. If set
to “false”, the breath bar will always be displayed. The default value is “true”.
- hudbars_sorting: This setting allows you to specify the “slot” positions of the HUD bars manually.
The setting has to be specified as a comma-seperated list of key=value pairs, where a key refers to the
identifier of a HUD bar and the value refers to the slot number of where the HUD bar should be placed.
The slot number must be an integer greater of equal to 0. The slot positions start (slot 0) at the
bottom (nearest to hotbar in default configuration) left side, the following slot 1 is at the right
side, slot `2` is on the right side again, but placed over the first HUD bar (slot 0), and it goes on,
in a zig-zag pattern.
All HUD bars to which no sorting rule has been applied will fill in all slots which have not been occupied
by the HUD bars specified in this setting, the slots will be filled in from the lowest slot number.
Note that the order of those remaining HUD bars is *not* fixed, it basically just boils down on which mod
“came” first. Don't worry, the mod will still work perfectly fine, this setting is entirely optional.
Be careful not to use slot indices twice, or else different HUD bars will be drawn over each other!
If this setting is not set, by default the health and breath bar are displayed at slot positions 0 and 1,
respectively (health bar at left bottom-most positoin, breath bar right from it). All other HUD bars are
placed automatically.
Example value:
breath=0, health=1
This places the breath bar at the left side, and the health bar to the right side.
- hudbars_bar_type: Specifies the style of bars. You can select between the default progress-bar-like bars and the good old statbars
like you know from vanilla Minetest. Note that the classic and modern statbars are still a little bit experimental.
These values are possible:
- progress_bar: A horizontal progress-bar-like bar with a label, showing numerical value (current, maximum), and an icon.
These bars usually convey the most information. This is the default and recommended value..
- statbar_classic: Classic statbar, like in vanilla Minetest. Made out of up to 20 half-symbols. Those bars represent the vague ratio between
the current value and the maximum value. 1 half-symbol stands for approximately 5% of the maximum value.
- statbar_modern: Like the classic statbar, but also supports background images, this kind of statbar may be considered to be more user-friendly
than the classic statbar. This bar type closely resembles the [hud] mod.
- hudbars_vmargin: The vertical distance between two HUD bars in pixels (default: 24)
- hudbars_tick: The number of seconds between two updates of the HUD bars. Increase this number if you have a slow server (default: 0.1)
Position settings:
With these settings you can configure the positions of the HUD bars. All settings must be specified as a number.
The pos settings are specified as a floating-point number between 0 to 1 each, the start_offset settings are
specified as whole numbers, they specify a number of pixels.
The left and right variants are used for the zig-zag mode. In the stack_up and stack_down modes, only the left variant is used for
the base position
- hudbars_pos_left_x, hudbars_pos_left_y: Screen position (x and y) of the left HUD bar in zigzag mode. 0 is left-most/top, 1 is right-most/bottom.
Defaults: 0.5 (x) and 1 (y)
- hudbars_pos_right_x, hudbars_pos_right_y: Same as above, but for the right one.
Defaults: 0.5 and 1.
- hudbars_start_offset_left_x, hudbars_start_offset_left_y: Offset in pixels from the basic screen position specified in hudbars_pos_left_x/hudbars_pos_left_y.
Defaults: -175 and -86
- hudbars_start_offset_right_x, hudbars_start_offset_right_y: Same as above, but for the right one.
Defaults: 15 and -86
API:
----
The API is used to add your own custom HUD bars.
@ -36,6 +96,7 @@ Documentation for the API of this mod can be found in API.md.
License of textures:
--------------------
hudbars_icon_health.png - celeron55 (CC BY-SA 3.0), modified by BlockMen
hudbars_bgicon_health.png - celeron55 (CC BY-SA 3.0), modified by BlockMen
hudbars_icon_breath.png - kaeza (WTFPL), modified by BlockMen
hudbars_bar_health.png - Wuzzy (WTFPL)
hudbars_bar_breath.png - Wuzzy (WTFPL)

View File

@ -43,3 +43,24 @@ as of version 2.0.0 of the standard <http://semver.org/>.
-----
- Fix other HUD elements disappearing for rejoining players
- Remove pointless delays for initializing the HUD for new or rejoining players
1.0.3
-----
- Adjust default HUD bars position for Minetest 0.4.12
1.1.0
-----
- Add boolean minetest.conf setting support (hudbars_autohide_breathbar) to control whether the breath bar is automatically hidden when full (default: yes)
1.2.0
-----
- New setting: hudbars_sorting. You can now manually sort all the HUD bars. Useful if you don't like automatic order
- New setting: hudbars_bar_type. You now can change the appearance of the HUD bars.
- New HUD bar types, slightly experimental: Classic statbars and modern [hud]-style statbars
- New experimental/unfinished setting: hudbars_alignment_pattern: You can now make the HUD bars stack vertically instead of the current zig-zag pattern. Note you probably need to change source code to productively use this feature
- Various position-related HUD bar settings (see README.txt)
- Remove hudbars.conf support and hudbars.conf.example (was never officially supported anyways)
1.2.1
-----
- Fix crash when enable_damage is changed in mid-game

View File

@ -118,6 +118,7 @@ function hb.register_hudbar(identifier, text_color, label, textures, default_sta
number = barnumber,
alignment = {x=-1,y=-1},
offset = offset,
size = {x = 2.5, y = 16},
})
ids.text = player:hud_add({
hud_elem_type = "text",

View File

@ -86,7 +86,7 @@ local function tick()
for key, value in pairs(mana_from_node) do
if key:split(":")[1] == "group" then
local groupname = key:split(":")[2]
if minetest.get_node_group(node.name, groupname) > 0 then
if minetest.get_item_group(node.name, groupname) > 0 then
if nodemana then
nodemana = math.max(nodemana, value) -- We get the greater one (if the node is part of 2 or more groups)
else

View File

@ -119,7 +119,7 @@ minetest.register_globalstep(function(dtime)
for i=1, numParticles, 1 do
minetest.add_particle({
pos = {x=playerPos["x"]+math.random(-1,1)*math.random()/2,y=playerPos["y"]+0.1,z=playerPos["z"]+math.random(-1,1)*math.random()/2},
vel = {x=0, y=5, z=0},
velocity = {x=0, y=5, z=0},
acc = {x=0, y=-13, z=0},
expirationtime = math.random(),
size = math.random()+0.5,