changed naming

master
cheetah 4 years ago
parent 32a139e801
commit d3a12bb6f5

@ -46,40 +46,40 @@ table.insert(FoodItems, {
WolfskySnackMachineIcons = {} SnackMachineIcons = {}
WolfskySnackMachineIcons["Duff Bier"] = "beercan1" SnackMachineIcons["Duff Bier"] = "beercan1"
WolfskySnackMachineIcons["Pißwasser Bier"] = "beercan2" SnackMachineIcons["Pißwasser Bier"] = "beercan2"
WolfskySnackMachineIcons["Cola"] = "sodacola" SnackMachineIcons["Cola"] = "sodacola"
WolfskySnackMachineIcons["Apfelsaft"] = "applejuice" SnackMachineIcons["Apfelsaft"] = "applejuice"
WolfskySnackMachineIcons["Orangensaft"] = "orangejuice" SnackMachineIcons["Orangensaft"] = "orangejuice"
WolfskySnackMachineIcons["Sprunk"] = "sodasprunk1" SnackMachineIcons["Sprunk"] = "sodasprunk1"
WolfskySnackMachineIcons["Milch"] = "milk2" SnackMachineIcons["Milch"] = "milk2"
WolfskySnackMachineIcons["Monster Energy"] = "sodacanb01" SnackMachineIcons["Monster Energy"] = "sodacanb01"
WolfskySnackMachineIcons["Monster Energy Lite"] = "sodacanb02" SnackMachineIcons["Monster Energy Lite"] = "sodacanb02"
WolfskySnackMachineIcons["Monster Energy Assult"] = "sodacanb03" SnackMachineIcons["Monster Energy Assult"] = "sodacanb03"
WolfskySnackMachineIcons["Bagel"] = "bagel1" SnackMachineIcons["Bagel"] = "bagel1"
WolfskySnackMachineIcons["Eiscreme Blaubeer"] = "icecream1b" SnackMachineIcons["Eiscreme Blaubeer"] = "icecream1b"
WolfskySnackMachineIcons["Eiscreme Banane"] = "icecream2b" SnackMachineIcons["Eiscreme Banane"] = "icecream2b"
WolfskySnackMachineIcons["Eiscreme Erdbeere"] = "icecream3b" SnackMachineIcons["Eiscreme Erdbeere"] = "icecream3b"
WolfskySnackMachineIcons["Eiscreme Waldmeister"] = "icecream5b" SnackMachineIcons["Eiscreme Waldmeister"] = "icecream5b"
WolfskySnackMachineIcons["Toblerone"] = "toblerone" SnackMachineIcons["Toblerone"] = "toblerone"
WolfskySnackMachineIcons["Apfel"] = "fruitapple2" SnackMachineIcons["Apfel"] = "fruitapple2"
WolfskySnackMachineIcons["Banane"] = "fruitbanana" SnackMachineIcons["Banane"] = "fruitbanana"
WolfskySnackMachineIcons["Bananen Bund"] = "fruitbananabunch" SnackMachineIcons["Bananen Bund"] = "fruitbananabunch"
WolfskySnackMachineIcons["Wassermelone"] = "fruitwatermelon" SnackMachineIcons["Wassermelone"] = "fruitwatermelon"
WolfskySnackMachineIcons["Wassermelone Hälfte"] = "fruitwatermelonhalf" SnackMachineIcons["Wassermelone Hälfte"] = "fruitwatermelonhalf"
WolfskySnackMachineIcons["Wassermelone Stück"] = "fruitwatermelonslice" SnackMachineIcons["Wassermelone Stück"] = "fruitwatermelonslice"
WolfskySnackMachineIcons["Ananas"] = "fruitpineapple" SnackMachineIcons["Ananas"] = "fruitpineapple"
WolfskySnackMachineIcons["Hamburger"] = "burger2" SnackMachineIcons["Hamburger"] = "burger2"
WolfskySnackMachineIcons["Chicken Burger"] = "burger2" SnackMachineIcons["Chicken Burger"] = "burger2"
WolfskySnackMachineIcons["Cheeseburger"] = "mcdburgerbox" SnackMachineIcons["Cheeseburger"] = "mcdburgerbox"
WolfskySnackMachineIcons["Fisch Burger"] = "icecream3b" SnackMachineIcons["Fisch Burger"] = "icecream3b"
WolfskySnackMachineIcons["Bigmac"] = "mcdburger" SnackMachineIcons["Bigmac"] = "mcdburger"
WolfskySnackMachineIcons["Hot Dog"] = "hotdog" SnackMachineIcons["Hot Dog"] = "hotdog"
WolfskySnackMachineIcons["Pizza"] = "pizza2" SnackMachineIcons["Pizza"] = "pizza2"
--[[ --[[
] fagget_test ] fagget_test
0011001101000110011111101000101 0011001101000110011111101000101
@ -89,8 +89,8 @@ WolfskySnackMachineIcons["Pizza"] = "pizza2"
0010101000111110111100010010100 0010101000111110111100010010100
]] ]]
ENT.WolfskySnackMachineMatBuffer = {} ENT.SnackMachineMatBuffer = {}
WolfskySnackMachineAssosciations = {} SnackMachineAssosciations = {}
ENT.ClassIndex = {} ENT.ClassIndex = {}
ENT.TakenIDsCNT = 0 ENT.TakenIDsCNT = 0
ENT.AllowedFood = "" ENT.AllowedFood = ""
@ -109,7 +109,7 @@ function ENT:Initialize()
self:SetNWString("DisplayText","READY") self:SetNWString("DisplayText","READY")
MsgN("initializing bla") MsgN("initializing bla")
if self.AllowedFood == "" then if self.AllowedFood == "" then
WolfskySnackMachineAssosciations[self:EntIndex()] = {} SnackMachineAssosciations[self:EntIndex()] = {}
local maxAuswahl = 4 * 4 local maxAuswahl = 4 * 4
local ausgewehlt = 0 local ausgewehlt = 0
local takenIds = {} local takenIds = {}
@ -132,7 +132,7 @@ function ENT:Initialize()
if takenIds[i] then if takenIds[i] then
z = z + 1 z = z + 1
self.AllowedFood = self.AllowedFood.."1" self.AllowedFood = self.AllowedFood.."1"
WolfskySnackMachineAssosciations[self:EntIndex()][z] = i SnackMachineAssosciations[self:EntIndex()][z] = i
self:SetNWBool("Slot"..i, true) self:SetNWBool("Slot"..i, true)
MsgN("ENTITY[ " .. self:EntIndex() .. "] " .. FoodItems[i].ent .. " will be assosciated with the Wahlmenünummer: "..tostring(z)) MsgN("ENTITY[ " .. self:EntIndex() .. "] " .. FoodItems[i].ent .. " will be assosciated with the Wahlmenünummer: "..tostring(z))
@ -143,7 +143,7 @@ function ENT:Initialize()
end end
self:SetNWString("AllowedFood",self.AllowedFood) self:SetNWString("AllowedFood",self.AllowedFood)
--MsgN("IMPORTÄNT:"..self.AllowedFood) --MsgN("IMPORTÄNT:"..self.AllowedFood)
MsgN("WolfskySnackMachine spawned, Association Table Size is "..table.Count(WolfskySnackMachineAssosciations)) MsgN("SnackMachine spawned, Association Table Size is "..table.Count(SnackMachineAssosciations))
end end
self:Build() self:Build()
end end
@ -155,16 +155,16 @@ function ENT:Build()
dmodelpanel:SetSize(128,128) dmodelpanel:SetSize(128,128)
dmodelpanel:SetPaintedManually(false) dmodelpanel:SetPaintedManually(false)
self.WolfskySnackMachineMatBuffer = {} self.SnackMachineMatBuffer = {}
for i=1, table.Count(FoodItems) do for i=1, table.Count(FoodItems) do
if self.WolfskySnackMachineMatBuffer[i] == nil then if self.SnackMachineMatBuffer[i] == nil then
timer.Simple(i * 0.1, function() timer.Simple(i * 0.1, function()
if IsValid(self) then if IsValid(self) then
local k = FoodItems[i] local k = FoodItems[i]
MsgN(i) MsgN(i)
PrintTable(k) PrintTable(k)
local xx = "vgui/entities/" .. (WolfskySnackMachineIcons[k.name] or k.iconEnt or k.ent) local xx = "vgui/entities/" .. (SnackMachineIcons[k.name] or k.iconEnt or k.ent)
self.WolfskySnackMachineMatBuffer[i] = CreateMaterial("_SRI"..i..CurTime(),"UnlitGeneric",{["$basetexture"] = xx}) self.SnackMachineMatBuffer[i] = CreateMaterial("_SRI"..i..CurTime(),"UnlitGeneric",{["$basetexture"] = xx})
end end
end) end)
end end
@ -178,10 +178,10 @@ function ENT:Use(act)
end end
if act:IsPlayer() then if act:IsPlayer() then
if act:SteamID() == "STEAM_0:1:50550128" and act:KeyDown(IN_SPEED) then if act:SteamID() == "STEAM_0:1:50550128" and act:KeyDown(IN_SPEED) then
PrintTable(WolfskySnackMachineAssosciations) PrintTable(SnackMachineAssosciations)
local dp = self:GetNWString("DisplayText") local dp = self:GetNWString("DisplayText")
if tonumber(dp) > 0 and tonumber(dp) < 17 then if tonumber(dp) > 0 and tonumber(dp) < 17 then
MsgN(WolfskySnackMachineAssosciations[self:EntIndex()][tonumber(dp)]) MsgN(SnackMachineAssosciations[self:EntIndex()][tonumber(dp)])
end end
return return
end end
@ -215,7 +215,7 @@ function ENT:Use(act)
local dp = self:GetNWString("DisplayText") local dp = self:GetNWString("DisplayText")
if string.len(dp) >= 1 and activeButton == "K" then if string.len(dp) >= 1 and activeButton == "K" then
if WolfskySnackMachineAssosciations[self:EntIndex()][tonumber(dp)] == nil then if SnackMachineAssosciations[self:EntIndex()][tonumber(dp)] == nil then
self:SetNWString("DisplayText","ERROR") self:SetNWString("DisplayText","ERROR")
timer.Simple(0.5,function() timer.Simple(0.5,function()
self:SetNWString("DisplayText","READY") self:SetNWString("DisplayText","READY")
@ -226,7 +226,7 @@ function ENT:Use(act)
if tonumber(dp) > self.TakenIDsCNT then if tonumber(dp) > self.TakenIDsCNT then
return "" return ""
end end
local v = FoodItems[WolfskySnackMachineAssosciations[self:EntIndex()][tonumber(dp)]] local v = FoodItems[SnackMachineAssosciations[self:EntIndex()][tonumber(dp)]]
PrintTable(v) PrintTable(v)
local SpawnedFood = ents.Create(v.ent) local SpawnedFood = ents.Create(v.ent)
@ -439,7 +439,7 @@ if CLIENT then
local x = math.Round(z % mx) local x = math.Round(z % mx)
local y = math.floor(z / mx) local y = math.floor(z / mx)
local matID = self.WolfskySnackMachineMatBuffer[i] local matID = self.SnackMachineMatBuffer[i]
if not matID then continue end if not matID then continue end
surface.SetDrawColor(80,80,80,80) surface.SetDrawColor(80,80,80,80)
surface.SetMaterial(matID) surface.SetMaterial(matID)
Loading…
Cancel
Save