fix(camera): restore Tab toggle and FaceCam mode from user config
This commit is contained in:
1 parent
a396f1227c
commit
1f04ea4440
2 files changed
+13
-42
No files matched your search
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
"auto_technique_food": true,
|
"auto_technique_food": true,
|
||||||
"camera_settings": {
|
"camera_settings": {
|
||||||
"distance": 2,
|
"distance": 2,
|
||||||
"mode": "freecam"
|
"mode": "facecam"
|
||||||
},
|
},
|
||||||
"currency_wars": {
|
"currency_wars": {
|
||||||
"52022": {
|
"52022": {
|
||||||
|
|||||||
+12
-41
@@ -555,44 +555,16 @@ function _G.__FREECAM_TICK()
|
|||||||
_G.__FC_INPUT_FRAME = frame
|
_G.__FC_INPUT_FRAME = frame
|
||||||
|
|
||||||
-- Hotkey Handling:
|
-- Hotkey Handling:
|
||||||
-- F7: Toggle FaceCam directly
|
-- Tab: Main toggle (as set by user)
|
||||||
-- F8: Toggle FreeCam directly
|
-- F8 / Insert: Alternate toggles
|
||||||
-- Insert: Toggle active / last camera mode
|
if Input.GetKeyDown(KeyCode.Tab) or Input.GetKeyDown(KeyCode.F8) or Input.GetKeyDown(KeyCode.Insert) then
|
||||||
local toggleFaceCam = Input.GetKeyDown(KeyCode.F7)
|
_G.__FREECAM_ENABLED = not _G.__FREECAM_ENABLED
|
||||||
local toggleFreeCam = Input.GetKeyDown(KeyCode.F8)
|
|
||||||
local toggleInsert = Input.GetKeyDown(KeyCode.Insert)
|
|
||||||
|
|
||||||
if toggleFaceCam or toggleFreeCam or toggleInsert then
|
|
||||||
local settings = _G.__GAC_CAMERA_SETTINGS or {mode="freecam", distance=2}
|
|
||||||
local defaultMode = settings.mode or "freecam"
|
|
||||||
|
|
||||||
if toggleFaceCam then
|
|
||||||
if _G.__FREECAM_ENABLED and _G.__FC_ACTIVE_MODE == "facecam" then
|
|
||||||
_G.__FREECAM_ENABLED = false
|
|
||||||
else
|
|
||||||
_G.__FREECAM_ENABLED = true
|
|
||||||
_G.__FC_ACTIVE_MODE = "facecam"
|
|
||||||
end
|
|
||||||
elseif toggleFreeCam then
|
|
||||||
if _G.__FREECAM_ENABLED and _G.__FC_ACTIVE_MODE == "freecam" then
|
|
||||||
_G.__FREECAM_ENABLED = false
|
|
||||||
else
|
|
||||||
_G.__FREECAM_ENABLED = true
|
|
||||||
_G.__FC_ACTIVE_MODE = "freecam"
|
|
||||||
end
|
|
||||||
elseif toggleInsert then
|
|
||||||
_G.__FREECAM_ENABLED = not _G.__FREECAM_ENABLED
|
|
||||||
if _G.__FREECAM_ENABLED and not _G.__FC_ACTIVE_MODE then
|
|
||||||
_G.__FC_ACTIVE_MODE = defaultMode
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
_G.__FC_LAST_TIME = nil
|
_G.__FC_LAST_TIME = nil
|
||||||
local cam = get_active_cam()
|
local cam = get_active_cam()
|
||||||
local activeMode = _G.__FC_ACTIVE_MODE or defaultMode
|
local settings = _G.__GAC_CAMERA_SETTINGS or {mode="facecam", distance=2}
|
||||||
|
|
||||||
if _G.__FREECAM_ENABLED then
|
if _G.__FREECAM_ENABLED then
|
||||||
if activeMode == "facecam" then
|
if settings.mode == "facecam" then
|
||||||
_G.__FC_FACE_DISTANCE = tonumber(settings.distance) or 2
|
_G.__FC_FACE_DISTANCE = tonumber(settings.distance) or 2
|
||||||
local head, root
|
local head, root
|
||||||
if cam then head, root = facecam_target(cam) end
|
if cam then head, root = facecam_target(cam) end
|
||||||
@@ -607,10 +579,10 @@ function _G.__FREECAM_TICK()
|
|||||||
_G.__FC_EULER = cam.transform.eulerAngles
|
_G.__FC_EULER = cam.transform.eulerAngles
|
||||||
set_cinemachine_enabled(cam, false)
|
set_cinemachine_enabled(cam, false)
|
||||||
end
|
end
|
||||||
if activeMode == "facecam" then
|
if settings.mode == "facecam" then
|
||||||
show_ui("<color=#00FF88><b>[FaceCam: ON]</b> | F7/Insert: Close | Scroll: Dist | F8: FreeCam</color>")
|
show_ui("<color=#00FF88><b>[FaceCam: ON]</b> | Tab: Close | Scroll: Distance</color>")
|
||||||
else
|
else
|
||||||
show_ui("<color=#00FF88><b>[FreeCam: ON]</b> Speed: " .. string.format("%.1f", _G.__FREECAM_SPEED) .. " | Arrows: Fly | PgUp/PgDn: Height | RMB: Look | F8/Insert: Close | F7: FaceCam</color>")
|
show_ui("<color=#00FF88><b>[FreeCam: ON]</b> Speed: " .. string.format("%.1f", _G.__FREECAM_SPEED) .. " | Arrows: Fly | PgUp/PgDn: Height | RMB: Look | Tab: Close</color>")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if cam then
|
if cam then
|
||||||
@@ -624,7 +596,7 @@ function _G.__FREECAM_TICK()
|
|||||||
_G.__FC_FACE_DISTANCE, _G.__FC_FACE_LOCAL_FORWARD = nil, nil
|
_G.__FC_FACE_DISTANCE, _G.__FC_FACE_LOCAL_FORWARD = nil, nil
|
||||||
_G.__FC_FACE_MISSING_SINCE = nil
|
_G.__FC_FACE_MISSING_SINCE = nil
|
||||||
if _G.__FC_FACE_ANCHOR then CS.UnityEngine.Object.Destroy(_G.__FC_FACE_ANCHOR); _G.__FC_FACE_ANCHOR = nil end
|
if _G.__FC_FACE_ANCHOR then CS.UnityEngine.Object.Destroy(_G.__FC_FACE_ANCHOR); _G.__FC_FACE_ANCHOR = nil end
|
||||||
local label = (activeMode == 'facecam') and 'FaceCam' or 'FreeCam'
|
local label = (settings.mode == 'facecam') and 'FaceCam' or 'FreeCam'
|
||||||
show_ui('<color=#00FF88><b>[' .. label .. ': OFF]</b></color>')
|
show_ui('<color=#00FF88><b>[' .. label .. ': OFF]</b></color>')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -694,10 +666,9 @@ function _G.__FREECAM_TICK()
|
|||||||
if _G.__FREECAM_ENABLED then
|
if _G.__FREECAM_ENABLED then
|
||||||
local cam = get_active_cam()
|
local cam = get_active_cam()
|
||||||
if cam then
|
if cam then
|
||||||
local settings = _G.__GAC_CAMERA_SETTINGS or {mode="freecam", distance=2}
|
local settings = _G.__GAC_CAMERA_SETTINGS or {mode="facecam", distance=2}
|
||||||
local activeMode = _G.__FC_ACTIVE_MODE or settings.mode or "freecam"
|
|
||||||
|
|
||||||
if activeMode == "facecam" then
|
if settings.mode == "facecam" then
|
||||||
if not update_facecam(cam, settings) then
|
if not update_facecam(cam, settings) then
|
||||||
set_cinemachine_enabled(cam, true)
|
set_cinemachine_enabled(cam, true)
|
||||||
_G.__FREECAM_ENABLED = false
|
_G.__FREECAM_ENABLED = false
|
||||||
|
|||||||
Reference in new issue
Block a user