screens/playerhud.lua
303132333435363738394041
self.vig:GetAnimState():SetBuild("vig")
self.vig:GetAnimState():SetBank("vig")
self.vig:GetAnimState():PlayAnimation("basic", true)
self.vig:SetHAnchor(ANCHOR_LEFT)
self.vig:SetVAnchor(ANCHOR_TOP)
self.vig:SetScaleMode(SCALEMODE_FIXEDPROPORTIONAL)
self.vig:SetClickable(false)
self.bloodover = self.overlayroot:AddChild(BloodOver())
self.iceover = self.overlayroot:AddChild(IceOver(owner))
self.fireover = self.overlayroot:AddChild(FireOver(owner))
self.iceover:Hide()
30313233343536373839404142
self.vig:GetAnimState():SetBuild("vig")
self.vig:GetAnimState():SetBank("vig")
self.vig:GetAnimState():PlayAnimation("basic", true)
self.vig:SetHAnchor(ANCHOR_MIDDLE)
self.vig:SetVAnchor(ANCHOR_MIDDLE)
self.vig:SetScaleMode(SCALEMODE_FIXEDPROPORTIONAL)
self.vig:SetClickable(false)
self.bloodover = self.overlayroot:AddChild(BloodOver(owner))
self.iceover = self.overlayroot:AddChild(IceOver(owner))
self.fireover = self.overlayroot:AddChild(FireOver(owner))
self.iceover:Hide()
65666768697071
self:CloseControllerInventory()
end
self.owner.components.inventory:ReturnActiveItem()
self.controls.hover:Hide()
end
66676869707172737475
self:CloseControllerInventory()
end
local is_controller_attached = TheInput:ControllerAttached()
if is_controller_attached then
self.owner.components.inventory:ReturnActiveItem()
end
self.controls.hover:Hide()
end
171172173174175176177178
self.inst:ListenForEvent("badaura", function(inst, data) return self.bloodover:Flash() end, self.owner)
self.inst:ListenForEvent("attacked", function(inst, data) return self.bloodover:Flash() end, self.owner)
self.inst:ListenForEvent("startstarving", function(inst, data) self.bloodover:TurnOn() end, self.owner)
self.inst:ListenForEvent("stopstarving", function(inst, data) self.bloodover:TurnOff() end, self.owner)
self.inst:ListenForEvent("gosane", function(inst, data) self:GoSane() end, self.owner)
self.inst:ListenForEvent("goinsane", function(inst, data) self:GoInsane() end, self.owner)
175176177178179180181182183184
self.inst:ListenForEvent("badaura", function(inst, data) return self.bloodover:Flash() end, self.owner)
self.inst:ListenForEvent("attacked", function(inst, data) return self.bloodover:Flash() end, self.owner)
self.inst:ListenForEvent("startstarving", function(inst, data) self.bloodover:UpdateState() end, self.owner)
self.inst:ListenForEvent("stopstarving", function(inst, data) self.bloodover:UpdateState() end, self.owner)
self.inst:ListenForEvent("startfreezing", function(inst, data) self.bloodover:UpdateState() end, self.owner)
self.inst:ListenForEvent("stopfreezing", function(inst, data) self.bloodover:UpdateState() end, self.owner)
self.inst:ListenForEvent("gosane", function(inst, data) self:GoSane() end, self.owner)
self.inst:ListenForEvent("goinsane", function(inst, data) self:GoInsane() end, self.owner)
207208209210211212213214215216217
TheFrontEnd:StopTrackingMouse()
self:CloseControllerCrafting()
self.controls.inv:OpenControllerInventory()
self.owner.components.playercontroller:OnUpdate(0)
end
function PlayerHud:CloseControllerInventory()
TheFrontEnd:GetSound():PlaySound("dontstarve/HUD/craft_close")
self.controls.inv:CloseControllerInventory()
end
213214215216217218219220221222223224225226
TheFrontEnd:StopTrackingMouse()
self:CloseControllerCrafting()
self.controls.inv:OpenControllerInventory()
self.controls:ShowStatusNumbers()
self.owner.components.playercontroller:OnUpdate(0)
end
function PlayerHud:CloseControllerInventory()
TheFrontEnd:GetSound():PlaySound("dontstarve/HUD/craft_close")
self.controls:HideStatusNumbers()
self.controls.inv:CloseControllerInventory()
end
225226227228229230
self:CloseControllerInventory()
self.controls.inv:Disable()
self.controls.crafttabs:OpenControllerCrafting()
end
function PlayerHud:CloseControllerCrafting()
234235236237238239240241242
self:CloseControllerInventory()
self.controls.inv:Disable()
self.controls.crafttabs:OpenControllerCrafting()
self.owner.components.locomotor:Stop()
--self.owner.components.playercontroller.draggingonground = false
--self.owner.components.playercontroller.startdragtime = nil
end
function PlayerHud:CloseControllerCrafting()