Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "base/internal/ui/reflexcore";
- volumeControl = {canHide = false; canPosition = false;};
- registerWidget("volumeControl");
- function volumeControl:initialize()
- widgetCreateConsoleVariable("increment", "float", 0);
- end
- function volumeControl:draw()
- local volumeIncrement = clampTo4Decimal(widgetGetConsoleVariable("increment"));
- if volumeIncrement ~= 0 then
- local newVolume = clamp(clampTo4Decimal(consoleGetVariable("s_volume")) + volumeIncrement, 0, 1);
- consolePerformCommand("s_volume " .. newVolume);
- consolePrint("s_volume " .. newVolume);
- widgetSetConsoleVariable("increment", 0);
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement