diff --git a/CHANGELOG.md b/CHANGELOG.md index 949c756d0..3d6d99437 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel ## Unreleased +### Added + +- Added momentary_rot_button to targetID (by @MrXonte) + ## [v0.14.6b](https://github.com/TTT-2/TTT2/tree/v0.14.6b) (2026-04-06) ### Added diff --git a/gamemodes/terrortown/gamemode/shared/sh_entity.lua b/gamemodes/terrortown/gamemode/shared/sh_entity.lua index 6b95d1659..0ef119f4b 100644 --- a/gamemodes/terrortown/gamemode/shared/sh_entity.lua +++ b/gamemodes/terrortown/gamemode/shared/sh_entity.lua @@ -33,10 +33,18 @@ function entmeta:IsRotatingButton() return button.IsClass(self, "func_rot_button") end +--- +-- Returns true if this entity is a momentary rotating button (lever). +-- @return boolean Returns true if momentary rotating button +-- @realm shared +function entmeta:IsMomentaryRotatingButton() + return button.IsClass(self, "momentary_rot_button") +end + --- -- Returns true if the entity is any type of button. -- @return boolean Returns true if button -- @realm shared function entmeta:IsButton() - return self:IsDefaultButton() or self:IsRotatingButton() + return self:IsDefaultButton() or self:IsRotatingButton() or self:IsMomentaryRotatingButton() end diff --git a/lua/terrortown/lang/en.lua b/lua/terrortown/lang/en.lua index e00a65018..448093d05 100644 --- a/lua/terrortown/lang/en.lua +++ b/lua/terrortown/lang/en.lua @@ -2356,9 +2356,11 @@ L.label_roles_derandomize_min_weight = "Derandomization minimum weight" -- 2024-08-17 L.name_button_default = "Button" L.name_button_rotating = "Lever" +L.name_button_momentary_rotating = "Wheel" L.button_default = "Press [{usekey}] to trigger" L.button_rotating = "Press [{usekey}] to flip" +L.button_momentary_rotating = "Press [{usekey}] to rotate" L.undefined_key = "???" diff --git a/lua/ttt2/libraries/buttons.lua b/lua/ttt2/libraries/buttons.lua index 06493f16e..6b124d7ce 100644 --- a/lua/ttt2/libraries/buttons.lua +++ b/lua/ttt2/libraries/buttons.lua @@ -12,6 +12,7 @@ button = {} local validButtons = { "func_button", "func_rot_button", + "momentary_rot_button", } if SERVER then diff --git a/lua/ttt2/libraries/targetid.lua b/lua/ttt2/libraries/targetid.lua index 2a558fd2e..743d3c443 100644 --- a/lua/ttt2/libraries/targetid.lua +++ b/lua/ttt2/libraries/targetid.lua @@ -702,6 +702,11 @@ function targetid.HUDDrawTargetIDButtons(tData) tData:SetTitle(TryT("name_button_rotating")) tData:SetSubtitle(ParT("button_rotating", key_params)) end + + if ent:IsMomentaryRotatingButton() then + tData:SetTitle(TryT("name_button_momentary_rotating")) + tData:SetSubtitle(ParT("button_momentary_rotating", key_params)) + end end ---