chore: aufgeraeumt nach der Abnahme
Lampen-Prop entfernt. Seit der Umstellung auf die spieleigene Scuba-Lampe war es funktionslos: standardmaessig aus, nie verifiziert, und eine Polizei-Taschenlampe am Kopf haette neben dem nativen Licht nur Deko gespielt. Damit fallen auch die Debug-Befehle /divelamp und /divelampcheck weg, samt config.debug und vier Config-Werten. Zwoelf Upstream-Locales geloescht. Sie hatten 8 von 26 Keys - im Spiel waeren dort rohe Key-Namen erschienen. Gepflegt werden DE und EN. PLAN.md war ein Vorab-Plan mit Phasen und Aufwandsschaetzungen und damit erledigt. Ersetzt durch ENTSCHEIDUNGEN.md: warum die Dinge so gebaut sind und welche Fallstricke dahinterstecken - onCache-Timing, consume, decay, SetMetadata, die Atemgas-Grenze, das transform-origin am Zeiger. Also das, was beim naechsten Anfassen wirklich hilft. README von den Abschnitten befreit, die es nicht mehr gibt. Bilder und Icons neu erzeugt. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,6 @@ local shared = require 'config.shared'
|
||||
local currentGear = {
|
||||
mask = 0,
|
||||
tank = 0,
|
||||
lamp = 0,
|
||||
enabled = false
|
||||
}
|
||||
|
||||
@@ -140,12 +139,6 @@ local function deleteGear()
|
||||
DeleteEntity(currentGear.tank)
|
||||
currentGear.tank = 0
|
||||
end
|
||||
|
||||
if currentGear.lamp ~= 0 then
|
||||
DetachEntity(currentGear.lamp, false, true)
|
||||
DeleteEntity(currentGear.lamp)
|
||||
currentGear.lamp = 0
|
||||
end
|
||||
end
|
||||
|
||||
--- Hängt ein Prop hart an einen Ped-Bone.
|
||||
@@ -171,25 +164,11 @@ local function attachProp(ped, model, bone, offset, rotation)
|
||||
return prop
|
||||
end
|
||||
|
||||
--- Lampen-Model einmalig prüfen. lib.requestModel wirft bei ungültigen Models einen
|
||||
--- Error - ohne diese Prüfung würde ein falsch geschriebener Prop-Name die komplette
|
||||
--- Ausrüstung unbenutzbar machen, statt nur die Optik der Lampe zu kosten.
|
||||
local lampModel = config.lampProp ~= '' and joaat(config.lampProp) or nil
|
||||
local hasLampProp = lampModel ~= nil and (IsModelValid(lampModel) or IsModelInCdimage(lampModel))
|
||||
|
||||
if lampModel and not hasLampProp then
|
||||
lib.print.warn(('lampProp "%s" ist kein gültiges Model - die Lampe leuchtet, das Prop fehlt.'):format(config.lampProp))
|
||||
end
|
||||
|
||||
--- @param ped number? default cache.ped
|
||||
local function attachGear(ped)
|
||||
ped = ped or cache.ped
|
||||
currentGear.tank = attachProp(ped, TANK_MODEL, TANK_BONE, vec3(-0.25, -0.25, 0.0), vec3(180.0, 90.0, 0.0))
|
||||
currentGear.mask = attachProp(ped, MASK_MODEL, MASK_BONE, vec3(0.0, 0.0, 0.0), vec3(180.0, 90.0, 0.0))
|
||||
|
||||
if hasLampProp then
|
||||
currentGear.lamp = attachProp(ped, lampModel, config.lampBone, config.lampPropOffset, config.lampPropRotation)
|
||||
end
|
||||
end
|
||||
|
||||
--- @param state boolean
|
||||
@@ -217,8 +196,6 @@ local function isPropIntact(prop)
|
||||
end
|
||||
|
||||
local function isGearIntact()
|
||||
if hasLampProp and not isPropIntact(currentGear.lamp) then return false end
|
||||
|
||||
return isPropIntact(currentGear.mask) and isPropIntact(currentGear.tank)
|
||||
end
|
||||
|
||||
@@ -672,57 +649,6 @@ lib.addKeybind({
|
||||
end
|
||||
})
|
||||
|
||||
--- Wo Prop und Lichtkegel am Bone sitzen, lässt sich nicht am Schreibtisch
|
||||
--- erraten - das hängt daran, wie das Model selbst ausgerichtet ist. Diese Befehle
|
||||
--- ändern die Werte im laufenden Spiel und geben die Zeile zum Übernehmen aus,
|
||||
--- damit nicht pro Versuch die Resource neu gestartet werden muss.
|
||||
---
|
||||
--- lib.require cached Module, main.lua und light.lua teilen sich also dieselbe
|
||||
--- config-Tabelle - das Licht zieht sofort mit.
|
||||
if config.debug then
|
||||
--- @return vector3?
|
||||
local function readVec(args, from)
|
||||
local x, y, z = tonumber(args[from]), tonumber(args[from + 1]), tonumber(args[from + 2])
|
||||
|
||||
if not x or not y or not z then return end
|
||||
|
||||
return vec3(x, y, z)
|
||||
end
|
||||
|
||||
local function fmtVec(v)
|
||||
return ('vec3(%.2f, %.2f, %.2f)'):format(v.x, v.y, v.z)
|
||||
end
|
||||
|
||||
RegisterCommand('divelamp', function(_, args)
|
||||
local offset, rotation = readVec(args, 1), readVec(args, 4)
|
||||
|
||||
if not offset or not rotation then
|
||||
lib.print.info('/divelamp <x> <y> <z> <rx> <ry> <rz> - Sitz des Lampen-Props')
|
||||
return
|
||||
end
|
||||
|
||||
config.lampPropOffset, config.lampPropRotation = offset, rotation
|
||||
|
||||
if currentGear.enabled then
|
||||
deleteGear()
|
||||
attachGear()
|
||||
end
|
||||
|
||||
lib.print.info(('lampPropOffset = %s,\nlampPropRotation = %s,'):format(fmtVec(offset), fmtVec(rotation)))
|
||||
end, false)
|
||||
|
||||
--- Die Spiel-Lampe braucht die Scuba-Kleidung am Ped. Dieser Befehl sagt, ob
|
||||
--- das aktuelle Outfit sie überhaupt hat - sonst rätselt man, warum nichts
|
||||
--- leuchtet.
|
||||
RegisterCommand('divelampcheck', function()
|
||||
SetEnableScubaGearLight(cache.ped, true)
|
||||
local works = IsScubaGearLightEnabled(cache.ped)
|
||||
SetEnableScubaGearLight(cache.ped, lampOn)
|
||||
|
||||
lib.print.info(('Scuba-Lampe am aktuellen Outfit: %s'):format(works and 'ja' or 'nein'))
|
||||
end, false)
|
||||
end
|
||||
|
||||
--- Beim Model-Wechsel (Kleiderladen, Skin-Change) ist der Ped ein anderer -
|
||||
--- alle attached Props sind weg und die Scuba-Flags gelten für den alten Ped.
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user