96 Commits

Author SHA1 Message Date
Aaron Suen
a16ceda69a Detect cheat status changes bypassing events 2021-07-11 15:25:27 -04:00
Aaron Suen
1f4bdeb059 Remove cheating alert for spectators 2021-06-30 07:38:20 -04:00
Aaron Suen
1f3ea458a0 Fix cheat detection
A couple of simple baseline checks I missed that
aren't necessarily tied to privs but may be handled
by mods as well.
2021-06-27 19:50:56 -04:00
Aaron Suen
bf8d8e5877 Display when cheats are enabled on-screen
Without this, some players are likely to enable
certain privs and abilities without knowing that
they're cheats and will break the designed
gameplay.  Similarly, server admins may be likely
to use the same default_privs for a nodecore server
as they might for an MTG or even creative server,
causing accidental cheating as well.  Adding this
messages makes it hard to be unaware that your
game is at least misconfigured.
2021-06-23 22:46:07 -04:00
Aaron Suen
95f0fb0ee9 Heaviest image compression option 2021-03-09 08:33:58 -05:00
Aaron Suen
410ebd5d8d Recompression using ECT
https://github.com/fhanau/Efficient-Compression-Tool
2021-03-09 08:16:23 -05:00
Aaron Suen
c10e80ef87 Set name in mod.conf as demanded by 5.5+ 2021-03-01 20:10:27 -05:00
Aaron Suen
51b5aa8b94 Playerstep microoptimization
Avoid calling get_player_name too much
2021-03-01 18:58:34 -05:00
Aaron Suen
b73e70d351 Fix some translate inform warnings. 2020-09-27 09:30:57 -04:00
Aaron Suen
f24230e924 Late-bind touchtip API
Allow mods to intercept/override
2020-09-16 20:53:22 -04:00
Aaron Suen
0f8459c1c7 Fix code formatting issue 2020-09-12 16:30:15 -04:00
Aaron Suen
80ad330a15 Touchtips for fluids above nodes 2020-09-11 19:23:35 -04:00
Aaron Suen
d712ad3668 Stone brick hints 2020-09-10 23:21:36 -04:00
Aaron Suen
efa2446e42 Add hints for player mods 2020-09-10 22:28:25 -04:00
Aaron Suen
4f24397869 Mirror object crosshair left/right
It looks more aligned with the original this way.
2020-09-04 21:45:33 -04:00
Aaron Suen
e51d9a5a70 Rename textures again to not collide
This allows a texturepack to support both the
original hotbar (for release edition) and the new
hotbar (for the alpha edition) at the same time,
while giving us time to test out the alpha version
and roll out the new release when it's ready, and
without forcing TP authors to trade off support.

Names are also lexically consistent and more
consistent with internal names.
2020-09-04 20:50:29 -04:00
Aaron Suen
76176ea648 Rename selection reticle back 2020-09-04 20:30:44 -04:00
Aaron Suen
b7d6015906 Add back in legacy bar as background
This allows monolithic hotbar drawing, and
variations by position, and brings back partial
support for existing TPs.
2020-09-04 20:16:10 -04:00
Aaron Suen
d7f231f083 Retire redunant textures 2020-09-04 20:03:36 -04:00
Aaron Suen
5059f9b3c3 Alternative hotbar approach
We still change the background, but only depend
on the state of the slot, not on wield index.  Go
back to a traditional slot selection ring for the
selection index.

Slot backgrounds are a little bolder normally, and
when broken, especially bold around the broken
areas.

The selection ring itself is broken so that the
gaps in broken slots are still "open" to the outside
when the selection ring is in place.
2020-09-04 19:59:12 -04:00
Aaron Suen
1c0a9f1ade Add a lagless hotbar cursor
- Highlight behind item may lag behind the
  new cursor, but the new cursor will show
  which slot you're trying to select when
  scrolling rapidly.
- Also fix the margins/centering for hotbar
  image.

Will have to see how this plays on the actual
MP server, where there's notable RTT lag.
2020-09-04 13:55:13 -04:00
Aaron Suen
ca20aa5584 Refac HUD into separate files 2020-09-04 13:35:38 -04:00
Aaron Suen
79622ce150 Unalias hotbar slot textures
This was causing a texture from texture packs
to be reinterpreted differently, causing buggy-
looking hotbars, and TP authors would not
have been able to change the hotbar to work
with both versions.

Now before and after use different sets of
textures so a single TP can safely support
both before and after.
2020-09-04 12:56:18 -04:00
Aaron Suen
d88e1a9c11 Hotbar fixes
- Hide the redundant selector
- Properly use NC PlayerStep API
2020-09-04 12:34:54 -04:00
Aaron Suen
f8da98acf7 Fixes/tidying 2020-09-04 12:29:34 -04:00
Aaron Suen
5b2e61be75 Merge branch 'dev' into fancy_hotbar_9271_fixed 2020-09-04 12:29:08 -04:00
Aaron Suen
3f5f78bbe0 New entity crosshair 2020-09-03 21:02:10 -04:00
Aaron Suen
2d1f61ee97 Touchtips support "touch thru" API
Allow the "above" node to override the "under"
node's description.  Use this mechanism to
append charcoal glyph descriptions to the
touchtips, but only when punching a face that
has a glyph on it.
2020-06-28 12:38:14 -04:00
Aaron Suen
466805da48 Enroll skybox, fix some bugs 2020-06-22 23:17:01 -04:00
Aaron Suen
5648331c9f Replace all perplayer with playerstep 2020-06-22 22:47:33 -04:00
Aaron Suen
e0156b4742 Add profiler instrumentation metadata everywhere
N.B. the MT built-in profiler doesn't yet actually support reading
labels from bare-function registrations, so a builtin hack is
needed.
2020-06-15 07:21:39 -04:00
Aaron Suen
32e30328eb Delay breath HUD onset
The hack to start new players with full breath does
not apparently work with existing players, so players
are joining to find their breath half gone at the start
of play.

Instead, let's just hide the breath HUD entirely for the
initial half of underwater movement, and only show it
when the player is running low.  This effectively hides
the fact that players are losing the top half of breath
when joining, in the common case.

Players joining and being immediately submerged in
water is an uncommon enough case that this will
probably not affect gameplay significantly.
2020-06-07 14:17:20 -04:00
Aaron Suen
5fa2483d87 Refactor, fix new players starting a half breath 2020-06-07 12:26:27 -04:00
Aaron Suen
0a5565a3ea Buff player breath 2020-06-07 12:15:56 -04:00
Aaron Suen
b903ddd42a Image optimizations. 2020-04-16 01:27:54 -04:00
Aaron Suen
a6ef71d9dd More breath HUD redoing 2020-04-13 00:00:31 -04:00
Aaron Suen
0e6327ca2d Custom theme-matching crosshair 2020-04-09 23:18:39 -04:00
Aaron Suen
e987a87bd8 Simplify breath hud handling 2020-03-22 08:14:51 -04:00
Aaron Suen
4d47ab2e75 NC API dependency simplification.
Treat all API mods as a "layer", and use the new
nc_api_all registration to indicate that a mod depends
on the NC API (which ALL NC mods assume they do).
This means that each non-API mod does not need to
worry about which API mods it really needs and which
it does not, nor will they need to be updated for any
internal API restructures.

This is a game, not a modpack, so all mods will be
loaded anyway, and we only care about order.  That
means that we don't really need to worry about
having excess dependencies because any mod we
don't actually need will be needed by something that's
loaded anyway.  If somebody wants to reuse a
component elsewhere, they're likely to need to do
some work to untangle it anyway, because of the
amount that NodeCore mechanics interact and
interdepend.
2020-01-05 12:59:12 -05:00
Aaron Suen
dcfc80b367 Remove explicit names in mod.confs. 2020-01-05 12:38:45 -05:00
Aaron Suen
3406eb2869 Bake hotbar sel into hotbar.
This prevents the race between client-side changing
the hotbar selection index and server-side correcting
the selection image.

As a side effect, the hotbar slots no longer change
in size based on wield index, but this effect is not
very significant, and could be worked around if needed by adding padding to the normal
hotbar texture.

This branch depends on upstream PR #9271 being
merged for the MT client.
2019-12-31 16:12:33 -05:00
Aaron Suen
ffb8b12ab6 Re-quantize/optimize breath image. 2019-12-31 13:29:54 -05:00
Aaron Suen
24decd3c47 Fade bottom of breath HUD to unobscure hotbar. 2019-12-31 13:25:08 -05:00
Aaron Suen
76e43ed07f Fix breath HUD regression. 2019-12-31 13:23:36 -05:00
Aaron Suen
32e9c306b7 Attempt to create "fancy" hotbar.
Seems this doesn't actually work.  The hotbar image
MUST be a physical file, and cannot use any texture
modifiers, so sayeth the engine.
2019-12-31 11:06:35 -05:00
Aaron Suen
7fa3d405cd Merge multiline handling into nc_api_hud.
Most of the complexity of touchtip multiline handling
is now done in the unified HUD API.
2019-12-31 09:51:07 -05:00
Aaron Suen
248dbda2da Create unified HUD API.
- Handles upsert, TTL, caching, players leaving.
- Unify breath and player name HUD logic for now.

Touchtips are more complex (multiline, translate) so
those will need more work to unify.
2019-12-31 09:32:17 -05:00
Aaron Suen
83c394dcdd Fix node stack names not translating. 2019-12-29 10:22:55 -05:00
Aaron Suen
2c023da125 Simplify wear gauge appearance. 2019-12-27 12:13:11 -05:00
Aaron Suen
124ac24792 Add wear gauge to tool descriptions too. 2019-12-27 11:57:10 -05:00