ACF Custom Mod V4 10.0 - 2015 Update

-10.0 V4 '2015 First Update'
--Updated to Original ACF Revision 545
--Added Unofficial ACF Extras Models&Engines
--Added Readme_installation into Readme_custom
--Added EngineMaker Version in Acf_globals_custom
--Added Dave E2 turbo
--Added Admin menu
--Added&Improved lot of lua's infos
--Improved colors loading functions
--Improved help menu luas
--Improved engines loadings
--Improved engines gui updating(lot less calling)
--Renamed CanDo to Tips
--Renamed CurrentVersion2 to CurrentVersion
--Renamed Version2 to Version
--Renamed RequiresFuel number to boolean
--Removed 'browser' text from menu opening cmds
--Removed useless OnClose menu functions
--Removed useless Color console commands
This commit is contained in:
bouletmarc 2015-05-04 22:09:27 -04:00
parent f50871ceb9
commit fca17e5fef
529 changed files with 4147 additions and 2620 deletions

View File

@ -1,4 +1,17 @@
#######################
INSTALLATION:
#######################
Create a folder in a garrysmod/addons.
----You can use any folder name-----
Install the Custom ACF Mod from this SVN below in the "Custom ACF" folder.
https://github.com/bouletmarc/ACF_CustomMod/trunk
#######################
HOW TO USE :
#######################

View File

@ -1,11 +0,0 @@
#######################
INSTALLATION:
#######################
Create a folder in a garrysmod/addons.
----You can use any folder name-----
Install the Custom ACF Mod from this SVN below in the "Custom ACF" folder.
https://github.com/bouletmarc/ACF_CustomMod/trunk

View File

@ -1,63 +1,28 @@
r103
-9.01 V3
--Added ACF Custom Menu
--Added Lot's acfCustom E2 fucntions
--Added All Engines to the List
--Removed Changelog Menu
--Removed Help Install Menu
-------BIG UPDATE-------
--Converted Custom Mod
--Custom Mod going to V3
--Custom Mod is now apart of original
--Installation easier, no more merge
--THIS CHANGE IS TO MAKE IT BETTER
*r104
-9.11 V3
--Added Custom Updating System
--Added Chips weld when spawn on entity
--Added RpmAdd
--Added Acf Custom Sound Tool
--Added Acf Custom Copy Tool
--Fixed Acf Custom Notify
--Fixed Chips on first spawn sometimes
--Removed Gearbox Model from EngineMaker
--Removed MaxRpmAdd/LimitRpmAdd
--Inversed Radiator Linking
--Cleaned/updated somes lua files
----SPECIALS NOTES----
You can update Original engines
to become Custom engines in 1clic.
Work with gearboxes, engine maker, etc.
You should wire and link it again.
*r106
-9.22 V3
--Added Custom Mod Tips Menu
--Added Turbocharger
--Added Supercharger
--Added Turbo/supercharger to sound tool
--Fixed Custom to Engine Maker Updating
--Help Menu Cleaned
----SPECIALS NOTES----
-Thanks to SEM for models-
Turbo and Supercharger are in test
They are working fine, but might be
improved in furtur update. I'm gonna
check the feedback of them
*r107
r109
-9.31 V3
--Improved Turbo Spool Start
--Turbo Add Slightly more torque
--Fixed Changelog Error
--Fixed E2 Function 'acfCustomRpmAdd'
--Fixed E2 Function 'acfCustomRpmAdd'
*r110
-10.0 V4 '2015 First Update'
--Updated to Original ACF Revision 545
--Added Unofficial ACF Extras Models&Engines
--Added Readme_installation into Readme_custom
--Added EngineMaker Version in Acf_globals_custom
--Added Dave E2 turbo
--Added Admin menu
--Added&Improved lot of lua's infos
--Improved colors loading functions
--Improved help menu luas
--Improved engines loadings
--Improved engines gui updating(lot less calling)
--Renamed CanDo to Tips
--Renamed CurrentVersion2 to CurrentVersion
--Renamed Version2 to Version
--Renamed RequiresFuel number to boolean
--Removed 'browser' text from menu opening cmds
--Removed useless OnClose menu functions
--Removed useless Color console commands

View File

@ -0,0 +1,187 @@
@name ACF_EngineTurbo
@inputs [Rpm Throttle]:number
@outputs TqAdd MaxRpmAdd LimitRpmAdd
@persist [I Max]:number
@persist [TSize CSize HSize TDistance Angle Speed Alpha N Divide]:number
interval( 240 )
if ( first() | dupefinished() ) {
HSize = TSize = CSize = 0.75
OutputAngle = 20
TDistance = ( TSize * 8 ) * 0.75
Divide = 0.3 # Divide of the torque add
I = 0
Max = 15
Speed = 0
setName("ACF_EngineTurbo\nMade by Dave")
entity():soundPlay(1,0,"acf_engines/turbine_small.wav")
entity():soundPlay(2,0,"acf_extra/vehiclefx/boost/tcl_turbo.wav")
}
if ( I < Max & holoCanCreate() ) {
I++
holoCreate( I )
holoPos(1, entity():toWorld(vec(0,0,TDistance/2)))
holoPos(2, entity():toWorld(vec(0,0,TDistance*0.75)))
holoPos(3, entity():toWorld(vec(4.5*CSize,4*CSize,TDistance/2)))
holoPos(4, entity():toWorld(vec(0,0,0)))
holoPos(5, entity():toWorld(vec(0,0,TDistance*0.3125)))
holoPos(6, entity():toWorld(vec(0,0,TDistance/-4)))
holoPos(7, entity():toWorld(vec(0,0,TDistance/-2)))
holoPos(8, entity():toWorld(vec(0,0,TDistance*-0.75)))
holoPos(9, entity():toWorld(vec(-4*TSize,3.5*TSize,TDistance/-2)))
holoPos(10, entity():toWorld(vec(-4*TSize,7*TSize,TDistance/-2)))
holoPos(11, entity():toWorld(vec(0,0,((-5.5)*CSize)+TDistance*0.525)))
holoPos(12, entity():toWorld(vec(0,0,((5.5)*CSize)+TDistance*-0.6875)))
holoPos(13, entity():toWorld(vec(0,0,0)))
holoPos(14,holoEntity(11):toWorld(vec(0,0,6*CSize)))
holoPos(15,holoEntity(12):toWorld(vec(0,0,6*CSize)))
holoScale(1,vec(1.1,1.1,1.3)*CSize)
holoScale(2,vec(0.6,0.6,1.5)*CSize)
holoScale(3,vec(0.28,0.28,0.8)*CSize)
holoScale(4,vec(0.4*HSize,0.4*HSize,TDistance*0.0625))
holoScale(5,vec(0.8,0.8,0.05)*CSize)
holoScale(6,vec(0.8,0.8,0.05*0.75)*TSize)
holoScale(7,vec(1,1,1.4*0.75)*TSize)
holoScale(8,vec(0.8,0.8,1.3*0.75)*TSize)
holoScale(9,vec(0.35,0.35*0.75,0.6)*TSize)
holoScale(10,vec(0.4,0.05,0.5*0.75)*TSize)
holoScale(11,vec(0.75,0.75,0.35)*CSize)
holoScale(12,vec(0.7,0.7,0.35)*TSize)
holoScale(13,vec(0.05,0.05,0.05))
holoScale(14,vec(0.1*CSize))
holoScale(15,vec(0.1*TSize))
holoColor(1,vec(170,170,170))
holoColor(2,vec(170,170,170))
holoColor(3,vec(255,255,255))
holoColor(4,vec(20,20,20))
holoColor(5,vec(200,200,200))
holoColor(6,vec(200,200,200))
holoColor(7,vec(100,100,100))
holoColor(8,vec(100,100,100))
holoColor(9,vec(150,150,150))
holoColor(10,vec(150,150,150))
holoAng(1,entity():toWorld(ang(0,0,0)))
holoAng(2,entity():toWorld(ang(0,0,0)))
holoAng(3,entity():toWorld(ang(0,0,90)))
holoAng(4,entity():toWorld(ang(0,0,0)))
holoAng(5,entity():toWorld(ang(0,0,0)))
holoAng(6,entity():toWorld(ang(0,0,0)))
holoAng(7,entity():toWorld(ang(0,0,0)))
holoAng(8,entity():toWorld(ang(0,0,0)))
holoAng(9,entity():toWorld(ang(0,0,90)))
holoAng(10,entity():toWorld(ang(0,0,0)))
holoAng(11,entity():toWorld(ang(0,0,0)))
holoAng(12,entity():toWorld(ang(180,0,0)))
holoAng(13,entity():toWorld(ang(0,0,0)))
holoModel(1,"hq_torus_thick")
holoModel(2,"hq_torus")
holoModel(3,"hq_cylinder")
holoModel(4,"hq_cylinder")
holoModel(5,"hq_cylinder")
holoModel(6,"hq_cylinder")
holoModel(7,"hq_torus_thick")
holoModel(8,"hq_torus_thick")
holoModel(9,"hq_cylinder")
holoModel(10,"hq_square")
holoModel(11,"models/maxofs2d/thruster_propeller.mdl")
holoModel(12,"models/maxofs2d/thruster_propeller.mdl")
holoModel(13,"hq_square")
holoModel(14,"models/hunter/tubes/circle2x2.mdl")
holoModel(15,"models/hunter/tubes/circle2x2.mdl")
holoMaterial(1,"phoenix_storms/fender_chrome")
holoMaterial(2,"phoenix_storms/fender_chrome")
holoMaterial(3,"phoenix_storms/fender_chrome")
holoMaterial(4,"phoenix_storms/gear")
holoMaterial(5,"phoenix_storms/gear")
holoMaterial(6,"phoenix_storms/fender_chrome")
holoMaterial(7,"phoenix_storms/fender_chrome")
holoMaterial(8,"phoenix_storms/fender_chrome")
holoMaterial(9,"phoenix_storms/fender_chrome")
holoMaterial(10,"phoenix_storms/fender_chrome")
holoMaterial(14,"phoenix_storms/trains/track_beamtop")
holoMaterial(15,"phoenix_storms/trains/track_beamtop")
holoParent(1, entity())
holoParent(2, entity())
holoParent(3, holoEntity(13))
holoParent(4, entity())
holoParent(5, entity())
holoParent(6, entity())
holoParent(7, entity())
holoParent(8, entity())
holoParent(9, entity())
holoParent(10, entity())
holoParent(11, entity())
holoParent(12, entity())
holoParent(13, entity())
holoParent(14, holoEntity(11))
holoParent(15, holoEntity(12))
holoClipEnabled(11,1)
holoClip(11,vec(0,0,6*CSize),vec(0,0,1),0)
holoClipEnabled(12,1)
holoClip(12,vec(0,0,6*CSize),vec(0,0,1),0)
holoAng(13,entity():toWorld(ang(0,OutputAngle,0)))
}
holoAng(11,entity():toWorld(ang(0,-Angle,0)))
holoAng(12,entity():toWorld(ang(180,Angle,0)))
Angle += Speed
Acc = (Rpm * 20) - Speed
Dcc = 100 + (Rpm * 20)
Alpha = Speed / 160
AlphaD = Speed / 160
if ( Alpha > 180 ) { Alpha = 180 }
if ( AlphaD > 240 ) { AlphaD = 240 }
if ( Speed < Rpm * 20 ) { Speed += Acc / 2 }
if ( Speed > Rpm * 20 ) { Speed -= Dcc / 10 }
holoAlpha(14,Alpha)
holoAlpha(15,Alpha)
holoAlpha(11,255-AlphaD)
holoAlpha(12,255-AlphaD)
soundPitch(1,50*N+Rpm/35)
soundVolume(1,CSize/7+Rpm/30000)
soundPitch(2,50*N+Rpm/35)
soundVolume(2,CSize/7+Rpm/20000)
if ( ( changed( Throttle ) ) & ( !Throttle ) & ( Rpm > 6500 ) ) {
entity():soundPlay(3,0,"acf_extra/vehiclefx/boost/turbo_pop_1.wav")
}
if ( ( changed( Throttle ) ) & ( Throttle ) ) {
soundVolume(3,0)
soundStop(3,1)
}
N = Rpm > 300 ? 1 : 0
TqAdd = round(Speed / (Divide * 1000)) * CSize
MaxRpmAdd = round(Speed / 50) * CSize
LimitRpmAdd = MaxRpmAdd
if ( MaxRpmAdd > 1500 ) { MaxRpmAdd = 1500 }

View File

@ -1,23 +1,8 @@
--loading colors
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
end
--------------------------------------
-- Initialize
--------------------------------------
function PANEL:Init( )
--###########################################
--Check If the Client Saw the Whats New
--Check If the Client Saw Whats New
if file.Exists("acf/revision.txt", "DATA") then
local RevisionFile = file.Read("acf/revision.txt", "DATA")
local RevisionTable = {}
@ -25,20 +10,20 @@ function PANEL:Init( )
table.insert(RevisionTable, w)
end
local RevisionNumber = tonumber(RevisionTable[1])
if RevisionNumber != ACFCUSTOM.Version2 then
file.Write("acf/revision.txt", tostring(ACFCUSTOM.Version2)..","..tostring(ACFCUSTOM.VersionCustom))
RunConsoleCommand("acf_whatsnew_browser_open")
if RevisionNumber != ACFCUSTOM.Version then
file.Write("acf/revision.txt", tostring(ACFCUSTOM.Version)..","..tostring(ACFCUSTOM.VersionCustom))
RunConsoleCommand("acf_whatsnew_open")
end
else
file.CreateDir("acf")
file.Write("acf/revision.txt", tostring(ACFCUSTOM.Version2)..","..tostring(ACFCUSTOM.VersionCustom))
RunConsoleCommand("acf_whatsnew_browser_open")
file.Write("acf/revision.txt", tostring(ACFCUSTOM.Version)..","..tostring(ACFCUSTOM.VersionCustom))
RunConsoleCommand("acf_whatsnew_open")
end
--###########################################
--Start Menu coding
acfmenupanelcustom = self.Panel
// height
self:SetTall( surface.ScreenHeight() - 120 )
//Weapon Select
self.WeaponSelect = vgui.Create( "DTree", self )
self.WeaponData = ACFCUSTOM.Weapons
@ -64,21 +49,20 @@ function PANEL:Init( )
acfmenupanelcustom:UpdateDisplay(self.mytable)
end
HomeNode.Icon:SetImage( "icon16/newspaper.png" )
--Get Convars limits
local Makerlimit = GetConVarNumber("sbox_max_acf_maker")
local Extralimit = GetConVarNumber("sbox_max_acf_extra")
--Set Pages
--Set Nodes
local Mobility = self.WeaponSelect:AddNode( "Mobility List" )
local Engines = Mobility:AddNode( "Engines" )
local CustomGB = Mobility:AddNode( "Custom Gearboxes" )
--###################
--Set Nodes with limits
if Makerlimit > 0 then MakerNode = Mobility:AddNode( "Engines Maker" ) end
if Extralimit > 0 then ExtraNode = Mobility:AddNode( "Engines Extras" ) end
--###################
--Set Nodes Final
local EngineSubcats = {}
for _, MobilityTable in pairs(self.WeaponDisplay["MobilityCustom"]) do
NodeAdd = Mobility
local NodeAdd = Mobility
if( MobilityTable.ent == "acf_engine_custom" ) then
NodeAdd = Engines
elseif ( MobilityTable.ent == "acf_gearboxauto" or MobilityTable.ent == "acf_gearboxcvt" or MobilityTable.ent == "acf_gearboxair" ) then
@ -96,7 +80,6 @@ function PANEL:Init( )
end
for MobilityID,MobilityTable in pairs(self.WeaponDisplay["MobilityCustom"]) do
local NodeAdd = Mobility
if MobilityTable.ent == "acf_engine_custom" then
NodeAdd = Engines
@ -133,11 +116,6 @@ function PANEL:Init( )
end
end
/*------------------------------------
Think
------------------------------------*/
function PANEL:Think( )
end
function PANEL:UpdateDisplay( Table )
RunConsoleCommand( "acfcustom_id", Table.id or 0 )
@ -188,89 +166,112 @@ function PANEL:PerformLayout()
ypos = acfmenupanelcustom.CustomDisplay.Y + acfmenupanelcustom.CustomDisplay:GetTall() + vspacing
end
end
--------------------------------------
-- Create Custom Menu
--------------------------------------
function ACFHomeCustomGUICreate( Table )
if not acfmenupanelcustom.CustomDisplay then return end
VersionText2 = vgui.Create( "DLabel" )
VersionText2:SetText("Custom Version")
VersionText2:SetTextColor(Color(0,0,50,255))
VersionText2:SetFont( "DefaultBold" )
VersionText2:SizeToContents()
acfmenupanelcustom.CustomDisplay:AddItem( VersionText2 )
--Set local vars
local VT, VT2, VT4 = vgui.Create( "DLabel" ), vgui.Create( "DLabel" ), vgui.Create( "DLabel" )
local ColorMenu, HelpMenu, CustomTips = vgui.Create( "DButton" ), vgui.Create( "DButton" ), vgui.Create( "DButton" )
local Log = vgui.Create( "DLabel" )
--Set vars
VT3 = vgui.Create( "DLabel" )
VersionT2 = vgui.Create( "DLabel" )
VersionT2:SetText("SVN Version: "..ACFCUSTOM.CurrentVersion2.."\nCurrent Version: "..ACFCUSTOM.Version2)
VersionT2:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
VersionT2:SetFont( "DefaultBold" )
VersionT2:SizeToContents()
acfmenupanelcustom.CustomDisplay:AddItem( VersionT2 )
--Version text1
VT:SetText("Custom Version")
VT:SetTextColor(Color(0,0,50,255))
VT:SetFont( "DefaultBold" )
VT:SizeToContents()
acfmenupanelcustom.CustomDisplay:AddItem( VT )
VersionT3 = vgui.Create( "DLabel" )
local color2
local versionstring2
if ACFCUSTOM.Version2 >= ACFCUSTOM.CurrentVersion2 then
versionstring2 = "Up To Date"
color2 = Color(0,225,0,255)
--Version text2
VT2:SetText("SVN Version: "..ACFCUSTOM.CurrentVersion.."\nCurrent Version: "..ACFCUSTOM.Version)
VT2:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
VT2:SetFont( "DefaultBold" )
VT2:SizeToContents()
acfmenupanelcustom.CustomDisplay:AddItem( VT2 )
--Version text3
local color
local versionstring
if ACFCUSTOM.Version >= ACFCUSTOM.CurrentVersion then
versionstring = "Up To Date"
color = Color(0,225,0,255)
else
versionstring2 = "Out Of Date"
color2 = Color(225,0,0,255)
versionstring = "Out Of Date"
color = Color(225,0,0,255)
end
VersionT3:SetText("ACF Custom Is "..versionstring2.."!\n")
VersionT3:SetColor(color2)
VersionT3:SetFont( "DefaultBold" )
VersionT3:SizeToContents()
acfmenupanelcustom.CustomDisplay:AddItem( VersionT3 )
VT3:SetText("ACF Custom Is "..versionstring.."!\n")
VT3:SetColor(color)
VT3:SetFont( "DefaultBold" )
VT3:SizeToContents()
acfmenupanelcustom.CustomDisplay:AddItem( VT3 )
VersionCustomText = vgui.Create( "DLabel" )
VersionCustomText:SetText("Custom Version: "..ACFCUSTOM.VersionCustom.."\n")
VersionCustomText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
VersionCustomText:SetFont( "DefaultBold" )
VersionCustomText:SizeToContents()
acfmenupanelcustom.CustomDisplay:AddItem( VersionCustomText )
--#################################################
--Color And Help Menu
ColorMenu = vgui.Create( "DButton" )
--Version text4
VT4 = vgui.Create( "DLabel" )
VT4:SetText("Custom Version: "..ACFCUSTOM.VersionCustom.."\n")
VT4:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
VT4:SetFont( "DefaultBold" )
VT4:SizeToContents()
acfmenupanelcustom.CustomDisplay:AddItem( VT4 )
--Color Menu Button
ColorMenu:SetText("Change ACF Menu Font's color")
ColorMenu:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
ColorMenu:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
ColorMenu:SetToolTip("Bored of that font color ?\nClic that button to change it !")
ColorMenu:SetWide(100)
ColorMenu:SetTall(30)
ColorMenu.DoClick = function()
RunConsoleCommand("acf_colormenu_browser_open")
RunConsoleCommand("acf_colormenu_open")
end
acfmenupanelcustom.CustomDisplay:AddItem( ColorMenu )
HelpText1 = vgui.Create( "DButton" )
HelpText1:SetText("Help")
HelpText1:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
HelpText1:SetToolTip("Clic here to get Help about ACF\nAbout Wiring, Linking, Options, Installation")
HelpText1:SetWide(70)
HelpText1:SetTall(30)
HelpText1.DoClick = function()
RunConsoleCommand("acf_help_browser_open")
end
acfmenupanelcustom.CustomDisplay:AddItem( HelpText1 )
WhatCustom = vgui.Create( "DButton" )
WhatCustom:SetText("Custom Mod Tips")
WhatCustom:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
WhatCustom:SetToolTip("Clic here to get Help about ACF\nAbout Wiring, Linking, Options, Installation")
WhatCustom:SetWide(80)
WhatCustom:SetTall(30)
WhatCustom.DoClick = function()
RunConsoleCommand("acf_customcando_open")
--Admin Menu
if LocalPlayer():IsAdmin() or LocalPlayer():IsSuperAdmin() then
local AdminMenu = vgui.Create( "DButton" )
AdminMenu:SetText("Admin Menu")
AdminMenu:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
AdminMenu:SetToolTip("Clic here to get Help about ACF\nAbout Wiring, Linking, Options, Installation")
AdminMenu:SetWide(75)
AdminMenu:SetTall(30)
AdminMenu.DoClick = function()
RunConsoleCommand("acf_admin_open")
end
acfmenupanelcustom.CustomDisplay:AddItem( AdminMenu )
end
acfmenupanelcustom.CustomDisplay:AddItem( WhatCustom )
TextLog= vgui.Create( "DLabel" )
TextLog:SetText( "Changelog")
TextLog:SetTextColor(Color(0,0,50,255))
TextLog:SetFont( "DefaultBold" )
acfmenupanelcustom.CustomDisplay:AddItem( TextLog )
--#################
--Help Menu Button
HelpMenu:SetText("Help")
HelpMenu:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
HelpMenu:SetToolTip("Clic here to get Help about ACF\nAbout Wiring, Linking, Options, Installation")
HelpMenu:SetWide(70)
HelpMenu:SetTall(30)
HelpMenu.DoClick = function()
RunConsoleCommand("acf_help_open")
end
acfmenupanelcustom.CustomDisplay:AddItem( HelpMenu )
--Custom Mod Tips Button
CustomTips:SetText("Custom Mod Tips")
CustomTips:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
CustomTips:SetToolTip("Clic here to get Help about ACF\nAbout Wiring, Linking, Options, Installation")
CustomTips:SetWide(80)
CustomTips:SetTall(30)
CustomTips.DoClick = function()
RunConsoleCommand("acf_tips_open")
end
acfmenupanelcustom.CustomDisplay:AddItem( CustomTips )
--Changelog Text
Log:SetText( "Changelog")
Log:SetTextColor(Color(0,0,50,255))
Log:SetFont( "DefaultBold" )
acfmenupanelcustom.CustomDisplay:AddItem( Log )
--Changelog Tree
if acfmenupanelcustom.Changelog then
acfmenupanelcustom["CData"]["Changelist"] = vgui.Create( "DTree" )
for Rev,Changes in pairs(acfmenupanelcustom.Changelog) do
@ -288,67 +289,73 @@ function ACFHomeCustomGUICreate( Table )
acfmenupanelcustom:UpdateAttribs( {rev = table.maxn(acfmenupanelcustom.Changelog)} )
end
end
function ACFHomeCustomGUIUpdate( Table )
--Settings vars
local Log, Log2 = vgui.Create( "DLabel" ), vgui.Create( "DLabel" )
TextLog1 = vgui.Create( "DLabel" )
TextLog1:SetText( "Custom Changlog :")
TextLog1:SetTextColor(Color(0,0,50,255))
TextLog1:SetFont( "DefaultBold" )
TextLog1:SizeToContents()
acfmenupanelcustom.CustomDisplay:AddItem( TextLog1 )
--Custom Changelog Text
Log:SetText( "Custom Changlog :")
Log:SetTextColor(Color(0,0,50,255))
Log:SetFont( "DefaultBold" )
Log:SizeToContents()
acfmenupanelcustom.CustomDisplay:AddItem( Log )
TextLog2 = vgui.Create( "DLabel" )
TextLog2:SetText( acfmenupanelcustom.Changelog[Table["rev"]])
TextLog2:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
TextLog2:SetFont( "DefaultBold" )
TextLog2:SizeToContents()
acfmenupanelcustom.CustomDisplay:AddItem( TextLog2 )
--Custom changelog revision
Log2:SetText( acfmenupanelcustom.Changelog[Table["rev"]])
Log2:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Log2:SetFont( "DefaultBold" )
Log2:SizeToContents()
acfmenupanelcustom.CustomDisplay:AddItem( Log2 )
local color2
local versionstring2
if ACFCUSTOM.Version2 >= ACFCUSTOM.CurrentVersion2 then
versionstring2 = "Up To Date"
color2 = Color(0,225,0,255)
local color
local versionstring
if ACFCUSTOM.Version >= ACFCUSTOM.CurrentVersion then
versionstring = "Up To Date"
color = Color(0,225,0,255)
else
versionstring2 = "Out Of Date"
color2 = Color(225,0,0,255)
versionstring = "Out Of Date"
color = Color(225,0,0,255)
end
VersionT3:SetText("ACF Custom Is "..versionstring2.."!\n")
VersionT3:SetColor(color2)
VersionT3:SizeToContents()
VT3:SetText("ACF Custom Is "..versionstring.."!\n")
VT3:SetColor(color)
VT3:SizeToContents()
acfmenupanelcustom.CustomDisplay:PerformLayout()
end
--------------------------------------
-- Changelog calling
--------------------------------------
function ACFChangelogHTTPCallBack(contents , size)
local Temp = string.Explode( "*", contents )
acfmenupanelcustom.Changelog = {}
for Key,String in pairs(Temp) do
acfmenupanelcustom.Changelog[tonumber(string.sub(String,2,4))] = string.Trim(string.sub(String, 5))
end
table.SortByKey(acfmenupanelcustom.Changelog,true)
local Table = {}
Table.guicreate = (function( Panel, Table ) ACFHomeCustomGUICreate( Table ) end or nil)
Table.guiupdate = (function( Panel, Table ) ACFHomeCustomGUIUpdate( Table ) end or nil)
acfmenupanelcustom:UpdateDisplay( Table )
end
http.Fetch("https://raw.github.com/bouletmarc/ACF_CustomMod/master/changelogcustom.txt", ACFChangelogHTTPCallBack, function() end)
--------------------------------------
-- Set Menu Text
--------------------------------------
function PANEL:CPanelText(Name, Desc)
if not acfmenupanelcustom["CData"][Name.."_text"] then
acfmenupanelcustom["CData"][Name.."_text"] = vgui.Create( "DLabel" )
acfmenupanelcustom["CData"][Name.."_text"]:SetText( Desc or "" )
acfmenupanelcustom["CData"][Name.."_text"]:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
acfmenupanelcustom["CData"][Name.."_text"]:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
acfmenupanelcustom["CData"][Name.."_text"]:SetWrap(true)
acfmenupanelcustom["CData"][Name.."_text"]:SetAutoStretchVertical( true )
acfmenupanelcustom.CustomDisplay:AddItem( acfmenupanelcustom["CData"][Name.."_text"] )
end
acfmenupanelcustom["CData"][Name.."_text"]:SetText( Desc )
acfmenupanelcustom["CData"][Name.."_text"]:SetSize( acfmenupanelcustom.CustomDisplay:GetWide(), 10 )
acfmenupanelcustom["CData"][Name.."_text"]:SizeToContentsY()
end
end

View File

@ -1,124 +0,0 @@
// Made by Bouletmarc.
local StartBrowserPanel = nil
local Changelog = {}
local function CreateSoundBrowser()
StartBrowserPanel = vgui.Create("DFrame") // The main frame.
StartBrowserPanel:SetSize(700, 450)
--Set Center
StartBrowserPanel:SetPos(((ScrW()/2)-(StartBrowserPanel:GetWide()/2))+ScrW()/4,(ScrH()/2)-(StartBrowserPanel:GetTall()/2))
StartBrowserPanel:SetMinWidth(700)
StartBrowserPanel:SetMinHeight(450)
StartBrowserPanel:SetSizable(false)
StartBrowserPanel:SetDeleteOnClose( true )
StartBrowserPanel:SetTitle("Custom Mod Tips Menu V9.2")
StartBrowserPanel:SetVisible(false)
StartBrowserPanel:SetCookieName( "wire_sound_browser" )
StartBrowserPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
local ButtonsSidePanel = StartBrowserPanel:Add("DPanel")
ButtonsSidePanel:DockMargin(4, 4, 4, 4)
ButtonsSidePanel:Dock(TOP)
ButtonsSidePanel:SetSize(330, 406)
ButtonsSidePanel:SetDrawBackground(true)
--#############################################################
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
RunConsoleCommand( "acfcustom_red", Redcolor )
RunConsoleCommand( "acfcustom_green", Greencolor )
RunConsoleCommand( "acfcustom_blue", Bluecolor )
SaveFunc()
end
--###########################################
local CustomCanDoClient = ""
local CustomCanDoServer = ""
CustomCanDoClient = CustomCanDoClient .. " CLIENT :\n"
CustomCanDoClient = CustomCanDoClient .. "-Engines have a rev limiter(cutoff) sound, can be disabled by wiring DisableCut to a Value that equal 1\n"
CustomCanDoClient = CustomCanDoClient .. "-Turbine and Eletric engine will not have rev limiter(cut off), its useles for thoses engines\n"
CustomCanDoClient = CustomCanDoClient .. "-ANY engines not require fuel, to require fuel link a fuel tank (add 25% torque, but the weight come with it)\n"
CustomCanDoClient = CustomCanDoClient .. "-When you stop a engine, it'll stop progressively\n"
CustomCanDoClient = CustomCanDoClient .. "-Engines link to the Chips, Nos, Turbo, Supercharger or Radiators\n"
CustomCanDoClient = CustomCanDoClient .. "-To update the engines made from Engine Maker, select Engine Maker again in the menu, it'll update values\n"
CustomCanDoClient = CustomCanDoClient .. "-It having all E2 functions like 'acfCustomThrottle(100)', also having customs functions like 'acfCustomTqAdd(50)'\n"
CustomCanDoClient = CustomCanDoClient .. "-Custom Mod have more sounds, more engines, and also old models back\n"
CustomCanDoClient = CustomCanDoClient .. "-The CVT from the custom mod are the first acf CVT ever made, and probably better than the original\n"
CustomCanDoClient = CustomCanDoClient .. "-The Airplane Beta Gearbox are used to rotate and also push/pull a prop like a propeller\n"
CustomCanDoServer = CustomCanDoServer .. " SERVER :\n"
CustomCanDoServer = CustomCanDoServer .. "-sbox_max_acf_modding (0-1) allow engines modding (wire inputs)\n"
CustomCanDoServer = CustomCanDoServer .. "-sbox_max_acf_extra (Value) the number of acf extras allowed (chips,nos)\n"
CustomCanDoServer = CustomCanDoServer .. "-sbox_max_acf_maker (Value) the number of engines from engines maker allowed\n"
CustomCanDoServer = CustomCanDoServer .. "-Anyone can use it if its on the server, and the client only get acf orignal\n"
CurrentText = ButtonsSidePanel:Add("DLabel")
CurrentText:SetPos(120,20)
CurrentText:SetFont( "DefaultBold" )
CurrentText:SetText("Custom Mod Tips : ")
CurrentText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
CurrentText:SizeToContents()
CustomModTipsClient = ButtonsSidePanel:Add("DLabel")
CustomModTipsClient:SetText(CustomCanDoClient)
CustomModTipsClient:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
CustomModTipsClient:SetPos(20,60)
CustomModTipsClient:SetFont( "DefaultBold" )
CustomModTipsClient:SizeToContents()
CustomModTipsServer = ButtonsSidePanel:Add("DLabel")
CustomModTipsServer:SetText(CustomCanDoServer)
CustomModTipsServer:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
CustomModTipsServer:SetPos(20,230)
CustomModTipsServer:SetFont( "DefaultBold" )
CustomModTipsServer:SizeToContents()
Close = ButtonsSidePanel:Add("DButton")
Close:SetText("Close")
Close:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
Close:SetPos( 220,340 )
Close:SetWide(80)
Close:SetTall( 50 )
Close.DoClick = function()
StartBrowserPanel:Close()
end
StartBrowserPanel.OnClose = function() end
StartBrowserPanel:InvalidateLayout(false)
end
local function OpenSartBrowser(pl, cmd, args)
if (!IsValid(StartBrowserPanel)) then
CreateSoundBrowser()
end
StartBrowserPanel:SetVisible(true)
StartBrowserPanel:MakePopup()
StartBrowserPanel:InvalidateLayout(true)
WireLib.Timedcall(function(StartBrowserPanel)
if (!IsValid(StartBrowserPanel)) then return end
StartBrowserPanel:InvalidateLayout(true)
end, StartBrowserPanel)
end
concommand.Add("acf_customcando_open", OpenSartBrowser)

View File

@ -0,0 +1,165 @@
--------------------------------------
-- Set vars
--------------------------------------
local MainPanel = nil
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu()
--Set frame
MainPanel = vgui.Create("DFrame")
MainPanel:SetSize(830, 470)
--Set Center
MainPanel:SetPos((ScrW()/2)-(MainPanel:GetWide()/2),(ScrH()/2)-(MainPanel:GetTall()/2))
--Set size
MainPanel:SetMinWidth(820)
MainPanel:SetMinHeight(460)
--Set options
MainPanel:SetSizable(false)
MainPanel:SetDeleteOnClose( true )
MainPanel:SetTitle("Custom Mod Tips Menu V3")
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Add left panel
local LeftPanel = MainPanel:Add("DPanel")
LeftPanel:DockMargin(4, 4, 4, 4)
LeftPanel:Dock(LEFT)
LeftPanel:SetSize(400, 420)
LeftPanel:SetDrawBackground(false)
--Add right panel
local RightPanel = MainPanel:Add("DPanel")
RightPanel:DockMargin(4, 4, 4, 4)
RightPanel:Dock(RIGHT)
RightPanel:SetSize(400, 420)
RightPanel:SetDrawBackground(false)
--------------------------------------
-- Initialize Panels
--------------------------------------
--Set local vars
local TopLeftText = ""
local BottomLeftText = ""
local TopRightText = ""
local BottomRightText = ""
local TopLeftName = "CLIENT :"
local BottomLeftName = ""
local TopRightName = "SERVER :"
local BottomRightName = ""
--Set top left text
TopLeftText = TopLeftText .. "-Engines have rev limiter sound\n"
TopLeftText = TopLeftText .. "--disable it by wiring DisableCut to a Value(0-1)\n"
TopLeftText = TopLeftText .. "--Turbine and Electric engine will not have rev limiter\n\n"
TopLeftText = TopLeftText .. "-ANY engines not require fuel\n"
TopLeftText = TopLeftText .. "--linking a tank add 25% torque and weight\n\n"
TopLeftText = TopLeftText .. "-When you stop a engine, it'll stop progressively\n\n"
TopLeftText = TopLeftText .. "-Selecting again EngineMaker in the menu make it updating values\n\n"
TopLeftText = TopLeftText .. "-Have Custom E2 functions \n\n"
TopLeftText = TopLeftText .. "-Custom Mod have more sounds, more engines, and old models\n\n"
TopLeftText = TopLeftText .. "-The CVT from the custom mod are the first ACF CVT ever made\n\n"
TopLeftText = TopLeftText .. "-The Airplane Beta Gearbox are used to rotate and also push/pull\n"
TopLeftText = TopLeftText .. "--a prop like a propeller\n\n"
--Set bottom left text
BottomLeftText = BottomLeftText .. ""
--Set top right text
TopRightText = TopRightText .. "-sbox_max_acf_modding (0-1) allow engines modding (wire inputs)\n\n"
TopRightText = TopRightText .. "-sbox_max_acf_extra (Value) the number of acf extras allowed\n\n"
TopRightText = TopRightText .. "-sbox_max_acf_maker (Value) the number of engines maker allowed\n\n"
TopRightText = TopRightText .. "-Anyone can use CustomMod on the server\n"
TopRightText = TopRightText .. "--even if the client not have it\n\n"
--Set bottom right text
BottomRightText = BottomRightText .. ""
--------------------------------------
-- Left Panel Menu
--------------------------------------
--Set local vars
local TopLeftTitle, TopLeft = LeftPanel:Add("DLabel"), LeftPanel:Add("DLabel")
local BottomLeftTitle, BottomLeft = LeftPanel:Add("DLabel"), LeftPanel:Add("DLabel")
--Set top left title
TopLeftTitle:SetText(TopLeftName)
TopLeftTitle:SetTextColor(Color(210,210,210,255))
TopLeftTitle:SetPos(40,40)
TopLeftTitle:SetFont( "DefaultBold" )
TopLeftTitle:SizeToContents()
--Set top left text
TopLeft:SetText(TopLeftText)
TopLeft:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
TopLeft:SetPos(20,60)
TopLeft:SetFont( "DefaultBold" )
TopLeft:SizeToContents()
--Set bottom left title
BottomLeftTitle:SetText(BottomLeftName)
BottomLeftTitle:SetTextColor(Color(210,210,210,255))
BottomLeftTitle:SetPos(40,220)
BottomLeftTitle:SetFont( "DefaultBold" )
BottomLeftTitle:SizeToContents()
--Set bottom left text
BottomLeft:SetText(BottomLeftText)
BottomLeft:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
BottomLeft:SetPos(20,240)
BottomLeft:SetFont( "DefaultBold" )
BottomLeft:SizeToContents()
--------------------------------------
-- Right Panel Menu
--------------------------------------
--Set local vars
local TopRightTitle, TopRight = RightPanel:Add("DLabel"), RightPanel:Add("DLabel")
local BottomRightTitle, BottomRight = RightPanel:Add("DLabel"), RightPanel:Add("DLabel")
--Set top right title
TopRightTitle:SetText(TopRightName)
TopRightTitle:SetTextColor(Color(210,210,210,255))
TopRightTitle:SetPos(20,40)
TopRightTitle:SetFont( "DefaultBold" )
TopRightTitle:SizeToContents()
--Set top right text
TopRight:SetText(TopRightText)
TopRight:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
TopRight:SetPos(0,60)
TopRight:SetFont( "DefaultBold" )
TopRight:SizeToContents()
--Set bottom right title
BottomRightTitle:SetText(BottomRightName)
BottomRightTitle:SetTextColor(Color(210,210,210,255))
BottomRightTitle:SetPos(20,200)
BottomRightTitle:SetFont( "DefaultBold" )
BottomRightTitle:SizeToContents()
--Set bottom right text
BottomRight:SetText(BottomRightText)
BottomRight:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
BottomRight:SetPos(0,220)
BottomRight:SetFont( "DefaultBold" )
BottomRight:SizeToContents()
--------------------------------------
-- End Panel Menu
--------------------------------------
--Set close button
local Close = LeftPanel:Add("DButton")
Close:SetText("Close")
Close:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Close:SetPos(30,360)
Close:SetWide(80)
Close:SetTall(40)
Close.DoClick = function()
MainPanel:Close()
end
MainPanel:InvalidateLayout(true)
end
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
if (!IsValid(MainPanel)) then
CreateMenu()
end
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
WireLib.Timedcall(function(MainPanel)
if (!IsValid(MainPanel)) then return end
MainPanel:InvalidateLayout(true)
end, MainPanel)
end
concommand.Add("acf_tips_open", OpenMenu)

View File

@ -0,0 +1,191 @@
--------------------------------------
-- Set vars
--------------------------------------
local MainPanel = nil
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu( )
--Set frame
MainPanel = vgui.Create("DFrame")
MainPanel:SetSize(360, 420)
--Set Center
MainPanel:SetPos((ScrW()/2)-(MainPanel:GetWide()/2),(ScrH()/2)-(MainPanel:GetTall()/2))
--Set size
MainPanel:SetMinWidth(500)
MainPanel:SetMinHeight(500)
--Set options
MainPanel:SetDeleteOnClose( true )
MainPanel:SetTitle("ACF Admin's Menu by Bouletmarc")
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Menu Text
MainText = MainPanel:Add("DLabel")
MainText:SetText("Change ACF Limits or Customs Limits")
MainText:SetTextColor(Color(0,255,0,255))
MainText:SetPos(80,18)
MainText:SetFont( "DefaultBold" )
MainText:SizeToContents()
--Add left panel
local LeftPanel = MainPanel:Add("DPanel")
LeftPanel:DockMargin(4, 4, 4, 4)
LeftPanel:Dock(LEFT)
LeftPanel:SetSize(220, 420)
LeftPanel:SetDrawBackground(true)
--Add right panel
local RightPanel = MainPanel:Add("DPanel")
RightPanel:DockMargin(4, 4, 4, 4)
RightPanel:Dock(RIGHT)
RightPanel:SetSize(120, 400)
RightPanel:SetDrawBackground(true)
--------------------------------------
-- Initialize Panels
--------------------------------------
if LocalPlayer():IsAdmin() or LocalPlayer():IsSuperAdmin() then
--Top Text's
DescText = LeftPanel:Add("DLabel")
DescText:SetPos(90,10)
DescText:SetFont( "DefaultBold" )
DescText:SetText("Descriptions")
DescText:SetTextColor(Color(0,150,0,255))
DescText:SizeToContents()
SettingText = RightPanel:Add("DLabel")
SettingText:SetPos(30,10)
SettingText:SetFont( "DefaultBold" )
SettingText:SetText("Settings")
SettingText:SetTextColor(Color(0,150,0,255))
SettingText:SizeToContents()
--Set All Texts Left Side
local txt = ""
txt = txt .."ACF Custom Mod Master Switch\n\n\n"
txt = txt .."Set the ACF_Guns Limits\n\n\n"
txt = txt .."Set the ACF_Ammo Limits\n\n\n"
txt = txt .."Set the ACF Engine/Gearbox/fuel Limits\n\n\n"
txt = txt .."Set the ACF Engine Extras Limits\n\n\n"
txt = txt .."Set the ACF Engine Maker Limits\n\n\n"
AllTexts = LeftPanel:Add("DLabel")
AllTexts:SetPos(10,40)
AllTexts:SetText(txt)
AllTexts:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
AllTexts:SizeToContents()
--Customs Mod Switch
local CustomSwitch = GetConVarNumber("sbox_max_acf_modding")
CustomButton = RightPanel:Add("DButton")
CustomButton:SetPos(10,30)
CustomButton:SetWide(100)
CustomButton:SetTall(30)
CustomButton.DoClick = function()
if CustomSwitch == 1 then
CustomSwitch = 0
RunConsoleCommand( "sbox_max_acf_modding", 0)
CustomButton:SetText("Custom Mod OFF")
CustomButton:SetTextColor(Color(200,0,0,255))
elseif CustomSwitch == 0 then
CustomSwitch = 1
RunConsoleCommand( "sbox_max_acf_modding", 1)
CustomButton:SetText("Custom Mod ON")
CustomButton:SetTextColor(Color(0,200,0,255))
end
end
if CustomSwitch == 1 then
CustomButton:SetText("Custom Mod ON")
CustomButton:SetTextColor(Color(0,200,0,255))
else
CustomButton:SetText("Custom Mod OFF")
CustomButton:SetTextColor(Color(200,0,0,255))
end
--Acf Gun Limit
local GunsLimits = GetConVarNumber("sbox_max_acf_gun")
GunsEntry = RightPanel:Add( "DTextEntry" )
GunsEntry:SetText( GunsLimits )
GunsEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
GunsEntry:SetPos( 10, 70 )
GunsEntry:SetWide( 80 )
GunsEntry.OnTextChanged = function( )
RunConsoleCommand( "sbox_max_acf_gun", GunsEntry:GetValue())
end
--Acf Ammo Limit
local AmmoLimits = GetConVarNumber("sbox_max_acf_ammo")
AmmoEntry = RightPanel:Add( "DTextEntry" )
AmmoEntry:SetText( AmmoLimits )
AmmoEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
AmmoEntry:SetPos( 10, 110 )
AmmoEntry:SetWide( 80 )
AmmoEntry.OnTextChanged = function( )
RunConsoleCommand( "sbox_max_acf_ammo", AmmoEntry:GetValue() )
end
--Acf Misc Limit
local MiscLimits = GetConVarNumber("sbox_max_acf_misc")
MiscEntry = RightPanel:Add( "DTextEntry" )
MiscEntry:SetText( MiscLimits )
MiscEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
MiscEntry:SetPos( 10, 150 )
MiscEntry:SetWide( 80 )
MiscEntry.OnTextChanged = function( )
RunConsoleCommand( "sbox_max_acf_misc", MiscEntry:GetValue() )
end
--Acf Extras Limit
local ExtrasLimits = GetConVarNumber("sbox_max_acf_extra")
ExtrasEntry = RightPanel:Add( "DTextEntry" )
ExtrasEntry:SetText( ExtrasLimits )
ExtrasEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
ExtrasEntry:SetPos( 10, 190 )
ExtrasEntry:SetWide( 80 )
ExtrasEntry.OnTextChanged = function( )
RunConsoleCommand( "sbox_max_acf_extra", ExtrasEntry:GetValue() )
end
--Acf Engine Maker Limit
local MakerLimits = GetConVarNumber("sbox_max_acf_maker")
MakerEntry = RightPanel:Add( "DTextEntry" )
MakerEntry:SetText( MakerLimits )
MakerEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
MakerEntry:SetPos( 10, 230 )
MakerEntry:SetWide( 80 )
MakerEntry.OnTextChanged = function( )
RunConsoleCommand( "sbox_max_acf_maker", MakerEntry:GetValue() )
end
else
DescText = LeftPanel:Add("DLabel")
DescText:SetPos(50,70)
DescText:SetFont( "DefaultBold" )
DescText:SetText("YOU ARE NOT\n ALLOWED\n TO BE HERE!\n\n\n\n\n\nPLEASE LEAVE!")
DescText:SetTextColor(Color(200,0,0,255))
DescText:SizeToContents()
end
Close = LeftPanel:Add("DButton")
Close:SetText("Close")
Close:SetTextColor(Color(255,0,0,255))
Close:SetPos(20,300)
Close:SetWide(100)
Close:SetTall(60)
Close.DoClick = function()
MainPanel:Close()
end
MainPanel:InvalidateLayout(true)
end
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
if (!IsValid(MainPanel)) then
CreateMenu()
end
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
WireLib.Timedcall(function(MainPanel)
if (!IsValid(MainPanel)) then return end
MainPanel:InvalidateLayout(true)
end, MainPanel)
end
concommand.Add("acf_admin_open", OpenMenu)

View File

@ -1,172 +1,142 @@
// Made by Bouletmarc.
local StartBrowserPanel = nil
local function CreateSoundBrowser( )
StartBrowserPanel = vgui.Create("DFrame") // The main frame.
StartBrowserPanel:SetSize(300, 450)
--------------------------------------
-- Set vars
--------------------------------------
local MainPanel = nil
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu( )
--Set frame
MainPanel = vgui.Create("DFrame")
MainPanel:SetSize(300, 450)
--Set Center
StartBrowserPanel:SetPos((ScrW()/2)-(StartBrowserPanel:GetWide()/2),(ScrH()/2)-(StartBrowserPanel:GetTall()/2))
StartBrowserPanel:SetMinWidth(290)
StartBrowserPanel:SetMinHeight(440)
StartBrowserPanel:SetDeleteOnClose( true )
StartBrowserPanel:SetTitle("ACF Font's Color Menu by Bouletmarc")
StartBrowserPanel:SetVisible(false)
StartBrowserPanel:SetCookieName( "wire_sound_browser" )
StartBrowserPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
MainText = StartBrowserPanel:Add("DLabel")
MainPanel:SetPos((ScrW()/2)-(MainPanel:GetWide()/2),(ScrH()/2)-(MainPanel:GetTall()/2))
--Set size
MainPanel:SetMinWidth(290)
MainPanel:SetMinHeight(440)
--Set options
MainPanel:SetDeleteOnClose( true )
MainPanel:SetTitle("ACF Font's Color Menu by Bouletmarc")
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Menu text
local MainText = MainPanel:Add("DLabel")
MainText:SetText("Change color of Acf font's in the menu")
MainText:SetTextColor(Color(0,255,0,255))
MainText:SetPos(45,35)
MainText:SetFont( "DefaultBold" )
MainText:SizeToContents()
local ButtonsSidePanel = StartBrowserPanel:Add("DPanel")
ButtonsSidePanel:DockMargin(4, 4, 4, 4)
ButtonsSidePanel:Dock(TOP)
ButtonsSidePanel:SetSize(280, 430)
ButtonsSidePanel:SetDrawBackground(false)
--#############################################################
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
RunConsoleCommand( "acfcustom_red", Redcolor )
RunConsoleCommand( "acfcustom_green", Greencolor )
RunConsoleCommand( "acfcustom_blue", Bluecolor )
--Add 2nd panel
local SecondPanel = MainPanel:Add("DPanel")
SecondPanel:DockMargin(4, 4, 4, 4)
SecondPanel:Dock(TOP)
SecondPanel:SetSize(280, 430)
SecondPanel:SetDrawBackground(false)
--------------------------------------
-- 2nd Panel Menu
--------------------------------------
if not file.Exists("acf/menucolor.txt", "DATA") then
SaveFunc()
end
--###########################################
--create menu text
CurrentText = ButtonsSidePanel:Add("DLabel")
CurrentText:SetPos(160,260)
CurrentText:SetFont( "DefaultBold" )
CurrentText:SetText("Current Color :\n ("..Redcolor..","..Greencolor..","..Bluecolor..")")
CurrentText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
CurrentText:SizeToContents()
HelpText = ButtonsSidePanel:Add("DLabel")
HelpText:SetPos(140,320)
HelpText:SetFont( "DefaultBold" )
HelpText:SetText(" To Reload\n ACF Menu Colors\n Clic on ACF Home\nat the top of ACF Menu")
HelpText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
HelpText:SizeToContents()
Save = ButtonsSidePanel:Add("DButton")
--Set color text
local ColorText = SecondPanel:Add("DLabel")
ColorText:SetPos(160,260)
ColorText:SetFont( "DefaultBold" )
ColorText:SetText("Current Color :\n ("..ACFC.R..","..ACFC.G..","..ACFC.B..")")
ColorText:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
ColorText:SizeToContents()
--Set help text
local Help = SecondPanel:Add("DLabel")
Help:SetPos(140,320)
Help:SetFont( "DefaultBold" )
Help:SetText(" To Reload\n ACF Menu Colors\n Clic on ACF Home\nat the top of ACF Menu")
Help:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Help:SizeToContents()
--Set save button
local Save = SecondPanel:Add("DButton")
Save:SetText("Save")
Save:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
Save:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Save:SetPos(20,260)
Save:SetWide(100)
Save:SetTall(60)
Save.DoClick = function()
SaveFunc()
end
Close = ButtonsSidePanel:Add("DButton")
--Set close button
local Close = SecondPanel:Add("DButton")
Close:SetText("Close")
Close:SetTextColor(Color(255,0,0,255))
Close:SetPos(20,340)
Close:SetWide(100)
Close:SetTall(60)
Close.DoClick = function()
StartBrowserPanel:Close()
MainPanel:Close()
end
--#########################################################################################
--Color Mixer
ColorPanel = ButtonsSidePanel:Add("DPanel")
ColorPanel:SetSize( 257,190 ) --good size for example
ColorPanel:SetPos( 10, 30 )
--Create color mixer panel
local ColorPanel = SecondPanel:Add("DPanel")
ColorPanel:SetSize(257,190)
ColorPanel:SetPos(10, 30)
ColorPanel:SetDrawBackground(false)
Mixer = ColorPanel:Add("DColorMixer")
Mixer:Dock( FILL )
Mixer:SetPalette( false )
Mixer:SetAlphaBar( false )
Mixer:SetWangs( true )
Mixer:SetColor( Color( Redcolor,Greencolor,Bluecolor ) )
--Color mixer
local Mixer = ColorPanel:Add("DColorMixer")
Mixer:Dock(FILL)
Mixer:SetPalette(false)
Mixer:SetAlphaBar(false)
Mixer:SetWangs(true)
Mixer:SetColor(Color(ACFC.R,ACFC.G,ACFC.B))
Mixer.ValueChanged = function()
local colorRGB = Mixer:GetColor()
local r,g,b,a = colorRGB.r, colorRGB.g, colorRGB.b, colorRGB.a
Redcolorcheck = tonumber(r)
Greencolorcheck = tonumber(g)
Bluecolorcheck = tonumber(b)
local ColorTable = {tonumber(r), tonumber(g), tonumber(b)}
if Redcolorcheck > 255 then
Redcolor = 255
else
Redcolor = tonumber(r)
for k, v in pairs(ColorTable) do
if v > 255 then
k = 255
else
k = tonumber(v)
end
end
if Greencolorcheck > 255 then
Greencolor = 255
else
Greencolor = tonumber(g)
end
ACFC.R = tonumber(ColorTable[1])
ACFC.G = tonumber(ColorTable[2])
ACFC.B = tonumber(ColorTable[3])
if Bluecolorcheck > 255 then
Bluecolor = 255
else
Bluecolor = tonumber(b)
end
RunConsoleCommand( "acfcustom_red", Redcolor )
RunConsoleCommand( "acfcustom_green", Greencolor )
RunConsoleCommand( "acfcustom_blue", Bluecolor )
CurrentText:SetText("Current Color :\n ("..Redcolor..","..Greencolor..","..Bluecolor..")")
CurrentText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
HelpText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
Save:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
ColorText:SetText("Current Color :\n ("..ACFC.R..","..ACFC.G..","..ACFC.B..")")
ColorText:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Help:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Save:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
end
--#########################################################################################
StartBrowserPanel.OnClose = function()
end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end
--Saving
--------------------------------------
-- Saving
--------------------------------------
function SaveFunc()
local RedcolorT = math.Round(GetConVarNumber("acfcustom_red"))
local GreencolorT = math.Round(GetConVarNumber("acfcustom_green"))
local BluecolorT = math.Round(GetConVarNumber("acfcustom_blue"))
local txt = RedcolorT..","..GreencolorT..","..BluecolorT
local txt = ACFC.R..","..ACFC.G..","..ACFC.B
file.CreateDir("acf")
file.Write("acf/menucolor.txt", txt)
end
local function OpenSartBrowser(pl, cmd, args)
if (!IsValid(StartBrowserPanel)) then
CreateSoundBrowser()
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
if (!IsValid(MainPanel)) then
CreateMenu()
end
StartBrowserPanel:SetVisible(true)
StartBrowserPanel:MakePopup()
StartBrowserPanel:InvalidateLayout(true)
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
WireLib.Timedcall(function(StartBrowserPanel)
if (!IsValid(StartBrowserPanel)) then return end
WireLib.Timedcall(function(MainPanel)
if (!IsValid(MainPanel)) then return end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end, StartBrowserPanel)
end, MainPanel)
end
concommand.Add("acf_colormenu_browser_open", OpenSartBrowser)
concommand.Add("acf_colormenu_open", OpenMenu)

View File

@ -1,127 +1,90 @@
// Made by Bouletmarc.
local StartBrowserPanel = nil
--------------------------------------
-- Set vars
--------------------------------------
local MainPanel = nil
local Changelog = {}
local function CreateSoundBrowser()
StartBrowserPanel = vgui.Create("DFrame") // The main frame.
StartBrowserPanel:SetSize(350, 450)
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu()
--Set frame
MainPanel = vgui.Create("DFrame")
MainPanel:SetSize(350, 450)
--Set Center
StartBrowserPanel:SetPos(((ScrW()/2)-(StartBrowserPanel:GetWide()/2))+ScrW()/4,(ScrH()/2)-(StartBrowserPanel:GetTall()/2))
StartBrowserPanel:SetMinWidth(350)
StartBrowserPanel:SetMinHeight(450)
StartBrowserPanel:SetSizable(false)
StartBrowserPanel:SetDeleteOnClose( true )
StartBrowserPanel:SetTitle("Whats New Menu V8.1")
StartBrowserPanel:SetVisible(false)
StartBrowserPanel:SetCookieName( "wire_sound_browser" )
StartBrowserPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
local ButtonsSidePanel = StartBrowserPanel:Add("DPanel")
ButtonsSidePanel:DockMargin(4, 4, 4, 4)
ButtonsSidePanel:Dock(TOP)
ButtonsSidePanel:SetSize(330, 406)
ButtonsSidePanel:SetDrawBackground(true)
--#############################################################
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
RunConsoleCommand( "acfcustom_red", Redcolor )
RunConsoleCommand( "acfcustom_green", Greencolor )
RunConsoleCommand( "acfcustom_blue", Bluecolor )
SaveFunc()
end
--###########################################
CurrentText = ButtonsSidePanel:Add("DLabel")
CurrentText:SetPos(70,20)
CurrentText:SetFont( "DefaultBold" )
CurrentText:SetText("Whats New in ACF Custom Rev : "..ACFCUSTOM.Version2)
CurrentText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
CurrentText:SizeToContents()
Close = ButtonsSidePanel:Add("DButton")
MainPanel:SetPos(((ScrW()/2)-(MainPanel:GetWide()/2))+ScrW()/4,(ScrH()/2)-(MainPanel:GetTall()/2))
--Set size
MainPanel:SetMinWidth(350)
MainPanel:SetMinHeight(450)
--Set options
MainPanel:SetSizable(false)
MainPanel:SetDeleteOnClose( true )
MainPanel:SetTitle("Whats New Menu V8.1")
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Add 2nd panel
local SecondPanel = MainPanel:Add("DPanel")
SecondPanel:DockMargin(4, 4, 4, 4)
SecondPanel:Dock(TOP)
SecondPanel:SetSize(330, 406)
SecondPanel:SetDrawBackground(true)
--------------------------------------
-- 2nd Panel Menu
--------------------------------------
--Set text
local Text = SecondPanel:Add("DLabel")
Text:SetPos(70,20)
Text:SetFont( "DefaultBold" )
Text:SetText("Whats New in ACF Custom Rev : "..ACFCUSTOM.Version)
Text:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Text:SizeToContents()
--Set close button
local Close = SecondPanel:Add("DButton")
Close:SetText("Close")
Close:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
Close:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Close:SetPos( 120,340 )
Close:SetWide(80)
Close:SetTall( 50 )
Close.DoClick = function()
StartBrowserPanel:Close()
MainPanel:Close()
end
--#################
CustomDisplay = ButtonsSidePanel:Add("DPanelList")
CustomDisplay:SetSpacing( 10 )
CustomDisplay:EnableHorizontal( false )
CustomDisplay:EnableVerticalScrollbar( true )
CustomDisplay:SetSize( 300, 240 )
CustomDisplay:SetPos( 20, 50 )
--Revision list
Rev = SecondPanel:Add("DPanelList")
Rev:SetSpacing( 10 )
Rev:EnableHorizontal( false )
Rev:EnableVerticalScrollbar( true )
Rev:SetSize( 300, 240 )
Rev:SetPos( 20, 50 )
ButtonsSidePanel:PerformLayout()
SecondPanel:PerformLayout()
if Changelog then
CustomDisplay:PerformLayout()
UpdateSoundBrowser( {rev = table.maxn(Changelog)} )
Rev:PerformLayout()
UpdateMenu( {rev = table.maxn(Changelog)} )
end
--###############
StartBrowserPanel.OnClose = function() end
StartBrowserPanel:InvalidateLayout(false)
MainPanel:InvalidateLayout(false)
end
--###########
function UpdateSoundBrowser( Table )
--#######
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
end
--Clear
--------------------------------------
-- Update Menu
--------------------------------------
function UpdateMenu( Table )
--Clear text
if TextLog2 then TextLog2:Remove() end
--Set Changelog text
TextLog2 = vgui.Create( "DLabel" )
TextLog2:SetText( Changelog[Table["rev"]])
TextLog2:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
TextLog2:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
TextLog2:SetFont( "DefaultBold" )
TextLog2:SetWrap(true)
TextLog2:SetAutoStretchVertical(true)
CustomDisplay:AddItem( TextLog2 )
Rev:AddItem( TextLog2 )
CustomDisplay:PerformLayout()
Rev:PerformLayout()
end
--###########
--------------------------------------
-- Changelog Calling
--------------------------------------
local function ACFChangelogHTTPCallBack(contents , size)
local Temp = string.Explode( "*", contents )
Changelog = {}
@ -131,19 +94,20 @@ local function ACFChangelogHTTPCallBack(contents , size)
table.SortByKey(Changelog,true)
end
http.Fetch("https://raw.github.com/bouletmarc/ACF_CustomMod/master/changelogcustom.txt", ACFChangelogHTTPCallBack, function() end)
--##########
local function OpenSartBrowser(pl, cmd, args)
if (!IsValid(StartBrowserPanel)) then
CreateSoundBrowser()
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
if (!IsValid(MainPanel)) then
CreateMenu()
end
StartBrowserPanel:SetVisible(true)
StartBrowserPanel:MakePopup()
StartBrowserPanel:InvalidateLayout(true)
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
WireLib.Timedcall(function(StartBrowserPanel)
if (!IsValid(StartBrowserPanel)) then return end
StartBrowserPanel:InvalidateLayout(true)
end, StartBrowserPanel)
WireLib.Timedcall(function(MainPanel)
if (!IsValid(MainPanel)) then return end
MainPanel:InvalidateLayout(true)
end, MainPanel)
end
concommand.Add("acf_whatsnew_browser_open", OpenSartBrowser)
concommand.Add("acf_whatsnew_open", OpenMenu)

View File

@ -1,68 +1,51 @@
// Made by Bouletmarc.
local StartBrowserPanel = nil
local function CreateSoundBrowser()
--###########################################
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
end
--###########################################
StartBrowserPanel = vgui.Create("DFrame") // The main frame.
StartBrowserPanel:SetSize(450, 400)
--Set Center
StartBrowserPanel:SetPos((ScrW()/2)-(StartBrowserPanel:GetWide()/2),(ScrH()/2)-(StartBrowserPanel:GetTall()/2))
StartBrowserPanel:SetMinWidth(450)
StartBrowserPanel:SetMinHeight(400)
--------------------------------------
-- Set vars
--------------------------------------
local MainPanel = nil
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu()
StartBrowserPanel:SetSizable(false)
StartBrowserPanel:SetDeleteOnClose( true )
StartBrowserPanel:SetTitle("Engine Menu V8.5 - SETUP MENU")
StartBrowserPanel:SetVisible(false)
StartBrowserPanel:SetCookieName( "wire_sound_browser" )
StartBrowserPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
MainPanel = vgui.Create("DFrame")
MainPanel:SetSize(450, 400)
local ButtonsSidePanel = StartBrowserPanel:Add("DPanel")
ButtonsSidePanel:DockMargin(4, 4, 4, 4)
ButtonsSidePanel:Dock(TOP)
ButtonsSidePanel:SetSize(430, 360)
ButtonsSidePanel:SetDrawBackground(false)
--#############################################################
MainPanel:SetPos((ScrW()/2)-(MainPanel:GetWide()/2),(ScrH()/2)-(MainPanel:GetTall()/2))
MainPanel:SetMinWidth(450)
MainPanel:SetMinHeight(400)
MainPanel:SetSizable(false)
MainPanel:SetDeleteOnClose( true )
MainPanel:SetTitle("Engine Menu V"..ACFCUSTOM.EngineMakerVersion.." - SETUP MENU")
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Add 2nd panel
local SecondPanel = MainPanel:Add("DPanel")
SecondPanel:DockMargin(4, 4, 4, 4)
SecondPanel:Dock(TOP)
SecondPanel:SetSize(430, 360)
SecondPanel:SetDrawBackground(false)
--------------------------------------
-- 2nd Panel Menu
--------------------------------------
--Set local vars
local FuelTypeValue = 0 --Petrol, Diesel, etc...
local EngTypeValue = 0 --I4, I6, etc..
local EngSizeValue = 0 --Small, Medium, Fat
local MdlText = ""
local iSelectVal = "false"
local IsTransVal = "false"
RunConsoleCommand( "acfcustom_data4", "Petrol" )
RunConsoleCommand( "acfcustom_data5", "GenericPetrol" )
RunConsoleCommand( "acfcustom_data13", "false" )
RunConsoleCommand( "acfcustom_data14", "false" )
EngineNameTitle = ButtonsSidePanel:Add( "DLabel" )
EngineNameTitle = SecondPanel:Add( "DLabel" )
EngineNameTitle:SetText( "Engine Name :" )
EngineNameTitle:SetFont( "DefaultBold" )
EngineNameTitle:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
EngineNameTitle:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
EngineNameTitle:SetPos( 20,10 )
EngineNameTitle:SizeToContents()
EngineName = ButtonsSidePanel:Add( "DTextEntry" )
EngineName = SecondPanel:Add( "DTextEntry" )
EngineName:SetText( "PUT NAME HERE" )
EngineName:SetTextColor(Color(200,0,0,255))
EngineName:SetPos( 20,30 )
@ -72,19 +55,18 @@ local function CreateSoundBrowser()
EngineName:SetText( "PUT NAME HERE" )
EngineName:SetTextColor(Color(200,0,0,255))
else
RunConsoleCommand( "acfcustom_data1", EngineName:GetValue() )
EngineName:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
EngineName:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
end
end
FuelTypeButton = ButtonsSidePanel:Add("DButton")
FuelTypeButton = SecondPanel:Add("DButton")
FuelTypeButton:SetText("Petrol")
FuelTypeButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
FuelTypeButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
FuelTypeButton:SetPos( 0, 60 )
FuelTypeButton:SetWide( 60 )
FuelTypeButton:SetTall( 40 )
ModelsList = ButtonsSidePanel:Add("DComboBox")
ModelsList = SecondPanel:Add("DComboBox")
ModelsList:SetPos(70,70)
ModelsList:SetSize( 120, 20 )
ModelsList.OnSelect = function( panel, index, value )
@ -92,19 +74,18 @@ local function CreateSoundBrowser()
EngineModel2:SetText( "Models :\n"..MdlText )
EngineModel2:SizeToContents()
DisplayModel:SetModel( MdlText )
RunConsoleCommand("acf_menudata3", MdlText)
end
--#######################
EngineModel2 = ButtonsSidePanel:Add( "DLabel" )
EngineModel2 = SecondPanel:Add( "DLabel" )
EngineModel2:SetText( "Models :\n"..MdlText )
EngineModel2:SetFont( "DefaultBold" )
EngineModel2:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
EngineModel2:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
EngineModel2:SetPos( 180, 10 )
EngineModel2:SizeToContents()
--#### DISPLAY
DisplayModel = ButtonsSidePanel:Add("DModelPanel")
DisplayModel = SecondPanel:Add("DModelPanel")
DisplayModel:SetModel( MdlText )
DisplayModel:SetCamPos( Vector( 250, 500, 250 ) )
DisplayModel:SetLookAt( Vector( 0, 0, 0 ) )
@ -114,158 +95,128 @@ local function CreateSoundBrowser()
DisplayModel.LayoutEntity = function( panel , entity ) end
--########################
--Side Text Entry Setup and Hint
TorqueHint = ButtonsSidePanel:Add("DButton")
TorqueHint = SecondPanel:Add("DButton")
TorqueHint:SetToolTip("This is your Torque amount value\nUse Small value for Small Engine(ex:75)\nUse Medium value for Medium Engine(ex:450)\nUse Big value for Big Engine(ex:2000)\nTake note Diesel and Turbine engines need\na bit bigger value than others engines")
TorqueHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
TorqueHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
TorqueHint:SetWide(100)
TorqueHint:SetTall(25)
TorqueHint:SetPos( 210, 50 )
TorqueHint:SetText("Torque Hint")
TorqueEntry = ButtonsSidePanel:Add( "DTextEntry" )
TorqueEntry = SecondPanel:Add( "DTextEntry" )
TorqueEntry:SetText( "Torque Number" )
TorqueEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
TorqueEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
TorqueEntry:SetPos( 320, 50 )
TorqueEntry:SetWide( 120 )
TorqueEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data6", TorqueEntry:GetValue() )
end
IdleHint = ButtonsSidePanel:Add("DButton")
IdleHint = SecondPanel:Add("DButton")
IdleHint:SetToolTip("Use value between 500-2000 RPM\nFuel Engine Only")
IdleHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
IdleHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
IdleHint:SetWide(100)
IdleHint:SetTall(25)
IdleHint:SetPos( 210, 90 )
IdleHint:SetText("Idle RPM Hint")
IdleEntry = ButtonsSidePanel:Add( "DTextEntry" )
IdleEntry = SecondPanel:Add( "DTextEntry" )
IdleEntry:SetText( "Idle Number" )
IdleEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
IdleEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
IdleEntry:SetPos( 320, 90 )
IdleEntry:SetWide( 120 )
IdleEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data7", IdleEntry:GetValue() )
end
PeakMinHint = ButtonsSidePanel:Add("DButton")
PeakMinHint = SecondPanel:Add("DButton")
PeakMinHint:SetToolTip("Use value between 2000-4000 RPM\nFuel Engine Only")
PeakMinHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
PeakMinHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
PeakMinHint:SetWide(100)
PeakMinHint:SetTall(25)
PeakMinHint:SetPos( 210, 130 )
PeakMinHint:SetText("Peak Min RPM Hint")
PeakMinEntry = ButtonsSidePanel:Add( "DTextEntry" )
PeakMinEntry = SecondPanel:Add( "DTextEntry" )
PeakMinEntry:SetText( "PeakMin RPM Number" )
PeakMinEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
PeakMinEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
PeakMinEntry:SetPos( 320, 130 )
PeakMinEntry:SetWide( 120 )
PeakMinEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data8", PeakMinEntry:GetValue() )
end
PeakMaxHint = ButtonsSidePanel:Add("DButton")
PeakMaxHint = SecondPanel:Add("DButton")
PeakMaxHint:SetToolTip("Use value between 4000-10000 RPM\nDONT use higher value than Limit RPM\nYou can use the same value as Limit RPM\nFuel Engine Only")
PeakMaxHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
PeakMaxHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
PeakMaxHint:SetWide(100)
PeakMaxHint:SetTall(25)
PeakMaxHint:SetPos( 210, 170 )
PeakMaxHint:SetText("Peak Max RPM Hint")
PeakMaxEntry = ButtonsSidePanel:Add( "DTextEntry" )
PeakMaxEntry = SecondPanel:Add( "DTextEntry" )
PeakMaxEntry:SetText( "PeakMax RPM Number" )
PeakMaxEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
PeakMaxEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
PeakMaxEntry:SetPos( 320, 170 )
PeakMaxEntry:SetWide( 120 )
PeakMaxEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data9", PeakMaxEntry:GetValue() )
end
LimitHint = ButtonsSidePanel:Add("DButton")
LimitHint = SecondPanel:Add("DButton")
LimitHint:SetToolTip("Use value between 4500-10000 RPM\nDONT use lower value than PeakMax RPM\nYou can use the same value as PeakMax RPM")
LimitHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
LimitHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
LimitHint:SetWide(100)
LimitHint:SetTall(25)
LimitHint:SetPos( 210, 210 )
LimitHint:SetText("Limit RPM Hint")
LimitEntry = ButtonsSidePanel:Add( "DTextEntry" )
LimitEntry = SecondPanel:Add( "DTextEntry" )
LimitEntry:SetText( "Limit RPM Number" )
LimitEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
LimitEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
LimitEntry:SetPos( 320, 210 )
LimitEntry:SetWide( 120 )
LimitEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data10", LimitEntry:GetValue() )
end
FlywheelHint = ButtonsSidePanel:Add("DButton")
FlywheelHint = SecondPanel:Add("DButton")
FlywheelHint:SetToolTip("Use value between 0.01-1 with Petrol engines\nUse value between 0.5-10 with :\nDiesel engines\nElectric engines\nTurbine engines")
FlywheelHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
FlywheelHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
FlywheelHint:SetWide(100)
FlywheelHint:SetTall(25)
FlywheelHint:SetPos( 210, 250 )
FlywheelHint:SetText("Flywheel Hint")
FlywheelEntry = ButtonsSidePanel:Add( "DTextEntry" )
FlywheelEntry = SecondPanel:Add( "DTextEntry" )
FlywheelEntry:SetText( "Flywheel Number" )
FlywheelEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
FlywheelEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
FlywheelEntry:SetPos( 320, 250 )
FlywheelEntry:SetWide( 120 )
FlywheelEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data11", FlywheelEntry:GetValue() )
end
FlywheelOverHint = ButtonsSidePanel:Add("DButton")
FlywheelOverHint = SecondPanel:Add("DButton")
FlywheelOverHint:SetToolTip("Use value between 5000-10000\nOnly on Electrics and Turbines engines")
FlywheelOverHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
FlywheelOverHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
FlywheelOverHint:SetWide(100)
FlywheelOverHint:SetTall(25)
FlywheelOverHint:SetPos( 210, 290 )
FlywheelOverHint:SetText("Override Hint")
FlywheelOverEntry = ButtonsSidePanel:Add( "DTextEntry" )
FlywheelOverEntry = SecondPanel:Add( "DTextEntry" )
FlywheelOverEntry:SetText( "Override Number" )
FlywheelOverEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
FlywheelOverEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
FlywheelOverEntry:SetPos( 320, 290 )
FlywheelOverEntry:SetWide( 120 )
FlywheelOverEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data15", FlywheelOverEntry:GetValue() )
end
FlywheelOverEntry:SetDrawBackground(false)
FlywheelOverEntry:SetEditable(false)
WeightHint = ButtonsSidePanel:Add("DButton")
WeightHint = SecondPanel:Add("DButton")
WeightHint:SetToolTip("Use value between 50-1000 for good Weight\nBigger your model are, bigger the number should be")
WeightHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
WeightHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
WeightHint:SetWide(100)
WeightHint:SetTall(25)
WeightHint:SetPos( 210, 330 )
WeightHint:SetText("Weight Hint")
WeightEntry = ButtonsSidePanel:Add( "DTextEntry" )
WeightEntry = SecondPanel:Add( "DTextEntry" )
WeightEntry:SetText( "Weight Number" )
WeightEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
WeightEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
WeightEntry:SetPos( 320, 330 )
WeightEntry:SetWide( 120 )
WeightEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data12", WeightEntry:GetValue() )
end
--#######################
--Fuel Do clic
FuelTypeButton.DoClick = function()
if FuelTypeValue == 0 then
FuelTypeValue = 1
FuelTypeButton:SetText("Diesel")
RunConsoleCommand( "acfcustom_data4", "Diesel" )
RunConsoleCommand( "acfcustom_data5", "GenericDiesel" )
elseif FuelTypeValue == 1 then
FuelTypeValue = 2
FuelTypeButton:SetText("Electric")
RunConsoleCommand( "acfcustom_data4", "Electric" )
RunConsoleCommand( "acfcustom_data5", "Electric" )
RunConsoleCommand( "acfcustom_data13", "true" )
RunConsoleCommand( "acfcustom_data14", "false" )
iSelectVal = "true"
IsTransVal = "false"
--Set False Values
@ -278,19 +229,12 @@ local function CreateSoundBrowser()
IdleEntry:SetDrawBackground(false)
PeakMinEntry:SetDrawBackground(false)
PeakMaxEntry:SetDrawBackground(false)
RunConsoleCommand( "acfcustom_data7", 10 )
RunConsoleCommand( "acfcustom_data8", 10 )
RunConsoleCommand( "acfcustom_data9", 10 )
--Set True Value
FlywheelOverEntry:SetDrawBackground(true)
FlywheelOverEntry:SetEditable(true)
elseif FuelTypeValue == 2 then
FuelTypeValue = 3
FuelTypeButton:SetText("Turbine")
RunConsoleCommand( "acfcustom_data4", "Any" )
RunConsoleCommand( "acfcustom_data5", "Turbine" )
RunConsoleCommand( "acfcustom_data13", "true" )
RunConsoleCommand( "acfcustom_data14", "true" )
iSelectVal = "true"
IsTransVal = "true"
--Set False Values
@ -303,19 +247,12 @@ local function CreateSoundBrowser()
IdleEntry:SetDrawBackground(false)
PeakMinEntry:SetDrawBackground(false)
PeakMaxEntry:SetDrawBackground(false)
RunConsoleCommand( "acfcustom_data7", 1 )
RunConsoleCommand( "acfcustom_data8", 1 )
RunConsoleCommand( "acfcustom_data9", 1 )
--Set True Value
FlywheelOverEntry:SetDrawBackground(true)
FlywheelOverEntry:SetEditable(true)
elseif FuelTypeValue == 3 then
FuelTypeValue = 0
FuelTypeButton:SetText("Petrol")
RunConsoleCommand( "acfcustom_data4", "Petrol" )
RunConsoleCommand( "acfcustom_data5", "GenericPetrol" )
RunConsoleCommand( "acfcustom_data13", "false" )
RunConsoleCommand( "acfcustom_data14", "false" )
iSelectVal = "false"
IsTransVal = "false"
--Reset True Value
@ -328,9 +265,6 @@ local function CreateSoundBrowser()
IdleEntry:SetDrawBackground(true)
PeakMinEntry:SetDrawBackground(true)
PeakMaxEntry:SetDrawBackground(true)
RunConsoleCommand( "acfcustom_data7", 500 )
RunConsoleCommand( "acfcustom_data8", 1200 )
RunConsoleCommand( "acfcustom_data9", 3500 )
--Reset False Value
FlywheelOverEntry:SetDrawBackground(false)
FlywheelOverEntry:SetEditable(false)
@ -338,23 +272,21 @@ local function CreateSoundBrowser()
end
end
--########################
--Back and Next Button
BackButton = ButtonsSidePanel:Add("DButton")
BackButton = SecondPanel:Add("DButton")
BackButton:SetText("Back")
BackButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
BackButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
BackButton:SetPos( 20, 320 )
BackButton:SetWide(80)
BackButton:SetTall( 40 )
BackButton.DoClick = function()
RunConsoleCommand("acf_enginestart_browser_open")
StartBrowserPanel:Close()
RunConsoleCommand("acf_enginestart_open")
MainPanel:Close()
end
NextButton = ButtonsSidePanel:Add("DButton")
NextButton = SecondPanel:Add("DButton")
NextButton:SetText("Next Step")
NextButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
NextButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
NextButton:SetPos( 120, 320 )
NextButton:SetWide(80)
NextButton:SetTall( 40 )
@ -400,8 +332,8 @@ local function CreateSoundBrowser()
txt = txt ..IdleLoadT..","..PeakMinLoadT..","..PeakMaxLoadT..","..LimitRpmLoadT..","..FlywheelLoadT..","..WeightLoadT..","
txt = txt ..EngSizeValue..","..EngTypeValue..","..iSelectVal..","..IsTransVal..","..FlywheelOverLoadT
file.Write("acf/lastengine.txt", txt)
RunConsoleCommand("acf_enginesound_browser_open")
StartBrowserPanel:Close()
RunConsoleCommand("acf_enginesound_open")
MainPanel:Close()
end
--Reload Values, used for engine Loading or Menu Back Button
@ -489,29 +421,27 @@ local function CreateSoundBrowser()
iSelectVal = iSelectLoad
IsTransVal = IsTransLoad
MdlText = ModelLoad
--######
StartBrowserPanel.OnClose = function() end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end
local function OpenSartBrowser(pl, cmd, args)
if (!IsValid(StartBrowserPanel)) then
CreateSoundBrowser()
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
if (!IsValid(MainPanel)) then
CreateMenu()
end
StartBrowserPanel:SetVisible(true)
StartBrowserPanel:MakePopup()
StartBrowserPanel:InvalidateLayout(true)
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
WireLib.Timedcall(function(StartBrowserPanel)
if (!IsValid(StartBrowserPanel)) then return end
WireLib.Timedcall(function(MainPanel)
if (!IsValid(MainPanel)) then return end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end, StartBrowserPanel)
end, MainPanel)
end
concommand.Add("acf_enginecreateload_browser_open", OpenSartBrowser)
concommand.Add("acf_enginecreateload_open", OpenMenu)

View File

@ -1,68 +1,51 @@
// Made by Bouletmarc.
--------------------------------------
-- Set vars
--------------------------------------
local MainPanel = nil
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu()
local StartBrowserPanel = nil
local function CreateSoundBrowser()
--###########################################
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
end
--###########################################
StartBrowserPanel = vgui.Create("DFrame") // The main frame.
StartBrowserPanel:SetSize(450, 400)
--Set Center
StartBrowserPanel:SetPos((ScrW()/2)-(StartBrowserPanel:GetWide()/2),(ScrH()/2)-(StartBrowserPanel:GetTall()/2))
StartBrowserPanel:SetMinWidth(450)
StartBrowserPanel:SetMinHeight(400)
MainPanel = vgui.Create("DFrame")
MainPanel:SetSize(450, 400)
StartBrowserPanel:SetSizable(false)
StartBrowserPanel:SetDeleteOnClose( true )
StartBrowserPanel:SetTitle("Engine Menu V8.5 - SETUP MENU")
StartBrowserPanel:SetVisible(false)
StartBrowserPanel:SetCookieName( "wire_sound_browser" )
StartBrowserPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
MainPanel:SetPos((ScrW()/2)-(MainPanel:GetWide()/2),(ScrH()/2)-(MainPanel:GetTall()/2))
MainPanel:SetMinWidth(450)
MainPanel:SetMinHeight(400)
local ButtonsSidePanel = StartBrowserPanel:Add("DPanel")
ButtonsSidePanel:DockMargin(4, 4, 4, 4)
ButtonsSidePanel:Dock(TOP)
ButtonsSidePanel:SetSize(430, 360)
ButtonsSidePanel:SetDrawBackground(false)
--#############################################################
MainPanel:SetSizable(false)
MainPanel:SetDeleteOnClose( true )
MainPanel:SetTitle("Engine Menu V"..ACFCUSTOM.EngineMakerVersion.." - SETUP MENU")
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Add 2nd panel
local SecondPanel = MainPanel:Add("DPanel")
SecondPanel:DockMargin(4, 4, 4, 4)
SecondPanel:Dock(TOP)
SecondPanel:SetSize(430, 360)
SecondPanel:SetDrawBackground(false)
--------------------------------------
-- 2nd Panel Menu
--------------------------------------
--Set local vars
local FuelTypeValue = 0 --Petrol, Diesel, etc...
local EngTypeValue = 0 --I4, I6, etc..
local EngSizeValue = 0 --Small, Medium, Fat
local MdlText = ""
local iSelectVal = "false"
local IsTransVal = "false"
RunConsoleCommand( "acfcustom_data4", "Petrol" )
RunConsoleCommand( "acfcustom_data5", "GenericPetrol" )
RunConsoleCommand( "acfcustom_data13", "false" )
RunConsoleCommand( "acfcustom_data14", "false" )
EngineNameTitle = ButtonsSidePanel:Add( "DLabel" )
EngineNameTitle = SecondPanel:Add( "DLabel" )
EngineNameTitle:SetText( "Engine Name :" )
EngineNameTitle:SetFont( "DefaultBold" )
EngineNameTitle:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
EngineNameTitle:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
EngineNameTitle:SetPos( 20,10 )
EngineNameTitle:SizeToContents()
EngineName = ButtonsSidePanel:Add( "DTextEntry" )
EngineName = SecondPanel:Add( "DTextEntry" )
EngineName:SetText( "PUT NAME HERE" )
EngineName:SetTextColor(Color(200,0,0,255))
EngineName:SetPos( 20,30 )
@ -72,19 +55,18 @@ local function CreateSoundBrowser()
EngineName:SetText( "PUT NAME HERE" )
EngineName:SetTextColor(Color(200,0,0,255))
else
RunConsoleCommand( "acfcustom_data1", EngineName:GetValue() )
EngineName:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
EngineName:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
end
end
FuelTypeButton = ButtonsSidePanel:Add("DButton")
FuelTypeButton = SecondPanel:Add("DButton")
FuelTypeButton:SetText("Petrol")
FuelTypeButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
FuelTypeButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
FuelTypeButton:SetPos( 0, 60 )
FuelTypeButton:SetWide( 60 )
FuelTypeButton:SetTall( 40 )
ModelsList = ButtonsSidePanel:Add("DComboBox")
ModelsList = SecondPanel:Add("DComboBox")
ModelsList:SetPos(70,70)
ModelsList:SetSize( 120, 20 )
ModelsList.OnSelect = function( panel, index, value )
@ -92,19 +74,18 @@ local function CreateSoundBrowser()
EngineModel2:SetText( "Models :\n"..MdlText )
EngineModel2:SizeToContents()
DisplayModel:SetModel( MdlText )
RunConsoleCommand("acf_menudata3", MdlText)
end
--#######################
EngineModel2 = ButtonsSidePanel:Add( "DLabel" )
EngineModel2 = SecondPanel:Add( "DLabel" )
EngineModel2:SetText( "Models :\n"..MdlText )
EngineModel2:SetFont( "DefaultBold" )
EngineModel2:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
EngineModel2:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
EngineModel2:SetPos( 180, 10 )
EngineModel2:SizeToContents()
--#### DISPLAY
DisplayModel = ButtonsSidePanel:Add("DModelPanel")
DisplayModel = SecondPanel:Add("DModelPanel")
DisplayModel:SetModel( MdlText )
DisplayModel:SetCamPos( Vector( 250, 500, 250 ) )
DisplayModel:SetLookAt( Vector( 0, 0, 0 ) )
@ -114,158 +95,128 @@ local function CreateSoundBrowser()
DisplayModel.LayoutEntity = function( panel , entity ) end
--########################
--Side Text Entry Setup and Hint
TorqueHint = ButtonsSidePanel:Add("DButton")
TorqueHint = SecondPanel:Add("DButton")
TorqueHint:SetToolTip("This is your Torque amount value\nUse Small value for Small Engine(ex:75)\nUse Medium value for Medium Engine(ex:450)\nUse Big value for Big Engine(ex:2000)\nTake note Diesel and Turbine engines need\na bit bigger value than others engines")
TorqueHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
TorqueHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
TorqueHint:SetWide(100)
TorqueHint:SetTall(25)
TorqueHint:SetPos( 210, 50 )
TorqueHint:SetText("Torque Hint")
TorqueEntry = ButtonsSidePanel:Add( "DTextEntry" )
TorqueEntry = SecondPanel:Add( "DTextEntry" )
TorqueEntry:SetText( "Torque Number" )
TorqueEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
TorqueEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
TorqueEntry:SetPos( 320, 50 )
TorqueEntry:SetWide( 120 )
TorqueEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data6", TorqueEntry:GetValue() )
end
IdleHint = ButtonsSidePanel:Add("DButton")
IdleHint = SecondPanel:Add("DButton")
IdleHint:SetToolTip("Use value between 500-2000 RPM\nFuel Engine Only")
IdleHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
IdleHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
IdleHint:SetWide(100)
IdleHint:SetTall(25)
IdleHint:SetPos( 210, 90 )
IdleHint:SetText("Idle RPM Hint")
IdleEntry = ButtonsSidePanel:Add( "DTextEntry" )
IdleEntry = SecondPanel:Add( "DTextEntry" )
IdleEntry:SetText( "Idle Number" )
IdleEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
IdleEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
IdleEntry:SetPos( 320, 90 )
IdleEntry:SetWide( 120 )
IdleEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data7", IdleEntry:GetValue() )
end
PeakMinHint = ButtonsSidePanel:Add("DButton")
PeakMinHint = SecondPanel:Add("DButton")
PeakMinHint:SetToolTip("Use value between 2000-4000 RPM\nFuel Engine Only")
PeakMinHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
PeakMinHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
PeakMinHint:SetWide(100)
PeakMinHint:SetTall(25)
PeakMinHint:SetPos( 210, 130 )
PeakMinHint:SetText("Peak Min RPM Hint")
PeakMinEntry = ButtonsSidePanel:Add( "DTextEntry" )
PeakMinEntry = SecondPanel:Add( "DTextEntry" )
PeakMinEntry:SetText( "PeakMin RPM Number" )
PeakMinEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
PeakMinEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
PeakMinEntry:SetPos( 320, 130 )
PeakMinEntry:SetWide( 120 )
PeakMinEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data8", PeakMinEntry:GetValue() )
end
PeakMaxHint = ButtonsSidePanel:Add("DButton")
PeakMaxHint = SecondPanel:Add("DButton")
PeakMaxHint:SetToolTip("Use value between 4000-10000 RPM\nDONT use higher value than Limit RPM\nYou can use the same value as Limit RPM\nFuel Engine Only")
PeakMaxHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
PeakMaxHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
PeakMaxHint:SetWide(100)
PeakMaxHint:SetTall(25)
PeakMaxHint:SetPos( 210, 170 )
PeakMaxHint:SetText("Peak Max RPM Hint")
PeakMaxEntry = ButtonsSidePanel:Add( "DTextEntry" )
PeakMaxEntry = SecondPanel:Add( "DTextEntry" )
PeakMaxEntry:SetText( "PeakMax RPM Number" )
PeakMaxEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
PeakMaxEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
PeakMaxEntry:SetPos( 320, 170 )
PeakMaxEntry:SetWide( 120 )
PeakMaxEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data9", PeakMaxEntry:GetValue() )
end
LimitHint = ButtonsSidePanel:Add("DButton")
LimitHint = SecondPanel:Add("DButton")
LimitHint:SetToolTip("Use value between 4500-10000 RPM\nDONT use lower value than PeakMax RPM\nYou can use the same value as PeakMax RPM")
LimitHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
LimitHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
LimitHint:SetWide(100)
LimitHint:SetTall(25)
LimitHint:SetPos( 210, 210 )
LimitHint:SetText("Limit RPM Hint")
LimitEntry = ButtonsSidePanel:Add( "DTextEntry" )
LimitEntry = SecondPanel:Add( "DTextEntry" )
LimitEntry:SetText( "Limit RPM Number" )
LimitEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
LimitEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
LimitEntry:SetPos( 320, 210 )
LimitEntry:SetWide( 120 )
LimitEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data10", LimitEntry:GetValue() )
end
FlywheelHint = ButtonsSidePanel:Add("DButton")
FlywheelHint = SecondPanel:Add("DButton")
FlywheelHint:SetToolTip("Use value between 0.01-1 with Petrol engines\nUse value between 0.5-10 with :\nDiesel engines\nElectric engines\nTurbine engines")
FlywheelHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
FlywheelHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
FlywheelHint:SetWide(100)
FlywheelHint:SetTall(25)
FlywheelHint:SetPos( 210, 250 )
FlywheelHint:SetText("Flywheel Hint")
FlywheelEntry = ButtonsSidePanel:Add( "DTextEntry" )
FlywheelEntry = SecondPanel:Add( "DTextEntry" )
FlywheelEntry:SetText( "Flywheel Number" )
FlywheelEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
FlywheelEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
FlywheelEntry:SetPos( 320, 250 )
FlywheelEntry:SetWide( 120 )
FlywheelEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data11", FlywheelEntry:GetValue() )
end
FlywheelOverHint = ButtonsSidePanel:Add("DButton")
FlywheelOverHint = SecondPanel:Add("DButton")
FlywheelOverHint:SetToolTip("Use value between 5000-10000\nOnly on Electrics and Turbines engines")
FlywheelOverHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
FlywheelOverHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
FlywheelOverHint:SetWide(100)
FlywheelOverHint:SetTall(25)
FlywheelOverHint:SetPos( 210, 290 )
FlywheelOverHint:SetText("Override Hint")
FlywheelOverEntry = ButtonsSidePanel:Add( "DTextEntry" )
FlywheelOverEntry = SecondPanel:Add( "DTextEntry" )
FlywheelOverEntry:SetText( "Override Number" )
FlywheelOverEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
FlywheelOverEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
FlywheelOverEntry:SetPos( 320, 290 )
FlywheelOverEntry:SetWide( 120 )
FlywheelOverEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data15", FlywheelOverEntry:GetValue() )
end
FlywheelOverEntry:SetDrawBackground(false)
FlywheelOverEntry:SetEditable(false)
WeightHint = ButtonsSidePanel:Add("DButton")
WeightHint = SecondPanel:Add("DButton")
WeightHint:SetToolTip("Use value between 50-1000 for good Weight\nBigger your model are, bigger the number should be")
WeightHint:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
WeightHint:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
WeightHint:SetWide(100)
WeightHint:SetTall(25)
WeightHint:SetPos( 210, 330 )
WeightHint:SetText("Weight Hint")
WeightEntry = ButtonsSidePanel:Add( "DTextEntry" )
WeightEntry = SecondPanel:Add( "DTextEntry" )
WeightEntry:SetText( "Weight Number" )
WeightEntry:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
WeightEntry:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
WeightEntry:SetPos( 320, 330 )
WeightEntry:SetWide( 120 )
WeightEntry.OnTextChanged = function( )
RunConsoleCommand( "acfcustom_data12", WeightEntry:GetValue() )
end
--#######################
--Fuel Do clic
FuelTypeButton.DoClick = function()
if FuelTypeValue == 0 then
FuelTypeValue = 1
FuelTypeButton:SetText("Diesel")
RunConsoleCommand( "acfcustom_data4", "Diesel" )
RunConsoleCommand( "acfcustom_data5", "GenericDiesel" )
elseif FuelTypeValue == 1 then
FuelTypeValue = 2
FuelTypeButton:SetText("Electric")
RunConsoleCommand( "acfcustom_data4", "Electric" )
RunConsoleCommand( "acfcustom_data5", "Electric" )
RunConsoleCommand( "acfcustom_data13", "true" )
RunConsoleCommand( "acfcustom_data14", "false" )
iSelectVal = "true"
IsTransVal = "false"
--Set False Values
@ -278,19 +229,12 @@ local function CreateSoundBrowser()
IdleEntry:SetDrawBackground(false)
PeakMinEntry:SetDrawBackground(false)
PeakMaxEntry:SetDrawBackground(false)
RunConsoleCommand( "acfcustom_data7", 10 )
RunConsoleCommand( "acfcustom_data8", 10 )
RunConsoleCommand( "acfcustom_data9", 10 )
--Set True Value
FlywheelOverEntry:SetDrawBackground(true)
FlywheelOverEntry:SetEditable(true)
elseif FuelTypeValue == 2 then
FuelTypeValue = 3
FuelTypeButton:SetText("Turbine")
RunConsoleCommand( "acfcustom_data4", "Any" )
RunConsoleCommand( "acfcustom_data5", "Turbine" )
RunConsoleCommand( "acfcustom_data13", "true" )
RunConsoleCommand( "acfcustom_data14", "true" )
iSelectVal = "true"
IsTransVal = "true"
--Set False Values
@ -303,19 +247,12 @@ local function CreateSoundBrowser()
IdleEntry:SetDrawBackground(false)
PeakMinEntry:SetDrawBackground(false)
PeakMaxEntry:SetDrawBackground(false)
RunConsoleCommand( "acfcustom_data7", 1 )
RunConsoleCommand( "acfcustom_data8", 1 )
RunConsoleCommand( "acfcustom_data9", 1 )
--Set True Value
FlywheelOverEntry:SetDrawBackground(true)
FlywheelOverEntry:SetEditable(true)
elseif FuelTypeValue == 3 then
FuelTypeValue = 0
FuelTypeButton:SetText("Petrol")
RunConsoleCommand( "acfcustom_data4", "Petrol" )
RunConsoleCommand( "acfcustom_data5", "GenericPetrol" )
RunConsoleCommand( "acfcustom_data13", "false" )
RunConsoleCommand( "acfcustom_data14", "false" )
iSelectVal = "false"
IsTransVal = "false"
--Reset True Value
@ -328,9 +265,6 @@ local function CreateSoundBrowser()
IdleEntry:SetDrawBackground(true)
PeakMinEntry:SetDrawBackground(true)
PeakMaxEntry:SetDrawBackground(true)
RunConsoleCommand( "acfcustom_data7", 500 )
RunConsoleCommand( "acfcustom_data8", 1200 )
RunConsoleCommand( "acfcustom_data9", 3500 )
--Reset False Value
FlywheelOverEntry:SetDrawBackground(false)
FlywheelOverEntry:SetEditable(false)
@ -345,30 +279,27 @@ local function CreateSoundBrowser()
EngineModel2:SetText( "Models :\n"..MdlText )
EngineModel2:SizeToContents()
DisplayModel:SetModel( MdlText )
RunConsoleCommand("acf_menudata3", MdlText)
for k, v in pairs(Name) do
if not table.HasValue( { "linear_l.mdl", "linear_m.mdl", "linear_s.mdl", "t5large.mdl", "t5med.mdl", "t5small.mdl", "transaxial_l.mdl", "transaxial_m.mdl", "transaxial_s.mdl" }, v ) then
ModelsList:AddChoice(v)
end
end
--########################
--Back and Next Button
BackButton = ButtonsSidePanel:Add("DButton")
BackButton = SecondPanel:Add("DButton")
BackButton:SetText("Back")
BackButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
BackButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
BackButton:SetPos( 20, 320 )
BackButton:SetWide(80)
BackButton:SetTall( 40 )
BackButton.DoClick = function()
RunConsoleCommand("acf_enginestart_browser_open")
StartBrowserPanel:Close()
RunConsoleCommand("acf_enginestart_open")
MainPanel:Close()
end
NextButton = ButtonsSidePanel:Add("DButton")
NextButton = SecondPanel:Add("DButton")
NextButton:SetText("Next Step")
NextButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
NextButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
NextButton:SetPos( 120, 320 )
NextButton:SetWide(80)
NextButton:SetTall( 40 )
@ -415,31 +346,30 @@ local function CreateSoundBrowser()
txt = txt ..IdleLoadT..","..PeakMinLoadT..","..PeakMaxLoadT..","..LimitRpmLoadT..","..FlywheelLoadT..","..WeightLoadT..","
txt = txt ..EngSizeValue..","..EngTypeValue..","..iSelectVal..","..IsTransVal..","..FlywheelOverLoadT
file.Write("acf/lastengine.txt", txt)
RunConsoleCommand("acf_enginesound_browser_open")
StartBrowserPanel:Close()
RunConsoleCommand("acf_enginesound_open")
MainPanel:Close()
end
StartBrowserPanel.OnClose = function() end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end
local function OpenSartBrowser(pl, cmd, args)
if (!IsValid(StartBrowserPanel)) then
CreateSoundBrowser()
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
if (!IsValid(MainPanel)) then
CreateMenu()
end
StartBrowserPanel:SetVisible(true)
StartBrowserPanel:MakePopup()
StartBrowserPanel:InvalidateLayout(true)
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
WireLib.Timedcall(function(StartBrowserPanel)
if (!IsValid(StartBrowserPanel)) then return end
WireLib.Timedcall(function(MainPanel)
if (!IsValid(MainPanel)) then return end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end, StartBrowserPanel)
end, MainPanel)
end
concommand.Add("acf_enginecreate_browser_open", OpenSartBrowser)
concommand.Add("acf_enginecreate_open", OpenMenu)

View File

@ -1,81 +1,65 @@
// Made by Bouletmarc
--------------------------------------
-- Set vars
--------------------------------------
local MainPanel = nil
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu()
local SoundBrowserPanel = nil
MainPanel = vgui.Create("DFrame")
MainPanel:SetSize(550, 450)
MainPanel:SetPos((ScrW()/2)-(MainPanel:GetWide()/2),(ScrH()/2)-(MainPanel:GetTall()/2))
local function CreateSoundBrowser()
--###########################################
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
end
--###########################################
MainPanel:SetMinWidth(550)
MainPanel:SetMinHeight(450)
SoundBrowserPanel = vgui.Create("DFrame") // The main frame.
SoundBrowserPanel:SetSize(550, 450)
--Set Center
SoundBrowserPanel:SetPos((ScrW()/2)-(SoundBrowserPanel:GetWide()/2),(ScrH()/2)-(SoundBrowserPanel:GetTall()/2))
SoundBrowserPanel:SetMinWidth(550)
SoundBrowserPanel:SetMinHeight(450)
SoundBrowserPanel:SetSizable(false)
SoundBrowserPanel:SetDeleteOnClose( true )
SoundBrowserPanel:SetTitle("Engine Menu V8.1 - LOAD MENU")
SoundBrowserPanel:SetVisible(false)
SoundBrowserPanel:SetCookieName( "wire_sound_browser" )
SoundBrowserPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Button Panel
local ButtonsSidePanel = SoundBrowserPanel:Add("DPanel")
ButtonsSidePanel:DockMargin(5, 5, 5, 5)
ButtonsSidePanel:Dock(TOP)
ButtonsSidePanel:SetTall(430)
ButtonsSidePanel:SetWide(SoundBrowserPanel:GetWide())
ButtonsSidePanel:SetDrawBackground(false)
--#########################################################################
MainPanel:SetSizable(false)
MainPanel:SetDeleteOnClose( true )
MainPanel:SetTitle("Engine Menu V"..ACFCUSTOM.EngineMakerVersion.." - LOAD MENU")
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Add 2nd panel
local SecondPanel = MainPanel:Add("DPanel")
SecondPanel:DockMargin(5, 5, 5, 5)
SecondPanel:Dock(TOP)
SecondPanel:SetTall(430)
SecondPanel:SetWide(MainPanel:GetWide())
SecondPanel:SetDrawBackground(false)
--------------------------------------
-- 2nd Panel Menu
--------------------------------------
--text
SaveText1 = ButtonsSidePanel:Add("DLabel")
SaveText1 = SecondPanel:Add("DLabel")
SaveText1:SetText("Load Menu")
SaveText1:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
SaveText1:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
SaveText1:SetPos(245,20)
SaveText1:SetFont( "DefaultBold" )
SaveText1:SizeToContents()
--button
BackButton = ButtonsSidePanel:Add("DButton")
BackButton = SecondPanel:Add("DButton")
BackButton:SetText("Back")
BackButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
BackButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
BackButton:SetPos(60,320)
BackButton:SetWide(80)
BackButton:SetTall(60)
BackButton.DoClick = function()
RunConsoleCommand("acf_enginestart_browser_open")
SoundBrowserPanel:Close()
RunConsoleCommand("acf_enginestart_open")
MainPanel:Close()
end
ExitButtonMode = 0
ExitButton = ButtonsSidePanel:Add("DButton")
ExitButton = SecondPanel:Add("DButton")
ExitButton:SetText("Close")
ExitButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
ExitButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
ExitButton:SetPos(230,320)
ExitButton:SetWide(100)
ExitButton:SetTall(60)
ExitButton.DoClick = function()
SoundBrowserPanel:Close()
MainPanel:Close()
if ExitButtonMode == 1 then
notification.AddLegacy("Dont forget to Update Engine Maker", NOTIFY_HINT, 5)
local CustomEngineTable = {}
@ -105,27 +89,12 @@ local function CreateSoundBrowser()
txt = txt ..EngineSizeLoadT..","..EngineTypeLoadText..","..iSelectLoad..","..IsTransLoad..","..FlywheelOverLoad
file.CreateDir("acf")
file.Write("acf/lastengine.txt", txt)
RunConsoleCommand( "acfcustom_data1", NameLoad )
RunConsoleCommand( "acf_menudata2", SoundLoad )
RunConsoleCommand( "acf_menudata3", ModelLoad )
RunConsoleCommand( "acf_menudata4", FuelTypeLoad )
RunConsoleCommand( "acf_menudata5", EngineTypeLoad )
RunConsoleCommand( "acfcustom_data6", TorqueLoad )
RunConsoleCommand( "acfcustom_data7", IdleLoad )
RunConsoleCommand( "acfcustom_data8", PeakMinLoad )
RunConsoleCommand( "acfcustom_data9", PeakMaxLoad )
RunConsoleCommand( "acfcustom_data10", LimitRpmLoad )
RunConsoleCommand( "acfcustom_data11", FlywheelLoad )
RunConsoleCommand( "acfcustom_data12", WeightLoad )
RunConsoleCommand( "acfcustom_data13", iSelectLoad )
RunConsoleCommand( "acfcustom_data14", IsTransLoad )
RunConsoleCommand( "acfcustom_data15", FlywheelOverLoad )
end
end
NextButton = ButtonsSidePanel:Add("DButton")
NextButton = SecondPanel:Add("DButton")
NextButton:SetText("Edit Engine")
NextButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
NextButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
NextButton:SetPos(400,320)
NextButton:SetWide(80)
NextButton:SetTall(60)
@ -159,30 +128,15 @@ local function CreateSoundBrowser()
txt = txt ..EngineSizeLoadT..","..EngineTypeLoadText..","..iSelectLoad..","..IsTransLoad..","..FlywheelOverLoad
file.CreateDir("acf")
file.Write("acf/lastengine.txt", txt)
RunConsoleCommand( "acfcustom_data1", NameLoad )
RunConsoleCommand( "acf_menudata2", SoundLoad )
RunConsoleCommand( "acf_menudata3", ModelLoad )
RunConsoleCommand( "acf_menudata4", FuelTypeLoad )
RunConsoleCommand( "acf_menudata5", EngineTypeLoad )
RunConsoleCommand( "acfcustom_data6", TorqueLoad )
RunConsoleCommand( "acfcustom_data7", IdleLoad )
RunConsoleCommand( "acfcustom_data8", PeakMinLoad )
RunConsoleCommand( "acfcustom_data9", PeakMaxLoad )
RunConsoleCommand( "acfcustom_data10", LimitRpmLoad )
RunConsoleCommand( "acfcustom_data11", FlywheelLoad )
RunConsoleCommand( "acfcustom_data12", WeightLoad )
RunConsoleCommand( "acfcustom_data13", iSelectLoad )
RunConsoleCommand( "acfcustom_data14", IsTransLoad )
RunConsoleCommand( "acfcustom_data15", FlywheelOverLoad )
RunConsoleCommand("acf_enginecreateload_browser_open")
SoundBrowserPanel:Close()
RunConsoleCommand("acf_enginecreateload_open")
MainPanel:Close()
end
end
DermaListView = ButtonsSidePanel:Add("DListView")
DermaListView:SetParent(ButtonsSidePanel)
DermaListView = SecondPanel:Add("DListView")
DermaListView:SetParent(SecondPanel)
DermaListView:SetPos(20, 50)
DermaListView:SetSize(160, 250)
DermaListView:SetMultiSelect(false)
@ -192,14 +146,14 @@ local function CreateSoundBrowser()
DermaListView:AddLine(tostring(file))
end
DermaListViewSpec = ButtonsSidePanel:Add("DListView")
DermaListViewSpec:SetParent(ButtonsSidePanel)
DermaListViewSpec = SecondPanel:Add("DListView")
DermaListViewSpec:SetParent(SecondPanel)
DermaListViewSpec:SetPos(200, 50)
DermaListViewSpec:SetSize(160, 250)
DermaListViewSpec:SetMultiSelect(false)
DermaListViewSpec:AddColumn("Engines Infos")
DisplayModel = ButtonsSidePanel:Add("DModelPanel")
DisplayModel = SecondPanel:Add("DModelPanel")
DisplayModel:SetModel( "" )
DisplayModel:SetCamPos( Vector( 250, 500, 250 ) )
DisplayModel:SetLookAt( Vector( 0, 0, 0 ) )
@ -230,25 +184,26 @@ local function CreateSoundBrowser()
end
end
SoundBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end
local function OpenSoundBrowser(pl, cmd, args)
if (!IsValid(SoundBrowserPanel)) then
CreateSoundBrowser()
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
if (!IsValid(MainPanel)) then
CreateMenu()
end
SoundBrowserPanel:SetVisible(true)
SoundBrowserPanel:MakePopup()
SoundBrowserPanel:InvalidateLayout(true)
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
WireLib.Timedcall(function(SoundBrowserPanel)
if (!IsValid(SoundBrowserPanel)) then return end
WireLib.Timedcall(function(MainPanel)
if (!IsValid(MainPanel)) then return end
SoundBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end, SoundBrowserPanel)
end, MainPanel)
end
concommand.Add("acf_engineload_browser_open", OpenSoundBrowser)
concommand.Add("acf_engineload_open", OpenMenu)

View File

@ -1,6 +1,7 @@
// Made by Bouletmarc
local SoundBrowserPanel = nil
--------------------------------------
-- Set vars
--------------------------------------
local MainPanel = nil
--Saving New Engine
function NewEngineSaveFunc()
@ -26,21 +27,6 @@ function NewEngineSaveFunc()
local iSelectLoad = tostring(LastEngineTable[15])
local IsTransLoad = tostring(LastEngineTable[16])
local FlywheelOverLoad = tonumber(LastEngineTable[17])
RunConsoleCommand( "acfcustom_data1", NameLoadT )
RunConsoleCommand( "acf_menudata2", SoundLoadT )
RunConsoleCommand( "acf_menudata3", ModelLoadT )
RunConsoleCommand( "acf_menudata4", FuelTypeLoadT )
RunConsoleCommand( "acf_menudata5", EngineTypeLoadT )
RunConsoleCommand( "acfcustom_data6", TorqueLoadT )
RunConsoleCommand( "acfcustom_data7", IdleLoadT )
RunConsoleCommand( "acfcustom_data8", PeakMinLoadT )
RunConsoleCommand( "acfcustom_data9", PeakMaxLoadT )
RunConsoleCommand( "acfcustom_data10", LimitRpmLoadT )
RunConsoleCommand( "acfcustom_data11", FlywheelLoadT )
RunConsoleCommand( "acfcustom_data12", WeightLoadT )
RunConsoleCommand( "acfcustom_data13", iSelectLoad )
RunConsoleCommand( "acfcustom_data14", IsTransLoad )
RunConsoleCommand( "acfcustom_data15", FlywheelOverLoad )
local txt = NameLoadT..","..SoundLoadT..","..ModelLoadT..","..FuelTypeLoadT..","..EngineTypeLoadT..","..TorqueLoadT..","
txt = txt ..IdleLoadT..","..PeakMinLoadT..","..PeakMaxLoadT..","..LimitRpmLoadT..","..FlywheelLoadT..","..WeightLoadT..","
@ -61,62 +47,45 @@ function NewEngineSaveFunc()
file.Write("acf/custom.engines/"..Nametxtfile..".txt", txt) --Save the engine
file.Write("acf/lastengine.txt", txt) --Save the engine also as
end
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu()
local function CreateSoundBrowser()
--###########################################
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
end
--###########################################
MainPanel = vgui.Create("DFrame")
MainPanel:SetPos(500,200)
MainPanel:SetSize(450, 450)
SoundBrowserPanel = vgui.Create("DFrame") // The main frame.
SoundBrowserPanel:SetPos(500,200)
SoundBrowserPanel:SetSize(450, 450)
MainPanel:SetMinWidth(450)
MainPanel:SetMinHeight(450)
SoundBrowserPanel:SetMinWidth(450)
SoundBrowserPanel:SetMinHeight(450)
SoundBrowserPanel:SetSizable(false)
SoundBrowserPanel:SetDeleteOnClose( true )
SoundBrowserPanel:SetTitle("Engine Menu V3.3 - SAVE MENU")
SoundBrowserPanel:SetVisible(false)
SoundBrowserPanel:SetCookieName( "wire_sound_browser" )
SoundBrowserPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Button Panel
local ButtonsSidePanel = SoundBrowserPanel:Add("DPanel")
ButtonsSidePanel:DockMargin(5, 5, 5, 5)
ButtonsSidePanel:Dock(TOP)
ButtonsSidePanel:SetTall(440)
ButtonsSidePanel:SetWide(SoundBrowserPanel:GetWide())
ButtonsSidePanel:SetDrawBackground(false)
--#########################################################################
MainPanel:SetSizable(false)
MainPanel:SetDeleteOnClose( true )
MainPanel:SetTitle("Engine Menu V"..ACFCUSTOM.EngineMakerVersion.." - SAVE MENU")
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Add 2nd panel
local SecondPanel = MainPanel:Add("DPanel")
SecondPanel:DockMargin(5, 5, 5, 5)
SecondPanel:Dock(TOP)
SecondPanel:SetTall(440)
SecondPanel:SetWide(MainPanel:GetWide())
SecondPanel:SetDrawBackground(false)
--------------------------------------
-- 2nd Panel Menu
--------------------------------------
--text
SaveText1 = ButtonsSidePanel:Add("DLabel")
SaveText1 = SecondPanel:Add("DLabel")
SaveText1:SetText("Save Menu")
SaveText1:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
SaveText1:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
SaveText1:SetPos(180,10)
SaveText1:SetFont( "DefaultBold" )
SaveText1:SizeToContents()
DermaListView = ButtonsSidePanel:Add("DListView")
DermaListView:SetParent(ButtonsSidePanel)
DermaListView = SecondPanel:Add("DListView")
DermaListView:SetParent(SecondPanel)
DermaListView:SetPos(40, 30)
DermaListView:SetSize(350, 280)
DermaListView:SetMultiSelect(false)
@ -162,18 +131,18 @@ local function CreateSoundBrowser()
DermaListView:SetSortable(false)
--button
BackButton = ButtonsSidePanel:Add("DButton")
BackButton = SecondPanel:Add("DButton")
BackButton:SetText("Back")
BackButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
BackButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
BackButton:SetPos(40,330)
BackButton:SetWide(80)
BackButton:SetTall(60)
BackButton.DoClick = function()
RunConsoleCommand("acf_enginesound_browser_open")
SoundBrowserPanel:Close()
RunConsoleCommand("acf_enginesound_open")
MainPanel:Close()
end
NextButton = ButtonsSidePanel:Add("DButton")
NextButton = SecondPanel:Add("DButton")
NextButton:SetText("Quit without save")
NextButton:SetToolTip("Dont forget to update the menu !")
NextButton:SetTextColor(Color(255,0,0,255))
@ -202,28 +171,13 @@ local function CreateSoundBrowser()
local iSelectLoad = tostring(LastEngineTable[15])
local IsTransLoad = tostring(LastEngineTable[16])
local FlywheelOverLoad = tonumber(LastEngineTable[17])
RunConsoleCommand( "acfcustom_data1", NameLoadT )
RunConsoleCommand( "acf_menudata2", SoundLoadT )
RunConsoleCommand( "acf_menudata3", ModelLoadT )
RunConsoleCommand( "acf_menudata4", FuelTypeLoadT )
RunConsoleCommand( "acf_menudata5", EngineTypeLoadT )
RunConsoleCommand( "acfcustom_data6", TorqueLoadT )
RunConsoleCommand( "acfcustom_data7", IdleLoadT )
RunConsoleCommand( "acfcustom_data8", PeakMinLoadT )
RunConsoleCommand( "acfcustom_data9", PeakMaxLoadT )
RunConsoleCommand( "acfcustom_data10", LimitRpmLoadT )
RunConsoleCommand( "acfcustom_data11", FlywheelLoadT )
RunConsoleCommand( "acfcustom_data12", WeightLoadT )
RunConsoleCommand( "acfcustom_data13", iSelectLoad )
RunConsoleCommand( "acfcustom_data14", IsTransLoad )
RunConsoleCommand( "acfcustom_data15", FlywheelOverLoad )
SoundBrowserPanel:Close()
MainPanel:Close()
notification.AddLegacy("Dont forget to Update Engine Maker", NOTIFY_HINT, 5)
end
SaveButton = ButtonsSidePanel:Add("DButton")
SaveButton = SecondPanel:Add("DButton")
SaveButton:SetText("Save")
SaveButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
SaveButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
SaveButton:SetPos(170,330)
SaveButton:SetWide(80)
SaveButton:SetTall(60)
@ -231,27 +185,28 @@ local function CreateSoundBrowser()
NewEngineSaveFunc()
NextButton:SetText("Quit")
NextButton:SetWide(80)
NextButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
NextButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
end
SoundBrowserPanel:InvalidateLayout(false)
MainPanel:InvalidateLayout(false)
end
local function OpenSoundBrowser(pl, cmd, args)
if (!IsValid(SoundBrowserPanel)) then
CreateSoundBrowser(path)
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
if (!IsValid(MainPanel)) then
CreateMenu(path)
end
SoundBrowserPanel:SetVisible(true)
SoundBrowserPanel:MakePopup()
SoundBrowserPanel:InvalidateLayout(true)
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
WireLib.Timedcall(function(SoundBrowserPanel)
if (!IsValid(SoundBrowserPanel)) then return end
WireLib.Timedcall(function(MainPanel)
if (!IsValid(MainPanel)) then return end
SoundBrowserPanel:InvalidateLayout(true)
end, SoundBrowserPanel)
MainPanel:InvalidateLayout(true)
end, MainPanel)
end
concommand.Add("acf_enginesave_browser_open", OpenSoundBrowser)
concommand.Add("acf_enginesave_open", OpenMenu)

View File

@ -1,7 +1,8 @@
// Made by Bouletmarc
--------------------------------------
-- Set vars
--------------------------------------
local max_char_count = 200
local SoundBrowserPanel = nil
local MainPanel = nil
local TabFileBrowser = nil
local SoundObj = nil
local SoundObjNoEffect = nil
@ -117,7 +118,7 @@ end
end
local function SetupSoundemitter(strSound)
RunConsoleCommand("acf_menudata2", strSound)
--nothing to do
end
local function SetupClipboard(strSound)
@ -216,28 +217,10 @@ local function SaveFilePath(panel, file)
panel:SetCookie("wire_soundfile", file)
end
local function CreateSoundBrowser(path)
--###########################################
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
end
--###########################################
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu(path)
local soundemitter = false
if (isstring(path) and path ~= "") then
soundemitter = true
@ -247,25 +230,24 @@ local function CreateSoundBrowser(path)
local nSoundVolume = 1
local nSoundPitch = 100
SoundBrowserPanel = vgui.Create("DFrame") // The main frame.
SoundBrowserPanel:SetSize(450, 500)
--Set Center
SoundBrowserPanel:SetPos((ScrW()/2)-(SoundBrowserPanel:GetWide()/2),(ScrH()/2)-(SoundBrowserPanel:GetTall()/2))
MainPanel = vgui.Create("DFrame")
MainPanel:SetSize(450, 500)
MainPanel:SetPos((ScrW()/2)-(MainPanel:GetWide()/2),(ScrH()/2)-(MainPanel:GetTall()/2))
SoundBrowserPanel:SetMinWidth(400)
SoundBrowserPanel:SetMinHeight(450)
MainPanel:SetMinWidth(400)
MainPanel:SetMinHeight(450)
SoundBrowserPanel:SetSizable(false)
SoundBrowserPanel:SetDeleteOnClose( true )
SoundBrowserPanel:SetTitle("Engine Menu V8.1 - SOUND MENU")
SoundBrowserPanel:SetVisible(false)
SoundBrowserPanel:SetCookieName( "wire_sound_browser" )
SoundBrowserPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
MainPanel:SetSizable(false)
MainPanel:SetDeleteOnClose( true )
MainPanel:SetTitle("Engine Menu V"..ACFCUSTOM.EngineMakerVersion.." - SOUND MENU")
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
TabFileBrowser = vgui.Create("acf_enginesoundbrowser")
--#############################################################
local BrowserTabs = SoundBrowserPanel:Add("DPropertySheet")
local BrowserTabs = MainPanel:Add("DPropertySheet")
BrowserTabs:DockMargin(5, 5, 5, 5)
BrowserTabs:Dock(FILL)
BrowserTabs:AddSheet("Sounds Browser", TabFileBrowser, "icon16/folder.png", false, false, "Browse your sound folder.")
@ -300,35 +282,34 @@ local function CreateSoundBrowser(path)
TabFileBrowser.DoDoubleClick = function(parent, file)
PlaySound(file, nSoundVolume, nSoundPitch)
PlaySoundNoEffect()
SaveFilePath(SoundBrowserPanel, file)
SaveFilePath(MainPanel, file)
strSound = file
SetupSoundemitter(strSound)
end
TabFileBrowser.DoClick = function(parent, file)
SaveFilePath(SoundBrowserPanel, file)
SaveFilePath(MainPanel, file)
strSound = file
if (!IsValid(SoundInfoText)) then return end
SoundInfoText:SetText(GetInfoString(file, {"file"}))
if (!IsValid(SoundText)) then return end
SoundText:SetText( "Sound : "..strSound )
SoundText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
SoundText:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
SetupSoundemitter(strSound)
end
TabFileBrowser.DoRightClick = function(parent, file)
Sendmenu(file, SoundBrowserPanel.Soundemitter, nSoundVolume, nSoundPitch)
SaveFilePath(SoundBrowserPanel, file)
Sendmenu(file, MainPanel.Soundemitter, nSoundVolume, nSoundPitch)
SaveFilePath(MainPanel, file)
strSound = file
SetupSoundemitter(strSound)
end
--################################################################################
local InfoPanel = SoundBrowserPanel:Add("DPanel")
local InfoPanel = MainPanel:Add("DPanel")
InfoPanel:DockMargin(5, 0, 5, 0)
InfoPanel:Dock(BOTTOM)
InfoPanel:SetTall(140)
@ -349,9 +330,8 @@ local function CreateSoundBrowser(path)
SoundText:SetFont( "DefaultBold" )
SoundText:SetWide(280)
SoundText:SetTall(10)
SoundText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
SoundText:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
SoundInfoText = InfoPanel:Add("DTextEntry")
SoundInfoText:Dock(FILL)
SoundInfoText:DockMargin(4, 4, 4, 0)
@ -360,7 +340,7 @@ local function CreateSoundBrowser(path)
SoundInfoText:SetVerticalScrollbarEnabled(true)
SoundInfoText:SetCursorColor(Color(0,0,255,255))
SoundInfoText:SetHighlightColor(Color(0,255,0,200))
SoundInfoText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
SoundInfoText:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
local ButtonsPanel = Buttons2Panel:Add("DPanel")
ButtonsPanel:DockMargin(0, 0, 0, 0)
@ -383,7 +363,7 @@ local function CreateSoundBrowser(path)
local PlayButton = PlayStopPanel:Add("DButton")
PlayButton:SetText("Play")
PlayButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
PlayButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
PlayButton:Dock(LEFT)
PlayButton:SetSize( 60, 20 )
PlayButton.DoClick = function()
@ -393,7 +373,7 @@ local function CreateSoundBrowser(path)
local StopButton = PlayStopPanel:Add("DButton")
StopButton:SetText("Stop")
StopButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
StopButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
StopButton:Dock(RIGHT)
StopButton:SetSize( 60, 20 )
StopButton.DoClick = function()
@ -437,17 +417,17 @@ local function CreateSoundBrowser(path)
BackButton = ButtonsPanel2:Add("DButton")
BackButton:SetText("Back")
BackButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
BackButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
BackButton:Dock( BOTTOM )
BackButton:SetTall(35)
BackButton.DoClick = function()
RunConsoleCommand("acf_enginecreateload_browser_open")
SoundBrowserPanel:Close()
RunConsoleCommand("acf_enginecreateload_open")
MainPanel:Close()
end
local SoundemitterButton = ButtonsPanel2:Add("DButton")
SoundemitterButton:SetText("Next Step")
SoundemitterButton:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
SoundemitterButton:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
SoundemitterButton:DockMargin(0, 2, 0, 0)
SoundemitterButton:SetTall(35)
SoundemitterButton:Dock(BOTTOM)
@ -476,7 +456,6 @@ local function CreateSoundBrowser(path)
local iSelectLoad = tostring(LastEngineTable[15])
local IsTransLoad = tostring(LastEngineTable[16])
local FlywheelOverLoad = tonumber(LastEngineTable[17])
local BadValues = 0
local txt = NameLoadT..","..strSound..","..ModelLoadT..","..FuelTypeLoadT..","..EngineTypeLoadT..","..TorqueLoadT..","
txt = txt ..IdleLoadT..","..PeakMinLoadT..","..PeakMaxLoadT..","..LimitRpmLoadT..","..FlywheelLoadT..","..WeightLoadT..","
@ -484,27 +463,18 @@ local function CreateSoundBrowser(path)
file.Write("acf/lastengine.txt", txt)
RunConsoleCommand("acf_enginesave_browser_open")
SoundBrowserPanel:Close()
RunConsoleCommand("acf_enginesave_open")
MainPanel:Close()
end
SoundBrowserPanel.PerformLayout = function(self, ...)
MainPanel.PerformLayout = function(self, ...)
TunePitchSlider:SetWide(TunePanel:GetWide() / 2 - 4)
TuneVolumeSlider:SetWide(TunePanel:GetWide() / 2 - 4)
/*ButtonsPanel:SetWide(InfoPanel:GetTall() * 1)
PlayStopPanel:SetTall(InfoPanel:GetTall() / 3 - 2)
PlayButton:SetWide(PlayStopPanel:GetWide() / 2 - 2.5)
StopButton:SetWide(PlayButton:GetWide())*/
/*if (self.Soundemitter) then
SoundemitterButton:SetTall(PlayStopPanel:GetTall() - 1.8)
end*/
DFrame.PerformLayout(self, ...)
end
SoundBrowserPanel.OnClose = function()
MainPanel.OnClose = function()
nSoundVolume = 1
nSoundPitch = 100
TuneVolumeSlider:SetValue(nSoundVolume * 100)
@ -513,25 +483,27 @@ local function CreateSoundBrowser(path)
PlaySoundNoEffect()
end
SoundBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end
local function OpenSoundBrowser(pl, cmd, args)
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
local path = args[1]
if (!IsValid(SoundBrowserPanel)) then
CreateSoundBrowser(path)
if (!IsValid(MainPanel)) then
CreateMenu(path)
end
SoundBrowserPanel:SetVisible(true)
SoundBrowserPanel:MakePopup()
SoundBrowserPanel:InvalidateLayout(true)
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
if (!IsValid(TabFileBrowser)) then return end
WireLib.Timedcall(function(SoundBrowserPanel, TabFileBrowser, path)
if (!IsValid(SoundBrowserPanel)) then return end
WireLib.Timedcall(function(MainPanel, TabFileBrowser, path)
if (!IsValid(MainPanel)) then return end
if (!IsValid(TabFileBrowser)) then return end
local soundemitter = false
@ -539,15 +511,14 @@ local function OpenSoundBrowser(pl, cmd, args)
soundemitter = true
end
SoundBrowserPanel.Soundemitter = soundemitter
MainPanel.Soundemitter = soundemitter
SoundBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
if (!soundemitter) then
path = SoundBrowserPanel:GetCookie("wire_soundfile", "")
path = MainPanel:GetCookie("wire_soundfile", "")
end
TabFileBrowser:SetOpenFile(path)
end, SoundBrowserPanel, TabFileBrowser, path)
end, MainPanel, TabFileBrowser, path)
end
concommand.Add("acf_enginesound_browser_open", OpenSoundBrowser)
concommand.Add("acf_enginesound_open", OpenMenu)

View File

@ -1,129 +1,110 @@
// Made by Bouletmarc.
--------------------------------------
-- Set vars
--------------------------------------
local MainPanel = nil
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu()
local StartBrowserPanel = nil
local function CreateSoundBrowser()
StartBrowserPanel = vgui.Create("DFrame") // The main frame.
StartBrowserPanel:SetPos(600,200)
StartBrowserPanel:SetSize(200, 320)
MainPanel = vgui.Create("DFrame")
MainPanel:SetPos(600,200)
MainPanel:SetSize(200, 320)
--Set Center
StartBrowserPanel:SetPos((ScrW()/2)-(StartBrowserPanel:GetWide()/2),(ScrH()/2)-(StartBrowserPanel:GetTall()/2))
MainPanel:SetPos((ScrW()/2)-(MainPanel:GetWide()/2),(ScrH()/2)-(MainPanel:GetTall()/2))
StartBrowserPanel:SetMinWidth(200)
StartBrowserPanel:SetMinHeight(320)
MainPanel:SetMinWidth(200)
MainPanel:SetMinHeight(320)
StartBrowserPanel:SetSizable(false)
StartBrowserPanel:SetDeleteOnClose( false )
StartBrowserPanel:SetTitle("Engine Maker Start Menu V8.1")
StartBrowserPanel:SetVisible(false)
StartBrowserPanel:SetCookieName( "wire_sound_browser" )
StartBrowserPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
local ButtonsSidePanel = StartBrowserPanel:Add("DPanel")
ButtonsSidePanel:DockMargin(4, 4, 4, 4)
ButtonsSidePanel:Dock(TOP)
ButtonsSidePanel:SetSize(180, 300)
ButtonsSidePanel:SetDrawBackground(false)
--#############################################################
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
RunConsoleCommand( "acfcustom_red", Redcolor )
RunConsoleCommand( "acfcustom_green", Greencolor )
RunConsoleCommand( "acfcustom_blue", Bluecolor )
SaveFunc()
end
--###########################################
MainPanel:SetSizable(false)
MainPanel:SetDeleteOnClose( false )
MainPanel:SetTitle("Engine Maker Start Menu V"..ACFCUSTOM.EngineMakerVersion)
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Add 2nd panel
local SecondPanel = MainPanel:Add("DPanel")
SecondPanel:DockMargin(4, 4, 4, 4)
SecondPanel:Dock(TOP)
SecondPanel:SetSize(180, 300)
SecondPanel:SetDrawBackground(false)
--------------------------------------
-- 2nd Panel Menu
--------------------------------------
--create menu text
CurrentText = ButtonsSidePanel:Add("DLabel")
CurrentText = SecondPanel:Add("DLabel")
CurrentText:SetPos(35,10)
CurrentText:SetFont( "DefaultBold" )
CurrentText:SetText(" ACF Engine Maker\nMade By Bouletmarc")
CurrentText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
CurrentText:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
CurrentText:SizeToContents()
CreateEng = ButtonsSidePanel:Add("DButton")
CreateEng = SecondPanel:Add("DButton")
CreateEng:SetText("Create New Engine")
CreateEng:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
CreateEng:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
CreateEng:SetToolTip("Create a New Engine\nChoose Values, Model, Sound, Name\nAnd save it !")
CreateEng:SetPos( 35, 60 )
CreateEng:SetWide(110)
CreateEng:SetTall( 40 )
CreateEng.DoClick = function()
RunConsoleCommand("acf_enginecreate_browser_open")
StartBrowserPanel:Close()
RunConsoleCommand("acf_enginecreate_open")
MainPanel:Close()
end
LoadEng = ButtonsSidePanel:Add("DButton")
LoadEng = SecondPanel:Add("DButton")
LoadEng:SetText("Load/Edit Engine")
LoadEng:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
LoadEng:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
LoadEng:SetToolTip("Load a engine\nThen edit it if you want")
LoadEng:SetPos( 35, 110 )
LoadEng:SetWide(110)
LoadEng:SetTall( 40 )
LoadEng.DoClick = function()
RunConsoleCommand("acf_engineload_browser_open")
StartBrowserPanel:Close()
RunConsoleCommand("acf_engineload_open")
MainPanel:Close()
end
EditLastEng = ButtonsSidePanel:Add("DButton")
EditLastEng = SecondPanel:Add("DButton")
EditLastEng:SetText("Edit Last Engine")
EditLastEng:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
EditLastEng:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
EditLastEng:SetToolTip("Edit the Last Engine used")
EditLastEng:SetPos( 35, 160 )
EditLastEng:SetWide(110)
EditLastEng:SetTall( 40 )
EditLastEng.DoClick = function()
RunConsoleCommand("acf_enginecreateload_browser_open")
StartBrowserPanel:Close()
RunConsoleCommand("acf_enginecreateload_open")
MainPanel:Close()
end
Close = ButtonsSidePanel:Add("DButton")
Close = SecondPanel:Add("DButton")
Close:SetText("Close")
Close:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
Close:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Close:SetPos( 50,220 )
Close:SetWide(80)
Close:SetTall( 50 )
Close.DoClick = function()
StartBrowserPanel:Close()
MainPanel:Close()
end
StartBrowserPanel.OnClose = function() end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end
local function OpenSartBrowser(pl, cmd, args)
if (!IsValid(StartBrowserPanel)) then
CreateSoundBrowser()
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
if (!IsValid(MainPanel)) then
CreateMenu()
end
StartBrowserPanel:SetVisible(true)
StartBrowserPanel:MakePopup()
StartBrowserPanel:InvalidateLayout(true)
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
WireLib.Timedcall(function(StartBrowserPanel)
if (!IsValid(StartBrowserPanel)) then return end
WireLib.Timedcall(function(MainPanel)
if (!IsValid(MainPanel)) then return end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end, StartBrowserPanel)
end, MainPanel)
end
concommand.Add("acf_enginestart_browser_open", OpenSartBrowser)
concommand.Add("acf_enginestart_open", OpenMenu)

View File

@ -1,201 +1,199 @@
// Made by Bouletmarc.
local StartBrowserPanel = nil
local function CreateSoundBrowser()
--###########################################
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
end
--###########################################
StartBrowserPanel = vgui.Create("DFrame") // The main frame.
StartBrowserPanel:SetSize(830, 470)
--------------------------------------
-- Set vars
--------------------------------------
local MainPanel = nil
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu()
--Set frame
MainPanel = vgui.Create("DFrame")
MainPanel:SetSize(830, 470)
--Set Center
StartBrowserPanel:SetPos((ScrW()/2)-(StartBrowserPanel:GetWide()/2),(ScrH()/2)-(StartBrowserPanel:GetTall()/2))
StartBrowserPanel:SetMinWidth(820)
StartBrowserPanel:SetMinHeight(460)
StartBrowserPanel:SetSizable(false)
StartBrowserPanel:SetDeleteOnClose( true )
StartBrowserPanel:SetTitle("ACF Help Menu by Bouletmarc")
StartBrowserPanel:SetVisible(false)
StartBrowserPanel:SetCookieName( "wire_sound_browser" )
StartBrowserPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
MainText = StartBrowserPanel:Add("DLabel")
MainPanel:SetPos((ScrW()/2)-(MainPanel:GetWide()/2),(ScrH()/2)-(MainPanel:GetTall()/2))
--Set size
MainPanel:SetMinWidth(820)
MainPanel:SetMinHeight(460)
--Set options
MainPanel:SetSizable(false)
MainPanel:SetDeleteOnClose( true )
MainPanel:SetTitle("ACF Help Menu by Bouletmarc")
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Menu text
MainText = MainPanel:Add("DLabel")
MainText:SetText("ACF Help Menu Page1")
MainText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
MainText:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
MainText:SetPos(360,15)
MainText:SetFont( "DefaultBold" )
MainText:SizeToContents()
local ButtonsSidePanel = StartBrowserPanel:Add("DPanel")
ButtonsSidePanel:DockMargin(4, 4, 4, 4)
ButtonsSidePanel:Dock(LEFT)
ButtonsSidePanel:SetSize(400, 420)
ButtonsSidePanel:SetDrawBackground(false)
local ButtonsSidePanel2 = StartBrowserPanel:Add("DPanel")
ButtonsSidePanel2:DockMargin(4, 4, 4, 4)
ButtonsSidePanel2:Dock(RIGHT)
ButtonsSidePanel2:SetSize(400, 420)
ButtonsSidePanel2:SetDrawBackground(false)
--#############################################################
WireModText1 = ButtonsSidePanel:Add("DLabel")
WireModText1:SetText("WireMod Part :")
WireModText1:SetTextColor(Color(0,170,170,255))
WireModText1:SetPos(280,20)
WireModText1:SetFont( "DefaultBold" )
WireModText1:SizeToContents()
--#########################################################################################
WireModTextEngine = ButtonsSidePanel:Add("DLabel")
WireModTextEngine:SetText("With Engine's :")
WireModTextEngine:SetTextColor(Color(210,210,210,255))
WireModTextEngine:SetPos(40,40)
WireModTextEngine:SetFont( "DefaultBold" )
WireModTextEngine:SizeToContents()
WireModTextGearbox = ButtonsSidePanel2:Add("DLabel")
WireModTextGearbox:SetText("With Gearbox's :")
WireModTextGearbox:SetTextColor(Color(210,210,210,255))
WireModTextGearbox:SetPos(20,40)
WireModTextGearbox:SetFont( "DefaultBold" )
WireModTextGearbox:SizeToContents()
/*WireModTextChips = ButtonsSidePanel:Add("DLabel")
WireModTextChips:SetText("With Chips's :")
WireModTextChips:SetTextColor(Color(210,210,210,255))
WireModTextChips:SetPos(40,220)
WireModTextChips:SetFont( "DefaultBold" )
WireModTextChips:SizeToContents()*/
WireModTextFuel = ButtonsSidePanel2:Add("DLabel")
WireModTextFuel:SetText("With Fuel Tank's :")
WireModTextFuel:SetTextColor(Color(210,210,210,255))
WireModTextFuel:SetPos(20,200)
WireModTextFuel:SetFont( "DefaultBold" )
WireModTextFuel:SizeToContents()
--#########################################################################################
local WireLineEngine = ""
WireLineEngine = WireLineEngine .. "- Active should be wired to a (0-1) value\n"
WireLineEngine = WireLineEngine .. "- Throttle should be wired to a (0-100) value\n"
WireLineEngine = WireLineEngine .. "- TqAdd to a Torque adding Value\n"
WireLineEngine = WireLineEngine .. "- MaxRpmAdd to a Max RPM adding Value\n"
WireLineEngine = WireLineEngine .. "- LimitRpmAdd to a Limit RPM adding Value\n"
WireLineEngine = WireLineEngine .. "- FlywheelMass to a Flywheel Mass number Value\n"
WireLineEngine = WireLineEngine .. "- Idle to a Idle RPM Value\n"
WireLineEngine = WireLineEngine .. "- Disable Cutoff to 1 to Disable the Cutoff\n"
WireLineEngine = WireLineEngine .. "- Override to a Override RPM Value\n"
local WireLineGearbox = ""
WireLineGearbox = WireLineGearbox .. "- Clutch should be wired to (0-1)\n"
WireLineGearbox = WireLineGearbox .. "- Brake should be wired to (0-20) too high value make spazz\n"
WireLineGearbox = WireLineGearbox .. "- Left/Right Input's are to controls side's wheel's\n"
WireLineGearbox = WireLineGearbox .. "- Gear should be wired to your Gear Number Value or\n"
WireLineGearbox = WireLineGearbox .. "* if you use GearUp and GearDown, those should\n"
WireLineGearbox = WireLineGearbox .. "* be wired to (0-1) to Increase or Decrease Gear.\n"
/*local WireLineChips = ""
WireLineChips = WireLineChips .. "- ActiveChips should be wired to a (0-1) value\n"
WireLineChips = WireLineChips .. "** OUTPUTS : **\n"
WireLineChips = WireLineChips .. "- TqAdd to the Engine(Engine to Chips)\n"
WireLineChips = WireLineChips .. "- MaxRpmAdd to the Engine(Engine to Chips)\n"
WireLineChips = WireLineChips .. "- LimitRpmAdd to the Engine(Engine to Chips)"*/
local WireLineFuel = ""
WireLineFuel = WireLineFuel .. "- Active should be wired to a (0-1) value AND\n"
WireLineFuel = WireLineFuel .. "* BEFORE the engine -Active- are wired, to make\n"
WireLineFuel = WireLineFuel .. "* the tank Activate before engine\n\n"
WireLineFuel = WireLineFuel .. "- Refuel Duty to (0-1) to make the tank refuel other tank's"
--#########################################################################################
WireModText2 = ButtonsSidePanel:Add("DLabel")
WireModText2:SetText(WireLineEngine)
WireModText2:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
WireModText2:SetPos(20,60)
WireModText2:SetFont( "DefaultBold" )
WireModText2:SizeToContents()
WireModText3 = ButtonsSidePanel2:Add("DLabel")
WireModText3:SetText(WireLineGearbox)
WireModText3:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
WireModText3:SetPos(0,60)
WireModText3:SetFont( "DefaultBold" )
WireModText3:SizeToContents()
/*WireModText2 = ButtonsSidePanel:Add("DLabel")
WireModText2:SetText(WireLineChips)
WireModText2:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
WireModText2:SetPos(20,240)
WireModText2:SetFont( "DefaultBold" )
WireModText2:SizeToContents()*/
WireModTextFuelDesc = ButtonsSidePanel2:Add("DLabel")
WireModTextFuelDesc:SetText(WireLineFuel)
WireModTextFuelDesc:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
WireModTextFuelDesc:SetPos(0,220)
WireModTextFuelDesc:SetFont( "DefaultBold" )
WireModTextFuelDesc:SizeToContents()
--#########################################################################################
Close = ButtonsSidePanel:Add("DButton")
--Add left panel
local LeftPanel = MainPanel:Add("DPanel")
LeftPanel:DockMargin(4, 4, 4, 4)
LeftPanel:Dock(LEFT)
LeftPanel:SetSize(400, 420)
LeftPanel:SetDrawBackground(false)
--Add right panel
local RightPanel = MainPanel:Add("DPanel")
RightPanel:DockMargin(4, 4, 4, 4)
RightPanel:Dock(RIGHT)
RightPanel:SetSize(400, 420)
RightPanel:SetDrawBackground(false)
--------------------------------------
-- Initialize Panels
--------------------------------------
--Set local vars
local TopLeftText = ""
local BottomLeftText = ""
local TopRightText = ""
local BottomRightText = ""
local TopLeftName = "With Engine's :"
local BottomLeftName = "With Gearbox's :"
local TopRightName = "With Fuel Tank's :"
local BottomRightName = ""
--local BottomRightName = "With Chips :"
local TitleText = "WireMod Part :"
local TitleName = LeftPanel:Add("DLabel")
--Set top left text
TopLeftText = TopLeftText .. "- Active should be wired to a (0-1) value\n"
TopLeftText = TopLeftText .. "- Throttle should be wired to a (0-100) value\n"
TopLeftText = TopLeftText .. "- TqAdd to a Torque adding Value\n"
TopLeftText = TopLeftText .. "- MaxRpmAdd to a Max RPM adding Value\n"
TopLeftText = TopLeftText .. "- LimitRpmAdd to a Limit RPM adding Value\n"
TopLeftText = TopLeftText .. "- FlywheelMass to a Flywheel Mass number Value\n"
TopLeftText = TopLeftText .. "- Idle to a Idle RPM Value\n"
TopLeftText = TopLeftText .. "- Disable Cutoff to 1 to Disable the Cutoff\n"
TopLeftText = TopLeftText .. "- Override to a Override RPM Value\n"
--Set bottom left text
BottomLeftText = BottomLeftText .. "- Clutch should be wired to (0-1)\n"
BottomLeftText = BottomLeftText .. "- Brake should be wired to (0-20) too high value make spazz\n"
BottomLeftText = BottomLeftText .. "- Left/Right Input's are to controls side's wheel's\n"
BottomLeftText = BottomLeftText .. "- Gear should be wired to your Gear Number Value or\n"
BottomLeftText = BottomLeftText .. "* if you use GearUp and GearDown, those should\n"
BottomLeftText = BottomLeftText .. "* be wired to (0-1) to Increase or Decrease Gear.\n"
--Set top right text
TopRightText = TopRightText .. "- Active should be wired to a (0-1) value AND\n"
TopRightText = TopRightText .. "* BEFORE the engine -Active- are wired, to make\n"
TopRightText = TopRightText .. "* the tank Activate before engine\n\n"
TopRightText = TopRightText .. "- Refuel Duty to (0-1) to make the tank refuel other tank's"
--Set bottom right text
/*BottomRightText = BottomRightText .. "- ActiveChips should be wired to a (0-1) value\n"
BottomRightText = BottomRightText .. "** OUTPUTS : **\n"
BottomRightText = BottomRightText .. "- TqAdd to the Engine(Engine to Chips)\n"
BottomRightText = BottomRightText .. "- MaxRpmAdd to the Engine(Engine to Chips)\n"
BottomRightText = BottomRightText .. "- LimitRpmAdd to the Engine(Engine to Chips)"*/
--Set title
TitleName:SetText(TitleText)
TitleName:SetTextColor(Color(240,240,240,255))
TitleName:SetPos(280,20)
TitleName:SetFont( "DefaultBold" )
TitleName:SizeToContents()
--------------------------------------
-- Left Panel Menu
--------------------------------------
--Set local vars
local TopLeftTitle, TopLeft = LeftPanel:Add("DLabel"), LeftPanel:Add("DLabel")
local BottomLeftTitle, BottomLeft = LeftPanel:Add("DLabel"), LeftPanel:Add("DLabel")
--Set top left title
TopLeftTitle:SetText(TopLeftName)
TopLeftTitle:SetTextColor(Color(210,210,210,255))
TopLeftTitle:SetPos(40,40)
TopLeftTitle:SetFont( "DefaultBold" )
TopLeftTitle:SizeToContents()
--Set top left text
TopLeft:SetText(TopLeftText)
TopLeft:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
TopLeft:SetPos(20,60)
TopLeft:SetFont( "DefaultBold" )
TopLeft:SizeToContents()
--Set bottom left title
BottomLeftTitle:SetText(BottomLeftName)
BottomLeftTitle:SetTextColor(Color(210,210,210,255))
BottomLeftTitle:SetPos(40,220)
BottomLeftTitle:SetFont( "DefaultBold" )
BottomLeftTitle:SizeToContents()
--Set bottom left text
BottomLeft:SetText(BottomLeftText)
BottomLeft:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
BottomLeft:SetPos(20,240)
BottomLeft:SetFont( "DefaultBold" )
BottomLeft:SizeToContents()
--------------------------------------
-- Right Panel Menu
--------------------------------------
--Set local vars
local TopRightTitle, TopRight = RightPanel:Add("DLabel"), RightPanel:Add("DLabel")
local BottomRightTitle, BottomRight = RightPanel:Add("DLabel"), RightPanel:Add("DLabel")
--Set top right title
TopRightTitle:SetText(TopRightName)
TopRightTitle:SetTextColor(Color(210,210,210,255))
TopRightTitle:SetPos(20,40)
TopRightTitle:SetFont( "DefaultBold" )
TopRightTitle:SizeToContents()
--Set top right text
TopRight:SetText(TopRightText)
TopRight:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
TopRight:SetPos(0,60)
TopRight:SetFont( "DefaultBold" )
TopRight:SizeToContents()
--Set bottom right title
BottomRightTitle:SetText(BottomRightName)
BottomRightTitle:SetTextColor(Color(210,210,210,255))
BottomRightTitle:SetPos(20,200)
BottomRightTitle:SetFont( "DefaultBold" )
BottomRightTitle:SizeToContents()
--Set bottom right text
BottomRight:SetText(BottomRightText)
BottomRight:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
BottomRight:SetPos(0,220)
BottomRight:SetFont( "DefaultBold" )
BottomRight:SizeToContents()
--------------------------------------
-- End Panel Menu
--------------------------------------
--Set close button
local Close = LeftPanel:Add("DButton")
Close:SetText("Close")
Close:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
Close:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Close:SetPos(30,360)
Close:SetWide(80)
Close:SetTall(40)
Close.DoClick = function()
StartBrowserPanel:Close()
MainPanel:Close()
end
HelpNext = ButtonsSidePanel:Add("DButton")
--Set next page button
local HelpNext = LeftPanel:Add("DButton")
HelpNext:SetText("Help Next Page")
HelpNext:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
HelpNext:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
HelpNext:SetPos(280,360)
HelpNext:SetWide(100)
HelpNext:SetTall(40)
HelpNext.DoClick = function()
RunConsoleCommand("acf_help2_browser_open")
StartBrowserPanel:Close()
RunConsoleCommand("acf_help2_open")
MainPanel:Close()
end
--#########################################################################################
StartBrowserPanel.OnClose = function()
end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end
local function OpenSartBrowser(pl, cmd, args)
if (!IsValid(StartBrowserPanel)) then
CreateSoundBrowser()
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
if (!IsValid(MainPanel)) then
CreateMenu()
end
StartBrowserPanel:SetVisible(true)
StartBrowserPanel:MakePopup()
StartBrowserPanel:InvalidateLayout(true)
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
WireLib.Timedcall(function(StartBrowserPanel)
if (!IsValid(StartBrowserPanel)) then return end
WireLib.Timedcall(function(MainPanel)
if (!IsValid(MainPanel)) then return end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end, StartBrowserPanel)
end, MainPanel)
end
concommand.Add("acf_help1_browser_open", OpenSartBrowser)
concommand.Add("acf_help1_open", OpenMenu)

View File

@ -1,208 +1,194 @@
// Made by Bouletmarc.
local StartBrowserPanel = nil
local function CreateSoundBrowser()
--###########################################
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
end
--###########################################
StartBrowserPanel = vgui.Create("DFrame") // The main frame.
StartBrowserPanel:SetSize(830, 470)
--------------------------------------
-- Set vars
--------------------------------------
local MainPanel = nil
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu()
--Set frame
MainPanel = vgui.Create("DFrame")
MainPanel:SetSize(830, 470)
--Set Center
StartBrowserPanel:SetPos((ScrW()/2)-(StartBrowserPanel:GetWide()/2),(ScrH()/2)-(StartBrowserPanel:GetTall()/2))
StartBrowserPanel:SetMinWidth(820)
StartBrowserPanel:SetMinHeight(460)
StartBrowserPanel:SetSizable(false)
StartBrowserPanel:SetDeleteOnClose( true )
StartBrowserPanel:SetTitle("ACF Help Menu by Bouletmarc")
StartBrowserPanel:SetVisible(false)
StartBrowserPanel:SetCookieName( "wire_sound_browser" )
StartBrowserPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
MainText = StartBrowserPanel:Add("DLabel")
MainPanel:SetPos((ScrW()/2)-(MainPanel:GetWide()/2),(ScrH()/2)-(MainPanel:GetTall()/2))
--Set size
MainPanel:SetMinWidth(820)
MainPanel:SetMinHeight(460)
--Set options
MainPanel:SetSizable(false)
MainPanel:SetDeleteOnClose( true )
MainPanel:SetTitle("ACF Help Menu by Bouletmarc")
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Menu text
MainText = MainPanel:Add("DLabel")
MainText:SetText("ACF Help Menu Page2")
MainText:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
MainText:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
MainText:SetPos(360,15)
MainText:SetFont( "DefaultBold" )
MainText:SizeToContents()
local ButtonsSidePanel = StartBrowserPanel:Add("DPanel")
ButtonsSidePanel:DockMargin(4, 4, 4, 4)
ButtonsSidePanel:Dock(LEFT)
ButtonsSidePanel:SetSize(400, 420)
ButtonsSidePanel:SetDrawBackground(false)
local ButtonsSidePanel2 = StartBrowserPanel:Add("DPanel")
ButtonsSidePanel2:DockMargin(4, 4, 4, 4)
ButtonsSidePanel2:Dock(RIGHT)
ButtonsSidePanel2:SetSize(400, 420)
ButtonsSidePanel2:SetDrawBackground(false)
--#############################################################
/*WireModText1 = ButtonsSidePanel:Add("DLabel")
WireModText1:SetText("WireMod Part :")
WireModText1:SetTextColor(Color(0,170,170,255))
WireModText1:SetPos(280,20)
WireModText1:SetFont( "DefaultBold" )
WireModText1:SizeToContents()
--#########################################################################################
WireModTextVtec = ButtonsSidePanel:Add("DLabel")
WireModTextVtec:SetText("With Vtec's :")
WireModTextVtec:SetTextColor(Color(210,210,210,255))
WireModTextVtec:SetPos(40,40)
WireModTextVtec:SetFont( "DefaultBold" )
WireModTextVtec:SizeToContents()
WireModTextNos = ButtonsSidePanel2:Add("DLabel")
WireModTextNos:SetText("With Nos :")
WireModTextNos:SetTextColor(Color(210,210,210,255))
WireModTextNos:SetPos(20,40)
WireModTextNos:SetFont( "DefaultBold" )
WireModTextNos:SizeToContents()*/
LinkingText1 = ButtonsSidePanel:Add("DLabel")
LinkingText1:SetText("Linking Part :")
LinkingText1:SetTextColor(Color(0,170,170,255))
LinkingText1:SetPos(40,40)
LinkingText1:SetFont( "DefaultBold" )
LinkingText1:SizeToContents()
/*EngineTextOption = ButtonsSidePanel2:Add("DLabel")
EngineTextOption:SetText("Engine options button's")
EngineTextOption:SetTextColor(Color(0,170,170,255))
EngineTextOption:SetPos(20,180)
EngineTextOption:SetFont( "DefaultBold" )
EngineTextOption:SizeToContents()*/
--#########################################################################################
/*local WireLineVtec = ""
WireLineVtec = WireLineVtec .. "- RPM should be wired to the Engine\n"
WireLineVtec = WireLineVtec .. "** OUTPUTS : **\n"
WireLineVtec = WireLineVtec .. "- ActiveChips to a ACF Chips(Chips to Vtec)\n\n"
WireLineVtec = WireLineVtec .. "To make the engine powerful on the Vtec, you\n"
WireLineVtec = WireLineVtec .. "should wire together a Vtec, a Engine and a Chips\n"
WireLineVtec = WireLineVtec .. "Vtec get value from Engine and throw it to the Chips\n"
WireLineVtec = WireLineVtec .. "Chips will throw the Power to the Engine at the end"
local WireLineNos = ""
WireLineNos = WireLineNos .. "- ActiveNos should be wired to a (0-1) value\n"
WireLineNos = WireLineNos .. "** OUTPUTS : **\n"
WireLineNos = WireLineNos .. "- TqAdd to the Engine(Engine to Nos)\n"
WireLineNos = WireLineNos .. "- MaxRpmAdd to the Engine(Engine to Nos)\n"
WireLineNos = WireLineNos .. "- LimitRpmAdd to the Engine(Engine to Nos)"
WireLineNos = WireLineNos .. "- Usable to a Screen or similar to know if\n"
WireLineNos = WireLineNos .. " you can activate it"*/
local LinkingLine1 = ""
LinkingLine1 = LinkingLine1 .. "*To LINK, you must RIGHT clic on both entities with acf_menu*\n"
LinkingLine1 = LinkingLine1 .. "*To UNLINK, you must hold -E- and right clic with acf_menu*\n\n"
LinkingLine1 = LinkingLine1 .. "- Engine must be linked to Gearbox, FuelTank or a Engine Extra\n"
LinkingLine1 = LinkingLine1 .. "- Gearbox's must be linked to Wheels (regular prop's)\n"
LinkingLine1 = LinkingLine1 .. "- Gun must be linked to the Ammo Box\n\n"
LinkingLine1 = LinkingLine1 .. "-- Chips, Nos, Turbo, Supercharger and Radiator is a Engine Extra\n"
--local EngineLineOption = ""
--#########################################################################################
/*WireModText3 = ButtonsSidePanel:Add("DLabel")
WireModText3:SetText(WireLineVtec)
WireModText3:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
WireModText3:SetPos(20,60)
WireModText3:SetFont( "DefaultBold" )
WireModText3:SizeToContents()
WireModText4 = ButtonsSidePanel2:Add("DLabel")
WireModText4:SetText(WireLineNos)
WireModText4:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
WireModText4:SetPos(0,60)
WireModText4:SetFont( "DefaultBold" )
WireModText4:SizeToContents()*/
LinkingText2 = ButtonsSidePanel:Add("DLabel")
LinkingText2:SetText(LinkingLine1)
LinkingText2:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
LinkingText2:SetPos(20,80)
LinkingText2:SetFont( "DefaultBold" )
LinkingText2:SizeToContents()
/*EngineTextOptionDesc = ButtonsSidePanel2:Add("DLabel")
EngineTextOptionDesc:SetText(EngineLineOption)
EngineTextOptionDesc:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
EngineTextOptionDesc:SetPos(0,200)
EngineTextOptionDesc:SetFont( "DefaultBold" )
EngineTextOptionDesc:SizeToContents()*/
--#########################################################################################
Close = ButtonsSidePanel:Add("DButton")
--Add left panel
local LeftPanel = MainPanel:Add("DPanel")
LeftPanel:DockMargin(4, 4, 4, 4)
LeftPanel:Dock(LEFT)
LeftPanel:SetSize(400, 420)
LeftPanel:SetDrawBackground(false)
--Add right panel
local RightPanel = MainPanel:Add("DPanel")
RightPanel:DockMargin(4, 4, 4, 4)
RightPanel:Dock(RIGHT)
RightPanel:SetSize(400, 420)
RightPanel:SetDrawBackground(false)
--------------------------------------
-- Initialize Panels
--------------------------------------
--Set local vars
local TopLeftText = ""
local BottomLeftText = ""
local TopRightText = ""
local BottomRightText = ""
local TopLeftName = "Linking Part :"
local BottomLeftName = ""
local TopRightName = ""
local BottomRightName = ""
local TitleText = ""
local TitleName = LeftPanel:Add("DLabel")
--Set top left text
TopLeftText = TopLeftText .. "*To LINK, you must RIGHT clic on both entities with acf_menu*\n"
TopLeftText = TopLeftText .. "*To UNLINK, you must hold -E- and right clic with acf_menu*\n\n"
TopLeftText = TopLeftText .. "- Engine must be linked to Gearbox, FuelTank or a Engine Extra\n"
TopLeftText = TopLeftText .. "- Gearbox's must be linked to Wheels (regular prop's)\n"
TopLeftText = TopLeftText .. "- Gun must be linked to the Ammo Box\n\n"
TopLeftText = TopLeftText .. "-- Chips, Nos, Turbo, Supercharger and Radiator is a Engine Extra\n"
--Set bottom left text
BottomLeftText = BottomLeftText .. ""
--Set top right text
TopRightText = TopRightText .. ""
--Set bottom right text
BottomRightText = BottomRightText .. ""
--Set title
TitleName:SetText(TitleText)
TitleName:SetTextColor(Color(240,240,240,255))
TitleName:SetPos(280,20)
TitleName:SetFont( "DefaultBold" )
TitleName:SizeToContents()
--------------------------------------
-- Left Panel Menu
--------------------------------------
--Set local vars
local TopLeftTitle, TopLeft = LeftPanel:Add("DLabel"), LeftPanel:Add("DLabel")
local BottomLeftTitle, BottomLeft = LeftPanel:Add("DLabel"), LeftPanel:Add("DLabel")
--Set top left title
TopLeftTitle:SetText(TopLeftName)
TopLeftTitle:SetTextColor(Color(210,210,210,255))
TopLeftTitle:SetPos(40,40)
TopLeftTitle:SetFont( "DefaultBold" )
TopLeftTitle:SizeToContents()
--Set top left text
TopLeft:SetText(TopLeftText)
TopLeft:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
TopLeft:SetPos(20,60)
TopLeft:SetFont( "DefaultBold" )
TopLeft:SizeToContents()
--Set bottom left title
BottomLeftTitle:SetText(BottomLeftName)
BottomLeftTitle:SetTextColor(Color(210,210,210,255))
BottomLeftTitle:SetPos(40,220)
BottomLeftTitle:SetFont( "DefaultBold" )
BottomLeftTitle:SizeToContents()
--Set bottom left text
BottomLeft:SetText(BottomLeftText)
BottomLeft:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
BottomLeft:SetPos(20,240)
BottomLeft:SetFont( "DefaultBold" )
BottomLeft:SizeToContents()
--------------------------------------
-- Right Panel Menu
--------------------------------------
--Set local vars
local TopRightTitle, TopRight = RightPanel:Add("DLabel"), RightPanel:Add("DLabel")
local BottomRightTitle, BottomRight = RightPanel:Add("DLabel"), RightPanel:Add("DLabel")
--Set top right title
TopRightTitle:SetText(TopRightName)
TopRightTitle:SetTextColor(Color(210,210,210,255))
TopRightTitle:SetPos(20,40)
TopRightTitle:SetFont( "DefaultBold" )
TopRightTitle:SizeToContents()
--Set top right text
TopRight:SetText(TopRightText)
TopRight:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
TopRight:SetPos(0,60)
TopRight:SetFont( "DefaultBold" )
TopRight:SizeToContents()
--Set bottom right title
BottomRightTitle:SetText(BottomRightName)
BottomRightTitle:SetTextColor(Color(210,210,210,255))
BottomRightTitle:SetPos(20,200)
BottomRightTitle:SetFont( "DefaultBold" )
BottomRightTitle:SizeToContents()
--Set bottom right text
BottomRight:SetText(BottomRightText)
BottomRight:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
BottomRight:SetPos(0,220)
BottomRight:SetFont( "DefaultBold" )
BottomRight:SizeToContents()
--------------------------------------
-- End Panel Menu
--------------------------------------
--Set close button
local Close = LeftPanel:Add("DButton")
Close:SetText("Close")
Close:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
Close:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Close:SetPos(30,360)
Close:SetWide(80)
Close:SetTall(40)
Close.DoClick = function()
StartBrowserPanel:Close()
MainPanel:Close()
end
HelpBack = ButtonsSidePanel:Add("DButton")
--Set back page button
local HelpBack = LeftPanel:Add("DButton")
HelpBack:SetText("Help Back Page")
HelpBack:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
HelpBack:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
HelpBack:SetPos(170,360)
HelpBack:SetWide(100)
HelpBack:SetTall(40)
HelpBack.DoClick = function()
RunConsoleCommand("acf_help1_browser_open")
StartBrowserPanel:Close()
RunConsoleCommand("acf_help1_open")
MainPanel:Close()
end
/*HelpNext = ButtonsSidePanel:Add("DButton")
--Set next page button
/*local HelpNext = LeftPanel:Add("DButton")
HelpNext:SetText("Help Next Page")
HelpNext:SetTextColor(Color(0,0,255,255))
HelpNext:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
HelpNext:SetPos(280,360)
HelpNext:SetWide(100)
HelpNext:SetTall(40)
HelpNext.DoClick = function()
RunConsoleCommand("acf_help2_browser_open")
StartBrowserPanel:Close()
RunConsoleCommand("acf_help2_open")
MainPanel:Close()
end*/
--#########################################################################################
StartBrowserPanel.OnClose = function()
end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end
local function OpenSartBrowser(pl, cmd, args)
if (!IsValid(StartBrowserPanel)) then
CreateSoundBrowser()
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
if (!IsValid(MainPanel)) then
CreateMenu()
end
StartBrowserPanel:SetVisible(true)
StartBrowserPanel:MakePopup()
StartBrowserPanel:InvalidateLayout(true)
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
WireLib.Timedcall(function(StartBrowserPanel)
if (!IsValid(StartBrowserPanel)) then return end
WireLib.Timedcall(function(MainPanel)
if (!IsValid(MainPanel)) then return end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end, StartBrowserPanel)
end, MainPanel)
end
concommand.Add("acf_help2_browser_open", OpenSartBrowser)
concommand.Add("acf_help2_open", OpenMenu)

View File

@ -1,119 +1,101 @@
// Made by Bouletmarc.
local StartBrowserPanel = nil
local function CreateSoundBrowser()
--###########################################
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
end
--###########################################
StartBrowserPanel = vgui.Create("DFrame") // The main frame.
StartBrowserPanel:SetSize(250, 400)
--------------------------------------
-- Set vars
--------------------------------------
local MainPanel = nil
--------------------------------------
-- Create Menu
--------------------------------------
local function CreateMenu()
--Set frame
MainPanel = vgui.Create("DFrame")
MainPanel:SetSize(250, 400)
--Set Center
StartBrowserPanel:SetPos((ScrW()/2)-(StartBrowserPanel:GetWide()/2),(ScrH()/2)-(StartBrowserPanel:GetTall()/2))
StartBrowserPanel:SetMinWidth(250)
StartBrowserPanel:SetMinHeight(400)
StartBrowserPanel:SetSizable(false)
StartBrowserPanel:SetDeleteOnClose( false )
StartBrowserPanel:SetTitle("ACF Help Menu")
StartBrowserPanel:SetVisible(false)
StartBrowserPanel:SetCookieName( "wire_sound_browser" )
StartBrowserPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
local ButtonsSidePanel = StartBrowserPanel:Add("DPanel")
ButtonsSidePanel:DockMargin(4, 4, 4, 4)
ButtonsSidePanel:Dock(TOP)
ButtonsSidePanel:SetSize(230, 360)
ButtonsSidePanel:SetDrawBackground(false)
--#############################################################
SVNText1 = ButtonsSidePanel:Add("DLabel")
SVNText1:SetText("First make sure you have \n ACF Custom Installed. \n\n Here the SVN :")
SVNText1:SetTextColor(Color(0,255,0,255))
SVNText1:SetPos(45,20)
SVNText1:SetFont( "DefaultBold" )
SVNText1:SizeToContents()
SVNText2 = ButtonsSidePanel:Add( "DTextEntry" )
SVNText2:SetText( "https://github.com/bouletmarc/ACF_CustomMod/trunk" )
SVNText2:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
SVNText2:SetPos( 10,80 )
SVNText2:SetWide( 220 )
SVNText2.OnTextChanged = function( )
if SVNText2:GetValue() != "https://github.com/bouletmarc/ACF_CustomMod/trunk" then
SVNText2:SetText( "https://github.com/bouletmarc/ACF_CustomMod/trunk" )
MainPanel:SetPos((ScrW()/2)-(MainPanel:GetWide()/2),(ScrH()/2)-(MainPanel:GetTall()/2))
--Set size
MainPanel:SetMinWidth(250)
MainPanel:SetMinHeight(400)
--Set options
MainPanel:SetSizable(false)
MainPanel:SetDeleteOnClose( false )
MainPanel:SetTitle("ACF Help Menu")
MainPanel:SetVisible(false)
MainPanel:SetCookieName( "wire_sound_browser" )
MainPanel:GetParent():SetWorldClicker(true) // Allow the use of the toolgun while in menu.
--Add 2nd panel
local SecondPanel = MainPanel:Add("DPanel")
SecondPanel:DockMargin(4, 4, 4, 4)
SecondPanel:Dock(TOP)
SecondPanel:SetSize(230, 360)
SecondPanel:SetDrawBackground(false)
--------------------------------------
-- 2nd Panel Menu
--------------------------------------
--Set local vars
local Text1, Text3 = SecondPanel:Add("DLabel"), SecondPanel:Add("DLabel")
local Text2 = SecondPanel:Add( "DTextEntry" )
local Copy, Help = SecondPanel:Add("DButton"), SecondPanel:Add("DButton")
--Set Text1
Text1:SetText("First make sure you have \n ACF Custom Installed. \n\n Here the SVN :")
Text1:SetTextColor(Color(0,255,0,255))
Text1:SetPos(45,20)
Text1:SetFont( "DefaultBold" )
Text1:SizeToContents()
--Set Text2
Text2:SetText( "https://github.com/bouletmarc/ACF_CustomMod/trunk" )
Text2:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Text2:SetPos( 10,80 )
Text2:SetWide( 220 )
Text2.OnTextChanged = function( )
if Text2:GetValue() != "https://github.com/bouletmarc/ACF_CustomMod/trunk" then
Text2:SetText( "https://github.com/bouletmarc/ACF_CustomMod/trunk" )
end
end
SVNCopy = ButtonsSidePanel:Add("DButton")
SVNCopy:SetText("Copy SVN link")
SVNCopy:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
SVNCopy:SetPos( 65, 110 )
SVNCopy:SetWide(ButtonsSidePanel:GetWide() / 2.2 - 2.2)
SVNCopy:SetTall( 30 )
SVNCopy.DoClick = function()
--Set Copy Button
Copy:SetText("Copy SVN link")
Copy:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Copy:SetPos( 65, 110 )
Copy:SetWide(SecondPanel:GetWide() / 2.2 - 2.2)
Copy:SetTall( 30 )
Copy.DoClick = function()
SetClipboardText("https://github.com/bouletmarc/ACF_CustomMod/trunk")
end
HelpHormal = ButtonsSidePanel:Add("DButton")
HelpHormal:SetText("Help me with ACF")
HelpHormal:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
HelpHormal:SetPos( 20, 170 )
HelpHormal:SetWide(ButtonsSidePanel:GetWide() / 1.2 - 1.2)
HelpHormal:SetTall( 40 )
HelpHormal.DoClick = function()
RunConsoleCommand("acf_help1_browser_open")
StartBrowserPanel:Close()
--Set Help Button
Help:SetText("Help me with ACF")
Help:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Help:SetPos( 20, 170 )
Help:SetWide(SecondPanel:GetWide() / 1.2 - 1.2)
Help:SetTall( 40 )
Help.DoClick = function()
RunConsoleCommand("acf_help1_open")
MainPanel:Close()
end
BMText1 = ButtonsSidePanel:Add("DLabel")
BMText1:SetText("Made by Bouletmarc\n (B0ul3Tm@rc)")
BMText1:SetTextColor(Color(0,255,0,255))
BMText1:SetPos(60,320)
BMText1:SetFont( "DefaultBold" )
BMText1:SizeToContents()
StartBrowserPanel.OnClose = function()
--Set Owner
Text3:SetText("Made by Bouletmarc\n (B0ul3Tm@rc)")
Text3:SetTextColor(Color(0,255,0,255))
Text3:SetPos(60,320)
Text3:SetFont( "DefaultBold" )
Text3:SizeToContents()
end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end
local function OpenSartBrowser(pl, cmd, args)
if (!IsValid(StartBrowserPanel)) then
CreateSoundBrowser()
--------------------------------------
-- Open Menu
--------------------------------------
local function OpenMenu(pl, cmd, args)
if (!IsValid(MainPanel)) then
CreateMenu()
end
StartBrowserPanel:SetVisible(true)
StartBrowserPanel:MakePopup()
StartBrowserPanel:InvalidateLayout(true)
MainPanel:SetVisible(true)
MainPanel:MakePopup()
MainPanel:InvalidateLayout(true)
WireLib.Timedcall(function(StartBrowserPanel)
if (!IsValid(StartBrowserPanel)) then return end
WireLib.Timedcall(function(MainPanel)
if (!IsValid(MainPanel)) then return end
StartBrowserPanel:InvalidateLayout(true)
MainPanel:InvalidateLayout(true)
end, StartBrowserPanel)
end, MainPanel)
end
concommand.Add("acf_help_browser_open", OpenSartBrowser)
concommand.Add("acf_help_open", OpenMenu)

View File

@ -1,12 +1,13 @@
-- This loads the files in the engine, gearbox, fuel, and gun folders!
-- Go edit those files instead of this one.
--------------------------------------
-- Initialize
--------------------------------------
AddCSLuaFile()
local MobilityTable = {}
-- setup base classes
--------------------------------------
-- Setup classes
--------------------------------------
--custom engines
local enginecustom_base = {
ent = "acf_engine_custom",
type = "MobilityCustom"
@ -59,10 +60,9 @@ local supercharger_base = {
ent = "acf_supercharger",
type = "MobilityCustom"
}
--##############################
--## set gui ####
--##############################
--------------------------------------
-- Setup GUI
--------------------------------------
if CLIENT then
enginecustom_base.guicreate = function( panel, tbl ) ACFEngineCustomGUICreate( tbl ) end or nil
enginecustom_base.guiupdate = function() return end
@ -94,10 +94,9 @@ if CLIENT then
supercharger_base.guicreate = function( panel, tbl ) ACFSuperchargerGUICreate( tbl ) end or nil
supercharger_base.guiupdate = function() return end
end
--##############################
--## define functions ####
--##############################
--------------------------------------
-- Setup Functions
--------------------------------------
function ACF_DefineEngine( id, data )
data.id = id
table.Inherit( data, enginecustom_base )
@ -157,12 +156,20 @@ function ACF_DefineSupercharger( id, data )
table.Inherit( data, supercharger_base )
MobilityTable[ id ] = data
end
--##############################
--## search and load ####
--##############################
local engines = file.Find( "acf/shared/enginescustom/*.lua", "LUA" )
-------------------------------------
-- Search&Load
--------------------------------------
--Original Engines
local engines = file.Find( "acf/shared/engines/*.lua", "LUA" )
for k, v in pairs( engines ) do
if v != "electric.lua" or v != "special.lua" or v != "turbine.lua" then
AddCSLuaFile( "acf/shared/engines/" .. v )
include( "acf/shared/engines/" .. v )
end
end
--Custom Engines
local customengines = file.Find( "acf/shared/enginescustom/*.lua", "LUA" )
for k, v in pairs( customengines ) do
AddCSLuaFile( "acf/shared/enginescustom/" .. v )
include( "acf/shared/enginescustom/" .. v )
end
@ -172,6 +179,7 @@ for k, v in pairs( custom ) do
AddCSLuaFile( "acf/shared/customs/" .. v )
include( "acf/shared/customs/" .. v )
end
-- now that the mobility table is populated, throw it in the acf ents list
--------------------------------------
-- Setup list
--------------------------------------
list.Set( "ACFCUSTOMEnts", "MobilityCustom", MobilityTable )

View File

@ -0,0 +1,53 @@
-- Flat 6 engines
ACF_DefineEngine( "B10-3.8", {
name = "B10 3.8L Flat 10 Petrol",
desc = "Car sized flat ten engine, sporty and light",
model = "models/engines/b10small.mdl",
sound = "acf_engines/b6_petrolsmall.wav",
category = "B",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 200,
torque = 336,
flywheelmass = 0.08,
idlerpm = 750,
peakminrpm = 4300,
peakmaxrpm = 6950,
limitrpm = 7250
} )
ACF_DefineEngine( "B10-5.0", {
name = "B10 5.0 Flat 10 Petrol",
desc = "Sports car grade flat ten, renown for their smooth operation and light weight",
model = "models/engines/b10medium.mdl",
sound = "acf_engines/b6_petrolmedium.wav",
category = "B",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 340,
torque = 488,
flywheelmass = 0.1,
idlerpm = 900,
peakminrpm = 3500,
peakmaxrpm = 6000,
limitrpm = 6800
} )
ACF_DefineEngine( "B10-10.0", {
name = "B10 10.0L Flat 10 Petrol",
desc = "Aircraft grade boxer with a high rev range biased powerband",
model = "models/engines/b10large.mdl",
sound = "acf_engines/b6_petrollarge.wav",
category = "B",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 830,
torque = 1170,
flywheelmass = 1,
idlerpm = 620,
peakminrpm = 2500,
peakmaxrpm = 4100,
limitrpm = 4500
} )

View File

@ -0,0 +1,53 @@
-- Flat 6 engines
ACF_DefineEngine( "B12-4.1", {
name = "B12 4.1L Flat 12 Petrol",
desc = "Car sized flat twelve engine, sporty and light",
model = "models/engines/b12small.mdl",
sound = "acf_engines/b6_petrolsmall.wav",
category = "B",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 250,
torque = 386,
flywheelmass = 0.08,
idlerpm = 750,
peakminrpm = 4300,
peakmaxrpm = 6950,
limitrpm = 7250
} )
ACF_DefineEngine( "B12-8.0", {
name = "B12 8.0 Flat 12 Petrol",
desc = "Sports car grade flat twelve, renown for their smooth operation and light weight",
model = "models/engines/b12medium.mdl",
sound = "acf_engines/b6_petrolmedium.wav",
category = "B",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 380,
torque = 528,
flywheelmass = 0.1,
idlerpm = 900,
peakminrpm = 3500,
peakmaxrpm = 6000,
limitrpm = 6800
} )
ACF_DefineEngine( "B12-17.0", {
name = "B12 17.0L Flat 12 Petrol",
desc = "Aircraft grade boxer with a high rev range biased powerband",
model = "models/engines/b12large.mdl",
sound = "acf_engines/b6_petrollarge.wav",
category = "B",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 1050,
torque = 1470,
flywheelmass = 1,
idlerpm = 620,
peakminrpm = 2500,
peakmaxrpm = 4100,
limitrpm = 4500
} )

View File

@ -0,0 +1,53 @@
-- Flat 6 engines
ACF_DefineEngine( "B8-3.8", {
name = "B8 3.8L Flat 8 Petrol",
desc = "Car sized flat eight engine, sporty and light",
model = "models/engines/b8small.mdl",
sound = "acf_engines/b6_petrolsmall.wav",
category = "B",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 140,
torque = 236,
flywheelmass = 0.08,
idlerpm = 750,
peakminrpm = 4300,
peakmaxrpm = 6950,
limitrpm = 7250
} )
ACF_DefineEngine( "B8-6.0", {
name = "B8 5.0 Flat 8 Petrol",
desc = "Sports car grade flat eight, renown for their smooth operation and light weight",
model = "models/engines/b8medium.mdl",
sound = "acf_engines/b6_petrolmedium.wav",
category = "B",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 260,
torque = 388,
flywheelmass = 0.1,
idlerpm = 900,
peakminrpm = 3500,
peakmaxrpm = 6000,
limitrpm = 6800
} )
ACF_DefineEngine( "B8-12.0", {
name = "B8 10.0L Flat 8 Petrol",
desc = "Aircraft grade boxer with a high rev range biased powerband",
model = "models/engines/b8large.mdl",
sound = "acf_engines/b6_petrollarge.wav",
category = "B",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 680,
torque = 970,
flywheelmass = 1,
idlerpm = 620,
peakminrpm = 2500,
peakmaxrpm = 4100,
limitrpm = 4500
} )

View File

@ -0,0 +1,142 @@
-- Inline 12 engines
-- Petrol
ACF_DefineEngine( "4.4-I12", {
name = "4.4L I12 Petrol",
desc = "Incredible stupid 4.4L I12 engine made for fun",
model = "models/engines/inline12s.mdl",
sound = "acf_engines/i12s.wav",
category = "I12",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 340,
torque = 260,
flywheelmass = 2,
idlerpm = 400,
peakminrpm = 2000,
peakmaxrpm = 3250,
limitrpm = 3500
} )
ACF_DefineEngine( "9.6-I12", {
name = "9.6L I12 Petrol",
desc = "Medium 9.6L I12 engine made for fun",
model = "models/engines/inline12m.mdl",
sound = "acf_engines/i12m.wav",
category = "I12",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 600,
torque = 820,
flywheelmass = 3.4,
idlerpm = 450,
peakminrpm = 2000,
peakmaxrpm = 3250,
limitrpm = 3600
} )
ACF_DefineEngine( "30.0-I12", {
name = "30.0L I12 Petrol",
desc = "Oh my god 30 liters in 12 cylinders.. fuck the duck",
model = "models/engines/inline12b.mdl",
sound = "acf_engines/i12l.wav",
category = "I12",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 1700,
torque = 1920,
flywheelmass = 5.4,
idlerpm = 550,
peakminrpm = 1650,
peakmaxrpm = 2600,
limitrpm = 2850
} )
ACF_DefineEngine( "65.0-I12", {
name = "65.0L I12 Petrol",
desc = "OH MY GOD, IS THIS A AN ENGINE FROM AN AIRCRAFT CARRIER?",
model = "models/engines/inline12h.mdl",
sound = "acf_engines/l6_petrollarge2.wav",
category = "I12",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 3000,
torque = 3640,
flywheelmass = 10,
idlerpm = 200,
peakminrpm = 500,
peakmaxrpm = 1000,
limitrpm = 1100
} )
-- Diesel
ACF_DefineEngine( "6.0-I12", {
name = "6.0L I12 Diesel",
desc = "Tank sized I12 diesel, good, wide powerband",
model = "models/engines/inline12s.mdl",
sound = "acf_engines/l6_dieselsmall.wav",
category = "I12",
fuel = "Diesel",
enginetype = "GenericDiesel",
weight = 300,
torque = 400,
flywheelmass = 0.9,
idlerpm = 650,
peakminrpm = 600,
peakmaxrpm = 1700,
limitrpm = 2000
} )
ACF_DefineEngine( "13.0-I12", {
name = "13.0L I12 Diesel",
desc = "Truck duty I6, good overall powerband and torque",
model = "models/engines/inline12m.mdl",
sound = "acf_engines/l6_dieselmedium4.wav",
category = "I12",
fuel = "Diesel",
enginetype = "GenericDiesel",
weight = 900,
torque = 1040,
flywheelmass = 2,
idlerpm = 500,
peakminrpm = 900,
peakmaxrpm = 2800,
limitrpm = 3600
} )
ACF_DefineEngine( "40.0-I12", {
name = "40.0L I12 Diesel",
desc = "OMG 40 LITERS! This engine sucks more than my mom!",
model = "models/engines/inline12b.mdl",
sound = "acf_engines/l6_diesellarge2.wav",
category = "I12",
fuel = "Diesel",
enginetype = "GenericDiesel",
weight = 2400,
torque = 4200,
flywheelmass = 10,
idlerpm = 350,
peakminrpm = 450,
peakmaxrpm = 1600,
limitrpm = 2000
} )
ACF_DefineEngine( "80.0-I12", {
name = "80.0L I12 Diesel",
desc = "80 Liters, when you turn it on the world rotates in other direction!",
model = "models/engines/inline12h.mdl",
sound = "acf_engines/l6_diesellarge2.wav",
category = "I12",
fuel = "Diesel",
enginetype = "GenericDiesel",
weight = 4800,
torque = 8400,
flywheelmass = 14,
idlerpm = 300,
peakminrpm = 550,
peakmaxrpm = 1700,
limitrpm = 2100
} )

View File

@ -0,0 +1,53 @@
-- Radial engines
ACF_DefineEngine( "R3-1.2", {
name = "R3 1.2L Petrol",
desc = "A tiny, old worn-out radial.",
model = "models/engines/radial3s.mdl",
sound = "acf_engines/r7_petrolsmall.wav",
category = "Radial",
fuel = "Petrol",
enginetype = "Radial",
weight = 70,
torque = 120,
flywheelmass = 0.10,
idlerpm = 710,
peakminrpm = 2800,
peakmaxrpm = 4600,
limitrpm = 5000
} )
ACF_DefineEngine( "R3-5.0", {
name = "R3 5.0 Petrol",
desc = "Mid range radial, thirsty and smooth",
model = "models/engines/radial3m.mdl",
sound = "acf_engines/r7_petrolmedium.wav",
category = "Radial",
fuel = "Petrol",
enginetype = "Radial",
weight = 240,
torque = 340,
flywheelmass = 0.35,
idlerpm = 700,
peakminrpm = 2300,
peakmaxrpm = 3800,
limitrpm = 4000
} )
ACF_DefineEngine( "R3-11.0", {
name = "R3 11.0L Petrol",
desc = "Massive American radial monster, destined for aircraft and heavy things.",
model = "models/engines/radial3b.mdl",
sound = "acf_engines/r7_petrollarge.wav",
category = "Radial",
fuel = "Petrol",
enginetype = "Radial",
weight = 600,
torque = 1025,
flywheelmass = 3,
idlerpm = 760,
peakminrpm = 2200,
peakmaxrpm = 3400,
limitrpm = 3800
} )

View File

@ -0,0 +1,53 @@
-- Radial engines
ACF_DefineEngine( "R5-2.1", {
name = "R5 2.1L Petrol",
desc = "A tiny, old worn-out radial.",
model = "models/engines/radial5s.mdl",
sound = "acf_engines/r5.wav",
category = "Radial",
fuel = "Petrol",
enginetype = "Radial",
weight = 133,
torque = 99,
flywheelmass = 0.10,
idlerpm = 1100,
peakminrpm = 3500,
peakmaxrpm = 6600,
limitrpm = 7000
} )
ACF_DefineEngine( "R5-9.3", {
name = "R5 9.3 Petrol",
desc = "Mid range radial, thirsty and smooth",
model = "models/engines/radial5m.mdl",
sound = "acf_engines/r5.wav",
category = "Radial",
fuel = "Petrol",
enginetype = "Radial",
weight = 250,
torque = 238,
flywheelmass = 0.35,
idlerpm = 650,
peakminrpm = 2900,
peakmaxrpm = 5500,
limitrpm = 5750
} )
ACF_DefineEngine( "R5-19.5", {
name = "R5 19.5L Petrol",
desc = "Massive American radial monster, destined for fighter aircraft and heavy tanks.",
model = "models/engines/radial5b.mdl",
sound = "acf_engines/r5.wav",
category = "Radial",
fuel = "Petrol",
enginetype = "Radial",
weight = 400,
torque = 590,
flywheelmass = 3,
idlerpm = 550,
peakminrpm = 2500,
peakmaxrpm = 4200,
limitrpm = 4350
} )

View File

@ -0,0 +1,53 @@
-- Radial engines
ACF_DefineEngine( "R9-4.1", {
name = "R9 4.1L Petrol",
desc = "A tiny, old worn-out radial.",
model = "models/engines/radial9s.mdl",
sound = "acf_engines/r9b.wav",
category = "Radial",
fuel = "Petrol",
enginetype = "Radial",
weight = 150,
torque = 450,
flywheelmass = 0.15,
idlerpm = 700,
peakminrpm = 2700,
peakmaxrpm = 4400,
limitrpm = 4800
} )
ACF_DefineEngine( "R9-18.5", {
name = "R9 18.5 Petrol",
desc = "Mid range radial, thirsty and smooth",
model = "models/engines/radial9m.mdl",
sound = "acf_engines/r9m.wav",
category = "Radial",
fuel = "Petrol",
enginetype = "Radial",
weight = 560,
torque = 1500,
flywheelmass = 0.45,
idlerpm = 700,
peakminrpm = 1500,
peakmaxrpm = 2150,
limitrpm = 2200
} )
ACF_DefineEngine( "R9-36.5", {
name = "R9 36.5L Petrol",
desc = "Massive American radial monster, destined for fighter aircraft and heavy tanks.",
model = "models/engines/radial9b.mdl",
sound = "acf_engines/r9s.wav",
category = "Radial",
fuel = "Petrol",
enginetype = "Radial",
weight = 1200,
torque = 3205,
flywheelmass = 1,
idlerpm = 730,
peakminrpm = 500,
peakmaxrpm = 2200,
limitrpm = 2300
} )

View File

@ -0,0 +1,69 @@
-- Single-cylinder engines
ACF_DefineEngine( "0.125-I1.2", {
name = "125cc Single",
desc = "Very Tiny bike engine",
model = "models/engines/1cyltiny.mdl",
sound = "acf_engines/i1_small.wav",
category = "Single",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 7,
torque = 11,
flywheelmass = 0.003,
idlerpm = 2200,
peakminrpm = 5000,
peakmaxrpm = 7500,
limitrpm = 8500
} )
ACF_DefineEngine( "0.25-I1.2", {
name = "old 250cc Single",
desc = "Tiny bike engine",
model = "models/engines/1cyls.mdl",
sound = "acf_engines/i1_small.wav",
category = "Single",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 15,
torque = 20,
flywheelmass = 0.005,
idlerpm = 1200,
peakminrpm = 4000,
peakmaxrpm = 6500,
limitrpm = 7500
} )
ACF_DefineEngine( "0.5-I1.2", {
name = "old 500cc Single",
desc = "Large single cylinder bike engine",
model = "models/engines/1cylm.mdl",
sound = "acf_engines/i1_medium.wav",
category = "Single",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 20,
torque = 40,
flywheelmass = 0.005,
idlerpm = 900,
peakminrpm = 4300,
peakmaxrpm = 7000,
limitrpm = 8000
} )
ACF_DefineEngine( "1.3-I1.2", {
name = "old 1300cc Single",
desc = "Ridiculously large single cylinder engine, seriously what the fuck",
model = "models/engines/1cylb.mdl",
sound = "acf_engines/i1_large.wav",
category = "Single",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 50,
torque = 90,
flywheelmass = 0.1,
idlerpm = 600,
peakminrpm = 3600,
peakmaxrpm = 6000,
limitrpm = 6700
} )

View File

@ -0,0 +1,55 @@
-- Inline 12 engines
-- Petrol
ACF_DefineEngine( "20.3-V10HVY", {
name = "20.3L V10HVY Diesel",
desc = "Oh yes V10 Heavy with 20.3 Liters",
model = "models/engines/v10hvys.mdl",
sound = "acf_engines/hugev10small.wav",
category = "Heavy V10",
fuel = "Diesel",
enginetype = "GenericPetrol",
weight = 2200,
torque = 8544,
flywheelmass = 5.5,
idlerpm = 200,
peakminrpm = 450,
peakmaxrpm = 1150,
limitrpm = 1250
} )
ACF_DefineEngine( "50.8-V10HVY", {
name = "50.8L V10HVY Diesel",
desc = "huge 50.8L V10 heavy engine made for fun",
model = "models/engines/v10hvym.mdl",
sound = "acf_engines/hugev10medium.wav",
category = "Heavy V10",
fuel = "Diesel",
enginetype = "GenericPetrol",
weight = 4400,
torque = 17088,
flywheelmass = 10.6,
idlerpm = 180,
peakminrpm = 400,
peakmaxrpm = 1000,
limitrpm = 1100
} )
ACF_DefineEngine( "110.2-V10HVY", {
name = "110.2L V10HVY Diesel",
desc = "Oh my god 110.2 liters in 10 cylinders.. this one must be used with multiple gearboxes to handle the torque",
model = "models/engines/v10hvyb.mdl",
sound = "acf_engines/hugev10large.wav",
category = "Heavy V10",
fuel = "Diesel",
enginetype = "GenericPetrol",
weight = 9700,
torque = 38440,
flywheelmass = 15.7,
idlerpm = 150,
peakminrpm = 200,
peakmaxrpm = 850,
limitrpm = 900
} )

View File

@ -0,0 +1,52 @@
ACF_DefineEngine( "14.0-V6-D", {
name = "14.0L V6 Diesel",
desc = " This is what you get if you teach a redneck a little engineeeing, give him diesel fuel ,injectors ,a saw and a tank v12.",
model = "models/engines/v6large.mdl",
sound = "acf_engines/v6_diesellarge.wav",
category = "V6",
fuel = "Diesel",
enginetype = "GenericDiesel",
weight = 950,
torque = 1800,
flywheelmass = 5,
idlerpm = 550,
peakminrpm = 800,
peakmaxrpm = 2400,
limitrpm = 2850
} )
ACF_DefineEngine( "7.8-V6-D", {
name = "7.8L V6 Diesel",
desc = " This is what you get if you teach a redneck a little engineeeing, give him diesel fuel ,injectors ,a saw and a tank v12.",
model = "models/engines/v6med.mdl",
sound = "acf_engines/v8_dieselmedium2.wav",
category = "V6",
fuel = "Diesel",
enginetype = "GenericDiesel",
weight = 650,
torque = 900,
flywheelmass = 4,
idlerpm = 650,
peakminrpm = 1000,
peakmaxrpm = 3000,
limitrpm = 3250
} )
ACF_DefineEngine( "3.0-V6-D", {
name = "3L V6 Diesel",
desc = " This is what you get if you teach a redneck a little engineeeing, give him diesel fuel ,injectors ,a saw and a tank v12.",
model = "models/engines/v6small.mdl",
sound = "acf_engines/v8_dieselsmall.wav",
category = "V6",
fuel = "Diesel",
enginetype = "GenericDiesel",
weight = 300,
torque = 500,
flywheelmass = 3,
idlerpm = 800,
peakminrpm = 1100,
peakmaxrpm = 3300,
limitrpm = 3500
} )

View File

@ -0,0 +1,51 @@
ACF_DefineEngine( "VR4-1.6", {
name = "VR4 1.6L Petrol",
desc = "A tiny, old worn-out VR4 engine.",
model = "models/engines/vr4s.mdl",
sound = "acf_engines/vrs.wav",
category = "VR",
fuel = "Petrol",
enginetype = "GenericDiesel",
weight = 90,
torque = 170,
flywheelmass = 0.10,
idlerpm = 710,
peakminrpm = 2600,
peakmaxrpm = 4500,
limitrpm = 4900
} )
ACF_DefineEngine( "VR4-6.2", {
name = "VR4 6.2 Petrol",
desc = "Mid range VR4 engine, thirsty and smooth",
model = "models/engines/vr4m.mdl",
sound = "acf_engines/vrm.wav",
category = "VR",
fuel = "Petrol",
enginetype = "GenericDiesel",
weight = 290,
torque = 370,
flywheelmass = 0.45,
idlerpm = 680,
peakminrpm = 2200,
peakmaxrpm = 3600,
limitrpm = 3900
} )
ACF_DefineEngine( "VR4-14.8", {
name = "VR4 14.8L Petrol",
desc = "Massive VR4 monster, perfect for nothing.",
model = "models/engines/vr4b.mdl",
sound = "acf_engines/vrl.wav",
category = "VR",
fuel = "Petrol",
enginetype = "GenericDiesel",
weight = 800,
torque = 1225,
flywheelmass = 2,
idlerpm = 650,
peakminrpm = 2100,
peakmaxrpm = 3200,
limitrpm = 3800
} )

View File

@ -0,0 +1,51 @@
ACF_DefineEngine( "VR6-2.2", {
name = "VR6 2.2L Petrol",
desc = "A tiny, old worn-out VR6 engine.",
model = "models/engines/vr6s.mdl",
sound = "acf_engines/vrs.wav",
category = "VR",
fuel = "Petrol",
enginetype = "GenericDiesel",
weight = 120,
torque = 140,
flywheelmass = 0.10,
idlerpm = 710,
peakminrpm = 3900,
peakmaxrpm = 6400,
limitrpm = 7000
} )
ACF_DefineEngine( "VR6-4.8", {
name = "VR6 4.8 Petrol",
desc = "Mid range VR6 engine, thirsty and smooth",
model = "models/engines/vr6m.mdl",
sound = "acf_engines/vrm.wav",
category = "VR",
fuel = "Petrol",
enginetype = "GenericDiesel",
weight = 300,
torque = 360,
flywheelmass = 0.2,
idlerpm = 900,
peakminrpm = 3100,
peakmaxrpm = 5000,
limitrpm = 5500
} )
ACF_DefineEngine( "VR6-17.2", {
name = "VR6 17.2L Petrol",
desc = "Massive VR6 monster, perfect for nothing.",
model = "models/engines/vr6b.mdl",
sound = "acf_engines/vrl.wav",
category = "VR",
fuel = "Petrol",
enginetype = "GenericDiesel",
weight = 850,
torque = 1025,
flywheelmass = 2.5,
idlerpm = 750,
peakminrpm = 2100,
peakmaxrpm = 3900,
limitrpm = 4100
} )

View File

@ -0,0 +1,50 @@
ACF_DefineEngine( "VR8-5.7", {
name = "VR8 5.7L Petrol",
desc = "Car sized petrol engine, good power and mid range torque",
model = "models/engines/vr8s.mdl",
sound = "acf_engines/vrs.wav",
category = "VR",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 260,
torque = 320,
flywheelmass = 0.15,
idlerpm = 800,
peakminrpm = 3000,
peakmaxrpm = 5000,
limitrpm = 6500
} )
ACF_DefineEngine( "VR8-9.0", {
name = "VR8 9.0L Petrol",
desc = "Thirsty, giant VR8, for medium applications",
model = "models/engines/vr8m.mdl",
sound = "acf_engines/vrm.wav",
category = "VR",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 400,
torque = 460,
flywheelmass = 0.25,
idlerpm = 700,
peakminrpm = 3100,
peakmaxrpm = 5000,
limitrpm = 5500
} )
ACF_DefineEngine( "VR8-18.0", {
name = "VR8 18.0L Petrol",
desc = "American gasoline tank VR8, good overall power and torque and fairly lightweight",
model = "models/engines/vr8b.mdl",
sound = "acf_engines/vrl.wav",
category = "VR",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 850,
torque = 1458,
flywheelmass = 2.8,
idlerpm = 600,
peakminrpm = 2000,
peakmaxrpm = 3300,
limitrpm = 3800
} )

View File

@ -0,0 +1,55 @@
-- Inline 12 engines
-- Petrol
ACF_DefineEngine( "8.4-W16", {
name = "8.4L W16 Petrol",
desc = "Oh yes W16 with 8.4 Liters",
model = "models/engines/w16s.mdl",
sound = "acf_engines/w16small.wav",
category = "W16",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 550,
torque = 1250,
flywheelmass = 0.5,
idlerpm = 1400,
peakminrpm = 2500,
peakmaxrpm = 7250,
limitrpm = 8500
} )
ACF_DefineEngine( "16.4-W16", {
name = "16.4L W16 Petrol",
desc = "Default 16.4L W16 engine made for fun",
model = "models/engines/w16m.mdl",
sound = "acf_engines/w16medium.wav",
category = "W16",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 900,
torque = 2450,
flywheelmass = 0.6,
idlerpm = 1250,
peakminrpm = 1000,
peakmaxrpm = 6250,
limitrpm = 7600
} )
ACF_DefineEngine( "32.8-W16", {
name = "32.8L W16 Petrol",
desc = "Oh my god 32.8 liters in 16 cylinders.. fuck the duck twice",
model = "models/engines/w16b.mdl",
sound = "acf_engines/w16large.wav",
category = "W16",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 1700,
torque = 3800,
flywheelmass = 0.7,
idlerpm = 1050,
peakminrpm = 950,
peakmaxrpm = 5500,
limitrpm = 6250
} )

View File

@ -0,0 +1,50 @@
ACF_DefineEngine( "X12-4.8", {
name = "X12 3.2L Petrol",
desc = "A tiny, old worn-out X12 engine.",
model = "models/engines/x12s.mdl",
sound = "acf_engines/r7_petrolsmall.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 270,
torque = 460,
flywheelmass = 0.10,
idlerpm = 710,
peakminrpm = 2600,
peakmaxrpm = 4500,
limitrpm = 4900
} )
ACF_DefineEngine( "X12-18.6", {
name = "X12 18.6L Petrol",
desc = "Mid range X12 engine, thirsty and smooth",
model = "models/engines/x12m.mdl",
sound = "acf_engines/r7_petrolmedium.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 770,
torque = 1180,
flywheelmass = 0.45,
idlerpm = 680,
peakminrpm = 2200,
peakmaxrpm = 3600,
limitrpm = 3900
} )
ACF_DefineEngine( "X12-42.9", {
name = "X12 42.9L Petrol",
desc = "Massive X12 monster, perfect for a vibrator.",
model = "models/engines/x12b.mdl",
sound = "acf_engines/r7_petrollarge.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 2250,
torque = 3000,
flywheelmass = 2,
idlerpm = 650,
peakminrpm = 2100,
peakmaxrpm = 3200,
limitrpm = 3800
} )

View File

@ -0,0 +1,50 @@
ACF_DefineEngine( "X16-6.4", {
name = "X16 6.4L Petrol",
desc = "A tiny, old worn-out X16 engine.",
model = "models/engines/X16s.mdl",
sound = "acf_engines/r7_petrolsmall.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 360,
torque = 620,
flywheelmass = 0.10,
idlerpm = 710,
peakminrpm = 2600,
peakmaxrpm = 4500,
limitrpm = 4900
} )
ACF_DefineEngine( "X16-24.8", {
name = "X16 24.8L Petrol",
desc = "Mid range X16 engine, thirsty and smooth",
model = "models/engines/X16m.mdl",
sound = "acf_engines/r7_petrolmedium.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 1040,
torque = 1440,
flywheelmass = 0.45,
idlerpm = 680,
peakminrpm = 2200,
peakmaxrpm = 3600,
limitrpm = 3900
} )
ACF_DefineEngine( "X16-57.2", {
name = "X16 57.2L Petrol",
desc = "Massive X16 monster, perfect for a vibrator.",
model = "models/engines/X16b.mdl",
sound = "acf_engines/r7_petrollarge.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 3000,
torque = 4050,
flywheelmass = 2,
idlerpm = 650,
peakminrpm = 2100,
peakmaxrpm = 3200,
limitrpm = 3800
} )

View File

@ -0,0 +1,50 @@
ACF_DefineEngine( "X20-8.0", {
name = "X20 8L Petrol",
desc = "A tiny, old worn-out X20 engine.",
model = "models/engines/x20s.mdl",
sound = "acf_engines/r7_petrolsmall.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 450,
torque = 790,
flywheelmass = 0.10,
idlerpm = 710,
peakminrpm = 2600,
peakmaxrpm = 4500,
limitrpm = 4900
} )
ACF_DefineEngine( "X20-31.0", {
name = "X20 31L Petrol",
desc = "Mid range X20 engine, thirsty and smooth",
model = "models/engines/x20m.mdl",
sound = "acf_engines/r7_petrolmedium.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 1330,
torque = 1810,
flywheelmass = 0.45,
idlerpm = 680,
peakminrpm = 2200,
peakmaxrpm = 3600,
limitrpm = 3900
} )
ACF_DefineEngine( "X20-74.0", {
name = "X20 74L Petrol",
desc = "Massive X20 monster, perfect for a vibrator.",
model = "models/engines/x20b.mdl",
sound = "acf_engines/r7_petrollarge.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 3800,
torque = 5275,
flywheelmass = 2,
idlerpm = 650,
peakminrpm = 2100,
peakmaxrpm = 3200,
limitrpm = 3800
} )

View File

@ -0,0 +1,50 @@
ACF_DefineEngine( "X24-9.6", {
name = "X24 9.6L Petrol",
desc = "A tiny, old worn-out X24 engine.",
model = "models/engines/x24s.mdl",
sound = "acf_engines/r7_petrolsmall.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 540,
torque = 820,
flywheelmass = 0.10,
idlerpm = 710,
peakminrpm = 2600,
peakmaxrpm = 4500,
limitrpm = 4900
} )
ACF_DefineEngine( "X24-37.2", {
name = "X24 37.2L Petrol",
desc = "Mid range X24 engine, thirsty and smooth",
model = "models/engines/x24m.mdl",
sound = "acf_engines/r7_petrolmedium.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 1540,
torque = 2310,
flywheelmass = 0.45,
idlerpm = 680,
peakminrpm = 2200,
peakmaxrpm = 3600,
limitrpm = 3900
} )
ACF_DefineEngine( "X24-85.8-X24", {
name = "X24 85.8L Petrol",
desc = "Massive X24 monster, perfect for a vibrator.",
model = "models/engines/x24b.mdl",
sound = "acf_engines/r7_petrollarge.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 4500,
torque = 5700,
flywheelmass = 2,
idlerpm = 650,
peakminrpm = 2100,
peakmaxrpm = 3200,
limitrpm = 3800
} )

View File

@ -0,0 +1,103 @@
ACF_DefineEngine( "X4-1.6", {
name = "X4 1.6L Petrol",
desc = "A tiny, old worn-out X4 engine.",
model = "models/engines/xs.mdl",
sound = "acf_engines/r7_petrolsmall.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 90,
torque = 170,
flywheelmass = 0.10,
idlerpm = 710,
peakminrpm = 2600,
peakmaxrpm = 4500,
limitrpm = 4900
} )
ACF_DefineEngine( "X4-6.2", {
name = "X4 6.2 Petrol",
desc = "Mid range X4 engine, thirsty and smooth",
model = "models/engines/xm.mdl",
sound = "acf_engines/r7_petrolmedium.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 290,
torque = 370,
flywheelmass = 0.45,
idlerpm = 680,
peakminrpm = 2200,
peakmaxrpm = 3600,
limitrpm = 3900
} )
ACF_DefineEngine( "X4-14.8", {
name = "X4 14.8L Petrol",
desc = "Massive X4 monster, perfect for a vibrator.",
model = "models/engines/xb.mdl",
sound = "acf_engines/r7_petrollarge.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 800,
torque = 1225,
flywheelmass = 2,
idlerpm = 650,
peakminrpm = 2100,
peakmaxrpm = 3200,
limitrpm = 3800
} )
--x4-2
ACF_DefineEngine( "X4-1.6-2", {
name = "X4 1.6L Petrol",
desc = "A tiny, old worn-out X4 engine.",
model = "models/engines/x4s2.mdl",
sound = "acf_engines/r7_petrolsmall.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 90,
torque = 170,
flywheelmass = 0.10,
idlerpm = 710,
peakminrpm = 2600,
peakmaxrpm = 4500,
limitrpm = 4900
} )
ACF_DefineEngine( "X4-6.2", {
name = "X4 6.2L Petrol",
desc = "Mid range X4 engine, thirsty and smooth",
model = "models/engines/x4m2.mdl",
sound = "acf_engines/r7_petrolmedium.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 290,
torque = 370,
flywheelmass = 0.45,
idlerpm = 680,
peakminrpm = 2200,
peakmaxrpm = 3600,
limitrpm = 3900
} )
ACF_DefineEngine( "X4-14.8", {
name = "X4 14.8L Petrol",
desc = "Massive X4 monster, perfect for a vibrator.",
model = "models/engines/x4b2.mdl",
sound = "acf_engines/r7_petrollarge.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 800,
torque = 1225,
flywheelmass = 2,
idlerpm = 650,
peakminrpm = 2100,
peakmaxrpm = 3200,
limitrpm = 3800
} )

View File

@ -0,0 +1,50 @@
ACF_DefineEngine( "X8-3.2", {
name = "X8 3.2L Petrol",
desc = "A tiny, old worn-out X8 engine.",
model = "models/engines/x8s.mdl",
sound = "acf_engines/r7_petrolsmall.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 179,
torque = 310,
flywheelmass = 0.10,
idlerpm = 710,
peakminrpm = 2600,
peakmaxrpm = 4500,
limitrpm = 4900
} )
ACF_DefineEngine( "X8-12.4", {
name = "X8 12.4L Petrol",
desc = "Mid range X8 engine, thirsty and smooth",
model = "models/engines/x8m.mdl",
sound = "acf_engines/r7_petrolmedium.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 520,
torque = 720,
flywheelmass = 0.45,
idlerpm = 680,
peakminrpm = 2200,
peakmaxrpm = 3600,
limitrpm = 3900
} )
ACF_DefineEngine( "X8-25.6", {
name = "X8 25.6L Petrol",
desc = "Massive X8 monster, perfect for a vibrator.",
model = "models/engines/x8b.mdl",
sound = "acf_engines/r7_petrollarge.wav",
category = "X",
fuel = "Petrol",
enginetype = "Radial",
weight = 1500,
torque = 2025,
flywheelmass = 2,
idlerpm = 650,
peakminrpm = 2100,
peakmaxrpm = 3200,
limitrpm = 3800
} )

View File

@ -120,3 +120,25 @@ ACF_DefineEngine( "Electric-Large-NoBatt", {
elecpower = 272,
flywheeloverride = 6000
} )
ACF_DefineEngine( "Electric-Tiny-NoBatt", {
name = "Electric motor, Tiny, Standalone",
desc = "A pint-size electric motor, for the lightest of light utility work. Can power electric razors, desk fans, or your hopes and dreams\n\nElectric motors provide huge amounts of torque, but are very heavy.\n\nStandalone electric motors don't have integrated batteries, saving on weight and volume, but require you to supply your own batteries.",
model = "models/engines/emotor-standalone-tiny.mdl",
sound = "acf_engines/electric_small.wav",
category = "Electric",
fuel = "Electric",
enginetype = "Electric",
weight = 50, --250
torque = 40,
flywheelmass = 0.025,
idlerpm = 10,
peakminrpm = 10,
peakmaxrpm = 10,
limitrpm = 10000,
iselec = true,
elecpower = 5,
flywheeloverride = 500
} )

View File

@ -0,0 +1,82 @@
ACF_DefineEngine( "Electric-Tiny-NoBatt2", {
name = "Electric motor, Tiny, Standalone",
desc = "A tiny electric motor, loads of torque, but low power\n\nElectric motors provide huge amounts of torque, but are very heavy.\n\nStandalone electric motors don't have integrated batteries, saving on weight and volume, but require you to supply your own batteries.",
model = "models/engines/emotor-standalone-tiny.mdl",
sound = "acf_engines/electric_small.wav",
category = "Electric",
fuel = "Electric",
enginetype = "Electric",
weight = 50, --250
torque = 120,
flywheelmass = 0.15,
idlerpm = 10,
peakminrpm = 10,
peakmaxrpm = 10,
limitrpm = 13000,
iselec = true,
elecpower = 48,
flywheeloverride = 3000
} )
ACF_DefineEngine( "Electric-Small-NoBatt2", {
name = "Old Electric motor, Small, Standalone",
desc = "A small electric motor, loads of torque, but low power\n\nElectric motors provide huge amounts of torque, but are very heavy.\n\nStandalone electric motors don't have integrated batteries, saving on weight and volume, but require you to supply your own batteries.",
model = "models/engines/emotorsmall2.mdl",
sound = "acf_engines/electric_small.wav",
category = "Electric",
fuel = "Electric",
enginetype = "Electric",
weight = 125, --250
torque = 320,
flywheelmass = 0.25,
idlerpm = 10,
peakminrpm = 10,
peakmaxrpm = 10,
limitrpm = 10000,
iselec = true,
elecpower = 78,
flywheeloverride = 5000
} )
ACF_DefineEngine( "Electric-Medium-NoBatt2", {
name = "Old Electric motor, Medium, Standalone",
desc = "A medium electric motor, loads of torque, but low power\n\nElectric motors provide huge amounts of torque, but are very heavy.\n\nStandalone electric motors don't have integrated batteries, saving on weight and volume, but require you to supply your own batteries.",
model = "models/engines/emotormed2.mdl",
sound = "acf_engines/electric_medium.wav",
category = "Electric",
fuel = "Electric",
enginetype = "Electric",
weight = 575, --800
torque = 960,
flywheelmass = 1.2,
idlerpm = 10,
peakminrpm = 10,
peakmaxrpm = 10,
limitrpm = 7000,
iselec = true,
elecpower = 160,
flywheeloverride = 8000
} )
ACF_DefineEngine( "Electric-Large-NoBatt2", {
name = "Old Electric motor, Large, Standalone",
desc = "A huge electric motor, loads of torque, but low power\n\nElectric motors provide huge amounts of torque, but are very heavy.\n\nStandalone electric motors don't have integrated batteries, saving on weight and volume, but require you to supply your own batteries.",
model = "models/engines/emotorlarge2.mdl",
sound = "acf_engines/electric_large.wav",
category = "Electric",
fuel = "Electric",
enginetype = "Electric",
weight = 1500, --1900
torque = 2400,
flywheelmass = 8,
idlerpm = 10,
peakminrpm = 10,
peakmaxrpm = 10,
limitrpm = 4500,
iselec = true,
elecpower = 272,
flywheeloverride = 6000
} )

View File

@ -1,6 +1,23 @@
-- Special engines
ACF_DefineEngine( "0.9L-I2", {
name = "0.9L I2 Petrol",
desc = "Turbocharged inline twin engine that delivers surprising pep for its size.",
model = "models/engines/inline2s.mdl",
sound = "acf_extra/vehiclefx/engines/ponyengine.wav",
category = "Special",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 45,
torque = 116,
flywheelmass = 0.085,
idlerpm = 750,
peakminrpm = 3125,
peakmaxrpm = 5100,
limitrpm = 6000
} )
ACF_DefineEngine( "1.0L-I4", {
name = "1.0L I4 Petrol",
desc = "Tiny I4 designed for racing bikes. Doesn't pack much torque, but revs ludicrously high.",
@ -12,16 +29,33 @@ ACF_DefineEngine( "1.0L-I4", {
enginetype = "GenericPetrol",
weight = 63,
torque = 68,
flywheelmass = 0.035,
flywheelmass = 0.031,
idlerpm = 1200,
peakminrpm = 7500,
peakmaxrpm = 11500,
limitrpm = 12000
} )
ACF_DefineEngine( "1.8L-V4", {
name = "1.8L V4 Petrol",
desc = "Naturally aspirated rally-tuned V4 with enlarged bore and stroke.",
model = "models/engines/v4s.mdl",
sound = "acf_extra/vehiclefx/engines/l4/elan_onlow.WAV",
category = "Special",
fuel = "Petrol",
enginetype = "GenericPetrol",
weight = 92,
torque = 124.8,
flywheelmass = 0.04,
idlerpm = 900,
peakminrpm = 4600,
peakmaxrpm = 7000,
limitrpm = 7500
} )
ACF_DefineEngine( "2.4L-V6", {
name = "2.4L V6 Petrol",
desc = "Although the cast iron engine block is fairly weighty, it allows this tiny v6 to put out impressive power. The unique design allows uncharacteristically high RPM for a V6.",
desc = "Although the cast iron engine block is fairly weighty, this tiny v6 makes up for it with impressive power. The unique V angle allows uncharacteristically high RPM for a V6.",
model = "models/engines/v6small.mdl",
sound = "acf_extra/vehiclefx/engines/l6/capri_onmid.WAV",
category = "Special",
@ -149,7 +183,7 @@ ACF_DefineEngine( "3.0-V12", {
enginetype = "GenericPetrol",
weight = 175,
torque = 248,
flywheelmass = 0.175,
flywheelmass = 0.125,
idlerpm = 1200,
peakminrpm = 6875,
peakmaxrpm = 11000,

View File

@ -7,7 +7,7 @@ ACF_DefineEngine( "Turbine-Small-Trans", {
model = "models/engines/turbine_s.mdl",
sound = "acf_engines/turbine_small.wav",
category = "Turbine",
fuel = "Any",
fuel = "Multifuel",
enginetype = "Turbine",
weight = 200,
torque = 550,
@ -28,7 +28,7 @@ ACF_DefineEngine( "Turbine-Medium-Trans", {
model = "models/engines/turbine_m.mdl",
sound = "acf_engines/turbine_medium.wav",
category = "Turbine",
fuel = "Any",
fuel = "Multifuel",
enginetype = "Turbine",
weight = 400,
torque = 850,
@ -49,7 +49,7 @@ ACF_DefineEngine( "Turbine-Large-Trans", {
model = "models/engines/turbine_l.mdl",
sound = "acf_engines/turbine_large.wav",
category = "Turbine",
fuel = "Any",
fuel = "Multifuel",
enginetype = "Turbine",
weight = 1000,
torque = 2500,
@ -70,7 +70,7 @@ ACF_DefineEngine( "Turbine-Small", {
model = "models/engines/gasturbine_s.mdl",
sound = "acf_engines/turbine_small.wav",
category = "Turbine",
fuel = "Any",
fuel = "Multifuel",
enginetype = "Turbine",
weight = 200,
torque = 550,
@ -90,7 +90,7 @@ ACF_DefineEngine( "Turbine-Medium", {
model = "models/engines/gasturbine_m.mdl",
sound = "acf_engines/turbine_medium.wav",
category = "Turbine",
fuel = "Any",
fuel = "Multifuel",
enginetype = "Turbine",
weight = 400,
torque = 850,
@ -110,7 +110,7 @@ ACF_DefineEngine( "Turbine-Large", {
model = "models/engines/gasturbine_l.mdl",
sound = "acf_engines/turbine_large.wav",
category = "Turbine",
fuel = "Any",
fuel = "Multifuel",
enginetype = "Turbine",
weight = 1000,
torque = 2500,

View File

@ -0,0 +1,86 @@
ACF_DefineFuelTankSize( "Battery_1x1x2", {
name = "1x1x2 Battery",
desc = "Will keep a kart running all day.",
model = "models/fueltank/battery16t.mdl",
dims = { 10.9, 11, 20.3 }
} )
ACF_DefineFuelTankSize( "Battery_1x1x4", {
name = "1x1x4 Battery",
desc = "Dinghy",
model = "models/fueltank/battery32t.mdl",
dims = { 11, 11, 40.4 }
} )
ACF_DefineFuelTankSize( "Battery_1x2x4", {
name = "1x2x4 Battery",
desc = "Outboard motor.",
model = "models/fueltank/battery16s.mdl",
dims = { 21.3, 11, 40.4 }
} )
ACF_DefineFuelTankSize( "Battery_1x4x4", {
name = "1x4x4 Battery",
desc = "",
model = "models/fueltank/battery32s.mdl",
dims = { 41.1, 11, 40.4 }
} )
ACF_DefineFuelTankSize( "Battery_1x8x2", {
name = "1x8x2 Battery",
desc = "",
model = "models/fueltank/battery16mb.mdl",
dims = { 81.1, 11, 20.8 }
} )
ACF_DefineFuelTankSize( "Battery_1x8x4", {
name = "1x8x4 Battery",
desc = "",
model = "models/fueltank/battery32mb.mdl",
dims = { 81.1, 11, 40.4 }
} )
ACF_DefineFuelTankSize( "Tank_2x4x1", {
name = "2x4x1",
desc = "",
model = "models/fueltank/battery16m.mdl",
dims = { 41.7, 21.7, 11.6 }
} )
ACF_DefineFuelTankSize( "Tank_2x4x2", {
name = "2x4x2",
desc = "Mini Cooper.",
model = "models/fueltank/battery32m.mdl",
dims = { 41.7, 21.6, 21.6 }
} )
ACF_DefineFuelTankSize( "Battery_2x8x2", {
name = "1x8x2 Battery",
desc = "",
model = "models/fueltank/battery16b.mdl",
dims = { 81.1, 21, 20.8 }
} )
ACF_DefineFuelTankSize( "Battery_2x8x4", {
name = "2x8x4 Battery",
desc = "",
model = "models/fueltank/battery32b.mdl",
dims = { 81.1, 21, 40.4 }
} )
ACF_DefineFuelTankSize( "Battery_2x8x4", {
name = "1x8x4 Battery",
desc = "",
model = "models/fueltank/battery16h.mdl",
dims = { 81.1, 21, 40.8 }
} )
ACF_DefineFuelTankSize( "Battery_2x8x8", {
name = "2x8x8 Battery",
desc = "",
model = "models/fueltank/battery32h.mdl",
dims = { 81.1, 21, 80.4 }
} )

View File

@ -0,0 +1,79 @@
-- CVT (continuously variable transmission)
-- Weight
local GearCVTSW = 45
local GearCVTMW = 80
local GearCVTLW = 140
-- Torque Rating
local GearCVTST = 120
local GearCVTMT = 290
local GearCVTLT = 650
-- general description
local CVTDesc = "\n\nA CVT will adjust the ratio its first gear to keep an engine within a target rpm range, allowing constant peak performance. However, this comes at the cost of increased weight and limited torque ratings."
-- Straight fwclutch
ACF_DefineGearbox( "CVT2-ST-S", {
name = "CVT2, Straight, Small",
desc = "A light duty straight-through CVT."..CVTDesc,
model = "models/engines/flywheelclutchs.mdl",
category = "CVT",
weight = GearCVTSW,
switch = 0.15,
maxtq = GearCVTST,
gears = 2,
cvt = true,
geartable = {
[-3] = 3000, --target min rpm
[-2] = 5000, --target max rpm
[-1] = 1, --final drive
[ 0 ] = 0,
[ 1 ] = 0,
[ 2 ] = -0.1
}
} )
ACF_DefineGearbox( "CVT2-ST-M", {
name = "CVT2, Straight, Medium",
desc = "A medium straight-through CVT."..CVTDesc,
model = "models/engines/flywheelclutchm.mdl",
category = "CVT",
weight = GearCVTMW,
switch = 0.2,
maxtq = GearCVTMT,
gears = 2,
cvt = true,
geartable = {
[-3] = 3000, --target min rpm
[-2] = 5000, --target max rpm
[-1] = 1, --final drive
[ 0 ] = 0,
[ 1 ] = 0,
[ 2 ] = -0.1
}
} )
ACF_DefineGearbox( "CVT2-ST-L", {
name = "CVT2, Straight, Large",
desc = "A massive straight-through CVT designed for high torque applications."..CVTDesc,
model = "models/engines/flywheelclutchb.mdl",
category = "CVT",
weight = GearCVTLW,
switch = 0.3,
maxtq = GearCVTLT,
gears = 2,
cvt = true,
geartable = {
[-3] = 3000, --target min rpm
[-2] = 5000, --target max rpm
[-1] = 1, --final drive
[ 0 ] = 0,
[ 1 ] = 0,
[ 2 ] = -0.1
}
} )

View File

@ -1,18 +1,27 @@
--------------------------------------
-- Set vars
--------------------------------------
ACFCUSTOM = {}
--##############
ACFCUSTOM.VersionCustom = 9.3
ACFCUSTOM.Version2 = 109
ACFCUSTOM.CurrentVersion2 = 0
ACFCUSTOM.VersionCustom = 10.0
ACFCUSTOM.Version = 110
ACFCUSTOM.CurrentVersion = 0
ACFCUSTOM.EngineMakerVersion = 5.0
ACFC = {}
ACFC.R = 0
ACFC.G = 0
ACFC.B = 200
print("[[ ACF Custom Loaded ]]")
--Customs Cvars
--------------------------------------
-- Cvars
--------------------------------------
CreateConVar('sbox_max_acf_modding', 1)
CreateConVar('sbox_max_acf_extra', 12)
CreateConVar('sbox_max_acf_maker', 12)
--------------------------------------
-- Loading Files
--------------------------------------
AddCSLuaFile()
AddCSLuaFile( "acf/client/cl_acfcustom_gui.lua" )
--Loading Customs Files
local customfiles = file.Find( "acf/client/custommenu/*.lua", "LUA" )
local customfileshelpmenu = file.Find( "acf/client/custommenu/helpmenu/*.lua", "LUA" )
local customfilesenginemaker = file.Find( "acf/client/custommenu/enginemaker/*.lua", "LUA" )
@ -25,16 +34,19 @@ end
for k, v in pairs( customfilesenginemaker ) do
AddCSLuaFile( "acf/client/custommenu/enginemaker/" .. v )
end
--------------------------------------
-- Loading Files Client/Server side
--------------------------------------
if SERVER then
util.AddNetworkString( "ACFCUSTOM_Notify" )
elseif CLIENT then
--Loading Customs Files
local customfiles2 = file.Find( "acf/client/custommenu/*.lua", "LUA" )
local customfileshelpmenu2 = file.Find( "acf/client/custommenu/helpmenu/*.lua", "LUA" )
local customfilesenginemaker2 = file.Find( "acf/client/custommenu/enginemaker/*.lua", "LUA" )
for k, v in pairs( customfiles2 ) do
include( "acf/client/custommenu/" .. v )
if v != "acf_dupefixer.lua" then
include( "acf/client/custommenu/" .. v )
end
end
for k, v in pairs( customfileshelpmenu2 ) do
include( "acf/client/custommenu/helpmenu/" .. v )
@ -43,11 +55,12 @@ elseif CLIENT then
include( "acf/client/custommenu/enginemaker/" .. v )
end
end
include("acf/shared/acfloadercustom.lua")
ACFCUSTOM.Weapons = list.Get("ACFCUSTOMEnts")
--Notify
ACFCUSTOM.Weapons = list.Get("ACFCUSTOMEnts")
--------------------------------------
-- Notify
--------------------------------------
if SERVER then
function ACFCUSTOM_SendNotify( ply, success, msg )
net.Start( "ACFCUSTOM_Notify" )
@ -64,22 +77,49 @@ else
end
net.Receive( "ACFCUSTOM_Notify", ACFCUSTOM_Notify )
end
--------------------------------------
-- ACF tool category
--------------------------------------
if CLIENT then
ACFCUSTOM.CustomToolCategory = CreateClientConVar( "acf_tool_category", 0, true, false );
--Updating Checking
if( ACFCUSTOM.CustomToolCategory:GetBool() ) then
language.Add( "spawnmenu.tools.acf", "ACF" );
hook.Add( "AddToolMenuTabs", "CreateACFCategory", function()
spawnmenu.AddToolCategory( "Main", "ACF", "#spawnmenu.tools.acf" );
end );
end
end
--------------------------------------
-- Check for Updates
--------------------------------------
function ACFCUSTOM_UpdateChecking( )
print("[ACF] Checking for updates....")
http.Fetch("https://github.com/bouletmarc/ACF_CustomMod/",function(contents,size)
local rev2 = tonumber(string.match( contents, "history\"></span>\n%s*(%d+)\n%s*</span>" ))
if rev2 and ACFCUSTOM.Version2 >= rev2 then
print("[ACF] ACF Custom Is Up To Date, Latest Version: "..rev2)
elseif !rev2 then
local rev = tonumber(string.match( contents, "history\"></span>\n%s*(%d+)\n%s*</span>" ))
if rev and ACFCUSTOM.Version >= rev then
print("[ACF] ACF Custom Is Up To Date, Latest Version: "..rev)
elseif !rev then
print("[ACF] No Internet Connection Detected! ACF Custom Update Check Failed")
rev2 = ACFCUSTOM.Version2
rev = ACFCUSTOM.Version
else
print("[ACF] A newer version of ACF Custom is available! Version: "..rev2..", You have Version: "..ACFCUSTOM.Version2)
print("[ACF] A newer version of ACF Custom is available! Version: "..rev..", You have Version: "..ACFCUSTOM.Version)
if CLIENT then chat.AddText( Color( 255, 0, 0 ), "A newer version of ACF Custom is available!" ) end
end
ACFCUSTOM.CurrentVersion2 = rev2
ACFCUSTOM.CurrentVersion = rev
end, function() end)
end
ACFCUSTOM_UpdateChecking( )
--------------------------------------
-- Initial Colors Loading
--------------------------------------
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
ACFC.R = tonumber(MenuColorTable[1])
ACFC.G = tonumber(MenuColorTable[2])
ACFC.B = tonumber(MenuColorTable[3])
end

View File

@ -236,7 +236,7 @@ function MakeACF_Chips(Owner, Pos, Angle, Id, Data1, Data2, Data3)
Owner:AddCount("_acf_chips", Chips)
Owner:AddCleanup( "acfmenu", Chips )
Chips:SetNetworkedString( "WireName", Lookup.name )
Chips:SetNWString( "WireName", Lookup.name )
Chips:UpdateOverlayText()
Chips:SetWireOutputs()
@ -303,7 +303,7 @@ function ENT:Update( ArgsTable )
self.Inputs = Wire_CreateInputs( self, Inputs )
self.Outputs = WireLib.CreateSpecialOutputs( self, Outputs, OutputsTypes )
self:SetNetworkedString( "WireName", Lookup.name )
self:SetNWString( "WireName", Lookup.name )
self:UpdateOverlayText()
self:SetWireOutputs()

View File

@ -82,11 +82,11 @@ function ENT:Initialize()
self.LastCheck = 0
self.LastThink = 0
self.MassRatio = 1
self.FuelTank = 1
self.Legal = true
self.CanUpdate = true
self.RequiresFuel = 0
self.RequiresFuel = false
--####################
self.CutMode = 0
self.CutRpm = 0
self.Fuelusing = 0
@ -97,7 +97,7 @@ function ENT:Initialize()
self.RPMExtra = 0
self.ExtraUsing = 0
self.PeakTorqueHealth = 0
--#####################
self.Outputs = WireLib.CreateSpecialOutputs( self, { "RPM", "Torque", "Power", "Fuel Use", "Entity", "Mass", "Physical Mass" }, { "NORMAL","NORMAL","NORMAL", "NORMAL", "ENTITY", "NORMAL", "NORMAL" } )
Wire_TriggerOutput( self, "Entity", self )
end
@ -145,7 +145,7 @@ function MakeACF_Engine(Owner, Pos, Angle, Id)
Engine.SpecialHealth = true
Engine.SpecialDamage = true
Engine.TorqueMult = 1
---------------------
Engine:FirstLoadCustom()
Engine.FlywheelMassValue = Lookup.flywheelmass
--Creating Wire Inputs
@ -166,7 +166,7 @@ function MakeACF_Engine(Owner, Pos, Angle, Id)
end
end
Engine.Inputs = Wire_CreateInputs( Engine, Inputs )
---------------------
if Engine.EngineType == "GenericDiesel" then
Engine.TorqueScale = ACF.DieselTorqueScale
else
@ -205,7 +205,7 @@ function MakeACF_Engine(Owner, Pos, Angle, Id)
phys:SetMass( Engine.Weight )
end
Engine:SetNetworkedString( "WireName", Lookup.name )
Engine:SetNWString( "WireName", Lookup.name )
------ GUI ---------
Engine.FlywheelMassGUI = Engine.FlywheelMassValue
Engine:UpdateOverlayText()
@ -272,7 +272,7 @@ function ENT:Update( ArgsTable )
self.SpecialHealth = true
self.SpecialDamage = true
self.TorqueMult = self.TorqueMult or 1
---------------------
self:FirstLoadCustom()
self.FlywheelMassValue = Lookup.flywheelmass
--Creating Wire Inputs
@ -293,7 +293,7 @@ function ENT:Update( ArgsTable )
end
end
self.Inputs = Wire_CreateInputs( self, Inputs )
---------------------
if self.EngineType == "GenericDiesel" then
self.TorqueScale = ACF.DieselTorqueScale
else
@ -325,7 +325,7 @@ function ENT:Update( ArgsTable )
phys:SetMass( self.Weight )
end
self:SetNetworkedString( "WireName", Lookup.name )
self:SetNWString( "WireName", Lookup.name )
------ GUI ---------
self.FlywheelMassGUI = self.FlywheelMassValue
self:UpdateOverlayText()
@ -352,32 +352,26 @@ function ENT:FirstLoadCustom( )
end
function ENT:UpdateOverlayText()
if self.RequiresFuel == 1 then
self.PowerGUI = self.peakkw*ACF.TorqueBoost
self.TorqueGUI = (self.PeakTorqueAdd+self.PeakTorqueExtra-self.PeakTorqueHealth)*ACF.TorqueBoost
else
self.PowerGUI = self.peakkw
self.TorqueGUI = (self.PeakTorqueAdd+self.PeakTorqueExtra-self.PeakTorqueHealth)
end
local SpecialBoost = self.RequiresFuel and ACF.TorqueBoost or 1
self.PowerGUI = self.peakkw*SpecialBoost
self.TorqueGUI = (self.PeakTorqueAdd+self.PeakTorqueExtra-self.PeakTorqueHealth)*SpecialBoost
self.FuelusingGUI = self.Fuelusing
self.FlyRPMGUI = self.FlyRPM
local text = "Power: " .. math.Round(self.PowerGUI) .. " kW / " .. math.Round(self.PowerGUI * 1.34) .. " hp\n"
text = text .. "Torque: " .. math.Round(self.TorqueGUI) .. " Nm / " .. math.Round(self.TorqueGUI * 0.73) .. " ft-lb\n"
if self.EngineType == "Turbine" or self.EngineType == "Electric" then --Set Gui on electric&turbine
if self.EngineType == "Turbine" or self.EngineType == "Electric" then
text = text .. "Override: " .. math.Round(self.FlywheelOverride) .. " RPM\n"
text = text .. "Redline: " .. math.Round((self.LimitRPM+self.RPMExtra)) .. " RPM\n"
text = text .. "FlywheelMass: " .. math.Round(self.FlywheelMassGUI,3) .. " Kg\n"
text = text .. "Rpm: " .. math.Round(self.FlyRPM) .. " RPM\n"
if self.RequiresFuel == 1 then text = text .. "Consumption: " .. math.Round(self.Fuelusing,3) .. " liters/min\n" end
text = text .. "Weight: " .. math.Round(self.Weight) .. "Kg"
else --Set Gui on Others
else
text = text .. "Powerband: " .. math.Round(self.PeakMinRPM) .. " - " .. math.Round((self.PeakMaxRPM+self.RPMExtra)) .. " RPM\n"
text = text .. "Redline: " .. math.Round((self.LimitRPM+self.RPMExtra)) .. " RPM\n"
text = text .. "FlywheelMass: " .. math.Round(self.FlywheelMassGUI,3) .. " Kg\n"
text = text .. "Rpm: " .. math.Round(self.FlyRPM) .. " RPM\n"
if self.RequiresFuel == 1 then text = text .. "Consumption: " .. math.Round(self.Fuelusing,3) .. " liters/min\n" end
text = text .. "Idle: " .. math.Round(self.IdleRPM) .. " RPM\n"
text = text .. "Weight: " .. math.Round(self.Weight) .. "Kg"
end
text = text .. "Redline: " .. math.Round((self.LimitRPM+self.RPMExtra)) .. " RPM\n"
text = text .. "FlywheelMass: " .. math.Round(self.FlywheelMassGUI,3) .. " Kg\n"
text = text .. "Rpm: " .. math.Round(self.FlyRPM) .. " RPM\n"
if self.RequiresFuel then text = text .. "Consumption: " .. math.Round(self.FuelusingGUI,3) .. " liters/min\n" end
text = text .. "Weight: " .. math.Round(self.Weight) .. "Kg"
self:SetOverlayText( text )
end
@ -408,7 +402,7 @@ function ENT:TriggerInput( iname, value )
if (value > 0 and not self.Active) then
--make sure we have fuel
local HasFuel
if self.RequiresFuel == 0 then
if not self.RequiresFuel then
HasFuel = true
else
for _,fueltank in pairs(self.FuelLink) do
@ -427,7 +421,7 @@ function ENT:TriggerInput( iname, value )
end
elseif (value > 0) then
local HasFuel
if self.RequiresFuel == 0 then
if not self.RequiresFuel then
HasFuel = true
else
for _,fueltank in pairs(self.FuelLink) do
@ -449,64 +443,55 @@ function ENT:TriggerInput( iname, value )
Wire_TriggerOutput( self, "Power", 0 )
Wire_TriggerOutput( self, "Fuel Use", 0 )
end
--##########################################
elseif (iname == "TqAdd") then
if (value ~= 0 ) then
if (self.PeakTorqueAdd != self.PeakTorqueNormal+value) then
self.PeakTorqueAdd = self.PeakTorqueNormal+value
self:UpdateEngineConsumption()
elseif (value == 0 ) then
self.PeakTorqueAdd = self.PeakTorqueNormal
self:UpdateEngineConsumption()
end
elseif (iname == "RpmAdd") then
if (value ~= 0 ) then
if (self.PeakMaxRPM != self.PeakMaxRPMNormal+value) then
self.PeakMaxRPM = self.PeakMaxRPMNormal+value
self.LimitRPM = self.LimitRPMNormal+value
self.CutValue = self.LimitRPM / 20
self.CutRpm = self.LimitRPM - 100
self:UpdateEngineConsumption()
elseif (value == 0 ) then
self.PeakMaxRPM = self.PeakMaxRPMNormal
self.LimitRPM = self.LimitRPMNormal
self.CutValue = self.LimitRPM / 20
self.CutRpm = self.LimitRPM - 100
self:UpdateEngineConsumption()
end
elseif (iname == "FlywheelMass") then
if (value > 0 ) then
if (value > 0 and self.FlywheelMassValue != value) then
self.FlywheelMassValue = value
self.FlywheelMassGUI = self.FlywheelMassValue
self:UpdateOverlayText()
elseif (value <= 0 ) then
elseif (value <= 0 and self.FlywheelMassValue != self.FlywheelMassNormal) then
self.FlywheelMassValue = self.FlywheelMassNormal
self.FlywheelMassGUI = self.FlywheelMassValue
self:UpdateOverlayText()
end
elseif (iname == "Override") then
if (value > 0 ) then
if (value > 0 and self.FlywheelOverride != value) then
self.FlywheelOverride = value
self:UpdateOverlayText()
elseif (value <= 0 ) then
elseif (value <= 0 and self.FlywheelOverride != self.FlywheelOverrideNormal) then
self.FlywheelOverride = self.FlywheelOverrideNormal
self:UpdateOverlayText()
end
elseif (iname == "Idle") then
if (value > 0 ) then
if (value > 0 and self.IdleRPM != value) then
self.IdleRPM = value
self:UpdateOverlayText()
elseif (value <= 0 ) then
elseif (value <= 0 and self.IdleRPM != self.IdleRPMNormal) then
self.IdleRPM = self.IdleRPMNormal
self:UpdateOverlayText()
end
elseif (iname == "Disable Cutoff") then
if (value > 0 ) then
if (value > 0 and self.DisableCut != 1) then
self.DisableCut = 1
elseif (value <= 0 ) then
elseif (value <= 0 and self.DisableCut != 0) then
self.DisableCut = 0
end
end
end
--#########################
function ENT:ACF_Activate()
--Density of steel = 7.8g cm3 so 7.8kg for a 1mx1m plate 1m thick
local Entity = self
@ -550,6 +535,9 @@ function ENT:ACF_Activate()
if self.EngineType == "GenericDiesel" then
Entity.ACF.Health = Health * Percent * ACF.DieselEngineHPMult
Entity.ACF.MaxHealth = Health * ACF.DieselEngineHPMult
elseif self.EngineType == "Electric" then
Entity.ACF.Health = Health * Percent * ACF.ElectricEngineHPMult
Entity.ACF.MaxHealth = Health * ACF.ElectricEngineHPMult
else
Entity.ACF.Health = Health * Percent * ACF.EngineHPMult
Entity.ACF.MaxHealth = Health * ACF.EngineHPMult
@ -566,7 +554,7 @@ end
function ENT:ACF_OnDamage( Entity, Energy, FrAera, Angle, Inflictor, Bone, Type ) --This function needs to return HitRes
local Mul = ((Type == "HEAT" and 6.6) or 1) --Heat penetrators deal bonus damage to engines, roughly half an AP round
local Mul = ((Type == "HEAT" and ACF.HEATMulEngine) or 1) --Heat penetrators deal bonus damage to engines
local HitRes = ACF_PropDamage( Entity, Energy, FrAera * Mul, Angle, Inflictor ) --Calling the standard damage prop function
return HitRes --This function needs to return HitRes
@ -685,15 +673,20 @@ function ENT:CalcRPM()
local DeltaTime = CurTime() - self.LastThink
--find first active tank with fuel
--find next active tank with fuel
local Tank = nil
local boost = 1
for _,fueltank in pairs(self.FuelLink) do
if fueltank.Fuel > 0 and fueltank.Active then Tank = fueltank break end
if fueltank.Fuel <= 0 or not fueltank.Active then Tank = false break end
end
if (not Tank) and self.RequiresFuel == 1 then --make sure we've got a tank with fuel if needed
self:TriggerInput( "Active" , 0 )
local i = 0
local MaxTanks = #self.FuelLink
while i <= MaxTanks and not (Tank and Tank:IsValid() and Tank.Fuel > 0) do
self.FuelTank = self.FuelTank % MaxTanks + 1
Tank = self.FuelLink[self.FuelTank]
if Tank and Tank:IsValid() and Tank.Fuel > 0 and Tank.Active then
break --return Tank
end
Tank = nil
i = i + 1
end
--calculate fuel usage
@ -709,18 +702,13 @@ function ENT:CalcRPM()
boost = ACF.TorqueBoost
Wire_TriggerOutput(self, "Fuel Use", math.Round(60*Consumption/DeltaTime,3))
self.Fuelusing = math.Round((60*Consumption/DeltaTime),3)
elseif self.RequiresFuel then
self:TriggerInput( "Active", 0 ) --shut off if no fuel and requires it
return 0
else
Wire_TriggerOutput(self, "Fuel Use", 0)
end
--Function Calling
self:UpdateOverlayText() --Update GUI
for Key, Extra in pairs(self.ExtraLink) do --Update Power with Extra Link
if IsValid( Extra ) then
self:AddExtraValue( )
end
end
--adjusting performance based on damage
self.TorqueMult = math.Clamp(((1 - self.TorqueScale) / (0.5)) * ((self.ACF.Health/self.ACF.MaxHealth) - 1) + 1, self.TorqueScale, 1)
self.PeakTorque = (self.PeakTorqueAdd+self.PeakTorqueExtra-self.PeakTorqueHealth) * self.TorqueMult
@ -728,8 +716,6 @@ function ENT:CalcRPM()
-- Calculate the current torque from flywheel RPM
self.Torque = boost * self.Throttle * math.max( self.PeakTorque * math.min( self.FlyRPM / self.PeakMinRPM, (self.LimitRPM - self.FlyRPM) / (self.LimitRPM - self.PeakMaxRPM), 1 ), 0 )
self.Inertia = self.FlywheelMassValue*(3.1416)^2
local Drag
local TorqueDiff
if self.Active then
@ -752,14 +738,11 @@ function ENT:CalcRPM()
end
end
-- Let's accelerate the flywheel based on that torque
self.FlyRPM = math.max( self.FlyRPM + self.Torque / self.Inertia - Drag, 1 )
-- This is the presently avaliable torque from the engine
TorqueDiff = math.max( self.FlyRPM - self.IdleRPM, 0 ) * self.Inertia
end
if( self.Active == false ) then
-- Let's accelerate the flywheel based on that torque
self.FlyRPM = math.max( self.FlyRPM + self.Torque / self.Inertia - Drag, 1 )
-- This is the presently avaliable torque from the engine
TorqueDiff = math.max( self.FlyRPM - self.IdleRPM, 0 ) * self.Inertia
else
self.Torque = boost * 0 * math.max( self.PeakTorque * math.min( self.FlyRPM / self.PeakMinRPM , ((self.LimitRPM+self.RPMExtra) - self.FlyRPM) / ((self.LimitRPM+self.RPMExtra) - (self.PeakMaxRPM+self.RPMExtra)), 1 ), 0 )
if self.iselec == true then
Drag = self.PeakTorque * (math.max( self.FlyRPM - 0, 0) / self.FlywheelOverride) * (1 - 0) / self.Inertia
@ -767,13 +750,12 @@ function ENT:CalcRPM()
Drag = self.PeakTorque * (math.max( self.FlyRPM - 0, 0) / (self.PeakMaxRPM+self.RPMExtra)) * ( 1 - 0) / self.Inertia
end
-- Let's accelerate the flywheel based on that torque
self.FlyRPM = math.max( self.FlyRPM + self.Torque / self.Inertia - Drag, 1 )
-- This is the presently avaliable torque from the engine
TorqueDiff = 0
-- Let's accelerate the flywheel based on that torque
self.FlyRPM = math.max( self.FlyRPM + self.Torque / self.Inertia - Drag, 1 )
-- This is the presently avaliable torque from the engine
TorqueDiff = 0
end
--##############
-- The gearboxes don't think on their own, it's the engine that calls them, to ensure consistent execution order
local Boxes = table.Count( self.GearLink )
local TotalReqTq = 0
@ -789,11 +771,11 @@ function ENT:CalcRPM()
-- Split the torque fairly between the gearboxes who need it
for Key, Link in pairs( self.GearLink ) do
if not Link.Ent.Legal then continue end
Link.Ent:Act( Link.ReqTq * AvailRatio * self.MassRatio, DeltaTime )
Link.Ent:Act( Link.ReqTq * AvailRatio * self.MassRatio, DeltaTime, self.MassRatio )
end
self.FlyRPM = self.FlyRPM - math.min( TorqueDiff, TotalReqTq ) / self.Inertia
--#######################################
if( self.DisableCut == 0 ) then
if( self.FlyRPM >= self.CutRpm and self.CutMode == 0 ) then
self.CutMode = 1
@ -826,9 +808,16 @@ function ENT:CalcRPM()
self:UpdateOverlayText()
end
--SET VALUES FOR EXTRA
--Update Gui
if self.FuelusingGUI != self.Fuelusing or self.FlyRPMGUI != self.FlyRPM then
self:UpdateOverlayText()
end
--Update extras values
for Key, Extra in pairs(self.ExtraLink) do
if IsValid( Extra ) then
if IsValid(Extra) then
if self.PeakTorqueExtra != (Extra.TorqueAdd or 0) or self.RPMExtra != (Extra.RPMAdd or 0) then
self:AddExtraValue()
end
if Extra.GetRpm == true then
if not Extra.Legal then continue end
local PeakTorqueSend = (self.PeakTorqueAdd-self.PeakTorqueHealth)*self.TorqueMult
@ -836,7 +825,7 @@ function ENT:CalcRPM()
end
end
end
--SET VALUES FOR RADIATORS
--Update radiator values
for Key, Radiator in pairs(self.RadiatorLink) do
if IsValid( Radiator ) then
if Radiator.GetRpm == true then
@ -845,7 +834,7 @@ function ENT:CalcRPM()
end
end
end
--#######################################
-- Then we calc a smoothed RPM value for the sound effects
table.remove( self.RPM, 10 )
table.insert( self.RPM, 1, self.FlyRPM )
@ -926,7 +915,6 @@ function ENT:Link( Target )
return self:LinkRadiator( Target )
end
-- Gearbox linking
-- Check if target is already linked
for Key, Link in pairs( self.GearLink ) do
if Link.Ent == Target then
@ -1026,7 +1014,7 @@ function ENT:LinkFuel( Target )
table.insert( self.FuelLink, Target )
table.insert( Target.Master, self )
self.RequiresFuel = 1
self.RequiresFuel = true
self:UpdateOverlayText()
return true, "Link successful! Now Require Fuel"
@ -1037,7 +1025,7 @@ function ENT:UnlinkFuel( Target )
for Key, Value in pairs( self.FuelLink ) do
if Value == Target then
self.RequiresFuel = 0
self.RequiresFuel = false
self:UpdateOverlayText()
table.remove( self.FuelLink, Key )
return true, "Unlink successful! Now NOT Require Fuel"
@ -1047,7 +1035,6 @@ function ENT:UnlinkFuel( Target )
return false, "That fuel tank is not linked to this engine!"
end
--#####################################################
--LINKING EXTRA
function ENT:LinkExtra( Target )
@ -1064,7 +1051,7 @@ function ENT:LinkExtra( Target )
table.insert( self.ExtraLink, Target )
table.insert( Target.Master, self )
self:AddExtraValue( ) --Add Values
self:AddExtraValue() --Add Values
self.ExtraUsing = 1 --Set Using Extra to 1
return true, "Link successful!"
@ -1168,7 +1155,6 @@ function ENT:SetRadsInfos()
self:TriggerInput( "Active" , 0 )
end
end
--#####################################################
function ENT:PreEntityCopy()
@ -1256,7 +1242,7 @@ function ENT:PostEntityPaste( Player, Ent, CreatedEntities )
for _,ID in pairs(FuelLink.entities) do
local Linked = CreatedEntities[ ID ]
if IsValid( Linked ) then
self.RequiresFuel = 1
self.RequiresFuel = true
self:UpdateOverlayText()
self:Link( Linked )
end

View File

@ -30,29 +30,7 @@ if CLIENT then
end
function ACF_ModingEngine( )
--############
--loading
local Redcolor = 0
local Greencolor = 0
local Bluecolor = 0
if file.Exists("acf/menucolor.txt", "DATA") then
local MenuColor = file.Read("acf/menucolor.txt")
local MenuColorTable = {}
for w in string.gmatch(MenuColor, "([^,]+)") do
table.insert(MenuColorTable, w)
end
Redcolor = tonumber(MenuColorTable[1])
Greencolor = tonumber(MenuColorTable[2])
Bluecolor = tonumber(MenuColorTable[3])
local RedString = tostring(Redcolor)
local GreenString = tostring(Greencolor)
local BlueString = tostring(Bluecolor)
else
Redcolor = 0
Greencolor = 0
Bluecolor = 200
end
--First Load
--Set vars
local NameLoad = "No Name"
local SoundLoad = "No Sound"
local ModelLoad = "models/engines/inline4s.mdl"
@ -80,12 +58,13 @@ if CLIENT then
file.Write("acf/lastengine.txt", txt)
acfmenupanelcustom.CustomDisplay:PerformLayout()
end
--###########################################
--Start code
local wide = acfmenupanelcustom.CustomDisplay:GetWide()
Open = vgui.Create("DButton")
Open:SetText("Open Engine Menu")
Open:SetTextColor(Color(Redcolor,Greencolor,Bluecolor,255))
Open:SetTextColor(Color(ACFC.R,ACFC.G,ACFC.B,255))
Open:SetWide(wide)
Open:SetTall(30)
Open:SetVisible(true)
@ -124,6 +103,7 @@ if CLIENT then
Help:SetVisible(true)
Help:SetText("Help")
acfmenupanelcustom.CustomDisplay:AddItem(Help)
--Reload Last Engine
if file.Exists("acf/lastengine.txt", "DATA") then
local LastEngineText = file.Read("acf/lastengine.txt")
@ -162,7 +142,7 @@ if CLIENT then
RunConsoleCommand( "acfcustom_data13", IselectText )
RunConsoleCommand( "acfcustom_data14", IsTransText )
RunConsoleCommand( "acfcustom_data15", FlywheelOverNumber )
--###
acfmenupanelcustom:CPanelText("EngName", "Engine Name : "..NameLoad)
acfmenupanelcustom:CPanelText("EngSound", "Sound : "..SoundLoad)
acfmenupanelcustom:CPanelText("EngModel", "Model : "..ModelLoad)
@ -183,7 +163,6 @@ if CLIENT then
end
return
end
--###################################################
@ -201,11 +180,11 @@ function ENT:Initialize()
self.LastCheck = 0
self.LastThink = 0
self.MassRatio = 1
self.FuelTank = 1
self.Legal = true
self.CanUpdate = true
self.RequiresFuel = 0
self.RequiresFuel = false
--####################
self.CutMode = 0
self.CutRpm = 0
self.Fuelusing = 0
@ -216,7 +195,7 @@ function ENT:Initialize()
self.RPMExtra = 0
self.ExtraUsing = 0
self.PeakTorqueHealth = 0
--#####################
self.Outputs = WireLib.CreateSpecialOutputs( self, { "RPM", "Torque", "Power", "Fuel Use", "Entity", "Mass", "Physical Mass" }, { "NORMAL","NORMAL","NORMAL", "NORMAL", "ENTITY", "NORMAL", "NORMAL" } )
Wire_TriggerOutput( self, "Entity", self )
end
@ -229,104 +208,104 @@ function MakeACF_EngineMaker(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4,
if not Owner:CheckLimit("_acf_maker") then return false end
local EngineMaker = ents.Create( "acf_enginemaker" )
if not IsValid( EngineMaker ) then return false end
local Engine = ents.Create( "acf_enginemaker" )
if not IsValid( Engine ) then return false end
local EID
local List = list.Get("ACFCUSTOMEnts")
if List["MobilityCustom"][Id] then EID = Id else EID = "Maker" end
local Lookup = List.MobilityCustom[EID]
EngineMaker:SetAngles(Angle)
EngineMaker:SetPos(Pos)
EngineMaker:Spawn()
EngineMaker:SetPlayer(Owner)
EngineMaker.Owner = Owner
EngineMaker.Id = EID
Engine:SetAngles(Angle)
Engine:SetPos(Pos)
Engine:Spawn()
Engine:SetPlayer(Owner)
Engine.Owner = Owner
Engine.Id = EID
EngineMaker.elecpower = Lookup.elecpower
EngineMaker.SoundPitch = Lookup.pitch or 1
EngineMaker.SpecialHealth = true
EngineMaker.SpecialDamage = true
EngineMaker.TorqueMult = 1
Engine.elecpower = Lookup.elecpower
Engine.SoundPitch = Lookup.pitch or 1
Engine.SpecialHealth = true
Engine.SpecialDamage = true
Engine.TorqueMult = 1
EngineMaker.ModTable = Lookup.modtable
EngineMaker.ModTable[1] = Data1
EngineMaker.ModTable[2] = Data2
EngineMaker.ModTable[3] = Data3
EngineMaker.ModTable[4] = Data4
EngineMaker.ModTable[5] = Data5
EngineMaker.ModTable[6] = Data6
EngineMaker.ModTable[7] = Data7
EngineMaker.ModTable[8] = Data8
EngineMaker.ModTable[9] = Data9
EngineMaker.ModTable[10] = Data10
EngineMaker.ModTable[11] = Data11
EngineMaker.ModTable[12] = Data12
EngineMaker.ModTable[13] = Data13
EngineMaker.ModTable[14] = Data14
EngineMaker.ModTable[15] = Data15
Engine.ModTable = Lookup.modtable
Engine.ModTable[1] = Data1
Engine.ModTable[2] = Data2
Engine.ModTable[3] = Data3
Engine.ModTable[4] = Data4
Engine.ModTable[5] = Data5
Engine.ModTable[6] = Data6
Engine.ModTable[7] = Data7
Engine.ModTable[8] = Data8
Engine.ModTable[9] = Data9
Engine.ModTable[10] = Data10
Engine.ModTable[11] = Data11
Engine.ModTable[12] = Data12
Engine.ModTable[13] = Data13
Engine.ModTable[14] = Data14
Engine.ModTable[15] = Data15
EngineMaker.Mod1 = Data1
EngineMaker.Mod2 = Data2
EngineMaker.Mod3 = Data3
EngineMaker.Mod4 = Data4
EngineMaker.Mod5 = Data5
EngineMaker.Mod6 = Data6
EngineMaker.Mod7 = Data7
EngineMaker.Mod8 = Data8
EngineMaker.Mod9 = Data9
EngineMaker.Mod10 = Data10
EngineMaker.Mod11 = Data11
EngineMaker.Mod12 = Data12
EngineMaker.Mod13 = Data13
EngineMaker.Mod14 = Data14
EngineMaker.Mod15 = Data15
Engine.Mod1 = Data1
Engine.Mod2 = Data2
Engine.Mod3 = Data3
Engine.Mod4 = Data4
Engine.Mod5 = Data5
Engine.Mod6 = Data6
Engine.Mod7 = Data7
Engine.Mod8 = Data8
Engine.Mod9 = Data9
Engine.Mod10 = Data10
Engine.Mod11 = Data11
Engine.Mod12 = Data12
Engine.Mod13 = Data13
Engine.Mod14 = Data14
Engine.Mod15 = Data15
--Set Strings Values
if tostring(EngineMaker.Mod1) != nil then EngineMaker.EngineName = tostring(EngineMaker.Mod1) else EngineMaker.EngineName = "No Name" end
if tostring(EngineMaker.Mod2) != nil then EngineMaker.SoundPath = tostring(EngineMaker.Mod2) else EngineMaker.SoundPath = "" end
if string.find(tostring(EngineMaker.Mod3),".mdl") then EngineMaker.Model = tostring(EngineMaker.Mod3) else EngineMaker.Model = "models/engines/inline4s.mdl" end
if tostring(EngineMaker.Mod4) != nil then EngineMaker.FuelType = tostring(EngineMaker.Mod4) else EngineMaker.FuelType = "Petrol" end
if tostring(EngineMaker.Mod5) != nil then EngineMaker.EngineType = tostring(EngineMaker.Mod5) else EngineMaker.EngineType = "GenericPetrol" end
if tostring(Engine.Mod1) != nil then Engine.EngineName = tostring(Engine.Mod1) else Engine.EngineName = "No Name" end
if tostring(Engine.Mod2) != nil then Engine.SoundPath = tostring(Engine.Mod2) else Engine.SoundPath = "" end
if string.find(tostring(Engine.Mod3),".mdl") then Engine.Model = tostring(Engine.Mod3) else Engine.Model = "models/engines/inline4s.mdl" end
if tostring(Engine.Mod4) != nil then Engine.FuelType = tostring(Engine.Mod4) else Engine.FuelType = "Petrol" end
if tostring(Engine.Mod5) != nil then Engine.EngineType = tostring(Engine.Mod5) else Engine.EngineType = "GenericPetrol" end
--Set Torque
if(tonumber(EngineMaker.Mod6) >= 1) then EngineMaker.PeakTorque = tonumber(EngineMaker.Mod6)
elseif(tonumber(Data6) < 1 or tonumber(Data6) == nil) then EngineMaker.PeakTorque = 1 end
if(tonumber(Engine.Mod6) >= 1) then Engine.PeakTorque = tonumber(Engine.Mod6)
elseif(tonumber(Data6) < 1 or tonumber(Data6) == nil) then Engine.PeakTorque = 1 end
--Set Idle
if(tonumber(EngineMaker.Mod7) >= 1) then EngineMaker.IdleRPM = tonumber(EngineMaker.Mod7)
elseif(tonumber(EngineMaker.Mod7) < 1 or tonumber(EngineMaker.Mod7) == nil) then EngineMaker.IdleRPM = 1 end
if(tonumber(Engine.Mod7) >= 1) then Engine.IdleRPM = tonumber(Engine.Mod7)
elseif(tonumber(Engine.Mod7) < 1 or tonumber(Engine.Mod7) == nil) then Engine.IdleRPM = 1 end
--Set PeakMin
if(tonumber(EngineMaker.Mod8) >= 1) then EngineMaker.PeakMinRPM = tonumber(EngineMaker.Mod8)
elseif(tonumber(EngineMaker.Mod8) < 1 or tonumber(EngineMaker.Mod8) == nil) then EngineMaker.PeakMinRPM = 1 end
if(tonumber(Engine.Mod8) >= 1) then Engine.PeakMinRPM = tonumber(Engine.Mod8)
elseif(tonumber(Engine.Mod8) < 1 or tonumber(Engine.Mod8) == nil) then Engine.PeakMinRPM = 1 end
--Set PeakMax
if(EngineMaker.Mod9 <= EngineMaker.Mod10 and tonumber(EngineMaker.Mod9) >= 1 ) then EngineMaker.PeakMaxRPM = tonumber(EngineMaker.Mod9)
elseif(EngineMaker.Mod9 > EngineMaker.Mod10 ) then EngineMaker.PeakMaxRPM = tonumber(EngineMaker.Mod10)
elseif(tonumber(EngineMaker.Mod9) < 1 or tonumber(EngineMaker.Mod9) == nil) then EngineMaker.PeakMaxRPM = 1 end
if(Engine.Mod9 <= Engine.Mod10 and tonumber(Engine.Mod9) >= 1 ) then Engine.PeakMaxRPM = tonumber(Engine.Mod9)
elseif(Engine.Mod9 > Engine.Mod10 ) then Engine.PeakMaxRPM = tonumber(Engine.Mod10)
elseif(tonumber(Engine.Mod9) < 1 or tonumber(Engine.Mod9) == nil) then Engine.PeakMaxRPM = 1 end
--Set Limit
if(tonumber(EngineMaker.Mod10) >= 100) then EngineMaker.LimitRPM = tonumber(EngineMaker.Mod10)
elseif(tonumber(EngineMaker.Mod10) < 100 or tonumber(EngineMaker.Mod10) == nil) then EngineMaker.LimitRPM = 100 end
if(tonumber(Engine.Mod10) >= 100) then Engine.LimitRPM = tonumber(Engine.Mod10)
elseif(tonumber(Engine.Mod10) < 100 or tonumber(Engine.Mod10) == nil) then Engine.LimitRPM = 100 end
--Set Flywheel
if(tonumber(EngineMaker.Mod11) >= 0.001) then EngineMaker.FlywheelMassValue = tonumber(EngineMaker.Mod11)
elseif(tonumber(EngineMaker.Mod11) < 0.001 or tonumber(EngineMaker.Mod11) == nil) then EngineMaker.FlywheelMassValue = 0.001 end
if(tonumber(Engine.Mod11) >= 0.001) then Engine.FlywheelMassValue = tonumber(Engine.Mod11)
elseif(tonumber(Engine.Mod11) < 0.001 or tonumber(Engine.Mod11) == nil) then Engine.FlywheelMassValue = 0.001 end
--Set Weight
if(tonumber(EngineMaker.Mod12) >= 1) then EngineMaker.Weight = tonumber(EngineMaker.Mod12)
elseif(tonumber(EngineMaker.Mod12) < 1 or tonumber(EngineMaker.Mod12) == nil ) then EngineMaker.Weight = 1 end
if(tonumber(Engine.Mod12) >= 1) then Engine.Weight = tonumber(Engine.Mod12)
elseif(tonumber(Engine.Mod12) < 1 or tonumber(Engine.Mod12) == nil ) then Engine.Weight = 1 end
--Set Electric/turbine stuff
if tobool(EngineMaker.Mod13) != nil then EngineMaker.iselec = tobool(EngineMaker.Mod13) else EngineMaker.iselec = false end
if tobool(EngineMaker.Mod14) != nil then EngineMaker.IsTrans = tobool(EngineMaker.Mod14) else EngineMaker.IsTrans = false end
if tonumber(EngineMaker.Mod15) != nil then EngineMaker.FlywheelOverride = tonumber(EngineMaker.Mod15) else EngineMaker.FlywheelOverride = 1200 end
if tobool(Engine.Mod13) != nil then Engine.iselec = tobool(Engine.Mod13) else Engine.iselec = false end
if tobool(Engine.Mod14) != nil then Engine.IsTrans = tobool(Engine.Mod14) else Engine.IsTrans = false end
if tonumber(Engine.Mod15) != nil then Engine.FlywheelOverride = tonumber(Engine.Mod15) else Engine.FlywheelOverride = 1200 end
--Set Original Values
EngineMaker.PeakTorqueHeld = EngineMaker.PeakTorque
EngineMaker.CutValue = EngineMaker.LimitRPM / 20
EngineMaker.CutRpm = EngineMaker.LimitRPM - 100
EngineMaker.Inertia = EngineMaker.FlywheelMassValue*(3.1416)^2
Engine.PeakTorqueHeld = Engine.PeakTorque
Engine.CutValue = Engine.LimitRPM / 20
Engine.CutRpm = Engine.LimitRPM - 100
Engine.Inertia = Engine.FlywheelMassValue*(3.1416)^2
--Set Custom Values
EngineMaker:FirstLoadCustom()
Engine:FirstLoadCustom()
--Creating Wire Inputs
EngineMaker.CustomLimit = GetConVarNumber("sbox_max_acf_modding")
Engine.CustomLimit = GetConVarNumber("sbox_max_acf_modding")
local Inputs = {"Active", "Throttle"}
if EngineMaker.CustomLimit > 0 then
if EngineMaker.EngineType == "Turbine" or EngineMaker.EngineType == "Electric" then --Create inputs for Electric&Turbine
if Engine.CustomLimit > 0 then
if Engine.EngineType == "Turbine" or Engine.EngineType == "Electric" then --Create inputs for Electric&Turbine
table.insert(Inputs, "TqAdd")
table.insert(Inputs, "LimitRpmAdd")
table.insert(Inputs, "FlywheelMass")
@ -340,56 +319,56 @@ function MakeACF_EngineMaker(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4,
table.insert(Inputs, "Disable Cutoff")
end
end
EngineMaker.Inputs = Wire_CreateInputs( EngineMaker, Inputs )
---------------------
if EngineMaker.EngineType == "GenericDiesel" then
EngineMaker.TorqueScale = ACF.DieselTorqueScale
Engine.Inputs = Wire_CreateInputs( Engine, Inputs )
if Engine.EngineType == "GenericDiesel" then
Engine.TorqueScale = ACF.DieselTorqueScale
else
EngineMaker.TorqueScale = ACF.TorqueScale
Engine.TorqueScale = ACF.TorqueScale
end
--calculate boosted peak kw
if EngineMaker.EngineType == "Turbine" or EngineMaker.EngineType == "Electric" then
EngineMaker.DisableCut = 1
EngineMaker.peakkw = EngineMaker.PeakTorque * EngineMaker.LimitRPM / (4 * 9548.8)
EngineMaker.PeakKwRPM = math.floor(EngineMaker.LimitRPM / 2)
if Engine.EngineType == "Turbine" or Engine.EngineType == "Electric" then
Engine.DisableCut = 1
Engine.peakkw = Engine.PeakTorque * Engine.LimitRPM / (4 * 9548.8)
Engine.PeakKwRPM = math.floor(Engine.LimitRPM / 2)
else
EngineMaker.peakkw = EngineMaker.PeakTorque * EngineMaker.PeakMaxRPM / 9548.8
EngineMaker.PeakKwRPM = EngineMaker.PeakMaxRPM
Engine.peakkw = Engine.PeakTorque * Engine.PeakMaxRPM / 9548.8
Engine.PeakKwRPM = Engine.PeakMaxRPM
end
--calculate base fuel usage
if EngineMaker.EngineType == "Electric" then
EngineMaker.FuelUse = ACF.ElecRate / (ACF.Efficiency[EngineMaker.EngineType] * 60 * 60) --elecs use current power output, not max
if Engine.EngineType == "Electric" then
Engine.FuelUse = ACF.ElecRate / (ACF.Efficiency[Engine.EngineType] * 60 * 60) --elecs use current power output, not max
else
EngineMaker.FuelUse = ACF.TorqueBoost * ACF.FuelRate * ACF.Efficiency[EngineMaker.EngineType] * EngineMaker.peakkw / (60 * 60)
Engine.FuelUse = ACF.TorqueBoost * ACF.FuelRate * ACF.Efficiency[Engine.EngineType] * Engine.peakkw / (60 * 60)
end
EngineMaker.FlyRPM = 0
EngineMaker:SetModel( EngineMaker.Model )
EngineMaker.Sound = nil
EngineMaker.RPM = {}
Engine.FlyRPM = 0
Engine:SetModel( Engine.Model )
Engine.Sound = nil
Engine.RPM = {}
EngineMaker:PhysicsInit( SOLID_VPHYSICS )
EngineMaker:SetMoveType( MOVETYPE_VPHYSICS )
EngineMaker:SetSolid( SOLID_VPHYSICS )
Engine:PhysicsInit( SOLID_VPHYSICS )
Engine:SetMoveType( MOVETYPE_VPHYSICS )
Engine:SetSolid( SOLID_VPHYSICS )
EngineMaker.Out = EngineMaker:WorldToLocal(EngineMaker:GetAttachment(EngineMaker:LookupAttachment( "driveshaft" )).Pos)
Engine.Out = Engine:WorldToLocal(Engine:GetAttachment(Engine:LookupAttachment( "driveshaft" )).Pos)
local phys = EngineMaker:GetPhysicsObject()
local phys = Engine:GetPhysicsObject()
if IsValid( phys ) then
phys:SetMass( EngineMaker.Weight )
phys:SetMass( Engine.Weight )
end
EngineMaker:SetNetworkedString( "WireName", EngineMaker.EngineName )
Engine:SetNWString( "WireName", Lookup.name )
------ GUI ---------
EngineMaker.FlywheelMassGUI = EngineMaker.FlywheelMassValue
EngineMaker:UpdateOverlayText()
Engine.FlywheelMassGUI = Engine.FlywheelMassValue
Engine:UpdateOverlayText()
Owner:AddCount("_acf_enginemaker", EngineMaker)
Owner:AddCleanup( "acfmenu", EngineMaker )
Owner:AddCount("_acf_enginemaker", Engine)
Owner:AddCleanup( "acfmenu", Engine )
ACF_Activate( EngineMaker, 0 )
ACF_Activate( Engine, 0 )
return EngineMaker
return Engine
end
list.Set( "ACFCvars", "acf_enginemaker", {"id", "data1", "data2", "data3", "data4", "data5", "data6", "data7", "data8", "data9", "data10", "data11", "data12", "data13", "data14", "data15"} )
duplicator.RegisterEntityClass("acf_enginemaker", MakeACF_EngineMaker, "Pos", "Angle", "Id", "Mod1", "Mod2", "Mod3", "Mod4", "Mod5", "Mod6", "Mod7", "Mod8", "Mod9", "Mod10", "Mod11", "Mod12", "Mod13")
@ -554,7 +533,7 @@ function ENT:Update( ArgsTable ) --That table is the player data, as sorted in t
phys:SetMass( self.Weight )
end
self:SetNetworkedString( "WireName", self.EngineName )
self:SetNWString( "WireName", self.EngineName )
------ GUI ---------
self.FlywheelMassGUI = self.FlywheelMassValue
self:UpdateOverlayText()
@ -581,32 +560,26 @@ function ENT:FirstLoadCustom( )
end
function ENT:UpdateOverlayText()
if self.RequiresFuel == 1 then
self.PowerGUI = self.peakkw*ACF.TorqueBoost
self.TorqueGUI = (self.PeakTorqueAdd+self.PeakTorqueExtra-self.PeakTorqueHealth)*ACF.TorqueBoost
else
self.PowerGUI = self.peakkw
self.TorqueGUI = (self.PeakTorqueAdd+self.PeakTorqueExtra-self.PeakTorqueHealth)
end
local SpecialBoost = self.RequiresFuel and ACF.TorqueBoost or 1
self.PowerGUI = self.peakkw*SpecialBoost
self.TorqueGUI = (self.PeakTorqueAdd+self.PeakTorqueExtra-self.PeakTorqueHealth)*SpecialBoost
self.FuelusingGUI = self.Fuelusing
self.FlyRPMGUI = self.FlyRPM
local text = "Power: " .. math.Round(self.PowerGUI) .. " kW / " .. math.Round(self.PowerGUI * 1.34) .. " hp\n"
text = text .. "Torque: " .. math.Round(self.TorqueGUI) .. " Nm / " .. math.Round(self.TorqueGUI * 0.73) .. " ft-lb\n"
if self.EngineType == "Turbine" or self.EngineType == "Electric" then --Set Gui on electric&turbine
if self.EngineType == "Turbine" or self.EngineType == "Electric" then
text = text .. "Override: " .. math.Round(self.FlywheelOverride) .. " RPM\n"
text = text .. "Redline: " .. math.Round((self.LimitRPM+self.RPMExtra)) .. " RPM\n"
text = text .. "FlywheelMass: " .. math.Round(self.FlywheelMassGUI,3) .. " Kg\n"
text = text .. "Rpm: " .. math.Round(self.FlyRPM) .. " RPM\n"
if self.RequiresFuel == 1 then text = text .. "Consumption: " .. math.Round(self.Fuelusing,3) .. " liters/min\n" end
text = text .. "Weight: " .. math.Round(self.Weight) .. "Kg"
else --Set Gui on Others
else
text = text .. "Powerband: " .. math.Round(self.PeakMinRPM) .. " - " .. math.Round((self.PeakMaxRPM+self.RPMExtra)) .. " RPM\n"
text = text .. "Redline: " .. math.Round((self.LimitRPM+self.RPMExtra)) .. " RPM\n"
text = text .. "FlywheelMass: " .. math.Round(self.FlywheelMassGUI,3) .. " Kg\n"
text = text .. "Rpm: " .. math.Round(self.FlyRPM) .. " RPM\n"
if self.RequiresFuel == 1 then text = text .. "Consumption: " .. math.Round(self.Fuelusing,3) .. " liters/min\n" end
text = text .. "Idle: " .. math.Round(self.IdleRPM) .. " RPM\n"
text = text .. "Weight: " .. math.Round(self.Weight) .. "Kg"
end
text = text .. "Redline: " .. math.Round((self.LimitRPM+self.RPMExtra)) .. " RPM\n"
text = text .. "FlywheelMass: " .. math.Round(self.FlywheelMassGUI,3) .. " Kg\n"
text = text .. "Rpm: " .. math.Round(self.FlyRPM) .. " RPM\n"
if self.RequiresFuel then text = text .. "Consumption: " .. math.Round(self.FuelusingGUI,3) .. " liters/min\n" end
text = text .. "Weight: " .. math.Round(self.Weight) .. "Kg"
self:SetOverlayText( text )
end
@ -637,7 +610,7 @@ function ENT:TriggerInput( iname, value )
if (value > 0 and not self.Active) then
--make sure we have fuel
local HasFuel
if self.RequiresFuel == 0 then
if not self.RequiresFuel then
HasFuel = true
else
for _,fueltank in pairs(self.FuelLink) do
@ -656,7 +629,7 @@ function ENT:TriggerInput( iname, value )
end
elseif (value > 0) then
local HasFuel
if self.RequiresFuel == 0 then
if not self.RequiresFuel then
HasFuel = true
else
for _,fueltank in pairs(self.FuelLink) do
@ -678,64 +651,55 @@ function ENT:TriggerInput( iname, value )
Wire_TriggerOutput( self, "Power", 0 )
Wire_TriggerOutput( self, "Fuel Use", 0 )
end
--##########################################
elseif (iname == "TqAdd") then
if (value ~= 0 ) then
if (self.PeakTorqueAdd != self.PeakTorqueNormal+value) then
self.PeakTorqueAdd = self.PeakTorqueNormal+value
self:UpdateEngineConsumption()
elseif (value == 0 ) then
self.PeakTorqueAdd = self.PeakTorqueNormal
self:UpdateEngineConsumption()
end
elseif (iname == "RpmAdd") then
if (value ~= 0 ) then
if (self.PeakMaxRPM != self.PeakMaxRPMNormal+value) then
self.PeakMaxRPM = self.PeakMaxRPMNormal+value
self.LimitRPM = self.LimitRPMNormal+value
self.CutValue = self.LimitRPM / 20
self.CutRpm = self.LimitRPM - 100
self:UpdateEngineConsumption()
elseif (value == 0 ) then
self.PeakMaxRPM = self.PeakMaxRPMNormal
self.LimitRPM = self.LimitRPMNormal
self.CutValue = self.LimitRPM / 20
self.CutRpm = self.LimitRPM - 100
self:UpdateEngineConsumption()
end
elseif (iname == "FlywheelMass") then
if (value > 0 ) then
if (value > 0 and self.FlywheelMassValue != value) then
self.FlywheelMassValue = value
self.FlywheelMassGUI = self.FlywheelMassValue
self:UpdateOverlayText()
elseif (value <= 0 ) then
elseif (value <= 0 and self.FlywheelMassValue != self.FlywheelMassNormal) then
self.FlywheelMassValue = self.FlywheelMassNormal
self.FlywheelMassGUI = self.FlywheelMassValue
self:UpdateOverlayText()
end
elseif (iname == "Override") then
if (value > 0 ) then
if (value > 0 and self.FlywheelOverride != value) then
self.FlywheelOverride = value
self:UpdateOverlayText()
elseif (value <= 0 ) then
elseif (value <= 0 and self.FlywheelOverride != self.FlywheelOverrideNormal) then
self.FlywheelOverride = self.FlywheelOverrideNormal
self:UpdateOverlayText()
end
elseif (iname == "Idle") then
if (value > 0 ) then
if (value > 0 and self.IdleRPM != value) then
self.IdleRPM = value
self:UpdateOverlayText()
elseif (value <= 0 ) then
elseif (value <= 0 and self.IdleRPM != self.IdleRPMNormal) then
self.IdleRPM = self.IdleRPMNormal
self:UpdateOverlayText()
end
elseif (iname == "Disable Cutoff") then
if (value > 0 ) then
if (value > 0 and self.DisableCut != 1) then
self.DisableCut = 1
elseif (value <= 0 ) then
elseif (value <= 0 and self.DisableCut != 0) then
self.DisableCut = 0
end
end
end
--#########################
function ENT:ACF_Activate()
--Density of steel = 7.8g cm3 so 7.8kg for a 1mx1m plate 1m thick
local Entity = self
@ -779,6 +743,9 @@ function ENT:ACF_Activate()
if self.EngineType == "GenericDiesel" then
Entity.ACF.Health = Health * Percent * ACF.DieselEngineHPMult
Entity.ACF.MaxHealth = Health * ACF.DieselEngineHPMult
elseif self.EngineType == "Electric" then
Entity.ACF.Health = Health * Percent * ACF.ElectricEngineHPMult
Entity.ACF.MaxHealth = Health * ACF.ElectricEngineHPMult
else
Entity.ACF.Health = Health * Percent * ACF.EngineHPMult
Entity.ACF.MaxHealth = Health * ACF.EngineHPMult
@ -795,7 +762,7 @@ end
function ENT:ACF_OnDamage( Entity, Energy, FrAera, Angle, Inflictor, Bone, Type ) --This function needs to return HitRes
local Mul = ((Type == "HEAT" and 6.6) or 1) --Heat penetrators deal bonus damage to engines, roughly half an AP round
local Mul = ((Type == "HEAT" and ACF.HEATMulEngine) or 1) --Heat penetrators deal bonus damage to engines
local HitRes = ACF_PropDamage( Entity, Energy, FrAera * Mul, Angle, Inflictor ) --Calling the standard damage prop function
return HitRes --This function needs to return HitRes
@ -914,15 +881,20 @@ function ENT:CalcRPM()
local DeltaTime = CurTime() - self.LastThink
--find first active tank with fuel
--find next active tank with fuel
local Tank = nil
local boost = 1
for _,fueltank in pairs(self.FuelLink) do
if fueltank.Fuel > 0 and fueltank.Active then Tank = fueltank break end
if fueltank.Fuel <= 0 or not fueltank.Active then Tank = false break end
end
if (not Tank) and self.RequiresFuel == 1 then --make sure we've got a tank with fuel if needed
self:TriggerInput( "Active" , 0 )
local i = 0
local MaxTanks = #self.FuelLink
while i <= MaxTanks and not (Tank and Tank:IsValid() and Tank.Fuel > 0) do
self.FuelTank = self.FuelTank % MaxTanks + 1
Tank = self.FuelLink[self.FuelTank]
if Tank and Tank:IsValid() and Tank.Fuel > 0 and Tank.Active then
break --return Tank
end
Tank = nil
i = i + 1
end
--calculate fuel usage
@ -938,18 +910,13 @@ function ENT:CalcRPM()
boost = ACF.TorqueBoost
Wire_TriggerOutput(self, "Fuel Use", math.Round(60*Consumption/DeltaTime,3))
self.Fuelusing = math.Round((60*Consumption/DeltaTime),3)
elseif self.RequiresFuel then
self:TriggerInput( "Active", 0 ) --shut off if no fuel and requires it
return 0
else
Wire_TriggerOutput(self, "Fuel Use", 0)
end
--Function Calling
self:UpdateOverlayText() --Update GUI
for Key, Extra in pairs(self.ExtraLink) do --Update Power with Extra Link
if IsValid( Extra ) then
self:AddExtraValue( )
end
end
--adjusting performance based on damage
self.TorqueMult = math.Clamp(((1 - self.TorqueScale) / (0.5)) * ((self.ACF.Health/self.ACF.MaxHealth) - 1) + 1, self.TorqueScale, 1)
self.PeakTorque = (self.PeakTorqueAdd+self.PeakTorqueExtra-self.PeakTorqueHealth) * self.TorqueMult
@ -981,14 +948,11 @@ function ENT:CalcRPM()
end
end
-- Let's accelerate the flywheel based on that torque
self.FlyRPM = math.max( self.FlyRPM + self.Torque / self.Inertia - Drag, 1 )
-- This is the presently avaliable torque from the engine
TorqueDiff = math.max( self.FlyRPM - self.IdleRPM, 0 ) * self.Inertia
end
if( self.Active == false ) then
-- Let's accelerate the flywheel based on that torque
self.FlyRPM = math.max( self.FlyRPM + self.Torque / self.Inertia - Drag, 1 )
-- This is the presently avaliable torque from the engine
TorqueDiff = math.max( self.FlyRPM - self.IdleRPM, 0 ) * self.Inertia
else
self.Torque = boost * 0 * math.max( self.PeakTorque * math.min( self.FlyRPM / self.PeakMinRPM , ((self.LimitRPM+self.RPMExtra) - self.FlyRPM) / ((self.LimitRPM+self.RPMExtra) - (self.PeakMaxRPM+self.RPMExtra)), 1 ), 0 )
if self.iselec == true then
Drag = self.PeakTorque * (math.max( self.FlyRPM - 0, 0) / self.FlywheelOverride) * (1 - 0) / self.Inertia
@ -996,13 +960,12 @@ function ENT:CalcRPM()
Drag = self.PeakTorque * (math.max( self.FlyRPM - 0, 0) / (self.PeakMaxRPM+self.RPMExtra)) * ( 1 - 0) / self.Inertia
end
-- Let's accelerate the flywheel based on that torque
self.FlyRPM = math.max( self.FlyRPM + self.Torque / self.Inertia - Drag, 1 )
-- This is the presently avaliable torque from the engine
TorqueDiff = 0
-- Let's accelerate the flywheel based on that torque
self.FlyRPM = math.max( self.FlyRPM + self.Torque / self.Inertia - Drag, 1 )
-- This is the presently avaliable torque from the engine
TorqueDiff = 0
end
--##############
-- The gearboxes don't think on their own, it's the engine that calls them, to ensure consistent execution order
local Boxes = table.Count( self.GearLink )
local TotalReqTq = 0
@ -1018,11 +981,11 @@ function ENT:CalcRPM()
-- Split the torque fairly between the gearboxes who need it
for Key, Link in pairs( self.GearLink ) do
if not Link.Ent.Legal then continue end
Link.Ent:Act( Link.ReqTq * AvailRatio * self.MassRatio, DeltaTime )
Link.Ent:Act( Link.ReqTq * AvailRatio * self.MassRatio, DeltaTime, self.MassRatio )
end
self.FlyRPM = self.FlyRPM - math.min( TorqueDiff, TotalReqTq ) / self.Inertia
--#######################################
if( self.DisableCut == 0 ) then
if( self.FlyRPM >= self.CutRpm and self.CutMode == 0 ) then
self.CutMode = 1
@ -1055,9 +1018,16 @@ function ENT:CalcRPM()
self:UpdateOverlayText()
end
--SET VALUES FOR EXTRA
--Update Gui
if self.FuelusingGUI != self.Fuelusing or self.FlyRPMGUI != self.FlyRPM then
self:UpdateOverlayText()
end
--Update extras values
for Key, Extra in pairs(self.ExtraLink) do
if IsValid( Extra ) then
if IsValid(Extra) then
if self.PeakTorqueExtra != (Extra.TorqueAdd or 0) or self.RPMExtra != (Extra.RPMAdd or 0) then
self:AddExtraValue()
end
if Extra.GetRpm == true then
if not Extra.Legal then continue end
local PeakTorqueSend = (self.PeakTorqueAdd-self.PeakTorqueHealth)*self.TorqueMult
@ -1065,7 +1035,7 @@ function ENT:CalcRPM()
end
end
end
--SET VALUES FOR RADIATORS
--Update radiator values
for Key, Radiator in pairs(self.RadiatorLink) do
if IsValid( Radiator ) then
if Radiator.GetRpm == true then
@ -1074,7 +1044,7 @@ function ENT:CalcRPM()
end
end
end
--#######################################
-- Then we calc a smoothed RPM value for the sound effects
table.remove( self.RPM, 10 )
table.insert( self.RPM, 1, self.FlyRPM )
@ -1155,7 +1125,6 @@ function ENT:Link( Target )
return self:LinkRadiator( Target )
end
-- Gearbox linking
-- Check if target is already linked
for Key, Link in pairs( self.GearLink ) do
if Link.Ent == Target then
@ -1255,7 +1224,7 @@ function ENT:LinkFuel( Target )
table.insert( self.FuelLink, Target )
table.insert( Target.Master, self )
self.RequiresFuel = 1
self.RequiresFuel = true
self:UpdateOverlayText()
return true, "Link successful! Now Require Fuel"
@ -1266,7 +1235,7 @@ function ENT:UnlinkFuel( Target )
for Key, Value in pairs( self.FuelLink ) do
if Value == Target then
self.RequiresFuel = 0
self.RequiresFuel = false
self:UpdateOverlayText()
table.remove( self.FuelLink, Key )
return true, "Unlink successful! Now NOT Require Fuel"
@ -1276,7 +1245,6 @@ function ENT:UnlinkFuel( Target )
return false, "That fuel tank is not linked to this engine!"
end
--#####################################################
--LINKING EXTRA
function ENT:LinkExtra( Target )
@ -1397,7 +1365,6 @@ function ENT:SetRadsInfos()
self:TriggerInput( "Active" , 0 )
end
end
--#####################################################
function ENT:PreEntityCopy()
@ -1485,7 +1452,7 @@ function ENT:PostEntityPaste( Player, Ent, CreatedEntities )
for _,ID in pairs(FuelLink.entities) do
local Linked = CreatedEntities[ ID ]
if IsValid( Linked ) then
self.RequiresFuel = 1
self.RequiresFuel = true
self:UpdateOverlayText()
self:Link( Linked )
end

View File

@ -6,6 +6,7 @@ ENT.PrintName = "ACF Gearbox AIR"
ENT.WireDebugName = "ACF Gearbox AIR"
if CLIENT then
function ACFGearboxAirGUICreate( Table )
acfmenupanelcustom:CPanelText("Name", Table.name)
@ -44,7 +45,7 @@ function ENT:Initialize()
self.LBrake = 0
self.RBrake = 0
self.GearRatio = 1 --set to 1 because its not cutting other gearbox ratio's
self.GearRatio = 1
self.PropellerRpm = 0
self.LegalThink = 0
@ -103,7 +104,7 @@ function MakeACF_GearboxAIR(Owner, Pos, Angle, Id)
GearboxAIR:SetBodygroup(1, 0)
GearboxAIR:SetNetworkedString( "WireName", List.MobilityCustom[Id].name )
GearboxAIR:SetNWString( "WireName", List.MobilityCustom[Id].name )
GearboxAIR:UpdateOverlayText()
--GearboxAIR:SetModelScaling()
@ -140,7 +141,7 @@ function ENT:Update( ArgsTable )
self:SetBodygroup(1, 0)
self:SetNetworkedString( "WireName", List.MobilityCustom[Id].name )
self:SetNWString( "WireName", List.MobilityCustom[Id].name )
self:UpdateOverlayText()
return true, "AIR Gearbox updated successfully!"
@ -285,7 +286,7 @@ function ENT:Calc( InputRPM, InputInertia, GetRatio )
return math.min( self.TotalReqTq, self.MaxTorque )
end
function ENT:Act( Torque, DeltaTime )
function ENT:Act( Torque, DeltaTime, MassRatio )
local ReactTq = 0
-- Calculate the ratio of total requested torque versus what's avaliable, and then multiply it but the current gearratio
local AvailTq = 0
@ -307,7 +308,7 @@ function ENT:Act( Torque, DeltaTime )
local BoxPhys = self:GetPhysicsObject()
if IsValid( BoxPhys ) and ReactTq ~= 0 then
local Force = self:GetForward() * ReactTq - self:GetForward()
local Force = self:GetForward() * ReactTq * MassRatio - self:GetForward()
BoxPhys:ApplyForceOffset( Force * 39.37 * DeltaTime, self:GetPos() + self:GetUp() * -39.37 )
BoxPhys:ApplyForceOffset( Force * -39.37 * DeltaTime, self:GetPos() + self:GetUp() * 39.37 )
end

View File

@ -222,14 +222,6 @@ function ENT:Initialize()
self.RBrake = 0
self.SteerRate = 0
--########################
self.OnReverse = 0
self.Usable = 1
self.AllowChange = 0
self.ClutchMode = 0
self.ClutchModeUse = 0
--########################
self.GearRatio = 0
self.ChangeFinished = 0
@ -244,6 +236,12 @@ function ENT:Initialize()
self.LastActive = 0
self.Legal = true
self.OnReverse = 0
self.Usable = 1
self.AllowChange = 0
self.ClutchMode = 0
self.ClutchModeUse = 0
end
function MakeACF_GearboxAuto(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10)
@ -293,13 +291,11 @@ function MakeACF_GearboxAuto(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4,
GearboxAuto:SetModel( GearboxAuto.Model )
--############################
--Convert to number
GearboxAuto.DeclutchRpm = tonumber(GearboxAuto.Gear7)
GearboxAuto.RpmDown = tonumber(GearboxAuto.Gear8)
GearboxAuto.RpmUp = tonumber(GearboxAuto.Gear9)
GearboxAuto.ReverseGear = GearboxAuto.Gears
--############################
local Inputs = {"Reverse"}
if GearboxAuto.Dual then
@ -347,7 +343,7 @@ function MakeACF_GearboxAuto(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4,
GearboxAuto:SetBodygroup(1, 0)
end
GearboxAuto:SetNetworkedString( "WireName", List.MobilityCustom[Id].name )
GearboxAuto:SetNWString( "WireName", List.MobilityCustom[Id].name )
GearboxAuto:UpdateOverlayText()
return GearboxAuto
@ -425,13 +421,11 @@ function ENT:Update( ArgsTable )
self.Gear8 = ArgsTable[12]
self.Gear9 = ArgsTable[13]
--############################
--Convert to number
self.DeclutchRpm = tonumber(self.Gear7)
self.RpmDown = tonumber(self.Gear8)
self.RpmUp = tonumber(self.Gear9)
self.ReverseGear = self.Gears
--############################
self.Gear = 1
self:ChangeGear(1)
@ -442,7 +436,7 @@ function ENT:Update( ArgsTable )
self:SetBodygroup(1, 0)
end
self:SetNetworkedString( "WireName", List.MobilityCustom[Id].name )
self:SetNWString( "WireName", List.MobilityCustom[Id].name )
self:UpdateOverlayText()
return true, "GearboxAuto updated successfully!"
@ -595,7 +589,6 @@ function ENT:Calc( InputRPM, InputInertia )
self.RClutch = math.Clamp(1-0,0,1)*self.MaxTorque
end
end
--#################################################################################################
--increase
if self.OnReverse == 0 then
if InputRPM >= self.RpmUp then
@ -604,20 +597,20 @@ function ENT:Calc( InputRPM, InputInertia )
elseif self.Gear > self.Gears-1 then
self:ChangeGear(math.floor(self.Gears-1)) --not Allow reverse
end
--decrease
elseif InputRPM <= self.RpmDown then
--decrease
elseif InputRPM <= self.RpmDown then
if self.Gear > 1 then
self:ChangeGear(math.floor(self.Gear - 1))
elseif self.Gear < 1 then
self:ChangeGear(math.floor(1))
end
end
else --Reverse
--Reverse
else
if self.Gear != self.ReverseGear then
self:ChangeGear(math.floor(self.ReverseGear))
end
end
--####################################################################################################
for Key, Link in pairs( self.WheelLink ) do
if not IsValid( Link.Ent ) then
@ -653,7 +646,6 @@ function ENT:Calc( InputRPM, InputInertia )
end
return math.min( self.TotalReqTq, self.MaxTorque )
end
function ENT:CalcWheel( Link, SelfWorld )
@ -668,11 +660,9 @@ function ENT:CalcWheel( Link, SelfWorld )
-- Reported BaseRPM is in angle per second and in the wrong direction, so we convert and add the gearratio
return BaseRPM / self.GearRatio / -6
end
function ENT:Act( Torque, DeltaTime )
function ENT:Act( Torque, DeltaTime, MassRatio )
local ReactTq = 0
-- Calculate the ratio of total requested torque versus what's avaliable, and then multiply it but the current gearratio
local AvailTq = 0
@ -681,7 +671,6 @@ function ENT:Act( Torque, DeltaTime )
end
for Key, Link in pairs( self.WheelLink ) do
local Brake = 0
if Link.Side == 0 then
Brake = self.LBrake
@ -690,23 +679,21 @@ function ENT:Act( Torque, DeltaTime )
end
if Link.Ent.IsGeartrain then
Link.Ent:Act( Link.ReqTq * AvailTq, DeltaTime )
Link.Ent:Act( Link.ReqTq * AvailTq, DeltaTime, MassRatio )
else
self:ActWheel( Link, Link.ReqTq * AvailTq, Brake, DeltaTime )
ReactTq = ReactTq + Link.ReqTq * AvailTq
end
end
local BoxPhys = self:GetPhysicsObject()
if IsValid( BoxPhys ) and ReactTq ~= 0 then
local Force = self:GetForward() * ReactTq - self:GetForward()
local Force = self:GetForward() * ReactTq * MassRatio - self:GetForward()
BoxPhys:ApplyForceOffset( Force * 39.37 * DeltaTime, self:GetPos() + self:GetUp() * -39.37 )
BoxPhys:ApplyForceOffset( Force * -39.37 * DeltaTime, self:GetPos() + self:GetUp() * 39.37 )
end
self.LastActive = CurTime()
end
function ENT:ActWheel( Link, Torque, Brake, DeltaTime )

View File

@ -6,6 +6,7 @@ ENT.PrintName = "ACF Gearbox CVT"
ENT.WireDebugName = "ACF Gearbox CVT"
if CLIENT then
function ACFGearboxCVTGUICreate( Table )
if not acfmenupanelcustom.GearboxData then
@ -187,11 +188,6 @@ function ENT:Initialize()
self.WheelLink = {} -- a "Link" has these components: Ent, Side, Axis, Rope, RopeLen, Output, ReqTq, Vel
--################
self.CurrentRPM = 0
self.ClutchMode = 0
self.ClutchModeUse = 0
self.TotalReqTq = 0
self.RClutch = 0
self.LClutch = 0
@ -212,6 +208,10 @@ function ENT:Initialize()
self.LastActive = 0
self.Legal = true
self.CurrentRPM = 0
self.ClutchMode = 0
self.ClutchModeUse = 0
end
function MakeACF_GearboxCVT(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, Data5, Data6, Data7, Data8, Data9, Data10)
@ -311,7 +311,7 @@ function MakeACF_GearboxCVT(Owner, Pos, Angle, Id, Data1, Data2, Data3, Data4, D
GearboxCVT:SetBodygroup(1, 0)
end
GearboxCVT:SetNetworkedString( "WireName", List.MobilityCustom[Id].name )
GearboxCVT:SetNWString( "WireName", List.MobilityCustom[Id].name )
GearboxCVT:UpdateOverlayText()
return GearboxCVT
@ -403,7 +403,7 @@ function ENT:Update( ArgsTable )
self:SetBodygroup(1, 0)
end
self:SetNetworkedString( "WireName", List.MobilityCustom[Id].name )
self:SetNWString( "WireName", List.MobilityCustom[Id].name )
self:UpdateOverlayText()
return true, "CVT Gearbox updated successfully!"
@ -557,7 +557,7 @@ function ENT:Calc( InputRPM, InputInertia )
self.RClutch = math.Clamp(1-0,0,1)*self.MaxTorque
end
end
--####################
if self.ClutchMode == 1 then
if(self.GearFinal2 > self.RatioMin) then
--self.Reducer = ((self.RpmLimit2-InputRPM)+((self.RpmLimit2-InputRPM)/6000))-(self.RpmLimit2-InputRPM)
@ -599,7 +599,6 @@ function ENT:Calc( InputRPM, InputInertia )
Wire_TriggerOutput(self, "Ratio", self.GearRatio)
end
end
--####################
for Key, Link in pairs( self.WheelLink ) do
if not IsValid( Link.Ent ) then
@ -650,7 +649,7 @@ function ENT:CalcWheel( Link, SelfWorld )
return BaseRPM / self.GearRatio / -6
end
function ENT:Act( Torque, DeltaTime, Throttle )
function ENT:Act( Torque, DeltaTime, MassRatio )
local ReactTq = 0
-- Calculate the ratio of total requested torque versus what's avaliable, and then multiply it but the current gearratio
local AvailTq = 0
@ -667,7 +666,7 @@ function ENT:Act( Torque, DeltaTime, Throttle )
end
if Link.Ent.IsGeartrain then
Link.Ent:Act( Link.ReqTq * AvailTq, DeltaTime )
Link.Ent:Act( Link.ReqTq * AvailTq, DeltaTime, MassRatio )
else
self:ActWheel( Link, Link.ReqTq * AvailTq, Brake, DeltaTime )
ReactTq = ReactTq + Link.ReqTq * AvailTq
@ -676,7 +675,7 @@ function ENT:Act( Torque, DeltaTime, Throttle )
local BoxPhys = self:GetPhysicsObject()
if IsValid( BoxPhys ) and ReactTq ~= 0 then
local Force = self:GetForward() * ReactTq - self:GetForward()
local Force = self:GetForward() * ReactTq * MassRatio - self:GetForward()
BoxPhys:ApplyForceOffset( Force * 39.37 * DeltaTime, self:GetPos() + self:GetUp() * -39.37 )
BoxPhys:ApplyForceOffset( Force * -39.37 * DeltaTime, self:GetPos() + self:GetUp() * 39.37 )
end

View File

@ -144,7 +144,7 @@ function MakeACF_Nos(Owner, Pos, Angle, Id, Data1)
Wire_TriggerOutput(Nos.Entity, "Usable", Nos.UsableNos)
Wire_TriggerOutput(Nos.Entity, "Active", Nos.ActiveChips2)
Nos:SetNetworkedString( "WireName", Lookup.name )
Nos:SetNWString( "WireName", Lookup.name )
Nos:UpdateOverlayText()
return Nos
@ -191,7 +191,7 @@ function ENT:Update( ArgsTable )
Wire_TriggerOutput(self, "Usable", self.UsableNos)
Wire_TriggerOutput(self, "Active", self.ActiveChips2)
self:SetNetworkedString( "WireName", Lookup.name )
self:SetNWString( "WireName", Lookup.name )
self:UpdateOverlayText()
return true, "Nos updated successfully!"

View File

@ -105,7 +105,7 @@ function MakeACF_Rads(Owner, Pos, Angle, Id)
Owner:AddCount("_acf_rads", Rads)
Owner:AddCleanup( "acfcustom", Rads )
Rads:SetNetworkedString( "WireName", Lookup.name )
Rads:SetNWString( "WireName", Lookup.name )
Rads:UpdateOverlayText()
return Rads
@ -140,7 +140,7 @@ function ENT:Update( ArgsTable )
phys:SetMass( self.Weight )
end
self:SetNetworkedString( "WireName", Lookup.name )
self:SetNWString( "WireName", Lookup.name )
self:UpdateOverlayText()
return true, "Radiator updated successfully!"

View File

@ -143,7 +143,7 @@ function MakeACF_Supercharger(Owner, Pos, Angle, Id, Data1)
Owner:AddCount("_acf_supercharger", Supercharger)
Owner:AddCleanup( "acfmenu", Supercharger )
Supercharger:SetNetworkedString( "WireName", Lookup.name )
Supercharger:SetNWString( "WireName", Lookup.name )
Supercharger:UpdateOverlayText()
Supercharger:SetWireOutputs()
@ -184,7 +184,7 @@ function ENT:Update( ArgsTable )
local OutputsTypes = {"NORMAL"}
self.Outputs = WireLib.CreateSpecialOutputs( self, Outputs, OutputsTypes )
self:SetNetworkedString( "WireName", Lookup.name )
self:SetNWString( "WireName", Lookup.name )
self:UpdateOverlayText()
self:SetWireOutputs()

View File

@ -171,7 +171,7 @@ function MakeACF_Turbo(Owner, Pos, Angle, Id, Data1, Data2)
Owner:AddCount("_acf_turbo", Turbo)
Owner:AddCleanup( "acfmenu", Turbo )
Turbo:SetNetworkedString( "WireName", Lookup.name )
Turbo:SetNWString( "WireName", Lookup.name )
Turbo:UpdateOverlayText()
Turbo:SetWireOutputs()
@ -215,7 +215,7 @@ function ENT:Update( ArgsTable )
local OutputsTypes = {"NORMAL"}
self.Outputs = WireLib.CreateSpecialOutputs( self, Outputs, OutputsTypes )
self:SetNetworkedString( "WireName", Lookup.name )
self:SetNWString( "WireName", Lookup.name )
self:UpdateOverlayText()
self:SetWireOutputs()

View File

@ -1,5 +1,4 @@
E2Lib.RegisterExtension("acfcustom", true)
CreateConVar("sbox_acfcustom_e2restrictinfo", 1) -- 0=any, 1=owned
-- [ Helper Functions ] --
@ -33,14 +32,14 @@ __e2setcost( 1 )
-- Returns 1 if functions returning sensitive info are restricted to owned props
e2function number acfCustomInfoRestricted()
return GetConVar("sbox_acfcustom_e2restrictinfo"):GetInt() or 0
return GetConVar("sbox_acfcustom_restrictinfo"):GetInt() or 0
end
-- Returns the short name of an ACF entity
e2function string entity:acfCustomNameShort()
if isEngine(this) then return this.Id or "" end
if isGearbox(this) then return this.Id or "" end
if isChips(this) then return this.this.Id or "" end
if isChips(this) then return this.Id or "" end
return ""
end
@ -59,7 +58,6 @@ e2function void entity:acfCustomActive( number on )
this:TriggerInput("Active", on)
end
local linkTables =
{ -- link resources within each ent type. should point to an ent: true if adding link.Ent, false to add link itself
acf_engine_custom = {GearLink = true, FuelLink = false},
@ -71,9 +69,7 @@ local linkTables =
acf_nos = {Master = false}
}
local function getLinks(ent, enttype)
local ret = {}
-- find the link resources available for this ent type
for entry, mode in pairs(linkTables[enttype]) do
@ -88,7 +84,6 @@ local function getLinks(ent, enttype)
return ret
end
local function searchForGearboxLinks(ent)
local boxes = ents.FindByClass("acf_gearbox")
local boxes3 = ents.FindByClass("acf_gearboxcvt")
@ -132,11 +127,9 @@ local function searchForGearboxLinks(ent)
return ret
end
__e2setcost( 20 )
e2function array entity:acfCustomLinks()
if not IsValid(this) then return {} end
local enttype = this:GetClass()
@ -146,11 +139,8 @@ e2function array entity:acfCustomLinks()
end
return getLinks(this, enttype)
end
__e2setcost( 2 )
-- Returns the full name of an ACF entity
@ -173,10 +163,41 @@ e2function string entity:acfCustomType()
return ""
end
--allows e2 to perform ACF links
e2function number entity:acfCustomLinkTo(entity target, number notify)
if not ((isEngine(this) or isGearbox(this)) or isChips(this) and (isOwner(self, this) and isOwner(self, target))) then
if notify > 0 then
ACFCUSTOM_SendNotify(self.player, 0, "Must be called on a gun, engine, or gearbox you own.")
end
return 0
end
local success, msg = this:Link(target)
if notify > 0 then
ACFCUSTOM_SendNotify(self.player, success, msg)
end
return success and 1 or 0
end
--allows e2 to perform ACF unlinks
e2function number entity:acfCustomUnlinkFrom(entity target, number notify)
if not ((isEngine(this) or isGearbox(this)) or isChips(this) and (isOwner(self, this) and isOwner(self, target))) then
if notify > 0 then
ACFCUSTOM_SendNotify(self.player, 0, "Must be called on a gun, engine, or gearbox you own.")
end
return 0
end
local success, msg = this:Unlink(target)
if notify > 0 then
ACFCUSTOM_SendNotify(self.player, success, msg)
end
return success and 1 or 0
end
-- [ Engine Functions ] --
__e2setcost( 1 )
-- Returns 1 if the entity is an ACF engine

View File

@ -5,6 +5,8 @@ E2Helper.Descriptions["acfCustomActive"] = "Gets/sets Active (0-1) for an ACF Cu
E2Helper.Descriptions["acfCustomNameShort"] = "Returns the short name of an ACF Custom entity."
E2Helper.Descriptions["acfCustomName"] = "Returns the full name of an ACF Custom entity."
E2Helper.Descriptions["acfCustomType"] = "Returns the type of ACF Custom entity."
E2Helper.Descriptions["acfCustomLinkTo"] = "Link various ACF components together."
E2Helper.Descriptions["acfCustomUnlinkFrom"] = "Unlink various ACF components."
E2Helper.Descriptions["acfCustomInfoRestricted"] = "Returns 1 if functions returning sensitive info are restricted to owned props."
E2Helper.Descriptions["acfCustomLinks"] = "Returns all the entities which are linked to this entity through ACF Custom."

View File

@ -1,5 +1,7 @@
TOOL.Category = "Construction";
local cat = ((ACFCUSTOM.CustomToolCategory and ACFCUSTOM.CustomToolCategory:GetBool()) and "ACF" or "Construction");
TOOL.Category = cat
TOOL.Name = "#Tool.acfcopycustom.listname";
TOOL.Author = "looter and bouletmarc";
TOOL.Command = nil;
@ -10,7 +12,6 @@ TOOL.EngineMakerCopyData = {};
TOOL.ChipsData = {};
if CLIENT then
language.Add( "Tool.acfcopycustom.listname", "ACF Custom Copy Tool" );
language.Add( "Tool.acfcopycustom.name", "ACF Custom Copy Tool Custom" );
language.Add( "Tool.acfcopycustom.desc", "Copy gearbox/custom data from one object to another" );
@ -19,7 +20,6 @@ if CLIENT then
function TOOL.BuildCPanel( CPanel )
end
end
-- Update

View File

@ -1,5 +1,7 @@
TOOL.Category = "Construction"
local cat = ((ACFCUSTOM.CustomToolCategory and ACFCUSTOM.CustomToolCategory:GetBool()) and "ACF" or "Construction");
TOOL.Category = cat
TOOL.Name = "#Tool.acfcustom.listname"
TOOL.Command = nil
TOOL.ConfigName = ""
@ -30,7 +32,7 @@ cleanup.Register( "acfcustom" )
if CLIENT then
language.Add( "Tool.acfcustom.listname", "ACF Custom" )
language.Add( "Tool.acfcustom.name", "ACF Custom V3" )
language.Add( "Tool.acfcustom.name", "ACF Custom V4" )
language.Add( "Tool.acfcustom.desc", "Spawn the ACF Custom Entity" )
language.Add( "Tool.acfcustom.0", "Left click to spawn the entity, Right click to link an entity to another (+Use to unlink)" )
language.Add( "Tool.acfcustom.1", "Right click to link the selected sensor to a pod" )

View File

@ -1,5 +1,7 @@
TOOL.Category = "Construction"
local cat = ((ACFCUSTOM.CustomToolCategory and ACFCUSTOM.CustomToolCategory:GetBool()) and "ACF" or "Construction");
TOOL.Category = cat
TOOL.Name = "#Tool.acfsoundcustom.name"
TOOL.Command = nil
TOOL.ConfigName = ""

Binary file not shown.

Binary file not shown.

BIN
models/engines/1cyltiny.mdl Normal file

Binary file not shown.

BIN
models/engines/1cyltiny.phy Normal file

Binary file not shown.

Binary file not shown.

BIN
models/engines/1cyltiny.vvd Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
models/engines/b10large.mdl Normal file

Binary file not shown.

BIN
models/engines/b10large.phy Normal file

Binary file not shown.

Binary file not shown.

BIN
models/engines/b10large.vvd Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
models/engines/b10small.mdl Normal file

Binary file not shown.

BIN
models/engines/b10small.phy Normal file

Binary file not shown.

Binary file not shown.

BIN
models/engines/b10small.vvd Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
models/engines/b12large.mdl Normal file

Binary file not shown.

BIN
models/engines/b12large.phy Normal file

Binary file not shown.

Binary file not shown.

BIN
models/engines/b12large.vvd Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More