Skip to content

Commit 84b68ff

Browse files
committed
Refactor logging to use Logger module
Replaces `print` statements with `Logger.debug` and `Logger.info` calls. This improves log management by allowing for different log levels and easier filtering of log messages.
1 parent 9fe0d84 commit 84b68ff

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Data/Base.rte/Devices/Tools/GrappleGun/Scripts/RopeInputController.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,24 +223,24 @@ function RopeInputController.handleShiftMousewheelControls(grappleInstance, cont
223223
return false
224224
end
225225

226-
print("[SHIFT+WHEEL DEBUG] Starting shift mousewheel check")
226+
Logger.debug("RopeInputController.handleShiftMousewheelControls() - Starting shift mousewheel check")
227227

228228
-- Only allow when gun is equipped and grapple is attached
229229
if grappleInstance.actionMode <= 1 then
230-
print("[SHIFT+WHEEL DEBUG] Action mode is " .. grappleInstance.actionMode .. " (not attached)")
230+
Logger.debug("RopeInputController.handleShiftMousewheelControls() - Action mode is %d (not attached)", grappleInstance.actionMode)
231231
return false
232232
end
233233

234234
if not isCurrentlyEquipped(grappleInstance) then
235-
print("[SHIFT+WHEEL DEBUG] Gun not currently equipped")
235+
Logger.debug("RopeInputController.handleShiftMousewheelControls() - Gun not currently equipped")
236236
return false
237237
end
238238

239-
print("[SHIFT+WHEEL DEBUG] Equipment and attachment checks passed")
239+
Logger.debug("RopeInputController.handleShiftMousewheelControls() - Equipment and attachment checks passed")
240240

241241
-- Check for actual keyboard SHIFT key
242242
local shiftHeld = controller:IsState(Controller.KEYBOARD_SHIFT)
243-
print("[SHIFT+WHEEL DEBUG] Keyboard SHIFT held (KEYBOARD_SHIFT): " .. tostring(shiftHeld))
243+
Logger.debug("RopeInputController.handleShiftMousewheelControls() - Keyboard SHIFT held (KEYBOARD_SHIFT): %s", tostring(shiftHeld))
244244

245245
if not shiftHeld then
246246
return false
@@ -250,13 +250,13 @@ function RopeInputController.handleShiftMousewheelControls(grappleInstance, cont
250250
local scrollUp = controller:IsState(Controller.SCROLL_UP)
251251
local scrollDown = controller:IsState(Controller.SCROLL_DOWN)
252252

253-
print("[SHIFT+WHEEL DEBUG] Scroll up: " .. tostring(scrollUp) .. ", Scroll down: " .. tostring(scrollDown))
253+
Logger.debug("RopeInputController.handleShiftMousewheelControls() - Scroll up: %s, Scroll down: %s", tostring(scrollUp), tostring(scrollDown))
254254

255255
if not scrollUp and not scrollDown then
256256
return false
257257
end
258258

259-
print("[SHIFT+WHEEL DEBUG] SHIFT + Mousewheel detected!")
259+
Logger.info("RopeInputController.handleShiftMousewheelControls() - SHIFT + Mousewheel detected!")
260260

261261
-- IMPORTANT: Clear the scroll states to prevent weapon switching
262262
controller:SetState(Controller.SCROLL_UP, false)
@@ -270,18 +270,18 @@ function RopeInputController.handleShiftMousewheelControls(grappleInstance, cont
270270

271271
if scrollUp then
272272
lengthChange = -preciseScrollSpeed -- Shorten rope
273-
print("[SHIFT+WHEEL DEBUG] Shortening rope by " .. preciseScrollSpeed)
273+
Logger.info("RopeInputController.handleShiftMousewheelControls() - Shortening rope by %.1f", preciseScrollSpeed)
274274
elseif scrollDown then
275275
lengthChange = preciseScrollSpeed -- Lengthen rope
276-
print("[SHIFT+WHEEL DEBUG] Lengthening rope by " .. preciseScrollSpeed)
276+
Logger.info("RopeInputController.handleShiftMousewheelControls() - Lengthening rope by %.1f", preciseScrollSpeed)
277277
end
278278

279279
-- Update rope length
280280
local oldLength = grappleInstance.currentLineLength
281281
grappleInstance.currentLineLength = math.max(10, math.min(grappleInstance.currentLineLength + lengthChange, grappleInstance.maxLineLength))
282282
grappleInstance.setLineLength = grappleInstance.currentLineLength
283283

284-
print("[SHIFT+WHEEL DEBUG] Rope length changed from " .. oldLength .. " to " .. grappleInstance.currentLineLength)
284+
Logger.info("RopeInputController.handleShiftMousewheelControls() - Rope length changed from %.1f to %.1f", oldLength, grappleInstance.currentLineLength)
285285

286286
-- Clear any automatic selections since user is manually controlling
287287
grappleInstance.pieSelection = 0

0 commit comments

Comments
 (0)