1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00

Отдебажено, но отладочные сообщения пока не убраны

This commit is contained in:
Moon Horse
2024-07-29 16:49:16 +03:00
parent da69266e29
commit b433315c1f
7 changed files with 60 additions and 40 deletions

View File

@@ -272,7 +272,7 @@ ENT.ButtonMap["Voltages"] = {
buttons = {
{ID = "!BatteryVoltage", x=0, y=0, w=72.5,h=75, tooltip="",tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.BatteryVoltage"),ent:GetPackedRatio("BatteryVoltage")*150) end},
{ID = "!BatteryCurrent", x=72.5, y=0, w=72.5,h=75, tooltip="",tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.BatteryCurrent"),ent:GetPackedRatio("BatteryCurrent")*500) end},
{ID = "!BatteryCurrent", x=72.5, y=0, w=72.5,h=75, tooltip="",tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.BatteryCurrent"),(ent:GetPackedRatio("BatteryCurrent")-0.5)*500/0.5) end},
}
}
ENT.ButtonMap["Pressures"] = {
@@ -995,7 +995,7 @@ function ENT:Think()
self:Animate("train_line", self:GetPackedRatio("TLPressure"),0.14, 0.875, 256,2)--,,0.01)
self:Animate("brake_cylinder", self:GetPackedRatio("BCPressure"),0.14, 0.875, 256,2)--,,0.03)
self:Animate("voltmeter", self:GetPackedRatio("BatteryVoltage"),0.601, 0.400)
self:Animate("ampermeter", 0.5+self:GetPackedRatio("BatteryCurrent"),0.604, 0.398)
self:Animate("ampermeter", self:GetPackedRatio("BatteryCurrent"),0.604, 0.398)
local typ = self:GetNW2Int("LampType",1)
if self.LampType ~= typ then

View File

@@ -132,7 +132,7 @@ function ENT:Initialize()
},
}
--self.BattCurrent = 0
self.eds_eq = 0
--self.eds_eq = 0
-- Cross connections in train wires
self.TrainWireInverts = {
@@ -388,7 +388,7 @@ function ENT:Think()
----------------------------------*****************************--------------------------------]]
self:SetPackedRatio("BatteryVoltage",(self.Battery.eds_eq)/150.0)
self:SetPackedRatio("BatteryCurrent",self.Battery.Ibatt/1000)
self:SetPackedRatio("BatteryCurrent",0.5 + 0.5*self.Battery.Ibatt/500.0)
self:SetPackedRatio("EnginesCurrent", 0.5 + 0.5*(self.Electric.I24/500.0))
self:SetPackedBool("Compressor",Pneumatic.Compressor > 0)

View File

@@ -225,7 +225,7 @@ function ENT:Initialize()
self.OtsekDoor1 = false
self.OtsekDoor2 = false
--self.BattCurrent = 0
self.eds_eq = 0
--self.eds_eq = 0
self.Lamps = {
broken = {},
@@ -387,14 +387,14 @@ function ENT:TrainSpawnerUpdate()
self.Battery:TriggerInput("CarType",1)
--self.Battery:TriggerInput("InitialVoltage",math.random(62,75))
self.Battery:TriggerInput("Dischargeable",self:GetNW2Bool("BattCharge"))
local ccc = 0
--[[local ccc = 0
self.ComputerCar = false
for k,v in ipairs(self.WagonList) do
if v.AR63 and v.ComputerCar then ccc = ccc + 1; break end
end
if ccc == 0 then
self.ComputerCar = true
end
end]]
math.randomseed(num+817171)
if self.CustomSettings then
--{"Type","Spawner.717.Type","List",{"Spawner.717.Type.717","Spawner.717.Type.7175"}},