Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/assets/opensb/scripts
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-20 12:52:08 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-20 12:52:08 +1000
commit3aa45ab7995c000432bba8ee1335ff7db923ac41 (patch)
treed038fa458c15d49f89655d8486ee9ecbd26089e6 /assets/opensb/scripts
parentdb3d004d3008f10f133c8a1eb8f0200f0b05eea1 (diff)
Add voice muting, add input key and mouse functions
Diffstat (limited to 'assets/opensb/scripts')
-rw-r--r--assets/opensb/scripts/opensb/universeclient/voicemanager.lua23
1 files changed, 12 insertions, 11 deletions
diff --git a/assets/opensb/scripts/opensb/universeclient/voicemanager.lua b/assets/opensb/scripts/opensb/universeclient/voicemanager.lua
index 2f19f6a..0a93c3f 100644
--- a/assets/opensb/scripts/opensb/universeclient/voicemanager.lua
+++ b/assets/opensb/scripts/opensb/universeclient/voicemanager.lua
@@ -80,17 +80,18 @@ local function drawSpeakerBar(mouse, pos, speaker, i)
hoveredSpeaker = speaker
hoveredSpeakerIndex = i
hoveredSpeakerPosition = pos
- --if input.key("LShift") then
- -- textPositioning.position = {pos[1] + 288, pos[2] + 24}
- -- textPositioning.horizontalAnchor = "right"
- -- canvas:drawText("^#fff7;" .. tostring(speaker.speakerId), textPositioning, 16, nil, nil, nil, FONT_DIRECTIVES)
- --end
---
- --if input.mouseDown("MouseLeft") then
- -- local muted = not voice.muted(speaker.speakerId)
- -- interface.queueMessage((muted and "^#f43030;Muted^reset; " or "^#31d2f7;Unmuted^reset; ") .. speaker.name, 4, 0.5)
- -- voice.setMuted(speaker.speakerId, muted)
- --end
+ if input.keyHeld("LShift") then
+ textPositioning.position = {pos[1] + 288, pos[2] + 24}
+ textPositioning.horizontalAnchor = "right"
+ canvas:drawText("^#fff7,font=iosevka-semibold;" .. tostring(speaker.speakerId), textPositioning, 16, nil, nil, nil, FONT_DIRECTIVES)
+ end
+
+ if input.mouseDown("MouseLeft") then
+ local muted = not voice.speakerMuted(speaker.speakerId)
+ interface.queueMessage((muted and "^#f43030;Muted^reset; " or "^#31d2f7;Unmuted^reset; ") .. speaker.name, 4, 0.5)
+ voice.setSpeakerMuted(speaker.speakerId, muted)
+ speaker.muted = muted
+ end
end
end