diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000000..b909f13916 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,3485 @@ +-- This file will be read by Luacheck . +-- It's primarily to specify what globals are available across all files. + +-- Problems to ignore +ignore = { + "212", -- Unused argument +} + +-- string values with integer keys mean read-only globals +stds.garrysmod = { + -- BEGIN_GENERATED_CODE + + -- Hooks + "EFFECT", + "ENT", + "ENTITY", + "ENT_AI", + "ENT_ANIM", + "ENT_BRUSH", + "ENT_FILTER", + "ENT_NEXTBOT", + "ENT_POINT", + "GM", + "PANEL", + "PLAYER", + "SANDBOX", + "SWEP", + "TOOL", + + -- Libraries + "GWEN", + "achievements", + "ai", + "ai_schedule", + "ai_task", + "baseclass", + "bit", + "cam", + "chat", + "cleanup", + "concommand", + "constraint", + "construct", + "controlpanel", + "cookie", + "coroutine", + "cvars", + "debug", + "debugoverlay", + "derma", + "dragndrop", + "draw", + "drive", + "duplicator", + "effects", + "engine", + "ents", + "file", + "frame_blend", + "game", + "gameevent", + "gamemode", + "gmod", + "gmsave", + "gui", + "halo", + "hammer", + "hook", + "http", + "input", + "jit", + "killicon", + "language", + "list", + "markup", + "math", + "matproxy", + "menu", + "menubar", + "mesh", + "motionsensor", + "navmesh", + "net", + "notification", + "numpad", + "os", + "package", + "physenv", + "player", + "player_manager", + "presets", + "properties", + "render", + "resource", + "saverestore", + "scripted_ents", + "search", + "serverlist", + "sound", + "spawnmenu", + "sql", + "steamworks", + "string", + "surface", + "system", + "table", + "team", + "timer", + "umsg", + "undo", + "usermessage", + "utf8", + "util", + "vgui", + "video", + "weapons", + "widgets", + + -- Global + "AccessorFunc", + "Add_NPC_Class", + "AddBackgroundImage", + "AddConsoleCommand", + "AddCSLuaFile", + "AddonMaterial", + "AddOriginToPVS", + "AddWorldTip", + "Angle", + "AngleRand", + "assert", + "BroadcastLua", + "BuildNetworkedVarsTable", + "CancelLoading", + "ChangeBackground", + "ChangeTooltip", + "ClearBackgroundImages", + "ClientsideModel", + "ClientsideRagdoll", + "ClientsideScene", + "CloseDermaMenus", + "collectgarbage", + "Color", + "ColorAlpha", + "ColorRand", + "ColorToHSV", + "CompileFile", + "CompileString", + "ConsoleAutoComplete", + "ConVarExists", + "CreateClientConVar", + "CreateConVar", + "CreateMaterial", + "CreateParticleSystem", + "CreateSound", + "CreateSprite", + "CurTime", + "DamageInfo", + "DebugInfo", + "DeriveGamemode", + "Derma_Anim", + "Derma_DrawBackgroundBlur", + "Derma_Hook", + "Derma_Install_Convar_Functions", + "Derma_Message", + "Derma_Query", + "Derma_StringRequest", + "DermaMenu", + "DisableClipping", + "DOF_Kill", + "DOF_Start", + "DOFModeHack", + "DrawBackground", + "DrawBloom", + "DrawColorModify", + "DrawMaterialOverlay", + "DrawMotionBlur", + "DrawSharpen", + "DrawSobel", + "DrawSunbeams", + "DrawTexturize", + "DrawToyTown", + "DropEntityIfHeld", + "DynamicLight", + "EffectData", + "Either", + "EmitSentence", + "EmitSound", + "EndTooltip", + "Entity", + "Error", + "error", + "ErrorNoHalt", + "EyeAngles", + "EyePos", + "EyeVector", + "FindMetaTable", + "FindTooltip", + "Format", + "FrameNumber", + "FrameTime", + "GameDetails", + "gcinfo", + "GetConVar", + "GetConVarNumber", + "GetConVarString", + "GetDefaultLoadingHTML", + "GetDemoFileDetails", + "GetDownloadables", + "getfenv", + "GetGlobalAngle", + "GetGlobalBool", + "GetGlobalEntity", + "GetGlobalFloat", + "GetGlobalInt", + "GetGlobalString", + "GetGlobalVector", + "GetHostName", + "GetHUDPanel", + "GetLoadPanel", + "GetLoadStatus", + "getmetatable", + "GetOverlayPanel", + "GetRenderTarget", + "GetRenderTargetEx", + "GetSaveFileDetails", + "GetViewEntity", + "HSVToColor", + "HTTP", + "include", + "IncludeCS", + "ipairs", + "isangle", + "isbool", + "IsColor", + "IsEnemyEntityName", + "IsEntity", + "isentity", + "IsFirstTimePredicted", + "IsFriendEntityName", + "isfunction", + "IsInGame", + "ismatrix", + "IsMounted", + "isnumber", + "ispanel", + "isstring", + "istable", + "IsTableOfEntitiesValid", + "IsUselessModel", + "IsValid", + "isvector", + "JoinServer", + "JS_Language", + "JS_Utility", + "JS_Workshop", + "Label", + "LanguageChanged", + "Lerp", + "LerpAngle", + "LerpVector", + "LoadLastMap", + "LoadPresets", + "Localize", + "LocalPlayer", + "LocalToWorld", + "Material", + "Matrix", + "Mesh", + "Model", + "module", + "Msg", + "MsgAll", + "MsgC", + "MsgN", + "NamedColor", + "newproxy", + "next", + "NumDownloadables", + "NumModelSkins", + "OnModelLoaded", + "OpenFolder", + "OrderVectors", + "pairs", + "Particle", + "ParticleEffect", + "ParticleEffectAttach", + "ParticleEmitter", + "Path", + "pcall", + "Player", + "PositionSpawnIcon", + "PrecacheParticleSystem", + "PrecacheScene", + "PrecacheSentenceFile", + "PrecacheSentenceGroup", + "print", + "PrintMessage", + "PrintTable", + "ProjectedTexture", + "ProtectedCall", + "RandomPairs", + "rawequal", + "rawget", + "rawset", + "RealFrameTime", + "RealTime", + "RecipientFilter", + "RecordDemoFrame", + "RegisterDermaMenuForClose", + "RememberCursorPosition", + "RemoveTooltip", + "RenderAngles", + "RenderDoF", + "RenderStereoscopy", + "RenderSuperDoF", + "require", + "RestoreCursorPosition", + "RunConsoleCommand", + "RunGameUICommand", + "RunString", + "RunStringEx", + "SafeRemoveEntity", + "SafeRemoveEntityDelayed", + "SaveLastMap", + "SavePresets", + "ScreenScale", + "ScrH", + "ScrW", + "select", + "SendUserMessage", + "ServerLog", + "SetClipboardText", + "setfenv", + "SetGlobalAngle", + "SetGlobalBool", + "SetGlobalEntity", + "SetGlobalFloat", + "SetGlobalInt", + "SetGlobalString", + "SetGlobalVector", + "setmetatable", + "SetPhysConstraintSystem", + "SortedPairs", + "SortedPairsByMemberValue", + "SortedPairsByValue", + "Sound", + "SoundDuration", + "SQLStr", + "SScale", + "STNDRD", + "SuppressHostEvents", + "SysTime", + "TauntCamera", + "TextEntryLoseFocus", + "TimedCos", + "TimedSin", + "tobool", + "ToggleFavourite", + "tonumber", + "tostring", + "TranslateDownloadableName", + "type", + "TypeID", + "unpack", + "UnPredictedCurTime", + "UpdateLoadPanel", + "UpdateRenderTarget", + "UTIL_IsUselessModel", + "ValidPanel", + "Vector", + "VectorRand", + "VGUIFrameTime", + "VGUIRect", + "VisualizeLayout", + "WorkshopFileBase", + "WorldToLocal", + "xpcall", + + -- Classes + "Angle", + "CEffectData", + "CLuaEmitter", + "CLuaLocomotion", + "CLuaParticle", + "CMoveData", + "CNavArea", + "CNavLadder", + "CNewParticleEffect", + "CRecipientFilter", + "CSEnt", + "CSoundPatch", + "CTakeDamageInfo", + "CUserCmd", + "ConVar", + "Entity", + "File", + "IGModAudioChannel", + "IMaterial", + "IMesh", + "IRestore", + "ISave", + "ITexture", + "IVideoWriter", + "MarkupObject", + "NPC", + "NextBot", + "Panel", + "PathFollower", + "PhysObj", + "Player", + "ProjectedTexture", + "Schedule", + "Stack", + "TOOL", + "Task", + "VMatrix", + "Vector", + "Vehicle", + "Weapon", + "bf_read", + + -- Panels + "AchievementIcon", + "AvatarImage", + "Awesomium", + "Button", + "CheckButton", + "ContentIcon", + "ContextBase", + "ControlPanel", + "ControlPresets", + "CtrlListBox", + "DAdjustableModelPanel", + "DAlphaBar", + "DBinder", + "DBubbleContainer", + "DButton", + "DCategoryList", + "DCheckBox", + "DCheckBoxLabel", + "DCollapsibleCategory", + "DColorButton", + "DColorCombo", + "DColorCube", + "DColorMixer", + "DColorPalette", + "DColumnSheet", + "DComboBox", + "DDragBase", + "DDrawer", + "DEntityProperties", + "DExpandButton", + "DFileBrowser", + "DForm", + "DFrame", + "DGrid", + "DHTML", + "DHTMLControls", + "DHorizontalDivider", + "DHorizontalScroller", + "DIconBrowser", + "DIconLayout", + "DImage", + "DImageButton", + "DKillIcon", + "DLabel", + "DLabelEditable", + "DLabelURL", + "DListBox", + "DListBoxItem", + "DListLayout", + "DListView", + "DListViewHeaderLabel", + "DListViewLabel", + "DListViewLine", + "DListView_Column", + "DListView_ColumnPlain", + "DListView_DraggerBar", + "DListView_Line", + "DMenu", + "DMenuBar", + "DMenuOption", + "DMenuOptionCVar", + "DModelPanel", + "DModelSelect", + "DModelSelectMulti", + "DNotify", + "DNumPad", + "DNumSlider", + "DNumberScratch", + "DNumberWang", + "DPanel", + "DPanelList", + "DPanelOverlay", + "DPanelSelect", + "DProgress", + "DProperties", + "DPropertySheet", + "DProperty_Boolean", + "DProperty_Combo", + "DProperty_Float", + "DProperty_Generic", + "DProperty_Int", + "DProperty_VectorColor", + "DRGBPicker", + "DScrollBarGrip", + "DScrollPanel", + "DShape", + "DSizeToContents", + "DSlider", + "DSprite", + "DTab", + "DTextEntry", + "DTileLayout", + "DTooltip", + "DTree", + "DTree_Node", + "DTree_Node_Button", + "DVScrollBar", + "DVerticalDivider", + "EditablePanel", + "FingerVar", + "Frame", + "HTML", + "IconEditor", + "ImageCheckBox", + "Label", + "MatSelect", + "Material", + "ModelImage", + "Panel", + "PanelList", + "PresetEditor", + "PropSelect", + "RadioButton", + "RichText", + "SlideBar", + "Slider", + "SpawnIcon", + "TGAImage", + "TextEntry", + "URLLabel", + "fingerposer", + + -- Enumerations + --- ACT + "ACT_INVALID", + "ACT_RESET", + "ACT_IDLE", + "ACT_TRANSITION", + "ACT_COVER", + "ACT_COVER_MED", + "ACT_COVER_LOW", + "ACT_WALK", + "ACT_WALK_AIM", + "ACT_WALK_CROUCH", + "ACT_WALK_CROUCH_AIM", + "ACT_RUN", + "ACT_RUN_AIM", + "ACT_RUN_CROUCH", + "ACT_RUN_CROUCH_AIM", + "ACT_RUN_PROTECTED", + "ACT_SCRIPT_CUSTOM_MOVE", + "ACT_RANGE_ATTACK1", + "ACT_RANGE_ATTACK2", + "ACT_RANGE_ATTACK1_LOW", + "ACT_RANGE_ATTACK2_LOW", + "ACT_DIESIMPLE", + "ACT_DIEBACKWARD", + "ACT_DIEFORWARD", + "ACT_DIEVIOLENT", + "ACT_DIERAGDOLL", + "ACT_FLY", + "ACT_HOVER", + "ACT_GLIDE", + "ACT_SWIM", + "ACT_SWIM_IDLE", + "ACT_JUMP", + "ACT_HOP", + "ACT_LEAP", + "ACT_LAND", + "ACT_CLIMB_UP", + "ACT_CLIMB_DOWN", + "ACT_CLIMB_DISMOUNT", + "ACT_SHIPLADDER_UP", + "ACT_SHIPLADDER_DOWN", + "ACT_STRAFE_LEFT", + "ACT_STRAFE_RIGHT", + "ACT_ROLL_LEFT", + "ACT_ROLL_RIGHT", + "ACT_TURN_LEFT", + "ACT_TURN_RIGHT", + "ACT_CROUCH", + "ACT_CROUCHIDLE", + "ACT_STAND", + "ACT_USE", + "ACT_SIGNAL1", + "ACT_SIGNAL2", + "ACT_SIGNAL3", + "ACT_SIGNAL_ADVANCE", + "ACT_SIGNAL_FORWARD", + "ACT_SIGNAL_GROUP", + "ACT_SIGNAL_HALT", + "ACT_SIGNAL_LEFT", + "ACT_SIGNAL_RIGHT", + "ACT_SIGNAL_TAKECOVER", + "ACT_LOOKBACK_RIGHT", + "ACT_LOOKBACK_LEFT", + "ACT_COWER", + "ACT_SMALL_FLINCH", + "ACT_BIG_FLINCH", + "ACT_MELEE_ATTACK1", + "ACT_MELEE_ATTACK2", + "ACT_RELOAD", + "ACT_RELOAD_START", + "ACT_RELOAD_FINISH", + "ACT_RELOAD_LOW", + "ACT_ARM", + "ACT_DISARM", + "ACT_DROP_WEAPON", + "ACT_DROP_WEAPON_SHOTGUN", + "ACT_PICKUP_GROUND", + "ACT_PICKUP_RACK", + "ACT_IDLE_ANGRY", + "ACT_IDLE_RELAXED", + "ACT_IDLE_STIMULATED", + "ACT_IDLE_AGITATED", + "ACT_IDLE_STEALTH", + "ACT_IDLE_HURT", + "ACT_WALK_RELAXED", + "ACT_WALK_STIMULATED", + "ACT_WALK_AGITATED", + "ACT_WALK_STEALTH", + "ACT_RUN_RELAXED", + "ACT_RUN_STIMULATED", + "ACT_RUN_AGITATED", + "ACT_RUN_STEALTH", + "ACT_IDLE_AIM_RELAXED", + "ACT_IDLE_AIM_STIMULATED", + "ACT_IDLE_AIM_AGITATED", + "ACT_IDLE_AIM_STEALTH", + "ACT_WALK_AIM_RELAXED", + "ACT_WALK_AIM_STIMULATED", + "ACT_WALK_AIM_AGITATED", + "ACT_WALK_AIM_STEALTH", + "ACT_RUN_AIM_RELAXED", + "ACT_RUN_AIM_STIMULATED", + "ACT_RUN_AIM_AGITATED", + "ACT_RUN_AIM_STEALTH", + "ACT_CROUCHIDLE_STIMULATED", + "ACT_CROUCHIDLE_AIM_STIMULATED", + "ACT_CROUCHIDLE_AGITATED", + "ACT_WALK_HURT", + "ACT_RUN_HURT", + "ACT_SPECIAL_ATTACK1", + "ACT_SPECIAL_ATTACK2", + "ACT_COMBAT_IDLE", + "ACT_WALK_SCARED", + "ACT_RUN_SCARED", + "ACT_VICTORY_DANCE", + "ACT_DIE_HEADSHOT", + "ACT_DIE_CHESTSHOT", + "ACT_DIE_GUTSHOT", + "ACT_DIE_BACKSHOT", + "ACT_FLINCH_HEAD", + "ACT_FLINCH_CHEST", + "ACT_FLINCH_STOMACH", + "ACT_FLINCH_LEFTARM", + "ACT_FLINCH_RIGHTARM", + "ACT_FLINCH_LEFTLEG", + "ACT_FLINCH_RIGHTLEG", + "ACT_FLINCH_PHYSICS", + "ACT_IDLE_ON_FIRE", + "ACT_WALK_ON_FIRE", + "ACT_RUN_ON_FIRE", + "ACT_RAPPEL_LOOP", + "ACT_180_LEFT", + "ACT_180_RIGHT", + "ACT_90_LEFT", + "ACT_90_RIGHT", + "ACT_STEP_LEFT", + "ACT_STEP_RIGHT", + "ACT_STEP_BACK", + "ACT_STEP_FORE", + "ACT_GESTURE_RANGE_ATTACK1", + "ACT_GESTURE_RANGE_ATTACK2", + "ACT_GESTURE_MELEE_ATTACK1", + "ACT_GESTURE_MELEE_ATTACK2", + "ACT_GESTURE_RANGE_ATTACK1_LOW", + "ACT_GESTURE_RANGE_ATTACK2_LOW", + "ACT_MELEE_ATTACK_SWING_GESTURE", + "ACT_GESTURE_SMALL_FLINCH", + "ACT_GESTURE_BIG_FLINCH", + "ACT_GESTURE_FLINCH_BLAST", + "ACT_GESTURE_FLINCH_BLAST_SHOTGUN", + "ACT_GESTURE_FLINCH_BLAST_DAMAGED", + "ACT_GESTURE_FLINCH_BLAST_DAMAGED_SHOTGUN", + "ACT_GESTURE_FLINCH_HEAD", + "ACT_GESTURE_FLINCH_CHEST", + "ACT_GESTURE_FLINCH_STOMACH", + "ACT_GESTURE_FLINCH_LEFTARM", + "ACT_GESTURE_FLINCH_RIGHTARM", + "ACT_GESTURE_FLINCH_LEFTLEG", + "ACT_GESTURE_FLINCH_RIGHTLEG", + "ACT_GESTURE_TURN_LEFT", + "ACT_GESTURE_TURN_RIGHT", + "ACT_GESTURE_TURN_LEFT45", + "ACT_GESTURE_TURN_RIGHT45", + "ACT_GESTURE_TURN_LEFT90", + "ACT_GESTURE_TURN_RIGHT90", + "ACT_GESTURE_TURN_LEFT45_FLAT", + "ACT_GESTURE_TURN_RIGHT45_FLAT", + "ACT_GESTURE_TURN_LEFT90_FLAT", + "ACT_GESTURE_TURN_RIGHT90_FLAT", + "ACT_BARNACLE_HIT", + "ACT_BARNACLE_PULL", + "ACT_BARNACLE_CHOMP", + "ACT_BARNACLE_CHEW", + "ACT_DO_NOT_DISTURB", + "ACT_VM_DRAW", + "ACT_VM_HOLSTER", + "ACT_VM_IDLE", + "ACT_VM_FIDGET", + "ACT_VM_PULLBACK", + "ACT_VM_PULLBACK_HIGH", + "ACT_VM_PULLBACK_LOW", + "ACT_VM_THROW", + "ACT_VM_PULLPIN", + "ACT_VM_PRIMARYATTACK", + "ACT_VM_SECONDARYATTACK", + "ACT_VM_RELOAD", + "ACT_VM_DRYFIRE", + "ACT_VM_HITLEFT", + "ACT_VM_HITLEFT2", + "ACT_VM_HITRIGHT", + "ACT_VM_HITRIGHT2", + "ACT_VM_HITCENTER", + "ACT_VM_HITCENTER2", + "ACT_VM_MISSLEFT", + "ACT_VM_MISSLEFT2", + "ACT_VM_MISSRIGHT", + "ACT_VM_MISSRIGHT2", + "ACT_VM_MISSCENTER", + "ACT_VM_MISSCENTER2", + "ACT_VM_HAULBACK", + "ACT_VM_SWINGHARD", + "ACT_VM_SWINGMISS", + "ACT_VM_SWINGHIT", + "ACT_VM_IDLE_TO_LOWERED", + "ACT_VM_IDLE_LOWERED", + "ACT_VM_LOWERED_TO_IDLE", + "ACT_VM_RECOIL1", + "ACT_VM_RECOIL2", + "ACT_VM_RECOIL3", + "ACT_VM_PICKUP", + "ACT_VM_RELEASE", + "ACT_VM_ATTACH_SILENCER", + "ACT_VM_DETACH_SILENCER", + "ACT_SLAM_STICKWALL_IDLE", + "ACT_SLAM_STICKWALL_ND_IDLE", + "ACT_SLAM_STICKWALL_ATTACH", + "ACT_SLAM_STICKWALL_ATTACH2", + "ACT_SLAM_STICKWALL_ND_ATTACH", + "ACT_SLAM_STICKWALL_ND_ATTACH2", + "ACT_SLAM_STICKWALL_DETONATE", + "ACT_SLAM_STICKWALL_DETONATOR_HOLSTER", + "ACT_SLAM_STICKWALL_DRAW", + "ACT_SLAM_STICKWALL_ND_DRAW", + "ACT_SLAM_STICKWALL_TO_THROW", + "ACT_SLAM_STICKWALL_TO_THROW_ND", + "ACT_SLAM_STICKWALL_TO_TRIPMINE_ND", + "ACT_SLAM_THROW_IDLE", + "ACT_SLAM_THROW_ND_IDLE", + "ACT_SLAM_THROW_THROW", + "ACT_SLAM_THROW_THROW2", + "ACT_SLAM_THROW_THROW_ND", + "ACT_SLAM_THROW_THROW_ND2", + "ACT_SLAM_THROW_DRAW", + "ACT_SLAM_THROW_ND_DRAW", + "ACT_SLAM_THROW_TO_STICKWALL", + "ACT_SLAM_THROW_TO_STICKWALL_ND", + "ACT_SLAM_THROW_DETONATE", + "ACT_SLAM_THROW_DETONATOR_HOLSTER", + "ACT_SLAM_THROW_TO_TRIPMINE_ND", + "ACT_SLAM_TRIPMINE_IDLE", + "ACT_SLAM_TRIPMINE_DRAW", + "ACT_SLAM_TRIPMINE_ATTACH", + "ACT_SLAM_TRIPMINE_ATTACH2", + "ACT_SLAM_TRIPMINE_TO_STICKWALL_ND", + "ACT_SLAM_TRIPMINE_TO_THROW_ND", + "ACT_SLAM_DETONATOR_IDLE", + "ACT_SLAM_DETONATOR_DRAW", + "ACT_SLAM_DETONATOR_DETONATE", + "ACT_SLAM_DETONATOR_HOLSTER", + "ACT_SLAM_DETONATOR_STICKWALL_DRAW", + "ACT_SLAM_DETONATOR_THROW_DRAW", + "ACT_SHOTGUN_RELOAD_START", + "ACT_SHOTGUN_RELOAD_FINISH", + "ACT_SHOTGUN_PUMP", + "ACT_SMG2_IDLE2", + "ACT_SMG2_FIRE2", + "ACT_SMG2_DRAW2", + "ACT_SMG2_RELOAD2", + "ACT_SMG2_DRYFIRE2", + "ACT_SMG2_TOAUTO", + "ACT_SMG2_TOBURST", + "ACT_PHYSCANNON_UPGRADE", + "ACT_RANGE_ATTACK_AR1", + "ACT_RANGE_ATTACK_AR2", + "ACT_RANGE_ATTACK_AR2_LOW", + "ACT_RANGE_ATTACK_AR2_GRENADE", + "ACT_RANGE_ATTACK_HMG1", + "ACT_RANGE_ATTACK_ML", + "ACT_RANGE_ATTACK_SMG1", + "ACT_RANGE_ATTACK_SMG1_LOW", + "ACT_RANGE_ATTACK_SMG2", + "ACT_RANGE_ATTACK_SHOTGUN", + "ACT_RANGE_ATTACK_SHOTGUN_LOW", + "ACT_RANGE_ATTACK_PISTOL", + "ACT_RANGE_ATTACK_PISTOL_LOW", + "ACT_RANGE_ATTACK_SLAM", + "ACT_RANGE_ATTACK_TRIPWIRE", + "ACT_RANGE_ATTACK_THROW", + "ACT_RANGE_ATTACK_SNIPER_RIFLE", + "ACT_RANGE_ATTACK_RPG", + "ACT_MELEE_ATTACK_SWING", + "ACT_RANGE_AIM_LOW", + "ACT_RANGE_AIM_SMG1_LOW", + "ACT_RANGE_AIM_PISTOL_LOW", + "ACT_RANGE_AIM_AR2_LOW", + "ACT_COVER_PISTOL_LOW", + "ACT_COVER_SMG1_LOW", + "ACT_GESTURE_RANGE_ATTACK_AR1", + "ACT_GESTURE_RANGE_ATTACK_AR2", + "ACT_GESTURE_RANGE_ATTACK_AR2_GRENADE", + "ACT_GESTURE_RANGE_ATTACK_HMG1", + "ACT_GESTURE_RANGE_ATTACK_ML", + "ACT_GESTURE_RANGE_ATTACK_SMG1", + "ACT_GESTURE_RANGE_ATTACK_SMG1_LOW", + "ACT_GESTURE_RANGE_ATTACK_SMG2", + "ACT_GESTURE_RANGE_ATTACK_SHOTGUN", + "ACT_GESTURE_RANGE_ATTACK_PISTOL", + "ACT_GESTURE_RANGE_ATTACK_PISTOL_LOW", + "ACT_GESTURE_RANGE_ATTACK_SLAM", + "ACT_GESTURE_RANGE_ATTACK_TRIPWIRE", + "ACT_GESTURE_RANGE_ATTACK_THROW", + "ACT_GESTURE_RANGE_ATTACK_SNIPER_RIFLE", + "ACT_GESTURE_MELEE_ATTACK_SWING", + "ACT_IDLE_RIFLE", + "ACT_IDLE_SMG1", + "ACT_IDLE_ANGRY_SMG1", + "ACT_IDLE_PISTOL", + "ACT_IDLE_ANGRY_PISTOL", + "ACT_IDLE_ANGRY_SHOTGUN", + "ACT_IDLE_STEALTH_PISTOL", + "ACT_IDLE_PACKAGE", + "ACT_WALK_PACKAGE", + "ACT_IDLE_SUITCASE", + "ACT_WALK_SUITCASE", + "ACT_IDLE_SMG1_RELAXED", + "ACT_IDLE_SMG1_STIMULATED", + "ACT_WALK_RIFLE_RELAXED", + "ACT_RUN_RIFLE_RELAXED", + "ACT_WALK_RIFLE_STIMULATED", + "ACT_RUN_RIFLE_STIMULATED", + "ACT_IDLE_AIM_RIFLE_STIMULATED", + "ACT_WALK_AIM_RIFLE_STIMULATED", + "ACT_RUN_AIM_RIFLE_STIMULATED", + "ACT_IDLE_SHOTGUN_RELAXED", + "ACT_IDLE_SHOTGUN_STIMULATED", + "ACT_IDLE_SHOTGUN_AGITATED", + "ACT_WALK_ANGRY", + "ACT_POLICE_HARASS1", + "ACT_POLICE_HARASS2", + "ACT_IDLE_MANNEDGUN", + "ACT_IDLE_MELEE", + "ACT_IDLE_ANGRY_MELEE", + "ACT_IDLE_RPG_RELAXED", + "ACT_IDLE_RPG", + "ACT_IDLE_ANGRY_RPG", + "ACT_COVER_LOW_RPG", + "ACT_WALK_RPG", + "ACT_RUN_RPG", + "ACT_WALK_CROUCH_RPG", + "ACT_RUN_CROUCH_RPG", + "ACT_WALK_RPG_RELAXED", + "ACT_RUN_RPG_RELAXED", + "ACT_WALK_RIFLE", + "ACT_WALK_AIM_RIFLE", + "ACT_WALK_CROUCH_RIFLE", + "ACT_WALK_CROUCH_AIM_RIFLE", + "ACT_RUN_RIFLE", + "ACT_RUN_AIM_RIFLE", + "ACT_RUN_CROUCH_RIFLE", + "ACT_RUN_CROUCH_AIM_RIFLE", + "ACT_RUN_STEALTH_PISTOL", + "ACT_WALK_AIM_SHOTGUN", + "ACT_RUN_AIM_SHOTGUN", + "ACT_WALK_PISTOL", + "ACT_RUN_PISTOL", + "ACT_WALK_AIM_PISTOL", + "ACT_RUN_AIM_PISTOL", + "ACT_WALK_STEALTH_PISTOL", + "ACT_WALK_AIM_STEALTH_PISTOL", + "ACT_RUN_AIM_STEALTH_PISTOL", + "ACT_RELOAD_PISTOL", + "ACT_RELOAD_PISTOL_LOW", + "ACT_RELOAD_SMG1", + "ACT_RELOAD_SMG1_LOW", + "ACT_RELOAD_SHOTGUN", + "ACT_RELOAD_SHOTGUN_LOW", + "ACT_GESTURE_RELOAD", + "ACT_GESTURE_RELOAD_PISTOL", + "ACT_GESTURE_RELOAD_SMG1", + "ACT_GESTURE_RELOAD_SHOTGUN", + "ACT_BUSY_LEAN_LEFT", + "ACT_BUSY_LEAN_LEFT_ENTRY", + "ACT_BUSY_LEAN_LEFT_EXIT", + "ACT_BUSY_LEAN_BACK", + "ACT_BUSY_LEAN_BACK_ENTRY", + "ACT_BUSY_LEAN_BACK_EXIT", + "ACT_BUSY_SIT_GROUND", + "ACT_BUSY_SIT_GROUND_ENTRY", + "ACT_BUSY_SIT_GROUND_EXIT", + "ACT_BUSY_SIT_CHAIR", + "ACT_BUSY_SIT_CHAIR_ENTRY", + "ACT_BUSY_SIT_CHAIR_EXIT", + "ACT_BUSY_STAND", + "ACT_BUSY_QUEUE", + "ACT_DUCK_DODGE", + "ACT_DIE_BARNACLE_SWALLOW", + "ACT_GESTURE_BARNACLE_STRANGLE", + "ACT_PHYSCANNON_DETACH", + "ACT_PHYSCANNON_ANIMATE", + "ACT_PHYSCANNON_ANIMATE_PRE", + "ACT_PHYSCANNON_ANIMATE_POST", + "ACT_DIE_FRONTSIDE", + "ACT_DIE_RIGHTSIDE", + "ACT_DIE_BACKSIDE", + "ACT_DIE_LEFTSIDE", + "ACT_OPEN_DOOR", + "ACT_DI_ALYX_ZOMBIE_MELEE", + "ACT_DI_ALYX_ZOMBIE_TORSO_MELEE", + "ACT_DI_ALYX_HEADCRAB_MELEE", + "ACT_DI_ALYX_ANTLION", + "ACT_DI_ALYX_ZOMBIE_SHOTGUN64", + "ACT_DI_ALYX_ZOMBIE_SHOTGUN26", + "ACT_READINESS_RELAXED_TO_STIMULATED", + "ACT_READINESS_RELAXED_TO_STIMULATED_WALK", + "ACT_READINESS_AGITATED_TO_STIMULATED", + "ACT_READINESS_STIMULATED_TO_RELAXED", + "ACT_READINESS_PISTOL_RELAXED_TO_STIMULATED", + "ACT_READINESS_PISTOL_RELAXED_TO_STIMULATED_WALK", + "ACT_READINESS_PISTOL_AGITATED_TO_STIMULATED", + "ACT_READINESS_PISTOL_STIMULATED_TO_RELAXED", + "ACT_IDLE_CARRY", + "ACT_WALK_CARRY", + "ACT_STARTDYING", + "ACT_DYINGLOOP", + "ACT_DYINGTODEAD", + "ACT_RIDE_MANNED_GUN", + "ACT_VM_SPRINT_ENTER", + "ACT_VM_SPRINT_IDLE", + "ACT_VM_SPRINT_LEAVE", + "ACT_FIRE_START", + "ACT_FIRE_LOOP", + "ACT_FIRE_END", + "ACT_CROUCHING_GRENADEIDLE", + "ACT_CROUCHING_GRENADEREADY", + "ACT_CROUCHING_PRIMARYATTACK", + "ACT_OVERLAY_GRENADEIDLE", + "ACT_OVERLAY_GRENADEREADY", + "ACT_OVERLAY_PRIMARYATTACK", + "ACT_OVERLAY_SHIELD_UP", + "ACT_OVERLAY_SHIELD_DOWN", + "ACT_OVERLAY_SHIELD_UP_IDLE", + "ACT_OVERLAY_SHIELD_ATTACK", + "ACT_OVERLAY_SHIELD_KNOCKBACK", + "ACT_SHIELD_UP", + "ACT_SHIELD_DOWN", + "ACT_SHIELD_UP_IDLE", + "ACT_SHIELD_ATTACK", + "ACT_SHIELD_KNOCKBACK", + "ACT_CROUCHING_SHIELD_UP", + "ACT_CROUCHING_SHIELD_DOWN", + "ACT_CROUCHING_SHIELD_UP_IDLE", + "ACT_CROUCHING_SHIELD_ATTACK", + "ACT_CROUCHING_SHIELD_KNOCKBACK", + "ACT_TURNRIGHT45", + "ACT_TURNLEFT45", + "ACT_TURN", + "ACT_OBJ_ASSEMBLING", + "ACT_OBJ_DISMANTLING", + "ACT_OBJ_STARTUP", + "ACT_OBJ_RUNNING", + "ACT_OBJ_IDLE", + "ACT_OBJ_PLACING", + "ACT_OBJ_DETERIORATING", + "ACT_OBJ_UPGRADING", + "ACT_DEPLOY", + "ACT_DEPLOY_IDLE", + "ACT_UNDEPLOY", + "ACT_GRENADE_ROLL", + "ACT_GRENADE_TOSS", + "ACT_HANDGRENADE_THROW1", + "ACT_HANDGRENADE_THROW2", + "ACT_HANDGRENADE_THROW3", + "ACT_SHOTGUN_IDLE_DEEP", + "ACT_SHOTGUN_IDLE4", + "ACT_GLOCK_SHOOTEMPTY", + "ACT_GLOCK_SHOOT_RELOAD", + "ACT_RPG_DRAW_UNLOADED", + "ACT_RPG_HOLSTER_UNLOADED", + "ACT_RPG_IDLE_UNLOADED", + "ACT_RPG_FIDGET_UNLOADED", + "ACT_CROSSBOW_DRAW_UNLOADED", + "ACT_CROSSBOW_IDLE_UNLOADED", + "ACT_CROSSBOW_FIDGET_UNLOADED", + "ACT_GAUSS_SPINUP", + "ACT_GAUSS_SPINCYCLE", + "ACT_TRIPMINE_GROUND", + "ACT_TRIPMINE_WORLD", + "ACT_VM_PRIMARYATTACK_SILENCED", + "ACT_VM_RELOAD_SILENCED", + "ACT_VM_DRYFIRE_SILENCED", + "ACT_VM_IDLE_SILENCED", + "ACT_VM_DRAW_SILENCED", + "ACT_VM_IDLE_EMPTY_LEFT", + "ACT_VM_DRYFIRE_LEFT", + "ACT_PLAYER_IDLE_FIRE", + "ACT_PLAYER_CROUCH_FIRE", + "ACT_PLAYER_CROUCH_WALK_FIRE", + "ACT_PLAYER_WALK_FIRE", + "ACT_PLAYER_RUN_FIRE", + "ACT_IDLETORUN", + "ACT_RUNTOIDLE", + "ACT_SPRINT", + "ACT_GET_DOWN_STAND", + "ACT_GET_UP_STAND", + "ACT_GET_DOWN_CROUCH", + "ACT_GET_UP_CROUCH", + "ACT_PRONE_FORWARD", + "ACT_PRONE_IDLE", + "ACT_DEEPIDLE1", + "ACT_DEEPIDLE2", + "ACT_DEEPIDLE3", + "ACT_DEEPIDLE4", + "ACT_VM_RELOAD_DEPLOYED", + "ACT_VM_RELOAD_IDLE", + "ACT_VM_DRAW_DEPLOYED", + "ACT_VM_DRAW_EMPTY", + "ACT_VM_PRIMARYATTACK_EMPTY", + "ACT_VM_RELOAD_EMPTY", + "ACT_VM_IDLE_EMPTY", + "ACT_VM_IDLE_DEPLOYED_EMPTY", + "ACT_VM_IDLE_8", + "ACT_VM_IDLE_7", + "ACT_VM_IDLE_6", + "ACT_VM_IDLE_5", + "ACT_VM_IDLE_4", + "ACT_VM_IDLE_3", + "ACT_VM_IDLE_2", + "ACT_VM_IDLE_1", + "ACT_VM_IDLE_DEPLOYED", + "ACT_VM_IDLE_DEPLOYED_8", + "ACT_VM_IDLE_DEPLOYED_7", + "ACT_VM_IDLE_DEPLOYED_6", + "ACT_VM_IDLE_DEPLOYED_5", + "ACT_VM_IDLE_DEPLOYED_4", + "ACT_VM_IDLE_DEPLOYED_3", + "ACT_VM_IDLE_DEPLOYED_2", + "ACT_VM_IDLE_DEPLOYED_1", + "ACT_VM_UNDEPLOY", + "ACT_VM_UNDEPLOY_8", + "ACT_VM_UNDEPLOY_7", + "ACT_VM_UNDEPLOY_6", + "ACT_VM_UNDEPLOY_5", + "ACT_VM_UNDEPLOY_4", + "ACT_VM_UNDEPLOY_3", + "ACT_VM_UNDEPLOY_2", + "ACT_VM_UNDEPLOY_1", + "ACT_VM_UNDEPLOY_EMPTY", + "ACT_VM_DEPLOY", + "ACT_VM_DEPLOY_8", + "ACT_VM_DEPLOY_7", + "ACT_VM_DEPLOY_6", + "ACT_VM_DEPLOY_5", + "ACT_VM_DEPLOY_4", + "ACT_VM_DEPLOY_3", + "ACT_VM_DEPLOY_2", + "ACT_VM_DEPLOY_1", + "ACT_VM_DEPLOY_EMPTY", + "ACT_VM_PRIMARYATTACK_8", + "ACT_VM_PRIMARYATTACK_7", + "ACT_VM_PRIMARYATTACK_6", + "ACT_VM_PRIMARYATTACK_5", + "ACT_VM_PRIMARYATTACK_4", + "ACT_VM_PRIMARYATTACK_3", + "ACT_VM_PRIMARYATTACK_2", + "ACT_VM_PRIMARYATTACK_1", + "ACT_VM_PRIMARYATTACK_DEPLOYED", + "ACT_VM_PRIMARYATTACK_DEPLOYED_8", + "ACT_VM_PRIMARYATTACK_DEPLOYED_7", + "ACT_VM_PRIMARYATTACK_DEPLOYED_6", + "ACT_VM_PRIMARYATTACK_DEPLOYED_5", + "ACT_VM_PRIMARYATTACK_DEPLOYED_4", + "ACT_VM_PRIMARYATTACK_DEPLOYED_3", + "ACT_VM_PRIMARYATTACK_DEPLOYED_2", + "ACT_VM_PRIMARYATTACK_DEPLOYED_1", + "ACT_VM_PRIMARYATTACK_DEPLOYED_EMPTY", + "ACT_DOD_DEPLOYED", + "ACT_DOD_PRONE_DEPLOYED", + "ACT_DOD_IDLE_ZOOMED", + "ACT_DOD_WALK_ZOOMED", + "ACT_DOD_CROUCH_ZOOMED", + "ACT_DOD_CROUCHWALK_ZOOMED", + "ACT_DOD_PRONE_ZOOMED", + "ACT_DOD_PRONE_FORWARD_ZOOMED", + "ACT_DOD_PRIMARYATTACK_DEPLOYED", + "ACT_DOD_PRIMARYATTACK_PRONE_DEPLOYED", + "ACT_DOD_RELOAD_DEPLOYED", + "ACT_DOD_RELOAD_PRONE_DEPLOYED", + "ACT_DOD_PRIMARYATTACK_PRONE", + "ACT_DOD_SECONDARYATTACK_PRONE", + "ACT_DOD_RELOAD_CROUCH", + "ACT_DOD_RELOAD_PRONE", + "ACT_DOD_STAND_IDLE", + "ACT_DOD_STAND_AIM", + "ACT_DOD_CROUCH_IDLE", + "ACT_DOD_CROUCH_AIM", + "ACT_DOD_CROUCHWALK_IDLE", + "ACT_DOD_CROUCHWALK_AIM", + "ACT_DOD_WALK_IDLE", + "ACT_DOD_WALK_AIM", + "ACT_DOD_RUN_IDLE", + "ACT_DOD_RUN_AIM", + "ACT_DOD_STAND_AIM_PISTOL", + "ACT_DOD_CROUCH_AIM_PISTOL", + "ACT_DOD_CROUCHWALK_AIM_PISTOL", + "ACT_DOD_WALK_AIM_PISTOL", + "ACT_DOD_RUN_AIM_PISTOL", + "ACT_DOD_PRONE_AIM_PISTOL", + "ACT_DOD_STAND_IDLE_PISTOL", + "ACT_DOD_CROUCH_IDLE_PISTOL", + "ACT_DOD_CROUCHWALK_IDLE_PISTOL", + "ACT_DOD_WALK_IDLE_PISTOL", + "ACT_DOD_RUN_IDLE_PISTOL", + "ACT_DOD_SPRINT_IDLE_PISTOL", + "ACT_DOD_PRONEWALK_IDLE_PISTOL", + "ACT_DOD_STAND_AIM_C96", + "ACT_DOD_CROUCH_AIM_C96", + "ACT_DOD_CROUCHWALK_AIM_C96", + "ACT_DOD_WALK_AIM_C96", + "ACT_DOD_RUN_AIM_C96", + "ACT_DOD_PRONE_AIM_C96", + "ACT_DOD_STAND_IDLE_C96", + "ACT_DOD_CROUCH_IDLE_C96", + "ACT_DOD_CROUCHWALK_IDLE_C96", + "ACT_DOD_WALK_IDLE_C96", + "ACT_DOD_RUN_IDLE_C96", + "ACT_DOD_SPRINT_IDLE_C96", + "ACT_DOD_PRONEWALK_IDLE_C96", + "ACT_DOD_STAND_AIM_RIFLE", + "ACT_DOD_CROUCH_AIM_RIFLE", + "ACT_DOD_CROUCHWALK_AIM_RIFLE", + "ACT_DOD_WALK_AIM_RIFLE", + "ACT_DOD_RUN_AIM_RIFLE", + "ACT_DOD_PRONE_AIM_RIFLE", + "ACT_DOD_STAND_IDLE_RIFLE", + "ACT_DOD_CROUCH_IDLE_RIFLE", + "ACT_DOD_CROUCHWALK_IDLE_RIFLE", + "ACT_DOD_WALK_IDLE_RIFLE", + "ACT_DOD_RUN_IDLE_RIFLE", + "ACT_DOD_SPRINT_IDLE_RIFLE", + "ACT_DOD_PRONEWALK_IDLE_RIFLE", + "ACT_DOD_STAND_AIM_BOLT", + "ACT_DOD_CROUCH_AIM_BOLT", + "ACT_DOD_CROUCHWALK_AIM_BOLT", + "ACT_DOD_WALK_AIM_BOLT", + "ACT_DOD_RUN_AIM_BOLT", + "ACT_DOD_PRONE_AIM_BOLT", + "ACT_DOD_STAND_IDLE_BOLT", + "ACT_DOD_CROUCH_IDLE_BOLT", + "ACT_DOD_CROUCHWALK_IDLE_BOLT", + "ACT_DOD_WALK_IDLE_BOLT", + "ACT_DOD_RUN_IDLE_BOLT", + "ACT_DOD_SPRINT_IDLE_BOLT", + "ACT_DOD_PRONEWALK_IDLE_BOLT", + "ACT_DOD_STAND_AIM_TOMMY", + "ACT_DOD_CROUCH_AIM_TOMMY", + "ACT_DOD_CROUCHWALK_AIM_TOMMY", + "ACT_DOD_WALK_AIM_TOMMY", + "ACT_DOD_RUN_AIM_TOMMY", + "ACT_DOD_PRONE_AIM_TOMMY", + "ACT_DOD_STAND_IDLE_TOMMY", + "ACT_DOD_CROUCH_IDLE_TOMMY", + "ACT_DOD_CROUCHWALK_IDLE_TOMMY", + "ACT_DOD_WALK_IDLE_TOMMY", + "ACT_DOD_RUN_IDLE_TOMMY", + "ACT_DOD_SPRINT_IDLE_TOMMY", + "ACT_DOD_PRONEWALK_IDLE_TOMMY", + "ACT_DOD_STAND_AIM_MP40", + "ACT_DOD_CROUCH_AIM_MP40", + "ACT_DOD_CROUCHWALK_AIM_MP40", + "ACT_DOD_WALK_AIM_MP40", + "ACT_DOD_RUN_AIM_MP40", + "ACT_DOD_PRONE_AIM_MP40", + "ACT_DOD_STAND_IDLE_MP40", + "ACT_DOD_CROUCH_IDLE_MP40", + "ACT_DOD_CROUCHWALK_IDLE_MP40", + "ACT_DOD_WALK_IDLE_MP40", + "ACT_DOD_RUN_IDLE_MP40", + "ACT_DOD_SPRINT_IDLE_MP40", + "ACT_DOD_PRONEWALK_IDLE_MP40", + "ACT_DOD_STAND_AIM_MP44", + "ACT_DOD_CROUCH_AIM_MP44", + "ACT_DOD_CROUCHWALK_AIM_MP44", + "ACT_DOD_WALK_AIM_MP44", + "ACT_DOD_RUN_AIM_MP44", + "ACT_DOD_PRONE_AIM_MP44", + "ACT_DOD_STAND_IDLE_MP44", + "ACT_DOD_CROUCH_IDLE_MP44", + "ACT_DOD_CROUCHWALK_IDLE_MP44", + "ACT_DOD_WALK_IDLE_MP44", + "ACT_DOD_RUN_IDLE_MP44", + "ACT_DOD_SPRINT_IDLE_MP44", + "ACT_DOD_PRONEWALK_IDLE_MP44", + "ACT_DOD_STAND_AIM_GREASE", + "ACT_DOD_CROUCH_AIM_GREASE", + "ACT_DOD_CROUCHWALK_AIM_GREASE", + "ACT_DOD_WALK_AIM_GREASE", + "ACT_DOD_RUN_AIM_GREASE", + "ACT_DOD_PRONE_AIM_GREASE", + "ACT_DOD_STAND_IDLE_GREASE", + "ACT_DOD_CROUCH_IDLE_GREASE", + "ACT_DOD_CROUCHWALK_IDLE_GREASE", + "ACT_DOD_WALK_IDLE_GREASE", + "ACT_DOD_RUN_IDLE_GREASE", + "ACT_DOD_SPRINT_IDLE_GREASE", + "ACT_DOD_PRONEWALK_IDLE_GREASE", + "ACT_DOD_STAND_AIM_MG", + "ACT_DOD_CROUCH_AIM_MG", + "ACT_DOD_CROUCHWALK_AIM_MG", + "ACT_DOD_WALK_AIM_MG", + "ACT_DOD_RUN_AIM_MG", + "ACT_DOD_PRONE_AIM_MG", + "ACT_DOD_STAND_IDLE_MG", + "ACT_DOD_CROUCH_IDLE_MG", + "ACT_DOD_CROUCHWALK_IDLE_MG", + "ACT_DOD_WALK_IDLE_MG", + "ACT_DOD_RUN_IDLE_MG", + "ACT_DOD_SPRINT_IDLE_MG", + "ACT_DOD_PRONEWALK_IDLE_MG", + "ACT_DOD_STAND_AIM_30CAL", + "ACT_DOD_CROUCH_AIM_30CAL", + "ACT_DOD_CROUCHWALK_AIM_30CAL", + "ACT_DOD_WALK_AIM_30CAL", + "ACT_DOD_RUN_AIM_30CAL", + "ACT_DOD_PRONE_AIM_30CAL", + "ACT_DOD_STAND_IDLE_30CAL", + "ACT_DOD_CROUCH_IDLE_30CAL", + "ACT_DOD_CROUCHWALK_IDLE_30CAL", + "ACT_DOD_WALK_IDLE_30CAL", + "ACT_DOD_RUN_IDLE_30CAL", + "ACT_DOD_SPRINT_IDLE_30CAL", + "ACT_DOD_PRONEWALK_IDLE_30CAL", + "ACT_DOD_STAND_AIM_GREN_FRAG", + "ACT_DOD_CROUCH_AIM_GREN_FRAG", + "ACT_DOD_CROUCHWALK_AIM_GREN_FRAG", + "ACT_DOD_WALK_AIM_GREN_FRAG", + "ACT_DOD_RUN_AIM_GREN_FRAG", + "ACT_DOD_PRONE_AIM_GREN_FRAG", + "ACT_DOD_SPRINT_AIM_GREN_FRAG", + "ACT_DOD_PRONEWALK_AIM_GREN_FRAG", + "ACT_DOD_STAND_AIM_GREN_STICK", + "ACT_DOD_CROUCH_AIM_GREN_STICK", + "ACT_DOD_CROUCHWALK_AIM_GREN_STICK", + "ACT_DOD_WALK_AIM_GREN_STICK", + "ACT_DOD_RUN_AIM_GREN_STICK", + "ACT_DOD_PRONE_AIM_GREN_STICK", + "ACT_DOD_SPRINT_AIM_GREN_STICK", + "ACT_DOD_PRONEWALK_AIM_GREN_STICK", + "ACT_DOD_STAND_AIM_KNIFE", + "ACT_DOD_CROUCH_AIM_KNIFE", + "ACT_DOD_CROUCHWALK_AIM_KNIFE", + "ACT_DOD_WALK_AIM_KNIFE", + "ACT_DOD_RUN_AIM_KNIFE", + "ACT_DOD_PRONE_AIM_KNIFE", + "ACT_DOD_SPRINT_AIM_KNIFE", + "ACT_DOD_PRONEWALK_AIM_KNIFE", + "ACT_DOD_STAND_AIM_SPADE", + "ACT_DOD_CROUCH_AIM_SPADE", + "ACT_DOD_CROUCHWALK_AIM_SPADE", + "ACT_DOD_WALK_AIM_SPADE", + "ACT_DOD_RUN_AIM_SPADE", + "ACT_DOD_PRONE_AIM_SPADE", + "ACT_DOD_SPRINT_AIM_SPADE", + "ACT_DOD_PRONEWALK_AIM_SPADE", + "ACT_DOD_STAND_AIM_BAZOOKA", + "ACT_DOD_CROUCH_AIM_BAZOOKA", + "ACT_DOD_CROUCHWALK_AIM_BAZOOKA", + "ACT_DOD_WALK_AIM_BAZOOKA", + "ACT_DOD_RUN_AIM_BAZOOKA", + "ACT_DOD_PRONE_AIM_BAZOOKA", + "ACT_DOD_STAND_IDLE_BAZOOKA", + "ACT_DOD_CROUCH_IDLE_BAZOOKA", + "ACT_DOD_CROUCHWALK_IDLE_BAZOOKA", + "ACT_DOD_WALK_IDLE_BAZOOKA", + "ACT_DOD_RUN_IDLE_BAZOOKA", + "ACT_DOD_SPRINT_IDLE_BAZOOKA", + "ACT_DOD_PRONEWALK_IDLE_BAZOOKA", + "ACT_DOD_STAND_AIM_PSCHRECK", + "ACT_DOD_CROUCH_AIM_PSCHRECK", + "ACT_DOD_CROUCHWALK_AIM_PSCHRECK", + "ACT_DOD_WALK_AIM_PSCHRECK", + "ACT_DOD_RUN_AIM_PSCHRECK", + "ACT_DOD_PRONE_AIM_PSCHRECK", + "ACT_DOD_STAND_IDLE_PSCHRECK", + "ACT_DOD_CROUCH_IDLE_PSCHRECK", + "ACT_DOD_CROUCHWALK_IDLE_PSCHRECK", + "ACT_DOD_WALK_IDLE_PSCHRECK", + "ACT_DOD_RUN_IDLE_PSCHRECK", + "ACT_DOD_SPRINT_IDLE_PSCHRECK", + "ACT_DOD_PRONEWALK_IDLE_PSCHRECK", + "ACT_DOD_STAND_AIM_BAR", + "ACT_DOD_CROUCH_AIM_BAR", + "ACT_DOD_CROUCHWALK_AIM_BAR", + "ACT_DOD_WALK_AIM_BAR", + "ACT_DOD_RUN_AIM_BAR", + "ACT_DOD_PRONE_AIM_BAR", + "ACT_DOD_STAND_IDLE_BAR", + "ACT_DOD_CROUCH_IDLE_BAR", + "ACT_DOD_CROUCHWALK_IDLE_BAR", + "ACT_DOD_WALK_IDLE_BAR", + "ACT_DOD_RUN_IDLE_BAR", + "ACT_DOD_SPRINT_IDLE_BAR", + "ACT_DOD_PRONEWALK_IDLE_BAR", + "ACT_DOD_STAND_ZOOM_RIFLE", + "ACT_DOD_CROUCH_ZOOM_RIFLE", + "ACT_DOD_CROUCHWALK_ZOOM_RIFLE", + "ACT_DOD_WALK_ZOOM_RIFLE", + "ACT_DOD_RUN_ZOOM_RIFLE", + "ACT_DOD_PRONE_ZOOM_RIFLE", + "ACT_DOD_STAND_ZOOM_BOLT", + "ACT_DOD_CROUCH_ZOOM_BOLT", + "ACT_DOD_CROUCHWALK_ZOOM_BOLT", + "ACT_DOD_WALK_ZOOM_BOLT", + "ACT_DOD_RUN_ZOOM_BOLT", + "ACT_DOD_PRONE_ZOOM_BOLT", + "ACT_DOD_STAND_ZOOM_BAZOOKA", + "ACT_DOD_CROUCH_ZOOM_BAZOOKA", + "ACT_DOD_CROUCHWALK_ZOOM_BAZOOKA", + "ACT_DOD_WALK_ZOOM_BAZOOKA", + "ACT_DOD_RUN_ZOOM_BAZOOKA", + "ACT_DOD_PRONE_ZOOM_BAZOOKA", + "ACT_DOD_STAND_ZOOM_PSCHRECK", + "ACT_DOD_CROUCH_ZOOM_PSCHRECK", + "ACT_DOD_CROUCHWALK_ZOOM_PSCHRECK", + "ACT_DOD_WALK_ZOOM_PSCHRECK", + "ACT_DOD_RUN_ZOOM_PSCHRECK", + "ACT_DOD_PRONE_ZOOM_PSCHRECK", + "ACT_DOD_DEPLOY_RIFLE", + "ACT_DOD_DEPLOY_TOMMY", + "ACT_DOD_DEPLOY_MG", + "ACT_DOD_DEPLOY_30CAL", + "ACT_DOD_PRONE_DEPLOY_RIFLE", + "ACT_DOD_PRONE_DEPLOY_TOMMY", + "ACT_DOD_PRONE_DEPLOY_MG", + "ACT_DOD_PRONE_DEPLOY_30CAL", + "ACT_DOD_PRIMARYATTACK_RIFLE", + "ACT_DOD_SECONDARYATTACK_RIFLE", + "ACT_DOD_PRIMARYATTACK_PRONE_RIFLE", + "ACT_DOD_SECONDARYATTACK_PRONE_RIFLE", + "ACT_DOD_PRIMARYATTACK_PRONE_DEPLOYED_RIFLE", + "ACT_DOD_PRIMARYATTACK_DEPLOYED_RIFLE", + "ACT_DOD_PRIMARYATTACK_BOLT", + "ACT_DOD_SECONDARYATTACK_BOLT", + "ACT_DOD_PRIMARYATTACK_PRONE_BOLT", + "ACT_DOD_SECONDARYATTACK_PRONE_BOLT", + "ACT_DOD_PRIMARYATTACK_TOMMY", + "ACT_DOD_PRIMARYATTACK_PRONE_TOMMY", + "ACT_DOD_SECONDARYATTACK_TOMMY", + "ACT_DOD_SECONDARYATTACK_PRONE_TOMMY", + "ACT_DOD_PRIMARYATTACK_MP40", + "ACT_DOD_PRIMARYATTACK_PRONE_MP40", + "ACT_DOD_SECONDARYATTACK_MP40", + "ACT_DOD_SECONDARYATTACK_PRONE_MP40", + "ACT_DOD_PRIMARYATTACK_MP44", + "ACT_DOD_PRIMARYATTACK_PRONE_MP44", + "ACT_DOD_PRIMARYATTACK_GREASE", + "ACT_DOD_PRIMARYATTACK_PRONE_GREASE", + "ACT_DOD_PRIMARYATTACK_PISTOL", + "ACT_DOD_PRIMARYATTACK_PRONE_PISTOL", + "ACT_DOD_PRIMARYATTACK_C96", + "ACT_DOD_PRIMARYATTACK_PRONE_C96", + "ACT_DOD_PRIMARYATTACK_MG", + "ACT_DOD_PRIMARYATTACK_PRONE_MG", + "ACT_DOD_PRIMARYATTACK_PRONE_DEPLOYED_MG", + "ACT_DOD_PRIMARYATTACK_DEPLOYED_MG", + "ACT_DOD_PRIMARYATTACK_30CAL", + "ACT_DOD_PRIMARYATTACK_PRONE_30CAL", + "ACT_DOD_PRIMARYATTACK_DEPLOYED_30CAL", + "ACT_DOD_PRIMARYATTACK_PRONE_DEPLOYED_30CAL", + "ACT_DOD_PRIMARYATTACK_GREN_FRAG", + "ACT_DOD_PRIMARYATTACK_PRONE_GREN_FRAG", + "ACT_DOD_PRIMARYATTACK_GREN_STICK", + "ACT_DOD_PRIMARYATTACK_PRONE_GREN_STICK", + "ACT_DOD_PRIMARYATTACK_KNIFE", + "ACT_DOD_PRIMARYATTACK_PRONE_KNIFE", + "ACT_DOD_PRIMARYATTACK_SPADE", + "ACT_DOD_PRIMARYATTACK_PRONE_SPADE", + "ACT_DOD_PRIMARYATTACK_BAZOOKA", + "ACT_DOD_PRIMARYATTACK_PRONE_BAZOOKA", + "ACT_DOD_PRIMARYATTACK_PSCHRECK", + "ACT_DOD_PRIMARYATTACK_PRONE_PSCHRECK", + "ACT_DOD_PRIMARYATTACK_BAR", + "ACT_DOD_PRIMARYATTACK_PRONE_BAR", + "ACT_DOD_RELOAD_GARAND", + "ACT_DOD_RELOAD_K43", + "ACT_DOD_RELOAD_BAR", + "ACT_DOD_RELOAD_MP40", + "ACT_DOD_RELOAD_MP44", + "ACT_DOD_RELOAD_BOLT", + "ACT_DOD_RELOAD_M1CARBINE", + "ACT_DOD_RELOAD_TOMMY", + "ACT_DOD_RELOAD_GREASEGUN", + "ACT_DOD_RELOAD_PISTOL", + "ACT_DOD_RELOAD_FG42", + "ACT_DOD_RELOAD_RIFLE", + "ACT_DOD_RELOAD_RIFLEGRENADE", + "ACT_DOD_RELOAD_C96", + "ACT_DOD_RELOAD_CROUCH_BAR", + "ACT_DOD_RELOAD_CROUCH_RIFLE", + "ACT_DOD_RELOAD_CROUCH_RIFLEGRENADE", + "ACT_DOD_RELOAD_CROUCH_BOLT", + "ACT_DOD_RELOAD_CROUCH_MP44", + "ACT_DOD_RELOAD_CROUCH_MP40", + "ACT_DOD_RELOAD_CROUCH_TOMMY", + "ACT_DOD_RELOAD_CROUCH_BAZOOKA", + "ACT_DOD_RELOAD_CROUCH_PSCHRECK", + "ACT_DOD_RELOAD_CROUCH_PISTOL", + "ACT_DOD_RELOAD_CROUCH_M1CARBINE", + "ACT_DOD_RELOAD_CROUCH_C96", + "ACT_DOD_RELOAD_BAZOOKA", + "ACT_DOD_ZOOMLOAD_BAZOOKA", + "ACT_DOD_RELOAD_PSCHRECK", + "ACT_DOD_ZOOMLOAD_PSCHRECK", + "ACT_DOD_RELOAD_DEPLOYED_FG42", + "ACT_DOD_RELOAD_DEPLOYED_30CAL", + "ACT_DOD_RELOAD_DEPLOYED_MG", + "ACT_DOD_RELOAD_DEPLOYED_MG34", + "ACT_DOD_RELOAD_DEPLOYED_BAR", + "ACT_DOD_RELOAD_PRONE_PISTOL", + "ACT_DOD_RELOAD_PRONE_GARAND", + "ACT_DOD_RELOAD_PRONE_M1CARBINE", + "ACT_DOD_RELOAD_PRONE_BOLT", + "ACT_DOD_RELOAD_PRONE_K43", + "ACT_DOD_RELOAD_PRONE_MP40", + "ACT_DOD_RELOAD_PRONE_MP44", + "ACT_DOD_RELOAD_PRONE_BAR", + "ACT_DOD_RELOAD_PRONE_GREASEGUN", + "ACT_DOD_RELOAD_PRONE_TOMMY", + "ACT_DOD_RELOAD_PRONE_FG42", + "ACT_DOD_RELOAD_PRONE_RIFLE", + "ACT_DOD_RELOAD_PRONE_RIFLEGRENADE", + "ACT_DOD_RELOAD_PRONE_C96", + "ACT_DOD_RELOAD_PRONE_BAZOOKA", + "ACT_DOD_ZOOMLOAD_PRONE_BAZOOKA", + "ACT_DOD_RELOAD_PRONE_PSCHRECK", + "ACT_DOD_ZOOMLOAD_PRONE_PSCHRECK", + "ACT_DOD_RELOAD_PRONE_DEPLOYED_BAR", + "ACT_DOD_RELOAD_PRONE_DEPLOYED_FG42", + "ACT_DOD_RELOAD_PRONE_DEPLOYED_30CAL", + "ACT_DOD_RELOAD_PRONE_DEPLOYED_MG", + "ACT_DOD_RELOAD_PRONE_DEPLOYED_MG34", + "ACT_DOD_PRONE_ZOOM_FORWARD_RIFLE", + "ACT_DOD_PRONE_ZOOM_FORWARD_BOLT", + "ACT_DOD_PRONE_ZOOM_FORWARD_BAZOOKA", + "ACT_DOD_PRONE_ZOOM_FORWARD_PSCHRECK", + "ACT_DOD_PRIMARYATTACK_CROUCH", + "ACT_DOD_PRIMARYATTACK_CROUCH_SPADE", + "ACT_DOD_PRIMARYATTACK_CROUCH_KNIFE", + "ACT_DOD_PRIMARYATTACK_CROUCH_GREN_FRAG", + "ACT_DOD_PRIMARYATTACK_CROUCH_GREN_STICK", + "ACT_DOD_SECONDARYATTACK_CROUCH", + "ACT_DOD_SECONDARYATTACK_CROUCH_TOMMY", + "ACT_DOD_SECONDARYATTACK_CROUCH_MP40", + "ACT_DOD_HS_IDLE", + "ACT_DOD_HS_CROUCH", + "ACT_DOD_HS_IDLE_30CAL", + "ACT_DOD_HS_IDLE_BAZOOKA", + "ACT_DOD_HS_IDLE_PSCHRECK", + "ACT_DOD_HS_IDLE_KNIFE", + "ACT_DOD_HS_IDLE_MG42", + "ACT_DOD_HS_IDLE_PISTOL", + "ACT_DOD_HS_IDLE_STICKGRENADE", + "ACT_DOD_HS_IDLE_TOMMY", + "ACT_DOD_HS_IDLE_MP44", + "ACT_DOD_HS_IDLE_K98", + "ACT_DOD_HS_CROUCH_30CAL", + "ACT_DOD_HS_CROUCH_BAZOOKA", + "ACT_DOD_HS_CROUCH_PSCHRECK", + "ACT_DOD_HS_CROUCH_KNIFE", + "ACT_DOD_HS_CROUCH_MG42", + "ACT_DOD_HS_CROUCH_PISTOL", + "ACT_DOD_HS_CROUCH_STICKGRENADE", + "ACT_DOD_HS_CROUCH_TOMMY", + "ACT_DOD_HS_CROUCH_MP44", + "ACT_DOD_HS_CROUCH_K98", + "ACT_DOD_STAND_IDLE_TNT", + "ACT_DOD_CROUCH_IDLE_TNT", + "ACT_DOD_CROUCHWALK_IDLE_TNT", + "ACT_DOD_WALK_IDLE_TNT", + "ACT_DOD_RUN_IDLE_TNT", + "ACT_DOD_SPRINT_IDLE_TNT", + "ACT_DOD_PRONEWALK_IDLE_TNT", + "ACT_DOD_PLANT_TNT", + "ACT_DOD_DEFUSE_TNT", + "ACT_VM_FIZZLE", + "ACT_MP_STAND_IDLE", + "ACT_MP_CROUCH_IDLE", + "ACT_MP_CROUCH_DEPLOYED_IDLE", + "ACT_MP_CROUCH_DEPLOYED", + "ACT_MP_DEPLOYED_IDLE", + "ACT_MP_RUN", + "ACT_MP_WALK", + "ACT_MP_AIRWALK", + "ACT_MP_CROUCHWALK", + "ACT_MP_SPRINT", + "ACT_MP_JUMP", + "ACT_MP_JUMP_START", + "ACT_MP_JUMP_FLOAT", + "ACT_MP_JUMP_LAND", + "ACT_MP_DOUBLEJUMP", + "ACT_MP_SWIM", + "ACT_MP_DEPLOYED", + "ACT_MP_SWIM_DEPLOYED", + "ACT_MP_VCD", + "ACT_MP_SWIM_IDLE", + "ACT_MP_ATTACK_STAND_PRIMARYFIRE", + "ACT_MP_ATTACK_STAND_PRIMARYFIRE_DEPLOYED", + "ACT_MP_ATTACK_STAND_SECONDARYFIRE", + "ACT_MP_ATTACK_STAND_GRENADE", + "ACT_MP_ATTACK_CROUCH_PRIMARYFIRE", + "ACT_MP_ATTACK_CROUCH_PRIMARYFIRE_DEPLOYED", + "ACT_MP_ATTACK_CROUCH_SECONDARYFIRE", + "ACT_MP_ATTACK_CROUCH_GRENADE", + "ACT_MP_ATTACK_SWIM_PRIMARYFIRE", + "ACT_MP_ATTACK_SWIM_SECONDARYFIRE", + "ACT_MP_ATTACK_SWIM_GRENADE", + "ACT_MP_ATTACK_AIRWALK_PRIMARYFIRE", + "ACT_MP_ATTACK_AIRWALK_SECONDARYFIRE", + "ACT_MP_ATTACK_AIRWALK_GRENADE", + "ACT_MP_RELOAD_STAND", + "ACT_MP_RELOAD_STAND_LOOP", + "ACT_MP_RELOAD_STAND_END", + "ACT_MP_RELOAD_CROUCH", + "ACT_MP_RELOAD_CROUCH_LOOP", + "ACT_MP_RELOAD_CROUCH_END", + "ACT_MP_RELOAD_SWIM", + "ACT_MP_RELOAD_SWIM_LOOP", + "ACT_MP_RELOAD_SWIM_END", + "ACT_MP_RELOAD_AIRWALK", + "ACT_MP_RELOAD_AIRWALK_LOOP", + "ACT_MP_RELOAD_AIRWALK_END", + "ACT_MP_ATTACK_STAND_PREFIRE", + "ACT_MP_ATTACK_STAND_POSTFIRE", + "ACT_MP_ATTACK_STAND_STARTFIRE", + "ACT_MP_ATTACK_CROUCH_PREFIRE", + "ACT_MP_ATTACK_CROUCH_POSTFIRE", + "ACT_MP_ATTACK_SWIM_PREFIRE", + "ACT_MP_ATTACK_SWIM_POSTFIRE", + "ACT_MP_STAND_PRIMARY", + "ACT_MP_CROUCH_PRIMARY", + "ACT_MP_RUN_PRIMARY", + "ACT_MP_WALK_PRIMARY", + "ACT_MP_AIRWALK_PRIMARY", + "ACT_MP_CROUCHWALK_PRIMARY", + "ACT_MP_JUMP_PRIMARY", + "ACT_MP_JUMP_START_PRIMARY", + "ACT_MP_JUMP_FLOAT_PRIMARY", + "ACT_MP_JUMP_LAND_PRIMARY", + "ACT_MP_SWIM_PRIMARY", + "ACT_MP_DEPLOYED_PRIMARY", + "ACT_MP_SWIM_DEPLOYED_PRIMARY", + "ACT_MP_ATTACK_STAND_PRIMARY", + "ACT_MP_ATTACK_STAND_PRIMARY_DEPLOYED", + "ACT_MP_ATTACK_CROUCH_PRIMARY", + "ACT_MP_ATTACK_CROUCH_PRIMARY_DEPLOYED", + "ACT_MP_ATTACK_SWIM_PRIMARY", + "ACT_MP_ATTACK_AIRWALK_PRIMARY", + "ACT_MP_RELOAD_STAND_PRIMARY", + "ACT_MP_RELOAD_STAND_PRIMARY_LOOP", + "ACT_MP_RELOAD_STAND_PRIMARY_END", + "ACT_MP_RELOAD_CROUCH_PRIMARY", + "ACT_MP_RELOAD_CROUCH_PRIMARY_LOOP", + "ACT_MP_RELOAD_CROUCH_PRIMARY_END", + "ACT_MP_RELOAD_SWIM_PRIMARY", + "ACT_MP_RELOAD_SWIM_PRIMARY_LOOP", + "ACT_MP_RELOAD_SWIM_PRIMARY_END", + "ACT_MP_RELOAD_AIRWALK_PRIMARY", + "ACT_MP_RELOAD_AIRWALK_PRIMARY_LOOP", + "ACT_MP_RELOAD_AIRWALK_PRIMARY_END", + "ACT_MP_ATTACK_STAND_GRENADE_PRIMARY", + "ACT_MP_ATTACK_CROUCH_GRENADE_PRIMARY", + "ACT_MP_ATTACK_SWIM_GRENADE_PRIMARY", + "ACT_MP_ATTACK_AIRWALK_GRENADE_PRIMARY", + "ACT_MP_STAND_SECONDARY", + "ACT_MP_CROUCH_SECONDARY", + "ACT_MP_RUN_SECONDARY", + "ACT_MP_WALK_SECONDARY", + "ACT_MP_AIRWALK_SECONDARY", + "ACT_MP_CROUCHWALK_SECONDARY", + "ACT_MP_JUMP_SECONDARY", + "ACT_MP_JUMP_START_SECONDARY", + "ACT_MP_JUMP_FLOAT_SECONDARY", + "ACT_MP_JUMP_LAND_SECONDARY", + "ACT_MP_SWIM_SECONDARY", + "ACT_MP_ATTACK_STAND_SECONDARY", + "ACT_MP_ATTACK_CROUCH_SECONDARY", + "ACT_MP_ATTACK_SWIM_SECONDARY", + "ACT_MP_ATTACK_AIRWALK_SECONDARY", + "ACT_MP_RELOAD_STAND_SECONDARY", + "ACT_MP_RELOAD_STAND_SECONDARY_LOOP", + "ACT_MP_RELOAD_STAND_SECONDARY_END", + "ACT_MP_RELOAD_CROUCH_SECONDARY", + "ACT_MP_RELOAD_CROUCH_SECONDARY_LOOP", + "ACT_MP_RELOAD_CROUCH_SECONDARY_END", + "ACT_MP_RELOAD_SWIM_SECONDARY", + "ACT_MP_RELOAD_SWIM_SECONDARY_LOOP", + "ACT_MP_RELOAD_SWIM_SECONDARY_END", + "ACT_MP_RELOAD_AIRWALK_SECONDARY", + "ACT_MP_RELOAD_AIRWALK_SECONDARY_LOOP", + "ACT_MP_RELOAD_AIRWALK_SECONDARY_END", + "ACT_MP_ATTACK_STAND_GRENADE_SECONDARY", + "ACT_MP_ATTACK_CROUCH_GRENADE_SECONDARY", + "ACT_MP_ATTACK_SWIM_GRENADE_SECONDARY", + "ACT_MP_ATTACK_AIRWALK_GRENADE_SECONDARY", + "ACT_MP_STAND_MELEE", + "ACT_MP_CROUCH_MELEE", + "ACT_MP_RUN_MELEE", + "ACT_MP_WALK_MELEE", + "ACT_MP_AIRWALK_MELEE", + "ACT_MP_CROUCHWALK_MELEE", + "ACT_MP_JUMP_MELEE", + "ACT_MP_JUMP_START_MELEE", + "ACT_MP_JUMP_FLOAT_MELEE", + "ACT_MP_JUMP_LAND_MELEE", + "ACT_MP_SWIM_MELEE", + "ACT_MP_ATTACK_STAND_MELEE", + "ACT_MP_ATTACK_STAND_MELEE_SECONDARY", + "ACT_MP_ATTACK_CROUCH_MELEE", + "ACT_MP_ATTACK_CROUCH_MELEE_SECONDARY", + "ACT_MP_ATTACK_SWIM_MELEE", + "ACT_MP_ATTACK_AIRWALK_MELEE", + "ACT_MP_ATTACK_STAND_GRENADE_MELEE", + "ACT_MP_ATTACK_CROUCH_GRENADE_MELEE", + "ACT_MP_ATTACK_SWIM_GRENADE_MELEE", + "ACT_MP_ATTACK_AIRWALK_GRENADE_MELEE", + "ACT_MP_GESTURE_FLINCH", + "ACT_MP_GESTURE_FLINCH_PRIMARY", + "ACT_MP_GESTURE_FLINCH_SECONDARY", + "ACT_MP_GESTURE_FLINCH_MELEE", + "ACT_MP_GESTURE_FLINCH_HEAD", + "ACT_MP_GESTURE_FLINCH_CHEST", + "ACT_MP_GESTURE_FLINCH_STOMACH", + "ACT_MP_GESTURE_FLINCH_LEFTARM", + "ACT_MP_GESTURE_FLINCH_RIGHTARM", + "ACT_MP_GESTURE_FLINCH_LEFTLEG", + "ACT_MP_GESTURE_FLINCH_RIGHTLEG", + "ACT_MP_GRENADE1_DRAW", + "ACT_MP_GRENADE1_IDLE", + "ACT_MP_GRENADE1_ATTACK", + "ACT_MP_GRENADE2_DRAW", + "ACT_MP_GRENADE2_IDLE", + "ACT_MP_GRENADE2_ATTACK", + "ACT_MP_PRIMARY_GRENADE1_DRAW", + "ACT_MP_PRIMARY_GRENADE1_IDLE", + "ACT_MP_PRIMARY_GRENADE1_ATTACK", + "ACT_MP_PRIMARY_GRENADE2_DRAW", + "ACT_MP_PRIMARY_GRENADE2_IDLE", + "ACT_MP_PRIMARY_GRENADE2_ATTACK", + "ACT_MP_SECONDARY_GRENADE1_DRAW", + "ACT_MP_SECONDARY_GRENADE1_IDLE", + "ACT_MP_SECONDARY_GRENADE1_ATTACK", + "ACT_MP_SECONDARY_GRENADE2_DRAW", + "ACT_MP_SECONDARY_GRENADE2_IDLE", + "ACT_MP_SECONDARY_GRENADE2_ATTACK", + "ACT_MP_MELEE_GRENADE1_DRAW", + "ACT_MP_MELEE_GRENADE1_IDLE", + "ACT_MP_MELEE_GRENADE1_ATTACK", + "ACT_MP_MELEE_GRENADE2_DRAW", + "ACT_MP_MELEE_GRENADE2_IDLE", + "ACT_MP_MELEE_GRENADE2_ATTACK", + "ACT_MP_STAND_BUILDING", + "ACT_MP_CROUCH_BUILDING", + "ACT_MP_RUN_BUILDING", + "ACT_MP_WALK_BUILDING", + "ACT_MP_AIRWALK_BUILDING", + "ACT_MP_CROUCHWALK_BUILDING", + "ACT_MP_JUMP_BUILDING", + "ACT_MP_JUMP_START_BUILDING", + "ACT_MP_JUMP_FLOAT_BUILDING", + "ACT_MP_JUMP_LAND_BUILDING", + "ACT_MP_SWIM_BUILDING", + "ACT_MP_ATTACK_STAND_BUILDING", + "ACT_MP_ATTACK_CROUCH_BUILDING", + "ACT_MP_ATTACK_SWIM_BUILDING", + "ACT_MP_ATTACK_AIRWALK_BUILDING", + "ACT_MP_ATTACK_STAND_GRENADE_BUILDING", + "ACT_MP_ATTACK_CROUCH_GRENADE_BUILDING", + "ACT_MP_ATTACK_SWIM_GRENADE_BUILDING", + "ACT_MP_ATTACK_AIRWALK_GRENADE_BUILDING", + "ACT_MP_STAND_PDA", + "ACT_MP_CROUCH_PDA", + "ACT_MP_RUN_PDA", + "ACT_MP_WALK_PDA", + "ACT_MP_AIRWALK_PDA", + "ACT_MP_CROUCHWALK_PDA", + "ACT_MP_JUMP_PDA", + "ACT_MP_JUMP_START_PDA", + "ACT_MP_JUMP_FLOAT_PDA", + "ACT_MP_JUMP_LAND_PDA", + "ACT_MP_SWIM_PDA", + "ACT_MP_ATTACK_STAND_PDA", + "ACT_MP_ATTACK_SWIM_PDA", + "ACT_MP_GESTURE_VC_HANDMOUTH", + "ACT_MP_GESTURE_VC_FINGERPOINT", + "ACT_MP_GESTURE_VC_FISTPUMP", + "ACT_MP_GESTURE_VC_THUMBSUP", + "ACT_MP_GESTURE_VC_NODYES", + "ACT_MP_GESTURE_VC_NODNO", + "ACT_MP_GESTURE_VC_HANDMOUTH_PRIMARY", + "ACT_MP_GESTURE_VC_FINGERPOINT_PRIMARY", + "ACT_MP_GESTURE_VC_FISTPUMP_PRIMARY", + "ACT_MP_GESTURE_VC_THUMBSUP_PRIMARY", + "ACT_MP_GESTURE_VC_NODYES_PRIMARY", + "ACT_MP_GESTURE_VC_NODNO_PRIMARY", + "ACT_MP_GESTURE_VC_HANDMOUTH_SECONDARY", + "ACT_MP_GESTURE_VC_FINGERPOINT_SECONDARY", + "ACT_MP_GESTURE_VC_FISTPUMP_SECONDARY", + "ACT_MP_GESTURE_VC_THUMBSUP_SECONDARY", + "ACT_MP_GESTURE_VC_NODYES_SECONDARY", + "ACT_MP_GESTURE_VC_NODNO_SECONDARY", + "ACT_MP_GESTURE_VC_HANDMOUTH_MELEE", + "ACT_MP_GESTURE_VC_FINGERPOINT_MELEE", + "ACT_MP_GESTURE_VC_FISTPUMP_MELEE", + "ACT_MP_GESTURE_VC_THUMBSUP_MELEE", + "ACT_MP_GESTURE_VC_NODYES_MELEE", + "ACT_MP_GESTURE_VC_NODNO_MELEE", + "ACT_MP_GESTURE_VC_HANDMOUTH_BUILDING", + "ACT_MP_GESTURE_VC_FINGERPOINT_BUILDING", + "ACT_MP_GESTURE_VC_FISTPUMP_BUILDING", + "ACT_MP_GESTURE_VC_THUMBSUP_BUILDING", + "ACT_MP_GESTURE_VC_NODYES_BUILDING", + "ACT_MP_GESTURE_VC_NODNO_BUILDING", + "ACT_MP_GESTURE_VC_HANDMOUTH_PDA", + "ACT_MP_GESTURE_VC_FINGERPOINT_PDA", + "ACT_MP_GESTURE_VC_FISTPUMP_PDA", + "ACT_MP_GESTURE_VC_THUMBSUP_PDA", + "ACT_MP_GESTURE_VC_NODYES_PDA", + "ACT_MP_GESTURE_VC_NODNO_PDA", + "ACT_VM_UNUSABLE", + "ACT_VM_UNUSABLE_TO_USABLE", + "ACT_VM_USABLE_TO_UNUSABLE", + "ACT_GMOD_GESTURE_AGREE", + "ACT_GMOD_GESTURE_BECON", + "ACT_GMOD_GESTURE_BOW", + "ACT_GMOD_GESTURE_DISAGREE", + "ACT_GMOD_TAUNT_SALUTE", + "ACT_GMOD_GESTURE_WAVE", + "ACT_GMOD_TAUNT_PERSISTENCE", + "ACT_GMOD_TAUNT_MUSCLE", + "ACT_GMOD_TAUNT_LAUGH", + "ACT_GMOD_GESTURE_POINT", + "ACT_GMOD_TAUNT_CHEER", + "ACT_HL2MP_RUN_FAST", + "ACT_HL2MP_RUN_CHARGING", + "ACT_HL2MP_RUN_PANICKED", + "ACT_HL2MP_RUN_PROTECTED", + "ACT_HL2MP_IDLE_MELEE_ANGRY", + "ACT_HL2MP_ZOMBIE_SLUMP_IDLE", + "ACT_HL2MP_ZOMBIE_SLUMP_RISE", + "ACT_HL2MP_WALK_ZOMBIE_01", + "ACT_HL2MP_WALK_ZOMBIE_02", + "ACT_HL2MP_WALK_ZOMBIE_03", + "ACT_HL2MP_WALK_ZOMBIE_04", + "ACT_HL2MP_WALK_ZOMBIE_05", + "ACT_HL2MP_WALK_CROUCH_ZOMBIE_01", + "ACT_HL2MP_WALK_CROUCH_ZOMBIE_02", + "ACT_HL2MP_WALK_CROUCH_ZOMBIE_03", + "ACT_HL2MP_WALK_CROUCH_ZOMBIE_04", + "ACT_HL2MP_WALK_CROUCH_ZOMBIE_05", + "ACT_HL2MP_IDLE_CROUCH_ZOMBIE_01", + "ACT_HL2MP_IDLE_CROUCH_ZOMBIE_02", + "ACT_GMOD_GESTURE_RANGE_ZOMBIE", + "ACT_GMOD_GESTURE_TAUNT_ZOMBIE", + "ACT_GMOD_TAUNT_DANCE", + "ACT_GMOD_TAUNT_ROBOT", + "ACT_GMOD_GESTURE_RANGE_ZOMBIE_SPECIAL", + "ACT_GMOD_GESTURE_RANGE_FRENZY", + "ACT_HL2MP_RUN_ZOMBIE_FAST", + "ACT_HL2MP_WALK_ZOMBIE_06", + "ACT_ZOMBIE_LEAP_START", + "ACT_ZOMBIE_LEAPING", + "ACT_ZOMBIE_CLIMB_UP", + "ACT_ZOMBIE_CLIMB_START", + "ACT_ZOMBIE_CLIMB_END", + "ACT_HL2MP_IDLE_MAGIC", + "ACT_HL2MP_WALK_MAGIC", + "ACT_HL2MP_RUN_MAGIC", + "ACT_HL2MP_IDLE_CROUCH_MAGIC", + "ACT_HL2MP_WALK_CROUCH_MAGIC", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_MAGIC", + "ACT_HL2MP_GESTURE_RELOAD_MAGIC", + "ACT_HL2MP_JUMP_MAGIC", + "ACT_HL2MP_SWIM_IDLE_MAGIC", + "ACT_HL2MP_SWIM_MAGIC", + "ACT_HL2MP_IDLE_REVOLVER", + "ACT_HL2MP_WALK_REVOLVER", + "ACT_HL2MP_RUN_REVOLVER", + "ACT_HL2MP_IDLE_CROUCH_REVOLVER", + "ACT_HL2MP_WALK_CROUCH_REVOLVER", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_REVOLVER", + "ACT_HL2MP_GESTURE_RELOAD_REVOLVER", + "ACT_HL2MP_JUMP_REVOLVER", + "ACT_HL2MP_SWIM_IDLE_REVOLVER", + "ACT_HL2MP_SWIM_REVOLVER", + "ACT_HL2MP_IDLE_CAMERA", + "ACT_HL2MP_WALK_CAMERA", + "ACT_HL2MP_RUN_CAMERA", + "ACT_HL2MP_IDLE_CROUCH_CAMERA", + "ACT_HL2MP_WALK_CROUCH_CAMERA", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_CAMERA", + "ACT_HL2MP_GESTURE_RELOAD_CAMERA", + "ACT_HL2MP_JUMP_CAMERA", + "ACT_HL2MP_SWIM_IDLE_CAMERA", + "ACT_HL2MP_SWIM_CAMERA", + "ACT_HL2MP_IDLE_ANGRY", + "ACT_HL2MP_WALK_ANGRY", + "ACT_HL2MP_RUN_ANGRY", + "ACT_HL2MP_IDLE_CROUCH_ANGRY", + "ACT_HL2MP_WALK_CROUCH_ANGRY", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_ANGRY", + "ACT_HL2MP_GESTURE_RELOAD_ANGRY", + "ACT_HL2MP_JUMP_ANGRY", + "ACT_HL2MP_SWIM_IDLE_ANGRY", + "ACT_HL2MP_SWIM_ANGRY", + "ACT_HL2MP_IDLE_SCARED", + "ACT_HL2MP_WALK_SCARED", + "ACT_HL2MP_RUN_SCARED", + "ACT_HL2MP_IDLE_CROUCH_SCARED", + "ACT_HL2MP_WALK_CROUCH_SCARED", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_SCARED", + "ACT_HL2MP_GESTURE_RELOAD_SCARED", + "ACT_HL2MP_JUMP_SCARED", + "ACT_HL2MP_SWIM_IDLE_SCARED", + "ACT_HL2MP_SWIM_SCARED", + "ACT_HL2MP_IDLE_ZOMBIE", + "ACT_HL2MP_WALK_ZOMBIE", + "ACT_HL2MP_RUN_ZOMBIE", + "ACT_HL2MP_IDLE_CROUCH_ZOMBIE", + "ACT_HL2MP_WALK_CROUCH_ZOMBIE", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_ZOMBIE", + "ACT_HL2MP_GESTURE_RELOAD_ZOMBIE", + "ACT_HL2MP_JUMP_ZOMBIE", + "ACT_HL2MP_SWIM_IDLE_ZOMBIE", + "ACT_HL2MP_SWIM_ZOMBIE", + "ACT_HL2MP_IDLE_SUITCASE", + "ACT_HL2MP_WALK_SUITCASE", + "ACT_HL2MP_RUN_SUITCASE", + "ACT_HL2MP_IDLE_CROUCH_SUITCASE", + "ACT_HL2MP_WALK_CROUCH_SUITCASE", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_SUITCASE", + "ACT_HL2MP_GESTURE_RELOAD_SUITCASE", + "ACT_HL2MP_JUMP_SUITCASE", + "ACT_HL2MP_SWIM_IDLE_SUITCASE", + "ACT_HL2MP_SWIM_SUITCASE", + "ACT_HL2MP_IDLE", + "ACT_HL2MP_WALK", + "ACT_HL2MP_RUN", + "ACT_HL2MP_IDLE_CROUCH", + "ACT_HL2MP_WALK_CROUCH", + "ACT_HL2MP_GESTURE_RANGE_ATTACK", + "ACT_HL2MP_GESTURE_RELOAD", + "ACT_HL2MP_JUMP", + "ACT_HL2MP_SWIM", + "ACT_HL2MP_IDLE_PISTOL", + "ACT_HL2MP_WALK_PISTOL", + "ACT_HL2MP_RUN_PISTOL", + "ACT_HL2MP_IDLE_CROUCH_PISTOL", + "ACT_HL2MP_WALK_CROUCH_PISTOL", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_PISTOL", + "ACT_HL2MP_GESTURE_RELOAD_PISTOL", + "ACT_HL2MP_JUMP_PISTOL", + "ACT_HL2MP_SWIM_IDLE_PISTOL", + "ACT_HL2MP_SWIM_PISTOL", + "ACT_HL2MP_IDLE_SMG1", + "ACT_HL2MP_WALK_SMG1", + "ACT_HL2MP_RUN_SMG1", + "ACT_HL2MP_IDLE_CROUCH_SMG1", + "ACT_HL2MP_WALK_CROUCH_SMG1", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_SMG1", + "ACT_HL2MP_GESTURE_RELOAD_SMG1", + "ACT_HL2MP_JUMP_SMG1", + "ACT_HL2MP_SWIM_IDLE_SMG1", + "ACT_HL2MP_SWIM_SMG1", + "ACT_HL2MP_IDLE_AR2", + "ACT_HL2MP_WALK_AR2", + "ACT_HL2MP_RUN_AR2", + "ACT_HL2MP_IDLE_CROUCH_AR2", + "ACT_HL2MP_WALK_CROUCH_AR2", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_AR2", + "ACT_HL2MP_GESTURE_RELOAD_AR2", + "ACT_HL2MP_JUMP_AR2", + "ACT_HL2MP_SWIM_IDLE_AR2", + "ACT_HL2MP_SWIM_AR2", + "ACT_HL2MP_IDLE_SHOTGUN", + "ACT_HL2MP_WALK_SHOTGUN", + "ACT_HL2MP_RUN_SHOTGUN", + "ACT_HL2MP_IDLE_CROUCH_SHOTGUN", + "ACT_HL2MP_WALK_CROUCH_SHOTGUN", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_SHOTGUN", + "ACT_HL2MP_GESTURE_RELOAD_SHOTGUN", + "ACT_HL2MP_JUMP_SHOTGUN", + "ACT_HL2MP_SWIM_IDLE_SHOTGUN", + "ACT_HL2MP_SWIM_SHOTGUN", + "ACT_HL2MP_IDLE_RPG", + "ACT_HL2MP_WALK_RPG", + "ACT_HL2MP_RUN_RPG", + "ACT_HL2MP_IDLE_CROUCH_RPG", + "ACT_HL2MP_WALK_CROUCH_RPG", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_RPG", + "ACT_HL2MP_GESTURE_RELOAD_RPG", + "ACT_HL2MP_JUMP_RPG", + "ACT_HL2MP_SWIM_IDLE_RPG", + "ACT_HL2MP_SWIM_RPG", + "ACT_HL2MP_IDLE_GRENADE", + "ACT_HL2MP_WALK_GRENADE", + "ACT_HL2MP_RUN_GRENADE", + "ACT_HL2MP_IDLE_CROUCH_GRENADE", + "ACT_HL2MP_WALK_CROUCH_GRENADE", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE", + "ACT_HL2MP_GESTURE_RELOAD_GRENADE", + "ACT_HL2MP_JUMP_GRENADE", + "ACT_HL2MP_SWIM_IDLE_GRENADE", + "ACT_HL2MP_SWIM_GRENADE", + "ACT_HL2MP_IDLE_DUEL", + "ACT_HL2MP_WALK_DUEL", + "ACT_HL2MP_RUN_DUEL", + "ACT_HL2MP_IDLE_CROUCH_DUEL", + "ACT_HL2MP_WALK_CROUCH_DUEL", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_DUEL", + "ACT_HL2MP_GESTURE_RELOAD_DUEL", + "ACT_HL2MP_JUMP_DUEL", + "ACT_HL2MP_SWIM_IDLE_DUEL", + "ACT_HL2MP_SWIM_DUEL", + "ACT_HL2MP_IDLE_PHYSGUN", + "ACT_HL2MP_WALK_PHYSGUN", + "ACT_HL2MP_RUN_PHYSGUN", + "ACT_HL2MP_IDLE_CROUCH_PHYSGUN", + "ACT_HL2MP_WALK_CROUCH_PHYSGUN", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_PHYSGUN", + "ACT_HL2MP_GESTURE_RELOAD_PHYSGUN", + "ACT_HL2MP_JUMP_PHYSGUN", + "ACT_HL2MP_SWIM_IDLE_PHYSGUN", + "ACT_HL2MP_SWIM_PHYSGUN", + "ACT_HL2MP_IDLE_CROSSBOW", + "ACT_HL2MP_WALK_CROSSBOW", + "ACT_HL2MP_RUN_CROSSBOW", + "ACT_HL2MP_IDLE_CROUCH_CROSSBOW", + "ACT_HL2MP_WALK_CROUCH_CROSSBOW", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_CROSSBOW", + "ACT_HL2MP_GESTURE_RELOAD_CROSSBOW", + "ACT_HL2MP_JUMP_CROSSBOW", + "ACT_HL2MP_SWIM_IDLE_CROSSBOW", + "ACT_HL2MP_SWIM_CROSSBOW", + "ACT_HL2MP_IDLE_MELEE", + "ACT_HL2MP_WALK_MELEE", + "ACT_HL2MP_RUN_MELEE", + "ACT_HL2MP_IDLE_CROUCH_MELEE", + "ACT_HL2MP_WALK_CROUCH_MELEE", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_MELEE", + "ACT_HL2MP_GESTURE_RELOAD_MELEE", + "ACT_HL2MP_JUMP_MELEE", + "ACT_HL2MP_SWIM_IDLE_MELEE", + "ACT_HL2MP_SWIM_MELEE", + "ACT_HL2MP_IDLE_SLAM", + "ACT_HL2MP_WALK_SLAM", + "ACT_HL2MP_RUN_SLAM", + "ACT_HL2MP_IDLE_CROUCH_SLAM", + "ACT_HL2MP_WALK_CROUCH_SLAM", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_SLAM", + "ACT_HL2MP_GESTURE_RELOAD_SLAM", + "ACT_HL2MP_JUMP_SLAM", + "ACT_HL2MP_SWIM_IDLE_SLAM", + "ACT_HL2MP_SWIM_SLAM", + "ACT_VM_CRAWL", + "ACT_VM_CRAWL_EMPTY", + "ACT_VM_HOLSTER_EMPTY", + "ACT_VM_DOWN", + "ACT_VM_DOWN_EMPTY", + "ACT_VM_READY", + "ACT_VM_ISHOOT", + "ACT_VM_IIN", + "ACT_VM_IIN_EMPTY", + "ACT_VM_IIDLE", + "ACT_VM_IIDLE_EMPTY", + "ACT_VM_IOUT", + "ACT_VM_IOUT_EMPTY", + "ACT_VM_PULLBACK_HIGH_BAKE", + "ACT_VM_HITKILL", + "ACT_VM_DEPLOYED_IN", + "ACT_VM_DEPLOYED_IDLE", + "ACT_VM_DEPLOYED_FIRE", + "ACT_VM_DEPLOYED_DRYFIRE", + "ACT_VM_DEPLOYED_RELOAD", + "ACT_VM_DEPLOYED_RELOAD_EMPTY", + "ACT_VM_DEPLOYED_OUT", + "ACT_VM_DEPLOYED_IRON_IN", + "ACT_VM_DEPLOYED_IRON_IDLE", + "ACT_VM_DEPLOYED_IRON_FIRE", + "ACT_VM_DEPLOYED_IRON_DRYFIRE", + "ACT_VM_DEPLOYED_IRON_OUT", + "ACT_VM_DEPLOYED_LIFTED_IN", + "ACT_VM_DEPLOYED_LIFTED_IDLE", + "ACT_VM_DEPLOYED_LIFTED_OUT", + "ACT_VM_RELOADEMPTY", + "ACT_VM_IRECOIL1", + "ACT_VM_IRECOIL2", + "ACT_VM_FIREMODE", + "ACT_VM_ISHOOT_LAST", + "ACT_VM_IFIREMODE", + "ACT_VM_DFIREMODE", + "ACT_VM_DIFIREMODE", + "ACT_VM_SHOOTLAST", + "ACT_VM_ISHOOTDRY", + "ACT_VM_DRAW_M203", + "ACT_VM_DRAWFULL_M203", + "ACT_VM_READY_M203", + "ACT_VM_IDLE_M203", + "ACT_VM_RELOAD_M203", + "ACT_VM_HOLSTER_M203", + "ACT_VM_HOLSTERFULL_M203", + "ACT_VM_IIN_M203", + "ACT_VM_IIDLE_M203", + "ACT_VM_IOUT_M203", + "ACT_VM_CRAWL_M203", + "ACT_VM_DOWN_M203", + "ACT_VM_ISHOOT_M203", + "ACT_VM_RELOAD_INSERT", + "ACT_VM_RELOAD_INSERT_PULL", + "ACT_VM_RELOAD_END", + "ACT_VM_RELOAD_END_EMPTY", + "ACT_VM_RELOAD_INSERT_EMPTY", + "ACT_CROSSBOW_HOLSTER_UNLOADED", + "ACT_VM_FIRE_TO_EMPTY", + "ACT_VM_UNLOAD", + "ACT_VM_RELOAD2", + "ACT_GMOD_NOCLIP_LAYER", + "ACT_HL2MP_IDLE_FIST", + "ACT_HL2MP_WALK_FIST", + "ACT_HL2MP_RUN_FIST", + "ACT_HL2MP_IDLE_CROUCH_FIST", + "ACT_HL2MP_WALK_CROUCH_FIST", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_FIST", + "ACT_HL2MP_GESTURE_RELOAD_FIST", + "ACT_HL2MP_JUMP_FIST", + "ACT_HL2MP_SWIM_IDLE_FIST", + "ACT_HL2MP_SWIM_FIST", + "ACT_HL2MP_SIT", + "ACT_HL2MP_FIST_BLOCK", + "ACT_DRIVE_AIRBOAT", + "ACT_DRIVE_JEEP", + "ACT_GMOD_SIT_ROLLERCOASTER", + "ACT_HL2MP_IDLE_KNIFE", + "ACT_HL2MP_WALK_KNIFE", + "ACT_HL2MP_RUN_KNIFE", + "ACT_HL2MP_IDLE_CROUCH_KNIFE", + "ACT_HL2MP_WALK_CROUCH_KNIFE", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_KNIFE", + "ACT_HL2MP_GESTURE_RELOAD_KNIFE", + "ACT_HL2MP_JUMP_KNIFE", + "ACT_HL2MP_SWIM_IDLE_KNIFE", + "ACT_HL2MP_SWIM_KNIFE", + "ACT_HL2MP_IDLE_PASSIVE", + "ACT_HL2MP_WALK_PASSIVE", + "ACT_HL2MP_RUN_PASSIVE", + "ACT_HL2MP_IDLE_CROUCH_PASSIVE", + "ACT_HL2MP_WALK_CROUCH_PASSIVE", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_PASSIVE", + "ACT_HL2MP_GESTURE_RELOAD_PASSIVE", + "ACT_HL2MP_JUMP_PASSIVE", + "ACT_HL2MP_SWIM_PASSIVE", + "ACT_HL2MP_SWIM_IDLE_PASSIVE", + "ACT_HL2MP_IDLE_MELEE2", + "ACT_HL2MP_WALK_MELEE2", + "ACT_HL2MP_RUN_MELEE2", + "ACT_HL2MP_IDLE_CROUCH_MELEE2", + "ACT_HL2MP_WALK_CROUCH_MELEE2", + "ACT_HL2MP_GESTURE_RANGE_ATTACK_MELEE2", + "ACT_HL2MP_GESTURE_RELOAD_MELEE2", + "ACT_HL2MP_JUMP_MELEE2", + "ACT_HL2MP_SWIM_IDLE_MELEE2", + "ACT_HL2MP_SWIM_MELEE2", + "ACT_HL2MP_SIT_PISTOL", + "ACT_HL2MP_SIT_SHOTGUN", + "ACT_HL2MP_SIT_SMG1", + "ACT_HL2MP_SIT_AR2", + "ACT_HL2MP_SIT_PHYSGUN", + "ACT_HL2MP_SIT_GRENADE", + "ACT_HL2MP_SIT_RPG", + "ACT_HL2MP_SIT_CROSSBOW", + "ACT_HL2MP_SIT_MELEE", + "ACT_HL2MP_SIT_SLAM", + "ACT_HL2MP_SIT_FIST", + "ACT_GMOD_IN_CHAT", + "ACT_GMOD_GESTURE_ITEM_GIVE", + "ACT_GMOD_GESTURE_ITEM_DROP", + "ACT_GMOD_GESTURE_ITEM_PLACE", + "ACT_GMOD_GESTURE_ITEM_THROW", + "ACT_GMOD_GESTURE_MELEE_SHOVE_2HAND", + "ACT_GMOD_GESTURE_MELEE_SHOVE_1HAND", + "ACT_HL2MP_SWIM_IDLE", + "LAST_SHARED_ACTIVITY", + + --- BLOOD_COLOR + "DONT_BLEED", + "BLOOD_COLOR_RED", + "BLOOD_COLOR_YELLOW", + "BLOOD_COLOR_GREEN", + "BLOOD_COLOR_MECH", + "BLOOD_COLOR_ANTLION", + "BLOOD_COLOR_ZOMBIE", + "BLOOD_COLOR_ANTLION_WORKER", + + --- BONE + "BONE_PHYSICALLY_SIMULATED", + "BONE_PHYSICS_PROCEDURAL", + "BONE_ALWAYS_PROCEDURAL", + "BONE_SCREEN_ALIGN_SPHERE", + "BONE_SCREEN_ALIGN_CYLINDER", + "BONE_CALCULATE_MASK", + "BONE_USED_BY_HITBOX", + "BONE_USED_BY_ATTACHMENT", + "BONE_USED_BY_VERTEX_LOD0", + "BONE_USED_BY_VERTEX_LOD1", + "BONE_USED_BY_VERTEX_LOD2", + "BONE_USED_BY_VERTEX_LOD3", + "BONE_USED_BY_VERTEX_LOD4", + "BONE_USED_BY_VERTEX_LOD5", + "BONE_USED_BY_VERTEX_LOD6", + "BONE_USED_BY_VERTEX_LOD7", + "BONE_USED_BY_VERTEX_MASK", + "BONE_USED_BY_BONE_MERGE", + "BONE_USED_BY_ANYTHING", + "BONE_USED_MASK", + + --- BOX + "BOX_FRONT", + "BOX_BACK", + "BOX_RIGHT", + "BOX_LEFT", + "BOX_TOP", + "BOX_BOTTOM", + + --- BUTTON_CODE + "BUTTON_CODE_INVALID", + "BUTTON_CODE_NONE", + "BUTTON_CODE_LAST", + "BUTTON_CODE_COUNT", + + --- CAP + "CAP_SIMPLE_RADIUS_DAMAGE", + "CAP_MOVE_GROUND", + "CAP_MOVE_JUMP", + "CAP_MOVE_FLY", + "CAP_MOVE_CLIMB", + "CAP_MOVE_SWIM", + "CAP_MOVE_CRAWL", + "CAP_MOVE_SHOOT", + "CAP_SKIP_NAV_GROUND_CHECK", + "CAP_USE", + "CAP_AUTO_DOORS", + "CAP_OPEN_DOORS", + "CAP_TURN_HEAD", + "CAP_WEAPON_RANGE_ATTACK1", + "CAP_WEAPON_RANGE_ATTACK2", + "CAP_WEAPON_MELEE_ATTACK1", + "CAP_WEAPON_MELEE_ATTACK2", + "CAP_INNATE_RANGE_ATTACK1", + "CAP_INNATE_RANGE_ATTACK2", + "CAP_INNATE_MELEE_ATTACK1", + "CAP_INNATE_MELEE_ATTACK2", + "CAP_USE_WEAPONS", + "CAP_USE_SHOT_REGULATOR", + "CAP_ANIMATEDFACE", + "CAP_FRIENDLY_DMG_IMMUNE", + "CAP_SQUAD", + "CAP_DUCK", + "CAP_NO_HIT_PLAYER", + "CAP_AIM_GUN", + "CAP_NO_HIT_SQUADMATES", + + --- CHAN + "CHAN_REPLACE", + "CHAN_AUTO", + "CHAN_WEAPON", + "CHAN_VOICE", + "CHAN_ITEM", + "CHAN_BODY", + "CHAN_STREAM", + "CHAN_STATIC", + "CHAN_VOICE2", + "CHAN_VOICE_BASE", + "CHAN_USER_BASE", + + --- CLASS + "CLASS_NONE", + "CLASS_PLAYER", + "CLASS_PLAYER_ALLY", + "CLASS_PLAYER_ALLY_VITAL", + "CLASS_ANTLION", + "CLASS_BARNACLE", + "CLASS_BULLSEYE", + "CLASS_CITIZEN_PASSIVE", + "CLASS_CITIZEN_REBEL", + "CLASS_COMBINE", + "CLASS_COMBINE_GUNSHIP", + "CLASS_CONSCRIPT", + "CLASS_HEADCRAB", + "CLASS_MANHACK", + "CLASS_METROPOLICE", + "CLASS_MILITARY", + "CLASS_SCANNER", + "CLASS_STALKER", + "CLASS_VORTIGAUNT", + "CLASS_ZOMBIE", + "CLASS_PROTOSNIPER", + "CLASS_MISSILE", + "CLASS_FLARE", + "CLASS_EARTH_FAUNA", + "CLASS_HACKED_ROLLERMINE", + "CLASS_COMBINE_HUNTER", + + --- COLLISION_GROUP + "COLLISION_GROUP_NONE", + "COLLISION_GROUP_DEBRIS", + "COLLISION_GROUP_DEBRIS_TRIGGER", + "COLLISION_GROUP_INTERACTIVE_DEBRIS", + "COLLISION_GROUP_INTERACTIVE", + "COLLISION_GROUP_PLAYER", + "COLLISION_GROUP_BREAKABLE_GLASS", + "COLLISION_GROUP_VEHICLE", + "COLLISION_GROUP_PLAYER_MOVEMENT", + "COLLISION_GROUP_NPC", + "COLLISION_GROUP_IN_VEHICLE", + "COLLISION_GROUP_WEAPON", + "COLLISION_GROUP_VEHICLE_CLIP", + "COLLISION_GROUP_PROJECTILE", + "COLLISION_GROUP_DOOR_BLOCKER", + "COLLISION_GROUP_PASSABLE_DOOR", + "COLLISION_GROUP_DISSOLVING", + "COLLISION_GROUP_PUSHAWAY", + "COLLISION_GROUP_NPC_ACTOR", + "COLLISION_GROUP_NPC_SCRIPTED", + "COLLISION_GROUP_WORLD", + "LAST_SHARED_COLLISION_GROUP", + + --- COND + "COND_BEHIND_ENEMY", + "COND_BETTER_WEAPON_AVAILABLE", + "COND_CAN_MELEE_ATTACK1", + "COND_CAN_MELEE_ATTACK2", + "COND_CAN_RANGE_ATTACK1", + "COND_CAN_RANGE_ATTACK2", + "COND_ENEMY_DEAD", + "COND_ENEMY_FACING_ME", + "COND_ENEMY_OCCLUDED", + "COND_ENEMY_TOO_FAR", + "COND_ENEMY_UNREACHABLE", + "COND_ENEMY_WENT_NULL", + "COND_FLOATING_OFF_GROUND", + "COND_GIVE_WAY", + "COND_HAVE_ENEMY_LOS", + "COND_HAVE_TARGET_LOS", + "COND_HEALTH_ITEM_AVAILABLE", + "COND_HEAR_BUGBAIT", + "COND_HEAR_BULLET_IMPACT", + "COND_HEAR_COMBAT", + "COND_HEAR_DANGER", + "COND_HEAR_MOVE_AWAY", + "COND_HEAR_PHYSICS_DANGER", + "COND_HEAR_PLAYER", + "COND_HEAR_SPOOKY", + "COND_HEAR_THUMPER", + "COND_HEAR_WORLD", + "COND_HEAVY_DAMAGE", + "COND_IDLE_INTERRUPT", + "COND_IN_PVS", + "COND_LIGHT_DAMAGE", + "COND_LOST_ENEMY", + "COND_LOST_PLAYER", + "COND_LOW_PRIMARY_AMMO", + "COND_MOBBED_BY_ENEMIES", + "COND_NEW_ENEMY", + "COND_NO_CUSTOM_INTERRUPTS", + "COND_NO_HEAR_DANGER", + "COND_NO_PRIMARY_AMMO", + "COND_NO_SECONDARY_AMMO", + "COND_NO_WEAPON", + "COND_NONE", + "COND_NOT_FACING_ATTACK", + "COND_NPC_FREEZE", + "COND_NPC_UNFREEZE", + "COND_PHYSICS_DAMAGE", + "COND_PLAYER_ADDED_TO_SQUAD", + "COND_PLAYER_PUSHING", + "COND_PLAYER_REMOVED_FROM_SQUAD", + "COND_PROVOKED", + "COND_RECEIVED_ORDERS", + "COND_REPEATED_DAMAGE", + "COND_SCHEDULE_DONE", + "COND_SEE_DISLIKE", + "COND_SEE_ENEMY", + "COND_SEE_FEAR", + "COND_SEE_HATE", + "COND_SEE_NEMESIS", + "COND_SEE_PLAYER", + "COND_SMELL", + "COND_TALKER_RESPOND_TO_QUESTION", + "COND_TARGET_OCCLUDED", + "COND_TASK_FAILED", + "COND_TOO_CLOSE_TO_ATTACK", + "COND_TOO_FAR_TO_ATTACK", + "COND_WAY_CLEAR", + "COND_WEAPON_BLOCKED_BY_FRIEND", + "COND_WEAPON_HAS_LOS", + "COND_WEAPON_PLAYER_IN_SPREAD", + "COND_WEAPON_PLAYER_NEAR_TARGET", + "COND_WEAPON_SIGHT_OCCLUDED", + + --- CONTENTS + "CONTENTS_EMPTY", + "CONTENTS_SOLID", + "CONTENTS_WINDOW", + "CONTENTS_AUX", + "CONTENTS_GRATE", + "CONTENTS_SLIME", + "CONTENTS_WATER", + "CONTENTS_BLOCKLOS", + "CONTENTS_OPAQUE", + "CONTENTS_TESTFOGVOLUME", + "CONTENTS_TEAM4", + "CONTENTS_TEAM3", + "CONTENTS_TEAM1", + "CONTENTS_TEAM2", + "CONTENTS_IGNORE_NODRAW_OPAQUE", + "CONTENTS_MOVEABLE", + "CONTENTS_AREAPORTAL", + "CONTENTS_PLAYERCLIP", + "CONTENTS_MONSTERCLIP", + "CONTENTS_CURRENT_0", + "CONTENTS_CURRENT_180", + "CONTENTS_CURRENT_270", + "CONTENTS_CURRENT_90", + "CONTENTS_CURRENT_DOWN", + "CONTENTS_CURRENT_UP", + "CONTENTS_DEBRIS", + "CONTENTS_DETAIL", + "CONTENTS_HITBOX", + "CONTENTS_LADDER", + "CONTENTS_MONSTER", + "CONTENTS_ORIGIN", + "CONTENTS_TRANSLUCENT", + "LAST_VISIBLE_CONTENTS", + "ALL_VISIBLE_CONTENTS", + + --- CREATERENDERTARGETFLAGS + "CREATERENDERTARGETFLAGS_HDR", + "CREATERENDERTARGETFLAGS_AUTOMIPMAP", + "CREATERENDERTARGETFLAGS_UNFILTERABLE_OK", + + --- CT + "CT_DEFAULT", + "CT_DOWNTRODDEN", + "CT_REFUGEE", + "CT_REBEL", + "CT_UNIQUE", + + --- D + "D_ER", + "D_HT", + "D_FR", + "D_LI", + "D_NU", + + --- DMG + "DMG_GENERIC", + "DMG_CRUSH", + "DMG_BULLET", + "DMG_SLASH", + "DMG_BURN", + "DMG_VEHICLE", + "DMG_FALL", + "DMG_BLAST", + "DMG_CLUB", + "DMG_SHOCK", + "DMG_SONIC", + "DMG_ENERGYBEAM", + "DMG_NEVERGIB", + "DMG_ALWAYSGIB", + "DMG_DROWN", + "DMG_PARALYZE", + "DMG_NERVEGAS", + "DMG_POISON", + "DMG_ACID", + "DMG_AIRBOAT", + "DMG_BLAST_SURFACE", + "DMG_BUCKSHOT", + "DMG_DIRECT", + "DMG_DISSOLVE", + "DMG_DROWNRECOVER", + "DMG_PHYSGUN", + "DMG_PLASMA", + "DMG_PREVENT_PHYSICS_FORCE", + "DMG_RADIATION", + "DMG_REMOVENORAGDOLL", + "DMG_SLOWBURN", + + --- DOCK + "NODOCK", + "FILL", + "LEFT", + "RIGHT", + "TOP", + "BOTTOM", + + --- DOF + "DOF_OFFSET", + "DOF_SPACING", + + --- EF + "EF_BONEMERGE", + "EF_BONEMERGE_FASTCULL", + "EF_BRIGHTLIGHT", + "EF_DIMLIGHT", + "EF_NOINTERP", + "EF_NOSHADOW", + "EF_NODRAW", + "EF_NORECEIVESHADOW", + "EF_ITEM_BLINK", + "EF_PARENT_ANIMATES", + + --- EFL + "EFL_BOT_FROZEN", + "EFL_CHECK_UNTOUCH", + "EFL_DIRTY_ABSANGVELOCITY", + "EFL_DIRTY_ABSTRANSFORM", + "EFL_DIRTY_ABSVELOCITY", + "EFL_DIRTY_SHADOWUPDATE", + "EFL_DIRTY_SPATIAL_PARTITION", + "EFL_DIRTY_SURROUNDING_COLLISION_BOUNDS", + "EFL_DONTBLOCKLOS", + "EFL_DONTWALKON", + "EFL_DORMANT", + "EFL_FORCE_CHECK_TRANSMIT", + "EFL_HAS_PLAYER_CHILD", + "EFL_IN_SKYBOX", + "EFL_IS_BEING_LIFTED_BY_BARNACLE", + "EFL_KEEP_ON_RECREATE_ENTITIES", + "EFL_KILLME", + "EFL_NOCLIP_ACTIVE", + "EFL_NOTIFY", + "EFL_NO_AUTO_EDICT_ATTACH", + "EFL_NO_DAMAGE_FORCES", + "EFL_NO_DISSOLVE", + "EFL_NO_GAME_PHYSICS_SIMULATION", + "EFL_NO_MEGAPHYSCANNON_RAGDOLL", + "EFL_NO_PHYSCANNON_INTERACTION", + "EFL_NO_ROTORWASH_PUSH", + "EFL_NO_THINK_FUNCTION", + "EFL_NO_WATER_VELOCITY_CHANGE", + "EFL_SERVER_ONLY", + "EFL_SETTING_UP_BONES", + "EFL_TOUCHING_FLUID", + "EFL_USE_PARTITION_WHEN_NOT_SOLID", + + --- FCVAR + "FCVAR_ARCHIVE", + "FCVAR_ARCHIVE_XBOX", + "FCVAR_CHEAT", + "FCVAR_CLIENTCMD_CAN_EXECUTE", + "FCVAR_CLIENTDLL", + "FCVAR_DEMO", + "FCVAR_DONTRECORD", + "FCVAR_GAMEDLL", + "FCVAR_LUA_CLIENT", + "FCVAR_LUA_SERVER", + "FCVAR_NEVER_AS_STRING", + "FCVAR_NONE", + "FCVAR_NOTIFY", + "FCVAR_NOT_CONNECTED", + "FCVAR_PRINTABLEONLY", + "FCVAR_PROTECTED", + "FCVAR_REPLICATED", + "FCVAR_SERVER_CANNOT_QUERY", + "FCVAR_SERVER_CAN_EXECUTE", + "FCVAR_SPONLY", + "FCVAR_UNLOGGED", + "FCVAR_UNREGISTERED", + "FCVAR_USERINFO", + + --- FFT + "FFT_256", + "FFT_512", + "FFT_1024", + "FFT_2048", + "FFT_4096", + "FFT_8192", + "FFT_16384", + "FFT_32768", + + --- FL + "FL_ONGROUND", + "FL_DUCKING", + "FL_ANIMDUCKING", + "FL_WATERJUMP", + "FL_ONTRAIN", + "FL_INRAIN", + "FL_FROZEN", + "FL_ATCONTROLS", + "FL_CLIENT", + "FL_FAKECLIENT", + "FL_INWATER", + "FL_FLY", + "FL_SWIM", + "FL_CONVEYOR", + "FL_NPC", + "FL_GODMODE", + "FL_NOTARGET", + "FL_AIMTARGET", + "FL_PARTIALGROUND", + "FL_STATICPROP", + "FL_GRAPHED", + "FL_GRENADE", + "FL_STEPMOVEMENT", + "FL_DONTTOUCH", + "FL_BASEVELOCITY", + "FL_WORLDBRUSH", + "FL_OBJECT", + "FL_KILLME", + "FL_ONFIRE", + "FL_DISSOLVING", + "FL_TRANSRAGDOLL", + "FL_UNBLOCKABLE_BY_PLAYER", + + --- FORCE + "FORCE_STRING", + "FORCE_NUMBER", + "FORCE_BOOL", + + --- FSOLID + "FSOLID_CUSTOMRAYTEST", + "FSOLID_CUSTOMBOXTEST", + "FSOLID_NOT_SOLID", + "FSOLID_TRIGGER", + "FSOLID_NOT_STANDABLE", + "FSOLID_VOLUME_CONTENTS", + "FSOLID_FORCE_WORLD_ALIGNED", + "FSOLID_USE_TRIGGER_BOUNDS", + "FSOLID_ROOT_PARENT_ALIGNED", + "FSOLID_TRIGGER_TOUCH_DEBRIS", + "FSOLID_MAX_BITS", + + --- FVPHYSICS + "FVPHYSICS_CONSTRAINT_STATIC", + "FVPHYSICS_DMG_DISSOLVE", + "FVPHYSICS_DMG_SLICE", + "FVPHYSICS_HEAVY_OBJECT", + "FVPHYSICS_MULTIOBJECT_ENTITY", + "FVPHYSICS_NO_IMPACT_DMG", + "FVPHYSICS_NO_NPC_IMPACT_DMG", + "FVPHYSICS_NO_PLAYER_PICKUP", + "FVPHYSICS_NO_SELF_COLLISIONS", + "FVPHYSICS_PART_OF_RAGDOLL", + "FVPHYSICS_PENETRATING", + "FVPHYSICS_PLAYER_HELD", + "FVPHYSICS_WAS_THROWN", + + --- GESTURE_SLOT + "GESTURE_SLOT_ATTACK_AND_RELOAD", + "GESTURE_SLOT_GRENADE", + "GESTURE_SLOT_JUMP", + "GESTURE_SLOT_SWIM", + "GESTURE_SLOT_FLINCH", + "GESTURE_SLOT_VCD", + "GESTURE_SLOT_CUSTOM", + + --- GMOD_CHANNEL + "GMOD_CHANNEL_STOPPED", + "GMOD_CHANNEL_PLAYING", + "GMOD_CHANNEL_PAUSED", + "GMOD_CHANNEL_STALLED", + + --- HITGROUP + "HITGROUP_GENERIC", + "HITGROUP_HEAD", + "HITGROUP_CHEST", + "HITGROUP_STOMACH", + "HITGROUP_LEFTARM", + "HITGROUP_RIGHTARM", + "HITGROUP_LEFTLEG", + "HITGROUP_RIGHTLEG", + "HITGROUP_GEAR", + + --- HUD + "HUD_PRINTNOTIFY", + "HUD_PRINTCONSOLE", + "HUD_PRINTTALK", + "HUD_PRINTCENTER", + + --- HULL + "HULL_HUMAN", + "HULL_SMALL_CENTERED", + "HULL_WIDE_HUMAN", + "HULL_TINY", + "HULL_WIDE_SHORT", + "HULL_MEDIUM", + "HULL_TINY_CENTERED", + "HULL_LARGE", + "HULL_LARGE_CENTERED", + "HULL_MEDIUM_TALL", + + --- IMAGE_FORMAT + "IMAGE_FORMAT_DEFAULT", + "IMAGE_FORMAT_RGBA8888", + "IMAGE_FORMAT_ABGR8888", + "IMAGE_FORMAT_RGB888", + "IMAGE_FORMAT_BGR888", + "IMAGE_FORMAT_RGB565", + "IMAGE_FORMAT_ARGB8888", + "IMAGE_FORMAT_BGRA8888", + "IMAGE_FORMAT_RGBA16161616", + "IMAGE_FORMAT_RGBA16161616F", + + --- IN + "IN_ALT1", + "IN_ALT2", + "IN_ATTACK", + "IN_ATTACK2", + "IN_BACK", + "IN_DUCK", + "IN_FORWARD", + "IN_JUMP", + "IN_LEFT", + "IN_MOVELEFT", + "IN_MOVERIGHT", + "IN_RELOAD", + "IN_RIGHT", + "IN_SCORE", + "IN_SPEED", + "IN_USE", + "IN_WALK", + "IN_ZOOM", + "IN_GRENADE1", + "IN_GRENADE2", + "IN_WEAPON1", + "IN_WEAPON2", + "IN_BULLRUSH", + "IN_CANCEL", + "IN_RUN", + + --- JOYSTICK + "JOYSTICK_FIRST", + "JOYSTICK_FIRST_AXIS_BUTTON", + "JOYSTICK_FIRST_BUTTON", + "JOYSTICK_FIRST_POV_BUTTON", + "JOYSTICK_LAST", + "JOYSTICK_LAST_AXIS_BUTTON", + "JOYSTICK_LAST_BUTTON", + "JOYSTICK_LAST_POV_BUTTON", + + --- KEY + "KEY_FIRST", + "KEY_NONE", + "KEY_0", + "KEY_1", + "KEY_2", + "KEY_3", + "KEY_4", + "KEY_5", + "KEY_6", + "KEY_7", + "KEY_8", + "KEY_9", + "KEY_A", + "KEY_B", + "KEY_C", + "KEY_D", + "KEY_E", + "KEY_F", + "KEY_G", + "KEY_H", + "KEY_I", + "KEY_J", + "KEY_K", + "KEY_L", + "KEY_M", + "KEY_N", + "KEY_O", + "KEY_P", + "KEY_Q", + "KEY_R", + "KEY_S", + "KEY_T", + "KEY_U", + "KEY_V", + "KEY_W", + "KEY_X", + "KEY_Y", + "KEY_Z", + "KEY_PAD_0", + "KEY_PAD_1", + "KEY_PAD_2", + "KEY_PAD_3", + "KEY_PAD_4", + "KEY_PAD_5", + "KEY_PAD_6", + "KEY_PAD_7", + "KEY_PAD_8", + "KEY_PAD_9", + "KEY_PAD_DIVIDE", + "KEY_PAD_MULTIPLY", + "KEY_PAD_MINUS", + "KEY_PAD_PLUS", + "KEY_PAD_ENTER", + "KEY_PAD_DECIMAL", + "KEY_LBRACKET", + "KEY_RBRACKET", + "KEY_SEMICOLON", + "KEY_APOSTROPHE", + "KEY_BACKQUOTE", + "KEY_COMMA", + "KEY_PERIOD", + "KEY_SLASH", + "KEY_BACKSLASH", + "KEY_MINUS", + "KEY_EQUAL", + "KEY_ENTER", + "KEY_SPACE", + "KEY_BACKSPACE", + "KEY_TAB", + "KEY_CAPSLOCK", + "KEY_NUMLOCK", + "KEY_ESCAPE", + "KEY_SCROLLLOCK", + "KEY_INSERT", + "KEY_DELETE", + "KEY_HOME", + "KEY_END", + "KEY_PAGEUP", + "KEY_PAGEDOWN", + "KEY_BREAK", + "KEY_LSHIFT", + "KEY_RSHIFT", + "KEY_LALT", + "KEY_RALT", + "KEY_LCONTROL", + "KEY_RCONTROL", + "KEY_LWIN", + "KEY_RWIN", + "KEY_APP", + "KEY_UP", + "KEY_LEFT", + "KEY_DOWN", + "KEY_RIGHT", + "KEY_F1", + "KEY_F2", + "KEY_F3", + "KEY_F4", + "KEY_F5", + "KEY_F6", + "KEY_F7", + "KEY_F8", + "KEY_F9", + "KEY_F10", + "KEY_F11", + "KEY_F12", + "KEY_CAPSLOCKTOGGLE", + "KEY_NUMLOCKTOGGLE", + "KEY_LAST", + "KEY_SCROLLLOCKTOGGLE", + "KEY_COUNT", + "KEY_XBUTTON_A", + "KEY_XBUTTON_B", + "KEY_XBUTTON_X", + "KEY_XBUTTON_Y", + "KEY_XBUTTON_LEFT_SHOULDER", + "KEY_XBUTTON_RIGHT_SHOULDER", + "KEY_XBUTTON_BACK", + "KEY_XBUTTON_START", + "KEY_XBUTTON_STICK1", + "KEY_XBUTTON_STICK2", + "KEY_XBUTTON_UP", + "KEY_XBUTTON_RIGHT", + "KEY_XBUTTON_DOWN", + "KEY_XBUTTON_LEFT", + "KEY_XSTICK1_RIGHT", + "KEY_XSTICK1_LEFT", + "KEY_XSTICK1_DOWN", + "KEY_XSTICK1_UP", + "KEY_XBUTTON_LTRIGGER", + "KEY_XBUTTON_RTRIGGER", + "KEY_XSTICK2_RIGHT", + "KEY_XSTICK2_LEFT", + "KEY_XSTICK2_DOWN", + "KEY_XSTICK2_UP", + + --- kRenderFx + + --- MASK + "MASK_ALL", + "MASK_BLOCKLOS", + "MASK_BLOCKLOS_AND_NPCS", + "MASK_CURRENT", + "MASK_DEADSOLID", + "MASK_NPCSOLID", + "MASK_NPCSOLID_BRUSHONLY", + "MASK_NPCWORLDSTATIC", + "MASK_OPAQUE", + "MASK_OPAQUE_AND_NPCS", + "MASK_PLAYERSOLID", + "MASK_PLAYERSOLID_BRUSHONLY", + "MASK_SHOT", + "MASK_SHOT_HULL", + "MASK_SHOT_PORTAL", + "MASK_SOLID", + "MASK_SOLID_BRUSHONLY", + "MASK_SPLITAREAPORTAL", + "MASK_VISIBLE", + "MASK_VISIBLE_AND_NPCS", + "MASK_WATER", + + --- MAT + "MAT_ALIENFLESH", + "MAT_ANTLION", + "MAT_BLOODYFLESH", + "MAT_CLIP", + "MAT_COMPUTER", + "MAT_CONCRETE", + "MAT_DIRT", + "MAT_EGGSHELL", + "MAT_FLESH", + "MAT_FOLIAGE", + "MAT_GLASS", + "MAT_GRATE", + "MAT_SNOW", + "MAT_METAL", + "MAT_PLASTIC", + "MAT_SAND", + "MAT_SLOSH", + "MAT_TILE", + "MAT_GRASS", + "MAT_VENT", + "MAT_WOOD", + "MAT_DEFAULT", + "MAT_WARPSHIELD", + + --- MATERIAL + "MATERIAL_LINES", + "MATERIAL_LINE_LOOP", + "MATERIAL_LINE_STRIP", + "MATERIAL_POINTS", + "MATERIAL_POLYGON", + "MATERIAL_QUADS", + "MATERIAL_TRIANGLES", + "MATERIAL_TRIANGLE_STRIP", + + --- MATERIAL_CULLMODE + "MATERIAL_CULLMODE_CCW", + "MATERIAL_CULLMODE_CW", + + --- MATERIAL_FOG + "MATERIAL_FOG_NONE", + "MATERIAL_FOG_LINEAR", + "MATERIAL_FOG_LINEAR_BELOW_FOG_Z", + + --- MATERIAL_LIGHT + "MATERIAL_LIGHT_DISABLE", + "MATERIAL_LIGHT_POINT", + "MATERIAL_LIGHT_DIRECTIONAL", + "MATERIAL_LIGHT_SPOT", + + --- MATERIAL_RT_DEPTH + "MATERIAL_RT_DEPTH_SHARED", + "MATERIAL_RT_DEPTH_SEPARATE", + "MATERIAL_RT_DEPTH_NONE", + "MATERIAL_RT_DEPTH_ONLY", + + --- MOUSE + "MOUSE_LEFT", + "MOUSE_RIGHT", + "MOUSE_MIDDLE", + "MOUSE_4", + "MOUSE_5", + "MOUSE_WHEEL_UP", + "MOUSE_WHEEL_DOWN", + "MOUSE_COUNT", + "MOUSE_FIRST", + "MOUSE_LAST", + + --- MOVECOLLIDE + "MOVECOLLIDE_DEFAULT", + "MOVECOLLIDE_FLY_BOUNCE", + "MOVECOLLIDE_FLY_CUSTOM", + "MOVECOLLIDE_FLY_SLIDE", + "MOVECOLLIDE_COUNT", + + --- MOVETYPE + "MOVETYPE_NONE", + "MOVETYPE_ISOMETRIC", + "MOVETYPE_WALK", + "MOVETYPE_STEP", + "MOVETYPE_FLY", + "MOVETYPE_FLYGRAVITY", + "MOVETYPE_VPHYSICS", + "MOVETYPE_PUSH", + "MOVETYPE_NOCLIP", + "MOVETYPE_LADDER", + "MOVETYPE_OBSERVER", + "MOVETYPE_CUSTOM", + + --- NAV_MESH + "NAV_MESH_INVALID", + "NAV_MESH_CROUCH", + "NAV_MESH_JUMP", + "NAV_MESH_PRECISE", + "NAV_MESH_NO_JUMP", + "NAV_MESH_STOP", + "NAV_MESH_RUN", + "NAV_MESH_WALK", + "NAV_MESH_AVOID", + "NAV_MESH_TRANSIENT", + "NAV_MESH_DONT_HIDE", + "NAV_MESH_STAND", + "NAV_MESH_NO_HOSTAGES", + "NAV_MESH_STAIRS", + "NAV_MESH_NO_MERGE", + "NAV_MESH_OBSTACLE_TOP", + "NAV_MESH_CLIFF", + "NAV_MESH_FUNC_COST", + "NAV_MESH_HAS_ELEVATOR", + "NAV_MESH_NAV_BLOCKER", + + --- NavCorner + "NORTH_WEST", + "NORTH_EAST", + "SOUTH_EAST", + "SOUTH_WEST", + + --- NavDir + "NORTH", + "EAST", + "SOUTH", + "WEST", + + --- NavTraverseType + "GO_NORTH", + "GO_EAST", + "GO_SOUTH", + "GO_WEST", + "GO_LADDER_UP", + "GO_LADDER_DOWN", + "GO_JUMP", + "GO_ELEVATOR_UP", + "GO_ELEVATOR_DOWN", + + --- NOTIFY + "NOTIFY_GENERIC", + "NOTIFY_ERROR", + "NOTIFY_UNDO", + "NOTIFY_HINT", + "NOTIFY_CLEANUP", + + --- NPC_STATE + "NPC_STATE_INVALID", + "NPC_STATE_NONE", + "NPC_STATE_IDLE", + "NPC_STATE_ALERT", + "NPC_STATE_COMBAT", + "NPC_STATE_SCRIPT", + "NPC_STATE_PLAYDEAD", + "NPC_STATE_PRONE", + "NPC_STATE_DEAD", + + --- NUM + "NUM_AI_CLASSES", + "NUM_HULLS", + "NUM_BEAMS", + "NUM_SPRITES", + + --- OBS_MODE + "OBS_MODE_NONE", + "OBS_MODE_DEATHCAM", + "OBS_MODE_FREEZECAM", + "OBS_MODE_FIXED", + "OBS_MODE_IN_EYE", + "OBS_MODE_CHASE", + "OBS_MODE_ROAMING", + + --- PATTACH + "PATTACH_ABSORIGIN", + "PATTACH_ABSORIGIN_FOLLOW", + "PATTACH_CUSTOMORIGIN", + "PATTACH_POINT", + "PATTACH_POINT_FOLLOW", + "PATTACH_WORLDORIGIN", + + --- PLAYER + "PLAYER_IDLE", + "PLAYER_WALK", + "PLAYER_JUMP", + "PLAYER_SUPERJUMP", + "PLAYER_DIE", + "PLAYER_ATTACK1", + "PLAYER_IN_VEHICLE", + "PLAYER_RELOAD", + "PLAYER_START_AIMING", + "PLAYER_LEAVE_AIMING", + + --- PLAYERANIMEVENT + "PLAYERANIMEVENT_ATTACK_GRENADE", + "PLAYERANIMEVENT_ATTACK_PRIMARY", + "PLAYERANIMEVENT_ATTACK_SECONDARY", + "PLAYERANIMEVENT_CANCEL", + "PLAYERANIMEVENT_CUSTOM", + "PLAYERANIMEVENT_CUSTOM_GESTURE", + "PLAYERANIMEVENT_CUSTOM_GESTURE_SEQUENCE", + "PLAYERANIMEVENT_CUSTOM_SEQUENCE", + "PLAYERANIMEVENT_DIE", + "PLAYERANIMEVENT_DOUBLEJUMP", + "PLAYERANIMEVENT_FLINCH_CHEST", + "PLAYERANIMEVENT_FLINCH_HEAD", + "PLAYERANIMEVENT_FLINCH_LEFTARM", + "PLAYERANIMEVENT_FLINCH_LEFTLEG", + "PLAYERANIMEVENT_FLINCH_RIGHTARM", + "PLAYERANIMEVENT_FLINCH_RIGHTLEG", + "PLAYERANIMEVENT_JUMP", + "PLAYERANIMEVENT_RELOAD", + "PLAYERANIMEVENT_RELOAD_END", + "PLAYERANIMEVENT_RELOAD_LOOP", + "PLAYERANIMEVENT_SNAP_YAW", + "PLAYERANIMEVENT_SPAWN", + "PLAYERANIMEVENT_SWIM", + + --- RENDERGROUP + "RENDERGROUP_STATIC_HUGE", + "RENDERGROUP_OPAQUE_HUGE", + "RENDERGROUP_STATIC", + "RENDERGROUP_OPAQUE", + "RENDERGROUP_TRANSLUCENT", + "RENDERGROUP_BOTH", + "RENDERGROUP_VIEWMODEL", + "RENDERGROUP_VIEWMODEL_TRANSLUCENT", + "RENDERGROUP_OPAQUE_BRUSH", + "RENDERGROUP_OTHER", + + --- RENDERMODE + "RENDERMODE_NORMAL", + "RENDERMODE_TRANSCOLOR", + "RENDERMODE_TRANSTEXTURE", + "RENDERMODE_GLOW", + "RENDERMODE_TRANSALPHA", + "RENDERMODE_TRANSADD", + "RENDERMODE_ENVIROMENTAL", + "RENDERMODE_TRANSADDFRAMEBLEND", + "RENDERMODE_TRANSALPHADD", + "RENDERMODE_WORLDGLOW", + "RENDERMODE_NONE", + + --- RT_SIZE + "RT_SIZE_NO_CHANGE", + "RT_SIZE_DEFAULT", + "RT_SIZE_PICMIP", + "RT_SIZE_HDR", + "RT_SIZE_FULL_FRAME_BUFFER", + "RT_SIZE_OFFSCREEN", + "RT_SIZE_FULL_FRAME_BUFFER_ROUNDED_UP", + + --- SCHED + "LAST_SHARED_SCHEDULE", + "SCHED_AISCRIPT", + "SCHED_ALERT_FACE", + "SCHED_ALERT_FACE_BESTSOUND", + "SCHED_ALERT_REACT_TO_COMBAT_SOUND", + "SCHED_ALERT_SCAN", + "SCHED_ALERT_STAND", + "SCHED_ALERT_WALK", + "SCHED_AMBUSH", + "SCHED_ARM_WEAPON", + "SCHED_BACK_AWAY_FROM_ENEMY", + "SCHED_BACK_AWAY_FROM_SAVE_POSITION", + "SCHED_BIG_FLINCH", + "SCHED_CHASE_ENEMY", + "SCHED_CHASE_ENEMY_FAILED", + "SCHED_COMBAT_FACE", + "SCHED_COMBAT_PATROL", + "SCHED_COMBAT_STAND", + "SCHED_COMBAT_SWEEP", + "SCHED_COMBAT_WALK", + "SCHED_COWER", + "SCHED_DIE", + "SCHED_DIE_RAGDOLL", + "SCHED_DISARM_WEAPON", + "SCHED_DROPSHIP_DUSTOFF", + "SCHED_DUCK_DODGE", + "SCHED_ESTABLISH_LINE_OF_FIRE", + "SCHED_ESTABLISH_LINE_OF_FIRE_FALLBACK", + "SCHED_FAIL", + "SCHED_FAIL_ESTABLISH_LINE_OF_FIRE", + "SCHED_FAIL_NOSTOP", + "SCHED_FAIL_TAKE_COVER", + "SCHED_FALL_TO_GROUND", + "SCHED_FEAR_FACE", + "SCHED_FLEE_FROM_BEST_SOUND", + "SCHED_FLINCH_PHYSICS", + "SCHED_FORCED_GO", + "SCHED_FORCED_GO_RUN", + "SCHED_GET_HEALTHKIT", + "SCHED_HIDE_AND_RELOAD", + "SCHED_IDLE_STAND", + "SCHED_IDLE_WALK", + "SCHED_IDLE_WANDER", + "SCHED_INTERACTION_MOVE_TO_PARTNER", + "SCHED_INTERACTION_WAIT_FOR_PARTNER", + "SCHED_INVESTIGATE_SOUND", + "SCHED_MELEE_ATTACK1", + "SCHED_MELEE_ATTACK2", + "SCHED_MOVE_AWAY", + "SCHED_MOVE_AWAY_END", + "SCHED_MOVE_AWAY_FAIL", + "SCHED_MOVE_AWAY_FROM_ENEMY", + "SCHED_MOVE_TO_WEAPON_RANGE", + "SCHED_NEW_WEAPON", + "SCHED_NEW_WEAPON_CHEAT", + "SCHED_NONE", + "SCHED_NPC_FREEZE", + "SCHED_PATROL_RUN", + "SCHED_PATROL_WALK", + "SCHED_PRE_FAIL_ESTABLISH_LINE_OF_FIRE", + "SCHED_RANGE_ATTACK1", + "SCHED_RANGE_ATTACK2", + "SCHED_RELOAD", + "SCHED_RUN_FROM_ENEMY", + "SCHED_RUN_FROM_ENEMY_FALLBACK", + "SCHED_RUN_FROM_ENEMY_MOB", + "SCHED_RUN_RANDOM", + "SCHED_SCENE_GENERIC", + "SCHED_SCRIPTED_CUSTOM_MOVE", + "SCHED_SCRIPTED_FACE", + "SCHED_SCRIPTED_RUN", + "SCHED_SCRIPTED_WAIT", + "SCHED_SCRIPTED_WALK", + "SCHED_SHOOT_ENEMY_COVER", + "SCHED_SLEEP", + "SCHED_SMALL_FLINCH", + "SCHED_SPECIAL_ATTACK1", + "SCHED_SPECIAL_ATTACK2", + "SCHED_STANDOFF", + "SCHED_SWITCH_TO_PENDING_WEAPON", + "SCHED_TAKE_COVER_FROM_BEST_SOUND", + "SCHED_TAKE_COVER_FROM_ENEMY", + "SCHED_TAKE_COVER_FROM_ORIGIN", + "SCHED_TARGET_CHASE", + "SCHED_TARGET_FACE", + "SCHED_VICTORY_DANCE", + "SCHED_WAIT_FOR_SCRIPT", + "SCHED_WAIT_FOR_SPEAK_FINISH", + "SCHED_WAKE_ANGRY", + + --- SCREENFADE + + --- SENSORBONE + + --- SF + "SF_CITIZEN_AMMORESUPPLIER", + "SF_CITIZEN_FOLLOW", + "SF_CITIZEN_IGNORE_SEMAPHORE", + "SF_CITIZEN_MEDIC", + "SF_CITIZEN_NOT_COMMANDABLE", + "SF_CITIZEN_RANDOM_HEAD", + "SF_CITIZEN_RANDOM_HEAD_FEMALE", + "SF_CITIZEN_RANDOM_HEAD_MALE", + "SF_CITIZEN_USE_RENDER_BOUNDS", + "SF_FLOOR_TURRET_CITIZEN", + "SF_NPC_ALTCOLLISION", + "SF_NPC_ALWAYSTHINK", + "SF_NPC_DROP_HEALTHKIT", + "SF_NPC_FADE_CORPSE", + "SF_NPC_FALL_TO_GROUND", + "SF_NPC_GAG", + "SF_NPC_LONG_RANGE", + "SF_NPC_NO_PLAYER_PUSHAWAY", + "SF_NPC_NO_WEAPON_DROP", + "SF_NPC_START_EFFICIENT", + "SF_NPC_TEMPLATE", + "SF_NPC_WAIT_FOR_SCRIPT", + "SF_NPC_WAIT_TILL_SEEN", + "SF_PHYSBOX_MOTIONDISABLED", + "SF_PHYSBOX_NEVER_PICK_UP", + "SF_PHYSPROP_MOTIONDISABLED", + "SF_PHYSPROP_PREVENT_PICKUP", + "SF_ROLLERMINE_FRIENDLY", + + --- SIM + "SIM_NOTHING", + "SIM_LOCAL_ACCELERATION", + "SIM_LOCAL_FORCE", + "SIM_GLOBAL_ACCELERATION", + "SIM_GLOBAL_FORCE", + + --- SND + "SND_NOFLAGS", + "SND_CHANGE_VOL", + "SND_CHANGE_PITCH", + "SND_STOP", + "SND_SPAWNING", + "SND_DELAY", + "SND_STOP_LOOPING", + "SND_SHOULDPAUSE", + "SND_IGNORE_PHONEMES", + "SND_IGNORE_NAME", + "SND_DO_NOT_OVERWRITE_EXISTING_ON_CHANNEL", + + --- SNDLVL + "SNDLVL_NONE", + "SNDLVL_20dB", + "SNDLVL_25dB", + "SNDLVL_30dB", + "SNDLVL_35dB", + "SNDLVL_40dB", + "SNDLVL_45dB", + "SNDLVL_50dB", + "SNDLVL_55dB", + "SNDLVL_60dB
SNDLVL_IDLE", + "SNDLVL_65dB", + "SNDLVL_STATIC", + "SNDLVL_70dB", + "SNDLVL_75dB
SNDLVL_NORM", + "SNDLVL_80dB
SNDLVL_TALKING", + "SNDLVL_85dB", + "SNDLVL_90dB", + "SNDLVL_95dB", + "SNDLVL_100dB", + "SNDLVL_105dB", + "SNDLVL_110dB", + "SNDLVL_120dB", + "SNDLVL_130dB", + "SNDLVL_140dB
SNDLVL_GUNFIRE", + "SNDLVL_150dB", + "SNDLVL_180dB", + + --- SOLID + "SOLID_NONE", + "SOLID_BSP", + "SOLID_BBOX", + "SOLID_OBB", + "SOLID_OBB_YAW", + "SOLID_CUSTOM", + "SOLID_VPHYSICS", + + --- STENCIL + "STENCIL_NEVER", + "STENCIL_LESS", + "STENCIL_EQUAL", + "STENCIL_LESSEQUAL", + "STENCIL_GREATER", + "STENCIL_NOTEQUAL", + "STENCIL_GREATEREQUAL", + "STENCIL_ALWAYS", + "STENCIL_KEEP", + "STENCIL_ZERO", + "STENCIL_REPLACE", + "STENCIL_INCRSAT", + "STENCIL_DECRSAT", + "STENCIL_INVERT", + "STENCIL_INCR", + "STENCIL_DECR", + + --- STENCILCOMPARISONFUNCTION + "STENCILCOMPARISONFUNCTION_NEVER", + "STENCILCOMPARISONFUNCTION_LESS", + "STENCILCOMPARISONFUNCTION_EQUAL", + "STENCILCOMPARISONFUNCTION_LESSEQUAL", + "STENCILCOMPARISONFUNCTION_GREATER", + "STENCILCOMPARISONFUNCTION_NOTEQUAL", + "STENCILCOMPARISONFUNCTION_GREATEREQUAL", + "STENCILCOMPARISONFUNCTION_ALWAYS", + + --- STENCILOPERATION + "STENCILOPERATION_KEEP", + "STENCILOPERATION_ZERO", + "STENCILOPERATION_REPLACE", + "STENCILOPERATION_INCRSAT", + "STENCILOPERATION_DECRSAT", + "STENCILOPERATION_INVERT", + "STENCILOPERATION_INCR", + "STENCILOPERATION_DECR", + + --- STEPSOUNDTIME + "STEPSOUNDTIME_NORMAL", + "STEPSOUNDTIME_ON_LADDER", + "STEPSOUNDTIME_WATER_KNEE", + "STEPSOUNDTIME_WATER_FOOT", + + --- STUDIO + "STUDIO_DRAWTRANSLUCENTSUBMODELS", + "STUDIO_GENERATE_STATS", + "STUDIO_ITEM_BLINK", + "STUDIO_NOSHADOWS", + "STUDIO_RENDER", + "STUDIO_SHADOWDEPTHTEXTURE", + "STUDIO_SSAODEPTHTEXTURE", + "STUDIO_STATIC_LIGHTING", + "STUDIO_TRANSPARENCY", + "STUDIO_TWOPASS", + "STUDIO_VIEWXFORMATTACHMENTS", + "STUDIO_WIREFRAME", + "STUDIO_WIREFRAME_VCOLLIDE", + + --- SURF + "SURF_LIGHT", + "SURF_SKY", + "SURF_WARP", + "SURF_TRANS", + "SURF_NOPORTAL", + "SURF_TRIGGER", + "SURF_NODRAW", + "SURF_HINT", + "SURF_SKIP", + "SURF_NOLIGHT", + "SURF_BUMPLIGHT", + "SURF_NOSHADOWS", + "SURF_NODECALS", + "SURF_NOCHOP", + "SURF_HITBOX", + + --- TEAM + "TEAM_CONNECTING", + "TEAM_UNASSIGNED", + "TEAM_SPECTATOR", + + --- TEXFILTER + + --- TEXT_ALIGN + "TEXT_ALIGN_LEFT", + "TEXT_ALIGN_CENTER", + "TEXT_ALIGN_RIGHT", + "TEXT_ALIGN_TOP", + "TEXT_ALIGN_BOTTOM", + + --- TEXTUREFLAGS + "TEXTUREFLAGS_POINTSAMPLE", + "TEXTUREFLAGS_TRILINEAR", + "TEXTUREFLAGS_CLAMPS", + "TEXTUREFLAGS_CLAMPT", + "TEXTUREFLAGS_ANISOTROPIC", + "TEXTUREFLAGS_HINT_DXT5", + "TEXTUREFLAGS_PWL_CORRECTED", + "TEXTUREFLAGS_NORMAL", + "TEXTUREFLAGS_NOMIP", + "TEXTUREFLAGS_NOLOD", + "TEXTUREFLAGS_ALL_MIPS", + "TEXTUREFLAGS_PROCEDURAL", + "TEXTUREFLAGS_ONEBITALPHA", + "TEXTUREFLAGS_EIGHTBITALPHA", + "TEXTUREFLAGS_ENVMAP", + "TEXTUREFLAGS_RENDERTARGET", + "TEXTUREFLAGS_DEPTHRENDERTARGET", + "TEXTUREFLAGS_NODEBUGOVERRIDE", + "TEXTUREFLAGS_SINGLECOPY", + "TEXTUREFLAGS_UNUSED_00080000", + "TEXTUREFLAGS_UNUSED_00100000", + "TEXTUREFLAGS_UNUSED_00200000", + "TEXTUREFLAGS_UNUSED_00400000", + "TEXTUREFLAGS_NODEPTHBUFFER", + "TEXTUREFLAGS_UNUSED_01000000", + "TEXTUREFLAGS_CLAMPU", + "TEXTUREFLAGS_VERTEXTEXTURE", + "TEXTUREFLAGS_SSBUMP", + "TEXTUREFLAGS_UNUSED_10000000", + "TEXTUREFLAGS_BORDER", + "TEXTUREFLAGS_UNUSED_40000000", + "TEXTUREFLAGS_UNUSED_80000000", + + --- TRACER + "TRACER_NONE", + "TRACER_LINE", + "TRACER_RAIL", + "TRACER_BEAM", + "TRACER_LINE_AND_WHIZ", + + --- TRANSMIT + "TRANSMIT_NEVER", + "TRANSMIT_PVS", + "TRANSMIT_ALWAYS", + + --- TYPE + "TYPE_ANGLE", + "TYPE_BOOL", + "TYPE_COLOR", + "TYPE_CONVAR", + "TYPE_COUNT", + "TYPE_DAMAGEINFO", + "TYPE_DLIGHT", + "TYPE_EFFECTDATA", + "TYPE_ENTITY", + "TYPE_FILE", + "TYPE_FUNCTION", + "TYPE_IMESH", + "TYPE_INVALID", + "TYPE_LIGHTUSERDATA", + "TYPE_LOCOMOTION", + "TYPE_MATERIAL", + "TYPE_MATRIX", + "TYPE_MOVEDATA", + "TYPE_NAVAREA", + "TYPE_NAVLADDER", + "TYPE_NIL", + "TYPE_NUMBER", + "TYPE_PANEL", + "TYPE_PARTICLE", + "TYPE_PARTICLEEMITTER", + "TYPE_PARTICLESYSTEM", + "TYPE_PATH", + "TYPE_PHYSOBJ", + "TYPE_PIXELVISHANDLE", + "TYPE_RECIPIENTFILTER", + "TYPE_RESTORE", + "TYPE_SAVE", + "TYPE_SCRIPTEDVEHICLE", + "TYPE_SOUND", + "TYPE_SOUNDHANDLE", + "TYPE_STRING", + "TYPE_TABLE", + "TYPE_TEXTURE", + "TYPE_THREAD", + "TYPE_USERCMD", + "TYPE_USERDATA", + "TYPE_USERMSG", + "TYPE_VECTOR", + "TYPE_VIDEO", + + --- USE + "USE_OFF", + "USE_ON", + "USE_SET", + "USE_TOGGLE", + "CONTINUOUS_USE", + "ONOFF_USE", + "DIRECTIONAL_USE", + "SIMPLE_USE", + + --- WEAPON_PROFICIENCY + "WEAPON_PROFICIENCY_POOR", + "WEAPON_PROFICIENCY_AVERAGE", + "WEAPON_PROFICIENCY_GOOD", + "WEAPON_PROFICIENCY_VERY_GOOD", + "WEAPON_PROFICIENCY_PERFECT", + + -- END_GENERATED_CODE +} + +-- string keys mean read-write globals +stds.wiremod = { + BeamNetVars = true, + CPULib = true, + FLIR = true, + GPULib = true, + E2Lib = true, + E2Helper = true, + HCOMP = true, + WireLib = true, +} diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..5b41b8ff21 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: python + +before_install: + - pip install hererocks + - hererocks env --luajit 2.0.3 --luarocks latest + - source env/bin/activate + +install: + - luarocks install luacheck + +script: + - git diff --check $TRAVIS_COMMIT_RANGE + - git diff --name-only $TRAVIS_COMMIT_RANGE | grep '\.lua$' | xargs --no-run-if-empty luacheck --std min+garrysmod+wiremod diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..f686265f51 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,53 @@ +# Coding Guidelines + +Please see https://github.com/wiremod/wire/wiki/Coding-style for information on how code formatting is standardized in the Wiremod project. + +--- + +# Contributor Covenant Code of Conduct + +### Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +### Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +We do understand that participants who know one another may act in ways between them that could be considered unacceptable. It is our belief that this is not an issue so long as it is consentual. However, participants must still be concious, respectful, and considerate of third party observers, and as such we ask that participants keep unacceptable behavior minimal. + +### Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +### Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +### Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +### Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at http://contributor-covenant.org/version/1/4. + +Modified by the WireTeam. diff --git a/addon.json b/addon.json index a5b3355f74..ae7b83341d 100644 --- a/addon.json +++ b/addon.json @@ -2,7 +2,7 @@ "title" : "Wiremod", "type" : "tool", "tags" : [ "build", "fun" ], - "description": "A collection of entities connectable by data wires, which allows for the creation of advanced contraptions.", + "description": "A collection of entities connectable by data wires utilizing logical concepts, which allows for the creation of advanced contraptions.", "ignore" : [ "*.psd", @@ -12,6 +12,10 @@ "*.xcf", ".git*", ".gitignore", + ".luacheckrc", + ".travis.yml", + "CONTRIBUTING.md", + "generate-luacheck.sh", "git-hooks-pre-commit", "gitrid.sh", "license", @@ -19,4 +23,4 @@ "wiremod.fgd", "wiremod.jpg" ] -} \ No newline at end of file +} diff --git a/generate-luacheck.sh b/generate-luacheck.sh new file mode 100755 index 0000000000..de06e163be --- /dev/null +++ b/generate-luacheck.sh @@ -0,0 +1,118 @@ +#!/bin/bash + +set -e + +base_url='http://wiki.garrysmod.com' + +detag() { + printf '%s' "${1##*>}" +} + +wget -o /dev/null -O - "$base_url"/navbar/ | + sed -r ' + # Split up before each closing tag + s#//g + + # Remove everything before the last tag + s/.*&2 "unknown section '$section' for '$detagged'" + ;; + esac + ;; + + '&2 "Retrieving enum data for $detagged" + + url="$base_url/page/Enums/$detagged" # TODO: use URL from the tag + wget "$url" -o /dev/null -O - | + sed -rn 's/^ ('"$detagged"'_[^[:space:]]+|[A-Z][A-Z0-9_]{2,})$/ "\1",/p' + ;; + + Structures|Shaders|'Lua Reference'|Hooks|Libraries|Classes|Panels) + : + ;; + + *) + echo >&2 "unknown section '$section' for '$detagged'" + ;; + esac + ;; + + '

'*) + section="$detagged" + case "$section" in + Reference) + : + ;; + + *) + echo >&2 "Parsing section $section" + printf '\n -- %s\n' "$section" + ;; + esac + ;; + + '

'*) + section="$detagged" + case "$section" in + Enumerations) + echo >&2 "Parsing section $section" + printf '\n -- %s' "$section" # No newline after this, to avoid double newlines + ;; + esac + ;; + + ' tags + : + ;; + + *) + echo >&2 "Warning: Unhandled line '$line'" + esac + done + + printf '\n' + } | + sed -ri ' + 0,/BEGIN_GENERATED_CODE/ { + /BEGIN_GENERATED_CODE/ { + r /dev/stdin + } + b + } + /END_GENERATED_CODE/,$ b + d + ' .luacheckrc diff --git a/lua/entities/base_wire_entity.lua b/lua/entities/base_wire_entity.lua index bdb1c5694c..5afe960629 100644 --- a/lua/entities/base_wire_entity.lua +++ b/lua/entities/base_wire_entity.lua @@ -103,7 +103,7 @@ if CLIENT then end local function getWireName( ent ) - local name = ent:GetNetworkedString("WireName") + local name = ent:GetNWString("WireName") if not name or name == "" then return ent.PrintName else return name end end @@ -252,7 +252,7 @@ if CLIENT then -- Basic legacy GetOverlayText, is no longer used here but we leave it here in case other addons rely on it. function ENT:GetOverlayText() - local name = self:GetNetworkedString("WireName") + local name = self:GetNWString("WireName") if name == "" then name = self.PrintName end local header = "- " .. name .. " -" diff --git a/lua/entities/gmod_wire_cd_ray.lua b/lua/entities/gmod_wire_cd_ray.lua index b693bca92a..73538bcfab 100644 --- a/lua/entities/gmod_wire_cd_ray.lua +++ b/lua/entities/gmod_wire_cd_ray.lua @@ -132,7 +132,7 @@ function ENT:DoJob() if (self.Command[0] ~= 0) then //write ray disk.DiskMemory[sector_addr] = table.Copy(self.WriteBuffer) else //read ray - self.WriteBuffer = disk.DiskMemory[sector_addr] or { [0] = 0 } + self.WriteBuffer = table.Copy(disk.DiskMemory[sector_addr]) or { [0] = 0 } end end end diff --git a/lua/entities/gmod_wire_egp/lib/egplib/objectcontrol.lua b/lua/entities/gmod_wire_egp/lib/egplib/objectcontrol.lua index cf7626c636..57ce1b023e 100644 --- a/lua/entities/gmod_wire_egp/lib/egplib/objectcontrol.lua +++ b/lua/entities/gmod_wire_egp/lib/egplib/objectcontrol.lua @@ -100,16 +100,88 @@ end ---------------------------- -- Object order changing ---------------------------- -function EGP:SetOrder( Ent, from, to ) - if (!Ent.RenderTable or #Ent.RenderTable == 0) then return false end - if (Ent.RenderTable[from]) then +function EGP:SetOrder( Ent, from, to, dir ) + if not Ent.RenderTable or #Ent.RenderTable == 0 then return false end + dir = dir or 0 + + if Ent.RenderTable[from] then to = math.Clamp(math.Round(to or 1),1,#Ent.RenderTable) - table.insert( Ent.RenderTable, to, table.remove( Ent.RenderTable, from ) ) - if (SERVER) then Ent.RenderTable[to].ChangeOrder = {from,to} end + if SERVER then Ent.RenderTable[from].ChangeOrder = {target=to,dir=dir} end return true end return false end + +local already_reordered = {} +function EGP:PerformReorder_Ex( Ent, i ) + local obj = Ent.RenderTable[i] + if obj then + -- Check if this object has already been reordered + if already_reordered[obj.index] then + -- if yes, get its new position (or old position if it didn't change) + return already_reordered[obj.index] + end + + -- Set old position (to prevent recursive loops) + already_reordered[obj.index] = i + + if obj.ChangeOrder then + local target = obj.ChangeOrder.target + local dir = obj.ChangeOrder.dir + + local target_idx = 0 + if dir == 0 then + -- target is absolute position + target_idx = target + else + -- target is relative position + local bool, k, v = self:HasObject( Ent, target ) + if bool then + -- Check for order dependencies + k = self:PerformReorder_Ex( Ent, k ) or k + + target_idx = k + dir + end + end + + if target_idx ~= 0 then + -- Make a copy of the object and insert it at the new position + local copy = table.Copy(obj) + copy.ChangeOrder = nil + table.insert( Ent.RenderTable, target_idx, copy ) + + -- Update already reordered reference to new position + already_reordered[obj.index] = target_idx + + return target_idx + else + return i + end + end + end +end + +function EGP:PerformReorder( Ent ) + -- Reset, just to be sure + already_reordered = {} + + -- First pass, insert objects at their wanted position + for i=1,#Ent.RenderTable do + self:PerformReorder_Ex( Ent, i ) + end + + -- Second pass, remove objects from their original positions + for i=#Ent.RenderTable,1,-1 do + local obj = Ent.RenderTable[i] + if obj.ChangeOrder then + table.remove( Ent.RenderTable, i ) + end + end + + -- Clear some memory + already_reordered = {} +end + ---------------------------- -- Create / edit objects ---------------------------- diff --git a/lua/entities/gmod_wire_egp/lib/egplib/transmitreceive.lua b/lua/entities/gmod_wire_egp/lib/egplib/transmitreceive.lua index cba65fe8cb..92cee78dca 100644 --- a/lua/entities/gmod_wire_egp/lib/egplib/transmitreceive.lua +++ b/lua/entities/gmod_wire_egp/lib/egplib/transmitreceive.lua @@ -220,6 +220,8 @@ if (SERVER) then return end + local order_was_changed = false + if (!EGP.umsg.Start( "EGP_Transmit_Data", ply )) then return end net.WriteEntity( Ent ) net.WriteString( "ReceiveObjects" ) @@ -264,14 +266,10 @@ if (SERVER) then EGP:MoveTopLeft( Ent, v ) end - if (v.ChangeOrder) then -- We want to change the order of this object, send the index to where we wish to move it - local from = v.ChangeOrder[1] - local to = v.ChangeOrder[2] - if (Ent.RenderTable[to]) then - Ent.RenderTable[to].ChangeOrder = nil - end - net.WriteInt( from, 16 ) - net.WriteInt( to, 16 ) + if v.ChangeOrder then -- We want to change the order of this object, send the index to where we wish to move it + net.WriteInt( v.ChangeOrder.target, 16 ) + net.WriteInt( v.ChangeOrder.dir, 3 ) + order_was_changed = true else net.WriteInt( 0, 16 ) -- Don't change order end @@ -281,6 +279,11 @@ if (SERVER) then end EGP.umsg.End() + -- Change order now + if order_was_changed then + EGP:PerformReorder( Ent ) + end + EGP:SendQueueItem( ply ) end @@ -444,6 +447,8 @@ else -- SERVER/CLIENT if (EGP:EditObject( v, { vertices = vertices })) then Ent:EGP_Update() end end elseif (Action == "ReceiveObjects") then + local order_was_changed = false + for i=1,net.ReadUInt(16) do local index = net.ReadInt(16) if (index == 0) then break end -- In case the umsg had to abort early @@ -467,10 +472,10 @@ else -- SERVER/CLIENT else -- Change Order - local ChangeOrder_From = net.ReadInt(16) - local ChangeOrder_To - if (ChangeOrder_From != 0) then - ChangeOrder_To = net.ReadInt(16) + local ChangeOrder_To = net.ReadInt(16) + local ChangeOrder_Dir + if ChangeOrder_To ~= 0 then + ChangeOrder_Dir = net.ReadInt(3) end local current_obj @@ -513,18 +518,17 @@ else -- SERVER/CLIENT end -- Change Order (later) - if (ChangeOrder_From and ChangeOrder_To) then - current_obj.ChangeOrder = {ChangeOrder_From,ChangeOrder_To} + if ChangeOrder_To ~= 0 then + order_was_changed = true + current_obj.ChangeOrder = {target=ChangeOrder_To,dir=ChangeOrder_Dir} end end end - for i=1,#Ent.RenderTable do -- Change order now - local obj = Ent.RenderTable[i] - if obj.ChangeOrder then - self:SetOrder( Ent, obj.ChangeOrder[1], obj.ChangeOrder[2] ) - obj.ChangeOrder = nil - end + + -- Change order now + if order_was_changed then + self:PerformReorder( Ent ) end Ent:EGP_Update() diff --git a/lua/entities/gmod_wire_egp_hud/init.lua b/lua/entities/gmod_wire_egp_hud/init.lua index c053fa95b6..a64d6616c1 100644 --- a/lua/entities/gmod_wire_egp_hud/init.lua +++ b/lua/entities/gmod_wire_egp_hud/init.lua @@ -1,8 +1,8 @@ AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") -include('shared.lua') -AddCSLuaFile("HUDDraw.lua") -include("HUDDraw.lua") +include("shared.lua") +AddCSLuaFile("huddraw.lua") +include("huddraw.lua") ENT.WireDebugName = "E2 Graphics Processor HUD" diff --git a/lua/entities/gmod_wire_exit_point.lua b/lua/entities/gmod_wire_exit_point.lua index 7c83968470..aa7773a4cc 100644 --- a/lua/entities/gmod_wire_exit_point.lua +++ b/lua/entities/gmod_wire_exit_point.lua @@ -63,7 +63,7 @@ function ENT:AddExitPoint() ExitPoints[self] = true end local function RemoveExitPoint( ent ) - if ExitPoints[self] then ExitPoints[self] = nil end + if ExitPoints[ent] then ExitPoints[ent] = nil end end hook.Add( "EntityRemoved", "WireExitPoint", RemoveExitPoint ) diff --git a/lua/entities/gmod_wire_explosive.lua b/lua/entities/gmod_wire_explosive.lua index c5e96f62a8..4da92f0b03 100644 --- a/lua/entities/gmod_wire_explosive.lua +++ b/lua/entities/gmod_wire_explosive.lua @@ -5,6 +5,9 @@ ENT.WireDebugName = "Explosive" if CLIENT then return end -- No more client +local wire_explosive_delay = CreateConVar( "wire_explosive_delay", 0.2, FCVAR_ARCHIVE ) +local wire_explosive_range = CreateConVar( "wire_explosive_range", 512, FCVAR_ARCHIVE ) + function ENT:Initialize() self:PhysicsInit( SOLID_VPHYSICS ) @@ -49,7 +52,7 @@ function ENT:Setup( key, damage, delaytime, removeafter, radius, affectother, no self.Damage = math.Clamp( damage, 0, 1500 ) self.Delaytime = delaytime self.Removeafter = removeafter - self.Radius = math.min(512,math.max(radius, 1)) + self.Radius = math.Clamp(radius, 1, wire_explosive_range:GetFloat()) self.Affectother = affectother self.Notaffected = notaffected self.Delayreloadtime = delayreloadtime @@ -219,9 +222,9 @@ function ENT:Explode( ) if(not IsValid(ply)) then ply = self end; if (self.InvisibleAtZero) then - ply:SetCollisionGroup(COLLISION_GROUP_DEBRIS) - ply:SetNoDraw( true ) - ply:SetColor(Color(255, 255, 255, 0)) + self:SetCollisionGroup(COLLISION_GROUP_DEBRIS) + self:SetNoDraw( true ) + self:SetColor(Color(255, 255, 255, 0)) end if ( self.Damage > 0 ) then @@ -240,7 +243,7 @@ function ENT:Explode( ) self.exploding = false self.reloading = true - self.ReloadTime = CurTime() + math.max(1, self.Delayreloadtime) + self.ReloadTime = CurTime() + math.max(wire_explosive_delay:GetFloat(), self.Delayreloadtime) // Force reset of counter self.CountTime = 0 self:ShowOutput() @@ -256,7 +259,7 @@ function ENT:ShowOutput( ) self:SetColor(Color(255, c, c, 255)) end if (self.InvisibleAtZero) then - ply:SetNoDraw( false ) + self:SetNoDraw( false ) self:SetColor(Color(255, 255, 255, 255 * ((self.Delayreloadtime - self.count) / self.Delayreloadtime))) self:SetRenderMode(RENDERMODE_TRANSALPHA) end diff --git a/lua/entities/gmod_wire_expression2/base/compiler.lua b/lua/entities/gmod_wire_expression2/base/compiler.lua index 0cc23c5b2e..6cd6fdafd0 100644 --- a/lua/entities/gmod_wire_expression2/base/compiler.lua +++ b/lua/entities/gmod_wire_expression2/base/compiler.lua @@ -13,7 +13,7 @@ function Compiler.Execute(...) local instance = setmetatable({}, Compiler) -- and pcall the new instance's Process method. - return pcall(Compiler.Process, instance, ...) + return xpcall(Compiler.Process, E2Lib.errorHandler, instance, ...) end function Compiler:Error(message, instr) diff --git a/lua/entities/gmod_wire_expression2/base/parser.lua b/lua/entities/gmod_wire_expression2/base/parser.lua index 25411b7701..a1190fd180 100644 --- a/lua/entities/gmod_wire_expression2/base/parser.lua +++ b/lua/entities/gmod_wire_expression2/base/parser.lua @@ -86,7 +86,7 @@ function Parser.Execute(...) local instance = setmetatable({}, Parser) -- and pcall the new instance's Process method. - return pcall(Parser.Process, instance, ...) + return xpcall(Parser.Process, E2Lib.errorHandler, instance, ...) end function Parser:Error(message, token) diff --git a/lua/entities/gmod_wire_expression2/base/preprocessor.lua b/lua/entities/gmod_wire_expression2/base/preprocessor.lua index ff8ab6dd18..392d03d879 100644 --- a/lua/entities/gmod_wire_expression2/base/preprocessor.lua +++ b/lua/entities/gmod_wire_expression2/base/preprocessor.lua @@ -13,7 +13,7 @@ function PreProcessor.Execute(...) local instance = setmetatable({}, PreProcessor) -- and pcall the new instance's Process method. - return pcall(instance.Process, instance, ...) + return xpcall(instance.Process, E2Lib.errorHandler, instance, ...) end function PreProcessor:Error(message, column) @@ -399,4 +399,4 @@ function PreProcessor:PP_endif(args) if self.disabled == nil then self:Error("Found #endif outside #ifdef block") end if args:Trim() ~= "" then self:Error("Must not pass an argument to #endif") end self.disabled = nil -end \ No newline at end of file +end diff --git a/lua/entities/gmod_wire_expression2/base/tokenizer.lua b/lua/entities/gmod_wire_expression2/base/tokenizer.lua index 068b8e624b..714a8f6c60 100644 --- a/lua/entities/gmod_wire_expression2/base/tokenizer.lua +++ b/lua/entities/gmod_wire_expression2/base/tokenizer.lua @@ -13,7 +13,7 @@ function Tokenizer.Execute(...) local instance = setmetatable({}, Tokenizer) -- and pcall the new instance's Process method. - return pcall(Tokenizer.Process, instance, ...) + return xpcall(Tokenizer.Process, E2Lib.errorHandler, instance, ...) end function Tokenizer:Error(message, offset) @@ -264,4 +264,4 @@ function Tokenizer:NextOperator() -- branch op = op[2][self.character] end -end \ No newline at end of file +end diff --git a/lua/entities/gmod_wire_expression2/core/custom/cl_constraintcore.lua b/lua/entities/gmod_wire_expression2/core/custom/cl_constraintcore.lua index 94261f1e04..4eaa2fe64a 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/cl_constraintcore.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/cl_constraintcore.lua @@ -11,8 +11,8 @@ E2Helper.Descriptions["axis(evev)"] = "Creates an axis constraint between two en E2Helper.Descriptions["axis(evevn)"] = "Creates an axis constraint between two entities at vectors local to each entity with friction" E2Helper.Descriptions["axis(evevnv)"] = "Creates an axis constraint between two entities at vectors local to each entity with friction and local rotation axis" E2Helper.Descriptions["ballsocket"] = "Creates a ballsocket constraint between two entities at a vector local to ent1" -E2Helper.Descriptions["ballsocket(evevvv)"] = "Creates an AdvBallsocket constraint between two entities at a vector local to ent1, using the specified mins, maxs, and frictions)" -E2Helper.Descriptions["ballsocket(evevvvn)"] = "Creates an AdvBallsocket constraint between two entities at a vector local to ent1, using the specified mins, maxs, frictions, rotateonly)" +E2Helper.Descriptions["ballsocket(evevvv)"] = "Creates an AdvBallsocket constraint between two entities at a vector local to ent1, using the specified mins, maxs, and frictions" +E2Helper.Descriptions["ballsocket(evevvvn)"] = "Creates an AdvBallsocket constraint between two entities at a vector local to ent1, using the specified mins, maxs, frictions, rotateonly" E2Helper.Descriptions["weldAng"] = "Creates an angular weld constraint (angles are fixed, position is free) between two entities at a vector local to ent1" E2Helper.Descriptions["winch"] = "Creates a winch constraint with a referenceid, between two entities, at vectors local to each" E2Helper.Descriptions["hydraulic(nevevn)"] = "Creates a hydraulic constraint with a referenceid, between two entities, at vectors local to each" diff --git a/lua/entities/gmod_wire_expression2/core/custom/cl_prop.lua b/lua/entities/gmod_wire_expression2/core/custom/cl_prop.lua index 323510f8d5..7c17a9e6f8 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/cl_prop.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/cl_prop.lua @@ -31,3 +31,5 @@ E2Helper.Descriptions["propGetElasticity"] = "Gets prop's elasticity coefficient E2Helper.Descriptions["propSpawnUndo"] = "Set to 0 to force prop removal on E2 shutdown, and suppress Undo entries for props." E2Helper.Descriptions["propDeleteAll"] = "Removes all entities spawned by this E2" E2Helper.Descriptions["propStatic"] = "Sets to 1 to make the entity static (disables movement, physgun, unfreeze, drive...) or 0 to cancel." +E2Helper.Descriptions["propSetVelocity"] = "Sets the velocity of the prop for the next iteration" +E2Helper.Descriptions["propSetVelocityInstant"] = "Sets the initial velocity of the prop" diff --git a/lua/entities/gmod_wire_expression2/core/custom/effects.lua b/lua/entities/gmod_wire_expression2/core/custom/effects.lua index e01a09db32..d487c83096 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/effects.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/effects.lua @@ -173,7 +173,7 @@ e2function void effect:play(string name) if not this then return end if not isAllowed(self) then return end - util.Effect(name,this,false) + util.Effect(name,this) end registerCallback("construct", function(self) diff --git a/lua/entities/gmod_wire_expression2/core/custom/prop.lua b/lua/entities/gmod_wire_expression2/core/custom/prop.lua index ada2f0fdbb..c2f1c4e578 100644 --- a/lua/entities/gmod_wire_expression2/core/custom/prop.lua +++ b/lua/entities/gmod_wire_expression2/core/custom/prop.lua @@ -69,7 +69,7 @@ function PropCore.CreateProp(self,model,pos,angles,freeze,isVehicle) if model == "" then model = "models/nova/airboat_seat.mdl" end end - if not util.IsValidModel( model ) or not util.IsValidProp( model ) then return nil end + if not util.IsValidProp( model ) or not WireLib.CanModel(self.player, model) then return nil end pos = E2Lib.clampPos( pos ) @@ -365,6 +365,22 @@ e2function string entity:propPhysicalMaterial() return "" end +e2function void entity:propSetVelocity(vector velocity) + if not PropCore.ValidAction(self, this, "velocitynxt") then return end + local phys = this:GetPhysicsObject() + if IsValid( phys ) then + phys:SetVelocity(Vector(velocity[1], velocity[2], velocity[3])) + end +end + +e2function void entity:propSetVelocityInstant(vector velocity) + if not PropCore.ValidAction(self, this, "velocityins") then return end + local phys = this:GetPhysicsObject() + if IsValid( phys ) then + phys:SetVelocityInstantaneous(Vector(velocity[1], velocity[2], velocity[3])) + end +end + hook.Add( "CanDrive", "checkPropStaticE2", function( ply, ent ) if ent.propStaticE2 ~= nil then return false end end ) e2function void entity:propStatic( number static ) if not PropCore.ValidAction( self, this, "static" ) then return end diff --git a/lua/entities/gmod_wire_expression2/core/e2lib.lua b/lua/entities/gmod_wire_expression2/core/e2lib.lua index ff71b0656d..0f37a370f6 100644 --- a/lua/entities/gmod_wire_expression2/core/e2lib.lua +++ b/lua/entities/gmod_wire_expression2/core/e2lib.lua @@ -296,6 +296,19 @@ end -- ----------------------------- compiler stuf --------------------------------- +-- A function suitable for use as xpcall's error handler. If the error is +-- generated by Compiler:Error, Parser:Error, etc., then the string will be a +-- usable error message. If not, then it's an error not caused by an error in +-- user code, and so we dump a stack trace to the console to help debug it. +function E2Lib.errorHandler(message) + if string.match(message, " at line ") then return message end + + print("Internal error - please report to https://github.com/wiremod/wire/issues") + print(message) + debug.Trace() + return "Internal error, see console for more details" +end + E2Lib.optable_inv = { add = "+", sub = "-", diff --git a/lua/entities/gmod_wire_expression2/core/egpfunctions.lua b/lua/entities/gmod_wire_expression2/core/egpfunctions.lua index 47b525ca6e..442431d09a 100644 --- a/lua/entities/gmod_wire_expression2/core/egpfunctions.lua +++ b/lua/entities/gmod_wire_expression2/core/egpfunctions.lua @@ -89,6 +89,36 @@ e2function number wirelink:egpOrder( number index ) return -1 end +e2function void wirelink:egpOrderAbove( number index, number abovethis ) + if not EGP:IsAllowed( self, this ) then return end + local bool, k, v = EGP:HasObject( this, index ) + if bool then + local bool2, k2, v2 = EGP:HasObject( this, abovethis ) + if bool2 then + local bool3 = EGP:SetOrder( this, k, abovethis, 1 ) + if bool3 then + EGP:DoAction( this, self, "SendObject", v ) + Update(self,this) + end + end + end +end + +e2function void wirelink:egpOrderBelow( number index, number belowthis ) + if not EGP:IsAllowed( self, this ) then return end + local bool, k, v = EGP:HasObject( this, index ) + if bool then + local bool2, k2, v2 = EGP:HasObject( this, belowthis ) + if bool2 then + local bool3 = EGP:SetOrder( this, k, belowthis, -1 ) + if bool3 then + EGP:DoAction( this, self, "SendObject", v ) + Update(self,this) + end + end + end +end + __e2setcost(15) -------------------------------------------------------- @@ -959,6 +989,22 @@ e2function void wirelink:egpResolution( vector2 topleft, vector2 bottomright ) EGP:DoAction( this, self, "SetScale", xScale, yScale ) end +e2function vector2 wirelink:egpOrigin() + if (!EGP:IsAllowed( self, this )) then return end + local xOrigin = this.xScale[1] + (this.xScale[2] - this.xScale[1])/2 + local yOrigin = this.yScale[1] + (this.yScale[2] - this.yScale[1])/2 + return { xOrigin, yOrigin } + --return EGP:DoAction( this, self, "GetOrigin" ) +end + +e2function vector2 wirelink:egpSize() + if (!EGP:IsAllowed( self, this )) then return end + local width = math.abs(this.xScale[1] - this.xScale[2]) + local height = math.abs(this.yScale[1] - this.yScale[2]) + return { width, height } + --return EGP:DoAction( this, self, "GetScreenSize" ) +end + e2function void wirelink:egpDrawTopLeft( number onoff ) if (!EGP:IsAllowed( self, this )) then return end local bool = true diff --git a/lua/entities/gmod_wire_expression2/core/extloader.lua b/lua/entities/gmod_wire_expression2/core/extloader.lua index 20b299abeb..bb2941ac08 100644 --- a/lua/entities/gmod_wire_expression2/core/extloader.lua +++ b/lua/entities/gmod_wire_expression2/core/extloader.lua @@ -60,10 +60,6 @@ wire_expression2_reset_extensions() include("extpp.lua") -local function luaExists(luaname) - return #file.Find(luaname, "LUA") ~= 0 -end - local included_files local function e2_include_init() @@ -75,12 +71,6 @@ end local function e2_include(name) local path, filename = string.match(name, "^(.-/?)([^/]*)$") - local cl_name = path .. "cl_" .. filename - if luaExists("entities/gmod_wire_expression2/core/" .. cl_name) then - -- If a file of the same name prefixed with cl_ exists, send it to the client and load it there. - AddCSE2File(cl_name) - end - local luaname = "entities/gmod_wire_expression2/core/" .. name local contents = file.Read(luaname, "LUA") or "" e2_extpp_pass1(contents) @@ -174,14 +164,13 @@ e2_include("datasignal.lua") e2_include("egpfunctions.lua") e2_include("functions.lua") e2_include("strfunc.lua") +e2_include("steamidconv.lua") +-- Load serverside files here, they need additional parsing do local list = file.Find("entities/gmod_wire_expression2/core/custom/*.lua", "LUA") for _, filename in pairs(list) do - if filename:sub(1, 3) == "cl_" then - -- If the is prefixed with "cl_", send it to the client and load it there. - AddCSE2File("custom/" .. filename) - else + if filename:sub(1, 3) ~= "cl_" then e2_include("custom/" .. filename) end end diff --git a/lua/entities/gmod_wire_expression2/core/find.lua b/lua/entities/gmod_wire_expression2/core/find.lua index 21ec72a65f..729cd06326 100644 --- a/lua/entities/gmod_wire_expression2/core/find.lua +++ b/lua/entities/gmod_wire_expression2/core/find.lua @@ -14,7 +14,7 @@ local function filter_all() return true end local function filter_none() return false end local forbidden_classes = { - /* + --[[ ["info_apc_missile_hint"] = true, ["info_camera_link"] = true, ["info_constraint_anchor"] = true, @@ -42,7 +42,7 @@ local forbidden_classes = { ["info_target_gunshipcrash"] = true, ["info_teleport_destination"] = true, ["info_teleporter_countdown"] = true, - */ + ]] ["info_player_allies"] = true, ["info_player_axis"] = true, ["info_player_combine"] = true, @@ -442,6 +442,18 @@ e2function entity findPlayerByName(string name) return findPlayer(name) end +--- Returns the player with the given SteamID +e2function entity findPlayerBySteamID(string id) + if query_blocked(self, 1) then return NULL end + return player.GetBySteamID(id) or NULL +end + +--- Returns the player with the given SteamID64 +e2function entity findPlayerBySteamID64(string id) + if query_blocked(self, 1) then return NULL end + return player.GetBySteamID64(id) or NULL +end + --[[************************************************************************]]-- __e2setcost(10) @@ -990,3 +1002,21 @@ e2function number findClipToEntities( array entities ) return lookup[ent] end) end + +-- Filters the list of entities by removing all props not owned by this player +e2function number findClipToPlayerProps( entity ply ) + if not IsValid(ply) then return -1 end + return applyClip( self, function( ent ) + if not IsValid(ent) then return false end + return getOwner(self,ent) == ply + end) +end + +-- Filters the list of entities by removing all props owned by this player +e2function number findClipFromPlayerProps( entity ply ) + if not IsValid(ply) then return -1 end + return applyClip( self, function( ent ) + if not IsValid(ent) then return false end + return getOwner(self,ent) ~= ply + end) +end diff --git a/lua/entities/gmod_wire_expression2/core/hologram.lua b/lua/entities/gmod_wire_expression2/core/hologram.lua index ddb51f87d0..80802e5d58 100644 --- a/lua/entities/gmod_wire_expression2/core/hologram.lua +++ b/lua/entities/gmod_wire_expression2/core/hologram.lua @@ -135,13 +135,13 @@ for _,v in pairs( ModelList ) do end end -local function GetModel(model) +local function GetModel(self, model, skin) if ModelList[model] then model = "models/holograms/" .. ModelList[model] .. ".mdl" elseif wire_holograms_modelany:GetInt() == 0 then return elseif wire_holograms_modelany:GetInt() == 1 then - if not util.IsValidModel(model) then return nil end + if not WireLib.CanModel(self.player, model, skin) then return nil end end return Model(model) end @@ -454,7 +454,7 @@ local function MakeHolo(Player, Pos, Ang, model) E2Lib.setAng(prop, Ang) prop:SetModel(model) prop:SetPlayer(Player) - prop:SetNetworkedInt("ownerid", Player:UserID()) + prop:SetNWInt("ownerid", Player:UserID()) return prop end @@ -491,7 +491,7 @@ local function CreateHolo(self, index, pos, scale, ang, color, model) if not scale then scale = Vector(1,1,1) end if not ang then ang = self.entity:GetAngles() end - model = GetModel(model or "cube") or "models/holograms/cube.mdl" + model = GetModel(self, model or "cube") or "models/holograms/cube.mdl" local Holo = CheckIndex(self, index) if not Holo then @@ -689,7 +689,7 @@ e2function void holoDeleteAll( all ) end e2function void holoReset(index, string model, vector scale, vector color, string material) - model = GetModel(model) + model = GetModel(self, model) if not model then return end local Holo = CheckIndex(self, index) if not Holo then return end @@ -936,7 +936,7 @@ e2function void holoModel(index, string model) local Holo = CheckIndex(self, index) if not Holo then return end - model = GetModel(model) + model = GetModel(self, model) if not model then return end Holo.ent:SetModel(model) @@ -947,11 +947,11 @@ e2function void holoModel(index, string model, skin) if not Holo then return end skin = skin - skin % 1 - Holo.ent:SetSkin(skin) - model = GetModel(model) + model = GetModel(self, model, skin) if not model then return end + Holo.ent:SetSkin(skin) Holo.ent:SetModel(model) end diff --git a/lua/entities/gmod_wire_expression2/core/http.lua b/lua/entities/gmod_wire_expression2/core/http.lua index 7898a56cde..2d67f136c3 100644 --- a/lua/entities/gmod_wire_expression2/core/http.lua +++ b/lua/entities/gmod_wire_expression2/core/http.lua @@ -18,8 +18,8 @@ local function player_can_request( ply ) local preq = requests[ply] return !preq or - (preq.in_progress and preq.t_start and (CurTime() - preq.t_start) >= cvar_timeout:GetInt()) or - (!preq.in_progress and preq.t_end and (CurTime() - preq.t_end) >= cvar_delay:GetInt()) + (preq.in_progress and preq.t_start and (CurTime() - preq.t_start) >= cvar_timeout:GetFloat()) or + (!preq.in_progress and preq.t_end and (CurTime() - preq.t_end) >= cvar_delay:GetFloat()) end __e2setcost( 20 ) diff --git a/lua/entities/gmod_wire_expression2/core/init.lua b/lua/entities/gmod_wire_expression2/core/init.lua index 8e1f491376..a69e30d009 100644 --- a/lua/entities/gmod_wire_expression2/core/init.lua +++ b/lua/entities/gmod_wire_expression2/core/init.lua @@ -173,28 +173,36 @@ end -- --------------------------------------------------------------- +-- Load clientside files here +-- Serverside files are instead loaded in extloader.lua, because they need additional parsing +do + local function loadFiles( extra, list ) + for _, filename in pairs(list) do + if SERVER then AddCSLuaFile("entities/gmod_wire_expression2/core/" .. extra .. filename) + else include("entities/gmod_wire_expression2/core/" .. extra .. filename) end + end + end + + loadFiles("custom/",file.Find("entities/gmod_wire_expression2/core/custom/cl_*.lua", "LUA")) + loadFiles("",file.Find("entities/gmod_wire_expression2/core/cl_*.lua", "LUA")) +end + if SERVER then util.AddNetworkString("e2_functiondata_start") util.AddNetworkString("e2_functiondata_chunk") - local clientside_files = {} - - function AddCSE2File(filename) - AddCSLuaFile(filename) - clientside_files[filename] = true - end - + -- Serverside files are loaded in extloader include("extloader.lua") -- -- Transfer E2 function info to the client for validation and syntax highlighting purposes -- -- do - local miscdata = {} -- Will contain {E2 types info, includes, constants}, this whole table is under 1kb + local miscdata = {} -- Will contain {E2 types info, constants}, this whole table is under 1kb local functiondata = {} -- Will contain {functionname = {returntype, cost, argnames}, this will be between 50-100kb -- Fills out the above two tables function wire_expression2_prepare_functiondata() - miscdata = { {}, clientside_files, wire_expression2_constants } + miscdata = { {}, wire_expression2_constants } functiondata = {} for typename, v in pairs(wire_expression_types) do miscdata[1][typename] = v[1] -- typeid (s) @@ -215,7 +223,6 @@ if SERVER then net.Start("e2_functiondata_start") net.WriteTable(miscdata[1]) net.WriteTable(miscdata[2]) - net.WriteTable(miscdata[3]) net.Send(target) end end @@ -297,7 +304,7 @@ elseif CLIENT then end end - local function insertMiscData(types, includes, constants) + local function insertMiscData(types, constants) wire_expression2_reset_extensions() -- types @@ -306,11 +313,6 @@ elseif CLIENT then wire_expression_types2[typeid] = { typename } end - -- includes - for filename, _ in pairs(includes) do - include("entities/gmod_wire_expression2/core/" .. filename) - end - -- constants wire_expression2_constants = constants end @@ -318,7 +320,7 @@ elseif CLIENT then local buffer = {} net.Receive("e2_functiondata_start", function(len) buffer = {} - insertMiscData(net.ReadTable(), net.ReadTable(), net.ReadTable()) + insertMiscData(net.ReadTable(), net.ReadTable()) end) net.Receive("e2_functiondata_chunk", function(len) diff --git a/lua/entities/gmod_wire_expression2/core/number.lua b/lua/entities/gmod_wire_expression2/core/number.lua index 752e72bbe6..9abd97b00c 100644 --- a/lua/entities/gmod_wire_expression2/core/number.lua +++ b/lua/entities/gmod_wire_expression2/core/number.lua @@ -4,8 +4,10 @@ local delta = wire_expression2_delta local math = math local random = math.random local pi = math.pi +local inf = math.huge local exp = math.exp +local frexp = math.frexp local log = math.log local log10 = math.log10 local sqrt = math.sqrt @@ -226,6 +228,27 @@ end) __e2setcost(2) -- approximation +--- Returns true (1) if given value is a finite number; otherwise false (0). +e2function number isfinite(value) + return (value > -inf and value < inf) and 1 or 0 +end + +--- Returns 1 if given value is a positive infinity or -1 if given value is a negative infinity; otherwise 0. +e2function number isinf(value) + if value == inf then return 1 end + if value == -inf then return -1 end + return 0 +end + +--- Returns true (1) if given value is not a number (NaN); otherwise false (0). +e2function number isnan(value) + return (value ~= value) and 1 or 0 +end + +--[[************************************************************************]]-- + +__e2setcost(2) -- approximation + e2function number abs(value) if value >= 0 then return value else return -value end end @@ -376,6 +399,11 @@ registerFunction("exp", "n", "n", function(self, args) return exp(rv1) end) +e2function vector2 frexp(x) + local mantissa, exponent = frexp(x) + return { mantissa, exponent } +end + registerFunction("ln", "n", "n", function(self, args) local op1 = args[2] local rv1 = op1[1](self, op1) @@ -408,6 +436,10 @@ __e2setcost(2) -- approximation local deg2rad = pi / 180 local rad2deg = 180 / pi +registerFunction("inf", "", "n", function(self, args) + return inf +end) + registerFunction("pi", "", "n", function(self, args) return pi end) diff --git a/lua/entities/gmod_wire_expression2/core/player.lua b/lua/entities/gmod_wire_expression2/core/player.lua index c095846bfc..42cca79b29 100644 --- a/lua/entities/gmod_wire_expression2/core/player.lua +++ b/lua/entities/gmod_wire_expression2/core/player.lua @@ -4,6 +4,16 @@ local IsValid = IsValid local isOwner = E2Lib.isOwner + + +local spawnAlert = {} +local runBySpawn = 0 +local lastJoined = NULL + +local leaveAlert = {} +local runByLeave = 0 +local lastLeft = NULL + registerCallback("e2lib_replace_function", function(funcname, func, oldfunc) if funcname == "isOwner" then isOwner = func @@ -71,6 +81,10 @@ e2function string entity:steamID() return this:SteamID() end +e2function string entity:steamID64() + return IsValid(this) and this:IsPlayer() and this:SteamID64() or "" +end + e2function number entity:armor() if(!IsValid(this)) then return 0 end if(this:IsPlayer() or this:IsNPC()) then return this:Armor() else return 0 end @@ -192,11 +206,11 @@ e2function number entity:keyUse() end e2function number entity:keyReload() - return (IsValid(this) and this:IsPlayer() and this:KeyDown(IN_RELOAD)) and 1 or 0 + return (IsValid(this) and this:IsPlayer() and this:KeyDown(IN_RELOAD)) and 1 or 0 end e2function number entity:keyZoom() - return (IsValid(this) and this:IsPlayer() and this:KeyDown(IN_ZOOM)) and 1 or 0 + return (IsValid(this) and this:IsPlayer() and this:KeyDown(IN_ZOOM)) and 1 or 0 end e2function number entity:keyWalk() @@ -259,6 +273,9 @@ keys_lookup[113] = "mouse_wheel_down" registerCallback("destruct",function(self) KeyAlert[self.entity] = nil + --Used futher below. Didn't want to create more then one of these per file + spawnAlert[self.entity] = nil + leaveAlert[self.entity] = nil end) local function UpdateKeys(ply, key) @@ -529,3 +546,65 @@ e2function ranger entity:eyeTraceCursor() ret.RealStartPos = this:GetShootPos() return ret end + +--[[--------------------------------------------------------------------------------------------]]-- + +hook.Add("PlayerInitialSpawn","Exp2RunOnJoin", function(ply) + runBySpawn = 1 + lastJoined = ply + for e,_ in pairs(spawnAlert) do + if IsValid(e) then + e:Execute() + else + spawnAlert[e] = nil + end + end + runBySpawn = 0 +end) + +hook.Add("PlayerDisconnected","Exp2RunOnLeave", function(ply) + runByLeave = 1 + lastLeft = ply + for e,_ in pairs(leaveAlert) do + if IsValid(e) then + e:Execute() + else + leaveAlert[e] = nil + end + end + runByLeave = 0 +end) + +__e2setcost(3) + +e2function void runOnPlayerConnect(activate) + if activate ~= 0 then + spawnAlert[self.entity] = true + else + spawnAlert[self.entity] = nil + end +end + +e2function number playerConnectClk() + return runBySpawn +end + +e2function entity lastConnectedPlayer() + return lastJoined +end + +e2function void runOnPlayerDisconnect(activate) + if activate ~= 0 then + leaveAlert[self.entity] = true + else + leaveAlert[self.entity] = nil + end +end + +e2function number playerDisconnectClk() + return runByLeave +end + +e2function entity lastDisconnectedPlayer() + return lastLeft +end diff --git a/lua/entities/gmod_wire_expression2/core/selfaware.lua b/lua/entities/gmod_wire_expression2/core/selfaware.lua index fc001a197e..35dc110f58 100644 --- a/lua/entities/gmod_wire_expression2/core/selfaware.lua +++ b/lua/entities/gmod_wire_expression2/core/selfaware.lua @@ -108,8 +108,10 @@ end -- Get the name of another E2 e2function string entity:getName() - if (!IsValid(this) or this:GetClass() != "gmod_wire_expression2") then return "" end - return this.name or "" + if IsValid(this) and this.GetGateName then + return this:GetGateName() or "" + end + return "" end diff --git a/lua/entities/gmod_wire_expression2/core/serialization.lua b/lua/entities/gmod_wire_expression2/core/serialization.lua index 1dfd3f9596..b5cf73c4d9 100644 --- a/lua/entities/gmod_wire_expression2/core/serialization.lua +++ b/lua/entities/gmod_wire_expression2/core/serialization.lua @@ -33,6 +33,16 @@ local function logGlonCall( self, glonString, ret, safeGlonObject ) end ]] +local antispam_lookup = {} +local function antispam( self ) + if antispam_lookup[self.uid] and antispam_lookup[self.uid] > CurTime() then + return false + end + + antispam_lookup[self.uid] = CurTime() + 0.5 + return true +end + -- this conversions table is used by luaTypeToWireTypeid local conversions = { -- convert boolean to number @@ -316,6 +326,7 @@ e2function string vonEncode(array data) local ok, ret = pcall(WireLib.von.serialize, data) if not ok then last_von_error = ret + if not antispam(self) then return "" end WireLib.ClientError("von.encode error: "..ret, self.player) return "" end @@ -337,6 +348,7 @@ e2function array vonDecode(string data) if not ok then last_von_error = ret + if not antispam(self) then return {} end WireLib.ClientError("von.decode error: "..ret, self.player) return {} end @@ -366,6 +378,7 @@ e2function table vonDecodeTable(string data) local ok, ret = pcall(WireLib.von.deserialize, data) if not ok then last_von_error = ret + if not antispam(self) then return table.Copy(DEFAULT) end WireLib.ClientError("von.decode error: "..ret, self.player) return table.Copy(DEFAULT) end @@ -385,6 +398,7 @@ local function jsonEncode( self, data, prettyprint ) local ok, ret = pcall(util.TableToJSON, data, prettyprint ~= 0) if not ok then last_json_error = ret + if not antispam(self) then return "" end WireLib.ClientError("jsonEncode error: "..ret, self.player) return "" end @@ -406,6 +420,7 @@ local function jsonDecode( self, data, tp ) if not ok then last_json_error = ret + if not antispam(self) then return {} end WireLib.ClientError("jsonDecode error: "..ret, self.player) return {} end diff --git a/lua/entities/gmod_wire_expression2/core/steamidconv.lua b/lua/entities/gmod_wire_expression2/core/steamidconv.lua new file mode 100644 index 0000000000..cafa1ba37a --- /dev/null +++ b/lua/entities/gmod_wire_expression2/core/steamidconv.lua @@ -0,0 +1,15 @@ +local util = util +local util_SteamIDFrom64 = util.SteamIDFrom64 +local util_SteamIDTo64 = util.SteamIDTo64 + +__e2setcost(5) -- approximated + +--- Given a 64bit SteamID will return a STEAM_0 style Steam ID. +e2function string steamIDFrom64(string community_id) + return util_SteamIDFrom64(community_id) +end + +--- Given a STEAM_0 style Steam ID will return a 64bit Steam ID. +e2function string steamIDTo64(string id) + return util_SteamIDTo64(id) +end diff --git a/lua/entities/gmod_wire_expression2/core/string.lua b/lua/entities/gmod_wire_expression2/core/string.lua index 3db58853b3..425a652305 100644 --- a/lua/entities/gmod_wire_expression2/core/string.lua +++ b/lua/entities/gmod_wire_expression2/core/string.lua @@ -122,6 +122,8 @@ end local string_char = string.char local string_byte = string.byte local string_len = string.len +local utf8_char = utf8.char +local utf8_byte = utf8.codepoint registerFunction("toChar", "n", "s", function(self, args) local op1 = args[2] @@ -150,57 +152,20 @@ local math_floor = math.floor registerFunction("toUnicodeChar", "n", "s", function(self, args) local op1 = args[2] local rv1 = op1[1](self, op1) - local utf8 = "" - if rv1 < 1 then - return "" - elseif rv1 <= 127 then - utf8 = string_char (rv1) - elseif rv1 < 2048 then - utf8 = ("%c%c"):format( 192 + math_floor (rv1 / 64), 128 + (rv1 % 64)) - elseif rv1 < 65536 then - utf8 = ("%c%c%c"):format( 224 + math_floor (rv1 / 4096), 128 + (math_floor (rv1 / 64) % 64), 128 + (rv1 % 64)) - elseif rv1 < 2097152 then - utf8 = ("%c%c%c%c"):format( 240 + math_floor (rv1 / 262144), 128 + (math_floor(rv1 / 4096) % 64), 128 + (math_floor (rv1 / 64) % 64), 128 + (rv1 % 64)) - end - return utf8 + + -- upper limit used to be 2097152, new limit acquired using pcall and a for loop + -- above this limit, the function causes a lua error + if rv1 < 1 or rv1 > 1114112 then return "" end + + return utf8_char(rv1) end) registerFunction("toUnicodeByte", "s", "n", function(self, args) local op1 = args[2] local rv1 = op1[1](self, op1) if rv1 == "" then return -1 end - local byte = string_byte(rv1) - if byte >= 128 then - if byte >= 240 then - -- 4 byte sequence - if string_len (rv1) < 4 then - return -1 - end - byte = (byte % 8) * 262144 - byte = byte + (string_byte (rv1, 2) % 64) * 4096 - byte = byte + (string_byte (rv1, 3) % 64) * 64 - byte = byte + (string_byte (rv1, 4) % 64) - elseif byte >= 224 then - -- 3 byte sequence - if string_len (rv1) < 3 then - return -1 - end - byte = (byte % 16) * 4096 - byte = byte + (string_byte (rv1, 2) % 64) * 64 - byte = byte + (string_byte (rv1, 3) % 64) - elseif byte >= 192 then - -- 2 byte sequence - if string_len (rv1) < 2 then - return -1 - end - byte = (byte % 32) * 64 - byte = byte + (string_byte (rv1, 2) % 64) - else - -- invalid sequence - byte = -1 - end - end - return byte + + return utf8_byte(rv1) end) /******************************************************************************/ diff --git a/lua/entities/gmod_wire_expression2/core/table.lua b/lua/entities/gmod_wire_expression2/core/table.lua index b5817b207d..c071ff4c78 100644 --- a/lua/entities/gmod_wire_expression2/core/table.lua +++ b/lua/entities/gmod_wire_expression2/core/table.lua @@ -179,74 +179,75 @@ local tostring_typeid = { xv4 = tostrings.Vector4, } -local function normal_table_tostring( tbl, indenting, abortafter ) - local ret = "" - local cost = 0 +local function checkAbort( ret, cost, abortafter ) + if abortafter and cost > abortafter then + if ret[#ret] ~= "\n- Aborted to prevent lag -" then + ret[#ret+1] = "\n- Aborted to prevent lag -" + end + return true + end + + return false +end + +local function normal_table_tostring( tbl, indenting, abortafter, cost ) + local ret = {} + local cost = cost or 0 for k,v in pairs( tbl ) do if tostrings[type(v)] then - ret = ret .. rep("\t",indenting) .. k .. "\t=\t" .. tostrings[type(v)]( v ) .. "\n" + ret[#ret+1] = rep("\t",indenting) .. k .. "\t=\t" .. tostrings[type(v)]( v ) .. "\n" cost = cost + 1 else - ret = ret .. rep("\t",indenting) .. k .. "\t=\t" .. tostring(v) .. "\n" + ret[#ret+1] = rep("\t",indenting) .. k .. "\t=\t" .. tostring(v) .. "\n" cost = cost + 1 end - if (abortafter and cost > abortafter) then - ret = ret .. "\n- Aborted to prevent lag -" - return ret, cost - end + + if checkAbort( ret, cost, abortafter ) then return table.concat(ret), cost end end - return ret, cost + return table.concat(ret), cost end local table_tostring -local function var_tostring( k, v, typeid, indenting, printed, abortafter ) +local function var_tostring( k, v, typeid, indenting, printed, abortafter, cost ) local ret = "" - local cost = 0 + local cost = (cost or 0) + 1 if (typeid == "t" and not printed[v]) then -- If it's a table printed[v] = true ret = rep("\t",indenting) .. k .. ":\n" - local ret2, cost2 = table_tostring( v, indenting + 2, printed, abortafter ) + local ret2, cost2 = table_tostring( v, indenting + 2, printed, abortafter, cost ) ret = ret .. ret2 - cost = cost2 + 1 + cost = cost + cost2 elseif typeid == "r" and not printed[v] then -- if it's an array printed[v] = true ret = rep("\t",indenting) .. k .. ":\n" - local ret2, cost2 = normal_table_tostring( v, indenting + 2, abortafter ) + local ret2, cost2 = normal_table_tostring( v, indenting + 2, abortafter, cost ) ret = ret .. ret2 - cost = cost2 + 1 + cost = cost2 elseif tostring_typeid[typeid] then -- if it's a type defined in this table ret = rep("\t",indenting) .. k .. "\t=\t" .. tostring_typeid[typeid]( v ) .. "\n" - cost = 1 else -- if it's anything else ret = rep("\t",indenting) .. k .. "\t=\t" .. tostring(v) .. "\n" - cost = 1 end return ret, cost end -table_tostring = function( tbl, indenting, printed, abortafter ) - local ret = "" - local cost = 0 +table_tostring = function( tbl, indenting, printed, abortafter, cost ) + local ret = {} + local cost = cost or 0 for k,v in pairs( tbl.n ) do - local ret2, cost2 = var_tostring( k, v, tbl.ntypes[k], indenting, printed, abortafter ) - ret = ret .. ret2 - cost = cost + cost2 - if abortafter and cost > abortafter then - ret = ret .. "\n- Aborted to prevent lag -" - return ret, cost - end + if checkAbort( ret, cost, abortafter ) then return table.concat(ret), cost end + local ret2, cost2 = var_tostring( k, v, tbl.ntypes[k], indenting, printed, abortafter, cost ) + ret[#ret+1] = ret2 + cost = cost2 end for k,v in pairs( tbl.s ) do - local ret2, cost2 = var_tostring( k, v, tbl.stypes[k], indenting, printed, abortafter ) - ret = ret .. ret2 - cost = cost + cost2 - if (abortafter and cost > abortafter) then - ret = ret .. "\n- Aborted to prevent lag -" - return ret, cost - end + if checkAbort( ret, cost, abortafter ) then return table.concat(ret), cost end + local ret2, cost2 = var_tostring( k, v, tbl.stypes[k], indenting, printed, abortafter, cost ) + ret[#ret+1] = ret2 + cost = cost2 end - return ret, cost + return table.concat(ret), cost end -------------------------------------------------------------------------------- @@ -430,6 +431,11 @@ e2function void printTable( table tbl ) local ret, cost = table_tostring( tbl, 0, printed, 200 ) self.prf = self.prf + cost for str in string.gmatch( ret, "[^\n]+" ) do + if #str > 250 then + self.prf = self.prf + 100 + self.player:ChatPrint("PrintTable attempted to print too much. PrintTable was cancelled to prevent lag") + return + end self.player:ChatPrint( str ) end end @@ -589,7 +595,7 @@ __e2setcost(5) -- Formats the table as a human readable string e2function string table:toString() local printed = { [this] = true } - local ret, cost = table_tostring( this, 0, printed ) + local ret, cost = table_tostring( this, 0, printed, 400 ) self.prf = self.prf + cost * opcost return ret end @@ -858,12 +864,12 @@ local clamp = math.Clamp local function concat( tab, delimeter, startindex, endindex ) local ret = {} local len = #tab - + startindex = startindex or 1 if startindex > len then return "" end - + endindex = clamp(endindex or len, startindex, len) - + for i=startindex, endindex do ret[#ret+1] = tostring(tab[i]) end diff --git a/lua/entities/gmod_wire_expression2/init.lua b/lua/entities/gmod_wire_expression2/init.lua index 5e8d57a47c..8bce32a1fd 100644 --- a/lua/entities/gmod_wire_expression2/init.lua +++ b/lua/entities/gmod_wire_expression2/init.lua @@ -10,22 +10,33 @@ function gmsave.ShouldSaveEntity( ent, ... ) return old( ent, ... ) end -local wire_expression2_unlimited = GetConVar("wire_expression2_unlimited") -local wire_expression2_quotasoft = GetConVar("wire_expression2_quotasoft") -local wire_expression2_quotahard = GetConVar("wire_expression2_quotahard") -local wire_expression2_quotatick = GetConVar("wire_expression2_quotatick") - -timer.Create("e2quota", 1, 0, function() - if wire_expression2_unlimited:GetBool() then - e2_softquota = 1000000 - e2_hardquota = 1000000 - e2_tickquota = 100000 - else - e2_softquota = wire_expression2_quotasoft:GetInt() - e2_hardquota = wire_expression2_quotahard:GetInt() - e2_tickquota = wire_expression2_quotatick:GetInt() +e2_softquota = nil +e2_hardquota = nil +e2_tickquota = nil + +do + local wire_expression2_unlimited = GetConVar("wire_expression2_unlimited") + local wire_expression2_quotasoft = GetConVar("wire_expression2_quotasoft") + local wire_expression2_quotahard = GetConVar("wire_expression2_quotahard") + local wire_expression2_quotatick = GetConVar("wire_expression2_quotatick") + + local function updateQuotas() + if wire_expression2_unlimited:GetBool() then + e2_softquota = 1000000 + e2_hardquota = 1000000 + e2_tickquota = 100000 + else + e2_softquota = wire_expression2_quotasoft:GetInt() + e2_hardquota = wire_expression2_quotahard:GetInt() + e2_tickquota = wire_expression2_quotatick:GetInt() + end end -end) + cvars.AddChangeCallback("wire_expression2_unlimited", updateQuotas) + cvars.AddChangeCallback("wire_expression2_quotasoft", updateQuotas) + cvars.AddChangeCallback("wire_expression2_quotahard", updateQuotas) + cvars.AddChangeCallback("wire_expression2_quotatick", updateQuotas) + updateQuotas() +end local function copytype(var) return istable(var) and table.Copy(var) or var @@ -259,6 +270,10 @@ function ENT:CompileCode(buffer, files, filepath) self:ResetContext() end +function ENT:GetGateName() + return self.name +end + function ENT:GetCode() return self.original, self.inc_files end @@ -438,7 +453,7 @@ function ENT:Reset() self.context.resetting = true -- reset the chip in the next tick - timer.Simple(0, function() self.Setup(self, self.original, self.inc_files) end) + timer.Simple(0, function() if IsValid(self) then self:Setup(self.original, self.inc_files) end end) end function ENT:TriggerInput(key, value) @@ -541,6 +556,7 @@ end) function MakeWireExpression2(player, Pos, Ang, model, buffer, name, inputs, outputs, vars, inc_files, filepath) if not player then player = game.GetWorld() end -- For Garry's Map Saver if IsValid(player) and not player:CheckLimit("wire_expressions") then return false end + if not WireLib.CanModel(player, model) then return false end local self = ents.Create("gmod_wire_expression2") if not self:IsValid() then return false end diff --git a/lua/entities/gmod_wire_forcer.lua b/lua/entities/gmod_wire_forcer.lua index 51e14b1226..cbcc6f72be 100644 --- a/lua/entities/gmod_wire_forcer.lua +++ b/lua/entities/gmod_wire_forcer.lua @@ -68,7 +68,7 @@ function ENT:Think() } if not IsValid(trace.Entity) then return end - if not gamemode.Call( "GravGunPunt", self:GetPlayer(), trace.Entity ) then return end + if IsValid(self:GetPlayer()) and not gamemode.Call( "GravGunPunt", self:GetPlayer(), trace.Entity ) then return end if trace.Entity:GetMoveType() == MOVETYPE_VPHYSICS then local phys = trace.Entity:GetPhysicsObject() diff --git a/lua/entities/gmod_wire_friendslist.lua b/lua/entities/gmod_wire_friendslist.lua new file mode 100644 index 0000000000..62ccd82f40 --- /dev/null +++ b/lua/entities/gmod_wire_friendslist.lua @@ -0,0 +1,144 @@ +AddCSLuaFile() +DEFINE_BASECLASS( "base_wire_entity" ) +ENT.PrintName = "Wire Friends List" +ENT.WireDebugName = "Friends List" + +if CLIENT then return end -- No more client + +function ENT:Initialize() + self.BaseClass.Initialize( self ) + + WireLib.CreateInputs( self, {"CheckEntity [ENTITY]", "CheckSteamID [STRING]", "CheckEntityID"} ) + WireLib.CreateOutputs( self, {"Checked", "Friends [ARRAY]", "AmountConnected", "AmountTotal"} ) + + self.friends = {} + self.friends_lookup = {} + self.steamids = {} + self.steamids_lookup = {} + self.save_on_entity = false + self:UpdateOutputs() +end + +function ENT:Setup( save_on_entity, friends_steamids ) + self.save_on_entity = false + self:UpdateFriendslist( friends_steamids ) + self.save_on_entity = save_on_entity or false + self:UpdateOutputs() +end + +function ENT:UpdateFriendslist( friends_steamids ) + if self.save_on_entity then return end + + self.friends = {} + self.friends_lookup = {} + + self.steamids = table.Copy(friends_steamids) + self.steamids_lookup = {} + for i=1,#friends_steamids do + self.steamids_lookup[friends_steamids[i]] = true + end + + local plys = player.GetHumans() + for i=1,#plys do + self:Connected( plys[i] ) + end + + self:UpdateOutputs() +end + +function ENT:Connected( ply ) + local steamid = ply:SteamID() + + -- already added + if self.friends_lookup[ply] then return end + + if self.steamids_lookup[ply:SteamID()] then + self.friends[#self.friends+1] = ply + self.friends_lookup[ply] = #self.friends + self:UpdateOutputs() + end +end + +function ENT:Disconnected( ply ) + local steamid = ply:SteamID() + + -- not already added + if not self.friends_lookup[ply] then return end + + if self.steamids_lookup[ply:SteamID()] then + local idx = self.friends_lookup[ply] + + table.remove( self.friends, idx ) + self.friends_lookup[ply] = nil + self:UpdateOutputs() + end +end + +hook.Add( "PlayerInitialSpawn", "wire_friendslist_connect", function( ply ) + local friendslists = ents.FindByClass( "gmod_wire_friendslist" ) + for i=1,#friendslists do friendslists[i]:Connected( ply ) end +end) +hook.Add( "PlayerDisconnected", "wire_friendslist_disconnect", function( ply ) + local friendslists = ents.FindByClass( "gmod_wire_friendslist" ) + for i=1,#friendslists do friendslists[i]:Disconnected( ply ) end +end) + +function ENT:TriggerInput( name, value ) + local ply + + if name == "CheckEntity" then + ply = value + elseif name == "CheckSteamID" then + ply = player.GetBySteamID( value ) + elseif name == "CheckEntityID" then + ply = Entity(value) + end + + if not IsValid( ply ) then return end + + if self.friends_lookup[ply] then + WireLib.TriggerOutput( self, "Checked", 1 ) + else + WireLib.TriggerOutput( self, "Checked", -1 ) + end + + timer.Remove( "wire_friendslist_" .. self:EntIndex() ) + timer.Create( "wire_friendslist_" .. self:EntIndex(), 0.1, 1, function() + if IsValid( self ) then + WireLib.TriggerOutput( self, "Checked", 0 ) + end + end) +end + +function ENT:UpdateOutputs() + local str = {} + + str[#str+1] = "Saved on entity: " .. (self.save_on_entity and "Yes" or "No") .. "\n" + str[#str+1] = #self.friends .. " connected friends" + str[#str+1] = "\nConnected:" + + local not_connected = {} + + for i=1, #self.steamids do + local steamid = self.steamids[i] + local ply = player.GetBySteamID( steamid ) + + if IsValid( ply ) then + str[#str+1] = ply:Nick() .. " (" .. steamid .. ")" + else + not_connected[#not_connected+1] = steamid + end + end + + table.insert( str, 2, #self.steamids .. " total friends" ) + + WireLib.TriggerOutput( self, "Friends", self.friends ) + WireLib.TriggerOutput( self, "AmountConnected", #self.friends ) + WireLib.TriggerOutput( self, "AmountTotal", #self.steamids ) + + local str = table.concat( str, "\n" ) + if #not_connected > 0 then str = str .. "\n\nNot connected:\n" .. table.concat( not_connected, "\n" ) end + self:SetOverlayText( str ) +end + +duplicator.RegisterEntityClass("gmod_wire_friendslist", WireLib.MakeWireEnt, "Data", "save_on_entity", "steamids") diff --git a/lua/entities/gmod_wire_gate.lua b/lua/entities/gmod_wire_gate.lua index 01d7766e95..0d5ae809b8 100644 --- a/lua/entities/gmod_wire_gate.lua +++ b/lua/entities/gmod_wire_gate.lua @@ -5,6 +5,8 @@ ENT.WireDebugName = "Gate" if CLIENT then return end -- No more client +local Wire_EnableGateInputValues = CreateConVar("Wire_EnableGateInputValues", 1, FCVAR_ARCHIVE) + function ENT:Initialize() self:PhysicsInit( SOLID_VPHYSICS ) self:SetMoveType( MOVETYPE_VPHYSICS ) @@ -122,7 +124,7 @@ function ENT:ShowOutput() if (self.Action) then txt = (self.Action.name or "No Name") if (self.Action.label) then - txt = txt.."\n"..self.Action.label(self:GetActionOutputs(), unpack(self:GetActionInputs(Wire_EnableGateInputValues))) + txt = txt.."\n"..self.Action.label(self:GetActionOutputs(), unpack(self:GetActionInputs(Wire_EnableGateInputValues:GetBool()))) end else txt = "Invalid gate!" diff --git a/lua/entities/gmod_wire_gpulib_controller.lua b/lua/entities/gmod_wire_gpulib_controller.lua index 9c988b1746..e56d12b809 100644 --- a/lua/entities/gmod_wire_gpulib_controller.lua +++ b/lua/entities/gmod_wire_gpulib_controller.lua @@ -55,6 +55,8 @@ function ENT:TriggerInput(iname, value) end function MakeGPULibController( pl, Pos, Ang, model, screen ) + model = model or "models/jaanus/wiretool/wiretool_siren.mdl" + if not WireLib.CanModel(pl, model) then return false end --if ( !pl:CheckLimit( "wire_cams" ) ) then return false end local controller = ents.Create( "gmod_wire_gpulib_controller" ) @@ -62,7 +64,7 @@ function MakeGPULibController( pl, Pos, Ang, model, screen ) controller:SetAngles( Ang ) controller:SetPos( Pos ) - controller:SetModel( Model(model or "models/jaanus/wiretool/wiretool_siren.mdl") ) + controller:SetModel(model) controller:Spawn() controller:Setup(screen) diff --git a/lua/entities/gmod_wire_hologram.lua b/lua/entities/gmod_wire_hologram.lua index 7ed6ab54ac..dc1147d3d6 100644 --- a/lua/entities/gmod_wire_hologram.lua +++ b/lua/entities/gmod_wire_hologram.lua @@ -8,7 +8,7 @@ function ENT:SetPlayer(ply) self:SetVar("Founder", ply) self:SetVar("FounderIndex", ply:UniqueID()) - self:SetNetworkedString("FounderName", ply:Nick()) + self:SetNWString("FounderName", ply:Nick()) end function ENT:GetPlayer() @@ -26,7 +26,7 @@ if CLIENT then function ENT:Initialize() self.bone_scale = {} self:DoScale() - local ownerid = self:GetNetworkedInt("ownerid") + local ownerid = self:GetNWInt("ownerid") self.blocked = blocked[ownerid] or false self.clips = {} @@ -318,7 +318,7 @@ if CLIENT then local id = toblock:UserID() blocked[id] = true for _, ent in ipairs(ents.FindByClass("gmod_wire_hologram")) do - if ent:GetNetworkedInt("ownerid") == id then + if ent:GetNWInt("ownerid") == id then ent.blocked = true end end @@ -346,7 +346,7 @@ if CLIENT then local id = toblock:UserID() blocked[id] = nil for _, ent in ipairs(ents.FindByClass("gmod_wire_hologram")) do - if ent:GetNetworkedInt("ownerid") == id then + if ent:GetNWInt("ownerid") == id then ent.blocked = false end end diff --git a/lua/entities/gmod_wire_hologrid.lua b/lua/entities/gmod_wire_hologrid.lua index 4303e96515..29f0f5b594 100644 --- a/lua/entities/gmod_wire_hologrid.lua +++ b/lua/entities/gmod_wire_hologrid.lua @@ -22,11 +22,11 @@ end function ENT:Setup(UseGPS) if UseGPS then self.usesgps = true - self:SetNetworkedEntity( "reference", ents.GetByIndex(-1) ) + self:SetNWEntity( "reference", ents.GetByIndex(-1) ) self:SetOverlayText( "(GPS)" ) else self.usesgps = false - self:SetNetworkedEntity( "reference", self.reference ) + self:SetNWEntity( "reference", self.reference ) self:SetOverlayText( "(Local)" ) end end diff --git a/lua/entities/gmod_wire_hudindicator/cl_init.lua b/lua/entities/gmod_wire_hudindicator/cl_init.lua index 6c05b97358..74089c22e1 100644 --- a/lua/entities/gmod_wire_hudindicator/cl_init.lua +++ b/lua/entities/gmod_wire_hudindicator/cl_init.lua @@ -21,7 +21,7 @@ local semicircletexid = surface.GetTextureID("hudindicator/hi_semicircle") function ENT:ClientCheckRegister() local ply = LocalPlayer() local plyuid = ply:UniqueID() - return (ply != self:GetPlayer() && !self:GetNetworkedBool(plyuid)) + return (ply != self:GetPlayer() && !self:GetNWBool(plyuid)) end // Used by STool for unregister control panel diff --git a/lua/entities/gmod_wire_hudindicator/init.lua b/lua/entities/gmod_wire_hudindicator/init.lua index afe51f4072..a45952896f 100644 --- a/lua/entities/gmod_wire_hudindicator/init.lua +++ b/lua/entities/gmod_wire_hudindicator/init.lua @@ -92,11 +92,11 @@ function ENT:HUDSetup(showinhud, huddesc, hudaddname, hudshowvalue, hudstyle, al // Add name if desired if (hudaddname) then - self:SetNetworkedString("WireName", huddesc) - elseif (self:GetNetworkedString("WireName") == huddesc) then + self:SetNWString("WireName", huddesc) + elseif (self:GetNWString("WireName") == huddesc) then // Only remove it if the HUD Description was there // because there might be another name on it - self:SetNetworkedString("WireName", "") + self:SetNWString("WireName", "") end // Adjust inputs accordingly @@ -171,7 +171,7 @@ function ENT:RegisterPlayer(ply, hookhidehud, podonly) if (!self.RegisteredPlayers[plyuid]) then self.RegisteredPlayers[plyuid] = { ply = ply, hookhidehud = hookhidehud, podonly = podonly } // This is used to check for pod-only status in ClientCheckRegister() - self:SetNetworkedBool( plyuid, util.tobool(podonly) ) + self:SetNWBool( plyuid, util.tobool(podonly) ) end umsg.Start("HUDIndicatorRegister", ply) diff --git a/lua/entities/gmod_wire_indicator.lua b/lua/entities/gmod_wire_indicator.lua index 5e202139f6..017019a7a4 100644 --- a/lua/entities/gmod_wire_indicator.lua +++ b/lua/entities/gmod_wire_indicator.lua @@ -75,7 +75,7 @@ function MakeWire7Seg( pl, Pos, Ang, Model, a, ar, ag, ab, aa, b, br, bg, bb, ba Model = Model, frozen = frozen, nocollide = nocollide }, a, ar, ag, ab, aa, b, br, bg, bb, ba ) if IsValid(ent) then - ent:SetNetworkedString("WireName", name) + ent:SetNWString("WireName", name) duplicator.StoreEntityModifier( ent, "WireName", { name = name } ) end return ent diff --git a/lua/entities/gmod_wire_keyboard/init.lua b/lua/entities/gmod_wire_keyboard/init.lua index b5ac6bdcd1..70b854e758 100644 --- a/lua/entities/gmod_wire_keyboard/init.lua +++ b/lua/entities/gmod_wire_keyboard/init.lua @@ -26,16 +26,16 @@ function ENT:Initialize() self:SetSolid(SOLID_VPHYSICS) self:SetUseType(SIMPLE_USE) - self.Inputs = WireLib.CreateInputs(self, { "Kick" }) - self.Outputs = WireLib.CreateOutputs(self, { "Memory", "User [ENTITY]", "InUse" }) + self.Inputs = WireLib.CreateInputs(self, { "Kick", "Reset Output String" }) + self.Outputs = WireLib.CreateOutputs(self, { "Memory", "Output [STRING]", "ActiveKeys [ARRAY]", "User [ENTITY]", "InUse" }) self.ActiveKeys = {} -- table containing all currently active keys, used to see when keys are pressed/released self.Buffer = {} -- array containing all currently active keys, value is ascii self.BufferLookup = {} -- lookup table mapping enums to buffer positions self.Buffer[0] = 0 + self.OutputString = "" - self:SetOverlayText("Not in use") - WireLib.TriggerOutput(self, "InUse", 0) + self:TriggerOutputs() end WireLib.AddInputAlias("Kick the bastard out of keyboard", "Kick") @@ -49,9 +49,41 @@ function ENT:TriggerInput(name, value) self:PlayerDetach() end end) + elseif name == "Reset Output String" then + self.OutputString = "" + self:TriggerOutputs() end end +function ENT:TriggerOutputs(key) + -- Output key numerical representation + if key ~= nil then + WireLib.TriggerOutput(self, "Memory", key) + end + + -- Output user + if IsValid( self.ply ) then + WireLib.TriggerOutput(self, "User", self.ply) + WireLib.TriggerOutput(self, "InUse", 1) + self:SetOverlayText("In use by " .. self.ply:Nick()) + else + WireLib.TriggerOutput(self, "User", nil) + WireLib.TriggerOutput(self, "InUse", 0) + self:SetOverlayText("Not in use") + end + + -- Output currently pressed keys + local ActiveKeys_Output, idx = {}, 0 + for key_enum,_ in pairs( self.ActiveKeys ) do + idx = idx + 1 + ActiveKeys_Output[idx] = self:GetRemappedKey(key_enum) + end + WireLib.TriggerOutput(self, "ActiveKeys", ActiveKeys_Output) + + -- Output buffer string + WireLib.TriggerOutput(self, "Output", self.OutputString) +end + function ENT:ReadCell(Address) if Address >= 0 and Address < 32 then return self.Buffer[Address] or 0 @@ -87,9 +119,6 @@ function ENT:PlayerAttach(ply) -- Store player self.ply = ply - WireLib.TriggerOutput(self, "User", ply) - WireLib.TriggerOutput(self, "InUse", 1) - self:SetOverlayText("In use by " .. ply:Nick()) -- Block keyboard input if self.Synchronous then @@ -114,14 +143,11 @@ function ENT:PlayerAttach(ply) self.ActiveKeys = {} self.Buffer = {} self.Buffer[0] = 0 + + self:TriggerOutputs() end function ENT:PlayerDetach() - WireLib.TriggerOutput(self, "User", nil) - WireLib.TriggerOutput(self, "InUse", 0) - - self:SetOverlayText("Not in use") - local ply = self.ply self.ply = nil @@ -141,6 +167,8 @@ function ENT:PlayerDetach() ply.WireKeyboard = nil end + + self:TriggerOutputs() end function ENT:Use(ply) @@ -187,6 +215,45 @@ hook.Add("PlayerLeaveVehicle", "wire_keyboard_PlayerLeaveVehicle", function(ply, end end) +local unprintable_chars = {} +for i=17,20 do unprintable_chars[i] = true end -- arrow keys +for i=144,177 do unprintable_chars[i] = true end -- ctrl, alt, shift, break, F1-F12, scroll/num/caps lock, and more + +local convertable_chars = { + [128] = 49, -- numpad 1 + [129] = 50, -- numpad 2 + [130] = 51, -- numpad 3 + [131] = 52, -- numpad 4 + [132] = 53, -- numpad 5 + [133] = 54, -- numpad 6 + [134] = 55, -- numpad 7 + [135] = 56, -- numpad 8 + [136] = 57, -- numpad 9 + [137] = 58, -- numpad 4 + [138] = 47, -- / + [139] = 42, -- * + [140] = 45, -- - + [141] = 43, -- + + [142] = 10, -- \n + [143] = 46, -- . +} + +function ENT:AppendOutputString(key) + if unprintable_chars[key] and not convertable_chars[key] then return end + if convertable_chars[key] then key = convertable_chars[key] end + + if key == 127 then + local pos = string.match(self.OutputString,"()"..utf8.charpattern.."$") + if pos then + self.OutputString = string.sub(self.OutputString,1,pos-1) + end + else + self.OutputString = self.OutputString .. utf8.char(key) + end + + self:TriggerOutputs() +end + --local Wire_Keyboard_Remap = Wire_Keyboard_Remap -- Defined in remap.lua function ENT:GetRemappedKey(key_enum) if not key_enum or key_enum == 0 or key_enum > KEY_LAST then return 0 end -- Above KEY_LAST are joystick and mouse enums @@ -205,7 +272,7 @@ function ENT:GetRemappedKey(key_enum) end end - if isstring(ret) then ret = string.byte(ret) end + if isstring(ret) then ret = utf8.codepoint(ret) end return ret end @@ -217,8 +284,9 @@ function ENT:KeyPressed(key_enum) self.ActiveKeys[key_enum] = true self:PushBuffer(key, key_enum) + self:AppendOutputString(key) - WireLib.TriggerOutput(self, "Memory", key) + self:TriggerOutputs(key) end function ENT:KeyReleased(key_enum) @@ -231,7 +299,7 @@ function ENT:KeyReleased(key_enum) self:RemoveFromBufferByKey(key) end - WireLib.TriggerOutput(self, "Memory", 0) + self:TriggerOutputs(0) end function ENT:IsPressedEnum(key_enum) diff --git a/lua/entities/gmod_wire_keyboard/remap.lua b/lua/entities/gmod_wire_keyboard/remap.lua index e725e88ef6..1c87b8cde3 100644 --- a/lua/entities/gmod_wire_keyboard/remap.lua +++ b/lua/entities/gmod_wire_keyboard/remap.lua @@ -62,7 +62,7 @@ remap[KEY_PAD_MINUS] = 140 remap[KEY_PAD_PLUS] = 141 remap[KEY_PAD_ENTER] = 142 remap[KEY_PAD_DECIMAL] = 143 -remap[KEY_ENTER] = 13 +remap[KEY_ENTER] = 10 remap[KEY_SPACE] = " " remap[KEY_BACKSPACE] = 127 remap[KEY_TAB] = 9 @@ -105,28 +105,31 @@ remap[KEY_F12] = 174 remap[KEY_CAPSLOCKTOGGLE] = 175 remap[KEY_NUMLOCKTOGGLE] = 176 remap[KEY_SCROLLLOCKTOGGLE] = 177 -remap[KEY_XBUTTON_UP] = 200 -remap[KEY_XBUTTON_DOWN] = 201 -remap[KEY_XBUTTON_LEFT] = 202 -remap[KEY_XBUTTON_RIGHT] = 203 -remap[KEY_XBUTTON_START] = 204 -remap[KEY_XBUTTON_BACK] = 205 -remap[KEY_XBUTTON_STICK1] = 206 -remap[KEY_XBUTTON_STICK2] = 207 -remap[KEY_XBUTTON_A] = 208 -remap[KEY_XBUTTON_B] = 209 -remap[KEY_XBUTTON_X] = 210 -remap[KEY_XBUTTON_Y] = 211 -remap[KEY_XBUTTON_LTRIGGER] = 214 -remap[KEY_XBUTTON_RTRIGGER] = 215 -remap[KEY_XSTICK1_UP] = 216 -remap[KEY_XSTICK1_DOWN] = 217 -remap[KEY_XSTICK1_LEFT] = 218 -remap[KEY_XSTICK1_RIGHT] = 219 -remap[KEY_XSTICK2_UP] = 220 -remap[KEY_XSTICK2_DOWN] = 221 -remap[KEY_XSTICK2_LEFT] = 222 -remap[KEY_XSTICK2_RIGHT] = 223 +--[[ + -- These are unused + remap[KEY_XBUTTON_UP] = 200 + remap[KEY_XBUTTON_DOWN] = 201 + remap[KEY_XBUTTON_LEFT] = 202 + remap[KEY_XBUTTON_RIGHT] = 203 + remap[KEY_XBUTTON_START] = 204 + remap[KEY_XBUTTON_BACK] = 205 + remap[KEY_XBUTTON_STICK1] = 206 + remap[KEY_XBUTTON_STICK2] = 207 + remap[KEY_XBUTTON_A] = 208 + remap[KEY_XBUTTON_B] = 209 + remap[KEY_XBUTTON_X] = 210 + remap[KEY_XBUTTON_Y] = 211 + remap[KEY_XBUTTON_LTRIGGER] = 214 + remap[KEY_XBUTTON_RTRIGGER] = 215 + remap[KEY_XSTICK1_UP] = 216 + remap[KEY_XSTICK1_DOWN] = 217 + remap[KEY_XSTICK1_LEFT] = 218 + remap[KEY_XSTICK1_RIGHT] = 219 + remap[KEY_XSTICK2_UP] = 220 + remap[KEY_XSTICK2_DOWN] = 221 + remap[KEY_XSTICK2_LEFT] = 222 + remap[KEY_XSTICK2_RIGHT] = 223 +]] local remap = Wire_Keyboard_Remap_default[KEY_LSHIFT] remap[KEY_A] = "A" @@ -205,7 +208,7 @@ remap[KEY_EQUAL] = "+" Wire_Keyboard_Remap.British = {} Wire_Keyboard_Remap.British = table.Copy(Wire_Keyboard_Remap.American) -Wire_Keyboard_Remap.British[83] = {} +Wire_Keyboard_Remap.British[KEY_LCONTROL] = {} Wire_Keyboard_Remap.British[KEY_RSHIFT] = Wire_Keyboard_Remap.British[KEY_LSHIFT] local remap = Wire_Keyboard_Remap.British.normal @@ -214,17 +217,17 @@ remap[KEY_APOSTROPHE] = "#" local remap = Wire_Keyboard_Remap.British[KEY_LSHIFT] remap[KEY_2] = '"' -remap[KEY_3] = "£" +remap[KEY_3] = "£" remap[KEY_APOSTROPHE] = "~" remap[KEY_BACKQUOTE] = "@" -local remap = Wire_Keyboard_Remap.British[83] -remap[KEY_4] = "€" -remap[KEY_A] = "á" -remap[KEY_E] = "é" -remap[KEY_I] = "í" -remap[KEY_O] = "ó" -remap[KEY_U] = "ú" +local remap = Wire_Keyboard_Remap.British[KEY_LCONTROL] +remap[KEY_4] = "€" +remap[KEY_A] = "á" +remap[KEY_E] = "é" +remap[KEY_I] = "í" +remap[KEY_O] = "ó" +remap[KEY_U] = "ú" ---------------------------------------------------------------------- -- Swedish @@ -232,19 +235,19 @@ remap[KEY_U] = " Wire_Keyboard_Remap.Swedish = {} Wire_Keyboard_Remap.Swedish = table.Copy(Wire_Keyboard_Remap_default) -Wire_Keyboard_Remap.Swedish[83] = {} -- KEY_RALT = 82, but didn't work correctly +Wire_Keyboard_Remap.Swedish[KEY_LCONTROL] = {} -- Should be KEY_RALT, but that didn't work correctly Wire_Keyboard_Remap.Swedish[KEY_RSHIFT] = Wire_Keyboard_Remap.Swedish[KEY_LSHIFT] local remap = Wire_Keyboard_Remap.Swedish.normal -remap[KEY_LBRACKET] = "´" -remap[KEY_RBRACKET] = "å" -remap[KEY_SEMICOLON] = "¨" -remap[KEY_APOSTROPHE] = "ä" -remap[KEY_BACKQUOTE] = "ö" +remap[KEY_LBRACKET] = "´" +remap[KEY_RBRACKET] = "Ã¥" +remap[KEY_BACKQUOTE] = "¨" +remap[KEY_APOSTROPHE] = "ä" +remap[KEY_SEMICOLON] = "ö" remap[KEY_COMMA] = "," remap[KEY_PERIOD] = "." remap[KEY_SLASH] = "'" -remap[KEY_BACKSLASH] = "§" +remap[KEY_BACKSLASH] = "§" remap[KEY_MINUS] = "-" remap[KEY_EQUAL] = "+" @@ -253,27 +256,27 @@ remap[KEY_0] = "=" remap[KEY_1] = "!" remap[KEY_2] = '"' remap[KEY_3] = "#" -remap[KEY_4] = "¤" +remap[KEY_4] = "¤" remap[KEY_5] = "%" remap[KEY_6] = "&" remap[KEY_7] = "/" remap[KEY_8] = "(" remap[KEY_9] = ")" remap[KEY_LBRACKET] = "`" -remap[KEY_RBRACKET] = "Å" -remap[KEY_BACKQUOTE] = "Ö" -remap[KEY_SEMICOLON] = "^" -remap[KEY_APOSTROPHE] = "Ä" +remap[KEY_RBRACKET] = "Ã…" +remap[KEY_SEMICOLON] = 214 --"Ö" +remap[KEY_BACKQUOTE] = "^" -- doesn't work because garry +remap[KEY_APOSTROPHE] = "Ä" remap[KEY_COMMA] = ";" remap[KEY_PERIOD] = ":" remap[KEY_SLASH] = "*" -remap[KEY_BACKSLASH] = "½" +remap[KEY_BACKSLASH] = "½" remap[KEY_MINUS] = "_" remap[KEY_EQUAL] = "?" -local remap = Wire_Keyboard_Remap.Swedish[83] +local remap = Wire_Keyboard_Remap.Swedish[KEY_LCONTROL] remap[KEY_2] = "@" -remap[KEY_3] = "£" +remap[KEY_3] = "£" remap[KEY_4] = "$" remap[KEY_7] = "{" remap[KEY_8] = "[" @@ -281,7 +284,7 @@ remap[KEY_9] = "]" remap[KEY_0] = "}" remap[KEY_EQUAL] = "\\" remap[KEY_SEMICOLON] = "~" -remap[KEY_E] = "€" +remap[KEY_E] = "€" ---------------------------------------------------------------------- -- Norwegian @@ -292,20 +295,20 @@ Wire_Keyboard_Remap.Norwegian = table.Copy(Wire_Keyboard_Remap.Swedish) Wire_Keyboard_Remap.Norwegian[KEY_RSHIFT] = Wire_Keyboard_Remap.Norwegian[KEY_LSHIFT] local remap = Wire_Keyboard_Remap.Norwegian.normal -remap[KEY_BACKQUOTE] = "ø" -remap[KEY_APOSTROPHE] = "æ" +remap[KEY_BACKQUOTE] = "ø" +remap[KEY_APOSTROPHE] = "æ" remap[KEY_BACKSLASH] = "|" remap[KEY_LBRACKET] = "\\" local remap = Wire_Keyboard_Remap.Norwegian[KEY_LSHIFT] -remap[KEY_BACKQUOTE] = "Ø" -remap[KEY_APOSTROPHE] = "Æ" -remap[KEY_BACKSLASH] = "§" +remap[KEY_BACKQUOTE] = "Ø" +remap[KEY_APOSTROPHE] = "Æ" +remap[KEY_BACKSLASH] = "§" -local remap = Wire_Keyboard_Remap.Norwegian[83] +local remap = Wire_Keyboard_Remap.Norwegian[KEY_LCONTROL] remap[KEY_EQUAL] = nil -remap[KEY_M] = "µ" -remap[KEY_LBRACKET] = "´" +remap[KEY_M] = "µ" +remap[KEY_LBRACKET] = "´" ---------------------------------------------------------------------- -- German @@ -313,15 +316,15 @@ remap[KEY_LBRACKET] = " Wire_Keyboard_Remap.German = {} Wire_Keyboard_Remap.German = table.Copy(Wire_Keyboard_Remap_default) -Wire_Keyboard_Remap.German[83] = {} -- KEY_RALT = 82, but didn't work correctly +Wire_Keyboard_Remap.German[KEY_LCONTROL] = {} -- Should be KEY_RALT, but that didn't work correctly Wire_Keyboard_Remap.German[KEY_RSHIFT] = Wire_Keyboard_Remap.German[KEY_LSHIFT] local remap = Wire_Keyboard_Remap.German.normal -remap[KEY_LBRACKET] = "ß" -remap[KEY_RBRACKET] = "´" -remap[KEY_SEMICOLON] = "ü" -remap[KEY_APOSTROPHE] = "ä" -remap[KEY_BACKQUOTE] = "ö" +remap[KEY_LBRACKET] = "ß" +remap[KEY_RBRACKET] = "´" +remap[KEY_SEMICOLON] = "ü" +remap[KEY_APOSTROPHE] = "ä" +remap[KEY_BACKQUOTE] = "ö" remap[KEY_COMMA] = "," remap[KEY_PERIOD] = "." remap[KEY_SLASH] = "#" @@ -333,7 +336,7 @@ local remap = Wire_Keyboard_Remap.German[KEY_LSHIFT] remap[KEY_0] = "=" remap[KEY_1] = "!" remap[KEY_2] = '"' -remap[KEY_3] = "§" +remap[KEY_3] = "§" remap[KEY_4] = "$" remap[KEY_5] = "%" remap[KEY_6] = "&" @@ -342,25 +345,25 @@ remap[KEY_8] = "(" remap[KEY_9] = ")" remap[KEY_LBRACKET] = "?" remap[KEY_RBRACKET] = "`" -remap[KEY_SEMICOLON] = "Ü" -remap[KEY_APOSTROPHE] = 'Ä' -remap[KEY_BACKQUOTE] = "Ö" +remap[KEY_SEMICOLON] = "Ãœ" +remap[KEY_APOSTROPHE] = 'Ä' +remap[KEY_BACKQUOTE] = "Ö" remap[KEY_COMMA] = ";" remap[KEY_PERIOD] = ":" remap[KEY_SLASH] = "'" -remap[KEY_BACKSLASH] = "°" +remap[KEY_BACKSLASH] = "°" remap[KEY_MINUS] = "_" remap[KEY_EQUAL] = "*" -local remap = Wire_Keyboard_Remap.German[83] +local remap = Wire_Keyboard_Remap.German[KEY_LCONTROL] remap[KEY_0] = "}" -remap[KEY_2] = '²' -remap[KEY_3] = "³" +remap[KEY_2] = '²' +remap[KEY_3] = "³" remap[KEY_7] = "{" remap[KEY_8] = "[" remap[KEY_9] = "]" -remap[KEY_E] = "€" -remap[KEY_M] = "µ" +remap[KEY_E] = "€" +remap[KEY_M] = "µ" remap[KEY_Q] = "@" remap[KEY_LBRACKET] = '\\' remap[KEY_EQUAL] = "~" diff --git a/lua/entities/gmod_wire_keypad.lua b/lua/entities/gmod_wire_keypad.lua index 696f35c473..8d340ccde5 100644 --- a/lua/entities/gmod_wire_keypad.lua +++ b/lua/entities/gmod_wire_keypad.lua @@ -103,7 +103,7 @@ if CLIENT then draw.DrawText(text, "Trebuchet18", textx, texty, Color(0, 0, 0, 255)) end - local Display = self:GetNetworkedInt("keypad_display", "") + local Display = self:GetNWString("keypad_display", "") if Display == "y" then draw.DrawText("ACCESS", "Trebuchet24", X+17, Y+7, Color(0, 255, 0, 255)) draw.DrawText("GRANTED","Trebuchet24", X+7, Y+27, Color(0, 255, 0, 255)) @@ -185,17 +185,17 @@ net.Receive("wire_keypad", function(netlen, ply) local key = net.ReadUInt(4) if key == 10 then -- Reset - ent:SetNetworkedString("keypad_display", "") + ent:SetNWString("keypad_display", "") ent:EmitSound("buttons/button14.wav") ent.CurrentNum = 0 elseif key == 11 or ent.CurrentNum > 999 then -- Accept local access = (ent.Password == util.CRC(ent.CurrentNum)) if access then - ent:SetNetworkedString("keypad_display", "y") + ent:SetNWString("keypad_display", "y") Wire_TriggerOutput(ent, "Valid", 1) ent:EmitSound("buttons/button9.wav") else - ent:SetNetworkedString("keypad_display", "n") + ent:SetNWString("keypad_display", "n") Wire_TriggerOutput(ent, "Invalid", 1) ent:EmitSound("buttons/button8.wav") end @@ -203,7 +203,7 @@ net.Receive("wire_keypad", function(netlen, ply) ent.CurrentNum = -1 timer.Create("wire_keypad_"..ent:EntIndex().."_"..tostring(access), 2, 1, function() if IsValid(ent) then - ent:SetNetworkedString("keypad_display", "") + ent:SetNWString("keypad_display", "") ent.CurrentNum = 0 if access then Wire_TriggerOutput(ent, "Valid", 0) @@ -216,9 +216,9 @@ net.Receive("wire_keypad", function(netlen, ply) ent.CurrentNum = ent.CurrentNum * 10 + key if ent.Secure then - ent:SetNetworkedString("keypad_display", string.rep("*", string.len(ent.CurrentNum))) + ent:SetNWString("keypad_display", string.rep("*", string.len(ent.CurrentNum))) else - ent:SetNetworkedString("keypad_display", tostring(ent.CurrentNum)) + ent:SetNWString("keypad_display", tostring(ent.CurrentNum)) end ent:EmitSound("buttons/button15.wav") end diff --git a/lua/entities/gmod_wire_oscilloscope.lua b/lua/entities/gmod_wire_oscilloscope.lua index 365e2ad651..e1623a7561 100644 --- a/lua/entities/gmod_wire_oscilloscope.lua +++ b/lua/entities/gmod_wire_oscilloscope.lua @@ -4,20 +4,20 @@ ENT.PrintName = "Wire Oscilloscope" ENT.WireDebugName = "Oscilloscope" function ENT:SetNextNode(x, y) - local node_idx = self:GetNetworkedInt("OscN") or 0 - if (node_idx > self:GetNetworkedFloat("Length", 50)) then node_idx = node_idx-self:GetNetworkedFloat("Length", 50) end + local node_idx = self:GetNWInt("OscN") or 0 + if (node_idx > self:GetNWFloat("Length", 50)) then node_idx = node_idx-self:GetNWFloat("Length", 50) end - self:SetNetworkedFloat("OscX"..node_idx, x) - self:SetNetworkedFloat("OscY"..node_idx, y) - self:SetNetworkedInt("OscN", node_idx+1) + self:SetNWFloat("OscX"..node_idx, x) + self:SetNWFloat("OscY"..node_idx, y) + self:SetNWInt("OscN", node_idx+1) end function ENT:GetNodeList() local nodes = {} - local node_idx = self:GetNetworkedInt("OscN") - local length = self:GetNetworkedFloat("Length", 50) + local node_idx = self:GetNWInt("OscN") + local length = self:GetNWFloat("Length", 50) for i=1,length do - table.insert(nodes, { X = (self:GetNetworkedFloat("OscX"..node_idx, 0)), Y = (self:GetNetworkedFloat("OscY"..node_idx, 0)) }) + table.insert(nodes, { X = (self:GetNWFloat("OscX"..node_idx, 0)), Y = (self:GetNWFloat("OscY"..node_idx, 0)) }) node_idx = node_idx+1 if (node_idx > length) then node_idx = node_idx-length end @@ -38,8 +38,8 @@ if CLIENT then function ENT:Draw() self:DrawModel() - local length = self:GetNetworkedFloat("Length", 50) - local r,g,b = self:GetNetworkedFloat("R"), self:GetNetworkedFloat("G"), self:GetNetworkedFloat("B") + local length = self:GetNWFloat("Length", 50) + local r,g,b = self:GetNWFloat("R"), self:GetNWFloat("G"), self:GetNWFloat("B") if r == 0 and g == 0 and b == 0 then g = 200 end self.GPU:RenderToGPU(function() @@ -117,14 +117,14 @@ end function ENT:TriggerInput(iname, value) if iname == "R" then - self:SetNetworkedFloat("R", math.Clamp(value, 0, 255)) + self:SetNWFloat("R", math.Clamp(value, 0, 255)) elseif iname == "G" then - self:SetNetworkedFloat("G", math.Clamp(value, 0, 255)) + self:SetNWFloat("G", math.Clamp(value, 0, 255)) elseif iname == "B" then - self:SetNetworkedFloat("B", math.Clamp(value, 0, 255)) + self:SetNWFloat("B", math.Clamp(value, 0, 255)) elseif iname == "Length" then if value == 0 then value = 50 end - self:SetNetworkedFloat("Length", math.Clamp(value, 1, wire_oscilloscope_maxlength:GetInt())) + self:SetNWFloat("Length", math.Clamp(value, 1, wire_oscilloscope_maxlength:GetInt())) elseif iname == "Update Frequency" then if value <= 0 then value = 0.08 end self.updaterate = value @@ -162,7 +162,7 @@ function ENT:ReadCell( address ) elseif address == 4 then return self.updaterate elseif address_lookup[address] then - return self:GetNetworkedFloat( address_lookup[address] ) + return self:GetNWFloat( address_lookup[address] ) end return 0 diff --git a/lua/entities/gmod_wire_ranger.lua b/lua/entities/gmod_wire_ranger.lua index 91b52061df..bdeca71630 100644 --- a/lua/entities/gmod_wire_ranger.lua +++ b/lua/entities/gmod_wire_ranger.lua @@ -47,7 +47,7 @@ function ENT:Setup( range, default_zero, show_beam, ignore_world, trace_water, o if range then self:SetBeamLength(math.min(range, 50000)) end if show_beam ~= nil then self:SetShowBeam(show_beam) end - self:SetNetworkedBool("TraceWater", trace_water) + self:SetNWBool("TraceWater", trace_water) local onames, otypes = {}, {} diff --git a/lua/entities/gmod_wire_simple_explosive.lua b/lua/entities/gmod_wire_simple_explosive.lua index 0b28757b24..37744a5df5 100644 --- a/lua/entities/gmod_wire_simple_explosive.lua +++ b/lua/entities/gmod_wire_simple_explosive.lua @@ -5,6 +5,9 @@ ENT.WireDebugName = "Simple Explosive" if CLIENT then return end -- No more client +local wire_explosive_delay = CreateConVar( "wire_explosive_delay", 0.2, FCVAR_ARCHIVE ) +local wire_explosive_range = CreateConVar( "wire_explosive_range", 512, FCVAR_ARCHIVE ) + function ENT:Initialize() self:PhysicsInit( SOLID_VPHYSICS ) self:SetMoveType( MOVETYPE_VPHYSICS ) @@ -16,6 +19,7 @@ function ENT:Initialize() end self.NormInfo = "" + self.DisabledByTimeUntil = CurTime() self.Inputs = Wire_CreateInputs(self, { "Detonate" }) end @@ -24,7 +28,7 @@ function ENT:Setup( key, damage, removeafter, radius ) self.key = key self.damage = math.Min(damage, 1500) self.removeafter = removeafter - self.radius = math.Clamp(radius, 1, 10000) + self.radius = math.Clamp(radius, 1, wire_explosive_range:GetFloat()) self.Exploded = false if (self.damage > 0) then @@ -55,6 +59,8 @@ function ENT:Explode( ) if ( !self:IsValid() ) then return end if (self.Exploded) then return end + if self.DisabledByTimeUntil > CurTime() then return end + self.DisabledByTimeUntil = CurTime() + wire_explosive_delay:GetFloat() local ply = self:GetPlayer() if not IsValid(ply) then ply = self end diff --git a/lua/entities/gmod_wire_speedometer.lua b/lua/entities/gmod_wire_speedometer.lua index 1495f5f228..a0fa9ed1c4 100644 --- a/lua/entities/gmod_wire_speedometer.lua +++ b/lua/entities/gmod_wire_speedometer.lua @@ -4,16 +4,16 @@ ENT.PrintName = "Wire Speedometer" ENT.WireDebugName = "Speedo" function ENT:GetXYZMode() - return self:GetNetworkedBool( 0 ) + return self:GetNWBool( 0 ) end function ENT:GetAngVel() - return self:GetNetworkedBool( 1 ) + return self:GetNWBool( 1 ) end function ENT:SetModes( XYZMode, AngVel ) - self:SetNetworkedBool( 0, XYZMode ) - self:SetNetworkedBool( 1, AngVel ) + self:SetNWBool( 0, XYZMode ) + self:SetNWBool( 1, AngVel ) end if CLIENT then diff --git a/lua/entities/gmod_wire_textentry.lua b/lua/entities/gmod_wire_textentry.lua index 71adc4d7d1..2ba16a1075 100644 --- a/lua/entities/gmod_wire_textentry.lua +++ b/lua/entities/gmod_wire_textentry.lua @@ -158,6 +158,8 @@ net.Receive("wire_textentry_action",function(len,ply) local text = net.ReadString() + self:Unprompt() -- in all cases, make text entry available for use again + if not self.BlockInput then WireLib.TriggerOutput( self, "Text", text ) @@ -173,7 +175,6 @@ net.Receive("wire_textentry_action",function(len,ply) end end - self:Unprompt() -- in all cases, make text entry available for use again self:UpdateOverlay() end) diff --git a/lua/entities/gmod_wire_thruster.lua b/lua/entities/gmod_wire_thruster.lua index 748d590a14..7ffa539611 100644 --- a/lua/entities/gmod_wire_thruster.lua +++ b/lua/entities/gmod_wire_thruster.lua @@ -4,31 +4,37 @@ ENT.PrintName = "Wire Thruster" ENT.RenderGroup = RENDERGROUP_BOTH -- TODO: this is only needed when they're active. ENT.WireDebugName = "Thruster" +WireLib.ThrusterNetEffects = { + ["fire_smoke"] = true +} + function ENT:SetEffect( name ) - self:SetNetworkedString( "Effect", name ) + self:SetNWString( "Effect", name ) + self.neteffect = WireLib.ThrusterNetEffects[ name ] end function ENT:GetEffect( name ) - return self:GetNetworkedString( "Effect" ) + return self:GetNWString( "Effect" ) end function ENT:SetOn( boolon ) - self:SetNetworkedBool( "On", boolon, true ) + self:SetNWBool( "On", boolon, true ) end function ENT:IsOn( name ) - return self:GetNetworkedBool( "On" ) + return self:GetNWBool( "On" ) end function ENT:SetOffset( v ) - self:SetNetworkedVector( "Offset", v, true ) + self:SetNWVector( "Offset", v, true ) end function ENT:GetOffset( name ) - return self:GetNetworkedVector( "Offset" ) + return self:GetNWVector( "Offset" ) end if CLIENT then function ENT:Initialize() self.ShouldDraw = 1 + self.EffectAvg = 0 local mx, mn = self:GetRenderBounds() self:SetRenderBounds(mn + Vector(0,0,128), mx, 0) @@ -125,14 +131,17 @@ function ENT:SetForce( force, mul ) self.ForceLinear, self.ForceAngle = phys:CalculateVelocityOffset( ThrusterWorldForce, ThrusterWorldPos ); self.ForceLinear = phys:WorldToLocalVector( self.ForceLinear ) + if self.neteffect then + -- self.ForceLinear is 0 if the thruster is frozen + self.effectforce = ThrusterWorldForce:Length() + self.updateeffect = true + end + if ( mul > 0 ) then self:SetOffset( self.ThrustOffset ) else self:SetOffset( self.ThrustOffsetR ) end - --- self:SetNetworkedVector( 1, self.ForceAngle ) --- self:SetNetworkedVector( 2, self.ForceLinear ) end function ENT:SetDatEffect(uwater, owater, uweffect, oweffect) @@ -200,6 +209,14 @@ function ENT:TriggerInput(iname, value) end end +function ENT:Think() + if self.neteffect and self.updateeffect then + self.updateeffect = false + self:SetNWFloat("Thrust", self.effectforce) + end + self:NextThink(CurTime()+0.5) +end + function ENT:PhysicsSimulate( phys, deltatime ) if (!self:IsOn()) then return SIM_NOTHING end diff --git a/lua/entities/gmod_wire_vectorthruster.lua b/lua/entities/gmod_wire_vectorthruster.lua index 6c229862c0..b3b39e5dd6 100644 --- a/lua/entities/gmod_wire_vectorthruster.lua +++ b/lua/entities/gmod_wire_vectorthruster.lua @@ -5,49 +5,51 @@ ENT.RenderGroup = RENDERGROUP_BOTH -- TODO: this is only needed when they're a ENT.WireDebugName = "Vector Thruster" function ENT:SetEffect( name ) - self:SetNetworkedString( "Effect", name ) + self:SetNWString( "Effect", name ) + self.neteffect = WireLib.ThrusterNetEffects[ name ] end function ENT:GetEffect() - return self:GetNetworkedString( "Effect" ) + return self:GetNWString( "Effect" ) end function ENT:SetOn( boolon ) - self:SetNetworkedBool( "vecon", boolon, true ) + self:SetNWBool( "vecon", boolon, true ) end function ENT:IsOn() - return self:GetNetworkedBool( "vecon" ) + return self:GetNWBool( "vecon" ) end function ENT:SetMode( v ) - self:SetNetworkedInt( "vecmode", v, true ) + self:SetNWInt( "vecmode", v, true ) end function ENT:GetMode() - return self:GetNetworkedInt( "vecmode" ) + return self:GetNWInt( "vecmode" ) end function ENT:SetOffset( v ) - self:SetNetworkedVector( "Offset", v, true ) + self:SetNWVector( "Offset", v, true ) end function ENT:GetOffset( name ) - return self:GetNetworkedVector( "Offset" ) + return self:GetNWVector( "Offset" ) end function ENT:SetNormal( v ) - self:SetNetworkedInt( "vecx", v.x * 100, true ) - self:SetNetworkedInt( "vecy", v.y * 100, true ) - self:SetNetworkedInt( "vecz", v.z * 100, true ) + self:SetNWInt( "vecx", v.x * 100, true ) + self:SetNWInt( "vecy", v.y * 100, true ) + self:SetNWInt( "vecz", v.z * 100, true ) end function ENT:GetNormal() return Vector( - self:GetNetworkedInt( "vecx" ) / 100, - self:GetNetworkedInt( "vecy" ) / 100, - self:GetNetworkedInt( "vecz" ) / 100 + self:GetNWInt( "vecx" ) / 100, + self:GetNWInt( "vecy" ) / 100, + self:GetNWInt( "vecz" ) / 100 ) end if CLIENT then function ENT:Initialize() self.ShouldDraw = 1 + self.EffectAvg = 0 local mx, mn = self:GetRenderBounds() self:SetRenderBounds(mn + Vector(0,0,128), mx, 0) @@ -174,6 +176,12 @@ function ENT:SetForce( force, mul ) self.ForceLinear, self.ForceAngle = phys:CalculateVelocityOffset( ThrusterWorldForce, ThrusterWorldPos ); self.ForceLinear = phys:WorldToLocalVector( self.ForceLinear ) + + if self.neteffect then + -- self.ForceLinear is 0 if the thruster is frozen + self.effectforce = ThrusterWorldForce:Length() + self.updateeffect = true + end end function ENT:Setup(force, force_min, force_max, oweffect, uweffect, owater, uwater, bidir, soundname, mode, angleinputs) @@ -252,6 +260,14 @@ function ENT:TriggerInput(iname, value) self:Switch( self:IsOn(), self.mul ) end +function ENT:Think() + if self.neteffect and self.updateeffect then + self.updateeffect = false + self:SetNWFloat("Thrust", self.effectforce) + end + self:NextThink(CurTime()+0.5) +end + function ENT:PhysicsSimulate( phys, deltatime ) if (!self:IsOn()) then return SIM_NOTHING end if (self:IsPlayerHolding()) then return SIM_NOTHING end diff --git a/lua/entities/gmod_wire_waypoint.lua b/lua/entities/gmod_wire_waypoint.lua index ea448b20e8..80383c4897 100644 --- a/lua/entities/gmod_wire_waypoint.lua +++ b/lua/entities/gmod_wire_waypoint.lua @@ -4,7 +4,7 @@ ENT.PrintName = "Wire Waypoint Beacon" ENT.WireDebugName = "Waypoint" function ENT:GetNextWaypoint() - return self:GetNetworkedEntity("NextWaypoint") + return self:GetNWEntity("NextWaypoint") end if CLIENT then @@ -56,7 +56,7 @@ function ENT:SetNextWaypoint(wp) local SavedNextWaypoint = self:GetNextWaypoint() if SavedNextWaypoint:IsValid() and SavedNextWaypoint ~= wp then - self:SetNetworkedEntity("NextWaypoint", wp) + self:SetNWEntity("NextWaypoint", wp) local waypoints = self.waypoints for _,ent in ipairs(waypoints) do @@ -70,7 +70,7 @@ function ENT:SetNextWaypoint(wp) return end - self:SetNetworkedEntity("NextWaypoint", wp) + self:SetNWEntity("NextWaypoint", wp) if table.HasValue(self.waypoints, wp) then return end diff --git a/lua/entities/gmod_wire_wheel.lua b/lua/entities/gmod_wire_wheel.lua index 07f423a6ff..f208cd9497 100644 --- a/lua/entities/gmod_wire_wheel.lua +++ b/lua/entities/gmod_wire_wheel.lua @@ -77,7 +77,7 @@ function ENT:GetMotor() end function ENT:SetDirection( dir ) - self:SetNetworkedInt( 1, dir ) + self:SetNWInt( 1, dir ) self.direction = dir end diff --git a/lua/entities/sent_deployableballoons.lua b/lua/entities/sent_deployableballoons.lua index cf0f238336..c3283eba55 100644 --- a/lua/entities/sent_deployableballoons.lua +++ b/lua/entities/sent_deployableballoons.lua @@ -44,6 +44,7 @@ hook.Add("Initialize", "CreateDamageFilter", CreateDamageFilter) local function MakeBalloonSpawner(pl, Data) if IsValid(pl) and not pl:CheckLimit("wire_deployers") then return nil end + if Data.Model and not WireLib.CanModel(pl, Data.Model, Data.Skin) then return false end local ent = ents.Create("sent_deployableballoons") if not ent:IsValid() then return end diff --git a/lua/weapons/gmod_tool/stools/wire_adv.lua b/lua/weapons/gmod_tool/stools/wire_adv.lua index 04e04ebb7e..74a4df84fe 100644 --- a/lua/weapons/gmod_tool/stools/wire_adv.lua +++ b/lua/weapons/gmod_tool/stools/wire_adv.lua @@ -14,12 +14,24 @@ if CLIENT then language.Add( "Tool.wire_adv.name", "Wiring Tool" ) language.Add( "Tool.wire_adv.desc", "Connect things with wires. (Press Shift+F to switch to the debugger tool)" ) language.Add( "Tool.wire_adv.desc2", "Used to connect wirable props." ) - language.Add( "Tool.wire_adv.0", "Primary: Select input (Shift: Select multiple; Alt: Select all), Secondary: Next, Reload: Unlink (Alt: Unlink all), Mouse Wheel: Next" ) - language.Add( "Tool.wire_adv.1", "Primary: Select entity, Secondary: Add wire point, Reload: Cancel" ) - language.Add( "Tool.wire_adv.2", "Primary: Select output (Alt: Auto-connect matching input/outputs), Secondary: Next, Reload: Cancel, Mouse Wheel: Next" ) language.Add( "WireTool_width", "Width:" ) language.Add( "WireTool_material", "Material:" ) language.Add( "WireTool_colour", "Colour:" ) + TOOL.Information = { + { name = "left_0", stage = 0, text = "Select input (Shift: Select multiple; Alt: Select all)" }, + { name = "right_0", stage = 0, text = "Next" }, + { name = "reload_0", stage = 0, text = "Unlink (Alt: Unlink all)" }, + { name = "mwheel_0", stage = 0, text = "Mouse wheel: Next" }, + { name = "left_1", stage = 1, text = "Select entity" }, + { name = "right_1", stage = 1, text = "Add wirepoint" }, + { name = "reload_1", stage = 1, text = "Cancel" }, + { name = "left_2", stage = 2, text = "Select output (Alt: Auto-connect matching input/outputs)" }, + { name = "right_2", stage = 2, text = "Next" }, + { name = "mwheel_2", stage = 2, text = "Mouse wheel: Next" }, + } + for _, info in pairs(TOOL.Information) do + language.Add("Tool.wire_adv." .. info.name, info.text) + end TOOL.Wire_ToolMenuIcon = "icon16/connect.png" end diff --git a/lua/weapons/gmod_tool/stools/wire_debugger.lua b/lua/weapons/gmod_tool/stools/wire_debugger.lua index e2497d7fa8..829bda5881 100644 --- a/lua/weapons/gmod_tool/stools/wire_debugger.lua +++ b/lua/weapons/gmod_tool/stools/wire_debugger.lua @@ -7,9 +7,12 @@ TOOL.Tab = "Wire" if ( CLIENT ) then language.Add( "Tool.wire_debugger.name", "Debugging Tool" ) language.Add( "Tool.wire_debugger.desc", "Shows selected components info on the HUD." ) - language.Add( "Tool.wire_debugger.0", "Primary: Add component to HUD, Secondary: Remove component from HUD, Reload: Clear HUD" ) + language.Add( "Tool.wire_debugger.left", "Add component to HUD" ) + language.Add( "Tool.wire_debugger.right", "Remove component from HUD" ) + language.Add( "Tool.wire_debugger.reload", "Clear HUD" ) language.Add( "Tool_wire_debugger_showports", "Show overlay of ports in HUD" ) language.Add( "Tool_wire_debugger_orientvertical", "Orient the Inputs/Outputs Vertically" ) + TOOL.Information = { "left", "right", "reload" } end if SERVER then util.AddNetworkString("WireDbgCount") diff --git a/lua/weapons/gmod_tool/stools/wire_namer.lua b/lua/weapons/gmod_tool/stools/wire_namer.lua index f05533e2a1..ef81858b4b 100644 --- a/lua/weapons/gmod_tool/stools/wire_namer.lua +++ b/lua/weapons/gmod_tool/stools/wire_namer.lua @@ -5,17 +5,19 @@ TOOL.ConfigName = "" TOOL.Tab = "Wire" if ( CLIENT ) then - language.Add( "Tool.wire_namer.name", "Naming Tool" ) - language.Add( "Tool.wire_namer.desc", "Names components." ) - language.Add( "Tool.wire_namer.0", "Primary: Set name\nSecondary: Get name" ) - language.Add( "WireNamerTool_name", "Name:" ) + language.Add( "Tool.wire_namer.name", "Naming Tool" ) + language.Add( "Tool.wire_namer.desc", "Names components." ) + language.Add( "Tool.wire_namer.left", "Set name" ) + language.Add( "Tool.wire_namer.right", "Copy name" ) + language.Add( "WireNamerTool_name", "Name:" ) + TOOL.Information = { "left", "right" } end TOOL.ClientConVar[ "name" ] = "" local function SetName( Player, Entity, Data ) if ( Data and Data.name ) then - Entity:SetNetworkedString("WireName", Data.name) + Entity:SetNWString("WireName", Data.name) duplicator.StoreEntityModifier( Entity, "WireName", Data ) end end @@ -28,7 +30,7 @@ function TOOL:LeftClick(trace) local name = self:GetClientInfo("name") - //trace.Entity:SetNetworkedString("WireName", name) + //trace.Entity:SetNWString("WireName", name) //made the WireName duplicatable entmod (TAD2020) SetName( Player, trace.Entity, {name = name} ) @@ -41,7 +43,7 @@ function TOOL:RightClick(trace) if (not trace.Entity:IsValid()) then return end if (CLIENT) then return end - local name = trace.Entity:GetNetworkedString("WireName") + local name = trace.Entity:GetNWString("WireName") if (not name) then return end self:GetOwner():ConCommand('wire_namer_name "' .. name .. '"') diff --git a/lua/wire/beam_netvars.lua b/lua/wire/beam_netvars.lua index 5d641521aa..3d513e945b 100644 --- a/lua/wire/beam_netvars.lua +++ b/lua/wire/beam_netvars.lua @@ -66,6 +66,8 @@ local ExtraDelayedUpdates = {} local NextCleanup = CurTime() +local Wire_FastOverlayTextUpdate = CreateConVar("Wire_FastOverlayTextUpdate", 0, FCVAR_ARCHIVE) + if ( CLIENT ) then local function Dump() Msg("Networked Beam Vars...\n") @@ -122,7 +124,7 @@ local function SendNetworkUpdate( VarType, Index, Key, Value, Player ) end local function AddDelayedNetworkUpdate( VarType, Ent, Key, Value ) - if (Wire_FastOverlayTextUpdate) then + if (Wire_FastOverlayTextUpdate:GetBool()) then SendNetworkUpdate( VarType, Ent, Key, Value ) elseif (Ent) and (VarType) then DelayedUpdates[Ent] = DelayedUpdates[Ent] or {} @@ -139,7 +141,7 @@ local function AddDelayedNetworkUpdate( VarType, Ent, Key, Value ) end local function AddExtraDelayedNetworkUpdate( VarType, Ent, Key, Value, Player ) - if (Wire_FastOverlayTextUpdate) then + if (Wire_FastOverlayTextUpdate:GetBool()) then SendNetworkUpdate( VarType, Ent, Key, Value ) elseif (Ent) and (VarType) and (Key) then ExtraDelayedUpdates[Ent] = ExtraDelayedUpdates[Ent] or {} diff --git a/lua/wire/client/cl_wirelib.lua b/lua/wire/client/cl_wirelib.lua index 0ab2bbb832..07615e8184 100644 --- a/lua/wire/client/cl_wirelib.lua +++ b/lua/wire/client/cl_wirelib.lua @@ -55,14 +55,14 @@ function Wire_Render(ent) local len = ent:GetNetworkedBeamInt(net_name) or 0 if (len > 0) then - local start = ent:GetNetworkedBeamVector(net_name .. "_start") - if (ent:IsValid()) then start = ent:LocalToWorld(start) end - local color_v = ent:GetNetworkedBeamVector(net_name .. "_col") - local color = Color(color_v.x, color_v.y, color_v.z, 255) - local width = ent:GetNetworkedBeamFloat(net_name .. "_width") + local width = ent:GetNetworkedBeamFloat(net_name .. "_width") if width > 0 then + local start = ent:GetNetworkedBeamVector(net_name .. "_start") + if (ent:IsValid()) then start = ent:LocalToWorld(start) end + local color_v = ent:GetNetworkedBeamVector(net_name .. "_col") + local color = Color(color_v.x, color_v.y, color_v.z, 255) local scroll = CurTime()*WIRE_SCROLL_SPEED render.SetMaterial(getmat(ent:GetNetworkedBeamString(net_name .. "_mat"))) @@ -283,7 +283,7 @@ function Wire_DrawTracerBeam( ent, beam_num, hilight, beam_length ) trace.start = start trace.endpos = ent.endpos trace.filter = { ent } - if ent:GetNetworkedBool("TraceWater") then trace.mask = MASK_ALL end + if ent:GetNWBool("TraceWater") then trace.mask = MASK_ALL end trace = util.TraceLine(trace) render.SetMaterial(beam_mat) diff --git a/lua/wire/client/customspawnmenu.lua b/lua/wire/client/customspawnmenu.lua index 21ec8b5d8f..3e00ba7b71 100644 --- a/lua/wire/client/customspawnmenu.lua +++ b/lua/wire/client/customspawnmenu.lua @@ -10,12 +10,15 @@ local custom_for_all_tabs = CreateConVar( "wire_tool_menu_custom_menu_for_all_ta local tab_width = CreateConVar( "wire_tool_menu_tab_width", -1, {FCVAR_ARCHIVE} ) local horizontal_divider_width = CreateConVar( "wire_tool_menu_horizontal_divider_width", 0.28, {FCVAR_ARCHIVE} ) local custom_icons = CreateConVar( "wire_tool_menu_custom_icons", 1, {FCVAR_ARCHIVE} ) +local autocollapse = CreateConVar( "wire_tool_menu_autocollapse", 0, {FCVAR_ARCHIVE} ) -- Helper functions local function expandall( bool, nodes ) for i=1,#nodes do - nodes[i]:SetExpanded( bool ) - if nodes[i].WireCookieText then cookie.Set( nodes[i].WireCookieText, bool and 1 or 0 ) end + if nodes[i].m_bExpanded ~= bool then + nodes[i]:SetExpanded( bool ) + if nodes[i].WireCookieText then cookie.Set( nodes[i].WireCookieText, bool and 1 or 0 ) end + end if nodes[i].ChildNodes then expandall( bool, nodes[i].ChildNodes:GetChildren() ) @@ -351,6 +354,11 @@ local function AddNode( list, text, icon, cookietext ) node.WireCookieText = cookietext function node:DoClick() + if autocollapse:GetBool() then + local parent = (list.RootNode and list.RootNode.ChildNodes:GetChildren() or list.ChildNodes:GetChildren()) + expandall( false, parent ) + end + local b = not self.m_bExpanded self:SetExpanded( b ) @@ -647,6 +655,9 @@ local function CreateCPanel( panel ) setUpTabReloadOnChange( UseIcons ) UseIcons:SetToolTip( "If disabled, all tools will use the 'wrench' icon." ) + local AutoCollapse = panel:CheckBox( "Autocollapse", "wire_tool_menu_autocollapse" ) + AutoCollapse:SetToolTip( "If enabled, opening a category will collapse other categories." ) + local TabWidth = panel:NumSlider( "Tab width", "wire_tool_menu_tab_width", 300, 3000, 0 ) panel:Help( [[Set the width of all tabs. Defaults: diff --git a/lua/wire/client/e2descriptions.lua b/lua/wire/client/e2descriptions.lua index 1d604dff3a..ea266bd083 100644 --- a/lua/wire/client/e2descriptions.lua +++ b/lua/wire/client/e2descriptions.lua @@ -49,11 +49,16 @@ timer.Simple(0.1, function() end) -- Number +E2Helper.Descriptions["finite(n)"] = "Returns 1 if given value is a finite number; otherwise 0." +E2Helper.Descriptions["isinf(n)"] = "Returns 1 if given value is a positive infinity or -1 if given value is a negative infinity; otherwise 0." +E2Helper.Descriptions["isnan(n)"] = "Returns 1 if given value is not a number (NaN); otherwise 0." +E2Helper.Descriptions["inf()"] = "Returns a huge constant (infinity)" E2Helper.Descriptions["mod(nn)"] = "Modulo, returns the Remainder after Argument 1 has been divided by Argument 2. Note \"mod(-1, 3) = -1\"" E2Helper.Descriptions["sqrt(n)"] = "Returns the Square Root of the Argument" E2Helper.Descriptions["cbrt(n)"] = "Returns the Cube Root of the Argument" E2Helper.Descriptions["root(nn)"] = "Returns the Nth Root of the first Argument" E2Helper.Descriptions["e()"] = "Returns Euler's Constant" +E2Helper.Descriptions["frexp(n)"] = "Returns the mantissa and exponent of the given floating-point number as a vector2 (X component holds a mantissa, and Y component holds an exponent)" E2Helper.Descriptions["exp(n)"] = "Returns e to the power of the Argument (same as e()^N but shorter and faster this way)" E2Helper.Descriptions["ln(n)"] = "Returns the logarithm to base e of the Argument" E2Helper.Descriptions["log2(n)"] = "Returns the logarithm to base 2 of the Argument" @@ -165,8 +170,8 @@ E2Helper.Descriptions["match(s:s)"] = "runs string.match(S, S2) and returns the E2Helper.Descriptions["match(s:sn)"] = "runs string.match(S, S2, N) and returns the sub-captures as an array" E2Helper.Descriptions["matchFirst(s:s)"] = "runs string.match(S, S2) and returns the first match or an empty string if the match failed" E2Helper.Descriptions["matchFirst(s:sn)"] = "runs string.match(S, S2, N) and returns the first match or an empty string if the match failed" -E2Helper.Descriptions["gmatch(s:s)"] = "runs string.gmatch(S, S2) and returns the captures in an array" -E2Helper.Descriptions["gmatch(s:sn)"] = "runs string.gmatch(S, S2, N) and returns the captures in an array" +E2Helper.Descriptions["gmatch(s:s)"] = "runs string.gmatch(S, S2) and returns the captures in arrays in a table" +E2Helper.Descriptions["gmatch(s:sn)"] = "runs string.gmatch(S, S2, N) and returns the captures in arrays in a table" -- Entity/Player E2Helper.Descriptions["entity(n)"] = "Gets the entity associated with the id" @@ -179,6 +184,7 @@ E2Helper.Descriptions["model(e:)"] = "Gets the model of an entity" E2Helper.Descriptions["owner(e:)"] = "Gets the owner of an entity" E2Helper.Descriptions["name(e:)"] = "Gets the name of a player" E2Helper.Descriptions["steamID(e:)"] = "Gets the steam ID of the player" +E2Helper.Descriptions["steamID64(e:)"] = "Gets the Steam Community ID (aka Steam64) of the given player" E2Helper.Descriptions["isSteamFriend(e:e)"] = "Returns if the given Entity is a steam friend of the first Entity" E2Helper.Descriptions["steamFriends(e:)"] = "Returns a Array with E's steam friends on the server E is playing on" E2Helper.Descriptions["pos(e:)"] = "Gets the position of the entity" @@ -311,6 +317,13 @@ E2Helper.Descriptions["setTrails(e:nnnsvn)"] = "StartSize, EndSize, Length, Mate E2Helper.Descriptions["setTrails(e:nnnsvnnn)"] = "StartSize, EndSize, Length, Material, Color (RGB), Alpha, AttachmentID, Additive. Adds a trail to E with the specified attributes" E2Helper.Descriptions["removeTrails(e:)"] = "Removes the trail from E" E2Helper.Descriptions["runOnKeys(en)"] = "If set to 1, E2 will run when specified player presses/releases their key" +E2Helper.Descriptions["playerDisconnectClk()"] = "Returns 1 if the chip is being executed because of a player disconnect event. Returns 0 otherwise" +E2Helper.Descriptions["lastDisconnectedPlayer()"] = "Returns the last player to disconnect. Must be done while in a disconnectClk() as anytime after the player object is gone." +E2Helper.Descriptions["runOnPlayerDisconnect(n)"] = "If set to 0, the chip will no longer run on player disconnect events, otherwise it makes this chip execute when someone disconnects. Only needs to be called once, not in every execution" +E2Helper.Descriptions["playerConnectClk()"] = "Returns 1 if the chip is being executed because of a player connect event. Returns 0 otherwise" +E2Helper.Descriptions["lastConnectedPlayer()"] = "Returns the last player to connect." +E2Helper.Descriptions["runOnPlayerConnect(n)"] = "If set to 0, the chip will no longer run on player connect events, otherwise it makes this chip execute when someone connects. Only needs to be called once, not in every execution" + -- Attachment E2Helper.Descriptions["lookupAttachment(e:s)"] = "Returns Es attachment ID associated with attachmentName" @@ -849,6 +862,10 @@ E2Helper.Descriptions["toUnit(sn)"] = "Converts default garrysmod units to speci E2Helper.Descriptions["fromUnit(sn)"] = "Converts specified units to default garrysmod units" E2Helper.Descriptions["convertUnit(ssn)"] = "Converts between two units" +-- Steam ID conversion +E2Helper.Descriptions["steamIDFrom64(s)"] = "Converts Steam Community ID to Steam ID" +E2Helper.Descriptions["steamIDTo64(s)"] = "Converts Steam ID to Steam Community ID" + -- Server information E2Helper.Descriptions["map()"] = "Returns the current map name" E2Helper.Descriptions["hostname()"] = "Returns the Name of the server" @@ -946,6 +963,8 @@ E2Helper.Descriptions["findByName(s)"] = "Find all entities with the given name" E2Helper.Descriptions["findByModel(s)"] = "Find all entities with the given model" E2Helper.Descriptions["findByClass(s)"] = "Find all entities with the given class" E2Helper.Descriptions["findPlayerByName(s)"] = "Returns the player with the given name, this is an exception to the rule" +E2Helper.Descriptions["findPlayerBySteamID(s)"] = "Returns the player with the given SteamID32" +E2Helper.Descriptions["findPlayerBySteamID64(s)"] = "Returns the player with the given SteamID64" E2Helper.Descriptions["findResult(n)"] = "Returns the indexed entity from the previous find event (valid parameters are 1 to the number of entities found)" E2Helper.Descriptions["findClosest(v)"] = "Returns the closest entity to the given point from the previous find event" E2Helper.Descriptions["findToArray()"] = "Formats the query as an array, R[Index,entity] to get an entity" diff --git a/lua/wire/client/text_editor/texteditor.lua b/lua/wire/client/text_editor/texteditor.lua index 949f3c81d3..8f91bd5673 100644 --- a/lua/wire/client/text_editor/texteditor.lua +++ b/lua/wire/client/text_editor/texteditor.lua @@ -343,7 +343,7 @@ function EDITOR:SetText(text) end function EDITOR:GetValue() - return string_gsub(table_concat(self.Rows, "\n"), "\r", "") + return (string_gsub(table_concat(self.Rows, "\n"), "\r", "")) end function EDITOR:HighlightLine( line, r, g, b, a ) diff --git a/lua/wire/client/text_editor/wire_expression2_editor.lua b/lua/wire/client/text_editor/wire_expression2_editor.lua index 50b3a2b5ab..99bc1ca9f3 100644 --- a/lua/wire/client/text_editor/wire_expression2_editor.lua +++ b/lua/wire/client/text_editor/wire_expression2_editor.lua @@ -798,6 +798,7 @@ function Editor:InitComponents() self.C.Divider:Dock(FILL) self.C.Divider:SetDividerWidth(4) self.C.Divider:SetCookieName("wire_expression2_editor_divider") + self.C.Divider:SetLeftMin(0) local DoNothing = function() end self.C.MainPane.Paint = DoNothing @@ -903,6 +904,7 @@ function Editor:InitComponents() else self.C.Divider:SetLeftWidth(0) end + self.C.Divider:InvalidateLayout() button:InvalidateLayout() end @@ -1479,16 +1481,12 @@ end local code1 = "@name \n@inputs \n@outputs \n@persist \n@trigger \n\n" -- code2 contains the code that is to be marked, so it can simply be overwritten or deleted. local code2 = [[#[ - Shoutout to Expression Advanced 2! Have you tried it yet? - You should try it. It's a hundred times faster than E2 - and has more features. http://goo.gl/sZcyN9 - - A new preprocessor command, @autoupdate has been added. - See the wiki for more info. - Documentation and examples are available at: - http://wiki.wiremod.com/wiki/Expression_2 - The community is available at http://www.wiremod.com + https://github.com/wiremod/wire/wiki/Expression-2 + + Discord is available at https://discord.gg/cqJ45CT + Reddit is available at https://www.reddit.com/r/wiremod + Report any bugs you find here https://github.com/wiremod/wire/issues ]#]] local defaultcode = code1 .. code2 .. "\n" diff --git a/lua/wire/client/thrusterlib.lua b/lua/wire/client/thrusterlib.lua index c53636522f..888df664af 100644 --- a/lua/wire/client/thrusterlib.lua +++ b/lua/wire/client/thrusterlib.lua @@ -232,15 +232,18 @@ WireLib.ThrusterEffectDraw.fire_smoke = function(self) local vOffset = self:LocalToWorld(self:GetOffset()) local vNormal = self:CalcNormal() + + self.EffectAvg = ( self.EffectAvg * 29 + math.min( self:GetNWFloat("Thrust") / 100000, 100 ) ) / 30 + local Magnitude = self.EffectAvg local scroll = CurTime() * -10 render.SetMaterial( matFire ) render.StartBeam( 3 ) - render.AddBeam( vOffset, 8, scroll, Color( 0, 0, 255, 128) ) - render.AddBeam( vOffset + vNormal * 60, 32, scroll + 1, Color( 255, 255, 255, 128) ) - render.AddBeam( vOffset + vNormal * 148, 32, scroll + 3, Color( 255, 255, 255, 0) ) + render.AddBeam( vOffset, Magnitude/6, scroll, Color( 0, 0, 255, 128) ) + render.AddBeam( vOffset + vNormal * Magnitude, Magnitude/2, scroll + 1, Color( 255, 255, 255, 128) ) + render.AddBeam( vOffset + vNormal * Magnitude * 2, Magnitude/2, scroll + 3, Color( 255, 255, 255, 0) ) render.EndBeam() scroll = scroll * 0.5 @@ -249,8 +252,8 @@ WireLib.ThrusterEffectDraw.fire_smoke = function(self) render.SetMaterial( matHeatWave ) render.StartBeam( 3 ) render.AddBeam( vOffset, 8, scroll, Color( 0, 0, 255, 128) ) - render.AddBeam( vOffset + vNormal * 32, 32, scroll + 2, Color( 255, 255, 255, 255) ) - render.AddBeam( vOffset + vNormal * 128, 48, scroll + 5, Color( 0, 0, 0, 0) ) + render.AddBeam( vOffset + vNormal * Magnitude, 32, scroll + 2, Color( 255, 255, 255, 255) ) + render.AddBeam( vOffset + vNormal * Magnitude * 2, 48, scroll + 5, Color( 0, 0, 0, 0) ) render.EndBeam() @@ -258,8 +261,8 @@ WireLib.ThrusterEffectDraw.fire_smoke = function(self) render.SetMaterial( matFire ) render.StartBeam( 3 ) render.AddBeam( vOffset, 8, scroll, Color( 0, 0, 255, 128) ) - render.AddBeam( vOffset + vNormal * 60, 16, scroll + 1, Color( 255, 255, 255, 128) ) - render.AddBeam( vOffset + vNormal * 148, 16, scroll + 3, Color( 255, 255, 255, 0) ) + render.AddBeam( vOffset + vNormal * Magnitude, 16, scroll + 1, Color( 255, 255, 255, 128) ) + render.AddBeam( vOffset + vNormal * Magnitude * 2, 16, scroll + 3, Color( 255, 255, 255, 0) ) render.EndBeam() self.SmokeTimer = self.SmokeTimer or 0 @@ -267,15 +270,18 @@ WireLib.ThrusterEffectDraw.fire_smoke = function(self) self.SmokeTimer = CurTime() + 0.015 - vOffset = self:LocalToWorld(self:GetOffset()) + Vector( math.Rand( -3, 3 ), math.Rand( -3, 3 ), math.Rand( -3, 3 ) ) - vNormal = self:CalcNormal() + local orth1 = Vector( vNormal.z, vNormal.x, vNormal.y ) + orth1 = ( orth1 - vNormal * vNormal:Dot(orth1) ):GetNormalized() + local orth2 = vNormal:Cross( orth1 ) local particle = emitter:Add( "particles/smokey", vOffset ) - particle:SetVelocity( vNormal * math.Rand( 10, 30 ) ) + particle:SetVelocity( vNormal * math.Rand( Magnitude*19, Magnitude*20 ) + orth1 * math.Rand( -50, 50 ) + orth2 * math.Rand( -50, 50 ) ) + particle:SetAirResistance( 60 ) particle:SetDieTime( 2.0 ) - particle:SetStartAlpha( math.Rand( 50, 150 ) ) - particle:SetStartSize( math.Rand( 8, 16 ) ) - particle:SetEndSize( math.Rand( 32, 64 ) ) + particle:SetStartAlpha( math.Rand( 0, 10 ) ) + particle:SetEndAlpha( 200 ) + particle:SetStartSize( math.Rand( 16, 24 ) ) + particle:SetEndSize( math.Rand( 10+Magnitude/2, 30+Magnitude/2 ) ) particle:SetRoll( math.Rand( -0.2, 0.2 ) ) particle:SetColor( 200, 200, 210 ) end diff --git a/lua/wire/client/wire_expression2_browser.lua b/lua/wire/client/wire_expression2_browser.lua index ece8216377..1bc17823c3 100644 --- a/lua/wire/client/wire_expression2_browser.lua +++ b/lua/wire/client/wire_expression2_browser.lua @@ -111,7 +111,7 @@ function PANEL:Search( str, foldername, fullpath, parentfullpath, first_recursio end end -local function check_results( status, bool, count ) +function PANEL:CheckSearchResults( status, bool, count ) if bool ~= nil and count ~= nil then -- we're done searching if count == 0 then local node = self.Root:AddNode( "No results" ) @@ -133,13 +133,13 @@ function PANEL:StartSearch( str ) local crt = coroutine.create( self.Search ) local status, bool, count = coroutine.resume( crt, self, str, self.startfolder, self.startfolder, "", true ) - check_results( status, bool, count ) + self:CheckSearchResults( status, bool, count ) timer.Create( "wire_expression2_search", 0, 0, function() for i=1,100 do -- Load loads of files/folders at a time local status, bool, count = coroutine.resume( crt ) - if check_results( status, bool, count ) then + if self:CheckSearchResults( status, bool, count ) then return -- exit loop etc end end diff --git a/lua/wire/gates/array.lua b/lua/wire/gates/array.lua new file mode 100644 index 0000000000..30f542cb70 --- /dev/null +++ b/lua/wire/gates/array.lua @@ -0,0 +1,150 @@ +--[[ + Array gates +]] + +GateActions("Array") + + +local types_defaults = { + NUMBER = 0, + ANGLE = Angle(0,0,0), + VECTOR = Vector(0,0,0), + STRING = "", + ENTITY = NULL, +} + +local types_formats = { + NUMBER = function(x) return tostring(x) end, + ANGLE = function(x) return string.format("(%d,%d,%d)",x.p,x.r,x.y) end, + VECTOR = function(x) return string.format("(%d,%d,%d)",x.x,x.y,x.z) end, + STRING = function(x) return x end, + ENTITY = function(x) return tostring(x) end, +} + +local types_compare = { -- used for array find gates. + ANGLE = function(a,b) return a.p == b.p and + a.y == b.y and + a.r == b.r end, + VECTOR = function(a,b) return a.x == b.x and + a.y == b.y and + a.z == b.z end, +} +local normal_compare = function(a,b) return a == b end + +for type_name, default in pairs( types_defaults ) do + local type_name2 = type_name + if type_name2 == "NUMBER" then type_name2 = "NORMAL" end + local compare = types_compare[type_name] or normal_compare + + GateActions["array_read_" .. type_name] = { + name = "Array Read (" .. type_name .. ")", + inputs = { "R", "Index" }, + inputtypes = { "ARRAY", "NORMAL" }, + outputtypes = { type_name2 }, + output = function(gate, r, index) + local var = r[math.floor(index)] + local tp = type(var) + + if not var then return default end + + if tp == "Player" and type_name == "ENTITY" then return var end -- Special case + if tp == "NPC" and type_name == "ENTITY" then return var end -- Special case + if string.upper(tp) ~= type_name then return default end + + return var + end, + label = function(Out,r,index) + return string.format( "%s[%s] = %s", r, index, types_formats[type_name](Out) ) + end, + } + + GateActions["array_find_" .. type_name] = { + name = "Array Find (" .. type_name .. ")", + inputs = { "R", "Value" }, + inputtypes = { "ARRAY", type_name2 }, + outputtypes = { "NORMAL" }, + output = function(gate, r, value) + for i=1,#r do + if i > 10000 then return 0 end -- Stop iterating too much to prevent lag + + local var = r[i] + + if compare(var,value) then return i end + end + + return 0 + end, + label = function(Out,r,index) + return string.format( "find(%s,%s) = %d", r, index, Out ) + end, + } + + --[[ + I feel there is no need for these gates at this time. + The only time you'll encounter arrays with gates + are in a situation where you only need to read. + I'll add it here for future reference + + GateActions["array_write_" .. type_name] = { + name = "Array Write (" .. type_name .. ")", + inputs = { "R", "Index", "Value" }, + inputtypes = { "ARRAY", "NORMAL", type_name2 }, + output = function(gate, r, index, value) + if type(var) ~= string.lower(type_name) then return end + if not var then return end + + r[math.floor(index)] = value + end, + label = function(Out,r,index) + return string.format( "%s[%s] = %s", r, index, types_formats[type_name](Out) ) + end, + } + ]] +end + +--[[ + I feel there is no need for this gate at this time. + The only time you'll encounter arrays with gates + are in a situation where you only need to read. + I'll add it here for future reference + +GateActions["array_create"] = { + name = "Array Create", + output = function(gate) + return {} + end, +} +]] + +GateActions["array_gettype"] = { + name = "Array Get Type", + inputs = { "R", "Index" }, + inputtypes = { "ARRAY", "NORMAL" }, + outputtypes = { "STRING" }, + output = function(gate, r, index) + local tp = type(r[math.floor(index)]) + + if tp == "nil" then return "NIL" end + if tp == "Player" then return "ENTITY" end -- Special case + if tp == "NPC" then return "ENTITY" end -- Special case + if not types_defaults[string.upper(tp)] then return "TYPE NOT SUPPORTED" end + + return tp + end, + label = function(Out,r,index) + return string.format( "type(%s[%s]) = %s", r, index, Out ) + end, +} + +GateActions["array_count"] = { + name = "Array Count", + inputs = { "R" }, + inputtypes = { "ARRAY" }, + outputtypes = { "NORMAL" }, + output = function(gate, r) + return #r + end, + label = function(Out,r,index) + return string.format( "#%s = %s", r, Out ) + end, +} diff --git a/lua/wire/gates/highspeed.lua b/lua/wire/gates/highspeed.lua new file mode 100644 index 0000000000..5f317efabf --- /dev/null +++ b/lua/wire/gates/highspeed.lua @@ -0,0 +1,42 @@ +GateActions("Highspeed") + +GateActions["highspeed_write"] = { + name = "Highspeed Write", + inputs = { "Clk", "Memory", "Address", "Data" }, + inputtypes = { "NORMAL", "WIRELINK", "NORMAL", "NORMAL" }, + output = function(gate, Clk, Memory, Address, Data) + if not Memory then return 0 end + if not Memory.WriteCell then return 0 end + if Clk <= 0 then return 0 end + + Address = math.floor(Address) + if Address < 0 then return 0 end + + return Memory:WriteCell(Address, Data) and 1 or 0 + end, + label = function(Out, Clk, Memory, Address, Data) + return "Clock:"..Clk.." Memory:"..Memory.." Address:"..Address.." Data:"..Data.." = "..Out + end +} + +GateActions["highspeed_read"] = { + name = "Highspeed Read", + inputs = { "Clk", "Memory", "Address" }, + inputtypes = { "NORMAL", "WIRELINK", "NORMAL" }, + output = function(gate, Clk, Memory, Address) + if not Memory then return 0 end + if not Memory.ReadCell then return 0 end + if Clk <= 0 then return 0 end + + Address = math.floor(Address) + if Address < 0 then return 0 end + + return Memory:ReadCell(Address) or 0 + end, + label = function(Out, Clk, Memory, Address) + return "Clock:"..Clk.." Memory:"..Memory.." Address:"..Address.." = "..Out + end +} + + +GateActions() diff --git a/lua/wire/gates/string.lua b/lua/wire/gates/string.lua index c37f66261b..6b0629a0e6 100644 --- a/lua/wire/gates/string.lua +++ b/lua/wire/gates/string.lua @@ -2,6 +2,8 @@ String gates ! :P ]] +local MAX_LEN = 1024*1024 -- max string length of 1MB + GateActions("String") GateActions["string_ceq"] = { @@ -131,13 +133,23 @@ GateActions["string_find"] = { end } - GateActions["string_concat"] = { name = "Concatenate", inputs = { "A" , "B" , "C" , "D" , "E" , "F" , "G" , "H" }, inputtypes = { "STRING" , "STRING" , "STRING" , "STRING" , "STRING" , "STRING" , "STRING" , "STRING" }, outputtypes = { "STRING" }, output = function(gate, A, B, C, D, E, F, G, H) + if (A and #A or 0) + + (B and #B or 0) + + (C and #C or 0) + + (D and #D or 0) + + (E and #E or 0) + + (F and #F or 0) + + (G and #G or 0) + + (H and #H or 0) > MAX_LEN + then + return false + end local T = {A,B,C,D,E,F,G,H} return table.concat(T) end, @@ -254,6 +266,9 @@ GateActions["string_repeat"] = { output = function(gate, A, B) if !A then A = "" end if !B or B<1 then B = 1 end + + if B * #A > MAX_LEN then return false end + return string.rep(A,B) end, label = function(Out, A) diff --git a/lua/wire/server/wirelib.lua b/lua/wire/server/wirelib.lua index 70899c4d83..0830f5429f 100644 --- a/lua/wire/server/wirelib.lua +++ b/lua/wire/server/wirelib.lua @@ -949,82 +949,6 @@ Wire_CreateOutputIterator = WireLib.CreateOutputIterator Wire_BuildDupeInfo = WireLib.BuildDupeInfo Wire_ApplyDupeInfo = WireLib.ApplyDupeInfo ---backwards logic: set enable to false to show show values on gates instead -Wire_EnableGateInputValues = true -local function WireEnableInputValues(pl, cmd, args) - if ( args[1] ) and ( ( pl:IsAdmin() ) or ( pl:IsSuperAdmin( )() ) ) then - if args[1] == "1" or args[1] == 1 then - Wire_EnableGateInputValues = true - elseif args[1] == "0" or args[1] == 0 then - Wire_EnableGateInputValues = false - else - pl:PrintMessage(HUD_PRINTCONSOLE, "Only takes 0 or 1") - end - end - pl:PrintMessage(HUD_PRINTCONSOLE, "\nWire_EnableGateInputValues = "..tostring(Wire_EnableGateInputValues).."\n") -end -concommand.Add( "Wire_EnableGateInputValues", WireEnableInputValues ) - -Wire_FastOverlayTextUpdate = false -local function WireFastOverlayTextUpdate(pl, cmd, args) - if ( args[1] ) and ( ( pl:IsAdmin() ) or ( pl:IsSuperAdmin( )() ) ) then - if args[1] == "1" or args[1] == 1 then - Wire_FastOverlayTextUpdate = true - elseif args[1] == "0" or args[1] == 0 then - Wire_FastOverlayTextUpdate = false - else - pl:PrintMessage(HUD_PRINTCONSOLE, "Only takes 0 or 1") - end - end - pl:PrintMessage(HUD_PRINTCONSOLE, "\nWire_FastOverlayTextUpdate = "..tostring(Wire_FastOverlayTextUpdate).."\n") -end -concommand.Add( "Wire_FastOverlayTextUpdate", WireFastOverlayTextUpdate ) - -Wire_SlowerOverlayTextUpdate = false -local function WireSlowerOverlayTextUpdate(pl, cmd, args) - if ( args[1] ) and ( ( pl:IsAdmin() ) or ( pl:IsSuperAdmin( )() ) ) then - if args[1] == "1" or args[1] == 1 then - Wire_SlowerOverlayTextUpdate = true - elseif args[1] == "0" or args[1] == 0 then - Wire_SlowerOverlayTextUpdate = false - else - pl:PrintMessage(HUD_PRINTCONSOLE, "Only takes 0 or 1") - end - end - pl:PrintMessage(HUD_PRINTCONSOLE, "\nWire_SlowerOverlayTextUpdate = "..tostring(Wire_SlowerOverlayTextUpdate).."\n") -end -concommand.Add( "Wire_SlowerOverlayTextUpdate", WireSlowerOverlayTextUpdate ) - -Wire_DisableOverlayTextUpdate = false -local function WireDisableOverlayTextUpdate(pl, cmd, args) - if ( args[1] ) and ( ( pl:IsAdmin() ) or ( pl:IsSuperAdmin( )() ) ) then - if args[1] == "1" or args[1] == 1 then - Wire_DisableOverlayTextUpdate = true - elseif args[1] == "0" or args[1] == 0 then - Wire_DisableOverlayTextUpdate = false - else - pl:PrintMessage(HUD_PRINTCONSOLE, "Only takes 0 or 1") - end - end - pl:PrintMessage(HUD_PRINTCONSOLE, "\nWire_DisableOverlayTextUpdate = "..tostring(Wire_DisableOverlayTextUpdate).."\n") -end -concommand.Add( "Wire_DisableOverlayTextUpdate", WireDisableOverlayTextUpdate ) - -Wire_ForceDelayOverlayTextUpdate = false -local function WireForceDelayOverlayTextUpdate(pl, cmd, args) - if ( args[1] ) and ( ( pl:IsAdmin() ) or ( pl:IsSuperAdmin( )() ) ) then - if args[1] == "1" or args[1] == 1 then - Wire_ForceDelayOverlayTextUpdate = true - elseif args[1] == "0" or args[1] == 0 then - Wire_ForceDelayOverlayTextUpdate = false - else - pl:PrintMessage(HUD_PRINTCONSOLE, "Only takes 0 or 1") - end - end - pl:PrintMessage(HUD_PRINTCONSOLE, "\nWire_ForceDelayOverlayTextUpdate = "..tostring(Wire_ForceDelayOverlayTextUpdate).."\n") -end -concommand.Add( "Wire_ForceDelayOverlayTextUpdate", WireForceDelayOverlayTextUpdate ) - -- prevent applyForce+Anti-noclip-based killing contraptions hook.Add("InitPostEntity", "antiantinoclip", function() local ENT = scripted_ents.GetList().rt_antinoclip_handler @@ -1134,9 +1058,29 @@ function WireLib.dummytrace(ent) } end +function WireLib.NumModelSkins(model) + if NumModelSkins then + return NumModelSkins(model) + end + local info = util.GetModelInfo(model) + return info and info.SkinCount +end + +--- @return whether the given player can spawn an object with the given model and skin +function WireLib.CanModel(player, model, skin) + if not util.IsValidModel(model) then return false end + if skin ~= nil then + local count = WireLib.NumModelSkins(model) + if count and count <= skin then return false end + end + if IsValid(player) and player:IsPlayer() and not hook.Run("PlayerSpawnObject", player, model, skin) then return false end + return true +end + function WireLib.MakeWireEnt( pl, Data, ... ) Data.Class = scripted_ents.Get(Data.Class).ClassName if IsValid(pl) and not pl:CheckLimit(Data.Class:sub(6).."s") then return false end + if Data.Model and not WireLib.CanModel(pl, Data.Model, Data.Skin) then return false end local ent = ents.Create( Data.Class ) if not IsValid(ent) then return false end @@ -1216,9 +1160,15 @@ function WireLib.AddOutputAlias( class, old, new ) ENT_table.OutputAliases[old] = new end +local function effectiveMass(ent) + if not isentity(ent) then return 1 end + if ent:IsWorld() then return 99999 end + if not IsValid(ent) or not IsValid(ent:GetPhysicsObject()) then return 1 end + return ent:GetPhysicsObject():GetMass() +end + function WireLib.CalcElasticConsts(Ent1, Ent2) - if not IsValid(Ent1:GetPhysicsObject()) or not IsValid(Ent2:GetPhysicsObject()) then return 100, 20 end - local minMass = math.min(Ent1:IsWorld() and 99999 or Ent1:GetPhysicsObject():GetMass(), Ent2:IsWorld() and 99999 or Ent2:GetPhysicsObject():GetMass()) + local minMass = math.min(effectiveMass(Ent1), effectiveMass(Ent2)) local const = minMass * 100 local damp = minMass * 20 diff --git a/lua/wire/stools/7seg.lua b/lua/wire/stools/7seg.lua index 15fffbe419..be53021815 100644 --- a/lua/wire/stools/7seg.lua +++ b/lua/wire/stools/7seg.lua @@ -7,13 +7,15 @@ TOOL.GhostMin = "x" if CLIENT then language.Add( "tool.wire_7seg.name", "7-Segment Display Tool" ) language.Add( "tool.wire_7seg.desc", "Spawns 7 indicators for numeric display with the wire system." ) - language.Add( "tool.wire_7seg.0", "Primary: Create display/Update Indicator" ) language.Add( "ToolWire7Seg_a_colour", "Off Colour:" ) language.Add( "ToolWire7Seg_b_colour", "On Colour:" ) language.Add( "ToolWire7SegTool_worldweld", "Allow weld to world" ) language.Add( "undone_wire7seg", "Undone 7-Segment Display" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end +WireToolSetup.BaseLang() + -- define MaxLimitName cause this tool just uses gmod_wire_indicators TOOL.MaxLimitName = "wire_indicators" diff --git a/lua/wire/stools/addressbus.lua b/lua/wire/stools/addressbus.lua index af312eaa1f..c72b6af4de 100644 --- a/lua/wire/stools/addressbus.lua +++ b/lua/wire/stools/addressbus.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "addressbus", "Data - Address Bus", "gmod_wire_addressbus", if ( CLIENT ) then language.Add( "Tool.wire_addressbus.name", "Address bus tool (Wire)" ) language.Add( "Tool.wire_addressbus.desc", "Spawns an address bus. Address spaces may overlap!" ) - language.Add( "Tool.wire_addressbus.0", "Primary: Create/Update address bus" ) + TOOL.Information = { { name = "left", text = "Create/Update address bus" } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/adv_input.lua b/lua/wire/stools/adv_input.lua index bfa849843c..fb34e58863 100644 --- a/lua/wire/stools/adv_input.lua +++ b/lua/wire/stools/adv_input.lua @@ -1,10 +1,9 @@ WireToolSetup.setCategory( "Input, Output/Keyboard Interaction" ) -WireToolSetup.open( "adv_input", "Adv. Input", "gmod_wire_adv_input", nil, "Adv Inputs" ) +WireToolSetup.open( "adv_input", "Adv. Input", "gmod_wire_adv_input", nil, "Adv. Inputs" ) if CLIENT then language.Add( "tool.wire_adv_input.name", "Adv. Input Tool (Wire)" ) language.Add( "tool.wire_adv_input.desc", "Spawns a adv. input for use with the wire system." ) - language.Add( "tool.wire_adv_input.0", "Primary: Create/Update Adv. Input" ) language.Add( "WireAdvInputTool_keymore", "Increase:" ) language.Add( "WireAdvInputTool_keyless", "Decrease:" ) language.Add( "WireAdvInputTool_toggle", "Toggle" ) @@ -12,8 +11,9 @@ if CLIENT then language.Add( "WireAdvInputTool_value_max", "Maximum:" ) language.Add( "WireAdvInputTool_value_start", "Start at:" ) language.Add( "WireAdvInputTool_speed", "Change per second:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end -WireToolSetup.BaseLang("Adv. Inputs") +WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if SERVER then diff --git a/lua/wire/stools/button.lua b/lua/wire/stools/button.lua index 2615f7e59f..65828609e5 100644 --- a/lua/wire/stools/button.lua +++ b/lua/wire/stools/button.lua @@ -4,13 +4,13 @@ WireToolSetup.open( "button", "Button", "gmod_wire_button", nil, "Buttons" ) if CLIENT then language.Add( "tool.wire_button.name", "Button Tool (Wire)" ) language.Add( "tool.wire_button.desc", "Spawns a button for use with the wire system." ) - language.Add( "tool.wire_button.0", "Primary: Create/Update Button" ) language.Add( "WireButtonTool_toggle", "Toggle" ) language.Add( "WireButtonTool_entityout", "Output Entity" ) language.Add( "WireButtonTool_value_on", "Value On:" ) language.Add( "WireButtonTool_value_off", "Value Off:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end -WireToolSetup.BaseLang("Buttons") +WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if SERVER then diff --git a/lua/wire/stools/cam.lua b/lua/wire/stools/cam.lua index 74e0360474..a5a679061c 100644 --- a/lua/wire/stools/cam.lua +++ b/lua/wire/stools/cam.lua @@ -4,8 +4,6 @@ WireToolSetup.open( "cam", "Cam Controller", "gmod_wire_cameracontroller", nil, if ( CLIENT ) then language.Add( "Tool.wire_cam.name", "Cam Controller Tool (Wire)" ) language.Add( "Tool.wire_cam.desc", "Spawns a constant Cam Controller prop for use with the wire system." ) - language.Add( "Tool.wire_cam.0", "Primary: Create/Update Cam Controller Secondary: Link a cam controller to a Pod." ) - language.Add( "Tool.wire_cam.1", "Now click a pod to link to." ) language.Add( "Tool.wire_cam.parentlocal", "Coordinates local to parent" ) language.Add( "Tool.wire_cam.automove", "Client side movement" ) language.Add( "Tool.wire_cam.localmove", "Localized movement" ) @@ -45,7 +43,7 @@ TOOL.ClientConVar[ "drawplayer" ] = "1" TOOL.ClientConVar[ "drawparent" ] = "1" TOOL.ClientConVar[ "smooth_amount" ] = "18" -WireToolSetup.SetupLinking() +WireToolSetup.SetupLinking(false, "pod") function TOOL.BuildCPanel(panel) WireDermaExts.ModelSelect(panel, "wire_cam_model", list.Get( "Wire_Misc_Tools_Models" ), 1) diff --git a/lua/wire/stools/cd_disk.lua b/lua/wire/stools/cd_disk.lua index da3bff3b37..d545646ead 100644 --- a/lua/wire/stools/cd_disk.lua +++ b/lua/wire/stools/cd_disk.lua @@ -2,12 +2,16 @@ WireToolSetup.setCategory( "Memory" ) WireToolSetup.open( "cd_disk", "CD Disk", "gmod_wire_cd_disk", nil, "CD Disks" ) if (CLIENT) then - language.Add("Tool.wire_cd_disk.name", "CD Disk Tool (Wire)") - language.Add("Tool.wire_cd_disk.desc", "Spawns a CD Disk.") - language.Add("Tool.wire_cd_disk.0", "Primary: Create/Update CD Disk, Secondary: Change model") - language.Add("WireDataTransfererTool_cd_disk", "CD Disk:") + language.Add("Tool.wire_cd_disk.name", "CD Disk Tool (Wire)") + language.Add("Tool.wire_cd_disk.desc", "Spawns a CD Disk.") + language.Add("WireDataTransfererTool_cd_disk", "CD Disk:") - WireToolSetup.setToolMenuIcon( "venompapa/wirecd/wirecd" ) + TOOL.Information = { + { name = "left", text = "Create/Update " .. TOOL.Name }, + { name = "right", text = "Change model" }, + } + + WireToolSetup.setToolMenuIcon( "venompapa/wirecd/wirecd" ) end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/cd_ray.lua b/lua/wire/stools/cd_ray.lua index 3e60168a81..6a7b414b03 100644 --- a/lua/wire/stools/cd_ray.lua +++ b/lua/wire/stools/cd_ray.lua @@ -2,14 +2,18 @@ WireToolSetup.setCategory( "Memory" ) WireToolSetup.open( "cd_ray", "CD Ray", "gmod_wire_cd_ray", nil, "CD Rays" ) if ( CLIENT ) then - language.Add( "Tool.wire_cd_ray.name", "CD Ray Tool (Wire)" ) - language.Add( "Tool.wire_cd_ray.desc", "Spawns a CD Ray." ) - language.Add( "Tool.wire_cd_ray.0", "Primary: Create/Update CD Ray Secondary: Create CD lock (to keep CD in same spot)" ) - language.Add( "WireCDRayTool_cd_ray", "CD Ray:" ) + language.Add( "Tool.wire_cd_ray.name", "CD Ray Tool (Wire)" ) + language.Add( "Tool.wire_cd_ray.desc", "Spawns a CD Ray." ) + language.Add( "WireCDRayTool_cd_ray", "CD Ray:" ) language.Add( "sboxlimit_wire_cd_rays", "You've hit CD Rays limit!" ) - language.Add( "undone_Wire CDRay", "Undone Wire CD Ray" ) + TOOL.Information = { + { name = "left", text = "Create/Update " .. TOOL.Name }, + { name = "right", text = "Create CD lock (to keep CD in same spot)" }, + } end +WireToolSetup.BaseLang() + if (SERVER) then CreateConVar('sbox_maxwire_cd_rays', 20) CreateConVar('sbox_maxwire_cd_locks', 20) @@ -20,8 +24,6 @@ TOOL.ClientConVar[ "lockmodel" ] = "models/venompapa/wirecdlock.mdl" TOOL.ClientConVar[ "Range" ] = "64" TOOL.ClientConVar[ "DefaultZero" ] = "0" -cleanup.Register("wire_cd_rays") - if SERVER then function TOOL:GetConVars() return self:GetClientNumber("Range"), self:GetClientNumber("DefaultZero") ~= 0 diff --git a/lua/wire/stools/clutch.lua b/lua/wire/stools/clutch.lua index f0c35c2eb3..84552dacfd 100644 --- a/lua/wire/stools/clutch.lua +++ b/lua/wire/stools/clutch.lua @@ -2,11 +2,14 @@ WireToolSetup.setCategory( "Physics" ) WireToolSetup.open( "clutch", "Clutch", "gmod_wire_clutch", nil, "Clutchs" ) if CLIENT then - language.Add( "Tool.wire_clutch.name", "Clutch Tool (Wire)" ) - language.Add( "Tool.wire_clutch.desc", "Control rotational friction between props" ) - language.Add( "Tool.wire_clutch.0", "Primary: Place/Select a clutch controller\nSecondary: Select an entity to apply the clutch to\nReload: Remove clutch from entity/deselect controller" ) - language.Add( "Tool.wire_clutch.1", "Right click on the second entity you want the clutch to apply to" ) - language.Add( "undone_wireclutch", "Undone Wire Clutch" ) + language.Add( "Tool.wire_clutch.name", "Clutch Tool (Wire)" ) + language.Add( "Tool.wire_clutch.desc", "Control rotational friction between props" ) + TOOL.Information = { + { name = "left_0", stage = 0, text = "Place/Select a clutch controller" }, + { name = "right_0", stage = 0, text = "Select an entity to apply the clutch to" }, + { name = "reload_0", stage = 0, text = "Remove clutch from entity/deselect controller" }, + { name = "right_1", stage = 1, text = "Right click on the second entity you want the clutch to apply to" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 8 ) @@ -106,7 +109,7 @@ if CLIENT then function TOOL:DrawHUD() local DrawnEnts = {} -- Used to keep track of which ents already have a circle - local controller = self:GetWeapon():GetNetworkedEntity( "WireClutchController" ) + local controller = self:GetWeapon():GetNWEntity( "WireClutchController" ) if !IsValid( controller ) then return end // Draw circle around the controller @@ -169,7 +172,7 @@ end if SERVER then function TOOL:SelectController( controller ) self.controller = controller - self:GetWeapon():SetNetworkedEntity( "WireClutchController", controller or Entity(0) ) -- Must use null entity since nil won't send + self:GetWeapon():SetNWEntity( "WireClutchController", controller or Entity(0) ) -- Must use null entity since nil won't send // Send constraint from the controller to the client local constrained_pairs = {} diff --git a/lua/wire/stools/colorer.lua b/lua/wire/stools/colorer.lua index 864ef5bde5..c7171400f7 100644 --- a/lua/wire/stools/colorer.lua +++ b/lua/wire/stools/colorer.lua @@ -2,13 +2,13 @@ WireToolSetup.setCategory( "Visuals" ) WireToolSetup.open( "colorer", "Colorer", "gmod_wire_colorer", nil, "Colorers" ) if CLIENT then - language.Add( "Tool.wire_colorer.name", "Colorer Tool (Wire)" ) - language.Add( "Tool.wire_colorer.desc", "Spawns a constant colorer prop for use with the wire system." ) - language.Add( "Tool.wire_colorer.0", "Primary: Create/Update Colorer" ) - language.Add( "WireColorerTool_colorer", "Colorer:" ) - language.Add( "WireColorerTool_outColor", "Output Color" ) - language.Add( "WireColorerTool_Range", "Max Range:" ) - language.Add( "WireColorerTool_Model", "Choose a Model:") + language.Add( "Tool.wire_colorer.name", "Colorer Tool (Wire)" ) + language.Add( "Tool.wire_colorer.desc", "Spawns a constant colorer prop for use with the wire system." ) + language.Add( "WireColorerTool_colorer", "Colorer:" ) + language.Add( "WireColorerTool_outColor", "Output Color" ) + language.Add( "WireColorerTool_Range", "Max Range:" ) + language.Add( "WireColorerTool_Model", "Choose a Model:") + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } WireToolSetup.setToolMenuIcon( "icon16/color_wheel.png" ) end diff --git a/lua/wire/stools/consolescreen.lua b/lua/wire/stools/consolescreen.lua index c3246f0c11..836b51e427 100644 --- a/lua/wire/stools/consolescreen.lua +++ b/lua/wire/stools/consolescreen.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "consolescreen", "Console Screen", "gmod_wire_consolescreen" if CLIENT then language.Add( "tool.wire_consolescreen.name", "Console Screen Tool (Wire)" ) language.Add( "tool.wire_consolescreen.desc", "Spawns a console screen" ) - language.Add( "tool.wire_consolescreen.0", "Primary: Create/Update screen" ) + TOOL.Information = { { name = "left", text = "Create " .. TOOL.Name } } WireToolSetup.setToolMenuIcon( "icon16/application_xp_terminal.png" ) end diff --git a/lua/wire/stools/cpu.lua b/lua/wire/stools/cpu.lua index 6504d824ac..59a2c61e36 100644 --- a/lua/wire/stools/cpu.lua +++ b/lua/wire/stools/cpu.lua @@ -2,10 +2,15 @@ WireToolSetup.setCategory( "Chips, Gates", "Advanced" ) WireToolSetup.open( "cpu", "CPU", "gmod_wire_cpu", nil, "CPUs" ) if CLIENT then - language.Add("Tool.wire_cpu.name", "CPU Tool (Wire)") - language.Add("Tool.wire_cpu.desc", "Spawns a central processing unit") - language.Add("Tool.wire_cpu.0", "Primary: upload program to hispeed device, Reload: attach debugger, Shift+Reload: clear, Secondary: open editor") - language.Add("ToolWirecpu_Model", "Model:" ) + language.Add("Tool.wire_cpu.name", "CPU Tool (Wire)") + language.Add("Tool.wire_cpu.desc", "Spawns a central processing unit") + language.Add("ToolWirecpu_Model", "Model:" ) + TOOL.Information = { + { name = "left", text = "Upload program to hispeed device" }, + { name = "right", text = "Open editor" }, + { name = "reload", text = "Attach debugger" }, + { name = "reload_shift", text = "Shift+Reload: Clear" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 7 ) diff --git a/lua/wire/stools/damage_detector.lua b/lua/wire/stools/damage_detector.lua index 32c3dc6df0..ae6d4392c5 100644 --- a/lua/wire/stools/damage_detector.lua +++ b/lua/wire/stools/damage_detector.lua @@ -4,8 +4,6 @@ WireToolSetup.open( "damage_detector", "Damage Detector", "gmod_wire_damage_dete if CLIENT then language.Add( "Tool.wire_damage_detector.name", "Damage Detector Tool (Wire)" ) language.Add( "Tool.wire_damage_detector.desc", "Spawns a damage detector for use with the wire system" ) - language.Add( "Tool.wire_damage_detector.0", "Primary: Create/Update Detector, Secondary: Link Detector to an entity, Reload: Unlink Detector" ) - language.Add( "Tool.wire_damage_detector.1", "Now select the entity to link to." ) language.Add( "Tool.wire_damage_detector.includeconstrained", "Include Constrained Props" ) end WireToolSetup.BaseLang() diff --git a/lua/wire/stools/data_satellitedish.lua b/lua/wire/stools/data_satellitedish.lua index 9a5704480a..2e4249d651 100644 --- a/lua/wire/stools/data_satellitedish.lua +++ b/lua/wire/stools/data_satellitedish.lua @@ -2,10 +2,8 @@ WireToolSetup.setCategory( "Memory" ) WireToolSetup.open( "data_satellitedish", "Satellite Dish", "gmod_wire_data_satellitedish", nil, "Satellite Dishs" ) if ( CLIENT ) then - language.Add( "Tool.wire_data_satellitedish.name", "Satellite Dish Tool (Wire)" ) - language.Add( "Tool.wire_data_satellitedish.desc", "Spawns a Satellite Dish." ) - language.Add( "Tool.wire_data_satellitedish.0", "Primary: Create Satellite Dish. Secondary: Link Satellite Dish. Reload: Unlink/Change model" ) - language.Add( "Tool.wire_data_satellitedish.1", "Now select the Wire Transferer to link to" ) + language.Add( "Tool.wire_data_satellitedish.name", "Satellite Dish Tool (Wire)" ) + language.Add( "Tool.wire_data_satellitedish.desc", "Spawns a Satellite Dish." ) end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) @@ -13,7 +11,7 @@ WireToolSetup.SetupMax( 20 ) TOOL.ClientConVar["model"] = "models/props_wasteland/prison_lamp001c.mdl" TOOL.ReloadSetsModel = true -WireToolSetup.SetupLinking(true) +WireToolSetup.SetupLinking(true, "Wire Transferer") function TOOL.BuildCPanel(panel) WireDermaExts.ModelSelect(panel, "wire_data_satellitedish_model", list.Get( "Wire_satellitedish_Models" ), 1) diff --git a/lua/wire/stools/data_store.lua b/lua/wire/stools/data_store.lua index 03138fe625..dc3911f068 100644 --- a/lua/wire/stools/data_store.lua +++ b/lua/wire/stools/data_store.lua @@ -2,10 +2,10 @@ WireToolSetup.setCategory( "Memory" ) WireToolSetup.open( "data_store", "Store", "gmod_wire_data_store", nil, "Data Stores" ) if ( CLIENT ) then - language.Add( "Tool.wire_data_store.name", "Data Store Tool (Wire)" ) - language.Add( "Tool.wire_data_store.desc", "Spawns a data store." ) - language.Add( "Tool.wire_data_store.0", "Primary: Create/Update data store" ) - language.Add( "WireDataStoreTool_data_store", "Data Store:" ) + language.Add( "Tool.wire_data_store.name", "Data Store Tool (Wire)" ) + language.Add( "Tool.wire_data_store.desc", "Spawns a data store." ) + language.Add( "WireDataStoreTool_data_store", "Data Store:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/data_transferer.lua b/lua/wire/stools/data_transferer.lua index 649ac59126..7c6d490681 100644 --- a/lua/wire/stools/data_transferer.lua +++ b/lua/wire/stools/data_transferer.lua @@ -2,14 +2,14 @@ WireToolSetup.setCategory( "Memory" ) WireToolSetup.open( "data_transferer", "Transferer", "gmod_wire_data_transferer", nil, "Transferers" ) if ( CLIENT ) then - language.Add( "Tool.wire_data_transferer.name", "Data Transferer Tool (Wire)" ) - language.Add( "Tool.wire_data_transferer.desc", "Spawns a data transferer." ) - language.Add( "Tool.wire_data_transferer.0", "Primary: Create/Update data transferer" ) - language.Add( "WireDataTransfererTool_data_transferer", "Data Transferer:" ) - language.Add( "WireDataTransfererTool_Range", "Max Range:" ) - language.Add( "WireDataTransfererTool_DefaultZero","Default To Zero") - language.Add( "WireDataTransfererTool_IgnoreZero","Ignore Zero") - language.Add( "WireDataTransfererTool_Model", "Choose a Model:") + language.Add( "Tool.wire_data_transferer.name", "Data Transferer Tool (Wire)" ) + language.Add( "Tool.wire_data_transferer.desc", "Spawns a data transferer." ) + language.Add( "WireDataTransfererTool_data_transferer", "Data Transferer:" ) + language.Add( "WireDataTransfererTool_Range", "Max Range:" ) + language.Add( "WireDataTransfererTool_DefaultZero","Default To Zero") + language.Add( "WireDataTransfererTool_IgnoreZero","Ignore Zero") + language.Add( "WireDataTransfererTool_Model", "Choose a Model:") + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/dataplug.lua b/lua/wire/stools/dataplug.lua index 48a8f8c4a3..42ce0f852f 100644 --- a/lua/wire/stools/dataplug.lua +++ b/lua/wire/stools/dataplug.lua @@ -2,15 +2,20 @@ WireToolSetup.setCategory( "Advanced" ) WireToolSetup.open( "dataplug", "Data - Plug/Socket", "gmod_wire_datasocket", nil, "Plugs and Sockets" ) if ( CLIENT ) then - language.Add( "Tool.wire_dataplug.name", "Data Plug Tool (Wire)" ) - language.Add( "Tool.wire_dataplug.desc", "Spawns plugs and sockets for use with the hi-speed wire system." ) - language.Add( "Tool.wire_dataplug.0", "Primary: Create/Update Socket Secondary: Create/Update Plug" ) + language.Add( "Tool.wire_dataplug.name", "Data Plug Tool (Wire)" ) + language.Add( "Tool.wire_dataplug.desc", "Spawns plugs and sockets for use with the hi-speed wire system." ) language.Add( "sboxlimit_wire_dataplugs", "You've hit plugs limit!" ) language.Add( "sboxlimit_wire_datasockets", "You've hit sockets limit!" ) language.Add( "undone_wiredataplug", "Undone Wire Data Plug" ) language.Add( "undone_wiredatasocket", "Undone Wire Data Socket" ) + TOOL.Information = { + { name = "left", text = "Create/Update " .. TOOL.Name }, + { name = "right", text = "Create/Update Plug" }, + } end +WireToolSetup.BaseLang() + if (SERVER) then CreateConVar('sbox_maxwire_dataplugs', 20) CreateConVar('sbox_maxwire_datasockets', 20) diff --git a/lua/wire/stools/dataport.lua b/lua/wire/stools/dataport.lua index f8e52c068e..6b86be0ce0 100644 --- a/lua/wire/stools/dataport.lua +++ b/lua/wire/stools/dataport.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "dataport", "Data - Port", "gmod_wire_dataport", nil, "Data if ( CLIENT ) then language.Add( "Tool.wire_dataport.name", "Data port tool (Wire)" ) language.Add( "Tool.wire_dataport.desc", "Spawns data port consisting of 8 ports" ) - language.Add( "Tool.wire_dataport.0", "Primary: Create/Update data ports unit" ) + TOOL.Information = { { name = "left", text = "Create/Update data port" } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/datarate.lua b/lua/wire/stools/datarate.lua index ec1be34701..7c48c6f8d2 100644 --- a/lua/wire/stools/datarate.lua +++ b/lua/wire/stools/datarate.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "datarate", "Data - Transfer Bus", "gmod_wire_datarate", nil if ( CLIENT ) then language.Add( "Tool.wire_datarate.name", "Data transfer bus tool (Wire)" ) language.Add( "Tool.wire_datarate.desc", "Spawns a data transferrer. Data transferrer acts like identity gate for hi-speed and regular links" ) - language.Add( "Tool.wire_datarate.0", "Primary: Create/Update data trasnferrer" ) + TOOL.Information = { { name = "left", text = "Create/Update data transferrer" } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/detonator.lua b/lua/wire/stools/detonator.lua index c414a858f1..c5631faf5c 100644 --- a/lua/wire/stools/detonator.lua +++ b/lua/wire/stools/detonator.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "detonator", "Detonator", "gmod_wire_detonator", nil, "Deton if CLIENT then language.Add( "tool.wire_detonator.name", "Detonator Tool (Wire)" ) language.Add( "tool.wire_detonator.desc", "Spawns a Detonator for use with the wire system." ) - language.Add( "tool.wire_detonator.0", "Primary: Create/Update Detonator" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/dhdd.lua b/lua/wire/stools/dhdd.lua index d5ca749129..cb7c17c2a6 100644 --- a/lua/wire/stools/dhdd.lua +++ b/lua/wire/stools/dhdd.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "dhdd", "DHDD", "gmod_wire_dhdd", nil, "DHDDs" ) if CLIENT then language.Add( "Tool.wire_dhdd.name", "DHDD Tool (Wire)" ) language.Add( "Tool.wire_dhdd.desc", "Spawns a dupeable hard drive gate for use with the wire system." ) - language.Add( "Tool.wire_dhdd.0", "Primary: Create DHDD." ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } language.Add( "Tool.wire_dhdd.weld", "Weld the DHDD." ) language.Add( "Tool.wire_dhdd.weldtoworld", "Weld the DHDD to the world." ) diff --git a/lua/wire/stools/digitalscreen.lua b/lua/wire/stools/digitalscreen.lua index 0c60b905c8..8f3cc9099c 100644 --- a/lua/wire/stools/digitalscreen.lua +++ b/lua/wire/stools/digitalscreen.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "digitalscreen", "Digital Screen", "gmod_wire_digitalscreen" if CLIENT then language.Add( "tool.wire_digitalscreen.name", "Digital Screen Tool (Wire)" ) language.Add( "tool.wire_digitalscreen.desc", "Spawns a digital screen, which can be used to draw pixel by pixel." ) - language.Add( "tool.wire_digitalscreen.0", "Primary: Create/Update screen" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/dual_input.lua b/lua/wire/stools/dual_input.lua index eede9e2899..601caa21a5 100644 --- a/lua/wire/stools/dual_input.lua +++ b/lua/wire/stools/dual_input.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "dual_input", "Dual Input", "gmod_wire_dual_input", nil, "Du if CLIENT then language.Add( "tool.wire_dual_input.name", "Dual Input Tool (Wire)" ) language.Add( "tool.wire_dual_input.desc", "Spawns a daul input for use with the wire system." ) - language.Add( "tool.wire_dual_input.0", "Primary: Create/Update Input" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } language.Add( "WireDualInputTool_keygroup", "Key 1:" ) language.Add( "WireDualInputTool_keygroup2", "Key 2:" ) language.Add( "WireDualInputTool_toggle", "Toggle" ) @@ -12,7 +12,7 @@ if CLIENT then language.Add( "WireDualInputTool_value_on2", "Value 2 On:" ) language.Add( "WireDualInputTool_value_off", "Value Off:" ) end -WireToolSetup.BaseLang("Dual Inputs") +WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if SERVER then diff --git a/lua/wire/stools/dynamic_button.lua b/lua/wire/stools/dynamic_button.lua index 6bbb5e8085..aa7029717b 100644 --- a/lua/wire/stools/dynamic_button.lua +++ b/lua/wire/stools/dynamic_button.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "dynamic_button", "Dynamic Button", "gmod_wire_dynamic_butto if CLIENT then language.Add( "tool.wire_dynamic_button.name", "Dynamic Button Tool (Wire)" ) language.Add( "tool.wire_dynamic_button.desc", "Spawns a dynamic button for use with the wire system." ) - language.Add( "tool.wire_dynamic_button.0", "Primary: Create/Update Dynamic Button" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } language.Add( "WireDynamicButtonTool_toggle", "Toggle" ) language.Add( "WireDynamicButtonTool_entityout", "Output Entity" ) language.Add( "WireDynamicButtonTool_value_on", "Value On:" ) @@ -14,7 +14,7 @@ if CLIENT then language.Add( "WireDynamicButtonTool_colour_on", "Color On:" ) language.Add( "WireDynamicButtonTool_colour_off", "Color Off:" ) end -WireToolSetup.BaseLang("Dynamic Buttons") +WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if SERVER then diff --git a/lua/wire/stools/egp.lua b/lua/wire/stools/egp.lua index 4b24bbcff9..7af86277f2 100644 --- a/lua/wire/stools/egp.lua +++ b/lua/wire/stools/egp.lua @@ -17,6 +17,7 @@ if (SERVER) then local function SpawnEnt( ply, Pos, Ang, model, class) if IsValid(ply) and (!ply:CheckLimit("wire_egps")) then return false end if not ply then ply = game.GetWorld() end -- For Garry's Map Saver + if model and not WireLib.CanModel(ply, model) then return false end local ent = ents.Create(class) if (model) then ent:SetModel(model) end ent:SetAngles(Ang) @@ -127,8 +128,10 @@ end if CLIENT then language.Add( "Tool.wire_egp.name", "E2 Graphics Processor" ) - language.Add( "Tool.wire_egp.desc", "EGP Tool" ) - language.Add( "Tool.wire_egp.0", "Primary: Create EGP Screen/HUD/Emitter, Secondary: Link EGP HUD to vehicle, Reload: Open the Reload Menu for several lag fixing options." ) + language.Add( "Tool.wire_egp.desc", "EGP Tool" ) + language.Add( "Tool.wire_egp.left_0", "Create EGP Screen/HUD/Emitter" ) + language.Add( "Tool.wire_egp.right_0", "Link EGP HUD to vehicle" ) + language.Add( "Tool.wire_egp.reload_0", "Open the Reload Menu for several lag fixing options" ) language.Add( "Tool.wire_egp.1", "Now right click a vehicle." ) language.Add( "sboxlimit_wire_egps", "You've hit the EGP limit!" ) language.Add( "Undone_wire_egp", "Undone EGP" ) @@ -140,7 +143,7 @@ if CLIENT then language.Add( "Tool_wire_egp_emitter_drawdist", "Additional emitter draw distance (Clientside)" ) end -WireToolSetup.SetupLinking() -- Generates RightClick, Reload, and DrawHUD functions +WireToolSetup.SetupLinking(false, "vehicle") -- Generates RightClick, Reload, and DrawHUD functions function TOOL:CheckHitOwnClass( trace ) return IsValid(trace.Entity) and trace.Entity:GetClass() == "gmod_wire_egp_hud" -- We only need linking for the hud @@ -406,4 +409,4 @@ function TOOL:Think() self.GhostEntity.Type = Type end self:UpdateGhost( self.GhostEntity, self:GetOwner() ) -end \ No newline at end of file +end diff --git a/lua/wire/stools/emarker.lua b/lua/wire/stools/emarker.lua index 251fcd15ea..9aa52dd71b 100644 --- a/lua/wire/stools/emarker.lua +++ b/lua/wire/stools/emarker.lua @@ -4,8 +4,12 @@ WireToolSetup.open( "emarker", "Entity Marker", "gmod_wire_emarker", nil, "Entit if CLIENT then language.Add( "Tool.wire_emarker.name", "Entity Marker Tool (Wire)" ) language.Add( "Tool.wire_emarker.desc", "Spawns an Entity Marker for use with the wire system." ) - language.Add( "Tool.wire_emarker.0", "Primary: Create Entity Marker/Display Link Info, Secondary: Link Entity Marker, Reload: Unlink Entity Marker" ) - language.Add( "Tool.wire_emarker.1", "Now select the entity to link to.") + TOOL.Information = { + { name = "left_0", stage = 0, text = "Create Entity Marker/Display Link Info" }, + { name = "right_0", stage = 0, text = "Link Entity Marker" }, + { name = "reload_0", stage = 0, text = "Unlink Entity Marker" }, + { name = "right_1", stage = 1, text = "Now select the entity to link to" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 30 ) @@ -35,8 +39,8 @@ function TOOL:LeftClick(trace) end ply:PrintMessage( HUD_PRINTTALK, "Linked model: " .. self.marker.mark:GetModel() ) - self:GetWeapon():SetNetworkedEntity( "WireEntityMark", self.marker.mark ) - self:GetWeapon():SetNetworkedEntity( "WireEntityMarker", self.marker ) + self:GetWeapon():SetNWEntity( "WireEntityMark", self.marker.mark ) + self:GetWeapon():SetNWEntity( "WireEntityMarker", self.marker ) else local ent = self:LeftClick_Make( trace, ply ) return self:LeftClick_PostMake( ent, ply, trace ) @@ -56,8 +60,8 @@ function TOOL:RightClick(trace) self.marker:LinkEMarker(trace.Entity) self:SetStage(0) self:GetOwner():PrintMessage( HUD_PRINTTALK,"Entity Marker linked" ) - self:GetWeapon():SetNetworkedEntity( "WireEntityMark", self.marker.mark ) - self:GetWeapon():SetNetworkedEntity( "WireEntityMarker", self.marker ) + self:GetWeapon():SetNWEntity( "WireEntityMark", self.marker.mark ) + self:GetWeapon():SetNWEntity( "WireEntityMarker", self.marker ) return true else return false @@ -74,15 +78,15 @@ function TOOL:Reload(trace) if (marker:GetClass() == "gmod_wire_emarker") then marker:UnLinkEMarker() self:GetOwner():PrintMessage( HUD_PRINTTALK,"Entity Marker unlinked" ) - self:GetWeapon():SetNetworkedEntity( "WireEntityMark", self.marker ) // Substitute for null, which won't set - self:GetWeapon():SetNetworkedEntity( "WireEntityMarker", self.marker ) // Set same point so line won't draw + self:GetWeapon():SetNWEntity( "WireEntityMark", self.marker ) // Substitute for null, which won't set + self:GetWeapon():SetNWEntity( "WireEntityMarker", self.marker ) // Set same point so line won't draw return true end end function TOOL:DrawHUD() - local mark = self:GetWeapon():GetNetworkedEntity( "WireEntityMark" ) - local marker = self:GetWeapon():GetNetworkedEntity( "WireEntityMarker" ) + local mark = self:GetWeapon():GetNWEntity( "WireEntityMark" ) + local marker = self:GetWeapon():GetNWEntity( "WireEntityMarker" ) if not IsValid(mark) or not IsValid(marker) then return end local markerpos = marker:GetPos():ToScreen() diff --git a/lua/wire/stools/exit_point.lua b/lua/wire/stools/exit_point.lua index 1a0b6ff2f3..1ce4a83b5f 100644 --- a/lua/wire/stools/exit_point.lua +++ b/lua/wire/stools/exit_point.lua @@ -4,7 +4,6 @@ WireToolSetup.open( "exit_point", "Vehicle Exit Point", "gmod_wire_exit_point", if CLIENT then language.Add( "tool."..TOOL.Mode..".name", TOOL.Name.." Tool (Wire)" ) language.Add( "tool."..TOOL.Mode..".desc", "Spawns a "..TOOL.Name ) - language.Add( "tool."..TOOL.Mode..".0", "Primary: Create "..TOOL.Name.."" ) WireToolSetup.setToolMenuIcon( "icon16/door_out.png" ) end @@ -15,7 +14,7 @@ TOOL.ClientConVar = { model = "models/jaanus/wiretool/wiretool_range.mdl", } -WireToolSetup.SetupLinking() +WireToolSetup.SetupLinking(false, "vehicle") function TOOL.BuildCPanel(panel) ModelPlug_AddToCPanel(panel, "Misc_Tools", "wire_exit_point", true) diff --git a/lua/wire/stools/explosive.lua b/lua/wire/stools/explosive.lua index a0a79f415b..10c16c3e5e 100644 --- a/lua/wire/stools/explosive.lua +++ b/lua/wire/stools/explosive.lua @@ -26,7 +26,6 @@ TOOL.ReloadSetsModel = true if ( CLIENT ) then language.Add( "Tool.wire_explosive.name", "Wired Explosives Tool" ) language.Add( "Tool.wire_explosive.desc", "Creates a variety of different explosives for wire system." ) - language.Add( "Tool.wire_explosive.0", "Left click to place the bomb. Right click update." ) language.Add( "Tool.wire_explosive.trigger", "Trigger value:" ) language.Add( "Tool.wire_explosive.damage", "Damage:" ) language.Add( "Tool.wire_explosive.radius", "Blast radius:" ) @@ -43,6 +42,10 @@ if ( CLIENT ) then language.Add( "Tool.wire_explosive.fireeffect", "Enable fire effect on triggered" ) language.Add( "Tool.wire_explosive.coloreffect", "Enable color change effect on damage" ) language.Add( "Tool.wire_explosive.invisibleatzero", "Become invisible when health reaches 0" ) + TOOL.Information = { + { name = "left", text = "Create " .. TOOL.Name }, + { name = "right", text = "Update " .. TOOL.Name }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) diff --git a/lua/wire/stools/expression2.lua b/lua/wire/stools/expression2.lua index e1b54327cf..f4fe1bb709 100644 --- a/lua/wire/stools/expression2.lua +++ b/lua/wire/stools/expression2.lua @@ -4,9 +4,13 @@ WireToolSetup.open("expression2", "Expression 2", "gmod_wire_expression2", nil, if CLIENT then language.Add("Tool.wire_expression2.name", "Expression 2 Tool (Wire)") language.Add("Tool.wire_expression2.desc", "Spawns an Expression 2 chip for use with the wire system.") - language.Add("Tool.wire_expression2.0", "Primary: Create/Update Expression, Secondary: Open Expression in Editor") language.Add("sboxlimit_wire_expressions", "You've hit the Expression limit!") + TOOL.Information = { + { name = "left", text = "Create " .. TOOL.Name }, + { name = "right", text = "Open " .. TOOL.Name .. " in Editor" }, + } + --WireToolSetup.setToolMenuIcon( "beer/wiremod/gate_e2" ) WireToolSetup.setToolMenuIcon( "vgui/e2logo" ) end diff --git a/lua/wire/stools/extbus.lua b/lua/wire/stools/extbus.lua index 4f3336d8da..5c4c8a9c67 100644 --- a/lua/wire/stools/extbus.lua +++ b/lua/wire/stools/extbus.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "extbus", "Data - Extended Bus", "gmod_wire_extbus", nil, "E if ( CLIENT ) then language.Add( "Tool.wire_extbus.name", "Extended bus tool (Wire)" ) language.Add( "Tool.wire_extbus.desc", "Spawns an extended bus (programmable address bus)" ) - language.Add( "Tool.wire_extbus.0", "Primary: Create/Update extended bus" ) + TOOL.Information = { { name = "left", text = "Create/Update extended bus" } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/eyepod.lua b/lua/wire/stools/eyepod.lua index c7094567b4..c1b89af76d 100644 --- a/lua/wire/stools/eyepod.lua +++ b/lua/wire/stools/eyepod.lua @@ -3,10 +3,15 @@ WireToolSetup.open( "eyepod", "Eye Pod", "gmod_wire_eyepod", nil, "Eye Pods" ) if ( CLIENT ) then //tool hud lang - language.Add( "Tool.wire_eyepod.name", "Eye Pod Tool (Wire)" ) - language.Add( "Tool.wire_eyepod.desc", "Spawns an Eye Pod Mouse Controller." ) - language.Add( "Tool.wire_eyepod.0", "Primary: Create/Update Controller Secondary: Link controller Reload: Unlink EyePod/Cancel Current Link" ) - language.Add( "Tool.wire_eyepod.1", "Now select the pod to link to.") + language.Add( "Tool.wire_eyepod.name", "Eye Pod Tool (Wire)" ) + language.Add( "Tool.wire_eyepod.desc", "Spawns an Eye Pod Mouse Controller." ) + TOOL.Information = { + { name = "left_0", stage = 0, text = "Create/Update Controller" }, + { name = "right_0", stage = 0, text = "Link controller" }, + { name = "reload_0", stage = 0, text = "Unlink EyePod" }, + { name = "right_1", stage = 1, text = "Now right click a vehicle" }, + { name = "reload_1", stage = 1, text = "Cancel Current Link" }, + } //panel control lang language.Add( "WireEyePod_DefaultToZero", "Default Outputs To Zero When Inactive" ) diff --git a/lua/wire/stools/forcer.lua b/lua/wire/stools/forcer.lua index 1111261316..ed8c837a65 100644 --- a/lua/wire/stools/forcer.lua +++ b/lua/wire/stools/forcer.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "forcer", "Forcer", "gmod_wire_forcer", nil, "Forcers" ) if CLIENT then language.Add( "tool.wire_forcer.name", "Forcer Tool (Wire)" ) language.Add( "tool.wire_forcer.desc", "Spawns a forcer prop for use with the wire system." ) - language.Add( "tool.wire_forcer.0", "Primary: Create/Update Forcer" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/friendslist.lua b/lua/wire/stools/friendslist.lua new file mode 100644 index 0000000000..a686e3652d --- /dev/null +++ b/lua/wire/stools/friendslist.lua @@ -0,0 +1,261 @@ +WireToolSetup.setCategory( "Input, Output" ) +WireToolSetup.open( "friendslist", "Friends List", "gmod_wire_friendslist", nil, "Friends Lists" ) + +if CLIENT then + language.Add( "tool.wire_friendslist.name", "Friends List Tool (Wire)" ) + language.Add( "tool.wire_friendslist.desc", "Spawns a friends list entity for use with the wire system." ) + + TOOL.Information = { + { name = "left", text = "Create/Update " .. TOOL.Name }, + { name = "right", text = "Copy settings" }, + } + + language.Add( "wire_friendslist_save_on_entity", "Save On Entity" ) + language.Add( "wire_friendslist_save_on_entity_tooltip", "When enabled, the friends list will be saved on the entity and carried across in dupes. When disabled, the friends list will mirror any changes you make in this UI." ) + language.Add( "wire_friendslist_invalid_steamid", "Invalid SteamID" ) + language.Add( "wire_friendslist_connected_players", "Currently connected players" ) + language.Add( "wire_friendslist_not_connected", "Not Connected" ) + + + WireToolSetup.setToolMenuIcon( "icon16/group.png" ) +end +WireToolSetup.BaseLang() +WireToolSetup.SetupMax(8) + +TOOL.ClientConVar = { + model = "models/kobilica/value.mdl", + save_on_entity = 0 +} + +local friends = {} + +if SERVER then + util.AddNetworkString( "wire_friendslist" ) + net.Receive( "wire_friendslist", function( length, ply ) + friends[ply] = net.ReadTable() + + -- Update all friendslists which have save_on_entity set to false + local friendslists = ents.FindByClass( "gmod_wire_friendslist" ) + for i=1,#friendslists do + local ent = friendslists[i] + if ent:GetPlayer() == ply then + ent:UpdateFriendslist( friends[ply] or {} ) + end + end + end) + + function TOOL:GetConVars() + return self:GetClientNumber( "save_on_entity" ) ~= 0, friends[self:GetOwner()] or {} + end + + hook.Add( "OnEntityCreated", "wire_friendslist_created", function( ent ) + if ent:GetClass() == "gmod_wire_friendslist" then + timer.Simple( 0, function() -- wait for wire to set the GetPlayer variable + if IsValid( ent ) then + ent:UpdateFriendslist( friends[ent:GetPlayer()] or {} ) + end + end) + end + end) + + -- Right click to copy + function TOOL:RightClick(trace) + if not self:CheckHitOwnClass(trace) then return false end + + friends[self:GetOwner()] = trace.Entity.steamids + net.Start( "wire_friendslist" ) + net.WriteTable( trace.Entity.steamids ) + net.Send( self:GetOwner() ) + end +else + function TOOL:RightClick(trace) + return self:CheckHitOwnClass(trace) + end + + local function loadFile() + if not file.Exists( "wire_friendslist.txt", "DATA" ) then return {} end + local str = file.Read( "wire_friendslist.txt", "DATA" ) + local t = string.Explode( ",", str ) + + local ret = {} + for i=1,#t do + local str = string.Trim(t[i]) + if string.match( str, "^STEAM_%d:%d:%d+$") ~= nil then + ret[#ret+1] = str + end + end + + return ret + end + + local function saveFile( friends ) + file.Write( "wire_friendslist.txt", table.concat(friends,",") ) + end + + local function sendFriends( dontsave ) + if #friends == 0 then return end + + net.Start("wire_friendslist") + net.WriteTable(friends) + net.SendToServer() + + if not dontsave then + saveFile( friends ) + end + end + + -- Receive values for copying + local cpanel_list + net.Receive( "wire_friendslist", function( length ) + friends = net.ReadTable() + saveFile( friends ) + + if not IsValid(cpanel_list) then -- They right clicked without opening the cpanel first, just save the values + return + end + + cpanel_list:Clear() + for i=1,#friends do + local ply = player.GetBySteamID( friends[i] ) + local col2 = "#wire_friendslist_not_connected" + if IsValid(ply) then col2 = ply:Nick() end + cpanel_list:AddLine( friends[i], col2 ) + end + end) + + local function addSteamID( steamid ) + for i=1,#friends do + if friends[i] == steamid then return false end + end + + if string.match( steamid, "^STEAM_%d:%d:%d+$") == nil then + WireLib.AddNotify( LocalPlayer(), "#wire_friendslist_invalid_steamid", NOTIFY_ERROR, 8, NOTIFYSOUND_ERROR1 ) + return false + end + + friends[#friends+1] = steamid + sendFriends() + return true + end + + local function removeSteamID( steamid ) + for i=1,#friends do + if friends[i] == steamid then + table.remove( friends, i ) + return true + end + end + return false + end + + hook.Add( "Initialize", "wire_friendslist_init", function() + timer.Simple( 5, function() + friends = loadFile() + sendFriends( true ) + end) + end) + + function TOOL.BuildCPanel(panel) + -- Use the same models as the wire constant value + WireToolHelpers.MakeModelSizer(panel, "wire_friendslist_modelsize") + ModelPlug_AddToCPanel(panel, "Value", "wire_friendslist", true) + + local save_on_entity = panel:CheckBox( "#wire_friendslist_save_on_entity", "wire_friendslist_save_on_entity" ) + save_on_entity:SetToolTip( "#wire_friendslist_save_on_entity_tooltip" ) + + local pnl = vgui.Create( "DPanel", panel ) + pnl:Dock( TOP ) + pnl:DockMargin( 2,2,2,2 ) + pnl:DockPadding( 2,2,2,2 ) + + local list = vgui.Create( "DListView", pnl ) + list:AddColumn( "SteamID" ) + list:AddColumn( "Name" ) + list:SetMultiSelect( false ) + list:Dock( TOP ) + list:SetHeight( 200 ) + cpanel_list = list + + local txt = vgui.Create( "DTextEntry", pnl ) + txt:Dock( TOP ) + + local btn_add = vgui.Create( "DButton", pnl ) + btn_add:Dock( TOP ) + btn_add:SetText( "Add" ) + + function btn_add:DoClick() + local steamid = string.upper(string.Trim(txt:GetValue())) + + if addSteamID( steamid ) then + local ply = player.GetBySteamID( steamid ) + local col2 = "#wire_friendslist_not_connected" + if IsValid(ply) then col2 = ply:Nick() end + list:AddLine( steamid, col2 ) + + txt:SetValue( "" ) + end + end + + local btn_remove = vgui.Create( "DButton", pnl ) + btn_remove:Dock( TOP ) + btn_remove:SetText( "Remove" ) + + function btn_remove:DoClick() + local selected = list:GetSelectedLine() + + if selected then + local steamid = list:GetLine( selected ):GetColumnText( 1 ) + list:RemoveLine( selected ) + + if removeSteamID( steamid ) then + sendFriends() + end + end + end + + for i=1,#friends do + local ply = player.GetBySteamID( friends[i] ) + local col2 = "#wire_friendslist_not_connected" + if IsValid(ply) then col2 = ply:Nick() end + list:AddLine( friends[i], col2 ) + end + + local pnl2 = vgui.Create( "DPanel", panel ) + pnl2:Dock( TOP ) + pnl2:DockMargin( 2,2,2,2 ) + pnl2:DockPadding( 2,2,2,2 ) + + local lbl = vgui.Create( "DLabel", pnl2 ) + lbl:SetText( "#wire_friendslist_connected_players" ) + lbl:SizeToContents() + lbl:Dock( TOP ) + lbl:SetTextColor( Color(0,0,0,255) ) + + local connected_list = vgui.Create( "DListView", pnl2 ) + connected_list:Dock( TOP ) + connected_list:AddColumn( "SteamID" ) + connected_list:AddColumn( "Name" ) + connected_list:SetHeight( 200 ) + + function connected_list:OnRowSelected( index, row ) + txt:SetValue(row:GetColumnText( 1 )) + end + + local refresh = vgui.Create( "DButton", pnl2 ) + refresh:Dock( TOP ) + refresh:SetText( "Refresh" ) + function refresh:DoClick() + connected_list:Clear() + local plys = player.GetHumans() + for i=1,#plys do + connected_list:AddLine( plys[i]:SteamID(), plys[i]:Nick() ) + end + end + + refresh:DoClick() + + -- wanted to use SizeToContents here but it didn't work, thanks garry + pnl:SetHeight( 268 ) + pnl2:SetHeight( 240 ) + end +end diff --git a/lua/wire/stools/fx_emitter.lua b/lua/wire/stools/fx_emitter.lua index a89de9984b..60603af277 100644 --- a/lua/wire/stools/fx_emitter.lua +++ b/lua/wire/stools/fx_emitter.lua @@ -4,8 +4,8 @@ WireToolSetup.open( "fx_emitter", "FX Emitter", "gmod_wire_fx_emitter", nil, "FX if ( CLIENT ) then language.Add( "Tool.wire_fx_emitter.name", "Wire FX Emitter" ) language.Add( "Tool.wire_fx_emitter.desc", "Wire FX Emitter Emits effects eh?" ) - language.Add( "Tool.wire_fx_emitter.0", "Click somewhere to spawn a wire fx emitter. Click on an existing wire fx emitter to update it." ) language.Add( "Tool.wire_fx_emitter.delay", "Delay between effect pulses" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/gates.lua b/lua/wire/stools/gates.lua index 20e79a19cb..6b2b343e83 100644 --- a/lua/wire/stools/gates.lua +++ b/lua/wire/stools/gates.lua @@ -2,7 +2,6 @@ WireToolSetup.setCategory( "Chips, Gates" ) WireToolSetup.open( "gates", "Gates", "gmod_wire_gate", nil, "Gates" ) -WireToolSetup.BaseLang() WireToolSetup.SetupMax(100) if SERVER then @@ -16,7 +15,6 @@ if CLIENT then language.Add( "Tool.wire_gates.name", "Gates Tool (Wire)" ) language.Add( "Tool.wire_gates.desc", "Spawns gates for use with the wire system." ) - language.Add( "Tool.wire_gates.0", "Primary: Create/Update Gate, Secondary: Copy Gate, Reload: Increase angle offset by 45 degrees, Shift+Reload: Unparent gate (If parented)." ) TOOL.ClientConVar["model"] = "models/jaanus/wiretool/wiretool_gate.mdl" TOOL.ClientConVar["parent"] = 0 @@ -33,6 +31,13 @@ if CLIENT then WireToolSetup.setToolMenuIcon( "bull/gates/gate_logic_and" ) + TOOL.Information = { + { name = "left", text = "Create/Update Gate" }, + { name = "right", text = "Copy Gate" }, + { name = "reload", text = "Increase angle offset by 45 degrees" }, + { name = "reload_shift", text = "Shift+Reload: Unparent gate (If parented)" }, + } + function TOOL.BuildCPanel( panel ) ----------------- GATE SELECTION & SEARCHING @@ -242,6 +247,8 @@ if CLIENT then end end +WireToolSetup.BaseLang() + if SERVER then function TOOL:GetConVars() return self:GetClientInfo( "action" ), self:GetClientNumber( "noclip" ) == 1 diff --git a/lua/wire/stools/gimbal.lua b/lua/wire/stools/gimbal.lua index b97e64adc4..f488f35508 100644 --- a/lua/wire/stools/gimbal.lua +++ b/lua/wire/stools/gimbal.lua @@ -4,7 +4,11 @@ WireToolSetup.open( "gimbal", "Gimbal (Facer)", "gmod_wire_gimbal", nil, "Gimbal if CLIENT then language.Add( "tool.wire_gimbal.name", "Gimbal Tool (Wire)" ) language.Add( "tool.wire_gimbal.desc", "Spawns a Gimbal (Facer)" ) - language.Add( "tool.wire_gimbal.0", "Primary: Create Gimbal, Reload: Copy model" ) + + TOOL.Information = { + { name = "left", text = "Create/Update Gimbal" }, + { name = "reload", text = "Copy model" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 8 ) diff --git a/lua/wire/stools/gps.lua b/lua/wire/stools/gps.lua index 63121964c5..3af6971ba0 100644 --- a/lua/wire/stools/gps.lua +++ b/lua/wire/stools/gps.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "gps", "GPS", "gmod_wire_gps", nil, "GPSs" ) if CLIENT then language.Add( "Tool.wire_gps.name", "GPS Tool (Wire)" ) language.Add( "Tool.wire_gps.desc", "Spawns a GPS for use with the wire system." ) - language.Add( "Tool.wire_gps.0", "Primary: Create/Update GPS" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } WireToolSetup.setToolMenuIcon( "icon16/world.png" ) end diff --git a/lua/wire/stools/gpu.lua b/lua/wire/stools/gpu.lua index 369a00b322..a663b6f140 100644 --- a/lua/wire/stools/gpu.lua +++ b/lua/wire/stools/gpu.lua @@ -4,8 +4,12 @@ WireToolSetup.open( "gpu", "GPU", "gmod_wire_gpu", nil, "GPUs" ) if CLIENT then language.Add("Tool.wire_gpu.name", "GPU Tool (Wire)") language.Add("Tool.wire_gpu.desc", "Spawns a graphics processing unit") - language.Add("Tool.wire_gpu.0", "Primary: create/reflash ZGPU or other hispeed device, Secondary: open editor and/or attach debugger to the ZGPU") language.Add("ToolWiregpu_Model", "Model:" ) + TOOL.Information = { + { name = "left", text = "Upload program to hispeed device" }, + { name = "right", text = "open editor and/or attach debugger to the ZGPU" }, + { name = "reload", text = "Wipe ROM/RAM and reset memory model" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 7 ) diff --git a/lua/wire/stools/gpulib_switcher.lua b/lua/wire/stools/gpulib_switcher.lua index 62b0f159fd..7e49c929aa 100644 --- a/lua/wire/stools/gpulib_switcher.lua +++ b/lua/wire/stools/gpulib_switcher.lua @@ -6,8 +6,13 @@ TOOL.ClientConVar[ "model" ] = "models/jaanus/wiretool/wiretool_siren.mdl" if (CLIENT) then language.Add("Tool.wire_gpulib_switcher.name", "GPULib Screen Switcher") language.Add("Tool.wire_gpulib_switcher.desc", "Displays one entity's GPULib screen on another entity.") - language.Add("Tool.wire_gpulib_switcher.0", "Primary: Link a GPULib Screen (Console/Digital/Text Screen/GPU/Oscilloscope) to a different prop/entity, Reload: Unlink") - language.Add("Tool.wire_gpulib_switcher.1", "Primary: Link selected GPULib Screen to this prop/entity, Secondary: Place GPULib controller for the selected screen, Reload: Cancel") + TOOL.Information = { + { name = "left_0", stage = 0, text = "Link a GPULib Screen (Console/Digital/Text Screen/GPU/Oscilloscope) to a different prop/entity" }, + { name = "right_0", stage = 0, text = "Unlink a screen" }, + { name = "left_1", stage = 1, text = "Link selected GPULib Screen to this prop/entity" }, + { name = "right_1", stage = 1, text = "Place GPULib controller for the selected screen" }, + { name = "reload_1", stage = 1, text = "Cancel" }, + } function TOOL.BuildCPanel(panel) panel:AddControl("Header", { Text = "#Tool.wire_gpulib_switcher.name", Description = "#Tool.wire_gpulib_switcher.desc" }) @@ -88,3 +93,5 @@ elseif SERVER then end end -- if SERVER + +WireToolSetup.BaseLang() \ No newline at end of file diff --git a/lua/wire/stools/grabber.lua b/lua/wire/stools/grabber.lua index ae2e36c156..e0a8896b6e 100644 --- a/lua/wire/stools/grabber.lua +++ b/lua/wire/stools/grabber.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "grabber", "Grabber", "gmod_wire_grabber", nil, "Grabbers" ) if CLIENT then language.Add( "tool.wire_grabber.name", "Grabber Tool (Wire)" ) language.Add( "tool.wire_grabber.desc", "Spawns a constant grabber prop for use with the wire system." ) - language.Add( "tool.wire_grabber.0", "Primary: Create/Update Grabber. Secondary: Link grabber to a prop that'll also be welded for stability" ) + language.Add( "tool.wire_grabber.right_0", "Link grabber to a prop that'll also be welded for stability" ) language.Add( "WireGrabberTool_Range", "Max Range:" ) language.Add( "WireGrabberTool_Gravity", "Disable Gravity" ) end @@ -25,7 +25,7 @@ TOOL.ClientConVar = { Gravity = 1, } -WireToolSetup.SetupLinking(true) +WireToolSetup.SetupLinking(true, "prop") function TOOL:GetGhostMin( min ) if self:GetModel() == "models/jaanus/wiretool/wiretool_grabber_forcer.mdl" then diff --git a/lua/wire/stools/graphics_tablet.lua b/lua/wire/stools/graphics_tablet.lua index a51f45964b..d7a2d3da18 100644 --- a/lua/wire/stools/graphics_tablet.lua +++ b/lua/wire/stools/graphics_tablet.lua @@ -8,12 +8,12 @@ WireToolSetup.setCategory( "Input, Output/Mouse Interaction" ) WireToolSetup.open( "graphics_tablet", "Graphics Tablet", "gmod_wire_graphics_tablet", nil, "Graphics Tablet" ) if ( CLIENT ) then - language.Add( "Tool.wire_graphics_tablet.name", "Graphics Tablet Tool (Wire)" ) - language.Add( "Tool.wire_graphics_tablet.desc", "Spawns a graphics tablet, which outputs cursor coordinates" ) - language.Add( "Tool.wire_graphics_tablet.0", "Primary: Create/Update graphics tablet" ) + language.Add( "Tool.wire_graphics_tablet.name", "Graphics Tablet Tool (Wire)" ) + language.Add( "Tool.wire_graphics_tablet.desc", "Spawns a graphics tablet, which outputs cursor coordinates" ) language.Add( "Tool_wire_graphics_tablet_mode", "Output mode: -1 to 1 (ticked), 0 to 1 (unticked)" ) language.Add( "Tool_wire_graphics_tablet_draw_background", "Draw background" ) language.Add( "Tool_wire_graphics_tablet_createflat", "Create flat to surface" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/gyroscope.lua b/lua/wire/stools/gyroscope.lua index a093978b41..8dd47299fc 100644 --- a/lua/wire/stools/gyroscope.lua +++ b/lua/wire/stools/gyroscope.lua @@ -4,8 +4,8 @@ WireToolSetup.open( "gyroscope", "Gyroscope", "gmod_wire_gyroscope", nil, "Gyros if CLIENT then language.Add( "Tool.wire_gyroscope.name", "Gyroscope Tool (Wire)" ) language.Add( "Tool.wire_gyroscope.desc", "Spawns a gyroscope for use with the wire system." ) - language.Add( "Tool.wire_gyroscope.0", "Primary: Create/Update Gyroscope" ) language.Add( "Tool.wire_gyroscope.out180", "Output -180 to 180 instead of 0 to 360" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) diff --git a/lua/wire/stools/hdd.lua b/lua/wire/stools/hdd.lua index 28990fb3b9..9acfbb2a63 100644 --- a/lua/wire/stools/hdd.lua +++ b/lua/wire/stools/hdd.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "hdd", "Memory - Flash EEPROM", "gmod_wire_hdd", nil, "Flash if ( CLIENT ) then language.Add( "Tool.wire_hdd.name", "Flash (EEPROM) tool (Wire)" ) language.Add( "Tool.wire_hdd.desc", "Spawns flash memory. It is used for permanent storage of data (carried over sessions)" ) - language.Add( "Tool.wire_hdd.0", "Primary: Create/Update flash memory" ) + TOOL.Information = { { name = "left", text = "Create/Update flash memory" } } WireToolSetup.setToolMenuIcon( "icon16/database.png" ) end diff --git a/lua/wire/stools/holoemitter.lua b/lua/wire/stools/holoemitter.lua index b468d27fe5..60af068f03 100644 --- a/lua/wire/stools/holoemitter.lua +++ b/lua/wire/stools/holoemitter.lua @@ -4,10 +4,13 @@ WireToolSetup.open( "holoemitter", "HoloEmitter", "gmod_wire_holoemitter", nil, if CLIENT then language.Add( "tool.wire_holoemitter.name", "Holographic Emitter Tool (Wire)" ) language.Add( "tool.wire_holoemitter.desc", "The emitter required for holographic projections" ) - language.Add( "tool.wire_holoemitter.0", "Primary: Create emitter, Secondary: Link emitter to any entity (makes it draw local to that entity instead)" ) - language.Add( "tool.wire_holoemitter.1", "Secondary: Link to entity (click the same holoemitter again to unlink it)" ) language.Add( "Tool_wire_holoemitter_fadetime", "Client side max fade time (set to 0 to never fade)." ) language.Add( "Tool_wire_holoemitter_keeplatestdot", "Keep latest dot indefinitely (prevent fading)." ) + TOOL.Information = { + { name = "left_0", stage = 0, text = "Create emitter" }, + { name = "right_0", stage = 0, text = "Link emitter to any entity (makes it draw local to that entity instead)" }, + { name = "right_1", stage = 1, text = "Link to entity (click the same holoemitter again to unlink it)" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) diff --git a/lua/wire/stools/hologrid.lua b/lua/wire/stools/hologrid.lua index 7681524e9b..86894df8f6 100644 --- a/lua/wire/stools/hologrid.lua +++ b/lua/wire/stools/hologrid.lua @@ -4,9 +4,12 @@ WireToolSetup.open( "hologrid", "HoloGrid", "gmod_wire_hologrid", nil, "HoloGrid if CLIENT then language.Add( "tool.wire_hologrid.name", "Holographic Grid Tool (Wire)" ) language.Add( "tool.wire_hologrid.desc", "The grid to aid in holographic projections" ) - language.Add( "tool.wire_hologrid.0", "Primary: Create grid, Secondary: Link HoloGrid with HoloEmitter or reference entity, Reload: Unlink HoloEmitter or HoloGrid" ) - language.Add( "tool.wire_hologrid.1", "Select the HoloGrid to link to." ) - language.Add( "tool.wire_hologrid.2", "Select the Holo Emitter or reference entity to link to." ) + TOOL.Information = { + { name = "left_0", stage = 0, text = "Create grid" }, + { name = "right_0", stage = 0, text = "Link HoloGrid with HoloEmitter or reference entity" }, + { name = "reload_0", stage = 0, text = "Unlink HoloEmitter or HoloGrid" }, + { name = "right_1", stage = 1, text = "Select the HoloGrid to link to" }, + } language.Add( "Tool_wire_hologrid_usegps", "Use GPS coordinates" ) end WireToolSetup.BaseLang() diff --git a/lua/wire/stools/hoverball.lua b/lua/wire/stools/hoverball.lua index 9414636d45..7f8e81f8e2 100644 --- a/lua/wire/stools/hoverball.lua +++ b/lua/wire/stools/hoverball.lua @@ -4,10 +4,10 @@ WireToolSetup.open( "hoverball", "Hoverball", "gmod_wire_hoverball", nil, "Hover if CLIENT then language.Add( "tool.wire_hoverball.name", "Wired Hoverball Tool" ) language.Add( "tool.wire_hoverball.desc", "Spawns a hoverball for use with the wire system." ) - language.Add( "tool.wire_hoverball.0", "Primary: Create/Update Hoverball" ) language.Add( "tool.wire_hoverball.starton", "Create with hover mode on" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end -WireToolSetup.BaseLang("Hoverballs") +WireToolSetup.BaseLang() WireToolSetup.SetupMax( 30 ) TOOL.ClientConVar = { diff --git a/lua/wire/stools/hudindicator.lua b/lua/wire/stools/hudindicator.lua index 479598e691..086ae23b41 100644 --- a/lua/wire/stools/hudindicator.lua +++ b/lua/wire/stools/hudindicator.lua @@ -4,10 +4,8 @@ WireToolSetup.setCategory( "Visuals/Indicators" ) WireToolSetup.open( "hudindicator", "Hud Indicator", "gmod_wire_hudindicator", nil, "Hud Indicators" ) if ( CLIENT ) then - language.Add( "Tool.wire_hudindicator.name", "Hud Indicator Tool (Wire)" ) - language.Add( "Tool.wire_hudindicator.desc", "Spawns a Hud Indicator for use with the wire system." ) - language.Add( "Tool.wire_hudindicator.0", "Primary: Create/Update Hud Indicator Secondary: Hook/Unhook someone else's Hud Indicator Reload: Link Hud Indicator to vehicle" ) - language.Add( "Tool.wire_hudindicator.1", "Now use Reload on a vehicle to link this Hud Indicator to it, or on the same Hud Indicator to unlink it" ) + language.Add( "Tool.wire_hudindicator.name", "Hud Indicator Tool (Wire)" ) + language.Add( "Tool.wire_hudindicator.desc", "Spawns a Hud Indicator for use with the wire system." ) // HUD Indicator stuff language.Add( "ToolWireHudIndicator_showinhud", "Show in my HUD") @@ -29,6 +27,13 @@ if ( CLIENT ) then language.Add( "ToolWireHudIndicator_fullcircleangle", "Start angle for full circle gauge (deg):") language.Add( "ToolWireHudIndicator_registeredindicators", "Registered Indicators:") language.Add( "ToolWireHudIndicator_deleteselected", "Unregister Selected Indicator") + + TOOL.Information = { + { name = "left_0", stage = 0, text = "Create/Update " .. TOOL.Name }, + { name = "right_0", stage = 0, text = "Hook/Unhook someone else's " .. TOOL.Name }, + { name = "reload_0", stage = 0, text = "Link Hud Indicator to vehicle" }, + { name = "reload_1", stage = 1, text = "Now use Reload on a vehicle to link this Hud Indicator to it, or on the same Hud Indicator to unlink it" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) @@ -187,13 +192,13 @@ function TOOL:Think() local currentcheck = trace.Entity:CheckRegister(ply) if (currentcheck != self.LastRegisterCheck) then self.LastRegisterCheck = currentcheck - self:GetWeapon():SetNetworkedBool("HUDIndicatorCheckRegister", currentcheck) + self:GetWeapon():SetNWBool("HUDIndicatorCheckRegister", currentcheck) end else if (self.LastRegisterCheck == true) then // Don't need to set this every 1/10 of a second self.LastRegisterCheck = false - self:GetWeapon():SetNetworkedBool("HUDIndicatorCheckRegister", false) + self:GetWeapon():SetNWBool("HUDIndicatorCheckRegister", false) end end self.NextCheckTime = CurTime() + 0.10 @@ -203,7 +208,7 @@ end if (CLIENT) then function TOOL:DrawHUD() - local isregistered = self:GetWeapon():GetNetworkedBool("HUDIndicatorCheckRegister") + local isregistered = self:GetWeapon():GetNWBool("HUDIndicatorCheckRegister") if (isregistered) then draw.WordBox(8, ScrW() / 2 + 10, ScrH() / 2 + 10, "Registered", "Default", Color(50, 50, 75, 192), Color(255, 255, 255, 255)) @@ -213,7 +218,7 @@ end function TOOL:Holster() self:ReleaseGhostEntity() - self:GetWeapon():SetNetworkedBool("HUDIndicatorCheckRegister", false) + self:GetWeapon():SetNWBool("HUDIndicatorCheckRegister", false) end function TOOL.BuildCPanel(panel) diff --git a/lua/wire/stools/hydraulic.lua b/lua/wire/stools/hydraulic.lua index 3605c09a94..e733c98bec 100644 --- a/lua/wire/stools/hydraulic.lua +++ b/lua/wire/stools/hydraulic.lua @@ -14,15 +14,18 @@ TOOL.ClientConVar = { if CLIENT then language.Add( "Tool.wire_hydraulic.name", "Hydraulic Tool (Wire)" ) language.Add( "Tool.wire_hydraulic.desc", "Makes a controllable hydraulic" ) - language.Add( "Tool.wire_hydraulic.0", "Primary: Place hydraulic\nSecondary: Place hydraulic along the hit normal" ) - language.Add( "Tool.wire_hydraulic.1", "Left click on the second point" ) - language.Add( "Tool.wire_hydraulic.2", "Left click to place the controller" ) language.Add( "Tool.wire_hydraulic.stretchonly", "Winch Mode (Stretch Only)" ) language.Add( "Tool.wire_hydraulic.stretchonly.help", "If this isn't enabled then it acts like a spring, pushing away the objects as they move closer." ) language.Add( "Tool.wire_hydraulic.width", "Width:" ) language.Add( "Tool.wire_hydraulic.material", "Material:" ) language.Add( "Tool.wire_hydraulic.fixed", "Fixed" ) language.Add( "Tool.wire_hydraulic.speed", "In/Out Speed Mul" ) + TOOL.Information = { + { name = "left_0", stage = 0, text = "Place hydraulic" }, + { name = "right_0", stage = 0, text = "Place hydraulic along the hit normal" }, + { name = "left_1", stage = 1, text = "Choose the second point" }, + { name = "left_2", stage = 2, text = "Place the controller" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax(16) diff --git a/lua/wire/stools/igniter.lua b/lua/wire/stools/igniter.lua index 5daf0975d8..10d75c8426 100644 --- a/lua/wire/stools/igniter.lua +++ b/lua/wire/stools/igniter.lua @@ -4,9 +4,9 @@ WireToolSetup.open( "igniter", "Igniter", "gmod_wire_igniter", nil, "Igniters" ) if CLIENT then language.Add( "tool.wire_igniter.name", "Igniter Tool (Wire)" ) language.Add( "tool.wire_igniter.desc", "Spawns a constant igniter prop for use with the wire system." ) - language.Add( "tool.wire_igniter.0", "Primary: Create/Update Igniter" ) language.Add( "WireIgniterTool_trgply", "Allow Player Igniting" ) language.Add( "WireIgniterTool_Range", "Max Range:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/indicator.lua b/lua/wire/stools/indicator.lua index 59afc9c061..b73be5038b 100644 --- a/lua/wire/stools/indicator.lua +++ b/lua/wire/stools/indicator.lua @@ -4,13 +4,13 @@ WireToolSetup.open( "indicator", "Indicator", "gmod_wire_indicator", nil, "Indic if CLIENT then language.Add( "tool.wire_indicator.name", "Indicator Tool (Wire)" ) language.Add( "tool.wire_indicator.desc", "Spawns a indicator for use with the wire system." ) - language.Add( "tool.wire_indicator.0", "Primary: Create/Update Indicator" ) language.Add( "ToolWireIndicator_a_value", "A Value:" ) language.Add( "ToolWireIndicator_a_colour", "A Colour:" ) language.Add( "ToolWireIndicator_b_value", "B Value:" ) language.Add( "ToolWireIndicator_b_colour", "B Colour:" ) language.Add( "ToolWireIndicator_Material", "Material:" ) language.Add( "ToolWireIndicator_90", "Rotate segment 90" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() diff --git a/lua/wire/stools/input.lua b/lua/wire/stools/input.lua index 0544a4c01e..d0c7f45fff 100644 --- a/lua/wire/stools/input.lua +++ b/lua/wire/stools/input.lua @@ -4,13 +4,13 @@ WireToolSetup.open( "input", "Numpad Input", "gmod_wire_input", nil, "Numpad Inp if CLIENT then language.Add( "tool.wire_input.name", "Input Tool (Wire)" ) language.Add( "tool.wire_input.desc", "Spawns a input for use with the wire system." ) - language.Add( "tool.wire_input.0", "Primary: Create/Update Input" ) language.Add( "WireInputTool_keygroup", "Key:" ) language.Add( "WireInputTool_toggle", "Toggle" ) language.Add( "WireInputTool_value_on", "Value On:" ) language.Add( "WireInputTool_value_off", "Value Off:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end -WireToolSetup.BaseLang("Inputs") +WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) if SERVER then diff --git a/lua/wire/stools/keyboard.lua b/lua/wire/stools/keyboard.lua index 266e163705..1b8ac2bda2 100644 --- a/lua/wire/stools/keyboard.lua +++ b/lua/wire/stools/keyboard.lua @@ -2,10 +2,8 @@ WireToolSetup.setCategory( "Input, Output/Keyboard Interaction", "Vehicle Contro WireToolSetup.open( "keyboard", "Keyboard", "gmod_wire_keyboard", nil, "Keyboards" ) if ( CLIENT ) then - language.Add( "Tool.wire_keyboard.name", "Wired Keyboard Tool (Wire)" ) - language.Add( "Tool.wire_keyboard.desc", "Spawns a keyboard input for use with the hi-speed wire system." ) - language.Add( "Tool.wire_keyboard.0", "Primary: Create/Update Keyboard, Secondary: Link Keyboard to pod, Reload: Unlink" ) - language.Add( "Tool.wire_keyboard.1", "Now select the pod to link to.") + language.Add( "Tool.wire_keyboard.name", "Wired Keyboard Tool (Wire)" ) + language.Add( "Tool.wire_keyboard.desc", "Spawns a keyboard input for use with the hi-speed wire system." ) language.Add( "Tool.wire_keyboard.leavekey", "Leave Key" ) end WireToolSetup.BaseLang() @@ -27,7 +25,7 @@ TOOL.ClientConVar = { leavekey = KEY_LALT } -WireToolSetup.SetupLinking(true) +WireToolSetup.SetupLinking(true, "vehicle") function TOOL.BuildCPanel(panel) ModelPlug_AddToCPanel(panel, "Keyboard", "wire_keyboard", true) diff --git a/lua/wire/stools/keypad.lua b/lua/wire/stools/keypad.lua index 33281fd8d1..a069704f4c 100644 --- a/lua/wire/stools/keypad.lua +++ b/lua/wire/stools/keypad.lua @@ -4,9 +4,9 @@ WireToolSetup.open( "keypad", "Keypad", "gmod_wire_keypad", nil, "Keypads" ) if CLIENT then language.Add( "tool."..TOOL.Mode..".name", TOOL.Name.." Tool (Wire)" ) language.Add( "tool."..TOOL.Mode..".desc", "Spawns a "..TOOL.Name ) - language.Add( "tool."..TOOL.Mode..".0", "Primary: Create/Update "..TOOL.Name.."" ) language.Add( "tool."..TOOL.Mode..".password", "Password: " ) language.Add( "tool."..TOOL.Mode..".secure", "Display Asterisks: " ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax(10) diff --git a/lua/wire/stools/lamp.lua b/lua/wire/stools/lamp.lua index 2383cf7a7b..d2748fbaff 100644 --- a/lua/wire/stools/lamp.lua +++ b/lua/wire/stools/lamp.lua @@ -4,13 +4,16 @@ WireToolSetup.open( "lamp", "Lamp", "gmod_wire_lamp", nil, "Lamps" ) if CLIENT then language.Add( "tool.wire_lamp.name", "Wire Lamps" ) language.Add( "tool.wire_lamp.desc", "Spawns a lamp for use with the wire system." ) - language.Add( "tool.wire_lamp.0", "Primary: Create hanging lamp Secondary: Create unattached lamp" ) language.Add( "WireLampTool_RopeLength", "Rope Length:") language.Add( "WireLampTool_FOV", "FOV:") language.Add( "WireLampTool_Dist", "Distance:") language.Add( "WireLampTool_Bright", "Brightness:") language.Add( "WireLampTool_Const", "Constraint:" ) language.Add( "WireLampTool_Color", "Color:" ) + TOOL.Information = { + { name = "left", text = "Create hanging lamp" }, + { name = "right", text = "Create unattached lamp" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) diff --git a/lua/wire/stools/las_receiver.lua b/lua/wire/stools/las_receiver.lua index 712ced3929..a447a50cbf 100644 --- a/lua/wire/stools/las_receiver.lua +++ b/lua/wire/stools/las_receiver.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "las_receiver", "Laser Pointer Receiver", "gmod_wire_las_rec if CLIENT then language.Add( "Tool.wire_las_receiver.name", "Laser Receiver Tool (Wire)" ) language.Add( "Tool.wire_las_receiver.desc", "Spawns a constant laser receiver prop for use with the wire system." ) - language.Add( "Tool.wire_las_receiver.0", "Primary: Create/Update Laser Receiver" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/latch.lua b/lua/wire/stools/latch.lua index 79e51a6d1d..583f8adaaf 100644 --- a/lua/wire/stools/latch.lua +++ b/lua/wire/stools/latch.lua @@ -4,11 +4,15 @@ WireToolSetup.open( "latch", "Weld/Constraint Latch", "gmod_wire_latch", nil, "C TOOL.ClientConVar[ "model" ] = "models/jaanus/wiretool/wiretool_siren.mdl" if CLIENT then - language.Add( "Tool.wire_latch.name", "Latch Tool (Wire)" ) - language.Add( "Tool.wire_latch.desc", "Makes a controllable latch" ) - language.Add( "Tool.wire_latch.0", "Primary: Click on first entity to be latched" ) - language.Add( "Tool.wire_latch.1", "Left click on the second entity" ) - language.Add( "Tool.wire_latch.2", "Left click to place the controller" ) + language.Add( "Tool.wire_latch.name", "Latch Tool (Wire)" ) + language.Add( "Tool.wire_latch.desc", "Makes a controllable latch" ) + TOOL.Information = { + { name = "left_0", stage = 0, text = "Choose the first entity to be latched" }, + { name = "left_1", stage = 1, text = "Choose the second entity to be latched" }, + { name = "reload_1", stage = 1, text = "Cancel" }, + { name = "left_2", stage = 2, text = "Place the controller" }, + { name = "reload_2", stage = 2, text = "Cancel" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 15 ) diff --git a/lua/wire/stools/lever.lua b/lua/wire/stools/lever.lua index cbdc7f71cd..949f80f9d9 100644 --- a/lua/wire/stools/lever.lua +++ b/lua/wire/stools/lever.lua @@ -4,9 +4,9 @@ WireToolSetup.open( "lever", "Lever", "gmod_wire_lever", nil, "Levers" ) if CLIENT then language.Add( "tool.wire_lever.name", "Lever Tool (Wire)" ) language.Add( "tool.wire_lever.desc", "Spawns a Lever for use with the wire system." ) - language.Add( "tool.wire_lever.0", "Primary: Create/Update Lever" ) language.Add( "tool.wire_lever.minvalue", "Max Value:" ) language.Add( "tool.wire_lever.maxvalue", "Min Value:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) diff --git a/lua/wire/stools/light.lua b/lua/wire/stools/light.lua index c7b1b706c2..8bfee72aa5 100644 --- a/lua/wire/stools/light.lua +++ b/lua/wire/stools/light.lua @@ -4,7 +4,6 @@ WireToolSetup.open( "light", "Light", "gmod_wire_light", nil, "Lights" ) if CLIENT then language.Add( "tool.wire_light.name", "Light Tool (Wire)" ) language.Add( "tool.wire_light.desc", "Spawns a Light for use with the wire system." ) - language.Add( "tool.wire_light.0", "Primary: Create Light" ) language.Add( "WireLightTool_RopeLength", "Rope Length:") language.Add( "WireLightTool_bright", "Glow brightness:") language.Add( "WireLightTool_size", "Glow size:" ) @@ -13,6 +12,7 @@ if CLIENT then language.Add( "WireLightTool_glow", "Glow Component" ) language.Add( "WireLightTool_const", "Constraint:" ) language.Add( "WireLightTool_color", "Initial Color:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax(8) diff --git a/lua/wire/stools/locator.lua b/lua/wire/stools/locator.lua index f6ea025b6b..cdc9193071 100644 --- a/lua/wire/stools/locator.lua +++ b/lua/wire/stools/locator.lua @@ -2,9 +2,9 @@ WireToolSetup.setCategory( "Detection/Beacon" ) WireToolSetup.open( "locator", "Locator", "gmod_wire_locator", nil, "Locators" ) if ( CLIENT ) then - language.Add( "Tool.wire_locator.name", "Locator Beacon Tool (Wire)" ) - language.Add( "Tool.wire_locator.desc", "Spawns a locator beacon for use with the wire system." ) - language.Add( "Tool.wire_locator.0", "Primary: Create/Update Locator Beacon" ) + language.Add( "Tool.wire_locator.name", "Locator Beacon Tool (Wire)" ) + language.Add( "Tool.wire_locator.desc", "Spawns a locator beacon for use with the wire system." ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 30 ) diff --git a/lua/wire/stools/motor.lua b/lua/wire/stools/motor.lua index 781560a355..ff80e73b28 100644 --- a/lua/wire/stools/motor.lua +++ b/lua/wire/stools/motor.lua @@ -2,15 +2,17 @@ WireToolSetup.setCategory( "Physics/Force" ) WireToolSetup.open( "motor", "Motor", "gmod_wire_motor", nil, "Motors" ) if CLIENT then - language.Add( "Tool.wire_motor.name", "Motor Tool (Wire)" ) - language.Add( "Tool.wire_motor.desc", "Makes a controllable motor" ) - language.Add( "Tool.wire_motor.0", "Left click on object" ) - language.Add( "Tool.wire_motor.1", "Left click somewhere else" ) - language.Add( "Tool.wire_motor.2", "Left click to place the controller" ) - language.Add( "WireMotorTool_torque", "Torque:" ) - language.Add( "WireMotorTool_friction", "Hinge Friction:" ) + language.Add( "Tool.wire_motor.name", "Motor Tool (Wire)" ) + language.Add( "Tool.wire_motor.desc", "Makes a controllable motor" ) + language.Add( "WireMotorTool_torque", "Torque:" ) + language.Add( "WireMotorTool_friction", "Hinge Friction:" ) language.Add( "WireMotorTool_nocollide", "No Collide" ) language.Add( "WireMotorTool_forcelimit", "Force Limit:" ) + TOOL.Information = { + { name = "left_0", stage = 0, text = "Choose the wheel's axis" }, + { name = "left_1", stage = 1, text = "Choose the base's axis" }, + { name = "left_2", stage = 2, text = "Place the controller" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) diff --git a/lua/wire/stools/nailer.lua b/lua/wire/stools/nailer.lua index a895b4a167..5bc20c8bff 100644 --- a/lua/wire/stools/nailer.lua +++ b/lua/wire/stools/nailer.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "nailer", "Nailer", "gmod_wire_nailer", nil, "Nailers" ) if ( CLIENT ) then language.Add( "Tool.wire_nailer.name", "Nailer Tool (Wire)" ) language.Add( "Tool.wire_nailer.desc", "Spawns a constant nailer prop for use with the wire system." ) - language.Add( "Tool.wire_nailer.0", "Primary: Create/Update Nailer" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/numpad.lua b/lua/wire/stools/numpad.lua index 4fff9649bc..9929a7aa99 100644 --- a/lua/wire/stools/numpad.lua +++ b/lua/wire/stools/numpad.lua @@ -2,12 +2,12 @@ WireToolSetup.setCategory( "Input, Output/Keyboard Interaction" ) WireToolSetup.open( "numpad", "Numpad", "gmod_wire_numpad", nil, "Numpads" ) if CLIENT then - language.Add( "Tool.wire_numpad.name", "Wired Numpad Tool (Wire)" ) - language.Add( "Tool.wire_numpad.desc", "Spawns a numpad input for use with the wire system." ) - language.Add( "Tool.wire_numpad.0", "Primary: Create/Update Numpad" ) - language.Add( "WireNumpadTool_toggle", "Toggle" ) - language.Add( "WireNumpadTool_value_on", "Value On:" ) - language.Add( "WireNumpadTool_value_off", "Value Off:" ) + language.Add( "Tool.wire_numpad.name", "Wired Numpad Tool (Wire)" ) + language.Add( "Tool.wire_numpad.desc", "Spawns a numpad input for use with the wire system." ) + language.Add( "WireNumpadTool_toggle", "Toggle" ) + language.Add( "WireNumpadTool_value_on", "Value On:" ) + language.Add( "WireNumpadTool_value_off", "Value Off:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/oscilloscope.lua b/lua/wire/stools/oscilloscope.lua index 9501328e00..b143055bec 100644 --- a/lua/wire/stools/oscilloscope.lua +++ b/lua/wire/stools/oscilloscope.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "oscilloscope", "Oscilloscope", "gmod_wire_oscilloscope", ni if CLIENT then language.Add( "tool.wire_oscilloscope.name", "Oscilloscope Tool (Wire)" ) language.Add( "tool.wire_oscilloscope.desc", "Spawns a oscilloscope what display line graphs." ) - language.Add( "tool.wire_oscilloscope.0", "Primary: Create/Update oscilloscope" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/output.lua b/lua/wire/stools/output.lua index e31dca341b..3ba16d810b 100644 --- a/lua/wire/stools/output.lua +++ b/lua/wire/stools/output.lua @@ -4,8 +4,8 @@ WireToolSetup.open( "output", "Numpad Output", "gmod_wire_output", nil, "Numpad if CLIENT then language.Add( "Tool.wire_output.name", "Output Tool (Wire)" ) language.Add( "Tool.wire_output.desc", "Spawns an output for use with the wire system." ) - language.Add( "Tool.wire_output.0", "Primary: Create/Update Output" ) language.Add( "Tool.wire_output.keygroup", "Key:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) diff --git a/lua/wire/stools/pixel.lua b/lua/wire/stools/pixel.lua index 251bb51906..2bd887c08c 100644 --- a/lua/wire/stools/pixel.lua +++ b/lua/wire/stools/pixel.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "pixel", "Pixel", "gmod_wire_pixel", nil, "Pixels" ) if CLIENT then language.Add( "tool.wire_pixel.name", "Pixel Tool (Wire)" ) language.Add( "tool.wire_pixel.desc", "Spawns a Pixel for use with the wire system." ) - language.Add( "tool.wire_pixel.0", "Primary: Create Pixel" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/plug.lua b/lua/wire/stools/plug.lua index d4e262d214..213115df5b 100644 --- a/lua/wire/stools/plug.lua +++ b/lua/wire/stools/plug.lua @@ -15,7 +15,6 @@ if (SERVER) then else language.Add( "Tool.wire_plug.name", "Plug & Socket Tool (Wire)" ) language.Add( "Tool.wire_plug.desc", "Spawns plugs and sockets for use with the wire system." ) - language.Add( "Tool.wire_plug.0", "Primary: Create/Update Socket, Secondary: Create/Update Plug" ) language.Add( "sboxlimit_wire_plugs", "You've hit the Wire Plugs limit!" ) language.Add( "sboxlimit_wire_sockets", "You've hit the Wire Sockets limit!" ) language.Add( "undone_wireplug", "Undone Wire Plug" ) @@ -27,8 +26,14 @@ else language.Add( "Tool_wire_plug_attachrange", "Plug attachment detection range:" ) language.Add( "Tool_wire_plug_drawoutline", "Draw the white outline on plugs and sockets." ) language.Add( "Tool_wire_plug_drawoutline_tooltip", "Disabling this helps you see inside the USB plug model when you set its material to wireframe." ) + TOOL.Information = { + { name = "left", text = "Create/Update Socket" }, + { name = "right", text = "Create/Update " .. TOOL.Name }, + } end +WireToolSetup.BaseLang() + TOOL.ClientConVar["model"] = "models/props_lab/tpplugholder_single.mdl" TOOL.ClientConVar["freeze"] = 1 TOOL.ClientConVar["array"] = 0 diff --git a/lua/wire/stools/pod.lua b/lua/wire/stools/pod.lua index d23484302c..ca39dcf146 100644 --- a/lua/wire/stools/pod.lua +++ b/lua/wire/stools/pod.lua @@ -4,8 +4,6 @@ WireToolSetup.open( "pod", "Pod Controller", "gmod_wire_pod", nil, "Pod Controll if CLIENT then language.Add("tool.wire_pod.name", "Pod Controller Tool (Wire)") language.Add("tool.wire_pod.desc", "Spawn/link a Wire Pod controller.") - language.Add("tool.wire_pod.0", "Primary: Create Pod controller. Secondary: Link controller.") - language.Add("tool.wire_pod.1", "Now select the pod to link to.") end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) @@ -15,7 +13,7 @@ TOOL.ClientConVar = { model = "models/jaanus/wiretool/wiretool_siren.mdl" } -WireToolSetup.SetupLinking(true) +WireToolSetup.SetupLinking(true, "pod") function TOOL.BuildCPanel(panel) ModelPlug_AddToCPanel(panel, "Misc_Tools", "wire_pod", nil, 1) diff --git a/lua/wire/stools/radio.lua b/lua/wire/stools/radio.lua index a90002117e..1dd8e3e0ea 100644 --- a/lua/wire/stools/radio.lua +++ b/lua/wire/stools/radio.lua @@ -4,10 +4,10 @@ WireToolSetup.open( "radio", "Radio", "gmod_wire_radio", nil, "Radios" ) if ( CLIENT ) then language.Add( "Tool.wire_radio.name", "Radio Tool (Wire)" ) language.Add( "Tool.wire_radio.desc", "Spawns a radio for use with the wire system." ) - language.Add( "Tool.wire_radio.0", "Primary: Create/Update Radio" ) language.Add( "WireRadioTool_channel", "Channel:" ) language.Add( "WireRadioTool_values", "Values:" ) language.Add( "WireRadioTool_secure", "Secure" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/ranger.lua b/lua/wire/stools/ranger.lua index 43c878220b..de26ef0194 100644 --- a/lua/wire/stools/ranger.lua +++ b/lua/wire/stools/ranger.lua @@ -4,7 +4,6 @@ WireToolSetup.open( "ranger", "Ranger", "gmod_wire_ranger", nil, "Rangers" ) if CLIENT then language.Add( "Tool.wire_ranger.name", "Ranger Tool (Wire)" ) language.Add( "Tool.wire_ranger.desc", "Spawns a ranger for use with the wire system." ) - language.Add( "Tool.wire_ranger.0", "Primary: Create/Update Ranger" ) language.Add( "Tool.wire_ranger.range", "Range:" ) language.Add( "Tool.wire_ranger.default_zero", "Default to zero" ) language.Add( "Tool.wire_ranger.show_beam", "Show Beam" ) @@ -21,6 +20,7 @@ if CLIENT then language.Add( "Tool.wire_ranger.out_eid", "Output Entity+EntID" ) language.Add( "Tool.wire_ranger.out_hnrm", "Output HitNormal" ) language.Add( "Tool.wire_ranger.hires", "High Resolution") + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) diff --git a/lua/wire/stools/relay.lua b/lua/wire/stools/relay.lua index dc75f25332..fc0b32722e 100644 --- a/lua/wire/stools/relay.lua +++ b/lua/wire/stools/relay.lua @@ -4,7 +4,6 @@ WireToolSetup.open( "relay", "Relay", "gmod_wire_relay", nil, "Relays" ) if ( CLIENT ) then language.Add( "Tool.wire_relay.name", "Relay" ) language.Add( "Tool.wire_relay.desc", "Spawns a multi pole, multi throw relay switch." ) - language.Add( "Tool.wire_relay.0", "Primary: Create/Update Relay" ) language.Add( "WireRelayTool_keygroup1", "Input 1 Key:" ) language.Add( "WireRelayTool_keygroup2", "Input 2 Key:" ) language.Add( "WireRelayTool_keygroup3", "Input 3 Key:" ) @@ -16,6 +15,7 @@ if ( CLIENT ) then language.Add( "WireRelayTool_normclose", "Normaly:" ) language.Add( "WireRelayTool_poles", "Number of poles:" ) language.Add( "WireRelayTool_throws", "Number of throws:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/rom.lua b/lua/wire/stools/rom.lua index 14552eeec8..abe0a7e1a0 100644 --- a/lua/wire/stools/rom.lua +++ b/lua/wire/stools/rom.lua @@ -4,10 +4,11 @@ WireToolSetup.open( "rom", "Memory - ROM", "gmod_wire_dhdd", nil, "Memory ROMs" if CLIENT then language.Add( "Tool.wire_rom.name", "ROM Tool (Wire)" ) language.Add( "Tool.wire_rom.desc", "Spawns a ROM chip" ) - language.Add( "Tool.wire_rom.0", "Primary: Create ROM." ) language.Add( "Tool.wire_rom.note", "ROM size will depend on written data.\nThe maximum size is 256 KB." ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } + TOOL.ClientConVar["model"] = "models/jaanus/wiretool/wiretool_gate.mdl" function TOOL.BuildCPanel( panel ) diff --git a/lua/wire/stools/screen.lua b/lua/wire/stools/screen.lua index a3ff144309..cea6f74784 100644 --- a/lua/wire/stools/screen.lua +++ b/lua/wire/stools/screen.lua @@ -4,7 +4,6 @@ WireToolSetup.open( "screen", "Screen", "gmod_wire_screen", nil, "Screens" ) if CLIENT then language.Add( "tool.wire_screen.name", "Screen Tool (Wire)" ) language.Add( "tool.wire_screen.desc", "Spawns a screen that display values." ) - language.Add( "tool.wire_screen.0", "Primary: Create/Update screen" ) language.Add("Tool_wire_screen_singlevalue", "Only one value") language.Add("Tool_wire_screen_singlebigfont", "Use bigger font for single-value screen") language.Add("Tool_wire_screen_texta", "Text A:") @@ -14,6 +13,7 @@ if CLIENT then language.Add("Tool_wire_screen_formatnumber", "Format the number into millions, billions, etc") language.Add("Tool_wire_screen_formattime", "Format the number as a duration, in seconds") language.Add("Tool_wire_screen_createflat", "Create flat to surface") + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/sensor.lua b/lua/wire/stools/sensor.lua index 397967359c..7fa9eb4bdd 100644 --- a/lua/wire/stools/sensor.lua +++ b/lua/wire/stools/sensor.lua @@ -4,8 +4,6 @@ WireToolSetup.open( "sensor", "Beacon Sensor", "gmod_wire_sensor", nil, "Beacon if ( CLIENT ) then language.Add( "Tool.wire_sensor.name", "Beacon Sensor Tool (Wire)" ) language.Add( "Tool.wire_sensor.desc", "Returns distance and/or bearing to a beacon" ) - language.Add( "Tool.wire_sensor.0", "Primary: Create Sensor Secondary: Link Sensor" ) - language.Add( "Tool.wire_sensor.1", "Click on the beacon to link to." ) language.Add( "WireSensorTool_outdist", "Output distance" ) language.Add( "WireSensorTool_outbrng", "Output bearing" ) language.Add( "WireSensorTool_xyz_mode", "Output local position, relative to beacon" ) @@ -39,7 +37,7 @@ TOOL.ClientConVar[ "velocity_normalized" ] = "0" TOOL.Model = "models/props_lab/huladoll.mdl" -WireToolSetup.SetupLinking(true) +WireToolSetup.SetupLinking(true, "beacon") function TOOL.BuildCPanel( panel ) panel:CheckBox("#WireSensorTool_outdist", "wire_sensor_outdist") diff --git a/lua/wire/stools/simple_explosive.lua b/lua/wire/stools/simple_explosive.lua index e9626583e8..c7ff358833 100644 --- a/lua/wire/stools/simple_explosive.lua +++ b/lua/wire/stools/simple_explosive.lua @@ -4,12 +4,15 @@ WireToolSetup.open( "simple_explosive", "Explosives (Simple)", "gmod_wire_simple if CLIENT then language.Add( "tool.wire_simple_explosive.name", "Simple Wired Explosives Tool" ) language.Add( "tool.wire_simple_explosive.desc", "Creates a simple explosives for wire system." ) - language.Add( "tool.wire_simple_explosive.0", "Left click: Spawn bomb, Reload: Copy model" ) language.Add( "Tool.simple_explosive.model", "Model:" ) language.Add( "Tool.simple_explosive.trigger", "Trigger value:" ) language.Add( "Tool.simple_explosive.damage", "Damage:" ) language.Add( "Tool.simple_explosive.removeafter", "Remove on explosion" ) language.Add( "Tool.simple_explosive.radius", "Blast radius:" ) + TOOL.Information = { + { name = "left", text = "Create/Update " .. TOOL.Name }, + { name = "reload", text = "Copy model" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/soundemitter.lua b/lua/wire/stools/soundemitter.lua index 9739265bc8..69e5adc8d9 100644 --- a/lua/wire/stools/soundemitter.lua +++ b/lua/wire/stools/soundemitter.lua @@ -4,8 +4,11 @@ WireToolSetup.open( "soundemitter", "Sound Emitter", "gmod_wire_soundemitter", n if CLIENT then language.Add( "tool.wire_soundemitter.name", "Sound Emitter Tool (Wire)" ) language.Add( "tool.wire_soundemitter.desc", "Spawns a sound emitter for use with the wire system." ) - language.Add( "tool.wire_soundemitter.0", "Primary: Create/Update Sound Emitter, Secondary: Open Sound Browser" ) language.Add( "WireEmitterTool_sound", "Sound:" ) + TOOL.Information = { + { name = "left", text = "Create/Update " .. TOOL.Name }, + { name = "right", text = "Open Sound Browser" }, + } WireToolSetup.setToolMenuIcon( "bull/various/subwoofer" ) end diff --git a/lua/wire/stools/spawner.lua b/lua/wire/stools/spawner.lua index 588de999b8..55b2412a7b 100644 --- a/lua/wire/stools/spawner.lua +++ b/lua/wire/stools/spawner.lua @@ -10,17 +10,12 @@ TOOL.ClientConVar = { if CLIENT then language.Add( "Tool.wire_spawner.name", "Prop Spawner (Wire)" ) language.Add( "Tool.wire_spawner.desc", "Spawns a prop at a pre-defined location" ) - language.Add( "Tool.wire_spawner.0", "Click a prop to turn it into a prop spawner." ) - language.Add( "Undone_gmod_wire_spawner", "Undone Wire Spawner" ) - language.Add( "Cleanup_gmod_wire_spawner", "Wire Spawners" ) - language.Add( "Cleaned_gmod_wire_spawner", "Cleaned up Wire Spawners" ) + TOOL.Information = { { name = "left", text = "Click a prop to turn it into a " .. TOOL.Name } } end -if SERVER then - CreateConVar("sbox_maxwire_spawners",10) -end +WireToolSetup.BaseLang() +WireToolSetup.SetupMax(10) -cleanup.Register("gmod_wire_spawner") function TOOL:LeftClick(trace) local ent = trace.Entity if !ent or !ent:IsValid() then return false end diff --git a/lua/wire/stools/speedometer.lua b/lua/wire/stools/speedometer.lua index 18346651a0..b6b9435410 100644 --- a/lua/wire/stools/speedometer.lua +++ b/lua/wire/stools/speedometer.lua @@ -4,9 +4,9 @@ WireToolSetup.open( "speedometer", "Speedometer", "gmod_wire_speedometer", nil, if CLIENT then language.Add( "tool.wire_speedometer.name", "Speedometer Tool (Wire)" ) language.Add( "tool.wire_speedometer.desc", "Spawns a speedometer for use with the wire system." ) - language.Add( "tool.wire_speedometer.0", "Primary: Create/Update Speedometer" ) language.Add( "Tool_wire_speedometer_xyz_mode", "Split Outputs to X,Y,Z" ) language.Add( "Tool_wire_speedometer_angvel", "Add Angular Velocity Outputs" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) diff --git a/lua/wire/stools/spu.lua b/lua/wire/stools/spu.lua index 94b7a90e40..0f231ea25c 100644 --- a/lua/wire/stools/spu.lua +++ b/lua/wire/stools/spu.lua @@ -4,8 +4,11 @@ WireToolSetup.open( "spu", "SPU", "gmod_wire_spu", nil, "SPUs" ) if CLIENT then language.Add("Tool.wire_spu.name", "SPU Tool (Wire)") language.Add("Tool.wire_spu.desc", "Spawns a sound processing unit") - language.Add("Tool.wire_spu.0", "Primary: create/reflash ZSPU, Secondary: open editor") language.Add("ToolWirespu_Model", "Model:" ) + TOOL.Information = { + { name = "left", text = "Create/reflash " .. TOOL.Name }, + { name = "right", text = "Open editor" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 7 ) diff --git a/lua/wire/stools/target_finder.lua b/lua/wire/stools/target_finder.lua index ae09bfe6a5..490c5c1d8a 100644 --- a/lua/wire/stools/target_finder.lua +++ b/lua/wire/stools/target_finder.lua @@ -4,7 +4,6 @@ WireToolSetup.open( "target_finder", "Target Finder", "gmod_wire_target_finder", if CLIENT then language.Add( "Tool.wire_target_finder.name", "Target Finder Beacon Tool (Wire)" ) language.Add( "Tool.wire_target_finder.desc", "Spawns a target finder beacon for use with the wire system." ) - language.Add( "Tool.wire_target_finder.0", "Primary: Create/Update Target Finder Beacon" ) language.Add( "WireTargetFinderTool_minrange", "Minimum Range:" ) language.Add( "WireTargetFinderTool_maxrange", "Maximum Range:" ) @@ -37,6 +36,7 @@ if CLIENT then language.Add( "WireTargetFinderTool_pcolA", "Alpha:") language.Add( "WireTargetFinderTool_checkbuddylist", "Check Propprotection Buddy List (EXPERIMENTAL!)" ) language.Add( "WireTargetFinderTool_onbuddylist", "Target Only Buddys (EXPERIMENTAL!)" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/teleporter.lua b/lua/wire/stools/teleporter.lua index 9fe70b84e6..dd462e7b3a 100644 --- a/lua/wire/stools/teleporter.lua +++ b/lua/wire/stools/teleporter.lua @@ -4,9 +4,12 @@ WireToolSetup.open( "teleporter", "Teleporter", "gmod_wire_teleporter", nil, "Te if ( CLIENT ) then language.Add( "Tool.wire_teleporter.name", "Teleporter Tool" ) language.Add( "Tool.wire_teleporter.desc", "Spawns a Wire Teleporter" ) - language.Add( "Tool.wire_teleporter.0", "Primary: Create Teleporter, Reload: Change Teleporter Model" ) language.Add( "Tool.wire_teleporter.effects", "Toggle effects" ) language.Add( "Tool.wire_teleporter.sounds", "Toggle sounds (Also has an input)" ) + TOOL.Information = { + { name = "left", text = "Create/Update " .. TOOL.Name }, + { name = "reload", text = "Copy model" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax(3) diff --git a/lua/wire/stools/textentry.lua b/lua/wire/stools/textentry.lua index 4939692e81..4ba5a45ecd 100644 --- a/lua/wire/stools/textentry.lua +++ b/lua/wire/stools/textentry.lua @@ -24,7 +24,7 @@ if SERVER then end end -WireToolSetup.SetupLinking(true) +WireToolSetup.SetupLinking(true, "vehicle") function TOOL.BuildCPanel(panel) panel:AddControl("Header",{Description="Input strings on a keyboard to be used with the wire system."}) diff --git a/lua/wire/stools/textreceiver.lua b/lua/wire/stools/textreceiver.lua index 7c4755885c..b33f3e332d 100644 --- a/lua/wire/stools/textreceiver.lua +++ b/lua/wire/stools/textreceiver.lua @@ -4,7 +4,6 @@ WireToolSetup.open( "textreceiver", "Text Receiver", "gmod_wire_textreceiver", n if ( CLIENT ) then language.Add( "Tool.wire_textreceiver.name", "Text Receiver Tool (Wire)" ) language.Add( "Tool.wire_textreceiver.desc", "Spawns a text receiver for use with the wire system." ) - language.Add( "Tool.wire_textreceiver.0", "Primary: Create/Update text receiver, Secondary: Copy Settings" ) language.Add( "Tool_wire_textreceiver_case_insensitive", "Case insensitive" ) language.Add( "Tool_wire_textreceiver_use_lua_patterns", "Use Lua Patterns" ) @@ -12,6 +11,11 @@ if ( CLIENT ) then for i=1,24 do language.Add( "Tool_wire_textreceiver_match" .. i, "Match " .. i .. ":" ) end + + TOOL.Information = { + { name = "left", text = "Create/Update " .. TOOL.Name }, + { name = "right", text = "Copy settings" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) diff --git a/lua/wire/stools/textscreen.lua b/lua/wire/stools/textscreen.lua index 81316cc202..4a197409ca 100644 --- a/lua/wire/stools/textscreen.lua +++ b/lua/wire/stools/textscreen.lua @@ -5,7 +5,6 @@ WireToolSetup.open( "textscreen", "Text Screen", "gmod_wire_textscreen", nil, "T if CLIENT then language.Add("tool.wire_textscreen.name", "Text Screen Tool (Wire)" ) language.Add("tool.wire_textscreen.desc", "Spawns a screen that displays text." ) - language.Add("tool.wire_textscreen.0", "Primary: Create/Update text screen, Secondary: Copy settings" ) language.Add("Tool_wire_textscreen_tsize", "Text size:") language.Add("Tool_wire_textscreen_tjust", "Horizontal alignment:") @@ -14,6 +13,11 @@ if CLIENT then language.Add("Tool_wire_textscreen_colour", "Text colour:") language.Add("Tool_wire_textscreen_createflat", "Create flat to surface") language.Add("Tool_wire_textscreen_text", "Default text:") + TOOL.Information = { + { name = "left", text = "Create/Update " .. TOOL.Name }, + { name = "right", text = "Copy settings" }, + } + end WireToolSetup.BaseLang() diff --git a/lua/wire/stools/thruster.lua b/lua/wire/stools/thruster.lua index 87eece23ac..4701573540 100644 --- a/lua/wire/stools/thruster.lua +++ b/lua/wire/stools/thruster.lua @@ -4,7 +4,6 @@ WireToolSetup.open( "thruster", "Thruster", "gmod_wire_thruster", nil, "Thruster if CLIENT then language.Add( "tool.wire_thruster.name", "Thruster Tool (Wire)" ) language.Add( "tool.wire_thruster.desc", "Spawns a thruster for use with the wire system." ) - language.Add( "tool.wire_thruster.0", "Primary: Create/Update Thruster" ) language.Add( "WireThrusterTool_Model", "Model:" ) language.Add( "WireThrusterTool_force", "Force multiplier:" ) language.Add( "WireThrusterTool_force_min", "Force minimum:" ) @@ -13,6 +12,7 @@ if CLIENT then language.Add( "WireThrusterTool_soundname", "Select sound" ) language.Add( "WireThrusterTool_owater", "Works out of water" ) language.Add( "WireThrusterTool_uwater", "Works under water" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) diff --git a/lua/wire/stools/trail.lua b/lua/wire/stools/trail.lua index fd3138c12f..9daff93517 100644 --- a/lua/wire/stools/trail.lua +++ b/lua/wire/stools/trail.lua @@ -4,9 +4,9 @@ WireToolSetup.open( "trail", "Trail", "gmod_wire_trail", nil, "Trails" ) if CLIENT then language.Add( "tool.wire_trail.name", "Trail Tool (Wire)" ) language.Add( "tool.wire_trail.desc", "Spawns a wired trail." ) - language.Add( "tool.wire_trail.0", "Primary: Create/Update trail" ) language.Add( "WireTrailTool_trail", "Trail:" ) language.Add( "WireTrailTool_mat", "Material:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/trigger.lua b/lua/wire/stools/trigger.lua index 3d090a3b28..7ecb8c7454 100644 --- a/lua/wire/stools/trigger.lua +++ b/lua/wire/stools/trigger.lua @@ -2,9 +2,6 @@ WireToolSetup.setCategory( "Detection" ) WireToolSetup.open( "trigger", "Trigger", "gmod_wire_trigger", nil, "Triggers" ) -WireToolSetup.BaseLang() -WireToolSetup.SetupMax( 64 ) - TOOL.ClientConVar = { model = "models/jaanus/wiretool/wiretool_siren.mdl", filter = 0, -- 0: all entities, 1: only players, 2: only props (and stuff that isn't a player) @@ -35,7 +32,7 @@ if CLIENT then language.Add( "Tool.wire_trigger.filter_all", "All Entities" ) language.Add( "Tool.wire_trigger.filter_players", "Only Players" ) language.Add( "Tool.wire_trigger.filter_props", "Only Props" ) - language.Add( "tool."..TOOL.Mode..".0", "Primary: Create "..TOOL.Name.."" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } concommand.Add( "wire_trigger_reset_size", function( ply, cmd, args ) @@ -53,6 +50,10 @@ if CLIENT then end ) end + +WireToolSetup.BaseLang() +WireToolSetup.SetupMax( 64 ) + function TOOL:GetConVars() return self:GetClientInfo( "model" ), self:GetClientNumber( "filter" ), self:GetClientNumber( "owneronly" ), self:GetClientNumber( "sizex" ), self:GetClientNumber( "sizey" ), self:GetClientNumber( "sizez" ), self:GetClientNumber( "offsetx" ), self:GetClientNumber( "offsety" ), self:GetClientNumber( "offsetz" ) end diff --git a/lua/wire/stools/turret.lua b/lua/wire/stools/turret.lua index d983d62a50..f4ff70c7aa 100644 --- a/lua/wire/stools/turret.lua +++ b/lua/wire/stools/turret.lua @@ -9,13 +9,13 @@ Sound( "NPC_FloorTurret.Shoot" ) if CLIENT then language.Add( "tool.wire_turret.name", "Turret" ) language.Add( "tool.wire_turret.desc", "Throws bullets at things" ) - language.Add( "tool.wire_turret.0", "Click somewhere to spawn an turret. Click on an existing turret to change it." ) language.Add( "Tool_wire_turret_spread", "Bullet Spread" ) language.Add( "Tool_wire_turret_numbullets", "Bullets per Shot" ) language.Add( "Tool_wire_turret_force", "Bullet Force" ) language.Add( "Tool_wire_turret_sound", "Shoot Sound" ) language.Add( "Tool_wire_turret_tracernum", "Tracer Every x Bullets:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/twoway_radio.lua b/lua/wire/stools/twoway_radio.lua index d6b3779f0d..4d51a2c81e 100644 --- a/lua/wire/stools/twoway_radio.lua +++ b/lua/wire/stools/twoway_radio.lua @@ -4,8 +4,6 @@ WireToolSetup.open( "twoway_radio", "Two-way Radio", "gmod_wire_twoway_radio", n if ( CLIENT ) then language.Add( "Tool.wire_twoway_radio.name", "Two-Way Radio Tool (Wire)" ) language.Add( "Tool.wire_twoway_radio.desc", "Spawns a two-way radio for use with the wire system." ) - language.Add( "Tool.wire_twoway_radio.0", "Primary: Create/Update Two-way Radio\nSecondary: Select a two-way radio to pair up with another two-way radio." ) - language.Add( "Tool.wire_twoway_radio.1", "Select the second two-way radio." ); end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) @@ -16,7 +14,7 @@ end TOOL.ClientConVar[ "model" ] = "models/props_lab/binderblue.mdl" -WireToolSetup.SetupLinking(true) +WireToolSetup.SetupLinking(true, "two-way radio") function TOOL.BuildCPanel(panel) WireDermaExts.ModelSelect(panel, "wire_twoway_radio_model", list.Get( "Wire_radio_Models" ), 2, true) diff --git a/lua/wire/stools/user.lua b/lua/wire/stools/user.lua index a8241f5a4a..5f20fee745 100644 --- a/lua/wire/stools/user.lua +++ b/lua/wire/stools/user.lua @@ -4,8 +4,8 @@ WireToolSetup.open( "user", "User", "gmod_wire_user", nil, "Users" ) if CLIENT then language.Add( "Tool.wire_user.name", "User Tool (Wire)" ) language.Add( "Tool.wire_user.desc", "Spawns a constant user prop for use with the wire system." ) - language.Add( "Tool.wire_user.0", "Primary: Create/Update User" ) language.Add( "Tool.wire_user.range", "Max Range:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/value.lua b/lua/wire/stools/value.lua index 3ab407ed19..882f163454 100644 --- a/lua/wire/stools/value.lua +++ b/lua/wire/stools/value.lua @@ -4,7 +4,11 @@ WireToolSetup.open( "value", "Constant Value", "gmod_wire_value", nil, "Constant if CLIENT then language.Add("Tool.wire_value.name", "Value Tool (Wire)") language.Add("Tool.wire_value.desc", "Spawns a constant value for use with the wire system.") - language.Add("Tool.wire_value.0", "Primary: Create/Update Value, Secondary: Copy Settings") + + TOOL.Information = { + { name = "left", text = "Create/Update " .. TOOL.Name }, + { name = "right", text = "Copy settings" }, + } WireToolSetup.setToolMenuIcon( "icon16/database_go.png" ) end diff --git a/lua/wire/stools/vehicle.lua b/lua/wire/stools/vehicle.lua index c7d96d46cf..e712acb029 100644 --- a/lua/wire/stools/vehicle.lua +++ b/lua/wire/stools/vehicle.lua @@ -4,15 +4,13 @@ WireToolSetup.open( "vehicle", "Vehicle Controller", "gmod_wire_vehicle", nil, " if CLIENT then language.Add("Tool.wire_vehicle.name", "Vehicle Controller Tool (Wire)") language.Add("Tool.wire_vehicle.desc", "Spawn/link a Wire Vehicle controller.") - language.Add("Tool.wire_vehicle.0", "Primary: Create Vehicle controller. Secondary: Link controller.") - language.Add("Tool.wire_vehicle.1", "Now select the Vehicle to link to.") end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) TOOL.ClientConVar[ "model" ] = "models/jaanus/wiretool/wiretool_siren.mdl" -WireToolSetup.SetupLinking(true) +WireToolSetup.SetupLinking(true, "vehicle") function TOOL.BuildCPanel(panel) WireDermaExts.ModelSelect(panel, "wire_vehicle_model", list.Get( "Wire_Misc_Tools_Models" ), 1) diff --git a/lua/wire/stools/vthruster.lua b/lua/wire/stools/vthruster.lua index 3a7bf5ad7c..7ba9fa3ac7 100644 --- a/lua/wire/stools/vthruster.lua +++ b/lua/wire/stools/vthruster.lua @@ -4,10 +4,13 @@ WireToolSetup.open( "vthruster", "Vector Thruster", "gmod_wire_vectorthruster", if ( CLIENT ) then language.Add( "Tool.wire_vthruster.name", "Vector Thruster Tool (Wire)" ) language.Add( "Tool.wire_vthruster.desc", "Spawns a vector thruster for use with the wire system." ) - language.Add( "Tool.wire_vthruster.0", "Primary: Create/Update Vector Thruster" ) - language.Add( "Tool.wire_vthruster.1", "Primary: Set the Angle, hold Shift to lock to 45 degrees" ) language.Add( "WireVThrusterTool_Mode", "Mode:" ) language.Add( "WireVThrusterTool_Angle", "Use Yaw/Pitch Inputs Instead" ) + + TOOL.Information = { + { name = "left_0", stage = 0, text = "Create/Update " .. TOOL.Name }, + { name = "left_1", stage = 1, text = "Set the Angle, hold Shift to lock to 45 degrees" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 10 ) diff --git a/lua/wire/stools/watersensor.lua b/lua/wire/stools/watersensor.lua index 1a47c4ed1b..62f73f2ead 100644 --- a/lua/wire/stools/watersensor.lua +++ b/lua/wire/stools/watersensor.lua @@ -4,8 +4,8 @@ WireToolSetup.open( "watersensor", "Water Sensor", "gmod_wire_watersensor", nil, if CLIENT then language.Add( "Tool.wire_watersensor.name", "Water Sensor Tool (Wire)" ) language.Add( "Tool.wire_watersensor.desc", "Spawns a constant Water Sensor prop for use with the wire system." ) - language.Add( "Tool.wire_watersensor.0", "Primary: Create/Update Water Sensor" ) language.Add( "WireWatersensorTool_watersensor", "Water Sensor:" ) + TOOL.Information = { { name = "left", text = "Create/Update " .. TOOL.Name } } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/waypoint.lua b/lua/wire/stools/waypoint.lua index cdde3e4f7c..60b68ada6a 100644 --- a/lua/wire/stools/waypoint.lua +++ b/lua/wire/stools/waypoint.lua @@ -2,12 +2,16 @@ WireToolSetup.setCategory( "Detection/Beacon" ) WireToolSetup.open( "waypoint", "Waypoint", "gmod_wire_waypoint", nil, "Waypoints" ) if ( CLIENT ) then - language.Add( "Tool.wire_waypoint.name", "Waypoint Beacon Tool (Wire)" ) - language.Add( "Tool.wire_waypoint.desc", "Spawns a waypoint beacon for use with the wire system." ) - language.Add( "Tool.wire_waypoint.0", "Primary: Create/Update Waypoint Beacon, Secondary: Link to next waypoint, Reload: Remove link to next waypoint" ) - language.Add( "Tool.wire_waypoint.1", "Primary: Select waypoint to go to after this one" ) - language.Add( "WireWaypointTool_range", "Range:" ) + language.Add( "Tool.wire_waypoint.name", "Waypoint Beacon Tool (Wire)" ) + language.Add( "Tool.wire_waypoint.desc", "Spawns a waypoint beacon for use with the wire system." ) + language.Add( "WireWaypointTool_range", "Range:" ) language.Add( "WireWaypointTool_alink", "Auto-link previous" ) + TOOL.Information = { + { name = "left_0", stage = 0, text = "Create/Update " .. TOOL.Name }, + { name = "right_0", stage = 0, text = "Link to next waypoint" }, + { name = "reload_0", stage = 0, text = "Remove link to next waypoint" }, + { name = "left_1", stage = 1, text = "Select waypoint to go to after this one" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 30 ) diff --git a/lua/wire/stools/weight.lua b/lua/wire/stools/weight.lua index 4b42e65b28..714c2cdc5d 100644 --- a/lua/wire/stools/weight.lua +++ b/lua/wire/stools/weight.lua @@ -4,7 +4,10 @@ WireToolSetup.open( "weight", "Weight (Adjustable)", "gmod_wire_weight", nil, "A if CLIENT then language.Add( "tool.wire_weight.name", "Weight Tool (Wire)" ) language.Add( "tool.wire_weight.desc", "Spawns a weight." ) - language.Add( "tool.wire_weight.0", "Primary: Create/Update weight, Reload: Copy model" ) + TOOL.Information = { + { name = "left", text = "Create/Update " .. TOOL.Name }, + { name = "reload", text = "Copy model" }, + } end WireToolSetup.BaseLang() WireToolSetup.SetupMax( 20 ) diff --git a/lua/wire/stools/wheel.lua b/lua/wire/stools/wheel.lua index 147a0f49e5..4f24e60e5a 100644 --- a/lua/wire/stools/wheel.lua +++ b/lua/wire/stools/wheel.lua @@ -4,7 +4,7 @@ WireToolSetup.open( "wheel", "Wheel", "gmod_wire_wheel", nil, "Wheels" ) if CLIENT then language.Add( "tool.wire_wheel.name", "Wheel Tool (wire)" ) language.Add( "tool.wire_wheel.desc", "Attaches a wheel to something." ) - language.Add( "tool.wire_wheel.0", "Click on a prop to attach a wheel." ) + TOOL.Information = { { name = "left", text = "Attach a wheel" } } language.Add( "tool.wire_wheel.group", "Input value to go forward:" ) language.Add( "tool.wire_wheel.group_reverse", "Input value to go in reverse:" ) diff --git a/lua/wire/tool_loader.lua b/lua/wire/tool_loader.lua index 30d20c96a6..38801bec1b 100644 --- a/lua/wire/tool_loader.lua +++ b/lua/wire/tool_loader.lua @@ -463,11 +463,18 @@ end -- optional function to add the basic language for basic tools -function WireToolSetup.BaseLang( pluralname ) +function WireToolSetup.BaseLang() if CLIENT then language.Add( "undone_"..TOOL.WireClass, "Undone Wire "..TOOL.Name ) - language.Add( "Cleanup_"..TOOL.WireClass, "Wire "..(TOOL.PluralName or pluralname) ) - language.Add( "Cleaned_"..TOOL.WireClass, "Cleaned Up Wire "..(TOOL.PluralName or pluralname) ) + if TOOL.PluralName then + language.Add( "Cleanup_"..TOOL.WireClass, "Wire "..TOOL.PluralName ) + language.Add( "Cleaned_"..TOOL.WireClass, "Cleaned Up Wire "..TOOL.PluralName ) + end + for _, info in pairs(TOOL.Information or {}) do + if info.text then + language.Add("Tool." .. TOOL.Mode .. "." .. info.name, info.text) + end + end end cleanup.Register(TOOL.WireClass) end @@ -487,12 +494,36 @@ end -- The SENT should have ENT:LinkEnt(e), ENT:UnlinkEnt(e), and ENT:ClearEntities() -- It should also send ENT.Marks to the client via WireLib.SendMarks(ent) -- Pass it true to disable linking multiple entities (ie for Pod Controllers) -function WireToolSetup.SetupLinking(SingleLink) +function WireToolSetup.SetupLinking(SingleLink, linkedname) TOOL.SingleLink = SingleLink + linkedname = linkedname or "entity" if CLIENT then - language.Add( "Tool."..TOOL.Mode..".0", "Primary: Create "..TOOL.Name..", Secondary: Link entities, Reload: Unlink entities" ) - language.Add( "Tool."..TOOL.Mode..".1", "Now select the entity to link to" .. (SingleLink and "" or " (Tip: Hold shift to link to more entities)")) - language.Add( "Tool."..TOOL.Mode..".2", "Now select the entity to unlink" .. (SingleLink and "" or " (Tip: Hold shift to unlink from more entities). Reload on the same controller again to clear all linked entities." )) + if TOOL.Information == nil or next(TOOL.Information) == nil then + TOOL.Information = { + { name = "left_0", stage = 0 }, + { name = "right_0", stage = 0 }, + { name = "reload_0", stage = 0 }, + { name = "right_1", stage = 1 }, + { name = "right_2", stage = 2 }, + } + if not SingleLink then + table.insert(TOOL.Information, { name = "info_1", stage = 1 }) + table.insert(TOOL.Information, { name = "info_2", stage = 2 }) + table.insert(TOOL.Information, { name = "reload_2", stage = 2 }) + end + end + + language.Add( "Tool."..TOOL.Mode..".left_0", "Create/Update "..TOOL.Name ) + language.Add( "Tool."..TOOL.Mode..".right_0", "Select a " .. TOOL.Name .. " to link to" ) + language.Add( "Tool."..TOOL.Mode..".reload_0", "Unlink everything from a " .. TOOL.Name ) + language.Add( "Tool."..TOOL.Mode..".right_1", "Now select the " .. linkedname .. " to link to" ) + language.Add( "Tool."..TOOL.Mode..".right_2", "Now select the " .. linkedname .. " to unlink" ) + + if not SingleLink then + language.Add( "Tool."..TOOL.Mode..".info_1", "Hold shift to link to more") + language.Add( "Tool."..TOOL.Mode..".info_2", "Hold shift to unlink from more") + language.Add( "Tool."..TOOL.Mode..".reload_2", "Reload on the same controller again to clear all linked entities.") + end function TOOL:DrawHUD() local trace = self:GetOwner():GetEyeTrace() diff --git a/readme.md b/readme.md index 14cdd2478f..1ac8271d4b 100644 --- a/readme.md +++ b/readme.md @@ -15,7 +15,7 @@ Simply clone this repository into your `addons` folder: # License -Copyright 2009-2016 Wire Team +Copyright 2009-2017 Wire Team Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -25,3 +25,7 @@ Unless required by applicable law or agreed to in writing, software distributed [Garry's Mod]: [workshop]: + +# Contributor Guidelines + +See CONTRIBUTING.md for guidelines on contributing and participating in the wiremod project.