├── .github └── ISSUE_TEMPLATE.md ├── .gitignore ├── README.md ├── addon.json ├── docs └── Expression Advanced 3 Docs.pdf ├── icon.jpg ├── lua ├── autorun │ └── expression3.lua ├── entities │ ├── e3_ring.lua │ ├── wire_expression3_base │ │ ├── cl_init.lua │ │ ├── init.lua │ │ ├── sh_context.lua │ │ ├── sh_cppi.lua │ │ └── shared.lua │ ├── wire_expression3_hologram.lua │ └── wire_expression3_screen.lua ├── expression3 │ ├── compiler.lua │ ├── core │ │ ├── boolean.lua │ │ ├── error.lua │ │ ├── events.lua │ │ ├── init.lua │ │ ├── math.lua │ │ ├── string.lua │ │ ├── system.lua │ │ ├── userclasses.lua │ │ ├── userfunctions.lua │ │ ├── variant.lua │ │ └── void.lua │ ├── debuger.lua │ ├── editor.lua │ ├── editor │ │ ├── derma │ │ │ ├── autocomplete.lua │ │ │ ├── button.lua │ │ │ ├── checkbox.lua │ │ │ ├── closebutton.lua │ │ │ ├── colorselect.lua │ │ │ ├── console.lua │ │ │ ├── console2.lua │ │ │ ├── dhtml.lua │ │ │ ├── editor.lua │ │ │ ├── filebrowser.lua │ │ │ ├── filemenu.lua │ │ │ ├── findreplace.lua │ │ │ ├── frame.lua │ │ │ ├── hscrollbar.lua │ │ │ ├── ide.lua │ │ │ ├── imagebutton.lua │ │ │ ├── options.lua │ │ │ ├── propertysheet.lua │ │ │ ├── sidebar.lua │ │ │ ├── simpletabs.lua │ │ │ ├── statebutton.lua │ │ │ ├── syntax.lua │ │ │ ├── syntax │ │ │ │ ├── syntax_console.lua │ │ │ │ ├── syntax_e3.lua │ │ │ │ ├── syntax_e3_tokenizer.lua │ │ │ │ └── syntax_lua.lua │ │ │ ├── textentry.lua │ │ │ ├── toolbar.lua │ │ │ └── tree.lua │ │ ├── expr_editor_lib.lua │ │ ├── font.lua │ │ ├── share.lua │ │ ├── style.lua │ │ └── vector2.lua │ ├── expr_lib.lua │ ├── extensions │ │ ├── angle.lua │ │ ├── applyforce.lua │ │ ├── bones.lua │ │ ├── canvas.lua │ │ ├── color.lua │ │ ├── constraints.lua │ │ ├── datetime.lua │ │ ├── e2table.lua │ │ ├── entity.lua │ │ ├── find.lua │ │ ├── game.lua │ │ ├── holograms.lua │ │ ├── http.lua │ │ ├── keypress.lua │ │ ├── matrix.lua │ │ ├── network.lua │ │ ├── player.lua │ │ ├── propcore.lua │ │ ├── quaternion.lua │ │ ├── ranger.lua │ │ ├── render.lua │ │ ├── sound.lua │ │ ├── table.lua │ │ ├── timers.lua │ │ ├── urlmaterials.lua │ │ ├── vector.lua │ │ ├── vector2.lua │ │ └── wirelink.lua │ ├── helper │ │ ├── csv │ │ │ ├── attributes.txt │ │ │ ├── functions.txt │ │ │ └── methods.txt │ │ ├── database.lua │ │ ├── derma.lua │ │ ├── examples │ │ │ ├── clock.lua │ │ │ └── e3 101.lua │ │ └── templates.lua │ ├── parser.lua │ ├── permissions │ │ ├── database.lua │ │ ├── extension.lua │ │ ├── gate_browser.lua │ │ ├── menu.lua │ │ ├── tekmenu.lua │ │ └── url_browser.lua │ ├── tokenizer.lua │ └── uploader.lua └── wire │ └── stools │ ├── expression3.lua │ └── expression3_screen.lua ├── materials ├── diagona-icons │ ├── 131.png │ ├── 132.png │ ├── 152.png │ └── v-grip.png ├── e3_discord.png ├── e3_github.png ├── e3_youtube.png ├── e3skin │ └── PermissionsPanelBG.png ├── fugue │ ├── application-sidebar-collapse.png │ ├── application-sidebar-expand.png │ ├── application-sidebar-list.png │ ├── arrow-090-small.png │ ├── arrow-090.png │ ├── arrow-270-small.png │ ├── arrow-270.png │ ├── arrow-circle-small.png │ ├── arrow-circle.png │ ├── arrow-resize.png │ ├── arrow-return-000-left.png │ ├── arrow-retweet.png │ ├── asterisk-small.png │ ├── balloon-ellipsis.png │ ├── binocular-small.png │ ├── binocular.png │ ├── block.png │ ├── blue-folder--plus.png │ ├── blue-folder-horizontal-open.png │ ├── blue-folder-horizontal.png │ ├── book-bookmark.png │ ├── book-open-bookmark.png │ ├── book.png │ ├── bug.png │ ├── camera-lens.png │ ├── controller-d-pad.png │ ├── cross-button.png │ ├── cross-script.png │ ├── disk-black.png │ ├── disk.png │ ├── disks-black.png │ ├── disks.png │ ├── document-copy.png │ ├── document-node.png │ ├── drive-upload.png │ ├── edit-lowercase.png │ ├── edit-size-down.png │ ├── edit-size-up.png │ ├── edit-superscript.png │ ├── exclamation-circle.png │ ├── exclamation-red.png │ ├── eye--arrow.png │ ├── fire.png │ ├── gear.png │ ├── globe-network.png │ ├── hand-shake.png │ ├── headstone-cross.png │ ├── home.png │ ├── keyboard-smiley.png │ ├── keyboard-space.png │ ├── lock-warning.png │ ├── magnifier--minus.png │ ├── magnifier--plus.png │ ├── magnifier-left.png │ ├── magnifier.png │ ├── microphone--minus.png │ ├── microphone--plus.png │ ├── microphone.png │ ├── minus-small-circle.png │ ├── monitor-network.png │ ├── monitor-screensaver.png │ ├── monitor-window-3d.png │ ├── node-insert-child.png │ ├── node-insert-next.png │ ├── palette-paint-brush.png │ ├── pencil.png │ ├── plus-button.png │ ├── printer-monochrome.png │ ├── question.png │ ├── quill.png │ ├── regular-expression-search-match.png │ ├── regular-expression.png │ ├── rocket-fly.png │ ├── script--minus.png │ ├── script--pencil.png │ ├── script--plus.png │ ├── script-text.png │ ├── script.png │ ├── selection-input.png │ ├── selection-select-input.png │ ├── selection-select.png │ ├── selection.png │ ├── share.png │ ├── speaker-volume.png │ ├── state-client.png │ ├── state-server.png │ ├── state-shared.png │ ├── switch.png │ ├── terminal--arrow.png │ ├── tick-small-circle.png │ ├── tick.png │ ├── toggle-small-expand.png │ ├── toggle-small.png │ ├── xfn.png │ └── youtube.png ├── lemongate │ ├── lemongate_chip_aperture_orange_dif.vtf │ ├── lemongate_chip_aperture_white_dif.vtf │ ├── lemongate_chip_dif.vtf │ ├── lemongate_chip_norm.vtf │ ├── skin1.vmt │ ├── skin2.vmt │ └── skin3.vmt ├── mandrac │ └── wire │ │ ├── e3.2323.vmt │ │ ├── e3.vmt │ │ ├── e3.vtf │ │ └── e3_normal.vtf ├── nezzkryptic │ ├── base.vmt │ ├── e3_chip.vtf │ ├── gear.vmt │ ├── pins.vmt │ └── text.vmt ├── omicron │ ├── bulb.vmt │ ├── bulb.vtf │ └── bulb_512.png ├── oskar │ ├── arrow-left.png │ ├── arrow-right.png │ ├── close.png │ ├── minus.png │ ├── minus32.png │ ├── plus.png │ └── plus32.png ├── shadowscion │ └── lemongate │ │ ├── gate.vmt │ │ ├── gate_d.vtf │ │ └── gate_n.vtf ├── tanknut │ ├── bosd.png │ ├── bosd.vmt │ └── bosd.vtf └── tek │ ├── arrow.png │ ├── backgroundcorneright.png │ ├── backgroundcornerleft.png │ ├── bottomcorneright.png │ ├── bottomcornerleft.png │ ├── iconexclamation.png │ ├── topcornerleft.png │ └── topcornerright.png ├── models ├── lemongate │ ├── GibsModel_chipmesh001.dx80.vtx │ ├── GibsModel_chipmesh001.dx90.vtx │ ├── GibsModel_chipmesh001.phy │ ├── GibsModel_chipmesh001.sw.vtx │ ├── GibsModel_chipmesh001.xbox.vtx │ ├── GibsModel_fanmesh001.dx80.vtx │ ├── GibsModel_fanmesh001.dx90.vtx │ ├── GibsModel_fanmesh001.phy │ ├── GibsModel_fanmesh001.sw.vtx │ ├── GibsModel_fanmesh001.xbox.vtx │ ├── gibsmodel_chipmesh001.mdl │ ├── gibsmodel_chipmesh001.vvd │ ├── gibsmodel_fanmesh001.mdl │ ├── gibsmodel_fanmesh001.vvd │ ├── lemongate.dx80.vtx │ ├── lemongate.dx90.vtx │ ├── lemongate.mdl │ ├── lemongate.phy │ ├── lemongate.sw.vtx │ ├── lemongate.vvd │ └── lemongate.xbox.vtx ├── mandrac │ └── wire │ │ ├── e3.dx80.vtx │ │ ├── e3.dx90.vtx │ │ ├── e3.mdl │ │ ├── e3.phy │ │ ├── e3.sw.vtx │ │ └── e3.vvd ├── nezzkryptic │ ├── e3_chip.dx80.vtx │ ├── e3_chip.dx90.vtx │ ├── e3_chip.mdl │ ├── e3_chip.phy │ ├── e3_chip.sw.vtx │ └── e3_chip.vvd ├── shadowscion │ └── lemongate │ │ ├── gate.dx80.vtx │ │ ├── gate.dx90.vtx │ │ ├── gate.mdl │ │ ├── gate.phy │ │ ├── gate.sw.vtx │ │ └── gate.vvd └── tanknut │ ├── cylinder.dx80.vtx │ ├── cylinder.dx90.vtx │ ├── cylinder.mdl │ ├── cylinder.sw.vtx │ └── cylinder.vvd ├── workshop_fuckvalve.bat ├── workshop_publish.bat └── workshop_update.bat /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | NOTE: 2 | 3 | 1. If you wish to alert us of more than one issue or request please submit them separately! 4 | 2. Please make sure that any long quotes of text (e.g code) should be submitted in the form of a [gist](gist.github.com) link. 5 | 3. Check that your request / issue has not already been mentioned, if it has please comment on the existing page instead. 6 | 4. If this is a request, please clear the template below and provide your request in as much detail as possible. 7 | 5. Please fill out the following template as accurately as possible: 8 | 9 | 1. Have you checked it with the latest version of the repository: 10 | If no, please do so and if you are not on the latest version, please update and re-test. 11 | 12 | 2. How many people are experiencing it (to your knowledge, including yourself): 13 | 14 | 3. Please describe in brief the issue you are experiencing: 15 | 16 | 4. If your getting any errors in game console, please provide them below. 17 | 18 | 5. If your getting either a tokenizer, parser, compiler or internal error, please provide that below. 19 | 20 | 5.1 Please provide a [gist](gist.github.com) link to your code. 21 | 22 | 5.2 Please run the validation debugger and provide screenshots of the output tab. You can do this by right-clicking the validation bar and selecting "Validate and debug". 23 | 24 | 6. Please make sure to prefix your title with either [BUG] for issues or [REQ] for requests, as well as attaching any suitable labels. 25 | 7. Is this issue linked to a specific code you are trying to execute: 26 | If yes, please provide a [gist](gist.github.com) of your code: 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | e3workspace.code-workspace 2 | glualint.json 3 | lua/expression3/editor/todo.org 4 | .vscode/settings.json 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ExpAdv3 2 | Expression Advanced 3 3 | 4 | ## Install Instructions: 5 | Copy ExpAdv3 folder into your Gmod addons folder, if you are on a Linux enviroment you will need to rename the folder to expadv3 (lower case) or the addon will not load. 6 | 7 | Make sure to remove any old ExpAdv2 or Lemongate addons from Garrysmod before installing, if you have installed these via workshop you will need to delete the workshop file in your addons folder. 8 | 9 | 10 | ## Links: 11 | 12 | Workshop (Will be regularly updated but not as much as GitHub): 13 | https://steamcommunity.com/sharedfiles/filedetails/?id=2001386268 14 | 15 | Video Tutorials: 16 | https://steamcommunity.com/sharedfiles/filedetails/?id=2001386268 17 | 18 | #Trello: 19 | https://trello.com/b/SwiMrYBH/expression-advanced-3 20 | 21 | #Grammar: 22 | https://github.com/Rusketh/ExpAdv3/blob/master/lua/expression3/parser.lua#L14 23 | 24 | #Extensions and API: 25 | https://github.com/Rusketh/ExpAdv3/blob/master/docs/Expression%20Advanced%203%20Docs.pdf 26 | 27 | #Discord: 28 | https://discord.gg/CtBdU7m 29 | 30 | # Attributions 31 | 32 | ## Yusuke Kamiyamane [Fugue Icons] 33 | 34 | https://p.yusukekamiyamane.com/ 35 | 36 | All rights of Fugue Icons belong to origonal authors. 37 | 38 | Used under Creative Commons Attribution 3.0 License (https://creativecommons.org/licenses/by/3.0) 39 | -------------------------------------------------------------------------------- /addon.json: -------------------------------------------------------------------------------- 1 | { 2 | "title" : "Expression 3", 3 | "type" : "tool", 4 | "tags" : [ "build", "fun" ], 5 | "description": "The Expression Three Beta.", 6 | "ignore" : 7 | [ 8 | "*.jpg", 9 | "*.bat", 10 | "*.txt", 11 | "*.md", 12 | ".git*", 13 | "*.pdf", 14 | "pre-commit", 15 | "LICENSE", 16 | "*.org", 17 | "*.code-workspace", 18 | "glualint.json", 19 | ".vscode*" 20 | ] 21 | } -------------------------------------------------------------------------------- /docs/Expression Advanced 3 Docs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/docs/Expression Advanced 3 Docs.pdf -------------------------------------------------------------------------------- /icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/icon.jpg -------------------------------------------------------------------------------- /lua/autorun/expression3.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ____ _ _ ___ ___ ____ ___ ___ __ ____ _ _ _ ___ _ _ ____ 3 | F ___J FJ LJ F _ ", F _ ", F ___J F __". F __". FJ F __ ] F L L] /.\ F __". FJ L] F___ J 4 | J |___: J \/ F J `-' |J `-'(| J |___: J (___| J (___| J L J |--| L J \| L //_\\ J |--\ LJ | | L `-__| L 5 | | _____| / \ | __/F| _ L | _____| J\___ \ J\___ \ | | | | | | | |\ | / ___ \ | | J |J J F L |__ ( 6 | F L____: / /\ \ F |__/ F |_\ L F L____: .--___) \.--___) \ F J F L__J J F L\\ J / L___J \ F L__J |J\ \/ /F .-____] J 7 | J________LJ__//\\__LJ__| J__| \\__LJ________LJ\______JJ\______JJ____LJ\______/FJ__L \\__L J__L J__LJ______/F \\__// J\______/F 8 | |________||__/ \__||__L |__| J__||________| J______F J______F|____| J______F |__L J__| |__L J__||______F \__/ J______F 9 | 10 | ::AutoRun:: 11 | ]] 12 | 13 | print("------------------------------------------------------------"); 14 | print("Installing..."); 15 | print("Expression Advanced 3"); 16 | print("------------------------------------------------------------"); 17 | 18 | 19 | EXPR_ROOT = ""; 20 | 21 | local _, addons = file.Find("addons\\*", "GAME"); 22 | 23 | for _, addon in pairs( addons ) do 24 | if file.Exists( string.format("addons\\%s\\lua\\autorun\\expression3.lua", addon), "GAME" ) then 25 | EXPR_ROOT = string.format("addons\\%s\\", addon); 26 | break; 27 | end 28 | end 29 | 30 | 31 | print("E3 Root directory:", EXPR_ROOT); 32 | 33 | if (SERVER) then 34 | AddCSLuaFile(); 35 | 36 | AddCSLuaFile("expression3/expr_lib.lua"); 37 | 38 | AddCSLuaFile("expression3/tokenizer.lua"); 39 | AddCSLuaFile("expression3/parser.lua"); 40 | AddCSLuaFile("expression3/compiler.lua"); 41 | AddCSLuaFile("expression3/debuger.lua"); 42 | 43 | AddCSLuaFile("expression3/uploader.lua"); 44 | AddCSLuaFile("expression3/core/init.lua"); 45 | 46 | AddCSLuaFile( "expression3/editor.lua" ) 47 | 48 | AddCSLuaFile( "expression3/editor/vector2.lua" ) 49 | AddCSLuaFile( "expression3/editor/font.lua" ) 50 | AddCSLuaFile( "expression3/editor/style.lua" ) 51 | AddCSLuaFile( "expression3/editor/expr_editor_lib.lua" ) 52 | 53 | AddCSLuaFile( "expression3/editor/derma/autocomplete.lua" ) 54 | AddCSLuaFile( "expression3/editor/derma/button.lua" ) 55 | AddCSLuaFile( "expression3/editor/derma/checkbox.lua" ) 56 | AddCSLuaFile( "expression3/editor/derma/closebutton.lua" ) 57 | AddCSLuaFile( "expression3/editor/derma/colorselect.lua" ) 58 | AddCSLuaFile( "expression3/editor/derma/console.lua" ) 59 | AddCSLuaFile( "expression3/editor/derma/dhtml.lua" ) 60 | AddCSLuaFile( "expression3/editor/derma/editor.lua" ) 61 | AddCSLuaFile( "expression3/editor/derma/filebrowser.lua" ) 62 | AddCSLuaFile( "expression3/editor/derma/filemenu.lua" ) 63 | AddCSLuaFile( "expression3/editor/derma/findreplace.lua" ) 64 | AddCSLuaFile( "expression3/editor/derma/frame.lua" ) 65 | AddCSLuaFile( "expression3/editor/derma/hscrollbar.lua" ) 66 | AddCSLuaFile( "expression3/editor/derma/ide.lua" ) 67 | AddCSLuaFile( "expression3/editor/derma/imagebutton.lua" ) 68 | AddCSLuaFile( "expression3/editor/derma/options.lua" ) 69 | AddCSLuaFile( "expression3/editor/derma/propertysheet.lua" ) 70 | AddCSLuaFile( "expression3/editor/derma/simpletabs.lua" ) 71 | AddCSLuaFile( "expression3/editor/derma/statebutton.lua" ) 72 | AddCSLuaFile( "expression3/editor/derma/syntax.lua" ) 73 | AddCSLuaFile( "expression3/editor/derma/syntax/syntax_console.lua" ) 74 | AddCSLuaFile( "expression3/editor/derma/syntax/syntax_e3.lua" ) 75 | AddCSLuaFile( "expression3/editor/derma/syntax/syntax_lua.lua" ) 76 | AddCSLuaFile( "expression3/editor/derma/textentry.lua" ) 77 | AddCSLuaFile( "expression3/editor/derma/toolbar.lua" ) 78 | AddCSLuaFile( "expression3/editor/derma/tree.lua" ) 79 | 80 | resource.AddWorkshop("2001386268"); 81 | 82 | resource.AddFile("models/lemongate/gibsmodel_chipmesh001.mdl"); 83 | resource.AddFile("models/lemongate/gibsmodel_fanmesh001.mdl"); 84 | resource.AddFile("models/lemongate/lemongate.mdl"); 85 | resource.AddFile("models/mandrac/wire/e3.mdl"); 86 | resource.AddFile("models/nezzkryptic/e3_chip.mdl"); 87 | resource.AddFile("models/shadowscion/lemongate/gate.mdl"); 88 | resource.AddFile("models/tanknut/cylinder.mdl"); 89 | 90 | local addAll; 91 | 92 | addAll = function(path, gamepath) 93 | 94 | local files, folders = file.Find(path, gamepath); 95 | 96 | if (files) then 97 | for _, file in pairs(files) do 98 | resource.AddFile( string.format("%s/%s", path, file) ); 99 | end 100 | end 101 | 102 | if (folders) then 103 | for _, folder in pairs(folders) do 104 | addAll( string.format("%s/%s", path, folder), gamepath ); 105 | end 106 | end 107 | end; 108 | 109 | addAll(string.format("%s/materials", EXPR_ROOT), "GAME"); 110 | addAll(string.format("%s/models", EXPR_ROOT), "GAME"); 111 | 112 | addAll(string.format("%s/lua/expression3/helper/csv", EXPR_ROOT), "GAME"); 113 | addAll(string.format("%s/lua/expression3/helper/custom", EXPR_ROOT), "GAME"); 114 | addAll(string.format("%s/lua/expression3/helper/examples", EXPR_ROOT), "GAME"); 115 | 116 | include("expression3/expr_lib.lua"); 117 | 118 | elseif (CLIENT) then 119 | include("expression3/expr_lib.lua"); 120 | end 121 | 122 | print("------------------------------------------------------------"); 123 | print("Expression Advanced 3"); 124 | print("Has been installed"); 125 | print("------------------------------------------------------------"); -------------------------------------------------------------------------------- /lua/entities/wire_expression3_base/sh_cppi.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ____ _ _ ___ ___ ____ ___ ___ __ ____ _ _ _ ___ _ _ ____ 3 | F ___J FJ LJ F _ ", F _ ", F ___J F __". F __". FJ F __ ] F L L] /.\ F __". FJ L] F___ J 4 | J |___: J \/ F J `-' |J `-'(| J |___: J (___| J (___| J L J |--| L J \| L //_\\ J |--\ LJ | | L `-__| L 5 | | _____| / \ | __/F| _ L | _____| J\___ \ J\___ \ | | | | | | | |\ | / ___ \ | | J |J J F L |__ ( 6 | F L____: / /\ \ F |__/ F |_\ L F L____: .--___) \.--___) \ F J F L__J J F L\\ J / L___J \ F L__J |J\ \/ /F .-____] J 7 | J________LJ__//\\__LJ__| J__| \\__LJ________LJ\______JJ\______JJ____LJ\______/FJ__L \\__L J__L J__LJ______/F \\__// J\______/F 8 | |________||__/ \__||__L |__| J__||________| J______F J______F|____| J______F |__L J__| |__L J__||______F \__/ J______F 9 | 10 | ::Expression 3 CPPI:: 11 | 12 | E3 Will require CPPI interface for the entity, 13 | if it doesnt exist it needs to fake one. 14 | ]] 15 | 16 | AddCSLuaFile(); 17 | 18 | --[[ 19 | ]] 20 | 21 | if (not CPPI) then 22 | function ENT:CPPIGetOwner() 23 | return self:GetPlayer(); 24 | end 25 | 26 | if (SERVER) then 27 | function ENT:CPPISetOwner(ply) 28 | if (IsValid(ply) and ply:IsPlayer()) then 29 | self:SetPlayer(ply); 30 | end 31 | 32 | return true 33 | end 34 | 35 | function ENT:CPPICanTool(ply, tool) 36 | return ply == self:GetPlayer(); 37 | end 38 | 39 | function ENT:CPPICanPhysgun(ply) 40 | return ply == self:GetPlayer(); 41 | end 42 | 43 | function ENT:CPPICanPickup(ply) 44 | return ply == self:GetPlayer(); 45 | end 46 | 47 | function ENT:CPPICanPunt(ply) 48 | return ply == self:GetPlayer(); 49 | end 50 | 51 | function ENT:CPPICanUse(ply) 52 | return ply == self:GetPlayer(); 53 | end 54 | 55 | function ENT:CPPICanDamage(ply) 56 | return ply == self:GetPlayer(); 57 | end 58 | 59 | function ENT:CPPICanProperty(ply, property) 60 | return ply == self:GetPlayer(); 61 | end 62 | 63 | function ENT:CPPICanEditVariable(ply, key, val, editTbl) 64 | return ply == self:GetPlayer(); 65 | end 66 | end 67 | end -------------------------------------------------------------------------------- /lua/expression3/core/boolean.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ***************************************************************************************************************************************************** 3 | create a new extention 4 | ***************************************************************************************************************************************************** 5 | ]]-- 6 | 7 | local extension = EXPR_LIB.RegisterExtension("boolean"); 8 | 9 | --[[ 10 | ***************************************************************************************************************************************************** 11 | register boolean class 12 | ***************************************************************************************************************************************************** 13 | ]]-- 14 | 15 | local class_bool = extension:RegisterClass("b", {"boolean", "bool"}, isbool, EXPR_LIB.NOTNIL); 16 | 17 | extension:RegisterNativeDefault("b", "false"); 18 | 19 | extension:RegisterWiredInport("b", "NORMAL", function(i) 20 | return i ~= 0; 21 | end); 22 | 23 | extension:RegisterWiredOutport("b", "NORMAL", function(o) 24 | return o and 1 or 0; 25 | end); 26 | 27 | extension:RegisterSyncable("b", net.WriteBool, net.ReadBool); 28 | 29 | --[[ 30 | ***************************************************************************************************************************************************** 31 | boolean operations 32 | ***************************************************************************************************************************************************** 33 | ]]-- 34 | 35 | extension:RegisterOperator("neq", "b,b", "b", 1); 36 | extension:RegisterOperator( "eq", "b,b", "b", 1); 37 | extension:RegisterOperator("and", "b,b", "b", 1); 38 | extension:RegisterOperator( "or", "b,b", "b", 1); 39 | extension:RegisterOperator( "is", "b", "b", 1); 40 | extension:RegisterOperator("not", "b", "b", 1); 41 | extension:RegisterOperator("ten", "b,b,b", "b", 1); 42 | 43 | --[[ 44 | ***************************************************************************************************************************************************** 45 | Boolean to number and back 46 | ***************************************************************************************************************************************************** 47 | ]]-- 48 | 49 | extension:RegisterCastingOperator("n", "b", function(b) 50 | return b and 1 or 0; 51 | end, false); 52 | 53 | extension:RegisterCastingOperator("b", "n", function(n) 54 | return n ~= 0 and true or false; 55 | end, false); 56 | 57 | --[[ 58 | ***************************************************************************************************************************************************** 59 | 60 | ***************************************************************************************************************************************************** 61 | ]]-- 62 | 63 | extension:EnableExtension(); 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /lua/expression3/core/error.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ***************************************************************************************************************************************************** 3 | create a new extention 4 | ***************************************************************************************************************************************************** 5 | ]]-- 6 | 7 | local extension = EXPR_LIB.RegisterExtension("error"); 8 | 9 | --[[ 10 | ***************************************************************************************************************************************************** 11 | register error class 12 | ***************************************************************************************************************************************************** 13 | ]]-- 14 | 15 | local class_error = extension:RegisterClass("er", {"error"}, istable, EXPR_LIB.NOTNIL); 16 | 17 | --[[ 18 | ***************************************************************************************************************************************************** 19 | error constructor 20 | ***************************************************************************************************************************************************** 21 | ]]-- 22 | 23 | extension:RegisterConstructor("er", "s", function(ctx, msg) 24 | local err = {}; 25 | err.state = "runtime"; 26 | err.char = 0; 27 | err.line = 0; 28 | err.msg = msg; 29 | err.ctx = ctx; 30 | return err; 31 | end); 32 | 33 | 34 | --[[ 35 | ***************************************************************************************************************************************************** 36 | Error methods 37 | ***************************************************************************************************************************************************** 38 | ]]-- 39 | 40 | extension:RegisterMethod("er", "message", "", "s", 1, function(err) 41 | return err and err.msg or "n/a"; 42 | end, true); 43 | 44 | extension:RegisterMethod("er", "char", "", "n", 1, function(err) 45 | return err and err.char or 0; 46 | end, true); 47 | 48 | extension:RegisterMethod("er", "line", "", "n", 1, function(err) 49 | return err and err.line or 0; 50 | end, true); 51 | 52 | --[[ 53 | ***************************************************************************************************************************************************** 54 | 55 | ***************************************************************************************************************************************************** 56 | ]]-- 57 | 58 | extension:EnableExtension(); 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /lua/expression3/core/events.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ***************************************************************************************************************************************************** 3 | create a new extention 4 | ***************************************************************************************************************************************************** 5 | ]]-- 6 | 7 | local extension = EXPR_LIB.RegisterExtension("events"); 8 | 9 | --[[ 10 | ***************************************************************************************************************************************************** 11 | 12 | ***************************************************************************************************************************************************** 13 | ]]-- 14 | 15 | -- When calling this you must always make your varargs into variants e.g "examp" -> {"s", "examp"} 16 | 17 | local function event_call(result, count, name, ...) 18 | for _, context in pairs(EXPR_LIB.GetAll()) do 19 | if (IsValid(context.entity)) then 20 | context.entity:CallEvent(result, count, name, ...); 21 | end 22 | end 23 | end; 24 | 25 | EXPR_LIB.CallEvent = event_call; 26 | 27 | --[[ 28 | ***************************************************************************************************************************************************** 29 | Default events 30 | ***************************************************************************************************************************************************** 31 | ]]-- 32 | 33 | hook.Add("Think", "Expression3.Event", function() 34 | EXPR_LIB.CallEvent("", 0, "Think"); 35 | end); 36 | 37 | --[[ 38 | ***************************************************************************************************************************************************** 39 | Results to table 40 | ***************************************************************************************************************************************************** 41 | ]]-- 42 | 43 | local function resultsToTable(status, class, results) 44 | local t = {{"b", status}}; 45 | for i = 1, #results do t[i + 1] = {class, results[i]} end 46 | return {tbl = t, children = {}, parents = {}, size = #t}; 47 | end 48 | 49 | --[[ 50 | ***************************************************************************************************************************************************** 51 | event library 52 | ***************************************************************************************************************************************************** 53 | ]]-- 54 | 55 | extension:RegisterLibrary("event"); 56 | 57 | extension:RegisterFunction("event", "add", "s,s,f", "", 0, function(context, event, id, udf) 58 | local events = context.events[event]; 59 | 60 | if (not events) then 61 | events = {}; 62 | context.events[event] = events; 63 | end 64 | 65 | events[id] = udf; 66 | end); 67 | 68 | extension:RegisterFunction("event", "remove", "s,s", "", 0, function(context, event, id) 69 | local events = context.events[event]; 70 | 71 | if (not events) then 72 | return; 73 | end 74 | 75 | events[id] = nil; 76 | end); 77 | 78 | extension:RegisterFunction("event", "call", "s,...", "b", 1, function(context, event, ...) 79 | local status = context.ent:CallEvent("", 0, event, ...); 80 | return status; 81 | end); 82 | 83 | extension:RegisterFunction("event", "call", "cls,n,s,...", "t", 1, function(context, class, count, event, ...) 84 | local status, results = context.ent:CallEvent(class, count, event, ...); 85 | return resultsToTable(status, class, results); 86 | end); 87 | 88 | extension:RegisterFunction("event", "call", "e,s,...", "b", 1, function(context, entity, event, ...) 89 | if (not IsValid(entity) or not entity.Expression3) then return end 90 | if not context:CanUseEntity(entity) then return end 91 | local status = entity:CallEvent("", 0, event, ...); 92 | return status; 93 | end); 94 | 95 | extension:RegisterFunction("event", "call", "cls,n,e,s,...", "", 0, function(context, class, count, entity, event, ...) 96 | if (not IsValid(entity) or not entity.Expression3) then return end 97 | if not context:CanUseEntity(entity) then return end 98 | local status, results = entity:CallEvent(class, count, event, ...); 99 | return resultsToTable(status, class, results); 100 | end); 101 | 102 | --[[ 103 | ***************************************************************************************************************************************************** 104 | 105 | ***************************************************************************************************************************************************** 106 | ]]-- 107 | 108 | extension:RegisterEvent("Trigger", "s", "", 0, "Called when a wire input is triggered,"); 109 | extension:RegisterEvent("UseScreen", "n,n,p,e", "", 0); 110 | extension:RegisterEvent("RenderScreen", "n,n,e", "", 0); 111 | extension:RegisterEvent("RenderHUD", "n,n", "", 0); 112 | extension:RegisterEvent("Think", "", "", 0, "Called every interval."); 113 | extension:RegisterEvent("OnPlayerChat","p,s,n", "", 0); 114 | extension:RegisterEvent("OnPlayerSpawn", "p", "", 0); 115 | extension:RegisterEvent("OnPlayerJoin", "p", "", 0); 116 | extension:RegisterEvent("OnPlayerDisconnect", "p", "", 0); 117 | extension:RegisterEvent("OnPlayerDeath", "p,e,e", "", 0); 118 | extension:RegisterEvent("InitializedClient", "p", "", 0, "Called once a client has initalized this script."); 119 | extension:RegisterEvent("ShutDown", "", "", 0, "Called before the gate is removed or reset."); 120 | --[[ 121 | ***************************************************************************************************************************************************** 122 | 123 | ***************************************************************************************************************************************************** 124 | ]]-- 125 | 126 | extension:EnableExtension(); 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /lua/expression3/core/init.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ***************************************************************************************************************************************************** 3 | Add this file to cs lua 4 | ***************************************************************************************************************************************************** 5 | ]]-- 6 | if SERVER then 7 | AddCSLuaFile(); 8 | end 9 | 10 | --[[ 11 | ***************************************************************************************************************************************************** 12 | Define the core libraries 13 | ***************************************************************************************************************************************************** 14 | ]]-- 15 | 16 | local core_files = { 17 | "expression3/core/void.lua", 18 | "expression3/core/math.lua", 19 | "expression3/core/boolean.lua", 20 | "expression3/core/string.lua", 21 | "expression3/core/variant.lua", 22 | "expression3/core/userfunctions.lua", 23 | "expression3/core/userclasses.lua", 24 | "expression3/core/error.lua", 25 | "expression3/core/system.lua", 26 | "expression3/core/events.lua", 27 | 28 | "expression3/helper/database.lua", 29 | "expression3/helper/templates.lua", 30 | "expression3/helper/derma.lua", 31 | 32 | "expression3/permissions/database.lua", 33 | "expression3/permissions/gate_browser.lua", 34 | "expression3/permissions/url_browser.lua", 35 | "expression3/permissions/extension.lua", 36 | "expression3/permissions/tekmenu.lua", 37 | "expression3/permissions/menu.lua", 38 | 39 | }; 40 | 41 | local path = "expression3/extensions/"; 42 | local extensions = file.Find(path .. "*.lua", "LUA"); 43 | 44 | --[[ 45 | ***************************************************************************************************************************************************** 46 | add client side files 47 | ***************************************************************************************************************************************************** 48 | ]]-- 49 | 50 | if SERVER then 51 | for _, filepath in pairs(core_files) do 52 | AddCSLuaFile(filepath); 53 | print("Adding CS file: ", filepath); 54 | end 55 | 56 | for i, filename in pairs( extensions ) do 57 | AddCSLuaFile(path .. filename); 58 | print("Adding CS file: ", path .. filename); 59 | end 60 | end 61 | 62 | --[[ 63 | ***************************************************************************************************************************************************** 64 | load the game 65 | ***************************************************************************************************************************************************** 66 | ]]-- 67 | 68 | hook.Add("Expression3.RegisterExtensions", "Expression3.Core.Extensions", function() 69 | 70 | for i, filename in pairs( core_files ) do 71 | include(filename); 72 | print("[E3] Loading core file " .. filename); 73 | end 74 | 75 | for i, filename in pairs( extensions ) do 76 | include(path .. filename); 77 | print("[E3] Loading file " .. path .. filename); 78 | end 79 | 80 | end); 81 | -------------------------------------------------------------------------------- /lua/expression3/core/userclasses.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ***************************************************************************************************************************************************** 3 | create a new extention 4 | ***************************************************************************************************************************************************** 5 | ]]-- 6 | 7 | local extension = EXPR_LIB.RegisterExtension("userclasses"); 8 | 9 | --[[ 10 | ***************************************************************************************************************************************************** 11 | register userclass class 12 | ***************************************************************************************************************************************************** 13 | ]]-- 14 | 15 | extension:RegisterClass("cls", {"type", "class"}, isstring, isnil); 16 | 17 | extension:RegisterOperator("neq", "cls,cls", "b", 1); 18 | extension:RegisterOperator( "eq", "cls,cls", "b", 1); 19 | 20 | 21 | --[[ 22 | ***************************************************************************************************************************************************** 23 | 24 | ***************************************************************************************************************************************************** 25 | ]]-- 26 | 27 | extension:EnableExtension(); 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /lua/expression3/core/userfunctions.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ***************************************************************************************************************************************************** 3 | create a new extention 4 | ***************************************************************************************************************************************************** 5 | ]]-- 6 | 7 | local extension = EXPR_LIB.RegisterExtension("userfunctions"); 8 | 9 | --[[ 10 | ***************************************************************************************************************************************************** 11 | register user function class 12 | ***************************************************************************************************************************************************** 13 | ]]-- 14 | 15 | local function notnil(obj) 16 | return obj ~= nil and obj ~= _nil 17 | end 18 | 19 | local class_function = extension:RegisterClass("f", {"function"}, istable, notnil); 20 | 21 | if (SERVER) then 22 | WireLib.DT.E3_API = { 23 | op = function() end; signature = ""; result = ""; count = 0 24 | } 25 | end 26 | 27 | extension:RegisterWiredInport("f", "E3_API"); 28 | extension:RegisterWiredOutport("f", "E3_API"); 29 | 30 | --[[ 31 | ***************************************************************************************************************************************************** 32 | 33 | ***************************************************************************************************************************************************** 34 | ]]-- 35 | 36 | extension:EnableExtension(); 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /lua/expression3/core/variant.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ***************************************************************************************************************************************************** 3 | create a new extention 4 | ***************************************************************************************************************************************************** 5 | ]]-- 6 | 7 | local extension = EXPR_LIB.RegisterExtension("variant"); 8 | 9 | --[[ 10 | ***************************************************************************************************************************************************** 11 | register variant or object class 12 | ***************************************************************************************************************************************************** 13 | ]]-- 14 | 15 | local class_object = extension:RegisterClass("vr", {"variant", "object"}, istable, EXPR_LIB.NOTNIL); 16 | 17 | --[[ 18 | ***************************************************************************************************************************************************** 19 | When all classes have loaded, register the casting operations. 20 | ***************************************************************************************************************************************************** 21 | ]]-- 22 | 23 | function extension.PostLoadClasses(this, classes) 24 | 25 | for _, c in pairs(classes) do 26 | local id = c.id; 27 | 28 | if (id ~= "_vr" and id ~= "") then 29 | 30 | extension:RegisterCastingOperator("_vr", id, function(ctx, obj) 31 | return {id, obj}; 32 | end); 33 | 34 | extension:RegisterCastingOperator(id, "_vr", function(ctx, vr) 35 | if (not vr or not vr[1] or vr[2] == nil) then 36 | ctx:Throw("attempt to cast variant of type nil to " .. c.name); 37 | end 38 | 39 | if (vr[1] ~= id) then 40 | ctx:Throw("attempt to cast variant of type " .. vr[1] .. " to " .. c.name); 41 | end 42 | 43 | return vr[2]; 44 | end); 45 | end 46 | end 47 | 48 | end 49 | 50 | --[[ 51 | ***************************************************************************************************************************************************** 52 | 53 | ***************************************************************************************************************************************************** 54 | ]]-- 55 | 56 | extension:EnableExtension(); 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /lua/expression3/core/void.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ***************************************************************************************************************************************************** 3 | create a new extention 4 | ***************************************************************************************************************************************************** 5 | ]]-- 6 | 7 | local extension = EXPR_LIB.RegisterExtension("void"); 8 | 9 | --[[ 10 | ***************************************************************************************************************************************************** 11 | Create a void meta object 12 | ***************************************************************************************************************************************************** 13 | ]]-- 14 | 15 | local Throw = function(void, msg, ...) 16 | local context = rawget(void, "context"); 17 | 18 | if context then 19 | context:Throw("debug-nil:" .. msg, ...); 20 | else 21 | error("Debug: E3 Nil, I forgot to do a thing here?"); 22 | end 23 | end 24 | 25 | local mt = {}; 26 | 27 | mt.__index = function(this, key) 28 | Throw(this, "__index(" .. tostring(key) .. ")"); 29 | end 30 | 31 | mt.__newindex = function(this, key) 32 | Throw(this, "__newindex(" .. tostring(key) .. ")"); 33 | end 34 | 35 | mt.__mode = function(this) 36 | Throw(this, "__mode()"); 37 | end 38 | 39 | mt.__call = function(this) 40 | Throw(this, "__call()"); 41 | end 42 | 43 | mt.__metatable = function(this) 44 | Throw(this, "__call()"); 45 | end 46 | 47 | mt.__tostring = function(this) 48 | Throw(this, "__tostring()"); 49 | end 50 | 51 | mt.__len = function(this) 52 | Throw(this, "__len()"); 53 | end 54 | 55 | mt.__pairs = function(this) 56 | Throw(this, "__pairs()"); 57 | end 58 | 59 | mt.__ipairs = function(this) 60 | Throw(this, "__ipairs()"); 61 | end 62 | 63 | mt.__unm = function(this) 64 | Throw(this, "__unm()"); 65 | end 66 | 67 | mt.__add = function(this) 68 | Throw(this, "__add()"); 69 | end 70 | 71 | mt.__sub = function(this) 72 | Throw(this, "__sub()"); 73 | end 74 | 75 | mt.__mul = function(this) 76 | Throw(this, "__mul()"); 77 | end 78 | 79 | mt.__div = function(this) 80 | Throw(this, "__div()"); 81 | end 82 | 83 | mt.__idiv = function(this) 84 | Throw(this, "__idiv()"); 85 | end 86 | 87 | mt.__mod = function(this) 88 | Throw(this, "__mod()"); 89 | end 90 | 91 | mt.__pow = function(this) 92 | Throw(this, "__pow()"); 93 | end 94 | 95 | mt.__concat = function(this) 96 | Throw(this, "__concat()"); 97 | end 98 | 99 | mt.__band = function(this) 100 | Throw(this, "__band()"); 101 | end 102 | 103 | mt.__bor = function(this ) 104 | Throw(this, "__bor()"); 105 | end 106 | 107 | mt.__bxor = function(this) 108 | Throw(this, "__bxor()"); 109 | end 110 | 111 | mt.__bnot = function(this) 112 | Throw(this, "__bnot()"); 113 | end 114 | 115 | mt.__shl = function(this) 116 | Throw(this, "__shl()"); 117 | end 118 | 119 | mt.__shr = function(this) 120 | Throw(this, "__shr()"); 121 | end 122 | 123 | mt.__tostring = function(this) 124 | return "void"; 125 | end 126 | 127 | mt.__type = "void"; 128 | 129 | ----------------------------------------------- 130 | 131 | local setmetatable = setmetatable; 132 | 133 | EXPR_LIB.Void = function(context) 134 | return setmetatable({ 135 | context = context, 136 | IsValid = function() return false; end, 137 | }, mt); 138 | end; 139 | 140 | --[[ 141 | ***************************************************************************************************************************************************** 142 | When a context is created we need to set up void. 143 | ***************************************************************************************************************************************************** 144 | ]]-- 145 | 146 | hook.Add("Expression3.Entity.BuildSandbox", "Expression3.Void", function(ent, context, env) 147 | local void = EXPR_LIB.Void(context); 148 | context.void = void; 149 | env.void = void; 150 | end); 151 | 152 | --[[ 153 | ***************************************************************************************************************************************************** 154 | register void as a class 155 | ***************************************************************************************************************************************************** 156 | ]]-- 157 | 158 | local function isnil(obj) 159 | return obj == nil or getmetatable(obj) == mt; 160 | end; 161 | 162 | local function notnil(obj) 163 | return obj ~= nil and getmetatable(obj) ~= mt; 164 | end 165 | 166 | EXPR_LIB.ISVOID = isnil; 167 | EXPR_LIB.NOTVOID = notnil; 168 | 169 | local class_nil = extension:RegisterClass("nil", {"void"}, isnil, isnil); 170 | 171 | --[[ 172 | ***************************************************************************************************************************************************** 173 | Nil needs to be compared 174 | ***************************************************************************************************************************************************** 175 | ]]-- 176 | 177 | function extension.PostLoadClasses(this, classes) 178 | for _, c in pairs(classes) do 179 | if (c.id ~= "") then 180 | extension:RegisterOperator("eq", "nil,"..c.id, "b", 1, isnil, true); 181 | extension:RegisterOperator("neq", "nil,"..c.id, "b", 1, notnil, true); 182 | end 183 | end 184 | end 185 | 186 | --[[ 187 | ***************************************************************************************************************************************************** 188 | 189 | ***************************************************************************************************************************************************** 190 | ]]-- 191 | 192 | extension:EnableExtension(); 193 | -------------------------------------------------------------------------------- /lua/expression3/debuger.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ____ _ _ ___ ___ ____ ___ ___ __ ____ _ _ _ ___ _ _ ____ 3 | F ___J FJ LJ F _ ", F _ ", F ___J F __". F __". FJ F __ ] F L L] /.\ F __". FJ L] F___ J 4 | J |___: J \/ F J `-' |J `-'(| J |___: J (___| J (___| J L J |--| L J \| L //_\\ J |--\ LJ | | L `-__| L 5 | | _____| / \ | __/F| _ L | _____| J\___ \ J\___ \ | | | | | | | |\ | / ___ \ | | J |J J F L |__ ( 6 | F L____: / /\ \ F |__/ F |_\ L F L____: .--___) \.--___) \ F J F L__J J F L\\ J / L___J \ F L__J |J\ \/ /F .-____] J 7 | J________LJ__//\\__LJ__| J__| \\__LJ________LJ\______JJ\______JJ____LJ\______/FJ__L \\__L J__L J__LJ______/F \\__// J\______/F 8 | |________||__/ \__||__L |__| J__||________| J______F J______F|____| J______F |__L J__| |__L J__||______F \__/ J______F 9 | 10 | ::Debugger:: 11 | ]] 12 | 13 | local COLORS = {}; 14 | COLORS.KEYWORD = Color(0, 0, 255); 15 | COLORS.OPERATOR = Color(255, 255, 255); 16 | COLORS.GENERIC = Color(200, 200, 200); 17 | COLORS.NATIVE = Color(150, 150, 0); 18 | COLORS.FUNCTION = Color(100, 100, 0); 19 | COLORS.STRING = Color(100, 100, 0); 20 | 21 | local KEYWORDS = {}; 22 | KEYWORDS['for'] = true; 23 | KEYWORDS['in'] = true; 24 | KEYWORDS['do'] = true; 25 | KEYWORDS['if'] = true; 26 | KEYWORDS['not'] = true; 27 | KEYWORDS['and'] = true; 28 | KEYWORDS['or'] = true; 29 | KEYWORDS['elseif'] = true; 30 | KEYWORDS['else'] = true; 31 | KEYWORDS['end'] = true; 32 | KEYWORDS['break'] = true; 33 | KEYWORDS['continue'] = true; 34 | KEYWORDS['function'] = true; 35 | KEYWORDS['return'] = true; 36 | KEYWORDS['local'] = true; 37 | 38 | local OPERATOR = {}; 39 | OPERATOR['{'] = true; 40 | OPERATOR['}'] = true; 41 | OPERATOR['('] = true; 42 | OPERATOR[')'] = true; 43 | OPERATOR['['] = true; 44 | OPERATOR[']'] = true; 45 | OPERATOR['#'] = true; 46 | OPERATOR['+'] = true; 47 | OPERATOR['-'] = true; 48 | OPERATOR['/'] = true; 49 | OPERATOR['*'] = true; 50 | OPERATOR['^'] = true; 51 | OPERATOR['%'] = true; 52 | OPERATOR['.'] = true; 53 | OPERATOR['='] = true; 54 | OPERATOR['=='] = true; 55 | OPERATOR['~='] = true; 56 | OPERATOR['>='] = true; 57 | OPERATOR['>'] = true; 58 | OPERATOR['<='] = true; 59 | OPERATOR['<'] = true; 60 | 61 | 62 | local function buildRows(native) 63 | local rows = {}; 64 | 65 | for row, line in pairs(string.Explode("\n", native)) do 66 | local inString; 67 | local tokens = {}; 68 | 69 | for _, token in pairs(string.Explode(" ", line)) do 70 | if token == "'" or token == '"' then 71 | if inString and inString == token then 72 | inString = nil; 73 | else 74 | inString = token; 75 | end 76 | 77 | tokens[#tokens + 1] = {token, COLORS.STRING}; 78 | elseif inString then 79 | tokens[#tokens + 1] = {token, COLORS.STRING}; 80 | elseif KEYWORDS[token] then 81 | tokens[#tokens + 1] = {token, COLORS.KEYWORD}; 82 | elseif OPERATOR[token] then 83 | tokens[#tokens + 1] = {token, COLORS.OPERATOR}; 84 | elseif _G[token] then 85 | local tbl = _G[token]; 86 | local t = type(tbl); 87 | 88 | if t == "function" then 89 | tokens[#tokens + 1] = {token, COLORS.FUNCTION}; 90 | elseif tbl then 91 | tokens[#tokens + 1] = {token, COLORS.NATIVE}; 92 | else 93 | tokens[#tokens + 1] = {token, COLORS.GENERIC}; 94 | end 95 | else 96 | tokens[#tokens + 1] = {token, COLORS.GENERIC}; 97 | end 98 | 99 | tokens[#tokens + 1] = {" ", COLORS.GENERIC}; 100 | end 101 | 102 | rows[row] = tokens; 103 | end 104 | 105 | return rows, native; 106 | end 107 | 108 | EXPR_LIB.ShowDebug = function(native, name) 109 | if (Golem) then 110 | local inst = Golem:GetInstance(); 111 | 112 | local rows, text = buildRows(native); 113 | 114 | name = name or "generic"; 115 | local sheet = inst:NewTab("editor", text); 116 | 117 | sheet.Panel._OnKeyCodeTyped = function() end; 118 | sheet.Panel._OnTextChanged = function() end; 119 | 120 | sheet.Panel.SyntaxColorLine = function(self, row) 121 | 122 | if rows[row] then 123 | return rows[row]; 124 | end 125 | 126 | return {{self.Rows[row], Color(255,255,255)}} 127 | end; 128 | 129 | local nFun = CompileString(text, "Expression 3 - Debugger", false); 130 | 131 | if type(nFun) ~= "string" then 132 | inst.btnValidate:SetColor( Color( 50, 255, 50 ) ); 133 | inst.btnValidate:SetText( "Native Output, Validated Sucessfuly" ); 134 | elseif (nFun) then 135 | inst:OnValidateError( false, nFun); 136 | Golem.Print(Color(255, 255, 255), nFun); 137 | end 138 | end 139 | end -------------------------------------------------------------------------------- /lua/expression3/editor.lua: -------------------------------------------------------------------------------- 1 | /*============================================================================================================================================ 2 | Golem Editor 3 | ============================================================================================================================================*/ 4 | 5 | Golem = { } 6 | 7 | if SERVER then 8 | return 9 | end 10 | 11 | function Golem.Init( ) 12 | Golem.Reload( ) 13 | end 14 | 15 | function Golem.Create( ) 16 | if Golem.Instance then return end 17 | Golem.Instance = vgui.Create( "GOLEM_IDE" ) 18 | Golem.Instance:SetText( "Expression 3 IDE - Golem" ) 19 | Golem.Instance:SetIcon( "fugue/application-sidebar-list.png" ) // Keep or not to keep, that is the question. 20 | Golem.Instance:Open( ) 21 | 22 | hook.Run( "Expression3.GolemInit" ) 23 | end 24 | 25 | function Golem.Reload( ) 26 | include( "expression3/editor/font.lua" ) 27 | include( "expression3/editor/style.lua" ) 28 | include( "expression3/editor/vector2.lua" ) 29 | 30 | if Golem.Instance then 31 | if IsValid( Golem.Instance ) and ispanel( Golem.Instance ) then 32 | Golem.Instance:Close( ) 33 | Golem.Instance:Remove( ) 34 | end 35 | Golem.Instance = nil 36 | end 37 | 38 | include( "expression3/editor/derma/autocomplete.lua" ) 39 | include( "expression3/editor/derma/button.lua" ) 40 | include( "expression3/editor/derma/checkbox.lua" ) 41 | include( "expression3/editor/derma/closebutton.lua" ) 42 | include( "expression3/editor/derma/colorselect.lua" ) 43 | include( "expression3/editor/derma/console.lua" ) 44 | -- include( "expression3/editor/derma/console2.lua" ) 45 | include( "expression3/editor/derma/dhtml.lua" ) 46 | include( "expression3/editor/derma/editor.lua" ) 47 | include( "expression3/editor/derma/filebrowser.lua" ) 48 | include( "expression3/editor/derma/filemenu.lua" ) 49 | include( "expression3/editor/derma/findreplace.lua" ) 50 | include( "expression3/editor/derma/frame.lua" ) 51 | include( "expression3/editor/derma/hscrollbar.lua" ) 52 | include( "expression3/editor/derma/ide.lua" ) 53 | include( "expression3/editor/derma/imagebutton.lua" ) 54 | include( "expression3/editor/derma/options.lua" ) 55 | include( "expression3/editor/derma/propertysheet.lua" ) 56 | include( "expression3/editor/derma/simpletabs.lua" ) 57 | include( "expression3/editor/derma/statebutton.lua" ) 58 | include( "expression3/editor/derma/textentry.lua" ) 59 | include( "expression3/editor/derma/toolbar.lua" ) 60 | include( "expression3/editor/derma/tree.lua" ) 61 | 62 | include( "expression3/editor/derma/syntax.lua" ) 63 | include( "expression3/editor/derma/syntax/syntax_e3.lua" ) 64 | include( "expression3/editor/derma/syntax/syntax_lua.lua" ) 65 | include( "expression3/editor/derma/syntax/syntax_console.lua" ) 66 | end 67 | 68 | function Golem.GetInstance( ) 69 | Golem.Create( ) 70 | return Golem.Instance 71 | end 72 | 73 | function Golem.Open( sFile ) 74 | if not Golem.Instance then Golem.Create( ) 75 | else Golem.Instance:Open( ) end 76 | 77 | if sFile then 78 | Golem.Instance:LoadFile( sFile ) 79 | end 80 | end 81 | 82 | function Golem.GetCode( ) 83 | if Golem.Instance then 84 | return Golem.Instance:GetCode( ) 85 | end 86 | end 87 | 88 | function Golem.Validate( sCode ) 89 | if Golem.Instance then 90 | return Golem.Instance:DoValidate( false, sCode ) 91 | end 92 | end 93 | 94 | function Golem.Print(...) 95 | if Golem.Instance then 96 | return Golem.Instance:PrintLine(...) 97 | end 98 | end 99 | 100 | function Golem.AddRow(...) 101 | if Golem.Instance then 102 | return Golem.Instance:AddRow(...) 103 | end 104 | end 105 | 106 | function Golem.Warning(...) 107 | if Golem.Instance then 108 | return Golem.Instance:Warning(...) 109 | end 110 | end 111 | 112 | function Golem.Info(...) 113 | if Golem.Instance then 114 | return Golem.Instance:Info(...) 115 | end 116 | end 117 | 118 | function Golem.GetDirective( directive ) 119 | if Golem.Instance then 120 | local code = Golem.Instance:GetCode( ) or "" 121 | 122 | if string.find( code, directive ) then 123 | code = string.Replace(code,";","\n") 124 | local lines = string.Explode( "\n", code ) 125 | local i = 1 126 | 127 | while i < #lines do 128 | local line = string.Trim( lines[i] ) 129 | 130 | if line == "" then 131 | i = i + 1 132 | continue 133 | end 134 | 135 | if string.match( line, "^/[/%*]") then 136 | if line[2] == "/" then 137 | i = i + 1 138 | continue 139 | else 140 | while i < #lines do 141 | if string.match( line, "%*/" ) then 142 | local _, p = string.find( line, "%*/" ) 143 | line = string.Trim( string.sub( line, p+1 ) ) 144 | break 145 | end 146 | 147 | line = string.Trim( lines[i] ) 148 | i = i + 1 149 | end 150 | continue 151 | end 152 | end 153 | 154 | if line[1] == "@" then 155 | local dir = string.match( line, "@" .. directive .. [[ *(%b"")]] ) or string.match( line, "@" .. directive .. [[ *(%b'')]] ) 156 | 157 | if dir then 158 | return string.sub( dir, 2, -2 ) 159 | end 160 | 161 | i = i + 1 162 | continue 163 | end 164 | 165 | return 166 | end 167 | end 168 | 169 | return 170 | end 171 | end 172 | 173 | --[[ 174 | Open Editor 175 | ]] 176 | 177 | net.Receive("Expression3.OpenGolem", function() 178 | local entity; 179 | 180 | if net.ReadBool() then entity = net.ReadEntity(); end 181 | 182 | Golem.Open(); 183 | 184 | if IsValid(entity) and entity.script then 185 | Golem.Instance:NewTab("editor", entity.script, false, entity:GetScriptName() or "generic"); 186 | end 187 | end); 188 | -------------------------------------------------------------------------------- /lua/expression3/editor/derma/button.lua: -------------------------------------------------------------------------------- 1 | /*============================================================================================================================================ 2 | Name: GOLEM_Button 3 | Author: Oskar 4 | ============================================================================================================================================*/ 5 | 6 | local surface = surface 7 | local math = math 8 | 9 | local gradient_down = Material( "vgui/gradient-u" ) 10 | 11 | local PANEL = { } 12 | 13 | AccessorFunc( PANEL, "m_tColor", "Color" ) 14 | AccessorFunc( PANEL, "m_tTextColor", "TextColor" ) 15 | AccessorFunc( PANEL, "m_tTextShadow", "TextShadow" ) 16 | 17 | AccessorFunc( PANEL, "m_sStyleNames", "StyleNames" ) 18 | AccessorFunc( PANEL, "m_sFont", "Font", FORCE_STRING ) 19 | 20 | AccessorFunc( PANEL, "m_bOutline", "Outlined", FORCE_BOOL ) 21 | AccessorFunc( PANEL, "m_bTextCentered", "TextCentered", FORCE_BOOL ) 22 | AccessorFunc( PANEL, "m_bFading", "Fading", FORCE_BOOL ) 23 | AccessorFunc( PANEL, "m_bFlat", "Flat", FORCE_BOOL ) 24 | 25 | function PANEL:Init( ) 26 | self:SetSize( 25, 25 ) 27 | 28 | self:SetFont( "Trebuchet22" ) 29 | self:SetText( "" ) 30 | 31 | self:SetColor( Color( 100, 100, 100 ) ) 32 | self:SetTextColor( Color( 255, 255, 255 ) ) 33 | self:SetOutlined( false ) 34 | self:SetTextCentered( false ) 35 | self:SetFading( true ) 36 | self:SetFlat( false ) 37 | end 38 | 39 | function PANEL:SetColor( cColor ) 40 | if not IsColor( cColor ) then 41 | return 42 | end 43 | 44 | self.m_tColor = cColor 45 | end 46 | 47 | function PANEL:SizeToContents( ) 48 | surface.SetFont( self:GetFont( ) ) 49 | local Text = self:GetText( ) 50 | local w, h = surface.GetTextSize( Text ) 51 | self:SetSize( w + 10, h ) 52 | end 53 | 54 | function PANEL:SizeToContentsX( ) 55 | surface.SetFont( self:GetFont( ) ) 56 | local Text = self:GetText( ) 57 | local w, h = surface.GetTextSize( Text ) 58 | self:SetWide( w + 10 ) 59 | end 60 | 61 | function PANEL:SizeToContentsY( ) 62 | surface.SetFont( self:GetFont( ) ) 63 | local Text = self:GetText( ) 64 | local w, h = surface.GetTextSize( Text ) 65 | self:SetTall( h ) 66 | end 67 | 68 | function PANEL:Paint( w, h ) 69 | surface.SetDrawColor( self:GetColor( ):Unpack( ) ) 70 | if self.m_sStyleNames and self.m_sStyleNames[1] then 71 | surface.SetDrawColor( Golem.Style:GetColor( self.m_sStyleNames[1] ) ) 72 | end 73 | surface.DrawRect( 0, 0, w, h ) 74 | 75 | if not self:GetFlat( ) then 76 | surface.SetDrawColor( 200, 200, 200, 100 ) 77 | if self.m_sStyleNames and self.m_sStyleNames[2] then surface.SetDrawColor( Golem.Style:GetColor( self.m_sStyleNames[2] ) ) end 78 | surface.SetMaterial( gradient_down ) 79 | surface.DrawTexturedRect( 0, 0, w, h ) 80 | end 81 | 82 | if self:GetFading( ) then 83 | surface.SetDrawColor( 0, 0, 0, 0 ) 84 | if self.Hovered then surface.SetDrawColor( 0, 0, 0, 100 ) end 85 | if self.Depressed then surface.SetDrawColor( 0, 0, 0, 150 ) end 86 | surface.DrawRect( 0, 0, w, h ) 87 | end 88 | 89 | if self:GetOutlined( ) then 90 | surface.SetDrawColor( 0, 0, 0, 255 ) 91 | surface.DrawOutlinedRect( 0, 0, w, h ) 92 | end 93 | 94 | surface.SetFont( self:GetFont( ) ) 95 | local Text = self:GetText( ) 96 | local tw, th = surface.GetTextSize( Text ) 97 | local x, y = math.floor( w / 2 ) - math.floor( tw / 2 ), math.floor( h / 2 ) - math.floor( th / 2 ) 98 | 99 | if not self:GetTextCentered( ) then x = 5 end 100 | 101 | if self:GetTextShadow( ) then 102 | surface.SetTextColor( self:GetTextShadow( ):Unpack( ) ) 103 | if self.m_sStyleNames and self.m_sStyleNames[3] then surface.SetTextColor( Golem.Style:GetColor( self.m_sStyleNames[3] ) ) end 104 | 105 | for _x = -1, 1 do 106 | for _y = -1, 1 do 107 | surface.SetTextPos( x + _x, y + _y ) 108 | surface.DrawText( Text ) 109 | end 110 | end 111 | end 112 | 113 | surface.SetTextColor( self:GetTextColor( ):Unpack( ) ) 114 | if self.m_sStyleNames and self.m_sStyleNames[4] then surface.SetTextColor( Golem.Style:GetColor( self.m_sStyleNames[4] ) ) end 115 | surface.SetTextPos( x, y ) 116 | surface.DrawText( Text ) 117 | 118 | return true 119 | end 120 | 121 | vgui.Register( "GOLEM_Button", PANEL, "DButton" ) 122 | -------------------------------------------------------------------------------- /lua/expression3/editor/derma/closebutton.lua: -------------------------------------------------------------------------------- 1 | /*============================================================================================================================================ 2 | Name: GOLEM_CloseButton 3 | Author: Oskar 4 | ============================================================================================================================================*/ 5 | 6 | local small_cross = Material( "fugue/cross-button.png" ) 7 | 8 | local PANEL = { } 9 | 10 | function PANEL:Init( ) 11 | self._x = 0 12 | self._y = 0 13 | self:SetMaterial( small_cross ) 14 | end 15 | 16 | function PANEL:DoClick( ) 17 | local Parent = self:GetParent( ) 18 | if Parent then 19 | if Parent.Close then 20 | Parent:Close( ) 21 | else 22 | Parent:Remove( ) 23 | end 24 | end 25 | end 26 | 27 | function PANEL:SetOffset( x, y ) 28 | self._x = x 29 | self._y = y 30 | end 31 | 32 | function PANEL:Think( ) 33 | if self:GetParent() then 34 | local x = self:GetParent( ):GetWide( ) - self:GetWide( ) + self._x 35 | local y = self._y 36 | self:SetPos( x, y ) 37 | end 38 | end 39 | 40 | vgui.Register( "GOLEM_CloseButton", PANEL, "GOLEM_ImageButton" ) 41 | -------------------------------------------------------------------------------- /lua/expression3/editor/derma/console.lua: -------------------------------------------------------------------------------- 1 | local PANEL = {}; 2 | 3 | function PANEL:Init( ) 4 | self.BaseClass.Init(self); 5 | 6 | self.nLine = 1; 7 | self.row = {}; 8 | self.format = {}; 9 | self.funcs = {}; 10 | 11 | self.tFormat = {}; 12 | self.tFuncs = {}; 13 | 14 | --self:NewLine(); 15 | self:SetEditable(false); 16 | self:SetDefaultTextColor(Color(255, 255, 255)); 17 | 18 | function self:PaintStatus() end 19 | 20 | self.pClearButton = self:Add( "GOLEM_ImageButton" ) 21 | self.pClearButton:SetMaterial( Material( "fugue/cross-button.png" ) ) 22 | 23 | self.pClearButton.DoClick = function(btn) 24 | self:Clear( ) 25 | end 26 | 27 | self.BookmarkWidth = 0 28 | end 29 | 30 | function PANEL:PerformLayout( ) 31 | self.BaseClass.PerformLayout(self) 32 | if not IsValid (self.pClearButton ) then return end 33 | self.pClearButton:SetPos( self:GetWide( ) - self.pClearButton:GetWide( ) - (self.pScrollBar:IsVisible() and self.pScrollBar:GetWide( ) or 0), 0 ) 34 | 35 | end 36 | 37 | function PANEL:Clear( ) 38 | self.nLine = 1 39 | self.row = { } 40 | self.format = { } 41 | self.funcs = { } 42 | 43 | self.tFormat = { } 44 | self.tFuncs = { } 45 | 46 | self:SetCode("") 47 | end 48 | 49 | function PANEL:ScrollToBottom( ) 50 | self:SetCaret( Vector2( #self.tRows, #self.tRows[#self.tRows] ) ); 51 | self:ScrollCaret(); 52 | end 53 | 54 | function PANEL:ClickText( cursor ) 55 | local format = self.tFormat[cursor.x]; 56 | local funcs = self.tFuncs[cursor.x]; 57 | if not funcs then return false; end 58 | 59 | local fun; 60 | local pos = 0; 61 | 62 | for k = 1, #format do 63 | local len = #format[k][1]; 64 | 65 | if (cursor.y >= pos) and (cursor.y <= (pos + len)) then 66 | fun = funcs[k]; 67 | break; 68 | else 69 | pos = pos + len; 70 | end 71 | end 72 | 73 | if not fun then return false; end 74 | 75 | fun(); 76 | 77 | return true; 78 | end 79 | 80 | function PANEL:NewLine() 81 | self.tRows[ self.nLine ] = table.concat(self.row, ""); 82 | self.tFormat[ self.nLine ] = table.Copy(self.format); 83 | self.tFuncs[ self.nLine ] = self.funcs; 84 | 85 | self.row = {}; 86 | self.format = {}; 87 | self.funcs = {}; 88 | self.nLine = self.nLine + 1; 89 | end 90 | 91 | function PANEL:Write(str) 92 | self.row[#self.row + 1] = str; 93 | self.format[#self.row] = {str, self.cTextColor}; 94 | if self.fClick then self.funcs[#self.row] = self.fClick; end 95 | end 96 | 97 | function PANEL:SetColor(col) 98 | self.cTextColor = col; 99 | end 100 | 101 | function PANEL:WriteImage(image, size) 102 | local str = string.rep(" ",math.ceil(size/self.FontWidth)); 103 | self.row[#self.row + 1] = str; 104 | self.format[#self.row] = { str, self.cTextColor, true, Material(image) }; 105 | if self.fClick then self.funcs[#self.row] = self.fClick; end 106 | end 107 | 108 | function PANEL:WriteTable(values) 109 | local tValues = #values; 110 | local oc = self.cTextColor; 111 | local of = self.fClick; 112 | 113 | for i = 1, tValues do 114 | local value = values[i]; 115 | 116 | if isfunction(value) then 117 | self.fClick = value; 118 | continue; 119 | end 120 | 121 | if IsColor(value) then 122 | self:SetColor(value); 123 | continue; 124 | end 125 | 126 | if istable(value) then 127 | if value.image then 128 | self:WriteImage(value.image, value.size); 129 | else 130 | self:WriteTable(value); 131 | end 132 | continue; 133 | end 134 | 135 | if not isstring(value) then 136 | value = tostring(value) 137 | end 138 | 139 | local lines = string.Explode("\n", value); 140 | local tLines = #lines; 141 | 142 | for j = 1, tLines do 143 | self:Write(lines[j]); 144 | 145 | if tLines > 1 and j < tLines then 146 | self:NewLine(); 147 | end 148 | end 149 | end 150 | 151 | self.fClick = of; 152 | self.cTextColor = oc; 153 | end 154 | 155 | function PANEL:WriteLine(...) 156 | self.cTextColor = self.cDefTextColor; 157 | self:WriteTable( { ... } ); 158 | self:NewLine(); 159 | self:ScrollToBottom(); 160 | end 161 | 162 | function PANEL:Warn(level, ...) 163 | local left = {}; 164 | local right = {...}; 165 | 166 | level = level or 2; 167 | 168 | if level == 1 then 169 | left[1] = {image = "fugue/question.png", size = 16} 170 | elseif level == 2 then 171 | left[1] = {image = "fugue/exclamation-circle.png", size = 16} 172 | elseif level == 3 then 173 | left[1] = {image = "fugue/exclamation-red.png", size = 16} 174 | end 175 | 176 | --if level == 3 then 177 | -- self:SetBackGroundColorL(200, 50, 50); 178 | -- self:SetBackGroundColorR(200, 50, 50); 179 | --end 180 | 181 | left[#left + 1] = Color(255, 255, 255); 182 | left[#left + 1] = "Warning "; 183 | 184 | self:WriteLine(left, right) 185 | end 186 | 187 | function PANEL:GetDefaultTextColor() 188 | return self.cDefTextColor; 189 | end 190 | 191 | function PANEL:SetDefaultTextColor(c) 192 | self.cDefTextColor = c; 193 | end 194 | 195 | vgui.Register( "GOLEM_Console", PANEL, "GOLEM_Editor" ); 196 | -------------------------------------------------------------------------------- /lua/expression3/editor/derma/dhtml.lua: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | Golem HTML tab 3 | Author: DaDamRival 4 | =============================================================================*/ 5 | 6 | local PANEL = {} 7 | 8 | function PANEL:Init() 9 | self.Html = self:Add("DHTML") 10 | end 11 | 12 | function PANEL:Setup(html) 13 | self.Html:Dock(FILL) 14 | 15 | if string.sub(html, 1, 4) != "url:" then 16 | self.Html:SetHTML(html) 17 | else 18 | self.Html:OpenURL(string.sub(html, 5)) 19 | end 20 | end 21 | 22 | function PANEL:Paint(w, h) 23 | surface.SetDrawColor(0, 0, 0, 255) 24 | surface.DrawRect(0, 0, w, h) 25 | end 26 | 27 | vgui.Register("GOLEM_DHTML", PANEL, "EditablePanel") 28 | -------------------------------------------------------------------------------- /lua/expression3/editor/derma/filebrowser.lua: -------------------------------------------------------------------------------- 1 | /*============================================================================================================================================ 2 | Name: GOLEM_FileBrowser 3 | Author: Oskar 4 | ============================================================================================================================================*/ 5 | 6 | local PANEL = { } 7 | 8 | function PANEL:Init( ) 9 | 10 | end 11 | 12 | vgui.Register( "GOLEM_FileBrowser", PANEL, "DFileBrowser" ) 13 | -------------------------------------------------------------------------------- /lua/expression3/editor/derma/hscrollbar.lua: -------------------------------------------------------------------------------- 1 | /*============================================================================================================================================ 2 | Name: GOLEM_HScrollBar 3 | Author: Oskar 4 | ============================================================================================================================================*/ 5 | 6 | local PANEL = { } 7 | 8 | function PANEL:Init( ) 9 | self.Offset = 0 10 | self.Scroll = 0 11 | self.CanvasSize = 1 12 | self.BarSize = 1 13 | 14 | self.btnUp:Remove( ) 15 | self.btnDown:Remove( ) 16 | self.btnGrip:Remove( ) 17 | 18 | self.btnLeft = vgui.Create( "DButton", self ) 19 | self.btnLeft:SetText( "" ) 20 | self.btnLeft.DoClick = function ( self ) self:GetParent( ):AddScroll( -1 ) end 21 | self.btnLeft.Paint = function( panel, w, h ) derma.SkinHook( "Paint", "ButtonLeft", panel, w, h ) end 22 | 23 | self.btnRight = vgui.Create( "DButton", self ) 24 | self.btnRight:SetText( "" ) 25 | self.btnRight.DoClick = function ( self ) self:GetParent( ):AddScroll( 1 ) end 26 | self.btnRight.Paint = function( panel, w, h ) derma.SkinHook( "Paint", "ButtonRight", panel, w, h ) end 27 | 28 | self.btnGrip = vgui.Create( "DScrollBarGrip", self ) 29 | 30 | self:SetSize( 15, 15 ) 31 | end 32 | 33 | function PANEL:AddScroll( dlta ) 34 | local OldScroll = self:GetScroll( ) 35 | 36 | dlta = dlta 37 | self:SetScroll( self:GetScroll( ) + dlta ) 38 | 39 | return OldScroll == self:GetScroll( ) 40 | end 41 | 42 | function PANEL:SetScroll( scroll ) 43 | if not self.Enabled then self.Scroll = 0 return end 44 | self.Scroll = math.Clamp( scroll, 0, self.CanvasSize ) 45 | self:InvalidateLayout( ) 46 | end 47 | 48 | function PANEL:OnMouseWheeled( dlta ) 49 | if not self:IsVisible( ) then return false end 50 | return self:AddScroll( dlta ) 51 | end 52 | 53 | function PANEL:OnMousePressed( ) 54 | local x, y = self:CursorPos( ) 55 | local PageSize = self.BarSize 56 | 57 | if x > self.btnGrip.x then 58 | self:SetScroll( self:GetScroll( ) + PageSize ) 59 | else 60 | self:SetScroll( self:GetScroll( ) - PageSize ) 61 | end 62 | end 63 | 64 | function PANEL:OnCursorMoved( x, y ) 65 | if not self.Enabled then return end 66 | if not self.Dragging then return end 67 | 68 | local x = self:ScreenToLocal( gui.MouseX( ), 0 ) 69 | local TrackSize = self:GetWide( ) - self:GetTall( ) * 2 - self.btnGrip:GetWide( ) 70 | 71 | x = x - self.btnRight:GetWide( ) - self.HoldPos 72 | x = x / TrackSize 73 | 74 | self:SetScroll( x * self.CanvasSize ) 75 | end 76 | 77 | function PANEL:Grip( ) 78 | if not self.Enabled then return end 79 | if self.BarSize == 0 then return end 80 | 81 | self:MouseCapture( true ) 82 | self.Dragging = true 83 | 84 | self.HoldPos = self.btnGrip:ScreenToLocal( gui.MouseX( ), 0 ) 85 | 86 | self.btnGrip.Depressed = true 87 | end 88 | 89 | function PANEL:PerformLayout( ) 90 | local Tall = self:GetTall( ) 91 | local Scroll = self:GetScroll( ) / self.CanvasSize 92 | local BarSize = math.max( self:BarScale( ) * (self:GetWide( ) - (Tall * 2)), 10 ) 93 | local Track = self:GetWide( ) - (Tall * 2) - BarSize 94 | Track = Track + 1 95 | 96 | Scroll = Scroll * Track 97 | 98 | self.btnGrip:SetPos( Tall + Scroll, 0 ) 99 | self.btnGrip:SetSize( BarSize, Tall ) 100 | 101 | self.btnLeft:SetPos( 0, 0 ) 102 | self.btnLeft:SetSize( Tall, Tall ) 103 | 104 | self.btnRight:SetPos( self:GetWide( ) - Tall, 0 ) 105 | self.btnRight:SetSize( Tall, Tall ) 106 | end 107 | 108 | 109 | vgui.Register( "GOLEM_HScrollBar", PANEL, "DVScrollBar" ) 110 | -------------------------------------------------------------------------------- /lua/expression3/editor/derma/imagebutton.lua: -------------------------------------------------------------------------------- 1 | /*============================================================================================================================================ 2 | Name: GOLEM_ImageButton 3 | Author: Oskar 4 | ============================================================================================================================================*/ 5 | 6 | local gradient_down = Material( "vgui/gradient-u" ) 7 | 8 | local PANEL = { } 9 | 10 | AccessorFunc( PANEL, "m_mMaterial", "Material" ) 11 | AccessorFunc( PANEL, "m_nPadding", "Padding" ) 12 | 13 | AccessorFunc( PANEL, "m_bIconFading", "IconFading", FORCE_BOOL ) 14 | AccessorFunc( PANEL, "m_bIconCentered", "IconCentered", FORCE_BOOL ) 15 | AccessorFunc( PANEL, "m_bIconStretch", "IconStretch", FORCE_BOOL ) 16 | AccessorFunc( PANEL, "m_bAutoResize", "AutoResize", FORCE_BOOL ) 17 | 18 | function PANEL:Init( ) 19 | self:SetText( "" ) 20 | self:SetPadding( 0 ) 21 | self:SetIconFading( true ) 22 | self:SetTextCentered( false ) 23 | self:SetIconCentered( false ) 24 | self:SetAutoResize( true ) 25 | self:SetIconStretch( false ) 26 | end 27 | 28 | function PANEL:DrawButton( bool ) 29 | self.m_bDrawButton = bool 30 | end 31 | 32 | function PANEL:SetMaterial( mat ) 33 | if type( mat ) ~= "IMaterial" or mat:IsError( ) then return end // TODO: Fling some shit here 34 | self.m_mMaterial = mat 35 | if self:GetAutoResize( ) then self:SizeToContents( ) end 36 | end 37 | 38 | function PANEL:SizeToContents( ) 39 | local w, h = 0, 0 40 | if self.m_mMaterial then 41 | w, h = self.m_mMaterial:Width( ) + self.m_nPadding * 2, self.m_mMaterial:Height( ) + self.m_nPadding * 2 42 | end 43 | 44 | if self.m_bDrawButton then 45 | surface.SetFont( self:GetFont() ) 46 | local Text = self:GetText( ) 47 | local x, y = surface.GetTextSize( Text ) 48 | if x > 0 then 49 | w = w + x + 4 + self.m_nPadding * ( self.m_mMaterial and 1 or 2 ) 50 | h = math.max( h, y + self.m_nPadding * 2 ) 51 | end 52 | end 53 | 54 | self:SetSize( w, h ) 55 | end 56 | 57 | function PANEL:SizeToContentsX( ) 58 | local w = 0 59 | if self.m_mMaterial then 60 | w = self.m_mMaterial:Width( ) + self.m_nPadding * 2 61 | end 62 | 63 | if self.m_bDrawButton then 64 | surface.SetFont( self:GetFont( ) ) 65 | local Text = self:GetText( ) 66 | local x = surface.GetTextSize( Text ) 67 | if x > 0 then 68 | w = w + x + 4 + self.m_nPadding * ( self.m_mMaterial and 1 or 2 ) 69 | end 70 | end 71 | 72 | self:SetWide( w ) 73 | end 74 | 75 | function PANEL:SizeToContentsY( ) 76 | local h = 0 77 | if self.m_mMaterial then 78 | h = self.m_mMaterial:Height( ) + self.m_nPadding * 2 79 | end 80 | 81 | if self.m_bDrawButton then 82 | surface.SetFont( self:GetFont( ) ) 83 | local Text = self:GetText( ) 84 | local _, y = surface.GetTextSize( Text ) 85 | h = math.max( h, y + self.m_nPadding * 2 ) 86 | end 87 | 88 | self:SetTall( h ) 89 | end 90 | 91 | local function PaintButton( self, w, h ) 92 | surface.SetDrawColor( self:GetColor( ):Unpack( ) ) 93 | if self.m_sStyleNames and self.m_sStyleNames[1] then 94 | surface.SetDrawColor( Golem.Style:GetColor( self.m_sStyleNames[1] ) ) 95 | end 96 | surface.DrawRect( 0, 0, w, h ) 97 | 98 | if not self:GetFlat( ) then 99 | surface.SetDrawColor( 200, 200, 200, 100 ) 100 | if self.m_sStyleNames and self.m_sStyleNames[2] then surface.SetDrawColor( Golem.Style:GetColor( self.m_sStyleNames[2] ) ) end 101 | surface.SetMaterial( gradient_down ) 102 | surface.DrawTexturedRect( 0, 0, w, h ) 103 | end 104 | 105 | if self:GetFading( ) then 106 | surface.SetDrawColor( 0, 0, 0, 0 ) 107 | if self.Hovered then surface.SetDrawColor( 0, 0, 0, 100 ) end 108 | if self.Depressed then surface.SetDrawColor( 0, 0, 0, 150 ) end 109 | surface.DrawRect( 0, 0, w, h ) 110 | end 111 | 112 | if self:GetOutlined( ) then 113 | surface.SetDrawColor( 0, 0, 0, 255 ) 114 | surface.DrawOutlinedRect( 0, 0, w, h ) 115 | end 116 | 117 | surface.SetFont( self:GetFont( ) ) 118 | local Text = self:GetText( ) 119 | local tw, th = surface.GetTextSize( Text ) 120 | local x, y = math.floor( w / 2 ) - math.floor( tw / 2 ), math.floor( h / 2 ) - math.floor( th / 2 ) 121 | 122 | if not self.m_bTextCentered then x = self.m_nPadding end 123 | 124 | if self.m_mMaterial then x = x + 2 + self.m_mMaterial:Width( ) + self.m_nPadding end 125 | 126 | if self:GetTextShadow( ) then 127 | surface.SetTextColor( self:GetTextShadow( ):Unpack() ) 128 | if self.m_sStyleNames and self.m_sStyleNames[3] then surface.SetTextColor( Golem.Style:GetColor( self.m_sStyleNames[3] ) ) end 129 | 130 | for _x = -1, 1 do 131 | for _y = -1, 1 do 132 | surface.SetTextPos( x + _x, y + _y ) 133 | surface.DrawText( Text ) 134 | end 135 | end 136 | end 137 | 138 | surface.SetTextColor( self:GetTextColor( ):Unpack( ) ) 139 | if self.m_sStyleNames and self.m_sStyleNames[4] then surface.SetTextColor( Golem.Style:GetColor( self.m_sStyleNames[4] ) ) end 140 | surface.SetTextPos( x, y ) 141 | surface.DrawText( Text ) 142 | end 143 | 144 | function PANEL:Paint( w, h ) 145 | if self.m_bDrawButton then PaintButton( self, w, h ) end 146 | 147 | if self.m_mMaterial then 148 | surface.SetDrawColor( 255, 255, 255, 255 ) 149 | surface.SetMaterial( self.m_mMaterial ) 150 | 151 | local n = math.max( self.m_mMaterial:Width( ), self.m_mMaterial:Height( ) ) 152 | local x, y = w/2 - n/2, h/2 - n/2 153 | 154 | if not self.m_bIconCentered then x = self.m_nPadding end 155 | 156 | if self:GetIconStretch( ) then x, y, n = 0, 0, math.max( w, h ) end 157 | 158 | surface.DrawTexturedRect( x, y, n, n ) 159 | 160 | if self:GetIconFading( ) then 161 | surface.SetDrawColor( 0, 0, 0, 0 ) 162 | if self.Hovered then surface.SetDrawColor( 0, 0, 0, 50 ) end 163 | if self.Depressed then surface.SetDrawColor( 0, 0, 0, 100 ) end 164 | end 165 | 166 | surface.DrawTexturedRect( x, y, n, n ) 167 | end 168 | 169 | return true 170 | end 171 | 172 | vgui.Register( "GOLEM_ImageButton", PANEL, "GOLEM_Button" ) -------------------------------------------------------------------------------- /lua/expression3/editor/derma/options.lua: -------------------------------------------------------------------------------- 1 | --[[============================================================================================================================================ 2 | Name: GOLEM_Options 3 | Author: Oskar 4 | ============================================================================================================================================]] 5 | local PANEL = { } 6 | 7 | function PANEL:Init( ) 8 | self:DockPadding( 5, 5, 5, 5 ) 9 | 10 | self.pColorSelect = self:Add( "GOLEM_ColorSelect" ) 11 | self.pColorSelect:Dock( TOP ) 12 | end 13 | 14 | function PANEL:Paint( w, h ) 15 | surface.SetDrawColor( Golem.Style:GetColor( "options-bg" ) ) 16 | surface.DrawRect( 0, 0, w, h ) 17 | end 18 | 19 | vgui.Register( "GOLEM_Options", PANEL, "EditablePanel" ) -------------------------------------------------------------------------------- /lua/expression3/editor/derma/propertysheet.lua: -------------------------------------------------------------------------------- 1 | /*============================================================================================================================================ 2 | Name: GOLEM_PropertySheet 3 | Author: Oskar 4 | ============================================================================================================================================*/ 5 | 6 | local PANEL = { } 7 | 8 | function PANEL:Init( ) 9 | self.pnlTabs = vgui.Create( "DPanel", self ) 10 | self.pnlTabs:Dock( TOP ) 11 | self.pnlTabs.Paint = function( pnl, w, h ) end 12 | 13 | self.btnNewTab = vgui.Create( "GOLEM_ImageButton", self.pnlTabs ) 14 | self.btnNewTab:Dock( LEFT ) 15 | self.btnNewTab:DockMargin( 0, 0, 2, 0 ) 16 | self.btnNewTab:SetIconFading( false ) 17 | self.btnNewTab:SetIconCentered( true ) 18 | self.btnNewTab:SetTooltip( "New tab" ) 19 | self.btnNewTab:SetPadding( 2 ) 20 | self.btnNewTab:SetFlat( true ) 21 | self.btnNewTab:SetOutlined( true ) 22 | self.btnNewTab:DrawButton( true ) 23 | self.btnNewTab:SetMaterial( Material( "fugue/script--plus.png" ) ) 24 | 25 | self.btnNewTab:SetStyleNames( { [1] = "tab-bg", [4] = "tab-txt" } ) 26 | 27 | self.btnNewTab.DoClick = function( btn ) 28 | self:GetParent( ):NewTab( "editor", false, nil, "generic" ) 29 | end 30 | 31 | self.tabScroller:Remove( ) 32 | self.tabScroller = vgui.Create( "DHorizontalScroller", self.pnlTabs ) 33 | self.tabScroller:Dock( FILL ) 34 | self.tabScroller:SetOverlap( -2 ) 35 | end 36 | 37 | function PANEL:AddSheet( strName, pnlContent, strMaterial, fClose ) 38 | if not IsValid( pnlContent ) then return end 39 | 40 | local Sheet = { } 41 | Sheet.Name = strLabel 42 | 43 | Sheet.Tab = vgui.Create( "GOLEM_ImageButton", self ) 44 | Sheet.Tab.DoClick = function( tab ) self:SetActiveTab( tab ) end 45 | Sheet.Tab:SetFont( "Trebuchet18" ) 46 | Sheet.Tab:SetTall( 24 ) 47 | Sheet.Tab:SetFlat( true ) 48 | Sheet.Tab:SetOutlined( true ) 49 | Sheet.Tab:DrawButton( true ) 50 | Sheet.Tab:SetPadding( 5 ) 51 | Sheet.Tab:SetMaterial( Material( strMaterial ) ) 52 | Sheet.Tab:SetIconFading( false ) 53 | Sheet.Tab:SetStyleNames( { [1] = "tab-bg", [4] = "tab-txt" } ) 54 | 55 | 56 | Sheet.Tab.btnClose = vgui.Create( "GOLEM_ImageButton", Sheet.Tab ) 57 | Sheet.Tab.btnClose.DoClick = fClose 58 | Sheet.Tab.btnClose:SetMaterial( Material( "oskar/close.png" ) ) 59 | -- Sheet.Tab.btnClose:SetMaterial( Material( "fugue/cross-button.png" ) ) 60 | Sheet.Tab.btnClose:SetSize( 16, 16 ) 61 | Sheet.Tab.btnClose:Dock( RIGHT ) 62 | Sheet.Tab.btnClose:DockMargin( 2, 2, 5, 2 ) 63 | Sheet.Tab.Sheet = Sheet 64 | 65 | Sheet.Tab.PerformLayout = function( tab ) 66 | tab:SizeToContentsX( ) 67 | tab:SetWide( tab:GetWide( ) + tab.btnClose:GetWide( ) ) 68 | end 69 | 70 | Sheet.Tab.SetName = function( tab, name ) 71 | tab:SetText( name ) 72 | tab.Sheet.Name = name 73 | self:InvalidateLayout( true ) 74 | end 75 | Sheet.Tab:SetName( strName ) 76 | 77 | Sheet.Tab.GetName = function( tab ) 78 | return string.Trim( tab:GetText( ) ) 79 | end 80 | 81 | Sheet.Tab.GetPanel = function( tab ) return tab.m_pPanel end 82 | Sheet.Tab.SetPanel = function( tab, panel ) tab.m_pPanel = panel end 83 | Sheet.Tab:SetPanel( pnlContent ) 84 | 85 | Sheet.Panel = pnlContent 86 | Sheet.Panel:SetVisible( false ) 87 | Sheet.Panel:SetParent( self ) 88 | Sheet.Panel.Tab = Sheet.Tab 89 | 90 | self.Items[#self.Items + 1] = Sheet 91 | 92 | if not self:GetActiveTab( ) then 93 | self:SetActiveTab( Sheet.Tab ) 94 | Sheet.Panel:SetVisible( true ) 95 | end 96 | 97 | self.tabScroller:AddPanel( Sheet.Tab ) 98 | 99 | return Sheet 100 | end 101 | 102 | function PANEL:CloseTab( tab, bRemovePanelToo ) 103 | local idx = 0 104 | for k, v in pairs( self.Items ) do 105 | if v.Tab ~= tab then continue end 106 | table.remove( self.Items, k ) 107 | idx = k 108 | break 109 | end 110 | 111 | for k, v in pairs( self.tabScroller.Panels ) do 112 | if v ~= tab then continue end 113 | table.remove( self.tabScroller.Panels, k ) 114 | break 115 | end 116 | self.tabScroller:InvalidateLayout( true ) 117 | 118 | if tab == self:GetActiveTab( ) then 119 | if #self.Items > 0 then self:SetActiveTab( self.Items[math.min(idx,#self.Items)].Tab ) 120 | else self:SetActiveTab( nil ) end 121 | end 122 | 123 | local pnl = tab:GetPanel( ) 124 | if bRemovePanelToo then pnl:Remove( ) end 125 | 126 | tab:Remove( ) 127 | self:InvalidateLayout( true ) 128 | return pnl 129 | end 130 | 131 | function PANEL:SetActiveTab( active ) 132 | if self.m_pActiveTab == active then return end 133 | if not IsValid(self.m_pActiveTab) or not ispanel(self.m_pActiveTab) then self.m_pActiveTab = nil end 134 | if self.m_pActiveTab then 135 | self.m_pActiveTab:GetPanel( ):SetVisible( false ) 136 | self.m_pActiveTab:SetStyleNames( { [1] = "tab-bg", [4] = "tab-txt" } ) 137 | end 138 | 139 | if active then 140 | active:SetStyleNames( { [1] = "tab-bg-active", [4] = "tab-txt" } ) 141 | end 142 | 143 | self.m_pActiveTab = active 144 | self:InvalidateLayout( ) 145 | end 146 | 147 | function PANEL:Paint( w, h ) 148 | end 149 | 150 | function PANEL:PerformLayout( ) 151 | local ActiveTab = self:GetActiveTab( ) 152 | 153 | if not ActiveTab then return end 154 | if not IsValid( ActiveTab ) or not ispanel(ActiveTab) then return end 155 | 156 | ActiveTab:InvalidateLayout( true ) 157 | self.pnlTabs:SetTall( ActiveTab:GetTall( ) ) 158 | 159 | local ActivePanel = ActiveTab:GetPanel( ) 160 | 161 | for k, v in pairs( self.Items ) do 162 | if v.Tab:GetPanel( ) == ActivePanel then 163 | v.Tab:GetPanel( ):SetVisible( true ) 164 | v.Tab:SetZPos( 100 ) 165 | else 166 | v.Tab:GetPanel( ):SetVisible( false ) 167 | v.Tab:SetZPos( 1 ) 168 | end 169 | v.Tab:InvalidateLayout( true ) 170 | end 171 | 172 | ActivePanel:SetPos( 0, ActiveTab:GetTall( ) ) 173 | ActivePanel:SetWide( self:GetWide( ) ) 174 | ActivePanel:SetTall( self:GetTall( ) - ActiveTab:GetTall( ) ) 175 | 176 | ActivePanel:InvalidateLayout( ) 177 | self.animFade:Run( ) 178 | end 179 | 180 | vgui.Register( "GOLEM_PropertySheet", PANEL, "DPropertySheet" ) -------------------------------------------------------------------------------- /lua/expression3/editor/derma/sidebar.lua: -------------------------------------------------------------------------------- 1 | /*Empty File*/ -------------------------------------------------------------------------------- /lua/expression3/editor/derma/simpletabs.lua: -------------------------------------------------------------------------------- 1 | /********************************************************************************* 2 | Tabbed Panel 3 | *********************************************************************************/ 4 | 5 | local TABPANEL = {}; 6 | 7 | function TABPANEL:Init() 8 | self.pnl_tbr = self:Add("GOLEM_Toolbar"); 9 | self.pnl_tbr:DockMargin(10, 10, 10, 0); 10 | self.pnl_tbr:Dock(TOP); 11 | 12 | self.pnl_cnvs = self:Add("EditablePanel"); 13 | self.pnl_cnvs:Dock(FILL); 14 | 15 | self.sheets = {}; 16 | self.tabs = {}; 17 | end 18 | 19 | function TABPANEL:AddTab(sName, sIcon, pSheet) 20 | 21 | if isstring(pSheet) then 22 | pSheet = vgui.Create(pSheet); 23 | end 24 | 25 | local tab = self.pnl_tbr:SetupButton(sName, sIcon, LEFT, function() 26 | self:SetActiveTab(sName); 27 | end) 28 | 29 | self.tabs[sName] = tab; 30 | self.sheets[sName] = pSheet; 31 | 32 | if pSheet then 33 | pSheet:SetParent(self.pnl_cnvs); 34 | pSheet:SetVisible(false); 35 | pSheet:Dock(FILL); 36 | end 37 | 38 | return pSheet, tab; 39 | end 40 | 41 | function TABPANEL:HideActiveTab() 42 | if self.m_sActive then 43 | 44 | local sheet = self.sheets[self.m_sActive]; 45 | 46 | if sheet then 47 | self.m_sActive = nil; 48 | sheet:SetVisible(false); 49 | end 50 | end 51 | end 52 | 53 | function TABPANEL:SetActiveTab(sName) 54 | local sheet = self.sheets[sName]; 55 | 56 | if sheet then 57 | self:HideActiveTab(); 58 | self.m_sActive = sName; 59 | sheet:SetVisible(true); 60 | end 61 | end 62 | 63 | vgui.Register("GOLEM_SimpleTabs", TABPANEL, "EditablePanel"); -------------------------------------------------------------------------------- /lua/expression3/editor/derma/statebutton.lua: -------------------------------------------------------------------------------- 1 | --[[============================================================================================================================================ 2 | Name: GOLEM_StateButton 3 | Author: Oskar 4 | ============================================================================================================================================]] 5 | local PANEL = { } 6 | 7 | AccessorFunc( PANEL, "m_nState", "State", FORCE_NUMBER ) 8 | 9 | function PANEL:Init( ) 10 | self.tStates = { } 11 | self.m_nState = 0 12 | self:SetAutoResize( false ) 13 | end 14 | 15 | --fugue/ui-check-box.png 16 | --fugue/ui-check-box-uncheck.png 17 | --fugue/ui-check-box-mix.png 18 | 19 | function PANEL:AddState( sIcon, sText, sTooltip, tValue, bNoCycle ) 20 | local nID = #self.tStates + 1 21 | if isstring( sIcon ) then sIcon = Material( sIcon ) end 22 | self.tStates[nID] = { nID = nID, mIcon = sIcon, sText = sText, sTooltip = sTooltip, tValue = tValue, bNoCycle = bNoCycle } 23 | end 24 | 25 | function PANEL:RemoveState( nID ) 26 | if nID > #self.tStates then return end 27 | if not self.tStates[nID] then return end 28 | table.remove( self.tStates, nID ) 29 | end 30 | 31 | function PANEL:UpdateState( nID, sIcon, sText, sTooltip, tValue, bNoCycle ) 32 | local tState = self.tStates[nID] 33 | 34 | if not tState then return end 35 | if isstring( sIcon ) then sIcon = Material( sIcon ) end 36 | 37 | tState.mIcon = sIcon or tState.mIcon 38 | tState.sText = sText or tState.sText 39 | tState.sTooltop = sTooltip or tState.sTooltop 40 | tState.tValue = tValue or tState.tValue 41 | if bNoCycle ~= nil then tState.bNoCycle = bNoCycle end 42 | 43 | if self.m_nState == nID then self:SetState( nID, true ) end 44 | end 45 | 46 | function PANEL:SetState( nID, bNoChange ) 47 | local tState = self.tStates[nID] 48 | 49 | if tState then 50 | if tState.mIcon then self:SetMaterial( tState.mIcon ) end 51 | if tState.sText then self:SetText( tState.sText ) end 52 | if tState.sTooltip then self:SetTooltip( tState.sTooltip ) end 53 | 54 | if not bNoChange then self:StateChanged( self.m_nState, nID ) end 55 | 56 | self.m_nState = nID 57 | end 58 | end 59 | 60 | function PANEL:StateChanged( nOldState, nNewState ) end 61 | 62 | function PANEL:GetStateData( nID ) 63 | return self.tStates[nID or self.m_nState] 64 | end 65 | 66 | function PANEL:GetValue( ) 67 | return self.tStates[self.m_nState].tValue 68 | end 69 | 70 | function PANEL:NextState( nLoop ) 71 | local nID = self.m_nState + 1 72 | if nID > #self.tStates then nID = 1 end 73 | 74 | if nLoop and nLoop > #self.tStates * 2 then return self:SetState( nID ) end 75 | 76 | if self.tStates[nID].bNoCycle then 77 | nLoop = (nLoop or 0) + 1 78 | self.m_nState = nID 79 | return self:NextState( nLoop ) 80 | end 81 | 82 | self:SetState( nID ) 83 | end 84 | 85 | function PANEL:PrevState( nLoop ) 86 | local nID = self.m_nState - 1 87 | if nID < 1 then nID = #self.tStates end 88 | 89 | if nLoop and nLoop > #self.tStates * 2 then return self:SetState( nID ) end 90 | 91 | if self.tStates[nID].bNoCycle then 92 | nLoop = (nLoop or 0) + 1 93 | self.m_nState = nID 94 | return self:PrevState( nLoop ) 95 | end 96 | 97 | self:SetState( nID ) 98 | end 99 | 100 | function PANEL:DoClick( ) 101 | self:NextState( ) 102 | end 103 | 104 | function PANEL:DoRightClick( ) 105 | self:PrevState( ) 106 | end 107 | 108 | vgui.Register( "GOLEM_StateButton", PANEL, "GOLEM_ImageButton" ) -------------------------------------------------------------------------------- /lua/expression3/editor/derma/syntax/syntax_console.lua: -------------------------------------------------------------------------------- 1 | --[[============================================================================================================================================ 2 | Console hack 3 | Author: Oskar 4 | ============================================================================================================================================]] 5 | 6 | local Syntax = { 7 | sName = "console" 8 | } 9 | 10 | Syntax.__index = Syntax 11 | 12 | function Syntax:Init( dEditor ) 13 | self.dEditor = dEditor 14 | dEditor:SetSyntax( self ) 15 | dEditor:SetCodeFolding( false ) 16 | dEditor:SetParamMatching( false ) 17 | end 18 | 19 | function Syntax:GetSyntax( nRow ) 20 | if self.dEditor.tFormat[nRow] then return self.dEditor.tFormat[nRow] end 21 | 22 | return { { self.dEditor.tRows[nRow], Color( 255, 255, 255 ) } } 23 | end 24 | 25 | function Syntax:Parse( ) 26 | end 27 | 28 | Golem.Syntax:Add( Syntax.sName, Syntax ) -------------------------------------------------------------------------------- /lua/expression3/editor/derma/syntax/syntax_e3_tokenizer.lua: -------------------------------------------------------------------------------- 1 | --[[============================================================================================================================================ 2 | Some major hacks for syntaxing using the tokenizer 3 | Author: Oskar 4 | ============================================================================================================================================]] 5 | 6 | local Syntax = { 7 | sName = "e3_tokenizer", 8 | tOutput = { }, 9 | tTokens = { } 10 | } 11 | 12 | Syntax.__index = Syntax 13 | 14 | function Syntax:Init( dEditor ) 15 | self.dEditor = dEditor 16 | dEditor:SetSyntax( self ) 17 | dEditor:SetCodeFolding( false ) 18 | dEditor:SetParamMatching( false ) 19 | 20 | 21 | end 22 | 23 | local colors = { 24 | ["comment"] = Color( 128, 128, 128 ), 25 | ["function"] = Color( 80, 160, 240 ), 26 | ["library"] = Color( 80, 160, 240 ), 27 | ["constant"] = Color( 80, 160, 240 ), 28 | ["keyword"] = Color( 0, 120, 240 ), 29 | ["notfound"] = Color( 240, 160, 0 ), 30 | ["number"] = Color( 0, 200, 0 ), 31 | ["operator"] = Color( 240, 0, 0 ), 32 | ["string"] = Color( 188, 188, 188 ), 33 | ["class"] = Color( 140, 200, 50 ), 34 | ["userfunction"] = Color( 102, 122, 102 ), 35 | ["variable"] = Color( 0, 180, 80 ), 36 | ["directive"] = Color( 89, 135, 126 ), 37 | ["attribute"] = Color( 100, 100, 200 ), 38 | } 39 | 40 | -- ["prediction"] = Color( 0xe3, 0xb5, 0x2d ), 41 | -- ["metamethod"] = Color( 0x00, 0xc8, 0xff ), 42 | -- fallback for nonexistant entries: 43 | setmetatable( colors, { 44 | __index = function( tbl, index ) return Color( 255, 255, 255 ) end 45 | } ) 46 | 47 | Golem.Syntax:RegisterColors( Syntax.sName, colors ) 48 | 49 | function Syntax:GetSyntax( nRow ) 50 | if self.tOutput and self.tOutput[nRow] then return self.tOutput[nRow] end 51 | 52 | return { { self.dEditor.tRows[nRow], Color( 255, 255, 255 ) } } 53 | end 54 | 55 | 56 | function Syntax:Parse( ) 57 | local tmp = self.dEditor:ExpandAll( ) 58 | self.tRows = table.Copy( self.dEditor.tRows ) 59 | self.dEditor:FoldAll( tmp ) 60 | 61 | local code = string.gsub( table.concat( self.tRows, "\n" ), "\r", "" ) 62 | 63 | local Tokenizer = EXPR_TOKENIZER.New() 64 | self.Tokenizer = Tokenizer 65 | 66 | Tokenizer:Initialize( "EXPADV", code, true ); 67 | 68 | local bOK, tData = Tokenizer:Run( ); 69 | 70 | if bOK ~= true then print( "Syntax Error", tData ) end 71 | self.tTokens = tData 72 | 73 | self.tOutput = { } 74 | self.nRow = 1 75 | self.nChar = 0 76 | self.nPos = 1 77 | self.nToken = 1 78 | 79 | for i, tToken in ipairs(tData.tokens) do 80 | if tToken.newLine then 81 | self.nRow = tToken.line 82 | self.nChar = 0 83 | end 84 | 85 | local text = tostring( tToken.orig or tToken.data ) 86 | 87 | -- if tToken.start >= self.nPos then 88 | -- self.tOutput[self.nRow] = self.tOutput[self.nRow] or { } 89 | -- self.tOutput[self.nRow][#self.tOutput[self.nRow] + 1] = { (" "):rep(tToken.start - self.nPos), Color( 255, 255, 255 ) } 90 | -- self.nPos = tToken.start 91 | -- end 92 | 93 | if tToken.char - self.nChar > #text then 94 | local diff = (tToken.char - self.nChar) - #text 95 | self.tOutput[self.nRow] = self.tOutput[self.nRow] or { } 96 | self.tOutput[self.nRow][#self.tOutput[self.nRow] + 1] = { (" "):rep(diff), Color( 255, 255, 255 ) } 97 | end 98 | self.nChar = tToken.char 99 | 100 | -- if tToken.line > self.nRow then 101 | -- local code = string.Explode( "\n", tToken.data ) 102 | 103 | -- for i,v in ipairs( code ) do 104 | -- self.tOutput[self.nRow] = self.tOutput[self.nRow] or { } 105 | -- self.tOutput[self.nRow][#self.tOutput[self.nRow] + 1] = { v, colors[tToken.name] } 106 | -- self.nRow = self.nRow + 1 107 | -- end 108 | -- else 109 | self.tOutput[self.nRow] = self.tOutput[self.nRow] or { } 110 | self.tOutput[self.nRow][#self.tOutput[self.nRow] + 1] = { tostring(tToken.orig or tToken.data), colors[tToken.name] } 111 | -- end 112 | 113 | 114 | 115 | -- self.nPos = tToken.stop 116 | end 117 | 118 | /*local runs = 0 119 | while self.nRow < #self.tRows or runs > 10000 do 120 | self.tOutput[self.nRow] = { } 121 | local token = self.tTokens.tokens[self.nToken] 122 | 123 | if token then 124 | if token.start > self.nPos then 125 | self.tOutput[self.nRow][#self.tOutput[self.nRow] + 1] = { (" "):rep(token.start - self.nPos), Color( 255, 255, 255 ) } 126 | self.nPos = token.start 127 | end 128 | 129 | if token.line > self.nRow then 130 | local code = string.Explode( "\n", token.data ) 131 | 132 | for i,v in ipairs( code ) do 133 | self.tOutput[self.nRow] = self.tOutput[self.nRow] or { } 134 | self.tOutput[self.nRow][#self.tOutput[self.nRow] + 1] = { v, colors[token.name] } 135 | self.nRow = self.nRow + 1 136 | end 137 | else 138 | self.tOutput[self.nRow][#self.tOutput[self.nRow] + 1] = { token.data , colors[token.name] } 139 | end 140 | 141 | self.nPos = token.stop 142 | self.nToken = self.nToken + 1 143 | else 144 | break 145 | end 146 | 147 | 148 | -- self.nRow = self.nRow + 1 149 | runs = runs + 1 150 | end */ 151 | 152 | 153 | end 154 | 155 | Golem.Syntax:Add( Syntax.sName, Syntax ) -------------------------------------------------------------------------------- /lua/expression3/editor/derma/toolbar.lua: -------------------------------------------------------------------------------- 1 | /*============================================================================================================================================ 2 | Name: GOLEM_Toolbar 3 | Author: Oskar 4 | ============================================================================================================================================*/ 5 | 6 | local PANEL = { } 7 | 8 | function PANEL:SetupButton( sName, sMaterial, nDock, fDoClick ) 9 | local btn = self:Add( "GOLEM_ImageButton" ) 10 | btn:Dock( nDock ) 11 | btn:SetPadding( 5 ) 12 | btn:SetIconFading( false ) 13 | btn:SetIconCentered( false ) 14 | btn:SetTextCentered( false ) 15 | btn:DrawButton( true ) 16 | btn:SetTooltip( sName ) 17 | btn:SetMaterial( Material( sMaterial ) ) 18 | btn:SetFlat( true ) 19 | btn:SetStyleNames( { "toolbar-btn" } ) 20 | 21 | if fDoClick then 22 | btn.DoClick = fDoClick 23 | end 24 | 25 | return btn 26 | end 27 | 28 | function PANEL:SetupStateButton( tStates, nDock, fStateChanged ) 29 | local btn = self:Add( "GOLEM_StateButton" ) 30 | btn:Dock( nDock ) 31 | btn:SetPadding( 5 ) 32 | btn:SetStyleNames( { "toolbar-btn" } ) 33 | btn:SetFlat( true ) 34 | btn:SetIconFading( false ) 35 | btn:DrawButton( true ) 36 | 37 | for k, v in pairs( tStates ) do 38 | btn:AddState( v.sIcon, v.sText, v.sTooltip or v.sText, v.tValue, v.bNoCycle ) 39 | end 40 | 41 | btn:SetState( 1 ) 42 | 43 | if fStateChanged then 44 | btn.StateChanged = fStateChanged 45 | end 46 | end 47 | 48 | function PANEL:SetupCheckBox( sOn, sOff, sMaterialT, sMaterialC, nDock, fChangedValue ) 49 | local btn = self:Add( "GOLEM_CheckBox" ) 50 | btn:Dock( nDock ) 51 | btn:SetPadding( 5 ) 52 | btn:SetIconFading( false ) 53 | btn:SetIconCentered( false ) 54 | btn:SetTextCentered( false ) 55 | btn:DrawButton( true ) 56 | btn:SetTooltip( sOff ) 57 | btn:SetTick( Material( sMaterialT ) ) 58 | btn:SetCross( Material( sMaterialC ) ) 59 | btn:SetFlat( true ) 60 | btn:SetStyleNames( { "toolbar-btn" } ) 61 | btn:SetValue( true, true ) 62 | btn:SetValue( false, true ) 63 | 64 | function btn:ChangedValue(v) 65 | btn:SetTooltip( v and sOn or sOff ); 66 | if fChangedValue then fChangedValue(btn, v); end 67 | end 68 | 69 | btn:ToggleForwards() 70 | 71 | return btn 72 | end 73 | 74 | 75 | function PANEL:SetupTextBox( sName, sMaterial, nDock, fDoClick, fChangedValue ) 76 | local txt = self:Add( "GOLEM_TextEntry" ); 77 | 78 | txt:SetFlat( true ) 79 | txt:SetTooltip( sName ); 80 | txt:SetMaterial( Material( sMaterial ) ); 81 | txt:Dock( nDock ); 82 | 83 | if fChangedValue then txt.OnValueChange = fChangedValue; end 84 | 85 | if fDoClick then txt.DoClick = fDoClick; end 86 | 87 | return txt; 88 | end 89 | 90 | function PANEL:Paint( w, h ) 91 | surface.SetDrawColor( Golem.Style:GetColor( "toolbar-bg" )) 92 | surface.DrawRect( 0, 0, w, h ) 93 | end 94 | 95 | vgui.Register( "GOLEM_Toolbar", PANEL, "Panel" ) -------------------------------------------------------------------------------- /lua/expression3/editor/expr_editor_lib.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ____ _ _ ___ ___ ____ ___ ___ __ ____ _ _ _ ___ _ _ ____ 3 | F ___J FJ LJ F _ ", F _ ", F ___J F __". F __". FJ F __ ] F L L] /.\ F __". FJ L] F___ J 4 | J |___: J \/ F J `-' |J `-'(| J |___: J (___| J (___| J L J |--| L J \| L //_\\ J |--\ LJ | | L `-__| L 5 | | _____| / \ | __/F| _ L | _____| J\___ \ J\___ \ | | | | | | | |\ | / ___ \ | | J |J J F L |__ ( 6 | F L____: / /\ \ F |__/ F |_\ L F L____: .--___) \.--___) \ F J F L__J J F L\\ J / L___J \ F L__J |J\ \/ /F .-____] J 7 | J________LJ__//\\__LJ__| J__| \\__LJ________LJ\______JJ\______JJ____LJ\______/FJ__L \\__L J__L J__LJ______/F \\__// J\______/F 8 | |________||__/ \__||__L |__| J__||________| J______F J______F|____| J______F |__L J__| |__L J__||______F \__/ J______F 9 | 10 | ::Expression 3 Editor Lib:: 11 | NOTE: This file is yet to be included anywhere. 12 | ]] 13 | 14 | local Extension = EXPR_LIB.GetExtensionMetatable(); 15 | 16 | if (not Extension) then 17 | error("Unable to get extension meta table for editor upgrades."); 18 | end 19 | 20 | function Extension.RegisterEditorMenu(this, name, icon, open, close) 21 | hook.Add("Expression3.AddGolemTabTypes", "Expression3." .. this.name .. "." .. name, function(editor) 22 | if (this.enabled) then 23 | editor:AddTabType(name, function(self, ...) 24 | local menu = self.tMenuTabs[name]; 25 | 26 | if (menu) then 27 | self.pnlSideTabHolder:SetActiveTab(menu.Tab); 28 | 29 | menu.Panel:RequestFocus(); 30 | 31 | return menu.Panel, menu.Tab, menu; 32 | end 33 | 34 | local panel = open(editor, ...); 35 | 36 | local sheet = self.pnlSideTabHolder:AddSheet(name, panel, icon); 37 | 38 | self.pnlSideTabHolder:SetActiveTab(sheet.Tab); 39 | 40 | self.tMenuTabs[name] = sheet; 41 | 42 | panel:RequestFocus(); 43 | 44 | return panel, sheet.Tab, sheet; 45 | end, 46 | 47 | function(self, pTab, bSave) 48 | if (close) then 49 | close(self, pTab, bSave); 50 | end 51 | 52 | self.tMenuTabs[name] = nil; 53 | end); 54 | 55 | editor.tbRight:SetupButton(name, icon, BOTTOM, function() 56 | editor:NewTab(name); 57 | end); 58 | end 59 | end); 60 | end 61 | -------------------------------------------------------------------------------- /lua/expression3/editor/font.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | surface.CreateFont( "GOLEM_Fixedsys_17", { 3 | font = "Fixedsys", 4 | size = 17, 5 | weight = 400, 6 | antialias = false 7 | } ) 8 | ]] 9 | -- surface.CreateFont( "Trebuchet24", { -- Goddamit Garry! 10 | -- font = "Trebuchet MS", 11 | -- size = 24, 12 | -- weight = 900, 13 | -- blursize = 0, 14 | -- scanlines = 0, 15 | -- antialias = true, 16 | -- underline = false, 17 | -- italic = false, 18 | -- strikeout = false, 19 | -- symbol = false, 20 | -- rotary = false, 21 | -- shadow = false, 22 | -- additive = false, 23 | -- outline = false 24 | -- } ) 25 | surface.CreateFont( "Trebuchet22", { 26 | font = "Trebuchet MS", 27 | size = 22, 28 | weight = 900, 29 | blursize = 0, 30 | scanlines = 0, 31 | antialias = true, 32 | underline = false, 33 | italic = false, 34 | strikeout = false, 35 | symbol = false, 36 | rotary = false, 37 | shadow = false, 38 | additive = false, 39 | outline = false 40 | } ) 41 | 42 | surface.CreateFont( "Trebuchet20", { 43 | font = "Trebuchet MS", 44 | size = 20, 45 | weight = 900, 46 | blursize = 0, 47 | scanlines = 0, 48 | antialias = true, 49 | underline = false, 50 | italic = false, 51 | strikeout = false, 52 | symbol = false, 53 | rotary = false, 54 | shadow = false, 55 | additive = false, 56 | outline = false 57 | } ) 58 | 59 | --[[============================================================================================================================================ 60 | Fonts 61 | ============================================================================================================================================]] 62 | --[[* Windows 63 | 64 | Courier New 65 | DejaVu Sans Mono 66 | Consolas 67 | Fixedsys 68 | Lucida Console 69 | ]] 70 | --[[* Mac 71 | Monaco 72 | ]] 73 | local Font = { 74 | sFontID = "Trebuchet24" 75 | } 76 | 77 | Golem.Font = Font 78 | table.Empty( cvars.GetConVarCallbacks( "golem_font_name", true ) ) 79 | table.Empty( cvars.GetConVarCallbacks( "golem_font_size", true ) ) 80 | local cvFontName = CreateClientConVar( "golem_font_name", "Courier New", true, false ) 81 | local cvFontSize = CreateClientConVar( "golem_font_size", 16, true, false ) 82 | 83 | Golem.ConVars = { 84 | cvFontName = cvFontName, 85 | cvFontSize = cvFontSize 86 | } 87 | 88 | cvars.AddChangeCallback( "golem_font_name", function( sCVar, sOld, sNew ) 89 | Font:SetFont( sNew, cvFontSize:GetInt( ), true ) 90 | end ) 91 | 92 | cvars.AddChangeCallback( "golem_font_size", function( sCVar, sOld, sNew ) 93 | Font:SetFont( cvFontName:GetString( ), sNew, true ) 94 | end ) 95 | 96 | function Font:GetFont( ) 97 | return self.sFontID 98 | end 99 | 100 | function Font:GetFontName( ) 101 | return cvFontName:GetString( ) 102 | end 103 | 104 | function Font:GetFontSize( ) 105 | return cvFontSize:GetInt( ) 106 | end 107 | 108 | local CreatedFonts = { } 109 | 110 | local function CreateFont( sFont, nSize ) 111 | local sFontID = "golem_" .. string.Replace( string.lower( sFont ), " ", "_" ) .. "_" .. nSize 112 | 113 | if not CreatedFonts[sFontID] then 114 | surface.CreateFont( sFontID, { 115 | font = sFont, 116 | size = nSize, 117 | weight = 400 118 | } ) 119 | 120 | -- surface.CreateFont( sFontID .. "_bold", { 121 | -- font = sFont, 122 | -- size = nSize, 123 | -- weight = 800, 124 | -- } ) 125 | 126 | CreatedFonts[sFontID] = true 127 | end 128 | 129 | return sFontID 130 | end 131 | 132 | -- Override 133 | function Font:OnFontChange( ) 134 | end 135 | 136 | function Font:SetFont( sFont, nSize, bConVar ) 137 | sFont = sFont or cvFontName:GetString( ) 138 | nSize = tonumber( nSize ) or cvFontSize:GetInt( ) 139 | 140 | if not bConVar then 141 | if sFont ~= cvFontName:GetString( ) then 142 | RunConsoleCommand( "golem_font_name", sFont ) 143 | end 144 | 145 | if nSize ~= cvFontSize:GetInt( ) then 146 | RunConsoleCommand( "golem_font_size", nSize ) 147 | end 148 | end 149 | 150 | self.sFontID = CreateFont( sFont, nSize ) 151 | self:OnFontChange( self.sFontID, sFont, nSize ) 152 | end 153 | 154 | function Font:ChangeFontSize( nInc, bAbs ) 155 | return self:SetFont( nil, bAbs and nInc or cvFontSize:GetInt( ) + nInc ) 156 | end 157 | 158 | timer.Simple( 0, function( ) 159 | -- Font.sFontID = CreateFont( cvFontName:GetString(), cvFontSize:GetString() ) 160 | Font:SetFont( ) 161 | end ) -------------------------------------------------------------------------------- /lua/expression3/editor/style.lua: -------------------------------------------------------------------------------- 1 | --[[============================================================================================================================================ 2 | Custom color schemes for Golem editor 3 | Author: Oskar 4 | ============================================================================================================================================]] 5 | 6 | local Style = { sActiveStyle = "dark" } 7 | Golem.Style = Style 8 | 9 | local tStyleData = { } 10 | local sSaveLocation = "golem-styledata.txt" 11 | 12 | if file.Exists( sSaveLocation, "DATA" ) then 13 | tStyleData = util.JSONToTable( file.Read( sSaveLocation, "DATA" ) ) 14 | else 15 | tStyleData["dark"] = { 16 | ["main-bg"] = Color( 100, 100, 100, 255 ), 17 | ["main-bg-g"] = Color( 80, 80, 80, 255 ), 18 | ["main-tt"] = Color( 240, 240, 240, 255 ), 19 | 20 | ["toolbar-bg"] = Color( 70, 70, 70, 255 ), 21 | ["toolbar-btn"] = Color( 70, 70, 70, 255 ), 22 | 23 | ["editor-bg"] = Color( 0, 0, 0, 255 ), 24 | ["editor-side-bg"] = Color( 32, 32, 32, 255 ), 25 | ["editor-side-idx"] = Color( 255, 255, 255, 255 ), 26 | ["editor-caret"] = Color( 240, 240, 240, 255 ), 27 | ["editor-status"] = Color( 50, 50, 50, 100 ), 28 | ["editor-status-txt"] = Color( 235, 235, 235, 255 ), 29 | 30 | ["options-bg"] = Color( 30, 30, 30, 255 ), 31 | 32 | ["tab-bg"] = Color( 100, 100, 100, 255 ), 33 | ["tab-bg-active"] = Color( 20, 20, 20, 255 ), 34 | ["tab-txt"] = Color( 255, 255, 255, 255 ), 35 | } 36 | 37 | tStyleData["blue"] = { 38 | ["main-bg"] = Color( 60, 100, 180, 255 ), 39 | ["main-bg-g"] = Color( 40, 80, 160, 255 ), 40 | ["main-tt"] = Color( 240, 240, 240, 255 ), 41 | 42 | ["toolbar-bg"] = Color( 40, 80, 160, 255 ), 43 | ["toolbar-btn"] = Color( 40, 80, 160, 255 ), 44 | 45 | ["editor-bg"] = Color( 0, 0, 0, 255 ), 46 | ["editor-side-bg"] = Color( 32, 32, 32, 255 ), 47 | ["editor-side-idx"] = Color( 255, 255, 255, 255 ), 48 | ["editor-caret"] = Color( 240, 240, 240, 255 ), 49 | ["editor-status"] = Color( 50, 50, 50, 100 ), 50 | ["editor-status-txt"] = Color( 235, 235, 235, 255 ), 51 | 52 | ["options-bg"] = Color( 20, 30, 40, 255 ), 53 | 54 | ["tab-bg"] = Color( 80, 100, 120, 255 ), 55 | ["tab-bg-active"] = Color( 20, 40, 60, 255 ), 56 | ["tab-txt"] = Color( 255, 255, 255, 255 ), 57 | } 58 | 59 | tStyleData["light"] = { 60 | ["main-bg"] = Color( 220, 220, 220, 255 ), 61 | ["main-bg-g"] = Color( 200, 200, 200, 255 ), 62 | ["main-tt"] = Color( 60, 60, 60, 255 ), 63 | 64 | ["toolbar-bg"] = Color( 180, 180, 180, 255 ), 65 | ["toolbar-btn"] = Color( 180, 180, 180, 255 ), 66 | 67 | ["editor-bg"] = Color( 255, 255, 255, 255 ), 68 | ["editor-side-bg"] = Color( 240, 240, 240, 255 ), 69 | ["editor-side-idx"] = Color( 0, 0, 0, 255 ), 70 | ["editor-caret"] = Color( 0, 0, 0, 255 ), 71 | ["editor-status"] = Color( 50, 50, 50, 100 ), 72 | ["editor-status-txt"] = Color( 50, 50, 50, 255 ), 73 | 74 | ["options-bg"] = Color( 240, 240, 240, 255 ), 75 | 76 | ["tab-bg"] = Color( 220, 220, 220, 255 ), 77 | ["tab-bg-active"] = Color( 130, 130, 130, 255 ), 78 | ["tab-txt"] = Color( 0, 0, 0, 255 ), 79 | } 80 | 81 | -- file.Write( sSaveLocation, util.TableToJSON( tStyleData, true ) ) 82 | end 83 | 84 | function Style:GetStyles( ) 85 | return table.GetKeys( tStyleData ) 86 | end 87 | 88 | function Style:SetActiveStyle( sName ) 89 | if not tStyleData[sName] then error( string.format( "[GOLEM][Style] Tried to change active style to invalid style %q", sName) ) end 90 | self.sActiveStyle = sName 91 | end 92 | 93 | local c_white = Color(255, 255, 255, 255) 94 | function Style:GetColor( sName, bColor ) 95 | local tActiveStyle = tStyleData[self.sActiveStyle] 96 | 97 | if not tActiveStyle[sName] then 98 | ErrorNoHalt( string.format( "[GOLEM][Style] Tried to get invalid color %q", sName or "" ) ) 99 | if bColor then return c_white else return 255, 255, 255, 255 end 100 | end 101 | 102 | if bColor then return tActiveStyle[sName] else return tActiveStyle[sName].r,tActiveStyle[sName].g,tActiveStyle[sName].b,tActiveStyle[sName].a end 103 | end -------------------------------------------------------------------------------- /lua/expression3/editor/vector2.lua: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------------------- 2 | Vector2 class 3 | Author: Oskar 4 | Credits: RevouluPowered 5 | ---------------------------------------------------------------------------*/ 6 | 7 | local setmetatable = setmetatable 8 | 9 | local meta = { } 10 | meta.__index = meta 11 | meta.__type = "vector2" 12 | 13 | function meta:__add( other ) -- var+var 14 | if isnumber( other ) then 15 | return Vector2( self.x + other, self.y + other ) 16 | elseif istable( other ) and other.__type == "vector2" then 17 | return Vector2( self.x + other.x, self.y + other.y ) 18 | end 19 | end 20 | 21 | function meta:__sub( other ) -- -var 22 | if isnumber( other ) then 23 | return Vector2( self.x - other, self.y - other ) 24 | elseif istable( other ) and other.__type == "vector2" then 25 | return Vector2( self.x - other.x, self.y - other.y ) 26 | end 27 | end 28 | 29 | function meta:__mul( other ) -- var*var 30 | if isnumber( other ) then 31 | return Vector2( self.x * other, self.y * other ) 32 | elseif istable( other ) and other.__type == "vector2" then 33 | return Vector2( self.x * other.x, self.y * other.y ) 34 | end 35 | end 36 | 37 | function meta:__div( other ) -- var/var 38 | if isnumber( other ) then 39 | return Vector2( self.x / other, self.y / other ) 40 | elseif istable( other ) and other.__type == "vector2" then 41 | return Vector2( self.x / other.x, self.y / other.y ) 42 | end 43 | end 44 | 45 | function meta:__mod( other ) -- var%var 46 | return Vector2( self.x % other.x, self.y % other.y ) 47 | end 48 | 49 | function meta:__pow( other ) -- var^var 50 | return Vector2( self.x ^ other.x, self.y ^ other.y ) 51 | end 52 | 53 | function meta:__unm( ) -- -var 54 | return Vector2( self.x * -1, self.y * -1 ) 55 | end 56 | 57 | -- #var 58 | function meta:__len( ) -- Garry has broken this =( 59 | return math.sqrt( self.x * self.x + self.y * self.y ) 60 | end 61 | 62 | function meta:__eq( other ) -- var==var 63 | return self.x == other.x and self.y == other.y 64 | end 65 | 66 | function meta:__lt( other ) -- var tqamount * 0.1 or abs(tq.z) > tqamount * 0.1 then 54 | off = Vector(-tq.z, 0, tq.x) 55 | else 56 | off = Vector(-tq.y, tq.x, 0) 57 | end 58 | 59 | off = off:GetNormal() * tqamount * 0.5 60 | 61 | local dir = (tq:Cross(off)):GetNormal() 62 | 63 | ph:ApplyForceOffset(dir, off) 64 | ph:ApplyForceOffset(dir * -1, off * -1) 65 | end 66 | end 67 | 68 | extension:SetServerState(); 69 | 70 | local lim = 1e24 71 | local function vecClamp(v) 72 | v.x = math.Clamp(v.x, -lim, lim) 73 | v.y = math.Clamp(v.y, -lim, lim) 74 | v.z = math.Clamp(v.z, -lim, lim) 75 | 76 | return Vector(v.x, v.y, v.z) 77 | end 78 | 79 | local function angClamp(a) 80 | a.p = math.Clamp(a.p, -lim, lim) 81 | a.y = math.Clamp(a.y, -lim, lim) 82 | a.r = math.Clamp(a.r, -lim, lim) 83 | 84 | return Angle(a.p, a.y, a.r) 85 | end 86 | 87 | extension:RegisterMethod("e", "applyForce", "v", "", 0, function(context, e, v) 88 | if context:CanUseEntity(e) then 89 | local ph = e:GetPhysicsObject(); 90 | vecClamp(v); 91 | 92 | if IsValid(ph) then 93 | ph:ApplyForceCenter(v); 94 | end 95 | end 96 | end, false); 97 | 98 | extension:RegisterMethod("e", "applyOffsetForce", "v", "", 0, function(context, e, v) 99 | if context:CanUseEntity(e) then 100 | local ph = e:GetPhysicsObject(); 101 | vecClamp(v); 102 | 103 | if IsValid(ph) then 104 | ph:ApplyForceOffset(v); 105 | end 106 | end 107 | end, false); 108 | 109 | extension:RegisterMethod("e", "applyAngForce", "a", "", 0, function(context, e, a) 110 | if context:CanUseEntity(e) then 111 | local ph = e:GetPhysicsObject(); 112 | angClamp(a); 113 | 114 | if IsValid(ph) then 115 | applyangForce(ph, a); 116 | end 117 | end 118 | end, false); 119 | 120 | extension:RegisterMethod("ph", "applyForce", "v", "", 0, function(context, ph, v) 121 | if IsValid(ph) then 122 | local e = ph:GetEntity(); 123 | vecClamp(v); 124 | 125 | if context:CanUseEntity(e) then 126 | ph:ApplyForceCenter(v); 127 | end 128 | end 129 | end, false); 130 | 131 | extension:RegisterMethod("ph", "applyOffsetForce", "v", "", 0, function(context, ph, v) 132 | if IsValid(ph) then 133 | local e = ph:GetEntity(); 134 | vecClamp(v); 135 | 136 | if context:CanUseEntity(e) then 137 | ph:ApplyForceOffset(v); 138 | end 139 | end 140 | end, false); 141 | 142 | extension:RegisterMethod("ph", "applyAngForce", "a", "", 0, function(context, ph, a) 143 | if IsValid(ph) then 144 | local e = ph:GetEntity(); 145 | angClamp(a); 146 | 147 | if context:CanUseEntity(e) then 148 | applyangForce(ph, a); 149 | end 150 | end 151 | end, false); 152 | 153 | extension:RegisterMethod("e", "applyTorque", "v", "", 0, function(context, e, v) 154 | if context:CanUseEntity(e) then 155 | local ph = e:GetPhysicsObject(); 156 | vecClamp(v); 157 | 158 | if IsValid(ph) then 159 | applyTorque(ph, v); 160 | end 161 | end 162 | end, false); 163 | 164 | 165 | 166 | 167 | --[[ 168 | Set Velocity 169 | ]] 170 | 171 | extension:SetServerState(); 172 | 173 | extension:RegisterMethod("e", "setVel", "v", "", 0, function(context, e, v) 174 | if context:CanUseEntity(e) then 175 | local ph = e:GetPhysicsObject(); 176 | vecClamp(v); 177 | if IsValid(ph) then 178 | ph:SetVelocity(v); 179 | end 180 | end 181 | end, false); 182 | 183 | extension:RegisterMethod("ph", "setVel", "v", "", 0, function(context, ph, v) 184 | if IsValid(ph) then 185 | local e = ph:GetEntity(); 186 | vecClamp(v); 187 | if IsValid(e) and context:CanUseEntity(e) then 188 | ph:SetVelocity(v); 189 | end 190 | end 191 | end, false); 192 | 193 | 194 | --[[ 195 | End of extention. 196 | ]] 197 | 198 | 199 | extension:EnableExtension(); -------------------------------------------------------------------------------- /lua/expression3/extensions/bones.lua: -------------------------------------------------------------------------------- 1 | local extension = EXPR_LIB.RegisterExtension("bones"); 2 | 3 | extension:SetSharedState(); 4 | 5 | local NULL_BONE; 6 | 7 | --[[ 8 | Bone Class 9 | ]] 10 | 11 | extension:RegisterClass("ph", {"bone", "physics"}, IsValid, IsValid); 12 | 13 | extension:RegisterMethod("e", "physics", "", "ph", 1, function(e) 14 | if IsValid(e) then return e:GetPhysicsObject() or NULL_BONE; end 15 | return NULL_BONE; 16 | end, true); 17 | 18 | extension:RegisterMethod("e", "getBoneCount", "", "n", 1, function(e) 19 | if IsValid(e) then return e:GetPhysicsObjectCount(); end 20 | return 0; 21 | end, true); 22 | 23 | extension:RegisterMethod("e", "getBoneIndex", "", "n", 1, function(e) 24 | if IsValid(e) then return e:GetPhysicsObjectNum(); end 25 | return 0; 26 | end, true); 27 | 28 | --[[ 29 | Operators 30 | ]] 31 | 32 | extension:RegisterOperator("eq", "ph,ph", "b", 1); 33 | extension:RegisterOperator("neq", "ph,ph", "b", 1); 34 | 35 | 36 | --[[ 37 | IsValid 38 | ]] 39 | 40 | extension:RegisterMethod("ph", "isValid", "", "b", 1, function(e) 41 | return IsValid(e); 42 | end, true); 43 | 44 | --[[ 45 | pos and angles 46 | ]] 47 | 48 | local getPos = function(e) 49 | if IsValid(e) then return e:GetPos() or Vector(0, 0, 0); end 50 | return Vector(0, 0, 0); 51 | end 52 | 53 | local getAngles = function(e) 54 | if IsValid(e) then return e:GetAngles() or Angle(0, 0, 0); end 55 | return Angle(0, 0, 0); 56 | end 57 | 58 | extension:SetSharedState(); 59 | 60 | extension:RegisterMethod("ph", "getPos", "", "v", 1, getPos); 61 | 62 | extension:RegisterMethod("ph", "pos", "", "v", 1, getPos); 63 | 64 | extension:RegisterMethod("ph", "getAng", "", "v", 1, getAngles); 65 | 66 | extension:RegisterMethod("ph", "ang", "", "v", 1, getAngles); 67 | 68 | 69 | extension:RegisterMethod( "ph", "forward", "", "v", 1, function(e) 70 | if IsValid(e) then 71 | return e:LocalToWorld( Vector(1,0,0) ) - e:GetPos( ); 72 | end 73 | 74 | return Vector(0, 0, 0); 75 | end, true ); 76 | 77 | extension:RegisterMethod( "ph", "right", "", "v", 1, function(e) 78 | if IsValid(e) then 79 | return e:LocalToWorld( Vector(0,-1,0) ) - e:GetPos( ); 80 | end 81 | 82 | return Vector(0, 0, 0); 83 | end, true ); 84 | 85 | extension:RegisterMethod( "ph", "up", "", "v", 1, function(e) 86 | if IsValid(e) then 87 | return e:LocalToWorld( Vector(0,0,1) ) - e:GetPos( ); 88 | end 89 | 90 | return Vector(0, 0, 0); 91 | end, true ); 92 | 93 | --[[ 94 | World and Local Vector and Angles 95 | ]] 96 | 97 | extension:RegisterMethod("ph", "toWorld", "v", "v", 1, function(ph, v) 98 | if IsValid(ph) then return ph:LocalToWorld(v); end 99 | return Vector(0, 0, 0); 100 | end, true); 101 | 102 | extension:RegisterMethod("ph", "toLocal", "v", "v", 1, function(ph, v) 103 | if IsValid(ph) then return ph:WorldToLocal(v); end 104 | return Vector(0, 0, 0); 105 | end, true); 106 | 107 | --[[ 108 | Velecotity 109 | ]] 110 | 111 | extension:RegisterMethod("ph", "Vel", "", "v", 1, function(ph) 112 | if IsValid(ph) then return ph:GetVelocity(); end 113 | return Vector(0, 0, 0); 114 | end); 115 | 116 | extension:RegisterMethod("ph", "angVel", "", "a", 1, function(ph) 117 | if IsValid(ph) then 118 | local a = ph:GetAngleVelocity(); 119 | return Angle(a.x, a.y, a.z); 120 | end 121 | 122 | return Angle(0, 0, 0); 123 | end, true); 124 | 125 | --[[ 126 | Damping 127 | ]] 128 | 129 | extension:RegisterMethod("ph", "damping", "", "n", 1, function(ph) 130 | if IsValid(ph) then 131 | return ph:GetDamping(), nil; 132 | end 133 | 134 | return 0; 135 | end, true); 136 | 137 | extension:RegisterMethod("ph", "angDamping", "", "n", 1, function(ph) 138 | if IsValid(ph) then 139 | local a, b = ph:GetDamping(); 140 | return b; 141 | end 142 | 143 | return 0; 144 | end, true); 145 | 146 | extension:RegisterMethod("ph", "rotDamping", "", "n", 1, function(ph) 147 | if IsValid(ph) then return ph:GetRotDamping(); end 148 | return 0; 149 | end); 150 | 151 | extension:RegisterMethod("ph", "speedDamping", "", "n", 1, function(ph) 152 | if IsValid(ph) then return ph:GetSpeedDamping(); end 153 | return 0; 154 | end); 155 | 156 | 157 | 158 | --[[ 159 | Energy and Inertia 160 | ]] 161 | 162 | extension:RegisterMethod("ph", "energy", "", "n", 1, function(ph) 163 | if IsValid(ph) then return ph:GetEnergy(); end 164 | return 0; 165 | end, true); 166 | 167 | extension:RegisterMethod("ph", "invInertia", "", "n", 1, function(ph) 168 | if IsValid(ph) then return ph:GetInvInertia(); end 169 | return 0; 170 | end, true); 171 | 172 | extension:RegisterMethod("ph", "inertia", "", "v", 1, function(ph) 173 | if IsValid(ph) then return ph:GetInertia(); end 174 | return Vector(0, 0, 0); 175 | end, true); 176 | 177 | 178 | --[[ 179 | Bearing / Elevation 180 | ]] 181 | 182 | extension:RegisterMethod( "ph", "bearing", "v", "n", 1, function(ph, v) 183 | if IsValid(ph) then 184 | local p = ph:WorldToLocal( v ); 185 | return (180 / math.pi) * -math.atan2(p.y, p.x); 186 | end 187 | 188 | return 0; 189 | end, true); 190 | 191 | extension:RegisterMethod( "ph", "elevation", "v", "n", 1, function(ph, v) 192 | if IsValid(ph) then 193 | local p = ph:WorldToLocal( v ); 194 | local l = p:Length(); 195 | return (180 / math.pi) * -math.asin(p.z / l); 196 | end 197 | 198 | return 0; 199 | end, true); 200 | 201 | extension:RegisterMethod( "ph", "heading", "v", "n", 1, function(ph, v) 202 | if IsValid(ph) then 203 | local p = ph:WorldToLocal( v ); 204 | local b = (180 / math.pi) * -math.atan2(p.y, p.x); 205 | local l = p:Length(); 206 | return Angle((180 / math.pi) * math.asin(p.z / l), b, 0 ) ; 207 | end 208 | 209 | return Angle(0, 0, 0); 210 | end, true); 211 | 212 | --[[ 213 | End of extention. 214 | ]] 215 | 216 | 217 | extension:EnableExtension(); -------------------------------------------------------------------------------- /lua/expression3/extensions/datetime.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ____ _ _ ___ ___ ____ ___ ___ __ ____ _ _ _ ___ _ _ ____ 3 | F ___J FJ LJ F _ ", F _ ", F ___J F __". F __". FJ F __ ] F L L] /.\ F __". FJ L] F___ J 4 | J |___: J \/ F J `-' |J `-'(| J |___: J (___| J (___| J L J |--| L J \| L //_\\ J |--\ LJ | | L `-__| L 5 | | _____| / \ | __/F| _ L | _____| J\___ \ J\___ \ | | | | | | | |\ | / ___ \ | | J |J J F L |__ ( 6 | F L____: / /\ \ F |__/ F |_\ L F L____: .--___) \.--___) \ F J F L__J J F L\\ J / L___J \ F L__J |J\ \/ /F .-____] J 7 | J________LJ__//\\__LJ__| J__| \\__LJ________LJ\______JJ\______JJ____LJ\______/FJ__L \\__L J__L J__LJ______/F \\__// J\______/F 8 | |________||__/ \__||__L |__| J__||________| J______F J______F|____| J______F |__L J__| |__L J__||______F \__/ J______F 9 | 10 | ::Time Extention:: 11 | ]] 12 | 13 | 14 | local extension = EXPR_LIB.RegisterExtension("time"); 15 | 16 | --[[ 17 | Time Stamp Object 18 | ]] 19 | 20 | local function timestamp(from, utc) 21 | return os.date(utc and "!*t" or "*t", from or os.time()); 22 | end 23 | 24 | extension:RegisterClass("ts", {"date"}, istable, EXPR_LIB.NOTNIL); 25 | 26 | extension:RegisterConstructor("ts", "", function() 27 | return {year = 0, month = 0, day = 0, hour = 0, min = 0, sec = 0, isdst = false}; 28 | end, true); 29 | 30 | extension:RegisterConstructor("ts", "n", timestamp, true); 31 | extension:RegisterConstructor("ts", "n,b", timestamp, true); 32 | 33 | extension:RegisterConstructor("ts", "b", function(utc) 34 | return os.date(utc and "!*t" or "*t", os.time()); 35 | end, true); 36 | 37 | --[[ 38 | Attributes 39 | ]] 40 | 41 | extension:RegisterAttribute("ts", "year", "n", "year"); 42 | extension:RegisterAttribute("ts", "month", "n", "month"); 43 | extension:RegisterAttribute("ts", "day", "n", "day"); 44 | 45 | extension:RegisterAttribute("ts", "hour", "n", "hour"); 46 | extension:RegisterAttribute("ts", "minute", "n", "min"); 47 | extension:RegisterAttribute("ts", "second", "n", "sec"); 48 | 49 | --[[ 50 | Time Stamp Methods 51 | ]] 52 | 53 | extension:RegisterMethod("ts", "getYear", "", "n", 1, function(ts, v) return ts.year; end, true); 54 | extension:RegisterMethod("ts", "getMonth", "", "n", 1, function(ts, v) return ts.month; end, true); 55 | extension:RegisterMethod("ts", "getDay", "", "n", 1, function(ts, v) return ts.day; end, true); 56 | 57 | extension:RegisterMethod("ts", "getHour", "", "n", 1, function(ts, v) return ts.hour; end, true); 58 | extension:RegisterMethod("ts", "getMinute", "", "n", 1, function(ts, v) return ts.min; end, true); 59 | extension:RegisterMethod("ts", "getSecond", "", "n", 1, function(ts, v) return ts.sec; end, true); 60 | 61 | extension:RegisterMethod("ts", "setYear", "n", "", 0, function(ts, v) ts.year = v; end, true); 62 | extension:RegisterMethod("ts", "setMonth", "n", "", 0, function(ts, v) ts.month = v; end, true); 63 | extension:RegisterMethod("ts", "setDay", "n", "", 0, function(ts, v) ts.day = v; end, true); 64 | 65 | extension:RegisterMethod("ts", "setHour", "n", "", 0, function(ts, v) ts.hour = v; end, true); 66 | extension:RegisterMethod("ts", "setMinute", "n", "", 0, function(ts, v) ts.min = v; end, true); 67 | extension:RegisterMethod("ts", "setSecond", "n", "", 0, function(ts, v) ts.sec = v; end, true); 68 | 69 | extension:RegisterMethod("ts", "setTime", "n,n,n", "", 0, function(ts, hour, min, sec) 70 | ts.hour = hour; 71 | ts.min = min; 72 | ts.sec = sec; 73 | end, true); 74 | 75 | extension:RegisterMethod("ts", "setDate", "n,n,n", "", 0, function(ts, day, month, year) 76 | obj.day = day; 77 | obj.month = month; 78 | obj.year = year; 79 | end, true); 80 | 81 | --[[ 82 | Time Library 83 | ]] 84 | 85 | extension:RegisterLibrary("time"); 86 | 87 | extension:RegisterFunction("time", "curtime", "", "n", 1, CurTime, true); 88 | 89 | extension:RegisterFunction("time", "realtime", "", "n", 1, RealTime, true); 90 | 91 | extension:RegisterFunction("time", "systime", "", "n", 1, SysTime, true); 92 | 93 | extension:RegisterFunction("time", "frametime", "", "n", 1, FrameTime, true); 94 | 95 | 96 | extension:RegisterFunction("time", "now", "", "n", 1, os.time, true); 97 | 98 | extension:RegisterFunction("time", "now", "ts", "n", 1, function(ts) 99 | return os.time(ts or {}); 100 | end, true); 101 | 102 | --[[ 103 | ]] 104 | 105 | extension:EnableExtension(); 106 | -------------------------------------------------------------------------------- /lua/expression3/extensions/game.lua: -------------------------------------------------------------------------------- 1 | local extension = EXPR_LIB.RegisterExtension("game"); 2 | 3 | --[[ 4 | Game for all your game information. 5 | ]] 6 | 7 | extension:RegisterLibrary("game"); 8 | 9 | extension:RegisterFunction("game", "map", "", "s", 1, game.GetMap); 10 | 11 | extension:RegisterFunction("game", "hostname", "", "s", 1, function() 12 | return GetConVar("hostname"):GetString(); 13 | end, true); 14 | 15 | extension:RegisterFunction("game", "isLan", "", "b", 1, function() 16 | return GetConVar("sv_lan"):GetBool() 17 | end, true); 18 | 19 | extension:RegisterFunction("game", "gamemode", "", "s", 1, function() 20 | return gmod.GetGamemode().Name; 21 | end, true); 22 | 23 | extension:RegisterFunction("game", "isSinglePlayer", "", "b", 1, game.SinglePlayer, true); 24 | 25 | extension:RegisterFunction("game", "isSinglePlayer", "", "b", 1, game.IsDedicated, true); 26 | 27 | extension:RegisterFunction("game", "numPlayers", "", "n", 1, function() 28 | return #player.GetAll(); 29 | end, true); 30 | 31 | extension:RegisterFunction("game", "maxPlayers", "", "n", 1, game.MaxPlayers, true); 32 | 33 | extension:RegisterFunction("game", "gravity", "", "n", 1, function() 34 | return GetConVar("sv_gravity"):GetFloat() 35 | end, true); 36 | 37 | extension:RegisterFunction("game", "propGravity", "", "v", 1, physenv.GetGravity, true); 38 | 39 | extension:RegisterFunction("game", "airDensity", "", "n", 1, physenv.GetAirDensity, true); 40 | 41 | extension:RegisterFunction("game", "maxFrictionMass", "", "n", 1, function() 42 | return physenv.GetPerformanceSettings()["MaxFrictionMass"]; 43 | end, true); 44 | 45 | extension:RegisterFunction("game", "minFrictionMass", "", "n", 1, function() 46 | return physenv.GetPerformanceSettings()["MinFrictionMass"]; 47 | end, true); 48 | 49 | extension:RegisterFunction("game", "speedLimit", "", "n", 1, function() 50 | return physenv.GetPerformanceSettings()["MaxVelocity"]; 51 | end, true); 52 | 53 | extension:RegisterFunction("game", "angSpeedLimit", "", "n", 1, function() 54 | return physenv.GetPerformanceSettings()["MaxAngularVelocity"]; 55 | end, true); 56 | 57 | extension:RegisterFunction("game", "tickInterval", "", "n", 1, engine.TickInterval, true); 58 | 59 | extension:RegisterFunction("game", "tickRate", "", "n", 1, function() 60 | return 1 / engine.TickInterval(); 61 | end, true); 62 | 63 | extension:EnableExtension(); -------------------------------------------------------------------------------- /lua/expression3/extensions/http.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Request function 3 | ]] 4 | 5 | local request = function(ctx, url, suc, fail) 6 | if not ctx:canGetURL(url, "HTTPRequests") then return false; end 7 | 8 | local entity = ctx.entity; 9 | 10 | http.Fetch(url, function( contents, size, headers, code ) 11 | if not IsValid(entity) or not entity:IsRunning() then return; end 12 | entity:Invoke( string.format("http.request(%q).sucess", url), "", 0, suc, {"s", contents}); 13 | end, function( err ) 14 | if not fail then return; end 15 | if not IsValid(entity) or not entity:IsRunning() then return; end 16 | entity:Invoke( string.format("http.request(%q).fail", url), "", 0, fail, {"s", err}); 17 | end); 18 | 19 | return true; 20 | end 21 | 22 | --[[ 23 | I just stole e2's http functions, credit to orgional authors. 24 | ]] 25 | 26 | local extension = EXPR_LIB.RegisterExtension("http"); 27 | 28 | extension:SetClientState(); 29 | 30 | extension:RegisterLibrary("http"); 31 | 32 | extension:RegisterPermission("HTTPRequests", "fugue/drive-upload.png", "This gate is allowed to make http requests the filter setting will still be applied."); 33 | 34 | 35 | extension:RegisterFunction("http", "request", "s,f", "b", 1, request, false); 36 | extension:RegisterFunction("http", "request", "s,f,f", "b", 1, request, false); 37 | 38 | extension:RegisterFunction("http", "encode", "s", "s", 1, function(data) 39 | local ndata = string.gsub( data, "[^%w _~%.%-]", function( str ) 40 | local nstr = string.format( "%X", string.byte( str ) ) 41 | 42 | return "%" .. ( ( string.len( nstr ) == 1 ) and "0" or "" ) .. nstr 43 | end ) 44 | 45 | return string.gsub( ndata, " ", "+" ) 46 | end, true); 47 | 48 | extension:RegisterFunction("http", "encode", "s", "s", 1, function(data) 49 | local ndata = string.gsub( data, "+", " " ) 50 | 51 | return string.gsub( ndata, "(%%%x%x)", function( str ) 52 | return string.char( tonumber( string.Right( str, 2 ), 16 ) ) 53 | end ) 54 | end, true); 55 | 56 | extension:EnableExtension() -------------------------------------------------------------------------------- /lua/expression3/extensions/timers.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ____ _ _ ___ ___ ____ ___ ___ __ ____ _ _ _ ___ _ _ ____ 3 | F ___J FJ LJ F _ ", F _ ", F ___J F __". F __". FJ F __ ] F L L] /.\ F __". FJ L] F___ J 4 | J |___: J \/ F J `-' |J `-'(| J |___: J (___| J (___| J L J |--| L J \| L //_\\ J |--\ LJ | | L `-__| L 5 | | _____| / \ | __/F| _ L | _____| J\___ \ J\___ \ | | | | | | | |\ | / ___ \ | | J |J J F L |__ ( 6 | F L____: / /\ \ F |__/ F |_\ L F L____: .--___) \.--___) \ F J F L__J J F L\\ J / L___J \ F L__J |J\ \/ /F .-____] J 7 | J________LJ__//\\__LJ__| J__| \\__LJ________LJ\______JJ\______JJ____LJ\______/FJ__L \\__L J__L J__LJ______/F \\__// J\______/F 8 | |________||__/ \__||__L |__| J__||________| J______F J______F|____| J______F |__L J__| |__L J__||______F \__/ J______F 9 | 10 | ::Timers/Time:: 11 | ]] 12 | 13 | hook.Add("Expression3.Entity.BuildSandbox", "Expression3.Timers", function(entity, ctx, env) 14 | ctx.data.timers = {}; 15 | end); 16 | 17 | local extension = EXPR_LIB.RegisterExtension("timers"); 18 | 19 | extension:RegisterLibrary("timer"); 20 | 21 | extension:RegisterFunction("timer", "simple", "n,f,...", "", 0, function(ctx, d, f, ...) 22 | local timers = ctx.data.timers; 23 | 24 | timers[#timers + 1] = { 25 | delay = d; 26 | next = CurTime() + d; 27 | paused = false; 28 | reps = 1; 29 | count = 0; 30 | func = f; 31 | values = {...}; 32 | simple = true; 33 | }; 34 | 35 | end, false); 36 | 37 | extension:RegisterFunction("timer", "create", "s,n,n,f,...", "", 0, function(ctx, n, d, r, f, ...) 38 | local timers = ctx.data.timers; 39 | 40 | timers[n] = { 41 | delay = d; 42 | next = CurTime() + d; 43 | paused = false; 44 | reps = r; 45 | count = 0; 46 | func = f; 47 | values = {...}; 48 | }; 49 | 50 | end, false); 51 | 52 | extension:RegisterFunction("timer", "exists", "s", "b", 1, function(ctx, name) 53 | local timers = ctx.data.timers; 54 | return timers[name] != nil; 55 | end, false); 56 | 57 | extension:RegisterFunction("timer", "remove", "s", "", 0, function(ctx, name) 58 | local timers = ctx.data.timers; 59 | timers[name] = nil; 60 | end, false); 61 | 62 | extension:RegisterFunction("timer", "pause", "s", "", 0, function(ctx, name) 63 | local timers = ctx.data.timers; 64 | 65 | if (timers[name]) then 66 | timers[name].paused = true; 67 | end 68 | end, false); 69 | 70 | extension:RegisterFunction("timer", "resume", "s", "", 0, function(ctx, name) 71 | local timers = ctx.data.timers; 72 | 73 | if (timers[name]) then 74 | timers[name].paused = false; 75 | end 76 | end, false); 77 | 78 | hook.Add( "Think", "Expression3.Timers.Run", function( ) 79 | local now = CurTime(); 80 | 81 | for _, ctx in pairs(EXPR_LIB.GetAll()) do 82 | if (IsValid(ctx.entity)) then 83 | local timers = ctx.data.timers; 84 | 85 | if (timers) then 86 | local i = 0; 87 | for k, timer in pairs(timers) do 88 | 89 | i = i + 1; -- Limit the amount we do in one think. 90 | 91 | if (i > 500) then break; end 92 | 93 | if (not timer.paused and now >= timer.next) then 94 | timer.next = now + timer.delay; 95 | 96 | if (timer.reps > 0) then 97 | timer.count = timer.count + 1; 98 | 99 | if (timer.count >= timer.reps) then 100 | timers[k] = nil; 101 | end 102 | end 103 | 104 | if (timer.simple) then 105 | timers[k] = nil; 106 | end 107 | 108 | local where = "timer." .. k; 109 | ctx.entity:Invoke(where, "", 0, timer.func, unpack(timer.values)); 110 | end 111 | end 112 | end 113 | end 114 | end 115 | end); 116 | 117 | 118 | extension:EnableExtension(); 119 | -------------------------------------------------------------------------------- /lua/expression3/extensions/urlmaterials.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Szymekk made this extention for EA2, I have just ported it over. 3 | ]] 4 | 5 | local max_count, max_size; 6 | 7 | if CLIENT then 8 | max_count = CreateConVar("expression3_maxurlmaterials", 15); 9 | max_size = CreateConVar("expression3_maxurlmatsize", 512); 10 | end 11 | 12 | --[[ 13 | 14 | ]] 15 | 16 | hook.Add("Expression3.Entity.BuildSandbox", "Expression3.URLMaterials", function(entity, ctx, env) 17 | ctx.data.materials = {}; 18 | end); 19 | 20 | --[[ 21 | 22 | ]] 23 | 24 | local TextureSize = 512; 25 | local HTML = HTML 26 | local URLQueue = { } 27 | local CanLoad = true 28 | 29 | if CLIENT then TextureSize = max_size:GetInt(); end 30 | 31 | --[[ 32 | 33 | ]] 34 | 35 | local function Download(context, Name, url, Width, Height) 36 | if not context:canGetURL(url, "URLMaterials") then return; end 37 | 38 | if IsValid(HTML) then HTML:Remove() end 39 | 40 | local htmlpanel = vgui.Create("HTML") 41 | htmlpanel:SetVisible(true) 42 | htmlpanel:SetSize(Width, Height) 43 | htmlpanel:SetPos(ScrW()-1, ScrH()-1) 44 | htmlpanel:SetHTML( 45 | [[ 46 | 53 | 54 | 55 | 56 | ]] 57 | ) 58 | HTML = htmlpanel 59 | 60 | local uid = "e3_urlmaterial_" .. Name .. context.entity:EntIndex() 61 | 62 | local spawn, nextUpdate = RealTime(), RealTime() + 0.5 63 | hook.Add("Think", uid, function() 64 | if !IsValid(context.entity) || !IsValid(htmlpanel) || RealTime() - spawn > 5 then 65 | htmlpanel:Remove() 66 | CanLoad = true 67 | hook.Remove("Think", uid) 68 | return 69 | end 70 | 71 | if RealTime() < nextUpdate then return end 72 | 73 | nextUpdate = RealTime() + 0.1 74 | 75 | if htmlpanel:IsLoading() then 76 | return 77 | end 78 | 79 | local mat = htmlpanel:GetHTMLMaterial() 80 | 81 | if !mat then return end 82 | 83 | local vertex_mat = CreateMaterial("e3urlmat_" .. Name, "UnlitGeneric", { ["$vertexcolor"] = 1, ["$vertexalpha"] = 1, ["$ignorez"] = 1, ["$nolod"] = 1 } ) 84 | local tex = mat:GetTexture("$basetexture") 85 | tex:Download() 86 | vertex_mat:SetTexture("$basetexture", tex) 87 | context.data.materials[Name] = vertex_mat 88 | 89 | htmlpanel:Remove() 90 | CanLoad = true 91 | hook.Remove("Think", uid) 92 | end) 93 | end 94 | 95 | --[[ 96 | 97 | ]] 98 | 99 | hook.Add("Think", "Expression3.UrlTexture", function() 100 | if #URLQueue > 1 && CanLoad then 101 | CanLoad = false 102 | Download(unpack(URLQueue[#URLQueue])) 103 | table.remove(URLQueue, #URLQueue) 104 | end 105 | if #URLQueue == 0 then CanLoad = true end 106 | end) 107 | 108 | --[[ 109 | 110 | ]] 111 | 112 | local download_material = function(context, Trace, Name, URL, Width, Height) 113 | if (context.data.materials[Name] || #context.data.materials < Component:ReadSetting("maxurlmaterials", 15)) && #URLQueue < 10 then 114 | context.data.materials[Name] = context.data.materials[Name] or Material("debug/debugempty") 115 | table.insert(URLQueue, { context, Name, URL, math.Clamp(Width or TextureSize, 1, TextureSize), math.Clamp(Height or TextureSize, 1, TextureSize) }) 116 | end 117 | end 118 | 119 | --[[ 120 | 121 | ]] 122 | 123 | local extension = EXPR_LIB.RegisterExtension("url-materials"); 124 | 125 | extension:SetClientState(); 126 | 127 | extension:RegisterPermission("URLMaterials", "fugue/drive-upload.png", "This gate is allowed to download images the filter setting will still be applied."); 128 | 129 | extension:RegisterFunction("render", "downloadURLMaterial", "s,s,n,n", "", 0, download_material, false); 130 | 131 | extension:RegisterFunction("render", "downloadURLMaterial", "s,s", "", 0, download_material, false); 132 | 133 | extension:RegisterFunction("render", "setURLMaterial", "s", "", 0, function(context, name) 134 | if context.data.materials then 135 | local mat = context.data.materials[name]; 136 | 137 | if mat then 138 | render.SetMaterial(mat); 139 | surface.SetMaterial(mat); 140 | end 141 | end 142 | end, false); 143 | 144 | extension:EnableExtension(); 145 | -------------------------------------------------------------------------------- /lua/expression3/helper/csv/attributes.txt: -------------------------------------------------------------------------------- 1 | signature id name type desc 2 | _v2.y _v2 y n Y position of vector2. 3 | _v2.x _v2 x n X position of vector2. 4 | _trr.hit_group _trr hit_group n 5 | _trr.hit_sky _trr hit_sky b 6 | _trr.hitbox _trr hitbox n 7 | _trr.hitbox_bone _trr hitbox_bone n 8 | _trr.hit_world _trr hit_world b 9 | _trr.distance _trr distance n 10 | _trr.hit_norm _trr hit_norm v The direction of the surface that was hit as a normal vector (vector with length of 1). 11 | _trr.hit_pos _trr hit_pos v The position the trace stopped. 12 | _trr.hit _trr hit b Indicates whether the trace hit something. 13 | _trr.hit_nodraw _trr hit_nodraw b Indicates whenever the trace hit a no-draw brush 14 | _trr.entity _trr entity e The entity hit by the trace. 15 | _trr.material_type _trr material_type n See https://wiki.garrysmod.com/page/Enums/MAT 16 | _trr.fraction _trr fraction n This indicates the how much of your trace length was used from 0-1 17 | _trr.normal _trr normal n The direction of the trace as a normal vector (vector with length of 1). 18 | _trr.fraction_solid _trr fraction_solid n Given the trace started in a solid enviroment, this will return at what distance the trace left the solid from 0-1. Doesn't work if the trace hit a non-worldspawn entity. 19 | _trr.hit_bone _trr hit_bone n The physics object id, of the physics object hit by the trace. 20 | _trr.start_solid _trr start_solid b True if the trace hit a none solid object. 21 | _trr.hit_noneworld _trr hit_noneworld b True if the trace hit a none world object. 22 | _trr.hit_texture _trr hit_texture s The surface material (not texture) of whatever the trace hit. Will be "**displacement**" if the trace hit a displacement, and **studio** if it hit a prop. 23 | v.y v y n Y position of vector. 24 | v.x v x n X position of vector. 25 | v.z v z n Z position of vector. 26 | _tr.hit_water _tr hit_water b If true the created trace will hit water. 27 | _tr.default_zero _tr default_zero b If true the created trace will default its hit position to 0. 28 | _tr.ignore_entitys _tr ignore_entitys b If true the created trace will not hit entities. 29 | _tr.ignore_world _tr ignore_world b If true the created trace will not hit the world. 30 | _tr.start _tr start v This is the start position of the created trace. 31 | _tr.end _tr end v This is the end position of the created trace. 32 | _ts.day _ts day n 33 | _ts.minute _ts minute n 34 | _ts.second _ts second n 35 | _ts.year _ts year n 36 | _ts.month _ts month n 37 | _ts.hour _ts hour n 38 | q.r q r n 39 | q.k q k n 40 | q.j q j n 41 | q.i q i n 42 | c.r c r n 43 | c.b c b n 44 | c.a c a n 45 | c.g c g n 46 | a.y a y n 47 | a.r a r n 48 | a.p a p n -------------------------------------------------------------------------------- /lua/expression3/helper/csv/functions.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/lua/expression3/helper/csv/functions.txt -------------------------------------------------------------------------------- /lua/expression3/permissions/extension.lua: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | Create a permissions extention 3 | ****************************************************************************************************************************/ 4 | 5 | local extension = EXPR_LIB.RegisterExtension("permissions"); 6 | 7 | extension:RegisterPermission("PropControl", "fugue/controller-d-pad.png", "This gate is allowed to alter your props."); 8 | 9 | extension:RegisterEvent("PermissionChanged", "p,s,b"); 10 | 11 | extension:RegisterEvent("GatherPermissions", "", "t", 1); 12 | 13 | extension:RegisterLibrary("permissions"); 14 | 15 | extension:RegisterFunction("permissions", "getAll", "", "t", 1, function() 16 | local t = {}; 17 | 18 | for k, _ in pairs( EXPR_LIB.PERMS ) do 19 | t[#t + 1] = {"s", k}; 20 | end 21 | 22 | return {tbl = t, children = {}, parents = {}, size = #t}; 23 | end, true); 24 | 25 | extension:RegisterFunction("permissions", "check", "e,s", "b", 1, function(ctx, ent, perm) 26 | if not IsValid(ent) then return false; end 27 | return ctx.getPerm(ent, perm); 28 | end, false); 29 | 30 | extension:RegisterFunction("permissions", "check", "e", "b", 1, function(ctx, ent) 31 | if not IsValid(ent) then return false; end 32 | return ctx.ppCheck(ent, perm); 33 | end, false); 34 | 35 | extension:RegisterFunction("permissions", "owner", "e", "p", 1, function(ctx, ent) 36 | if not IsValid(ent) then return nil; end 37 | return ctx.getOwner(ent) or Entity(0); 38 | end, false); 39 | 40 | extension:EnableExtension(); -------------------------------------------------------------------------------- /lua/expression3/permissions/gate_browser.lua: -------------------------------------------------------------------------------- 1 | if SERVER then return; end 2 | 3 | /********************************************************************************* 4 | Browser 5 | *********************************************************************************/ 6 | local PANEL = {}; 7 | 8 | function PANEL:Init() 9 | self.entities = {}; 10 | 11 | self:Reload(); 12 | end 13 | 14 | function PANEL:Reload(b) 15 | if not b then 16 | self:AddGlobalNode(); 17 | self.entities = {}; 18 | end 19 | 20 | for _, ctx in pairs(EXPR_LIB.GetAll()) do 21 | self:AddEntity(ctx.entity); 22 | end 23 | end 24 | 25 | function PANEL:AddGlobalNode() 26 | local oNode = self:AddNode("Global"); 27 | 28 | oNode:SetIcon("fugue/globe-network.png"); 29 | 30 | self:AddGlobalURLNode(oNode); 31 | 32 | for perm, data in pairs(EXPR_LIB.PERMS) do 33 | 34 | local pNode = self:AddNode(oNode, perm); 35 | local btn = self:EmbedButton(pNode, "GOLEM_StateBox", 24, 0); 36 | 37 | pNode:SetIcon(data[2]); -- icon 38 | pNode:SetTooltip(data[3]); --desc 39 | 40 | btn:AddState("allow", EXPR_ALLOW, "fugue/tick.png", "Allowed"); 41 | btn:AddState("deny", EXPR_DENY, "fugue/cross-button.png", "Denied"); 42 | btn:AddState("friends", EXPR_FRIEND, "fugue/hand-shake.png", "Friends Only"); 43 | 44 | btn:PollFromCallback(function() 45 | return EXPR_PERMS.GetGlobal(LocalPlayer(), perm), true; 46 | end); 47 | 48 | btn.ChangedValue = function(value) 49 | EXPR_PERMS.SetGlobalPermission(perm, value); 50 | end; 51 | 52 | end 53 | 54 | end 55 | 56 | function PANEL:AddGlobalURLNode(oNode) 57 | 58 | local pNode = self:AddNode(oNode, "URL Filter Mode"); 59 | local btn = self:EmbedButton(pNode, "GOLEM_StateBox", 24, 0); 60 | 61 | pNode:SetIcon("fugue/monitor-network.png"); 62 | pNode:SetTooltip("How are http and url requests handled."); 63 | 64 | btn:AddState("deny", EXPR_DENY, "fugue/cross-button.png", "Denied"); 65 | btn:AddState("whitelist", EXPR_WHITE_LIST, "fugue/quill.png", "Use Whitelist"); 66 | btn:AddState("blacklist", EXPR_BLACK_LIST, "fugue/exclamation-circle.png", "Use blacklist"); 67 | btn:AddState("friends", EXPR_FRIENDS, "fugue/hand-shake.png", "Friends Only"); 68 | 69 | btn:PollFromCallback(function() 70 | return EXPR_PERMS.GetGlobal(LocalPlayer(), "URL"), true; 71 | end); 72 | 73 | btn.ChangedValue = function(value) 74 | EXPR_PERMS.SetGlobalPermission("URL", value); 75 | end; 76 | 77 | end 78 | 79 | function PANEL:AddEntity(entity) 80 | 81 | if entity and not self.entities[entity] then 82 | 83 | local oName = entity:GetPlayerName() or "Disconnected"; 84 | local eName = entity:GetScriptName() or "generic"; 85 | 86 | eName = string.Explode("\n", eName)[1]; 87 | eName = string.format("(%i) - %s", entity:EntIndex(), eName); 88 | 89 | local oNode = self:AddNode(oName); 90 | local eNode = self:AddNode(oNode, eName); 91 | 92 | oNode:SetIcon("fugue/xfn.png"); 93 | eNode:SetIcon("fugue/monitor-window-3d.png"); 94 | 95 | self:AddEntityURLNode(eNode, entity); 96 | 97 | for perm, data in pairs(EXPR_LIB.PERMS) do 98 | 99 | local pNode = self:AddNode(eNode, perm); 100 | local btn = self:EmbedButton(pNode, "GOLEM_CheckBox", 24, 0); 101 | 102 | pNode:SetIcon(data[2]); 103 | pNode:SetTooltip(data[3]); 104 | 105 | btn:AddState("allow", EXPR_ALLOW, "fugue/tick.png", "Allowed"); 106 | btn:AddState("deny", EXPR_DENY, "fugue/cross-button.png", "Denied"); 107 | btn:AddState("global", EXPR_FRIEND, "fugue/globe-network.png"); 108 | 109 | btn:PollFromCallback(function() 110 | return EXPR_PERMS.Get(entity, LocalPlayer(), perm, true), true; 111 | end); 112 | 113 | btn.ChangedValue = function(value) 114 | EXPR_PERMS.Set(entity, LocalPlayer(), perm, value); 115 | end; 116 | end 117 | 118 | self.entities[entity] = eNode; 119 | 120 | end 121 | 122 | end 123 | 124 | function PANEL:AddEntityURLNode(eNode, entity) 125 | 126 | local pNode = self:AddNode(eNode, "URL Filter Mode"); 127 | local btn = self:EmbedButton(pNode, "GOLEM_StateBox", 24, 0); 128 | 129 | pNode:SetIcon("fugue/monitor-network.png"); 130 | pNode:SetTooltip("How are http and url requests handled."); 131 | 132 | btn:AddState("deny", EXPR_DENY, "fugue/cross-button.png"); 133 | btn:AddState("whitelist", EXPR_WHITE_LIST, "fugue/quill.png"); 134 | btn:AddState("blacklist", EXPR_BLACK_LIST, "fugue/exclamation-circle.png"); 135 | btn:AddState("global", EXPR_GLOBAL, "fugue/globe-network.png"); 136 | 137 | btn:PollFromCallback(function() 138 | return EXPR_PERMS.GetURLPerm(entity, true), true; 139 | end); 140 | 141 | btn.ChangedValue = function(value) 142 | EXPR_PERMS.Set(entity, LocalPlayer(), "URL", value); 143 | end; 144 | 145 | end 146 | 147 | function PANEL:RemoveEntity(entity) 148 | if entity then 149 | local node = self.entities[entity]; 150 | if IsValid(node) then node:Remove(); end 151 | self.entities[entity] = nil; 152 | end 153 | end 154 | 155 | function PANEL:Think() 156 | local time = CurTime(); 157 | 158 | if not self.m_nNextUpdate or self.m_nNextUpdate <= time then 159 | 160 | local entities = {}; 161 | 162 | for entity, node in pairs(self.entities) do 163 | if not IsValid(entity) then 164 | if IsValid(node) then node:Remove(); end 165 | else 166 | entities[entity] = node; 167 | end 168 | end 169 | 170 | self.entities = entities; 171 | 172 | self:Reload(true); 173 | 174 | self.m_nNextUpdate = time; 175 | 176 | end 177 | 178 | end 179 | 180 | vgui.Register("GOLEM_E3PermissionTree", PANEL, "GOLEM_Tree"); -------------------------------------------------------------------------------- /lua/expression3/permissions/menu.lua: -------------------------------------------------------------------------------- 1 | if SERVER then return; end 2 | 3 | /********************************************************************************* 4 | Tabbed Menu Panel 5 | *********************************************************************************/ 6 | do 7 | local PANEL = {}; 8 | 9 | function PANEL:Init() 10 | self:AddTab("Permissions", "fugue/xfn.png", "GOLEM_E3PermissionTree"); 11 | self:AddTab("HTTP", "fugue/globe-network.png", "GOLEM_E3URLTree"); 12 | 13 | self:SetActiveTab("Permissions"); 14 | end; 15 | 16 | function PANEL:Paint( w, h ) 17 | surface.SetDrawColor(30, 30, 30, 255) 18 | surface.DrawRect(0, 0, w, h) 19 | end 20 | 21 | vgui.Register("GOLEM_E3Permissions", PANEL, "GOLEM_SimpleTabs"); 22 | end 23 | 24 | /********************************************************************************* 25 | Add our permissions menu. 26 | *********************************************************************************/ 27 | 28 | hook.Add( "Expression3.AddGolemTabTypes", "PermssionsTab", function(editor) 29 | editor:AddCustomTab(false, "permissions", function( self ) 30 | if self.Permissions then 31 | self.pnlSideTabHolder:SetActiveTab( self.Permissions.Tab ) 32 | self.Permissions.Panel:RequestFocus( ) 33 | return self.Permissions 34 | end 35 | 36 | local Panel = vgui.Create( "GOLEM_E3Permissions" ) 37 | local Sheet = self.pnlSideTabHolder:AddSheet( "", Panel, "fugue/controller-d-pad.png", function(pnl) self:CloseMenuTab( pnl:GetParent( ), true ) end ) 38 | self.pnlSideTabHolder:SetActiveTab( Sheet.Tab ) 39 | self.Permissions = Sheet 40 | Sheet.Panel:RequestFocus( ) 41 | 42 | return Sheet 43 | end, function( self ) 44 | self.Permissions = nil 45 | end ); 46 | 47 | editor.tbRight:SetupButton( "Permssions", "fugue/controller-d-pad.png", TOP, function( ) editor:NewMenuTab( "permissions" ); end ) 48 | end); -------------------------------------------------------------------------------- /lua/expression3/permissions/tekmenu.lua: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | This is Teks origonal EA2 Android Permissions Concept 3 | ****************************************************************************************************************************/ 4 | 5 | if SERVER then return; end 6 | 7 | local matArrow = Material("tek/arrow.png") 8 | local matInfo = Material("tek/iconexclamation.png") 9 | local matTopLeft = Material("tek/topcornerleft.png") 10 | local matTopRight = Material("tek/topcornerright.png") 11 | local matBottomLeft = Material("tek/bottomcornerleft.png") 12 | local matBottomRight = Material("tek/bottomcorneright.png") 13 | 14 | local colBackground = Color(207, 207, 207) 15 | local colWhite = Color(255, 255, 255) 16 | local colTitle = Color(195, 195, 195) 17 | local colText = Color(85, 85, 85) 18 | 19 | /**************************************************************************************************************************** 20 | PANEL 21 | ****************************************************************************************************************************/ 22 | 23 | local PANEL = { } 24 | 25 | function PANEL:Init() 26 | self:SetWide(500) 27 | self:SetTall(83) 28 | 29 | self.btnAccept = self:Add("DButton") 30 | self.btnAccept:SetText("Accept") 31 | self.btnAccept:SetDrawBackground(false) 32 | 33 | self.btnBlock = self:Add("DButton") 34 | self.btnBlock:SetText("Block All") 35 | self.btnBlock:SetDrawBackground(false) 36 | 37 | self.btnClose = self:Add("DButton") 38 | self.btnClose:SetText("Close") 39 | self.btnClose:SetDrawBackground(false) 40 | 41 | function self.btnAccept.DoClick() 42 | if IsValid( self.entity ) then 43 | for perm, _ in pairs(self.features) do 44 | EXPR_PERMS.Set(self.entity, LocalPlayer(), perm, EXPR_ALLOW); 45 | end 46 | end 47 | self:Remove() 48 | end 49 | 50 | function self.btnBlock.DoClick() 51 | if IsValid( self.entity ) then 52 | for perm, _ in pairs(self.features) do 53 | EXPR_PERMS.Set(self.entity, LocalPlayer(), perm, EXPR_DENY); 54 | end 55 | end 56 | self:Remove() 57 | end 58 | 59 | function self.btnClose.DoClick() 60 | self:Remove() 61 | end 62 | end 63 | 64 | function PANEL:Paint(w, h) 65 | surface.SetDrawColor(colWhite) 66 | surface.SetMaterial(matTopLeft) 67 | surface.DrawTexturedRect(0, 0, 12, 12) 68 | surface.SetMaterial(matTopRight) 69 | surface.DrawTexturedRect(w - 12, 0, 12, 12) 70 | 71 | --Title: 72 | surface.SetDrawColor(colTitle) 73 | surface.DrawRect(12, 0, w - 24, 12) 74 | draw.SimpleText("- Expression 3 -", "default", w * 0.5, 6, colText, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) 75 | 76 | --Name and Owner 77 | surface.SetDrawColor(colTitle) 78 | surface.DrawRect(0, 12, w, 43) 79 | 80 | surface.SetDrawColor(colBackground) 81 | surface.DrawRect(5, 12, w - 10, 43) 82 | 83 | draw.SimpleText("Name: " .. self:GetTitle(), "default", 10, 13, colText, TEXT_ALIGN_LEFT) 84 | draw.SimpleText("Owner: " .. self:GetOwnersName(), "default", 10, 33, colText, TEXT_ALIGN_LEFT) 85 | 86 | --Features Title 87 | surface.SetDrawColor(colBackground) 88 | surface.DrawRect(0, 55, w, 40) 89 | 90 | surface.SetDrawColor(colWhite) 91 | surface.SetMaterial(matInfo) 92 | surface.DrawTexturedRect(9, 55, 32, 32) 93 | 94 | draw.SimpleText("This gate requires access to the", "default", 43, 56, colText, TEXT_ALIGN_LEFT) 95 | draw.SimpleText("features listed below.", "default", 43, 70, colText, TEXT_ALIGN_LEFT) 96 | 97 | local y = 95 98 | 99 | for _,perm in pairs(self.features) do 100 | local permission = EXPR_LIB.PERMS[perm]; 101 | 102 | if (permission) then 103 | surface.SetDrawColor(colBackground) 104 | surface.DrawRect(0, y, w, 42) 105 | 106 | surface.SetDrawColor(colWhite) 107 | surface.SetMaterial(Material(permission[2])) 108 | surface.DrawTexturedRect(24, y + 4, 32, 32) 109 | 110 | draw.SimpleText(perm, "default", 65, y + 5, colText, TEXT_ALIGN_LEFT) 111 | draw.SimpleText(permission[3], "default", 65, y + 20, colText, TEXT_ALIGN_LEFT) 112 | 113 | y = y + 42; 114 | end 115 | end 116 | 117 | surface.SetDrawColor(colBackground) 118 | surface.DrawRect(16, h - 16, w - 32, 16) 119 | surface.DrawRect(0, y, w, h - y - 16) 120 | 121 | surface.SetDrawColor(colWhite) 122 | surface.SetMaterial(matBottomLeft) 123 | surface.DrawTexturedRect(0, h - 16, 16, 16) 124 | 125 | surface.SetDrawColor(colWhite) 126 | surface.SetMaterial(matBottomRight) 127 | surface.DrawTexturedRect(w - 16, h - 16, 16, 16) 128 | end 129 | 130 | function PANEL:SetUp(Gate, features) 131 | self.entity = Gate; 132 | self.features = features; 133 | self:SetTall(120 + (table.Count(self.features) * 42)); 134 | end 135 | 136 | function PANEL:GetTitle() 137 | if !IsValid(self.entity) then 138 | return "" 139 | elseif self.entity.GetScriptName then 140 | return self.entity:GetScriptName() 141 | end 142 | 143 | return "generic" 144 | end 145 | 146 | function PANEL:GetOwnersName() 147 | if !IsValid(self.entity) or !IsValid(self.entity.player) then 148 | return "unkown" 149 | end 150 | 151 | return self.entity.player:Name() 152 | end 153 | 154 | function PANEL:PerformLayout() 155 | self.btnAccept:SetPos(0, self:GetTall() - 20) 156 | self.btnBlock:SetPos(100,self:GetTall() - 20) 157 | self.btnClose:SetPos(200,self:GetTall() - 20) 158 | end 159 | 160 | vgui.Register( "E3_TekMenu", PANEL, "DPanel" ); 161 | 162 | -------------------------------------------------------------------------------- /lua/expression3/permissions/url_browser.lua: -------------------------------------------------------------------------------- 1 | if SERVER then return; end 2 | 3 | /********************************************************************************* 4 | Browser 5 | *********************************************************************************/ 6 | local PANEL = {}; 7 | 8 | local add_icon = Material("fugue/plus-button.png"); 9 | local save_icon = Material("fugue/disk-black.png"); 10 | local edit_icon = Material("fugue/pencil.png"); 11 | local del_icon = Material("fugue/cross-button.png"); 12 | 13 | function PANEL:Init() 14 | self:Reload(); 15 | end 16 | 17 | function PANEL:Reload(b) 18 | if not b then 19 | EXPR_PERMS.LoadWhiteList(); 20 | EXPR_PERMS.LoadBlackList(); 21 | end 22 | 23 | self:LoadWhiteList(); 24 | self:LoadBlackList(); 25 | self:LoadHistory(); 26 | end 27 | 28 | /********************************************************************************* 29 | White List Node 30 | *********************************************************************************/ 31 | 32 | function PANEL:LoadWhiteList() 33 | self.node_white = self:AddNode("White List"); 34 | self.node_white:SetIcon("fugue/quill.png"); 35 | 36 | self.btn_white = self:EmbedButton(self.node_white, "GOLEM_ImageButton", 25, 0); 37 | self.btn_white:SetMaterial(add_icon); 38 | 39 | self.btn_white.DoClick = function() 40 | 41 | Golem.QueryString(add_icon, function(url) 42 | 43 | self:ListedNode("White List", "White list", url, EXPR_PERMS.WhiteListURL, EXPR_PERMS.UnwhiteListURL); 44 | 45 | end, "", "White list url"); 46 | 47 | end; 48 | 49 | self.sv_white = self:EmbedButton(self.node_white, "GOLEM_ImageButton", 50, 0); 50 | self.sv_white:SetMaterial(save_icon); 51 | 52 | self.sv_white.DoClick = function() 53 | EXPR_PERMS.SaveWhiteList(); 54 | end; 55 | 56 | for url, filter in pairs(EXPR_PERMS.GetWhiteList()) do 57 | self:ListedNode("White List", "White list", url, EXPR_PERMS.WhiteListURL, EXPR_PERMS.UnwhiteListURL); 58 | end 59 | end 60 | 61 | /********************************************************************************* 62 | Black List Node 63 | *********************************************************************************/ 64 | 65 | function PANEL:LoadBlackList() 66 | self.node_black = self:AddNode("Black List"); 67 | self.node_black:SetIcon("fugue/exclamation-circle.png"); 68 | 69 | self.btn_black = self:EmbedButton(self.node_black, "GOLEM_ImageButton", 25, 0); 70 | self.btn_black:SetMaterial(add_icon); 71 | 72 | self.btn_black.DoClick = function() 73 | 74 | self:CustomSearchPanel(add_icon, "Add to black list.", "url", 75 | function(_, url) 76 | EXPR_PERMS.BlackListURL(url); 77 | self:ResetSearchPanel(); 78 | self:ListedNode("Black List", "Black list", url, EXPR_PERMS.BlackListURL, EXPR_PERMS.UnblackListURL); 79 | end, 80 | "", name); 81 | 82 | end; 83 | 84 | self.sv_black = self:EmbedButton(self.node_black, "GOLEM_ImageButton", 50, 0); 85 | self.sv_black:SetMaterial(save_icon); 86 | 87 | self.sv_black.DoClick = function() 88 | EXPR_PERMS.SaveBlackList(); 89 | end; 90 | 91 | for url, filter in pairs(EXPR_PERMS.GetBlackList()) do 92 | self:ListedNode("Black List", "Black list", url, EXPR_PERMS.BlackListURL, EXPR_PERMS.UnblackListURL); 93 | end 94 | end 95 | 96 | /********************************************************************************* 97 | Add List node 98 | *********************************************************************************/ 99 | 100 | function PANEL:ListedNode(node, name, url, add, remove) 101 | local node = self:AddNode(node, url); 102 | node:SetText(string.sub(url, 1, 25)); 103 | node:SetTooltip(url); 104 | 105 | local edit = self:EmbedButton(node, "GOLEM_ImageButton", 25, 0); 106 | local del = self:EmbedButton(node, "GOLEM_ImageButton", 50, 0); 107 | 108 | edit:SetMaterial(edit_icon); 109 | del:SetMaterial(del_icon); 110 | 111 | edit.DoClick = function() 112 | 113 | self:CustomSearchPanel(edit_icon, "Apply changes.", url, 114 | function(_, _url) 115 | add(_url); 116 | remove(url); 117 | node:Remove(); 118 | self:ListedNode(node, name, _url, add, remove) 119 | self:ResetSearchPanel(); 120 | end, 121 | url); 122 | 123 | end; 124 | 125 | del.DoClick = function() 126 | remove(url) 127 | node:Remove(); 128 | end; 129 | 130 | return node; 131 | end 132 | 133 | 134 | /********************************************************************************* 135 | History Node 136 | *********************************************************************************/ 137 | 138 | function PANEL:LoadHistory() 139 | self.node_history = self:AddNode("History"); 140 | 141 | local rfsh = self:EmbedButton(self.node_history, "GOLEM_ImageButton", 25, 0); 142 | rfsh:SetIcon("fugue/arrow-circle.png"); 143 | rfsh:SetTooltip("Refresh history."); 144 | 145 | rfsh.DoClick = function() 146 | for url, ents in pairs(EXPR_PERMS.GetHistory()) do 147 | local node = self:AddNode("History", url); 148 | node:SetText(string.sub(url, 1, 25)); 149 | node:SetTooltip(url); 150 | 151 | local wlst = self:EmbedButton(node, "GOLEM_ImageButton", 25, 0); 152 | wlst:SetIcon("fugue/quill.png"); 153 | wlst:SetTooltip("Add to white list."); 154 | 155 | local blst = self:EmbedButton(node, "GOLEM_ImageButton", 50, 0); 156 | blst:SetIcon("fugue/exclamation-circle.png"); 157 | blst:SetTooltip("Add to black list."); 158 | 159 | wlst.DoClick = function() 160 | self:ListedNode("White List", "White list", url, EXPR_PERMS.WhiteListURL, EXPR_PERMS.UnwhiteListURL); 161 | end; 162 | 163 | blst.DoClick = function() 164 | self:ListedNode("Black List", "Black list", url, EXPR_PERMS.BlackListURL, EXPR_PERMS.UnblackListURL); 165 | end; 166 | end 167 | end; 168 | 169 | rfsh.DoClick(); 170 | 171 | end 172 | 173 | vgui.Register("GOLEM_E3URLTree", PANEL, "GOLEM_Tree"); -------------------------------------------------------------------------------- /lua/wire/stools/expression3.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ____ _ _ ___ ___ ____ ___ ___ __ ____ _ _ _ ___ _ _ ____ 3 | F ___J FJ LJ F _ ", F _ ", F ___J F __". F __". FJ F __ ] F L L] /.\ F __". FJ L] F___ J 4 | J |___: J \/ F J `-' |J `-'(| J |___: J (___| J (___| J L J |--| L J \| L //_\\ J |--\ LJ | | L `-__| L 5 | | _____| / \ | __/F| _ L | _____| J\___ \ J\___ \ | | | | | | | |\ | / ___ \ | | J |J J F L |__ ( 6 | F L____: / /\ \ F |__/ F |_\ L F L____: .--___) \.--___) \ F J F L__J J F L\\ J / L___J \ F L__J |J\ \/ /F .-____] J 7 | J________LJ__//\\__LJ__| J__| \\__LJ________LJ\______JJ\______JJ____LJ\______/FJ__L \\__L J__L J__LJ______/F \\__// J\______/F 8 | |________||__/ \__||__L |__| J__||________| J______F J______F|____| J______F |__L J__| |__L J__||______F \__/ J______F 9 | 10 | ::Expression 3 Tool:: 11 | ]] 12 | 13 | AddCSLuaFile(); 14 | 15 | WireToolSetup.setCategory( "Chips, Gates" ) 16 | WireToolSetup.open("expression3", "Expression 3", "wire_expression3_base", nil, "Expression3s") 17 | 18 | --[[ 19 | Client side language, etc. 20 | ]] 21 | 22 | if CLIENT then 23 | language.Add("Tool.wire_expression3.name", "Expression 3 Tool (Wire)") 24 | language.Add("Tool.wire_expression3.desc", "Spawns an Expression 3 chip for use with the wire system.") 25 | 26 | TOOL.Information = { 27 | { name = "left", text = "Create " .. TOOL.Name }, 28 | { name = "right", text = "Open " .. TOOL.Name .. " in Editor" }, 29 | } 30 | 31 | WireToolSetup.setToolMenuIcon( "vgui/e2logo" ) 32 | end 33 | 34 | --[[ 35 | Convars. 36 | ]] 37 | 38 | TOOL.ClientConVar = { 39 | model = "models/nezzkryptic/e3_chip.mdl", 40 | script_model = ""; 41 | } 42 | 43 | WireToolSetup.SetupMax(20) 44 | WireToolSetup.BaseLang() 45 | 46 | duplicator.RegisterEntityClass( "wire_expression3_base", WireLib.MakeWireEnt, "Data", "code_str" ) 47 | 48 | function TOOL:PostMake(ent) 49 | local ply = self:GetOwner(); 50 | 51 | ent.player = ply; 52 | ent:SetPlayer(ply); 53 | 54 | timer.Simple(0.2, function() 55 | EXPR_UPLOADER.RequestFromClient(self:GetOwner(), ent); 56 | end); 57 | end 58 | 59 | function TOOL:CheckHitOwnClass( trace ) 60 | return trace.Entity:IsValid() and trace.Entity.Expression3; 61 | end 62 | 63 | function TOOL:LeftClick_Update( trace ) 64 | EXPR_UPLOADER.RequestFromClient(self:GetOwner(), trace.Entity); 65 | end 66 | 67 | local GateModels = { 68 | "models/nezzkryptic/e3_chip.mdl", 69 | "models/lemongate/lemongate.mdl", 70 | "models/shadowscion/lemongate/gate.mdl", 71 | "models/mandrac/wire/e3.mdl", 72 | "models/bull/gates/processor.mdl", 73 | "models/expression 2/cpu_controller.mdl", 74 | "models/expression 2/cpu_expression.mdl", 75 | "models/expression 2/cpu_interface.mdl", 76 | "models/expression 2/cpu_microchip.mdl", 77 | "models/expression 2/cpu_processor.mdl", 78 | }; 79 | 80 | function TOOL:GetModel() 81 | local script_model = self:GetClientInfo("script_model"); 82 | 83 | if (script_model and script_model ~= "") then 84 | if (self:CheckValidModel(script_model)) then 85 | return script_model; 86 | end 87 | end 88 | 89 | return WireToolObj.GetModel(self); 90 | end 91 | 92 | if CLIENT then 93 | local TOOL = TOOL; 94 | 95 | function TOOL.BuildCPanel( CPanel ) 96 | 97 | local PropList = vgui.Create( "PropSelect" ) 98 | 99 | PropList:SetConVar( "wire_expression3_model" ) 100 | 101 | for _, Model in pairs( GateModels ) do 102 | PropList:AddModel( Model, false ) 103 | end 104 | 105 | CPanel:AddItem( PropList ) 106 | end 107 | 108 | hook.Add("Expression3.CloseGolem", "Expression3.Tool.ChooseModel", function() 109 | local model = Golem.GetDirective("model") or ""; 110 | RunConsoleCommand( "wire_expression3_script_model", model); 111 | end) 112 | end 113 | 114 | function TOOL:RightClick( Trace ) 115 | if (SERVER) then 116 | local loadScript = self:CheckHitOwnClass(Trace); 117 | 118 | net.Start("Expression3.OpenGolem"); 119 | 120 | net.WriteBool(loadScript); 121 | 122 | if loadScript then net.WriteEntity(Trace.Entity); end 123 | 124 | net.Send(self:GetOwner()); 125 | end 126 | end 127 | 128 | if CLIENT then 129 | 130 | function TOOL:DrawToolScreen(width, height) 131 | if (EXPR_UPLOADER) then 132 | EXPR_UPLOADER.DrawUploadScreen(width, height, "Gate"); 133 | end 134 | end 135 | 136 | end 137 | -------------------------------------------------------------------------------- /lua/wire/stools/expression3_screen.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | ____ _ _ ___ ___ ____ ___ ___ __ ____ _ _ _ ___ _ _ ____ 3 | F ___J FJ LJ F _ ", F _ ", F ___J F __". F __". FJ F __ ] F L L] /.\ F __". FJ L] F___ J 4 | J |___: J \/ F J `-' |J `-'(| J |___: J (___| J (___| J L J |--| L J \| L //_\\ J |--\ LJ | | L `-__| L 5 | | _____| / \ | __/F| _ L | _____| J\___ \ J\___ \ | | | | | | | |\ | / ___ \ | | J |J J F L |__ ( 6 | F L____: / /\ \ F |__/ F |_\ L F L____: .--___) \.--___) \ F J F L__J J F L\\ J / L___J \ F L__J |J\ \/ /F .-____] J 7 | J________LJ__//\\__LJ__| J__| \\__LJ________LJ\______JJ\______JJ____LJ\______/FJ__L \\__L J__L J__LJ______/F \\__// J\______/F 8 | |________||__/ \__||__L |__| J__||________| J______F J______F|____| J______F |__L J__| |__L J__||______F \__/ J______F 9 | 10 | ::Expression 3 Tool:: 11 | ]] 12 | 13 | AddCSLuaFile(); 14 | 15 | WireToolSetup.setCategory( "Chips, Gates" ) 16 | WireToolSetup.open("expression3_screen", "Expression 3 Screen", "wire_expression3_screen", nil, "Expression3s") 17 | 18 | --[[ 19 | Client side language, etc. 20 | ]] 21 | 22 | if CLIENT then 23 | language.Add("Tool.wire_expression3_screen.name", "Expression 3 Scrren Tool (Wire)") 24 | language.Add("Tool.wire_expression3_screen.desc", "Spawns an Expression 3 chip for use with the wire system.") 25 | 26 | TOOL.Information = { 27 | { name = "left", text = "Create " .. TOOL.Name }, 28 | { name = "right", text = "Open " .. TOOL.Name .. " in Editor" }, 29 | } 30 | 31 | WireToolSetup.setToolMenuIcon( "vgui/e2logo" ) 32 | end 33 | 34 | --[[ 35 | Convars. 36 | ]] 37 | 38 | TOOL.ClientConVar = { 39 | model = "models/props_phx/rt_screen.mdl", 40 | } 41 | 42 | WireToolSetup.SetupMax(20) 43 | WireToolSetup.BaseLang() 44 | 45 | duplicator.RegisterEntityClass( "wire_expression3_screen", WireLib.MakeWireEnt, "Data", "code_str" ) 46 | 47 | function TOOL:PostMake(ent) 48 | local ply = self:GetOwner(); 49 | 50 | ent.player = ply; 51 | ent:SetPlayer(ply); 52 | 53 | timer.Simple(0.2, function() 54 | EXPR_UPLOADER.RequestFromClient(self:GetOwner(), ent); 55 | end); 56 | end 57 | 58 | function TOOL:CheckHitOwnClass( trace ) 59 | return trace.Entity:IsValid() and trace.Entity.Expression3; 60 | end 61 | 62 | function TOOL:LeftClick_Update( trace ) 63 | EXPR_UPLOADER.RequestFromClient(self:GetOwner(), trace.Entity); 64 | end 65 | 66 | function TOOL:GetModel() 67 | local script_model = self:GetClientInfo("script_model"); 68 | 69 | if (script_model and script_model ~= "") then 70 | if (self:CheckValidModel(script_model)) then 71 | return script_model; 72 | end 73 | end 74 | 75 | return WireToolObj.GetModel(self); 76 | end 77 | 78 | if CLIENT then 79 | local TOOL = TOOL; 80 | 81 | function TOOL.BuildCPanel( CPanel ) 82 | WireDermaExts.ModelSelect(CPanel, "wire_expression3_screen_model", list.Get( "WireScreenModels" ), 5) 83 | end 84 | end 85 | 86 | function TOOL:RightClick( Trace ) 87 | if (SERVER) then 88 | local loadScript = self:CheckHitOwnClass(Trace); 89 | 90 | net.Start("Expression3.OpenGolem"); 91 | 92 | net.WriteBool(loadScript); 93 | 94 | if loadScript then net.WriteEntity(Trace.Entity); end 95 | 96 | net.Send(self:GetOwner()); 97 | end 98 | end 99 | 100 | if CLIENT then 101 | 102 | local background = surface.GetTextureID("omicron/bulb"); 103 | 104 | function TOOL:DrawToolScreen(width, height) 105 | if (EXPR_UPLOADER) then 106 | EXPR_UPLOADER.DrawUploadScreen(width, height, "Screen"); 107 | end 108 | end 109 | 110 | end 111 | -------------------------------------------------------------------------------- /materials/diagona-icons/131.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/diagona-icons/131.png -------------------------------------------------------------------------------- /materials/diagona-icons/132.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/diagona-icons/132.png -------------------------------------------------------------------------------- /materials/diagona-icons/152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/diagona-icons/152.png -------------------------------------------------------------------------------- /materials/diagona-icons/v-grip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/diagona-icons/v-grip.png -------------------------------------------------------------------------------- /materials/e3_discord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/e3_discord.png -------------------------------------------------------------------------------- /materials/e3_github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/e3_github.png -------------------------------------------------------------------------------- /materials/e3_youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/e3_youtube.png -------------------------------------------------------------------------------- /materials/e3skin/PermissionsPanelBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/e3skin/PermissionsPanelBG.png -------------------------------------------------------------------------------- /materials/fugue/application-sidebar-collapse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/application-sidebar-collapse.png -------------------------------------------------------------------------------- /materials/fugue/application-sidebar-expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/application-sidebar-expand.png -------------------------------------------------------------------------------- /materials/fugue/application-sidebar-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/application-sidebar-list.png -------------------------------------------------------------------------------- /materials/fugue/arrow-090-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/arrow-090-small.png -------------------------------------------------------------------------------- /materials/fugue/arrow-090.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/arrow-090.png -------------------------------------------------------------------------------- /materials/fugue/arrow-270-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/arrow-270-small.png -------------------------------------------------------------------------------- /materials/fugue/arrow-270.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/arrow-270.png -------------------------------------------------------------------------------- /materials/fugue/arrow-circle-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/arrow-circle-small.png -------------------------------------------------------------------------------- /materials/fugue/arrow-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/arrow-circle.png -------------------------------------------------------------------------------- /materials/fugue/arrow-resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/arrow-resize.png -------------------------------------------------------------------------------- /materials/fugue/arrow-return-000-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/arrow-return-000-left.png -------------------------------------------------------------------------------- /materials/fugue/arrow-retweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/arrow-retweet.png -------------------------------------------------------------------------------- /materials/fugue/asterisk-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/asterisk-small.png -------------------------------------------------------------------------------- /materials/fugue/balloon-ellipsis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/balloon-ellipsis.png -------------------------------------------------------------------------------- /materials/fugue/binocular-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/binocular-small.png -------------------------------------------------------------------------------- /materials/fugue/binocular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/binocular.png -------------------------------------------------------------------------------- /materials/fugue/block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/block.png -------------------------------------------------------------------------------- /materials/fugue/blue-folder--plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/blue-folder--plus.png -------------------------------------------------------------------------------- /materials/fugue/blue-folder-horizontal-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/blue-folder-horizontal-open.png -------------------------------------------------------------------------------- /materials/fugue/blue-folder-horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/blue-folder-horizontal.png -------------------------------------------------------------------------------- /materials/fugue/book-bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/book-bookmark.png -------------------------------------------------------------------------------- /materials/fugue/book-open-bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/book-open-bookmark.png -------------------------------------------------------------------------------- /materials/fugue/book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/book.png -------------------------------------------------------------------------------- /materials/fugue/bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/bug.png -------------------------------------------------------------------------------- /materials/fugue/camera-lens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/camera-lens.png -------------------------------------------------------------------------------- /materials/fugue/controller-d-pad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/controller-d-pad.png -------------------------------------------------------------------------------- /materials/fugue/cross-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/cross-button.png -------------------------------------------------------------------------------- /materials/fugue/cross-script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/cross-script.png -------------------------------------------------------------------------------- /materials/fugue/disk-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/disk-black.png -------------------------------------------------------------------------------- /materials/fugue/disk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/disk.png -------------------------------------------------------------------------------- /materials/fugue/disks-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/disks-black.png -------------------------------------------------------------------------------- /materials/fugue/disks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/disks.png -------------------------------------------------------------------------------- /materials/fugue/document-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/document-copy.png -------------------------------------------------------------------------------- /materials/fugue/document-node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/document-node.png -------------------------------------------------------------------------------- /materials/fugue/drive-upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/drive-upload.png -------------------------------------------------------------------------------- /materials/fugue/edit-lowercase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/edit-lowercase.png -------------------------------------------------------------------------------- /materials/fugue/edit-size-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/edit-size-down.png -------------------------------------------------------------------------------- /materials/fugue/edit-size-up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/edit-size-up.png -------------------------------------------------------------------------------- /materials/fugue/edit-superscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/edit-superscript.png -------------------------------------------------------------------------------- /materials/fugue/exclamation-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/exclamation-circle.png -------------------------------------------------------------------------------- /materials/fugue/exclamation-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/exclamation-red.png -------------------------------------------------------------------------------- /materials/fugue/eye--arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/eye--arrow.png -------------------------------------------------------------------------------- /materials/fugue/fire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/fire.png -------------------------------------------------------------------------------- /materials/fugue/gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/gear.png -------------------------------------------------------------------------------- /materials/fugue/globe-network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/globe-network.png -------------------------------------------------------------------------------- /materials/fugue/hand-shake.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/hand-shake.png -------------------------------------------------------------------------------- /materials/fugue/headstone-cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/headstone-cross.png -------------------------------------------------------------------------------- /materials/fugue/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/home.png -------------------------------------------------------------------------------- /materials/fugue/keyboard-smiley.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/keyboard-smiley.png -------------------------------------------------------------------------------- /materials/fugue/keyboard-space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/keyboard-space.png -------------------------------------------------------------------------------- /materials/fugue/lock-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/lock-warning.png -------------------------------------------------------------------------------- /materials/fugue/magnifier--minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/magnifier--minus.png -------------------------------------------------------------------------------- /materials/fugue/magnifier--plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/magnifier--plus.png -------------------------------------------------------------------------------- /materials/fugue/magnifier-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/magnifier-left.png -------------------------------------------------------------------------------- /materials/fugue/magnifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/magnifier.png -------------------------------------------------------------------------------- /materials/fugue/microphone--minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/microphone--minus.png -------------------------------------------------------------------------------- /materials/fugue/microphone--plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/microphone--plus.png -------------------------------------------------------------------------------- /materials/fugue/microphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/microphone.png -------------------------------------------------------------------------------- /materials/fugue/minus-small-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/minus-small-circle.png -------------------------------------------------------------------------------- /materials/fugue/monitor-network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/monitor-network.png -------------------------------------------------------------------------------- /materials/fugue/monitor-screensaver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/monitor-screensaver.png -------------------------------------------------------------------------------- /materials/fugue/monitor-window-3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/monitor-window-3d.png -------------------------------------------------------------------------------- /materials/fugue/node-insert-child.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/node-insert-child.png -------------------------------------------------------------------------------- /materials/fugue/node-insert-next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/node-insert-next.png -------------------------------------------------------------------------------- /materials/fugue/palette-paint-brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/palette-paint-brush.png -------------------------------------------------------------------------------- /materials/fugue/pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/pencil.png -------------------------------------------------------------------------------- /materials/fugue/plus-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/plus-button.png -------------------------------------------------------------------------------- /materials/fugue/printer-monochrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/printer-monochrome.png -------------------------------------------------------------------------------- /materials/fugue/question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/question.png -------------------------------------------------------------------------------- /materials/fugue/quill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/quill.png -------------------------------------------------------------------------------- /materials/fugue/regular-expression-search-match.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/regular-expression-search-match.png -------------------------------------------------------------------------------- /materials/fugue/regular-expression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/regular-expression.png -------------------------------------------------------------------------------- /materials/fugue/rocket-fly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/rocket-fly.png -------------------------------------------------------------------------------- /materials/fugue/script--minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/script--minus.png -------------------------------------------------------------------------------- /materials/fugue/script--pencil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/script--pencil.png -------------------------------------------------------------------------------- /materials/fugue/script--plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/script--plus.png -------------------------------------------------------------------------------- /materials/fugue/script-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/script-text.png -------------------------------------------------------------------------------- /materials/fugue/script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/script.png -------------------------------------------------------------------------------- /materials/fugue/selection-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/selection-input.png -------------------------------------------------------------------------------- /materials/fugue/selection-select-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/selection-select-input.png -------------------------------------------------------------------------------- /materials/fugue/selection-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/selection-select.png -------------------------------------------------------------------------------- /materials/fugue/selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/selection.png -------------------------------------------------------------------------------- /materials/fugue/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/share.png -------------------------------------------------------------------------------- /materials/fugue/speaker-volume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/speaker-volume.png -------------------------------------------------------------------------------- /materials/fugue/state-client.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/state-client.png -------------------------------------------------------------------------------- /materials/fugue/state-server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/state-server.png -------------------------------------------------------------------------------- /materials/fugue/state-shared.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/state-shared.png -------------------------------------------------------------------------------- /materials/fugue/switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/switch.png -------------------------------------------------------------------------------- /materials/fugue/terminal--arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/terminal--arrow.png -------------------------------------------------------------------------------- /materials/fugue/tick-small-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/tick-small-circle.png -------------------------------------------------------------------------------- /materials/fugue/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/tick.png -------------------------------------------------------------------------------- /materials/fugue/toggle-small-expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/toggle-small-expand.png -------------------------------------------------------------------------------- /materials/fugue/toggle-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/toggle-small.png -------------------------------------------------------------------------------- /materials/fugue/xfn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/xfn.png -------------------------------------------------------------------------------- /materials/fugue/youtube.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/fugue/youtube.png -------------------------------------------------------------------------------- /materials/lemongate/lemongate_chip_aperture_orange_dif.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/lemongate/lemongate_chip_aperture_orange_dif.vtf -------------------------------------------------------------------------------- /materials/lemongate/lemongate_chip_aperture_white_dif.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/lemongate/lemongate_chip_aperture_white_dif.vtf -------------------------------------------------------------------------------- /materials/lemongate/lemongate_chip_dif.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/lemongate/lemongate_chip_dif.vtf -------------------------------------------------------------------------------- /materials/lemongate/lemongate_chip_norm.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/lemongate/lemongate_chip_norm.vtf -------------------------------------------------------------------------------- /materials/lemongate/skin1.vmt: -------------------------------------------------------------------------------- 1 | "VertexLitGeneric" 2 | { 3 | 4 | $basetexture "lemongate/lemongate_chip_dif" 5 | $bumpmap "lemongate/lemongate_chip_norm" 6 | $selfillum "1" 7 | } -------------------------------------------------------------------------------- /materials/lemongate/skin2.vmt: -------------------------------------------------------------------------------- 1 | "VertexLitGeneric" 2 | { 3 | 4 | $basetexture "lemongate/lemongate_chip_aperture_white_dif" 5 | $bumpmap "lemongate/lemongate_chip_norm" 6 | $selfillum "1" 7 | } -------------------------------------------------------------------------------- /materials/lemongate/skin3.vmt: -------------------------------------------------------------------------------- 1 | "VertexLitGeneric" 2 | { 3 | 4 | $basetexture "lemongate/lemongate_chip_aperture_orange_dif" 5 | $bumpmap "lemongate/lemongate_chip_norm" 6 | $selfillum "1" 7 | } -------------------------------------------------------------------------------- /materials/mandrac/wire/e3.2323.vmt: -------------------------------------------------------------------------------- 1 | "VertexLitGeneric" 2 | { 3 | "$basetexture" "mandrac/wire/e3" 4 | //"$translucent" 1 5 | "$surfaceprop" "metal" 6 | "$envmap" "env_cubemap" 7 | "$envmapcontrast" 1 8 | "$envmapsaturation" 0 9 | "$envmaptint" "[ .85 .85 .9 ]" 10 | "$envmapmask" "mandrac/wire/e3_normal" 11 | "$selfillum" 0 12 | "$model" 1 13 | "$basealphaenvmapmask" 1 14 | "$halflambert" 1 15 | } 16 | 17 | 18 | -------------------------------------------------------------------------------- /materials/mandrac/wire/e3.vmt: -------------------------------------------------------------------------------- 1 | "VertexLitGeneric" 2 | { 3 | "$basetexture" "mandrac/wire/e3" 4 | "$surfaceprop" "metal" 5 | "$model" 1 6 | "$bumpmap" "mandrac/wire/e3_normal" 7 | "$phong" "1" 8 | "$halflambert" "1" 9 | "$phongboost" "1" 10 | "$phongexponent" "100" 11 | "$phongfresnelranges" "[0.5 5 10]" 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /materials/mandrac/wire/e3.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/mandrac/wire/e3.vtf -------------------------------------------------------------------------------- /materials/mandrac/wire/e3_normal.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/mandrac/wire/e3_normal.vtf -------------------------------------------------------------------------------- /materials/nezzkryptic/base.vmt: -------------------------------------------------------------------------------- 1 | "VertexLitGeneric" 2 | { 3 | "$model" "1" 4 | "$baseTexture" "nezzkryptic/e3_chip" 5 | "$surfaceprop" "Plastic" 6 | 7 | "$nocull" "1" 8 | "$halflambert" "1" 9 | 10 | "$phong" "1" 11 | "$phongboost" "1" 12 | "$phongexponent" "5" 13 | "$phongtint" "[1 0.85 0.85]" 14 | "$phongfresnelranges" "[.5 .85 30]" 15 | } 16 | -------------------------------------------------------------------------------- /materials/nezzkryptic/e3_chip.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/nezzkryptic/e3_chip.vtf -------------------------------------------------------------------------------- /materials/nezzkryptic/gear.vmt: -------------------------------------------------------------------------------- 1 | "VertexLitGeneric" 2 | { 3 | "$model" "1" 4 | "$baseTexture" "nezzkryptic/e3_chip" 5 | "$surfaceprop" "Plastic" 6 | 7 | "$nocull" "1" 8 | "$halflambert" "1" 9 | 10 | "$phong" "1" 11 | "$phongboost" "1" 12 | "$phongexponent" "5" 13 | "$phongtint" "[1 0.85 0.85]" 14 | "$phongfresnelranges" "[.5 .85 30]" 15 | } 16 | -------------------------------------------------------------------------------- /materials/nezzkryptic/pins.vmt: -------------------------------------------------------------------------------- 1 | "VertexLitGeneric" 2 | { 3 | "$model" "1" 4 | "$baseTexture" "nezzkryptic/e3_chip" 5 | "$surfaceprop" "Plastic" 6 | 7 | "$nocull" "1" 8 | "$halflambert" "1" 9 | 10 | "$phong" "1" 11 | "$phongboost" "1" 12 | "$phongexponent" "5" 13 | "$phongtint" "[1 0.85 0.85]" 14 | "$phongfresnelranges" "[.5 .85 30]" 15 | } 16 | -------------------------------------------------------------------------------- /materials/nezzkryptic/text.vmt: -------------------------------------------------------------------------------- 1 | "VertexLitGeneric" 2 | { 3 | "$model" "1" 4 | "$baseTexture" "nezzkryptic/e3_chip" 5 | "$surfaceprop" "Plastic" 6 | 7 | "$nocull" "1" 8 | "$halflambert" "1" 9 | 10 | "$phong" "1" 11 | "$phongboost" "1" 12 | "$phongexponent" "5" 13 | "$phongtint" "[1 0.85 0.85]" 14 | "$phongfresnelranges" "[.5 .85 30]" 15 | } 16 | -------------------------------------------------------------------------------- /materials/omicron/bulb.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "omicron/bulb" 4 | "$ignorez" 1 5 | "$vertexcolor" 1 6 | "$vertexalpha" 1 7 | "$nolod" 1 8 | } 9 | -------------------------------------------------------------------------------- /materials/omicron/bulb.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/omicron/bulb.vtf -------------------------------------------------------------------------------- /materials/omicron/bulb_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/omicron/bulb_512.png -------------------------------------------------------------------------------- /materials/oskar/arrow-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/oskar/arrow-left.png -------------------------------------------------------------------------------- /materials/oskar/arrow-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/oskar/arrow-right.png -------------------------------------------------------------------------------- /materials/oskar/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/oskar/close.png -------------------------------------------------------------------------------- /materials/oskar/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/oskar/minus.png -------------------------------------------------------------------------------- /materials/oskar/minus32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/oskar/minus32.png -------------------------------------------------------------------------------- /materials/oskar/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/oskar/plus.png -------------------------------------------------------------------------------- /materials/oskar/plus32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/oskar/plus32.png -------------------------------------------------------------------------------- /materials/shadowscion/lemongate/gate.vmt: -------------------------------------------------------------------------------- 1 | "VertexLitGeneric" 2 | { 3 | "$model" "1" 4 | "$baseTexture" "shadowscion/lemongate/gate_d" 5 | "$bumpmap" "shadowscion/lemongate/gate_n" 6 | 7 | "$alphatest" "1" 8 | "$nocull" "1" 9 | "$halflambert" "1" 10 | 11 | "$phong" "1" 12 | "$phongboost" "1" 13 | "$phongexponent" "5" 14 | "$phongtint" "[1 0.85 0.85]" 15 | "$phongfresnelranges" "[.5 .85 30]" 16 | } 17 | -------------------------------------------------------------------------------- /materials/shadowscion/lemongate/gate_d.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/shadowscion/lemongate/gate_d.vtf -------------------------------------------------------------------------------- /materials/shadowscion/lemongate/gate_n.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/shadowscion/lemongate/gate_n.vtf -------------------------------------------------------------------------------- /materials/tanknut/bosd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/tanknut/bosd.png -------------------------------------------------------------------------------- /materials/tanknut/bosd.vmt: -------------------------------------------------------------------------------- 1 | "UnlitGeneric" 2 | { 3 | "$basetexture" "tanknut/bosd" 4 | "$ignorez" 1 5 | "$vertexcolor" 1 6 | "$vertexalpha" 1 7 | "$nolod" 1 8 | } 9 | -------------------------------------------------------------------------------- /materials/tanknut/bosd.vtf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/tanknut/bosd.vtf -------------------------------------------------------------------------------- /materials/tek/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/tek/arrow.png -------------------------------------------------------------------------------- /materials/tek/backgroundcorneright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/tek/backgroundcorneright.png -------------------------------------------------------------------------------- /materials/tek/backgroundcornerleft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/tek/backgroundcornerleft.png -------------------------------------------------------------------------------- /materials/tek/bottomcorneright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/tek/bottomcorneright.png -------------------------------------------------------------------------------- /materials/tek/bottomcornerleft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/tek/bottomcornerleft.png -------------------------------------------------------------------------------- /materials/tek/iconexclamation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/tek/iconexclamation.png -------------------------------------------------------------------------------- /materials/tek/topcornerleft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/tek/topcornerleft.png -------------------------------------------------------------------------------- /materials/tek/topcornerright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/materials/tek/topcornerright.png -------------------------------------------------------------------------------- /models/lemongate/GibsModel_chipmesh001.dx80.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/GibsModel_chipmesh001.dx80.vtx -------------------------------------------------------------------------------- /models/lemongate/GibsModel_chipmesh001.dx90.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/GibsModel_chipmesh001.dx90.vtx -------------------------------------------------------------------------------- /models/lemongate/GibsModel_chipmesh001.phy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/GibsModel_chipmesh001.phy -------------------------------------------------------------------------------- /models/lemongate/GibsModel_chipmesh001.sw.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/GibsModel_chipmesh001.sw.vtx -------------------------------------------------------------------------------- /models/lemongate/GibsModel_chipmesh001.xbox.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/GibsModel_chipmesh001.xbox.vtx -------------------------------------------------------------------------------- /models/lemongate/GibsModel_fanmesh001.dx80.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/GibsModel_fanmesh001.dx80.vtx -------------------------------------------------------------------------------- /models/lemongate/GibsModel_fanmesh001.dx90.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/GibsModel_fanmesh001.dx90.vtx -------------------------------------------------------------------------------- /models/lemongate/GibsModel_fanmesh001.phy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/GibsModel_fanmesh001.phy -------------------------------------------------------------------------------- /models/lemongate/GibsModel_fanmesh001.sw.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/GibsModel_fanmesh001.sw.vtx -------------------------------------------------------------------------------- /models/lemongate/GibsModel_fanmesh001.xbox.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/GibsModel_fanmesh001.xbox.vtx -------------------------------------------------------------------------------- /models/lemongate/gibsmodel_chipmesh001.mdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/gibsmodel_chipmesh001.mdl -------------------------------------------------------------------------------- /models/lemongate/gibsmodel_chipmesh001.vvd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/gibsmodel_chipmesh001.vvd -------------------------------------------------------------------------------- /models/lemongate/gibsmodel_fanmesh001.mdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/gibsmodel_fanmesh001.mdl -------------------------------------------------------------------------------- /models/lemongate/gibsmodel_fanmesh001.vvd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/gibsmodel_fanmesh001.vvd -------------------------------------------------------------------------------- /models/lemongate/lemongate.dx80.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/lemongate.dx80.vtx -------------------------------------------------------------------------------- /models/lemongate/lemongate.dx90.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/lemongate.dx90.vtx -------------------------------------------------------------------------------- /models/lemongate/lemongate.mdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/lemongate.mdl -------------------------------------------------------------------------------- /models/lemongate/lemongate.phy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/lemongate.phy -------------------------------------------------------------------------------- /models/lemongate/lemongate.sw.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/lemongate.sw.vtx -------------------------------------------------------------------------------- /models/lemongate/lemongate.vvd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/lemongate.vvd -------------------------------------------------------------------------------- /models/lemongate/lemongate.xbox.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/lemongate/lemongate.xbox.vtx -------------------------------------------------------------------------------- /models/mandrac/wire/e3.dx80.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/mandrac/wire/e3.dx80.vtx -------------------------------------------------------------------------------- /models/mandrac/wire/e3.dx90.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/mandrac/wire/e3.dx90.vtx -------------------------------------------------------------------------------- /models/mandrac/wire/e3.mdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/mandrac/wire/e3.mdl -------------------------------------------------------------------------------- /models/mandrac/wire/e3.phy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/mandrac/wire/e3.phy -------------------------------------------------------------------------------- /models/mandrac/wire/e3.sw.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/mandrac/wire/e3.sw.vtx -------------------------------------------------------------------------------- /models/mandrac/wire/e3.vvd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/mandrac/wire/e3.vvd -------------------------------------------------------------------------------- /models/nezzkryptic/e3_chip.dx80.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/nezzkryptic/e3_chip.dx80.vtx -------------------------------------------------------------------------------- /models/nezzkryptic/e3_chip.dx90.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/nezzkryptic/e3_chip.dx90.vtx -------------------------------------------------------------------------------- /models/nezzkryptic/e3_chip.mdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/nezzkryptic/e3_chip.mdl -------------------------------------------------------------------------------- /models/nezzkryptic/e3_chip.phy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/nezzkryptic/e3_chip.phy -------------------------------------------------------------------------------- /models/nezzkryptic/e3_chip.sw.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/nezzkryptic/e3_chip.sw.vtx -------------------------------------------------------------------------------- /models/nezzkryptic/e3_chip.vvd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/nezzkryptic/e3_chip.vvd -------------------------------------------------------------------------------- /models/shadowscion/lemongate/gate.dx80.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/shadowscion/lemongate/gate.dx80.vtx -------------------------------------------------------------------------------- /models/shadowscion/lemongate/gate.dx90.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/shadowscion/lemongate/gate.dx90.vtx -------------------------------------------------------------------------------- /models/shadowscion/lemongate/gate.mdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/shadowscion/lemongate/gate.mdl -------------------------------------------------------------------------------- /models/shadowscion/lemongate/gate.phy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/shadowscion/lemongate/gate.phy -------------------------------------------------------------------------------- /models/shadowscion/lemongate/gate.sw.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/shadowscion/lemongate/gate.sw.vtx -------------------------------------------------------------------------------- /models/shadowscion/lemongate/gate.vvd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/shadowscion/lemongate/gate.vvd -------------------------------------------------------------------------------- /models/tanknut/cylinder.dx80.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/tanknut/cylinder.dx80.vtx -------------------------------------------------------------------------------- /models/tanknut/cylinder.dx90.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/tanknut/cylinder.dx90.vtx -------------------------------------------------------------------------------- /models/tanknut/cylinder.mdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/tanknut/cylinder.mdl -------------------------------------------------------------------------------- /models/tanknut/cylinder.sw.vtx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/tanknut/cylinder.sw.vtx -------------------------------------------------------------------------------- /models/tanknut/cylinder.vvd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposerFreak/ExpAdv3/20d890c72f3036bb9f6af7bc286b8d3e480d587b/models/tanknut/cylinder.vvd -------------------------------------------------------------------------------- /workshop_fuckvalve.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | cd ..\ 4 | set gma=%cd%\__TEMP.gma 5 | 6 | echo to the following gma file: 7 | echo %gma% 8 | pause 9 | 10 | cd ..\..\bin\ 11 | 12 | @echo on 13 | gmpublish update -addon "%gma%" -id "2001386268" 14 | @echo off 15 | pause 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /workshop_publish.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo WARNING: THIS SCRIPT WILL PUBLISH A NEW ADDON! 3 | pause 4 | 5 | set adir=%cd% 6 | echo Compiling addon from 7 | echo %adir% 8 | 9 | cd ..\ 10 | set gma=%cd%\__TEMP.gma 11 | 12 | echo to the following gma file: 13 | echo %gma% 14 | pause 15 | 16 | cd ..\..\bin\ 17 | 18 | @echo on 19 | gmad create -folder "%adir%" -out "%gma%" 20 | @echo off 21 | 22 | if exist "%gma%" ( 23 | 24 | echo Addon was packaged to gma file 25 | echo publishing to workshop 26 | 27 | @echo on 28 | gmpublish.exe create -addon "%gma%" -icon "%adir%\icon.jpg" 29 | @echo off 30 | 31 | pause 32 | 33 | echo Deleting temporary gma file 34 | del "%gma%" 35 | 36 | pause 37 | 38 | ) else ( 39 | 40 | echo Failed to create gma file, please check error log! 41 | pause 42 | 43 | ) 44 | 45 | -------------------------------------------------------------------------------- /workshop_update.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set adir=%cd% 4 | echo Compiling addon from 5 | echo %adir% 6 | 7 | cd ..\ 8 | set gma=%cd%\__TEMP.gma 9 | 10 | echo to the following gma file: 11 | echo %gma% 12 | pause 13 | 14 | cd ..\..\bin\ 15 | 16 | @echo on 17 | gmad create -folder "%adir%" -out "%gma%" 18 | @echo off 19 | 20 | if exist "%gma%" ( 21 | echo Addon was packaged to gma file 22 | echo publishing to workshop 23 | ) else ( 24 | echo Failed to create gma file, please check error log! 25 | pause 26 | exit 27 | ) 28 | 29 | @echo on 30 | gmpublish update -addon "%gma%" -id "2001386268" 31 | @echo off 32 | pause 33 | 34 | 35 | echo Deleting temporary gma file 36 | del "%gma%" 37 | 38 | 39 | 40 | 41 | 42 | --------------------------------------------------------------------------------