⚔ Console Modes
Gamepad users have two distinct modes: Combat and Inventory. Each mode enables different binds and controls, with automatic switching based on user interaction.
Mode Overview
Understanding Combat vs Inventory modes
Combat Mode
DefaultCharacter controls are active. Inventory interaction is disabled. Quick hotbar access for equipping items during gameplay.
Enabled Binds
Disabled Features
Inventory Mode
ToggleCharacter controls are suppressed. UI navigation is active. Full inventory management with selection-based actions.
Enabled Binds
Disabled Features
Mode Switching
How to transition between modes
Long Press L3
Hold the left stick (L3) for 0.5 seconds to toggle between modes.
Context Switch
ConsoleModeManager enables/disables IllusionIAS contexts automatically.
Visual Indicator
Badge appears showing current mode with color coding.
-- src/client/StowayClientv1_2/Input/ConsoleModeManager.luau
-- Long press duration (seconds)
local LONG_PRESS_DURATION = 0.5
-- Detection logic
switchAction.Activated:Connect(function(active, pressed)
if pressed then
isPressed = true
-- Schedule toggle after duration
longPressTask = task.delay(LONG_PRESS_DURATION, function()
if isPressed then
ConsoleModeManager.ToggleMode()
end)
else
isPressed = false
if longPressTask then
task.cancel(longPressTask)
longPressTask = nil
end
end
end)
Visual Mode Indicator
HUD badge showing current mode
A small badge appears in the bottom-right corner showing the current mode:
Combat Mode
Reddish badge, character controls active
Inventory Mode
Greenish badge, shows selection state
function CreateModeIndicator()
local player = game.GetService("Players").LocalPlayer
modeIndicatorGui = Instance.new("ScreenGui")
modeIndicatorGui.Name = "StowayConsoleHUD"
modeIndicatorGui.Parent = player:WaitForChild("PlayerGui")
local bg = Instance.new("Frame")
bg.Name = "ModeBadge"
bg.Size = UDim2.fromOffset(150, 40)
bg.Position = UDim2.new(0.95, -160, 0.85, 0)
bg.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
bg.Parent = modeIndicatorGui
modeTextLabel = Instance.new("TextLabel")
modeTextLabel.Text = "COMBAT"
modeTextLabel.TextColor3 = Color3.fromRGB(255, 100, 100) -- Red
modeTextLabel.Parent = bg
end
Mode Transition Behavior
What happens when switching modes
| Action | Switching to Combat | Switching to Inventory |
|---|---|---|
InputManager |
Combat context enabled | Inventory context enabled |
SelectionManager |
Disabled, clears selection | Enabled |
GuiService |
GuiNavigationEnabled = false | GuiNavigationEnabled = true |
Mode Indicator |
"COMBAT" (red) | "SELECTING" (green) |
Hooks |
OnDeselect fired | - |
Code Structure
ConsoleModeManager implementation
local ConsoleModeManager = {}
local CurrentMode = "" -- "Combat" | "Inventory"
-- Set mode directly
function ConsoleModeManager.SetMode(modeName)
if CurrentMode == modeName then return end
CurrentMode = modeName
if modeName == "Combat" then
InputManager.SetCombatEnabled(true)
InputManager.SetInventoryEnabled(false)
SelectionManager.SetEnabled(false)
GuiService.GuiNavigationEnabled = false
GuiService.SelectedObject = nil
if modeTextLabel then
modeTextLabel.Text = "⚔ COMBAT"
modeTextLabel.TextColor3 = Color3.fromRGB(255, 100, 100)
end
elseif modeName == "Inventory" then
InputManager.SetCombatEnabled(false)
InputManager.SetInventoryEnabled(true)
SelectionManager.SetEnabled(true)
GuiService.GuiNavigationEnabled = true
if modeTextLabel then
modeTextLabel.Text = "🎒 SELECTING"
modeTextLabel.TextColor3 = Color3.fromRGB(100, 255, 150)
end
end
end
-- Toggle between modes
function ConsoleModeManager.ToggleMode()
if CurrentMode == "Combat" then
ConsoleModeManager.SetMode("Inventory")
else
ConsoleModeManager.SetMode("Combat")
end
end
return ConsoleModeManager
State Callback
React to mode changes
SelectionManager provides a callback that updates the mode indicator text when selection state changes:
-- Connected in SetMode when entering Inventory mode
SelectionManager.OnStateChanged = function(newDesc)
if modeTextLabel then
modeTextLabel.Text = "🎒 " .. newDesc
end
end
-- Returns descriptions like:
-- "🖼 SELECTING" (idle)
-- "🔄 SWAP - SELECT TARGET" (source selected)
-- "🗑 DROPPING ITEM" (dropping)
Customization
Modifying mode behavior
Related Documentation
See also