From e1e38c2d30f667bc9ffc99d8d0b32967c3bd24cb Mon Sep 17 00:00:00 2001 From: Konstantin Gitschthaler Date: Tue, 19 May 2026 14:34:36 +0200 Subject: [PATCH 1/2] fix --- gamemodes/terrortown/gamemode/shared/sh_entity.lua | 10 +++++++++- lua/terrortown/lang/en.lua | 2 ++ lua/ttt2/libraries/buttons.lua | 1 + lua/ttt2/libraries/targetid.lua | 5 +++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gamemodes/terrortown/gamemode/shared/sh_entity.lua b/gamemodes/terrortown/gamemode/shared/sh_entity.lua index 6b95d16594..0ef119f4ba 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 e00a650186..448093d057 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 06493f16e2..6b124d7ce3 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 2a558fd2e4..743d3c4431 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 --- From aa72c3fead496364efb329be9e6c9bf73b22910b Mon Sep 17 00:00:00 2001 From: Konstantin Gitschthaler Date: Tue, 19 May 2026 14:36:42 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 949c756d00..3d6d994372 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