├── .editorconfig
├── .gitattributes
├── .github
├── ISSUE_TEMPLATE
│ └── bug_report.md
└── workflows
│ ├── betarelease.yml
│ └── release.yml
├── .gitignore
├── .idea
└── .gitignore
├── App
├── App.config
└── smxdasm.dll
├── Deploy
├── AssemblyInfo_Template.cs
├── Compress_Beta.ps1
├── Compress_Stable.ps1
├── DotNetChecker.nsh
├── FileAssociation.nsh
├── GPLv3.txt
├── SPCode_Beta.nsi
├── SPCode_Stable.nsi
├── SpcodeUpdater
│ ├── App.config
│ ├── FodyWeavers.xml
│ ├── FodyWeavers.xsd
│ ├── Icon.ico
│ ├── Program.cs
│ ├── Properties
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── Res
│ │ ├── Icon.ico
│ │ └── IconPng.png
│ ├── Resources
│ │ └── iconRes.bmp
│ ├── SpcodeUpdater.csproj
│ ├── SpeditUpdater.sln
│ ├── UpdateMarquee.Designer.cs
│ ├── UpdateMarquee.af-ZA.resx
│ ├── UpdateMarquee.cs
│ ├── UpdateMarquee.resx
│ └── packages.config
├── envsubst.exe
├── icon_beta.ico
├── icon_stable.ico
├── nsis-plugins
│ └── DotNetChecker.dll
├── postbuild.bat
└── prebuild.bat
├── FodyWeavers.xml
├── FodyWeavers.xsd
├── GPLv3.txt
├── Interop
├── ConfigControl.cs
├── HotkeyControl.cs
├── LoggingControl.cs
├── OptionsControl.cs
├── PipeInteropClient.cs
├── PipeInteropServer.cs
├── TranslationProvider.cs
└── Updater
│ ├── UpdateCheck.cs
│ ├── UpdateInfo.cs
│ ├── UpdateWindow.xaml
│ └── UpdateWindow.xaml.cs
├── Program.cs
├── Properties
├── Resources.Designer.cs
└── Resources.resx
├── README.md
├── Resources
├── AboutImages
│ ├── AdoptOpenJDK.jpg
│ ├── AvalonDock.png
│ ├── IconMonstr.png
│ ├── MahAppsMetro.png
│ ├── SharpDevelop.png
│ ├── alliedmodders.png
│ ├── license.png
│ ├── peace-maker.jpg
│ ├── smlib.png
│ └── sourcemod.png
├── Icons
│ ├── IconTemplates
│ │ ├── Icon.ico
│ │ ├── Icon256x.png
│ │ ├── Icon_Beta.ico
│ │ └── icon256xbeta.png
│ ├── empty-box.png
│ ├── icon-add.png
│ ├── icon-collapse.png
│ ├── icon-duplicate.png
│ ├── icon-error.png
│ ├── icon-expand.png
│ ├── icon-folder.png
│ ├── icon-gear.png
│ ├── icon-include.png
│ ├── icon-pawn.png
│ ├── icon-plugin.png
│ ├── icon-reload.png
│ ├── icon-smx.png
│ ├── icon-trash.png
│ ├── icon-txt.png
│ └── icon-warning.png
├── License.txt
├── Misc
│ ├── Configurations
│ │ ├── Configs.xml
│ │ └── sm_1_10_0_6509
│ │ │ ├── include
│ │ │ ├── admin.inc
│ │ │ ├── adminmenu.inc
│ │ │ ├── adt.inc
│ │ │ ├── adt_array.inc
│ │ │ ├── adt_stack.inc
│ │ │ ├── adt_trie.inc
│ │ │ ├── banning.inc
│ │ │ ├── basecomm.inc
│ │ │ ├── bitbuffer.inc
│ │ │ ├── clientprefs.inc
│ │ │ ├── clients.inc
│ │ │ ├── commandfilters.inc
│ │ │ ├── commandline.inc
│ │ │ ├── console.inc
│ │ │ ├── convars.inc
│ │ │ ├── core.inc
│ │ │ ├── cstrike.inc
│ │ │ ├── datapack.inc
│ │ │ ├── dbi.inc
│ │ │ ├── entity.inc
│ │ │ ├── entity_prop_stocks.inc
│ │ │ ├── events.inc
│ │ │ ├── files.inc
│ │ │ ├── float.inc
│ │ │ ├── functions.inc
│ │ │ ├── geoip.inc
│ │ │ ├── halflife.inc
│ │ │ ├── handles.inc
│ │ │ ├── helpers.inc
│ │ │ ├── keyvalues.inc
│ │ │ ├── lang.inc
│ │ │ ├── logging.inc
│ │ │ ├── mapchooser.inc
│ │ │ ├── menus.inc
│ │ │ ├── nextmap.inc
│ │ │ ├── profiler.inc
│ │ │ ├── protobuf.inc
│ │ │ ├── regex.inc
│ │ │ ├── sdkhooks.inc
│ │ │ ├── sdktools.inc
│ │ │ ├── sdktools_client.inc
│ │ │ ├── sdktools_engine.inc
│ │ │ ├── sdktools_entinput.inc
│ │ │ ├── sdktools_entoutput.inc
│ │ │ ├── sdktools_functions.inc
│ │ │ ├── sdktools_gamerules.inc
│ │ │ ├── sdktools_hooks.inc
│ │ │ ├── sdktools_sound.inc
│ │ │ ├── sdktools_stocks.inc
│ │ │ ├── sdktools_stringtables.inc
│ │ │ ├── sdktools_tempents.inc
│ │ │ ├── sdktools_tempents_stocks.inc
│ │ │ ├── sdktools_trace.inc
│ │ │ ├── sdktools_variant_t.inc
│ │ │ ├── sdktools_voice.inc
│ │ │ ├── sorting.inc
│ │ │ ├── sourcemod.inc
│ │ │ ├── string.inc
│ │ │ ├── testing.inc
│ │ │ ├── textparse.inc
│ │ │ ├── tf2.inc
│ │ │ ├── tf2_stocks.inc
│ │ │ ├── timers.inc
│ │ │ ├── topmenus.inc
│ │ │ ├── usermessages.inc
│ │ │ ├── vector.inc
│ │ │ ├── version.inc
│ │ │ └── version_auto.inc
│ │ │ └── spcomp.exe
│ ├── Icon.pdn
│ ├── Lysis
│ │ ├── IKVM.OpenJDK.Core.dll
│ │ ├── IKVM.OpenJDK.Util.dll
│ │ ├── IKVM.Runtime.dll
│ │ ├── LysisDecompiler.exe
│ │ └── lysis-java.dll
│ └── Templates
│ │ ├── ExtensionIncludeTemplate.inc
│ │ ├── IncludeTemplate.inc
│ │ ├── NativeIncludeTemplate.inc
│ │ ├── OldSyntaxTemplate_CSGO.sp
│ │ ├── OldSyntaxTemplate_CSS.sp
│ │ ├── OldSyntaxTemplate_Generic.sp
│ │ ├── OldSyntaxTemplate_TF2.sp
│ │ ├── Template_CSGO.sp
│ │ ├── Template_CSS.sp
│ │ ├── Template_Generic.sp
│ │ ├── Template_TF2.sp
│ │ └── Templates.xml
└── icon256xbeta.ico
├── SourcepawnCondenser
├── CondenserTest
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── CondenserTest.csproj
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ └── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
├── SourcepawnCondenser.sln
└── SourcepawnCondenser
│ ├── App.config
│ ├── Condenser.cs
│ ├── CondenserFunctions
│ ├── SMClasslike.cs
│ ├── SMConstantConsumer.cs
│ ├── SMEnumConsumer.cs
│ ├── SMEnumStructConsumer.cs
│ ├── SMFunctionConsumer.cs
│ ├── SMMethodmapConsumer.cs
│ ├── SMPPDirectiveConsumer.cs
│ ├── SMStructConsumer.cs
│ ├── SMTypedefConsumer.cs
│ └── SMVariableConsumer.cs
│ ├── SourcemodDefinition
│ ├── SMBaseDefinition.cs
│ ├── SMConstant.cs
│ ├── SMDefine.cs
│ ├── SMDefinition.cs
│ ├── SMEnum.cs
│ ├── SMEnumStruct.cs
│ ├── SMFunction.cs
│ ├── SMMethodmap.cs
│ ├── SMStruct.cs
│ ├── SMTypedef.cs
│ └── SMVariable.cs
│ ├── SourcepawnCondenser.csproj
│ ├── SourcepawnCondenser.csproj.DotSettings
│ └── Tokenizer
│ ├── Token.cs
│ ├── TokenKind.cs
│ └── Tokenizer.cs
├── Spcode.csproj
├── Spcode.sln
├── Spcode.sln.DotSettings
├── UI
├── Components
│ ├── ColorChangeControl
│ │ ├── ColorChangeControl.xaml
│ │ └── ColorChangeControl.xaml.cs
│ ├── DASMElement
│ │ ├── DASMElement.xaml
│ │ ├── DASMElement.xaml.cs
│ │ └── DASMElementHighlighter.cs
│ ├── EditorElement
│ │ ├── EditorElement.xaml
│ │ ├── EditorElement.xaml.cs
│ │ ├── EditorElementBracketHighlighter.cs
│ │ ├── EditorElementGoToDefinition.cs
│ │ ├── EditorElementHighlighter.cs
│ │ ├── EditorElementIntellisenseController.cs
│ │ ├── Foldings
│ │ │ └── EditorFoldingStrategy.cs
│ │ ├── Highlighting
│ │ │ ├── BracketHighlightHelpers.cs
│ │ │ ├── BracketSearchResult.cs
│ │ │ ├── ColorizeSection.cs
│ │ │ └── SPBracketSearcher.cs
│ │ └── Indentation
│ │ │ └── EditorIndentation.cs
│ └── HotkeyEditorControl
│ │ ├── HotkeyEditorControl.xaml
│ │ └── HotkeyEditorControl.xaml.cs
├── Interop
│ ├── LanguageChooserWindow.xaml
│ └── LanguageChooserWindow.xaml.cs
├── MainWindow
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── MainWindowCommands.cs
│ ├── MainWindowConfigHandler.cs
│ ├── MainWindowErrorResultGrid.cs
│ ├── MainWindowErrorStatus.cs
│ ├── MainWindowInputHandler.cs
│ ├── MainWindowLogBox.cs
│ ├── MainWindowMenuHandler.cs
│ ├── MainWindowObjectBrowser.cs
│ ├── MainWindowSPCompiler.cs
│ ├── MainWindowServerQuery.cs
│ └── MainWindowTranslations.cs
├── STheme
│ ├── Brushes.xaml
│ ├── Images
│ │ ├── DockAnchorableBottom.png
│ │ ├── DockAnchorableLeft.png
│ │ ├── DockAnchorableRight.png
│ │ ├── DockAnchorableTop.png
│ │ ├── DockDocumentAsAnchorableBottom.png
│ │ ├── DockDocumentAsAnchorableLeft.png
│ │ ├── DockDocumentAsAnchorableRight.png
│ │ ├── DockDocumentAsAnchorableTop.png
│ │ ├── DockDocumentBottom.png
│ │ ├── DockDocumentInside.png
│ │ ├── DockDocumentLeft.png
│ │ ├── DockDocumentRight.png
│ │ ├── DockDocumentTop.png
│ │ ├── DockPaneEmpty.png
│ │ ├── DockPaneLargeEmpty.png
│ │ ├── HTabGroup.png
│ │ ├── Locked.png
│ │ ├── PinAutoHide.png
│ │ ├── PinAutoHide_Black.png
│ │ ├── PinAutoHide_Dark.png
│ │ ├── PinClose.png
│ │ ├── PinClose_Black.png
│ │ ├── PinClose_Dark.png
│ │ ├── PinDocMenu.png
│ │ ├── PinDocMenu_Black.png
│ │ ├── PinMaximize.png
│ │ ├── PinMaximize_Black.png
│ │ ├── PinMaximize_Dark.png
│ │ ├── PinMenu.png
│ │ ├── PinMenu_Black.png
│ │ ├── PinMenu_Dark.png
│ │ ├── PinRestore.png
│ │ ├── PinRestore_Black.png
│ │ ├── PinRestore_Dark.png
│ │ └── VTabGroup.png
│ ├── SMetroTheme.cs
│ └── STheme.xaml
└── Windows
│ ├── AboutWindow.xaml
│ ├── AboutWindow.xaml.cs
│ ├── ConfigWindow.xaml
│ ├── ConfigWindow.xaml.cs
│ ├── ConfigWindow
│ └── ConfigWindowConfigsManager.cs
│ ├── GoToLineWindow.xaml
│ ├── GoToLineWindow.xaml.cs
│ ├── NewFileWindow.xaml
│ ├── NewFileWindow.xaml.cs
│ ├── OptionsWindow.xaml
│ ├── OptionsWindow.xaml.cs
│ ├── OptionsWindow
│ ├── OptionsWindowHighlighting.cs
│ ├── OptionsWindowHotkeys.cs
│ └── OptionsWindowOptionsManager.cs
│ ├── RenameWindow.xaml
│ ├── RenameWindow.xaml.cs
│ ├── SPDefinitionWindow.xaml
│ ├── SPDefinitionWindow.xaml.cs
│ ├── SearchWindow.xaml
│ └── SearchWindow.xaml.cs
├── Utils
├── Constants.cs
├── DecompileUtil.cs
├── DirHelper.cs
├── HotkeyUtils.cs
├── ManagedAES.cs
├── Models
│ ├── ComboboxItem.cs
│ ├── Config.cs
│ ├── ErrorDataGridRow.cs
│ ├── FTP.cs
│ ├── Hotkey.cs
│ ├── HotkeyInfo.cs
│ └── TemplateInfo.cs
├── NamesHelper.cs
├── ObjectBrowserUtils.cs
├── PathsHelper.cs
├── RegexKeywordsHelper.cs
├── SPSyntaxTidy
│ ├── SPSyntaxTidy.cs
│ └── SPTokenizer.cs
└── VersionHelper.cs
├── ValveQuery
└── ValveQuery.dll
└── app.config
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
19 | # Language override for sourcemod files
20 | *.sp -linguist-detectable
21 | *.smx -linguist-detectable
22 | *.inc -linguist-detectable
23 | *.cpp -linguist-detectable
24 | *.dll -linguist-detectable
25 | *.nsi -linguist-detectable
26 | *.nsh -linguist-detectable
27 | *.ps1 -linguist-detectable
28 | *.bat -linguist-detectable
29 | Deploy/ -linguist-vendored
30 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | Thank you for reporting a bug to help improve SPCode. Before issuing, please keep in mind the following recommendations:
11 | - Make sure you're on the latest version
12 | - Make sure your issue is reproducible in a clear manner so we can identify it and tackle it down quicker
13 |
14 | If you don't think you've followed the steps above, please think twice before issuing. Thank you!
15 |
16 | **Describe the bug**
17 | A clear and concise description of what the bug is.
18 |
19 | **To Reproduce**
20 | Steps to reproduce the behavior:
21 | 1. Go to '...'
22 | 2. Click on '....'
23 | 3. Scroll down to '....'
24 | 4. See error
25 |
26 | **Screenshots**
27 | If applicable, add screenshots to help explain your problem.
28 |
--------------------------------------------------------------------------------
/.github/workflows/betarelease.yml:
--------------------------------------------------------------------------------
1 | name: Publish Beta Release
2 |
3 | on:
4 | push:
5 | branches:
6 | - development
7 |
8 | jobs:
9 |
10 | # Build and release
11 | build:
12 |
13 | runs-on: windows-latest
14 | steps:
15 |
16 | # Checkout the repository
17 | - name: Checkout
18 | uses: actions/checkout@v2
19 | with:
20 | fetch-depth: 0
21 |
22 | # Fetch latest tag and rev number
23 | - name: Get tag and rev number
24 | id: get-tag-rev
25 | run: |
26 | echo "::set-output name=TAG::$(git describe --match "[0-9].[0-9].[0-9].[0-9]" --tags --abbrev=0)"
27 | echo "::set-output name=REV::$(git rev-list HEAD --count)"
28 |
29 | # Install the .NET Core workload
30 | - name: Install .NET Core
31 | uses: actions/setup-dotnet@v1
32 | with:
33 | dotnet-version: 6.0.100
34 |
35 | # Nuget
36 | - name: Restore NuGet packages
37 | uses: nuget/setup-nuget@v1
38 | with:
39 | nuget-version: '5.x'
40 | - run: nuget restore Spcode.sln
41 |
42 | # Setup MSBuild
43 | - name: Setup MSBuild
44 | uses: microsoft/setup-msbuild@v1.1
45 |
46 | # Build SPCode
47 | - name: Build SPCode
48 | run: msbuild Spcode.csproj /p:Configuration=Release-Beta /p:langversion=latest
49 |
50 | # Build Installer
51 | - name: Build Installer (NSIS)
52 | uses: joncloud/makensis-action@v1
53 | with:
54 | script-file: .\bin\Release-Beta\SPCode.nsi
55 |
56 | # Compress Beta Portable Version
57 | - name: Compress Portable Version
58 | run: .\bin\Release-Beta\Compress.ps1
59 | shell: powershell
60 |
61 | # Build Updater
62 | - name: Build Updater
63 | run: msbuild Deploy\SPCodeUpdater\SPCodeUpdater.csproj /p:Configuration=Release-Beta /p:langversion=latest
64 |
65 | # Create Release
66 | - name: Create Release
67 | id: create_release
68 | uses: actions/create-release@v1
69 | env:
70 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71 | with:
72 | tag_name: ${{ steps.get-tag-rev.outputs.TAG }}.beta${{ steps.get-tag-rev.outputs.REV }}
73 | release_name: Release ${{ steps.get-tag-rev.outputs.TAG }}.beta${{ steps.get-tag-rev.outputs.REV }}
74 | draft: false
75 | prerelease: true
76 |
77 | # Upload Installer
78 | - name: Upload Installer
79 | id: upload-installer
80 | uses: actions/upload-release-asset@v1
81 | env:
82 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83 | with:
84 | upload_url: ${{ steps.create_release.outputs.upload_url }}
85 | asset_path: .\bin\Release-Beta\SPCode.Beta.Installer.exe
86 | asset_name: SPCode.Beta.Installer.exe
87 | asset_content_type: application/octet-stream
88 |
89 | # Upload Portable
90 | - name: Upload Portable
91 | id: upload-portable
92 | uses: actions/upload-release-asset@v1
93 | env:
94 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95 | with:
96 | upload_url: ${{ steps.create_release.outputs.upload_url }}
97 | asset_path: .\bin\Release-Beta\SPCode.Beta.Portable.zip
98 | asset_name: SPCode.Beta.Portable.zip
99 | asset_content_type: application/zip
100 |
101 | # Upload Updater
102 | - name: Upload Updater
103 | id: upload-updater
104 | uses: actions/upload-release-asset@v1
105 | env:
106 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107 | with:
108 | upload_url: ${{ steps.create_release.outputs.upload_url }}
109 | asset_path: .\Deploy\SpcodeUpdater\bin\Release-Beta\SPCodeUpdater.exe
110 | asset_name: SPCodeUpdater.exe
111 | asset_content_type: application/octet-stream
112 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Publish Release
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 |
8 | jobs:
9 |
10 | # Build and release
11 | build:
12 |
13 | runs-on: windows-latest
14 | steps:
15 |
16 | # Checkout the repository
17 | - name: Checkout
18 | uses: actions/checkout@v2
19 | with:
20 | fetch-depth: 0
21 |
22 | # Fetch latest tag
23 | - name: Get tag
24 | id: get-tag
25 | run: |
26 | echo "::set-output name=TAG::$(git describe --match "[0-9].[0-9].[0-9].[0-9]" --tags --abbrev=0)"
27 |
28 | # Install the .NET Core workload
29 | - name: Install .NET Core
30 | uses: actions/setup-dotnet@v1
31 | with:
32 | dotnet-version: 6.0.100
33 |
34 | # Nuget
35 | - name: Restore NuGet packages
36 | uses: nuget/setup-nuget@v1
37 | with:
38 | nuget-version: '5.x'
39 | - run: nuget restore Spcode.sln
40 |
41 | # Setup MSBuild
42 | - name: Setup MSBuild.exe
43 | uses: microsoft/setup-msbuild@v1.1
44 |
45 | # Build SPCode
46 | - name: Build SPCode
47 | run: msbuild Spcode.csproj /p:Configuration=Release /p:langversion=latest
48 |
49 | # Build Installer
50 | - name: Build Installer (NSIS)
51 | uses: joncloud/makensis-action@v1
52 | with:
53 | script-file: .\bin\Release\SPCode.nsi
54 |
55 | # Compress Portable Version
56 | - name: Compress Portable Version
57 | run: .\bin\Release\Compress.ps1
58 | shell: powershell
59 |
60 | # Build Updater
61 | - name: Build Updater
62 | run: msbuild Deploy\SPCodeUpdater\SPCodeUpdater.csproj /p:Configuration=Release /property:langversion=latest
63 |
64 | - name: Create Release
65 | id: create_release
66 | uses: actions/create-release@v1
67 | env:
68 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69 | with:
70 | tag_name: ${{ steps.get-tag.outputs.TAG }}
71 | release_name: Release ${{ steps.get-tag.outputs.TAG }}
72 | draft: false
73 | prerelease: false
74 |
75 |
76 | - name: Upload Installer
77 | id: upload-installer
78 | uses: actions/upload-release-asset@v1
79 | env:
80 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81 | with:
82 | upload_url: ${{ steps.create_release.outputs.upload_url }}
83 | asset_path: .\bin\Release\SPCode.Installer.exe
84 | asset_name: SPCode.Installer.exe
85 | asset_content_type: application/octet-stream
86 |
87 | - name: Upload Portable
88 | id: upload-portable
89 | uses: actions/upload-release-asset@v1
90 | env:
91 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92 | with:
93 | upload_url: ${{ steps.create_release.outputs.upload_url }}
94 | asset_path: .\bin\Release\SPCode.Portable.zip
95 | asset_name: SPCode.Portable.zip
96 | asset_content_type: application/zip
97 |
98 | - name: Upload Updater
99 | id: upload-updater
100 | uses: actions/upload-release-asset@v1
101 | env:
102 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103 | with:
104 | upload_url: ${{ steps.create_release.outputs.upload_url }}
105 | asset_path: .\Deploy\SpcodeUpdater\bin\Release\SPCodeUpdater.exe
106 | asset_name: SPCodeUpdater.exe
107 | asset_content_type: application/octet-stream
108 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/.idea/.gitignore
--------------------------------------------------------------------------------
/App/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/App/smxdasm.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/App/smxdasm.dll
--------------------------------------------------------------------------------
/Deploy/AssemblyInfo_Template.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("${PROGRAMNAME}")]
6 | [assembly: AssemblyDescription("SPCode - A lightweight SourcePawn editor")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyCompany("SPCode Organization")]
9 | [assembly: AssemblyProduct("${PROGRAMNAME}")]
10 | [assembly: AssemblyCopyright("Copyright © Julien Kluge 2015")]
11 | [assembly: AssemblyTrademark("")]
12 | [assembly: AssemblyCulture("")]
13 | [assembly: NeutralResourcesLanguage("en-US")]
14 | [assembly: ComVisible(false)]
15 | [assembly: Guid("11db2f22-8d7c-4a10-a940-b103e4e3bdf2")]
16 |
17 | [assembly: AssemblyVersion("${TAG}")]
18 | [assembly: AssemblyInformationalVersion("${TAG}.beta${REV}")]
--------------------------------------------------------------------------------
/Deploy/Compress_Beta.ps1:
--------------------------------------------------------------------------------
1 | $loc = Get-Location
2 | Set-Location 'bin\Release-Beta\'
3 | $compress = @{
4 | LiteralPath=
5 | "sourcepawn/",
6 | "lysis/",
7 | "SPCode.exe",
8 | "GPLv3.txt",
9 | "License.txt"
10 | DestinationPath = "SPCode.Beta.Portable.zip"
11 |
12 | }
13 | Compress-Archive -Force @compress
14 | Set-Location $loc
--------------------------------------------------------------------------------
/Deploy/Compress_Stable.ps1:
--------------------------------------------------------------------------------
1 | $loc = Get-Location
2 | Set-Location 'bin\Release\'
3 | $compress = @{
4 | LiteralPath=
5 | "sourcepawn/",
6 | "lysis/",
7 | "SPCode.exe",
8 | "GPLv3.txt",
9 | "License.txt"
10 | DestinationPath = "SPCode.Portable.zip"
11 |
12 | }
13 | Compress-Archive -Force @compress
14 | Set-Location $loc
--------------------------------------------------------------------------------
/Deploy/SpcodeUpdater/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Deploy/SpcodeUpdater/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Deploy/SpcodeUpdater/Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Deploy/SpcodeUpdater/Icon.ico
--------------------------------------------------------------------------------
/Deploy/SpcodeUpdater/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Este código fue generado por una herramienta.
4 | // Versión de runtime:4.0.30319.42000
5 | //
6 | // Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
7 | // se vuelve a generar el código.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace SpcodeUpdater.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// Clase de recurso fuertemente tipado, para buscar cadenas traducidas, etc.
17 | ///
18 | // StronglyTypedResourceBuilder generó automáticamente esta clase
19 | // a través de una herramienta como ResGen o Visual Studio.
20 | // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen
21 | // con la opción /str o recompile su proyecto de VS.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SpcodeUpdater.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Reemplaza la propiedad CurrentUICulture del subproceso actual para todas las
51 | /// búsquedas de recursos mediante esta clase de recurso fuertemente tipado.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Busca un recurso adaptado de tipo System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap IconPng {
67 | get {
68 | object obj = ResourceManager.GetObject("IconPng", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/Deploy/SpcodeUpdater/Res/Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Deploy/SpcodeUpdater/Res/Icon.ico
--------------------------------------------------------------------------------
/Deploy/SpcodeUpdater/Res/IconPng.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Deploy/SpcodeUpdater/Res/IconPng.png
--------------------------------------------------------------------------------
/Deploy/SpcodeUpdater/Resources/iconRes.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Deploy/SpcodeUpdater/Resources/iconRes.bmp
--------------------------------------------------------------------------------
/Deploy/SpcodeUpdater/SpeditUpdater.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Express 2013 for Windows Desktop
4 | VisualStudioVersion = 12.0.31101.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpeditUpdater", "SpeditUpdater.csproj", "{402651FB-269B-4858-8D2A-6DF7E0B9A36E}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {402651FB-269B-4858-8D2A-6DF7E0B9A36E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {402651FB-269B-4858-8D2A-6DF7E0B9A36E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {402651FB-269B-4858-8D2A-6DF7E0B9A36E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {402651FB-269B-4858-8D2A-6DF7E0B9A36E}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/Deploy/SpcodeUpdater/UpdateMarquee.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace SPCodeUpdater
2 | {
3 | partial class UpdateMarquee
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UpdateMarquee));
32 | this.progressBar1 = new System.Windows.Forms.ProgressBar();
33 | this.label1 = new System.Windows.Forms.Label();
34 | this.SuspendLayout();
35 | //
36 | // progressBar1
37 | //
38 | this.progressBar1.ForeColor = System.Drawing.Color.DarkRed;
39 | resources.ApplyResources(this.progressBar1, "progressBar1");
40 | this.progressBar1.MarqueeAnimationSpeed = 10;
41 | this.progressBar1.Name = "progressBar1";
42 | this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
43 | this.progressBar1.UseWaitCursor = true;
44 | //
45 | // label1
46 | //
47 | resources.ApplyResources(this.label1, "label1");
48 | this.label1.ForeColor = System.Drawing.Color.Black;
49 | this.label1.Name = "label1";
50 | this.label1.UseWaitCursor = true;
51 | //
52 | // UpdateMarquee
53 | //
54 | resources.ApplyResources(this, "$this");
55 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
56 | this.BackColor = System.Drawing.Color.White;
57 | this.Controls.Add(this.label1);
58 | this.Controls.Add(this.progressBar1);
59 | this.ForeColor = System.Drawing.Color.White;
60 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
61 | this.MaximizeBox = false;
62 | this.MinimizeBox = false;
63 | this.Name = "UpdateMarquee";
64 | this.ShowIcon = false;
65 | this.ShowInTaskbar = false;
66 | this.UseWaitCursor = true;
67 | this.ResumeLayout(false);
68 | this.PerformLayout();
69 |
70 | }
71 | private System.Windows.Forms.Label label1;
72 | private System.Windows.Forms.ProgressBar progressBar1;
73 |
74 | #endregion
75 | }
76 | }
--------------------------------------------------------------------------------
/Deploy/SpcodeUpdater/UpdateMarquee.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Forms;
2 |
3 | namespace SPCodeUpdater
4 | {
5 | public partial class UpdateMarquee : Form
6 | {
7 | public UpdateMarquee()
8 | {
9 | InitializeComponent();
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/Deploy/envsubst.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Deploy/envsubst.exe
--------------------------------------------------------------------------------
/Deploy/icon_beta.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Deploy/icon_beta.ico
--------------------------------------------------------------------------------
/Deploy/icon_stable.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Deploy/icon_stable.ico
--------------------------------------------------------------------------------
/Deploy/nsis-plugins/DotNetChecker.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Deploy/nsis-plugins/DotNetChecker.dll
--------------------------------------------------------------------------------
/Deploy/postbuild.bat:
--------------------------------------------------------------------------------
1 | md ".\sourcepawn"
2 | md ".\sourcepawn\templates"
3 | md ".\sourcepawn\configs"
4 | md ".\sourcepawn\temp"
5 | md ".\sourcepawn\errorfiles"
6 | md ".\nsis-plugins"
7 | md ".\lysis"
8 | C:\Windows\system32\xcopy ".\..\..\Resources\Misc\Templates\*.*" ".\sourcepawn\templates\*.*" /e /y /q
9 | C:\Windows\system32\xcopy ".\..\..\Resources\Misc\Configurations" ".\sourcepawn\configs" /e /y /q /d
10 | C:\Windows\system32\xcopy ".\..\..\Resources\Misc\Lysis\*.*" ".\lysis" /e /y /q
11 | copy ".\..\..\Resources\Translations\lang_0_spcode.xml" ".\lang_0_spcode.xml" /y
12 | copy ".\..\..\Resources\License.txt" ".\License.txt" /y
13 | copy ".\..\..\Deploy\DotNetChecker.nsh" ".\DotNetChecker.nsh" /y
14 | copy ".\..\..\Deploy\FileAssociation.nsh" ".\FileAssociation.nsh" /y
15 | copy ".\..\..\Deploy\GPLv3.txt" ".\GPLv3.txt" /y
16 | copy ".\..\..\Deploy\nsis-plugins\DotNetChecker.dll" ".\nsis-plugins\DotNetChecker.dll" /y
17 |
18 | set beta=0
19 |
20 | if "%1"=="Debug-Beta" set beta=1
21 | if "%1"=="Release-Beta" set beta=1
22 |
23 | if %beta%==1 (
24 | copy ".\..\..\Deploy\SPCode_Beta.nsi" ".\SPCode.nsi" /y
25 | copy ".\..\..\Deploy\Compress_Beta.ps1" ".\Compress.ps1" /y
26 | copy ".\..\..\Deploy\icon_beta.ico" ".\icon.ico" /y
27 |
28 | ) else (
29 | copy ".\..\..\Deploy\SPCode_Stable.nsi" ".\SPCode.nsi" /y
30 | copy ".\..\..\Deploy\Compress_Stable.ps1" ".\Compress.ps1" /y
31 | copy ".\..\..\Deploy\icon_stable.ico" ".\icon.ico" /y
32 | )
33 |
34 | exit 0
--------------------------------------------------------------------------------
/Deploy/prebuild.bat:
--------------------------------------------------------------------------------
1 | REM // set beta status
2 | set beta=0
3 | if "%1"=="Debug-Beta" set beta=1
4 | if "%1"=="Release-Beta" set beta=1
5 |
6 | REM // fetch git count for beta rev
7 | for /f "tokens=*" %%A in ('git rev-list HEAD --count') do set "REV=%%A"
8 |
9 | REM // fetch latest tag
10 | for /f "tokens=*" %%B in ('git describe --match "[0-9].[0-9].[0-9].[0-9]" --tags --abbrev^=0') do set "TAG=%%B"
11 |
12 | REM // set program name
13 | set PROGRAMNAME=SPCode
14 | if "%1"=="Debug-Beta" set PROGRAMNAME=SPCode Beta
15 | if "%1"=="Release-Beta" set PROGRAMNAME=SPCode Beta
16 |
17 | REM // make assemblyinfo and installer from template
18 | envsubst -i AssemblyInfo_Template.cs -o ..\App\AssemblyInfo.cs
19 |
20 | REM // copy corresponding icons for version
21 | if %beta%==1 (
22 | copy "..\Resources\Icons\IconTemplates\Icon_Beta.ico" "..\Resources\Icons\Icon.ico" /y
23 | copy "..\Resources\Icons\IconTemplates\icon256xbeta.png" "..\Resources\Icons\icon256x.png" /y
24 | ) else (
25 | copy "..\Resources\Icons\IconTemplates\Icon.ico" "..\Resources\Icons\Icon.ico" /y
26 | copy "..\Resources\Icons\IconTemplates\icon256x.png" "..\Resources\Icons\icon256x.png" /y
27 | )
28 |
29 | exit 0
--------------------------------------------------------------------------------
/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Interop/LoggingControl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Controls;
3 |
4 | namespace SPCode.Interop
5 | {
6 | public static class LoggingControl
7 | {
8 | public static TextBox LogBox;
9 | public static void LogAction(string message, int newLines = 1)
10 | {
11 | try
12 | {
13 | LogBox.Text += $"[{DateTime.Now:HH:mm:ss}] {message} {new string('\n', newLines)}";
14 | LogBox.CaretIndex = LogBox.Text.Length;
15 | LogBox.ScrollToEnd();
16 | }
17 | catch (Exception)
18 | {
19 |
20 | }
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/Interop/PipeInteropClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.IO.Pipes;
4 | using System.Text;
5 | using SPCode.Utils;
6 |
7 | namespace SPCode.Interop
8 | {
9 | public static class PipeInteropClient
10 | {
11 | public static void ConnectToMasterPipeAndSendData(string data)
12 | {
13 | var stringData = Encoding.UTF8.GetBytes(data);
14 | var stringLength = stringData.Length;
15 | var array = new byte[sizeof(int) + stringLength];
16 | using (var stream = new MemoryStream(array))
17 | {
18 | var stringLengthData = BitConverter.GetBytes(stringLength);
19 | stream.Write(stringLengthData, 0, stringLengthData.Length);
20 | stream.Write(stringData, 0, stringData.Length);
21 | }
22 | using var pipeClient = new NamedPipeClientStream(".", NamesHelper.PipeServerName, PipeDirection.Out, PipeOptions.Asynchronous);
23 | pipeClient.Connect(5000);
24 | pipeClient.Write(array, 0, array.Length);
25 | pipeClient.Flush();
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/Interop/PipeInteropServer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO.Pipes;
3 | using System.Text;
4 | using SPCode.UI;
5 | using SPCode.Utils;
6 |
7 | namespace SPCode.Interop
8 | {
9 | public class PipeInteropServer : IDisposable
10 | {
11 | private NamedPipeServerStream pipeServer;
12 | private readonly MainWindow _window;
13 |
14 | public PipeInteropServer(MainWindow window)
15 | {
16 | _window = window;
17 | }
18 |
19 | public void Start()
20 | {
21 | StartInteropServer();
22 | }
23 |
24 | public void Close()
25 | {
26 | pipeServer.Close();
27 | }
28 |
29 | public void Dispose()
30 | {
31 | pipeServer.Close();
32 | }
33 |
34 | private void StartInteropServer()
35 | {
36 | if (pipeServer != null)
37 | {
38 | pipeServer.Close();
39 | pipeServer = null;
40 | }
41 | pipeServer = new NamedPipeServerStream(NamesHelper.PipeServerName, PipeDirection.In, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous);
42 | pipeServer.BeginWaitForConnection(new AsyncCallback(PipeConnection_MessageIn), null);
43 | }
44 |
45 | private void PipeConnection_MessageIn(IAsyncResult iar)
46 | {
47 | pipeServer.EndWaitForConnection(iar);
48 | var byteBuffer = new byte[4];
49 | pipeServer.Read(byteBuffer, 0, sizeof(int));
50 | var length = BitConverter.ToInt32(byteBuffer, 0);
51 | byteBuffer = new byte[length];
52 | pipeServer.Read(byteBuffer, 0, length);
53 | var data = Encoding.UTF8.GetString(byteBuffer);
54 | var files = data.Split('|');
55 | var SelectIt = true;
56 | for (var i = 0; i < files.Length; ++i)
57 | {
58 | _window.Dispatcher.Invoke(() =>
59 | {
60 | if (_window.IsLoaded)
61 | {
62 | if (_window.TryLoadSourceFile(files[i], out _, SelectMe: SelectIt) && _window.WindowState == System.Windows.WindowState.Minimized)
63 | {
64 | _window.WindowState = System.Windows.WindowState.Normal;
65 | SelectIt = false;
66 | }
67 | }
68 | });
69 | }
70 | StartInteropServer();
71 | }
72 | }
73 | }
--------------------------------------------------------------------------------
/Interop/Updater/UpdateInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using Octokit;
4 |
5 | namespace SPCode.Interop.Updater
6 | {
7 | public class UpdateInfo
8 | {
9 | public string ExceptionMessage = string.Empty;
10 | public bool GotException = false;
11 | public bool IsAvailable = false;
12 | public List AllReleases;
13 | public bool SkipDialog = false;
14 | public bool WriteAble = true;
15 | public ReleaseAsset Updater => AllReleases[0].Assets.FirstOrDefault(e => e.Name == "SPCodeUpdater.exe");
16 | public ReleaseAsset Portable => AllReleases[0].Assets.FirstOrDefault(e => e.Name.Contains("Portable"));
17 | }
18 | }
--------------------------------------------------------------------------------
/Interop/Updater/UpdateWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Este código fue generado por una herramienta.
4 | // Versión de runtime:4.0.30319.42000
5 | //
6 | // Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
7 | // se vuelve a generar el código.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace SPCode.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// Clase de recurso fuertemente tipado, para buscar cadenas traducidas, etc.
17 | ///
18 | // StronglyTypedResourceBuilder generó automáticamente esta clase
19 | // a través de una herramienta como ResGen o Visual Studio.
20 | // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen
21 | // con la opción /str o recompile su proyecto de VS.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SPCode.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Reemplaza la propiedad CurrentUICulture del subproceso actual para todas las
51 | /// búsquedas de recursos mediante esta clase de recurso fuertemente tipado.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
About
14 |
15 |
16 |
17 | SPCode is an open source SourcePawn editor, with multiple tools and features designed to help you develop and deploy your SourceMod plugins fast and easy .
18 | It was born in 2015 under the name of SPEdit, and in early 2020, we took care of its development. Download it now!
19 |
20 | Features
21 |
22 | * Compiling-config system (fully customizable)
23 | * Syntax highlighting (fully customizable)
24 | * Deprecated 1.6 syntax highlighting
25 | * SourcePawn plugin templates (customizable)
26 | * Copying after/before compiling (& pre/post commandlines)
27 | * Dynamic autocomplete and IntelliSense-like functionalities from all opened include-files
28 | * FTP upload
29 | * Server start feature
30 | * Code folding
31 | * Editor docking
32 | * API references
33 | * Bracket highlighting
34 | * Auto-indentation (active and passive)
35 | * Errors/warnings list
36 | * Syntax reformatter (syntax tidy)
37 | * Auto-updating
38 | * [Lysis Decompiler](https://github.com/peace-maker/lysis-java) (by [peace-maker](https://github.com/peace-maker))
39 | * SMX dissassembler
40 | * RCON querying
41 | * Auto bracket-closing
42 | * Object browser
43 | * Translations in multiple languages
44 |
45 | Building
46 |
47 | Requirements:
48 | - [.NET Framework 4.8](https://dotnet.microsoft.com/en-us/download/dotnet-framework/thank-you/net48-developer-pack-offline-installer)
49 | - [NSIS](https://nsis.sourceforge.io/Download)
50 | - [Git](https://git-scm.com/download/win)
51 |
52 | 1- Build the program: `msbuild Spcode.csproj /p:Configuration=Release`
53 | 2- Create the installer with `makensis .\bin\Release\SPCode.nsi`
54 | 3- Create the portable version running `.\Compress.ps1` with PowerShell
55 | 4- Build the updater: `msbuild Deploy\SpcodeUpdater\SpcodeUpdater.csproj /p:Configuration=Release`
56 |
57 | Credits
58 |
59 | * [Julien Kluge](https://github.com/JulienKluge) (original author of [SPEdit](https://github.com/JulienKluge/SPEdit))
60 | * [Maxi Jabase](https://github.com/maxijabase) (current maintainer)
61 | * [Natanel Shitrit](https://github.com/natanel-shitrit) (maintainer)
62 | * [Hexer10](https://github.com/Hexer10) (maintainer, SPCode creator)
63 |
--------------------------------------------------------------------------------
/Resources/AboutImages/AdoptOpenJDK.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/AboutImages/AdoptOpenJDK.jpg
--------------------------------------------------------------------------------
/Resources/AboutImages/AvalonDock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/AboutImages/AvalonDock.png
--------------------------------------------------------------------------------
/Resources/AboutImages/IconMonstr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/AboutImages/IconMonstr.png
--------------------------------------------------------------------------------
/Resources/AboutImages/MahAppsMetro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/AboutImages/MahAppsMetro.png
--------------------------------------------------------------------------------
/Resources/AboutImages/SharpDevelop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/AboutImages/SharpDevelop.png
--------------------------------------------------------------------------------
/Resources/AboutImages/alliedmodders.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/AboutImages/alliedmodders.png
--------------------------------------------------------------------------------
/Resources/AboutImages/license.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/AboutImages/license.png
--------------------------------------------------------------------------------
/Resources/AboutImages/peace-maker.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/AboutImages/peace-maker.jpg
--------------------------------------------------------------------------------
/Resources/AboutImages/smlib.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/AboutImages/smlib.png
--------------------------------------------------------------------------------
/Resources/AboutImages/sourcemod.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/AboutImages/sourcemod.png
--------------------------------------------------------------------------------
/Resources/Icons/IconTemplates/Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/IconTemplates/Icon.ico
--------------------------------------------------------------------------------
/Resources/Icons/IconTemplates/Icon256x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/IconTemplates/Icon256x.png
--------------------------------------------------------------------------------
/Resources/Icons/IconTemplates/Icon_Beta.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/IconTemplates/Icon_Beta.ico
--------------------------------------------------------------------------------
/Resources/Icons/IconTemplates/icon256xbeta.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/IconTemplates/icon256xbeta.png
--------------------------------------------------------------------------------
/Resources/Icons/empty-box.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/empty-box.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-add.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-collapse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-collapse.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-duplicate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-duplicate.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-error.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-expand.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-expand.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-folder.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-gear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-gear.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-include.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-include.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-pawn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-pawn.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-plugin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-plugin.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-reload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-reload.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-smx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-smx.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-trash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-trash.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-txt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-txt.png
--------------------------------------------------------------------------------
/Resources/Icons/icon-warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Icons/icon-warning.png
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/Configs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/include/adt.inc:
--------------------------------------------------------------------------------
1 | /**
2 | * vim: set ts=4 :
3 | * =============================================================================
4 | * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
5 | * =============================================================================
6 | *
7 | * This file is part of the SourceMod/SourcePawn SDK.
8 | *
9 | * This program is free software; you can redistribute it and/or modify it under
10 | * the terms of the GNU General Public License, version 3.0, as published by the
11 | * Free Software Foundation.
12 | *
13 | * This program is distributed in the hope that it will be useful, but WITHOUT
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 | * details.
17 | *
18 | * You should have received a copy of the GNU General Public License along with
19 | * this program. If not, see .
20 | *
21 | * As a special exception, AlliedModders LLC gives you permission to link the
22 | * code of this program (as well as its derivative works) to "Half-Life 2," the
23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 | * by the Valve Corporation. You must obey the GNU General Public License in
25 | * all respects for all other code used. Additionally, AlliedModders LLC grants
26 | * this exception to all derivative works. AlliedModders LLC defines further
27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 | * or .
29 | *
30 | * Version: $Id$
31 | */
32 |
33 | #if defined _adt_included
34 | #endinput
35 | #endif
36 | #define _adt_included
37 |
38 | #include
39 | #include
40 | #include
41 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/include/basecomm.inc:
--------------------------------------------------------------------------------
1 | /**
2 | * vim: set ts=4 :
3 | * =============================================================================
4 | * SourceMod (C)2004-2011 AlliedModders LLC. All rights reserved.
5 | * =============================================================================
6 | *
7 | * This file is part of the SourceMod/SourcePawn SDK.
8 | *
9 | * This program is free software; you can redistribute it and/or modify it under
10 | * the terms of the GNU General Public License, version 3.0, as published by the
11 | * Free Software Foundation.
12 | *
13 | * This program is distributed in the hope that it will be useful, but WITHOUT
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 | * details.
17 | *
18 | * You should have received a copy of the GNU General Public License along with
19 | * this program. If not, see .
20 | *
21 | * As a special exception, AlliedModders LLC gives you permission to link the
22 | * code of this program (as well as its derivative works) to "Half-Life 2," the
23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 | * by the Valve Corporation. You must obey the GNU General Public License in
25 | * all respects for all other code used. Additionally, AlliedModders LLC grants
26 | * this exception to all derivative works. AlliedModders LLC defines further
27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 | * or .
29 | *
30 | * Version: $Id$
31 | */
32 |
33 | #if defined _basecomm_included
34 | #endinput
35 | #endif
36 | #define _basecomm_included
37 |
38 | /**
39 | * Called when a client is muted or unmuted
40 | *
41 | * @param client Client index
42 | * @param muteState True if client was muted, false otherwise
43 | */
44 | forward void BaseComm_OnClientMute(int client, bool muteState);
45 |
46 | /**
47 | * Called when a client is gagged or ungagged
48 | *
49 | * @param client Client index
50 | * @param gagState True if client was gaged, false otherwise
51 | */
52 | forward void BaseComm_OnClientGag(int client, bool gagState);
53 |
54 | /**
55 | * Returns whether or not a client is gagged
56 | *
57 | * @param client Client index.
58 | * @return True if client is gagged, false otherwise.
59 | */
60 | native bool BaseComm_IsClientGagged(int client);
61 |
62 | /**
63 | * Returns whether or not a client is muted
64 | *
65 | * @param client Client index.
66 | * @return True if client is muted, false otherwise.
67 | */
68 | native bool BaseComm_IsClientMuted(int client);
69 |
70 | /**
71 | * Sets a client's gag state
72 | *
73 | * @param client Client index.
74 | * @param gagState True to gag client, false to ungag.
75 | * @return True if this caused a change in gag state, false otherwise.
76 | */
77 | native bool BaseComm_SetClientGag(int client, bool gagState);
78 |
79 | /**
80 | * Sets a client's mute state
81 | *
82 | * @param client Client index.
83 | * @param muteState True to mute client, false to unmute.
84 | * @return True if this caused a change in mute state, false otherwise.
85 | */
86 | native bool BaseComm_SetClientMute(int client, bool muteState);
87 |
88 | /* DO NOT EDIT BELOW THIS LINE */
89 |
90 | public SharedPlugin __pl_basecomm =
91 | {
92 | name = "basecomm",
93 | file = "basecomm.smx",
94 | #if defined REQUIRE_PLUGIN
95 | required = 1,
96 | #else
97 | required = 0,
98 | #endif
99 | };
100 |
101 | #if !defined REQUIRE_PLUGIN
102 | public void __pl_basecomm_SetNTVOptional()
103 | {
104 | MarkNativeAsOptional("BaseComm_IsClientGagged");
105 | MarkNativeAsOptional("BaseComm_IsClientMuted");
106 | MarkNativeAsOptional("BaseComm_SetClientGag");
107 | MarkNativeAsOptional("BaseComm_SetClientMute");
108 | }
109 | #endif
110 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/include/geoip.inc:
--------------------------------------------------------------------------------
1 | /**
2 | * vim: set ts=4 :
3 | * =============================================================================
4 | * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
5 | * =============================================================================
6 | *
7 | * This file is part of the SourceMod/SourcePawn SDK.
8 | *
9 | * This program is free software; you can redistribute it and/or modify it under
10 | * the terms of the GNU General Public License, version 3.0, as published by the
11 | * Free Software Foundation.
12 | *
13 | * This program is distributed in the hope that it will be useful, but WITHOUT
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 | * details.
17 | *
18 | * You should have received a copy of the GNU General Public License along with
19 | * this program. If not, see .
20 | *
21 | * As a special exception, AlliedModders LLC gives you permission to link the
22 | * code of this program (as well as its derivative works) to "Half-Life 2," the
23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 | * by the Valve Corporation. You must obey the GNU General Public License in
25 | * all respects for all other code used. Additionally, AlliedModders LLC grants
26 | * this exception to all derivative works. AlliedModders LLC defines further
27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 | * or .
29 | *
30 | * Version: $Id$
31 | */
32 |
33 | #if defined _geoip_included
34 | #endinput
35 | #endif
36 | #define _geoip_included
37 |
38 | #include
39 |
40 | /**
41 | * @section IP addresses can contain ports, the ports will be stripped out.
42 | */
43 |
44 | /**
45 | * Gets the two character country code from an IP address. (US, CA, etc)
46 | *
47 | * @param ip Ip to determine the country code.
48 | * @param ccode Destination string buffer to store the code.
49 | * @return True on success, false if no country found.
50 | */
51 | native bool GeoipCode2(const char[] ip, char ccode[3]);
52 |
53 | /**
54 | * Gets the three character country code from an IP address. (USA, CAN, etc)
55 | *
56 | * @param ip Ip to determine the country code.
57 | * @param ccode Destination string buffer to store the code.
58 | * @return True on success, false if no country found.
59 | */
60 | native bool GeoipCode3(const char[] ip, char ccode[4]);
61 |
62 | /**
63 | * Gets the full country name. (max length of output string is 45)
64 | *
65 | * @param ip Ip to determine the country code.
66 | * @param name Destination string buffer to store the country name.
67 | * @param maxlength Maximum length of output string buffer.
68 | * @return True on success, false if no country found.
69 | */
70 | native bool GeoipCountry(const char[] ip, char[] name, int maxlength);
71 |
72 | /**
73 | * @endsection
74 | */
75 |
76 | /**
77 | * Do not edit below this line!
78 | */
79 | public Extension __ext_geoip =
80 | {
81 | name = "GeoIP",
82 | file = "geoip.ext",
83 | #if defined AUTOLOAD_EXTENSIONS
84 | autoload = 1,
85 | #else
86 | autoload = 0,
87 | #endif
88 | #if defined REQUIRE_EXTENSIONS
89 | required = 1,
90 | #else
91 | required = 0,
92 | #endif
93 | };
94 |
95 | #if !defined REQUIRE_EXTENSIONS
96 | public void __ext_geoip_SetNTVOptional()
97 | {
98 | MarkNativeAsOptional("GeoipCode2");
99 | MarkNativeAsOptional("GeoipCode3");
100 | MarkNativeAsOptional("GeoipCountry");
101 | }
102 | #endif
103 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/include/nextmap.inc:
--------------------------------------------------------------------------------
1 | /**
2 | * vim: set ts=4 :
3 | * =============================================================================
4 | * SourceMod (C)2004-2014 AlliedModders LLC. All rights reserved.
5 | * =============================================================================
6 | *
7 | * This file is part of the SourceMod/SourcePawn SDK.
8 | *
9 | * This program is free software; you can redistribute it and/or modify it under
10 | * the terms of the GNU General Public License, version 3.0, as published by the
11 | * Free Software Foundation.
12 | *
13 | * This program is distributed in the hope that it will be useful, but WITHOUT
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 | * details.
17 | *
18 | * You should have received a copy of the GNU General Public License along with
19 | * this program. If not, see .
20 | *
21 | * As a special exception, AlliedModders LLC gives you permission to link the
22 | * code of this program (as well as its derivative works) to "Half-Life 2," the
23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 | * by the Valve Corporation. You must obey the GNU General Public License in
25 | * all respects for all other code used. Additionally, AlliedModders LLC grants
26 | * this exception to all derivative works. AlliedModders LLC defines further
27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 | * or .
29 | *
30 | * Version: $Id$
31 | */
32 |
33 | #if defined _nextmap_included_
34 | #endinput
35 | #endif
36 | #define _nextmap_included_
37 |
38 | /**
39 | * Sets SourceMod's internal nextmap.
40 | * Equivalent to changing sm_nextmap but with an added validity check.
41 | *
42 | * @param map Next map to set.
43 | * @return True if the nextmap was set, false if map was invalid.
44 | */
45 | native bool SetNextMap(const char[] map);
46 |
47 | /**
48 | * Returns SourceMod's internal nextmap.
49 | *
50 | * @param map Buffer to store the nextmap name.
51 | * @param maxlen Maximum length of the map buffer.
52 | * @return True if a Map was found and copied, false if no nextmap is set (map will be unchanged).
53 | */
54 | native bool GetNextMap(char[] map, int maxlen);
55 |
56 | /**
57 | * Changes the current map and records the reason for the change with maphistory
58 | *
59 | * @param map Map to change to.
60 | * @param reason Reason for change.
61 | */
62 | native void ForceChangeLevel(const char[] map, const char[] reason);
63 |
64 | /**
65 | * Gets the current number of maps in the map history
66 | *
67 | * @return Number of maps.
68 | */
69 | native int GetMapHistorySize();
70 |
71 | /**
72 | * Retrieves a map from the map history list.
73 | *
74 | * @param item Item number. Must be 0 or greater and less than GetMapHistorySize().
75 | * @param map Buffer to store the map name.
76 | * @param mapLen Length of map buffer.
77 | * @param reason Buffer to store the change reason.
78 | * @param reasonLen Length of the reason buffer.
79 | * @param startTime Time the map started.
80 | * @error Invalid item number.
81 | */
82 | native void GetMapHistory(int item, char[] map, int mapLen, char[] reason, int reasonLen, int &startTime);
83 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/include/sdktools_client.inc:
--------------------------------------------------------------------------------
1 | /**
2 | * vim: set ts=4 :
3 | * =============================================================================
4 | * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
5 | * =============================================================================
6 | *
7 | * This file is part of the SourceMod/SourcePawn SDK.
8 | *
9 | * This program is free software; you can redistribute it and/or modify it under
10 | * the terms of the GNU General Public License, version 3.0, as published by the
11 | * Free Software Foundation.
12 | *
13 | * This program is distributed in the hope that it will be useful, but WITHOUT
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 | * details.
17 | *
18 | * You should have received a copy of the GNU General Public License along with
19 | * this program. If not, see .
20 | *
21 | * As a special exception, AlliedModders LLC gives you permission to link the
22 | * code of this program (as well as its derivative works) to "Half-Life 2," the
23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 | * by the Valve Corporation. You must obey the GNU General Public License in
25 | * all respects for all other code used. Additionally, AlliedModders LLC grants
26 | * this exception to all derivative works. AlliedModders LLC defines further
27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 | * or .
29 | *
30 | * Version: $Id$
31 | */
32 |
33 | #if defined _sdktools_client_included
34 | #endinput
35 | #endif
36 | #define _sdktools_client_included
37 |
38 | /**
39 | * Sets the client to an inactive state waiting for a new map
40 | *
41 | * @param client The client index
42 | */
43 | native void InactivateClient(int client);
44 |
45 | /**
46 | * Reconnect a client without dropping the netchannel
47 | *
48 | * @param client The client index
49 | */
50 | native void ReconnectClient(int client);
51 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/include/sdktools_engine.inc:
--------------------------------------------------------------------------------
1 | /**
2 | * vim: set ts=4 :
3 | * =============================================================================
4 | * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
5 | * =============================================================================
6 | *
7 | * This file is part of the SourceMod/SourcePawn SDK.
8 | *
9 | * This program is free software; you can redistribute it and/or modify it under
10 | * the terms of the GNU General Public License, version 3.0, as published by the
11 | * Free Software Foundation.
12 | *
13 | * This program is distributed in the hope that it will be useful, but WITHOUT
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 | * details.
17 | *
18 | * You should have received a copy of the GNU General Public License along with
19 | * this program. If not, see .
20 | *
21 | * As a special exception, AlliedModders LLC gives you permission to link the
22 | * code of this program (as well as its derivative works) to "Half-Life 2," the
23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 | * by the Valve Corporation. You must obey the GNU General Public License in
25 | * all respects for all other code used. Additionally, AlliedModders LLC grants
26 | * this exception to all derivative works. AlliedModders LLC defines further
27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 | * or .
29 | *
30 | * Version: $Id$
31 | */
32 |
33 | #if defined _sdktools_engine_included
34 | #endinput
35 | #endif
36 | #define _sdktools_engine_included
37 |
38 | #define MAX_LIGHTSTYLES 64
39 |
40 | /**
41 | * Sets a client's "viewing entity."
42 | *
43 | * @param client Client index.
44 | * @param entity Entity index.
45 | * @error Invalid client or entity, lack of mod support, or client not in
46 | * game.
47 | */
48 | native void SetClientViewEntity(int client, int entity);
49 |
50 | /**
51 | * Sets a light style.
52 | *
53 | * @param style Light style (from 0 to MAX_LIGHTSTYLES-1)
54 | * @param value Light value string (see world.cpp/light.cpp in dlls)
55 | * @error Light style index is out of range.
56 | */
57 | native void SetLightStyle(int style, const char[] value);
58 |
59 | /**
60 | * Returns the client's eye position.
61 | *
62 | * @param client Player's index.
63 | * @param pos Destination vector to store the client's eye position.
64 | * @error Invalid client index, client not in game, or no mod support.
65 | */
66 | native void GetClientEyePosition(int client, float pos[3]);
67 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/include/sdktools_entinput.inc:
--------------------------------------------------------------------------------
1 | /**
2 | * vim: set ts=4 :
3 | * =============================================================================
4 | * SourceMod (C)2004-2017 AlliedModders LLC. All rights reserved.
5 | * =============================================================================
6 | *
7 | * This file is part of the SourceMod/SourcePawn SDK.
8 | *
9 | * This program is free software; you can redistribute it and/or modify it under
10 | * the terms of the GNU General Public License, version 3.0, as published by the
11 | * Free Software Foundation.
12 | *
13 | * This program is distributed in the hope that it will be useful, but WITHOUT
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 | * details.
17 | *
18 | * You should have received a copy of the GNU General Public License along with
19 | * this program. If not, see .
20 | *
21 | * As a special exception, AlliedModders LLC gives you permission to link the
22 | * code of this program (as well as its derivative works) to "Half-Life 2," the
23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 | * by the Valve Corporation. You must obey the GNU General Public License in
25 | * all respects for all other code used. Additionally, AlliedModders LLC grants
26 | * this exception to all derivative works. AlliedModders LLC defines further
27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 | * or .
29 | *
30 | * Version: $Id$
31 | */
32 |
33 | #if defined _sdktools_entinput_included
34 | #endinput
35 | #endif
36 | #define _sdktools_entinput_included
37 |
38 | /**
39 | * Invokes a named input method on an entity.
40 | *
41 | * After completion (successful or not), the current global variant is re-initialized.
42 | *
43 | * @param dest Destination entity index.
44 | * @param input Input action.
45 | * @param activator Entity index which initiated the sequence of actions (-1 for a NULL entity).
46 | * @param caller Entity index from which this event is sent (-1 for a NULL entity).
47 | * @param outputid Unknown.
48 | * @return True if successful otherwise false.
49 | * @error Invalid entity index or no mod support.
50 | */
51 | native bool AcceptEntityInput(int dest, const char[] input, int activator=-1, int caller=-1, int outputid=0);
52 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/include/sdktools_stocks.inc:
--------------------------------------------------------------------------------
1 | /**
2 | * vim: set ts=4 :
3 | * =============================================================================
4 | * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
5 | * =============================================================================
6 | *
7 | * This file is part of the SourceMod/SourcePawn SDK.
8 | *
9 | * This program is free software; you can redistribute it and/or modify it under
10 | * the terms of the GNU General Public License, version 3.0, as published by the
11 | * Free Software Foundation.
12 | *
13 | * This program is distributed in the hope that it will be useful, but WITHOUT
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 | * details.
17 | *
18 | * You should have received a copy of the GNU General Public License along with
19 | * this program. If not, see .
20 | *
21 | * As a special exception, AlliedModders LLC gives you permission to link the
22 | * code of this program (as well as its derivative works) to "Half-Life 2," the
23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 | * by the Valve Corporation. You must obey the GNU General Public License in
25 | * all respects for all other code used. Additionally, AlliedModders LLC grants
26 | * this exception to all derivative works. AlliedModders LLC defines further
27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 | * or .
29 | *
30 | * Version: $Id$
31 | */
32 |
33 | #if defined _sdktools_stocks_included
34 | #endinput
35 | #endif
36 | #define _sdktools_stocks_included
37 |
38 | /**
39 | * Given a partial team name, attempts to find a matching team.
40 | *
41 | * The search is performed case insensitively and only against the
42 | * first N characters of the team names, where N is the number of
43 | * characters in the search pattern.
44 | *
45 | * @param name Partial or full team name.
46 | * @return A valid team index on success.
47 | * -1 if no team matched.
48 | * -2 if more than one team matched.
49 | */
50 | stock int FindTeamByName(const char[] name)
51 | {
52 | int name_len = strlen(name);
53 | int num_teams = GetTeamCount();
54 | char team_name[32];
55 | int found_team = -1;
56 |
57 | for (int i = 0; i < num_teams; i++)
58 | {
59 | GetTeamName(i, team_name, sizeof(team_name));
60 |
61 | if (strncmp(team_name, name, name_len, false) == 0)
62 | {
63 | if (found_team >= 0)
64 | {
65 | return -2;
66 | }
67 | else
68 | {
69 | found_team = i;
70 | }
71 | }
72 | }
73 |
74 | return found_team;
75 | }
76 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/include/sdktools_variant_t.inc:
--------------------------------------------------------------------------------
1 | /**
2 | * vim: set ts=4 :
3 | * =============================================================================
4 | * SourceMod (C)2004-2017 AlliedModders LLC. All rights reserved.
5 | * =============================================================================
6 | *
7 | * This file is part of the SourceMod/SourcePawn SDK.
8 | *
9 | * This program is free software; you can redistribute it and/or modify it under
10 | * the terms of the GNU General Public License, version 3.0, as published by the
11 | * Free Software Foundation.
12 | *
13 | * This program is distributed in the hope that it will be useful, but WITHOUT
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 | * details.
17 | *
18 | * You should have received a copy of the GNU General Public License along with
19 | * this program. If not, see .
20 | *
21 | * As a special exception, AlliedModders LLC gives you permission to link the
22 | * code of this program (as well as its derivative works) to "Half-Life 2," the
23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 | * by the Valve Corporation. You must obey the GNU General Public License in
25 | * all respects for all other code used. Additionally, AlliedModders LLC grants
26 | * this exception to all derivative works. AlliedModders LLC defines further
27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 | * or .
29 | *
30 | * Version: $Id$
31 | */
32 |
33 | #if defined _sdktools_variant_t_included
34 | #endinput
35 | #endif
36 | #define _sdktools_variant_t_included
37 |
38 | /**
39 | * Sets a bool value in the global variant object.
40 | *
41 | * @param val Input value.
42 | */
43 | native void SetVariantBool(bool val);
44 |
45 | /**
46 | * Sets a string in the global variant object.
47 | *
48 | * @param str Input string.
49 | */
50 | native void SetVariantString(const char[] str);
51 |
52 | /**
53 | * Sets an integer value in the global variant object.
54 | *
55 | * @param val Input value.
56 | */
57 | native void SetVariantInt(int val);
58 |
59 | /**
60 | * Sets a floating point value in the global variant object.
61 | *
62 | * @param val Input value.
63 | */
64 | native void SetVariantFloat(float val);
65 |
66 | /**
67 | * Sets a 3D vector in the global variant object.
68 | *
69 | * @param vec Input vector.
70 | */
71 | native void SetVariantVector3D(const float vec[3]);
72 |
73 | /**
74 | * Sets a 3D position vector in the global variant object.
75 | *
76 | * @param vec Input position vector.
77 | */
78 | native void SetVariantPosVector3D(const float vec[3]);
79 |
80 | /**
81 | * Sets a color in the global variant object.
82 | *
83 | * @param color Input color.
84 | */
85 | native void SetVariantColor(const int color[4]);
86 |
87 | /**
88 | * Sets an entity in the global variant object.
89 | *
90 | * @param entity Entity index.
91 | * @error Invalid entity index.
92 | */
93 | native void SetVariantEntity(int entity);
94 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/include/testing.inc:
--------------------------------------------------------------------------------
1 | /**
2 | * vim: set ts=4 sw=4 tw=99 noet :
3 | * =============================================================================
4 | * SourceMod (C)2004-2014 AlliedModders LLC. All rights reserved.
5 | * =============================================================================
6 | *
7 | * This file is part of the SourceMod/SourcePawn SDK.
8 | *
9 | * This program is free software; you can redistribute it and/or modify it under
10 | * the terms of the GNU General Public License, version 3.0, as published by the
11 | * Free Software Foundation.
12 | *
13 | * This program is distributed in the hope that it will be useful, but WITHOUT
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 | * details.
17 | *
18 | * You should have received a copy of the GNU General Public License along with
19 | * this program. If not, see .
20 | *
21 | * As a special exception, AlliedModders LLC gives you permission to link the
22 | * code of this program (as well as its derivative works) to "Half-Life 2," the
23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 | * by the Valve Corporation. You must obey the GNU General Public License in
25 | * all respects for all other code used. Additionally, AlliedModders LLC grants
26 | * this exception to all derivative works. AlliedModders LLC defines further
27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 | * or .
29 | *
30 | * Version: $Id$
31 | */
32 |
33 | static int TestNumber = 0;
34 | static char TestContext[255];
35 |
36 | stock void SetTestContext(const char[] context)
37 | {
38 | strcopy(TestContext, sizeof(TestContext), context);
39 | }
40 |
41 | stock void AssertEq(const char[] text, int cell1, int cell2)
42 | {
43 | TestNumber++;
44 | if (cell1 == cell2)
45 | {
46 | PrintToServer("[%d] %s: %s == %d OK", TestNumber, TestContext, text, cell2);
47 | }
48 | else
49 | {
50 | PrintToServer("[%d] %s FAIL: %s should be %d, got %d", TestNumber, TestContext, text, cell2, cell1);
51 | ThrowError("test %d (%s in %s) failed", TestNumber, text, TestContext);
52 | }
53 | }
54 |
55 | stock void AssertFalse(const char[] text, bool value)
56 | {
57 | TestNumber++;
58 | if (!value)
59 | {
60 | PrintToServer("[%d] %s: %s == false OK", TestNumber, TestContext, text, value);
61 | }
62 | else
63 | {
64 | PrintToServer("[%d] %s FAIL: %s should be false, got true", TestNumber, TestContext, text);
65 | ThrowError("test %d (%s in %s) failed", TestNumber, text, TestContext);
66 | }
67 | }
68 |
69 | stock void AssertTrue(const char[] text, bool value)
70 | {
71 | TestNumber++;
72 | if (value)
73 | {
74 | PrintToServer("[%d] %s: %s == true OK", TestNumber, TestContext, text, value);
75 | }
76 | else
77 | {
78 | PrintToServer("[%d] %s FAIL: %s should be true, got false", TestNumber, TestContext, text);
79 | ThrowError("test %d (%s in %s) failed", TestNumber, text, TestContext);
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/include/version.inc:
--------------------------------------------------------------------------------
1 | /**
2 | * vim: set ts=4 :
3 | * =============================================================================
4 | * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
5 | * =============================================================================
6 | *
7 | * This file is part of the SourceMod/SourcePawn SDK.
8 | *
9 | * This program is free software; you can redistribute it and/or modify it under
10 | * the terms of the GNU General Public License, version 3.0, as published by the
11 | * Free Software Foundation.
12 | *
13 | * This program is distributed in the hope that it will be useful, but WITHOUT
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 | * details.
17 | *
18 | * You should have received a copy of the GNU General Public License along with
19 | * this program. If not, see .
20 | *
21 | * As a special exception, AlliedModders LLC gives you permission to link the
22 | * code of this program (as well as its derivative works) to "Half-Life 2," the
23 | * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 | * by the Valve Corporation. You must obey the GNU General Public License in
25 | * all respects for all other code used. Additionally, AlliedModders LLC grants
26 | * this exception to all derivative works. AlliedModders LLC defines further
27 | * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 | * or .
29 | *
30 | * Version: $Id$
31 | */
32 |
33 | #if defined _version_included
34 | #endinput
35 | #endif
36 | #define _version_included
37 |
38 | #tryinclude
39 |
40 | #if !defined _auto_version_included
41 | #define SOURCEMOD_V_TAG "manual"
42 | #define SOURCEMOD_V_REV 0
43 | #define SOURCEMOD_V_CSET "0"
44 | #define SOURCEMOD_V_MAJOR 1 /**< SourceMod Major version */
45 | #define SOURCEMOD_V_MINOR 10 /**< SourceMod Minor version */
46 | #define SOURCEMOD_V_RELEASE 0 /**< SourceMod Release version */
47 |
48 | #define SOURCEMOD_VERSION "1.10.0-manual" /**< SourceMod version string (major.minor.release-tag) */
49 | #endif
50 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/include/version_auto.inc:
--------------------------------------------------------------------------------
1 |
2 | #if defined _auto_version_included
3 | #endinput
4 | #endif
5 | #define _auto_version_included
6 |
7 | #define SOURCEMOD_V_TAG ""
8 | #define SOURCEMOD_V_CSET "8bf8c982"
9 | #define SOURCEMOD_V_MAJOR 1
10 | #define SOURCEMOD_V_MINOR 10
11 | #define SOURCEMOD_V_RELEASE 0
12 | #define SOURCEMOD_V_REV 6509
13 |
14 | #define SOURCEMOD_VERSION "1.10.0.6509"
15 |
--------------------------------------------------------------------------------
/Resources/Misc/Configurations/sm_1_10_0_6509/spcomp.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Misc/Configurations/sm_1_10_0_6509/spcomp.exe
--------------------------------------------------------------------------------
/Resources/Misc/Icon.pdn:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Misc/Icon.pdn
--------------------------------------------------------------------------------
/Resources/Misc/Lysis/IKVM.OpenJDK.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Misc/Lysis/IKVM.OpenJDK.Core.dll
--------------------------------------------------------------------------------
/Resources/Misc/Lysis/IKVM.OpenJDK.Util.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Misc/Lysis/IKVM.OpenJDK.Util.dll
--------------------------------------------------------------------------------
/Resources/Misc/Lysis/IKVM.Runtime.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Misc/Lysis/IKVM.Runtime.dll
--------------------------------------------------------------------------------
/Resources/Misc/Lysis/LysisDecompiler.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Misc/Lysis/LysisDecompiler.exe
--------------------------------------------------------------------------------
/Resources/Misc/Lysis/lysis-java.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/Misc/Lysis/lysis-java.dll
--------------------------------------------------------------------------------
/Resources/Misc/Templates/ExtensionIncludeTemplate.inc:
--------------------------------------------------------------------------------
1 | /*
2 | **
3 | */
4 | #if defined _INTERFACE_included
5 | #endinput
6 | #endif
7 | #define _INTERFACE_included
8 |
9 |
10 |
11 | /*
12 | #if !defined REQUIRE_EXTENSIONS
13 | public __ext_INTERFACE_SetNTVOptional()
14 | {
15 | MarkNativeAsOptional("");
16 | }
17 | #endif
18 | */
19 |
20 | public Extension __ext_INTERFACE =
21 | {
22 | name = "",
23 | file = ".ext",
24 | #if defined AUTOLOAD_EXTENSIONS
25 | autoload = 1,
26 | #else
27 | autoload = 0,
28 | #endif
29 | #if defined REQUIRE_EXTENSIONS
30 | required = 1,
31 | #else
32 | required = 0,
33 | #endif
34 | };
35 |
--------------------------------------------------------------------------------
/Resources/Misc/Templates/IncludeTemplate.inc:
--------------------------------------------------------------------------------
1 | /*
2 | **
3 | */
4 | #if defined _INCLUDE_included
5 | #endinput
6 | #endif
7 | #define _INCLUDE_included
8 |
--------------------------------------------------------------------------------
/Resources/Misc/Templates/NativeIncludeTemplate.inc:
--------------------------------------------------------------------------------
1 | /*
2 | **
3 | */
4 | #if defined _INTERFACE_included
5 | #endinput
6 | #endif
7 | #define _INTERFACE_included
8 |
9 |
10 |
11 | /*
12 | #if !defined REQUIRE_PLUGIN
13 | public __pl_INTERFACE_SetNTVOptional()
14 | {
15 | MarkNativeAsOptional("");
16 | }
17 | #endif
18 | */
19 |
20 | public SharedPlugin __pl_INTERFACE =
21 | {
22 | name = "",
23 | file = ".smx",
24 | #if defined REQUIRE_PLUGIN
25 | required = 1,
26 | #else
27 | required = 0,
28 | #endif
29 | };
30 |
--------------------------------------------------------------------------------
/Resources/Misc/Templates/OldSyntaxTemplate_CSGO.sp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #pragma semicolon 1
5 |
6 | #define PLUGIN_VERSION "0.00"
7 |
8 | public Plugin:myinfo =
9 | {
10 | name = "Name of plugin here!",
11 | author = "Your name here!",
12 | description = "Brief description of plugin functionality here!",
13 | version = PLUGIN_VERSION,
14 | url = "Your website URL/AlliedModders profile URL"
15 | };
16 |
17 | public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
18 | {
19 | // No need for the old GetGameFolderName setup.
20 | EngineVersion:g_engineversion = GetEngineVersion();
21 | if (g_engineversion != Engine_CSGO)
22 | {
23 | SetFailState("This plugin was made for use with Counter-Strike: Global Offensive only.");
24 | }
25 | }
26 |
27 | public OnPluginStart()
28 | {
29 | /**
30 | * @note For the love of god, please stop using FCVAR_PLUGIN.
31 | * Console.inc even explains this above the entry for the FCVAR_PLUGIN define.
32 | * "No logic using this flag ever existed in a released game. It only ever appeared in the first hl2sdk."
33 | */
34 | CreateConVar("sm_pluginnamehere_version", PLUGIN_VERSION, "Standard plugin version ConVar. Please don't change me!", FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
35 | }
36 |
37 | public OnMapStart()
38 | {
39 | /**
40 | * @note Precache your models, sounds, etc. here!
41 | * Not in OnConfigsExecuted! Doing so leads to issues.
42 | */
43 | }
44 |
--------------------------------------------------------------------------------
/Resources/Misc/Templates/OldSyntaxTemplate_CSS.sp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #pragma semicolon 1
5 |
6 | #define PLUGIN_VERSION "0.00"
7 |
8 | public Plugin:myinfo =
9 | {
10 | name = "Name of plugin here!",
11 | author = "Your name here!",
12 | description = "Brief description of plugin functionality here!",
13 | version = PLUGIN_VERSION,
14 | url = "Your website URL/AlliedModders profile URL"
15 | };
16 |
17 | public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
18 | {
19 | // No need for the old GetGameFolderName setup.
20 | EngineVersion:g_engineversion = GetEngineVersion();
21 | if (g_engineversion != Engine_CSS)
22 | {
23 | SetFailState("This plugin was made for use with Counter-Strike: Source only.");
24 | }
25 | }
26 |
27 | public OnPluginStart()
28 | {
29 | /**
30 | * @note For the love of god, please stop using FCVAR_PLUGIN.
31 | * Console.inc even explains this above the entry for the FCVAR_PLUGIN define.
32 | * "No logic using this flag ever existed in a released game. It only ever appeared in the first hl2sdk."
33 | */
34 | CreateConVar("sm_pluginnamehere_version", PLUGIN_VERSION, "Standard plugin version ConVar. Please don't change me!", FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
35 | }
36 |
37 | public OnMapStart()
38 | {
39 | /**
40 | * @note Precache your models, sounds, etc. here!
41 | * Not in OnConfigsExecuted! Doing so leads to issues.
42 | */
43 | }
44 |
--------------------------------------------------------------------------------
/Resources/Misc/Templates/OldSyntaxTemplate_Generic.sp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #pragma semicolon 1
5 |
6 | #define PLUGIN_VERSION "0.00"
7 |
8 | public Plugin:myinfo =
9 | {
10 | name = "Name of plugin here!",
11 | author = "Your name here!",
12 | description = "Brief description of plugin functionality here!",
13 | version = PLUGIN_VERSION,
14 | url = "Your website URL/AlliedModders profile URL"
15 | };
16 |
17 | public OnPluginStart()
18 | {
19 | /**
20 | * @note For the love of god, please stop using FCVAR_PLUGIN.
21 | * Console.inc even explains this above the entry for the FCVAR_PLUGIN define.
22 | * "No logic using this flag ever existed in a released game. It only ever appeared in the first hl2sdk."
23 | */
24 | CreateConVar("sm_pluginnamehere_version", PLUGIN_VERSION, "Standard plugin version ConVar. Please don't change me!", FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
25 | }
26 |
27 | public OnMapStart()
28 | {
29 | /**
30 | * @note Precache your models, sounds, etc. here!
31 | * Not in OnConfigsExecuted! Doing so leads to issues.
32 | */
33 | }
34 |
--------------------------------------------------------------------------------
/Resources/Misc/Templates/OldSyntaxTemplate_TF2.sp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | // ^ tf2_stocks.inc itself includes sdktools.inc and tf2.inc
4 |
5 | #pragma semicolon 1
6 |
7 | #define PLUGIN_VERSION "0.00"
8 |
9 | EngineVersion:g_engineversion;
10 |
11 | public Plugin:myinfo =
12 | {
13 | name = "Name of plugin here!",
14 | author = "Your name here!",
15 | description = "Brief description of plugin functionality here!",
16 | version = PLUGIN_VERSION,
17 | url = "Your website URL/AlliedModders profile URL"
18 | };
19 |
20 | public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
21 | {
22 | // No need for the old GetGameFolderName setup.
23 | EngineVersion:g_engineversion = GetEngineVersion();
24 | if (g_engineversion != Engine_TF2)
25 | {
26 | SetFailState("This plugin was made for use with Team Fortress 2 only.");
27 | }
28 | }
29 |
30 | public OnPluginStart()
31 | {
32 | /**
33 | * @note For the love of god, please stop using FCVAR_PLUGIN.
34 | * Console.inc even explains this above the entry for the FCVAR_PLUGIN define.
35 | * "No logic using this flag ever existed in a released game. It only ever appeared in the first hl2sdk."
36 | */
37 | CreateConVar("sm_pluginnamehere_version", PLUGIN_VERSION, "Standard plugin version ConVar. Please don't change me!", FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
38 | }
39 |
40 | public OnMapStart()
41 | {
42 | /**
43 | * @note Precache your models, sounds, etc. here!
44 | * Not in OnConfigsExecuted! Doing so leads to issues.
45 | */
46 | }
47 |
--------------------------------------------------------------------------------
/Resources/Misc/Templates/Template_CSGO.sp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #pragma semicolon 1
5 | #pragma newdecls required
6 |
7 | #define PLUGIN_VERSION "0.00"
8 |
9 | public Plugin myinfo =
10 | {
11 | name = "Name of plugin here!",
12 | author = "Your name here!",
13 | description = "Brief description of plugin functionality here!",
14 | version = PLUGIN_VERSION,
15 | url = "Your website URL/AlliedModders profile URL"
16 | };
17 |
18 | public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
19 | {
20 | // No need for the old GetGameFolderName setup.
21 | EngineVersion g_engineversion = GetEngineVersion();
22 | if (g_engineversion != Engine_CSGO)
23 | {
24 | SetFailState("This plugin was made for use with Counter-Strike: Global Offensive only.");
25 | }
26 | }
27 |
28 | public void OnPluginStart()
29 | {
30 | /**
31 | * @note For the love of god, please stop using FCVAR_PLUGIN.
32 | * Console.inc even explains this above the entry for the FCVAR_PLUGIN define.
33 | * "No logic using this flag ever existed in a released game. It only ever appeared in the first hl2sdk."
34 | */
35 | CreateConVar("sm_pluginnamehere_version", PLUGIN_VERSION, "Standard plugin version ConVar. Please don't change me!", FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
36 | }
37 |
38 | public void OnMapStart()
39 | {
40 | /**
41 | * @note Precache your models, sounds, etc. here!
42 | * Not in OnConfigsExecuted! Doing so leads to issues.
43 | */
44 | }
45 |
--------------------------------------------------------------------------------
/Resources/Misc/Templates/Template_CSS.sp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #pragma semicolon 1
5 | #pragma newdecls required
6 |
7 | #define PLUGIN_VERSION "0.00"
8 |
9 | public Plugin myinfo =
10 | {
11 | name = "Name of plugin here!",
12 | author = "Your name here!",
13 | description = "Brief description of plugin functionality here!",
14 | version = PLUGIN_VERSION,
15 | url = "Your website URL/AlliedModders profile URL"
16 | };
17 |
18 | public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
19 | {
20 | // No need for the old GetGameFolderName setup.
21 | EngineVersion g_engineversion = GetEngineVersion();
22 | if (g_engineversion != Engine_CSS)
23 | {
24 | SetFailState("This plugin was made for use with Counter-Strike: Source only.");
25 | }
26 | }
27 |
28 | public void OnPluginStart()
29 | {
30 | /**
31 | * @note For the love of god, please stop using FCVAR_PLUGIN.
32 | * Console.inc even explains this above the entry for the FCVAR_PLUGIN define.
33 | * "No logic using this flag ever existed in a released game. It only ever appeared in the first hl2sdk."
34 | */
35 | CreateConVar("sm_pluginnamehere_version", PLUGIN_VERSION, "Standard plugin version ConVar. Please don't change me!", FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
36 | }
37 |
38 | public void OnMapStart()
39 | {
40 | /**
41 | * @note Precache your models, sounds, etc. here!
42 | * Not in OnConfigsExecuted! Doing so leads to issues.
43 | */
44 | }
45 |
--------------------------------------------------------------------------------
/Resources/Misc/Templates/Template_Generic.sp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #pragma semicolon 1
5 | #pragma newdecls required
6 |
7 | #define PLUGIN_VERSION "0.00"
8 |
9 | public Plugin myinfo =
10 | {
11 | name = "Name of plugin here!",
12 | author = "Your name here!",
13 | description = "Brief description of plugin functionality here!",
14 | version = PLUGIN_VERSION,
15 | url = "Your website URL/AlliedModders profile URL"
16 | };
17 |
18 | public void OnPluginStart()
19 | {
20 | /**
21 | * @note For the love of god, please stop using FCVAR_PLUGIN.
22 | * Console.inc even explains this above the entry for the FCVAR_PLUGIN define.
23 | * "No logic using this flag ever existed in a released game. It only ever appeared in the first hl2sdk."
24 | */
25 | CreateConVar("sm_pluginnamehere_version", PLUGIN_VERSION, "Standard plugin version ConVar. Please don't change me!", FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
26 | }
27 |
28 | public void OnMapStart()
29 | {
30 | /**
31 | * @note Precache your models, sounds, etc. here!
32 | * Not in OnConfigsExecuted! Doing so leads to issues.
33 | */
34 | }
35 |
--------------------------------------------------------------------------------
/Resources/Misc/Templates/Template_TF2.sp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | // ^ tf2_stocks.inc itself includes sdktools.inc and tf2.inc
4 |
5 | #pragma semicolon 1
6 | #pragma newdecls required
7 |
8 | #define PLUGIN_VERSION "0.00"
9 |
10 | public Plugin myinfo =
11 | {
12 | name = "Name of plugin here!",
13 | author = "Your name here!",
14 | description = "Brief description of plugin functionality here!",
15 | version = PLUGIN_VERSION,
16 | url = "Your website URL/AlliedModders profile URL"
17 | };
18 |
19 | public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max)
20 | {
21 | // No need for the old GetGameFolderName setup.
22 | EngineVersion g_engineversion = GetEngineVersion();
23 | if (g_engineversion != Engine_TF2)
24 | {
25 | SetFailState("This plugin was made for use with Team Fortress 2 only.");
26 | }
27 | }
28 |
29 | public void OnPluginStart()
30 | {
31 | /**
32 | * @note For the love of god, please stop using FCVAR_PLUGIN.
33 | * Console.inc even explains this above the entry for the FCVAR_PLUGIN define.
34 | * "No logic using this flag ever existed in a released game. It only ever appeared in the first hl2sdk."
35 | */
36 | CreateConVar("sm_pluginnamehere_version", PLUGIN_VERSION, "Standard plugin version ConVar. Please don't change me!", FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
37 | }
38 |
39 | public void OnMapStart()
40 | {
41 | /**
42 | * @note Precache your models, sounds, etc. here!
43 | * Not in OnConfigsExecuted! Doing so leads to issues.
44 | */
45 | }
46 |
--------------------------------------------------------------------------------
/Resources/Misc/Templates/Templates.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Resources/icon256xbeta.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/Resources/icon256xbeta.ico
--------------------------------------------------------------------------------
/SourcepawnCondenser/CondenserTest/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/SourcepawnCondenser/CondenserTest/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/SourcepawnCondenser/CondenserTest/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace CondenserTest
4 | {
5 | public partial class App : Application
6 | {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/SourcepawnCondenser/CondenserTest/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/SourcepawnCondenser/CondenserTest/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 | using System.Windows;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("CondenserTest")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("CondenserTest")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | //In order to begin building localizable applications, set
23 | //CultureYouAreCodingWith in your .csproj file
24 | //inside a . For example, if you are using US english
25 | //in your source files, set the to en-US. Then uncomment
26 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
27 | //the line below to match the UICulture setting in the project file.
28 |
29 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
30 |
31 |
32 | [assembly: ThemeInfo(
33 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
34 | //(used if a resource is not found in the page,
35 | // or application resource dictionaries)
36 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
37 | //(used if a resource is not found in the page,
38 | // app, or any theme specific resource dictionaries)
39 | )]
40 |
41 |
42 | // Version information for an assembly consists of the following four values:
43 | //
44 | // Major Version
45 | // Minor Version
46 | // Build Number
47 | // Revision
48 | //
49 | // You can specify all the values or you can default the Build and Revision Numbers
50 | // by using the '*' as shown below:
51 | // [assembly: AssemblyVersion("1.0.*")]
52 | [assembly: AssemblyVersion("1.0.0.0")]
53 | [assembly: AssemblyFileVersion("1.0.0.0")]
54 |
--------------------------------------------------------------------------------
/SourcepawnCondenser/CondenserTest/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace CondenserTest.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CondenserTest.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/SourcepawnCondenser/CondenserTest/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace CondenserTest.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/SourcepawnCondenser/CondenserTest/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.24720.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SourcepawnCondenser", "SourcepawnCondenser\SourcepawnCondenser.csproj", "{B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CondenserTest", "CondenserTest\CondenserTest.csproj", "{B1E03089-FD98-4C01-828F-8CB05F87462F}"
9 | ProjectSection(ProjectDependencies) = postProject
10 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850} = {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}
11 | EndProjectSection
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|Any CPU = Debug|Any CPU
16 | Debug|ARM = Debug|ARM
17 | Debug|x64 = Debug|x64
18 | Debug|x86 = Debug|x86
19 | Release|Any CPU = Release|Any CPU
20 | Release|ARM = Release|ARM
21 | Release|x64 = Release|x64
22 | Release|x86 = Release|x86
23 | EndGlobalSection
24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
25 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Debug|Any CPU.Build.0 = Debug|Any CPU
27 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Debug|ARM.ActiveCfg = Debug|Any CPU
28 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Debug|ARM.Build.0 = Debug|Any CPU
29 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Debug|x64.ActiveCfg = Debug|Any CPU
30 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Debug|x64.Build.0 = Debug|Any CPU
31 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Debug|x86.ActiveCfg = Debug|Any CPU
32 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Debug|x86.Build.0 = Debug|Any CPU
33 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Release|Any CPU.ActiveCfg = Release|Any CPU
34 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Release|Any CPU.Build.0 = Release|Any CPU
35 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Release|ARM.ActiveCfg = Release|Any CPU
36 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Release|ARM.Build.0 = Release|Any CPU
37 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Release|x64.ActiveCfg = Release|Any CPU
38 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Release|x64.Build.0 = Release|Any CPU
39 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Release|x86.ActiveCfg = Release|Any CPU
40 | {B4E00F2D-DD73-42C7-A0CA-BA92B2A05850}.Release|x86.Build.0 = Release|Any CPU
41 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Debug|Any CPU.Build.0 = Debug|Any CPU
43 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Debug|ARM.ActiveCfg = Debug|Any CPU
44 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Debug|ARM.Build.0 = Debug|Any CPU
45 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Debug|x64.ActiveCfg = Debug|Any CPU
46 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Debug|x64.Build.0 = Debug|Any CPU
47 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Debug|x86.ActiveCfg = Debug|Any CPU
48 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Debug|x86.Build.0 = Debug|Any CPU
49 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Release|Any CPU.ActiveCfg = Release|Any CPU
50 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Release|Any CPU.Build.0 = Release|Any CPU
51 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Release|ARM.ActiveCfg = Release|Any CPU
52 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Release|ARM.Build.0 = Release|Any CPU
53 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Release|x64.ActiveCfg = Release|Any CPU
54 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Release|x64.Build.0 = Release|Any CPU
55 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Release|x86.ActiveCfg = Release|Any CPU
56 | {B1E03089-FD98-4C01-828F-8CB05F87462F}.Release|x86.Build.0 = Release|Any CPU
57 | EndGlobalSection
58 | GlobalSection(SolutionProperties) = preSolution
59 | HideSolutionNode = FALSE
60 | EndGlobalSection
61 | EndGlobal
62 |
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMClasslike.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using SourcepawnCondenser.SourcemodDefinition;
5 |
6 | namespace SourcepawnCondenser;
7 |
8 |
9 | ///
10 | /// This is inherited from from SMMethodmap and SMEnumStruct
11 | ///
12 | public abstract class SMClasslike : SMBaseDefinition
13 | {
14 | public readonly List Fields = new();
15 | public readonly List Methods = new();
16 |
17 | public virtual List ProduceNodes(SMDefinition smDef)
18 | {
19 | var nodes = new List();
20 | nodes.AddRange(ACNode.ConvertFromStringList(Methods.Select(e => e.Name), true, "▲ "));
21 | nodes.AddRange(ACNode.ConvertFromStringList(Fields.Select(e => e.Name), false, "• "));
22 |
23 | nodes.Sort((a, b) => string.CompareOrdinal(a.EntryName, b.EntryName));
24 |
25 | return nodes;
26 | }
27 | }
28 |
29 | public class SMObjectMethod : SMBaseDefinition
30 | {
31 | public string ClassName = string.Empty;
32 | public string FullName = string.Empty;
33 | public string ReturnType = string.Empty;
34 | public string[] Parameters = Array.Empty();
35 | }
36 |
37 | public class SMObjectField : SMBaseDefinition
38 | {
39 | public string ClassName = string.Empty;
40 | public string FullName = string.Empty;
41 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMConstantConsumer.cs:
--------------------------------------------------------------------------------
1 | using SourcepawnCondenser.SourcemodDefinition;
2 | using SourcepawnCondenser.Tokenizer;
3 |
4 | namespace SourcepawnCondenser
5 | {
6 | public partial class Condenser
7 | {
8 | private int ConsumeSMConstant()
9 | {
10 | if (position + 2 < length)
11 | {
12 | var startIndex = t[position].Index;
13 | var foundIdentifier = false;
14 | var foundAssignment = false;
15 | var constantName = string.Empty;
16 | for (var i = position + 2; i < length; ++i)
17 | {
18 | if (t[i].Kind == TokenKind.Semicolon)
19 | {
20 | if (!foundIdentifier)
21 | {
22 | if (t[i - 1].Kind == TokenKind.Identifier)
23 | {
24 | constantName = t[i - 1].Value;
25 | }
26 | }
27 |
28 | if (!string.IsNullOrWhiteSpace(constantName))
29 | {
30 | def.ConstVariables.Add(new SMConstant
31 | {
32 | Index = startIndex,
33 | Length = t[i].Index - startIndex,
34 | File = FileName,
35 | Name = constantName
36 | });
37 | }
38 |
39 | return i;
40 | }
41 |
42 | if (t[i].Kind == TokenKind.Assignment)
43 | {
44 | foundAssignment = true;
45 | if (t[i - 1].Kind == TokenKind.Identifier)
46 | {
47 | foundIdentifier = true;
48 | constantName = t[i - 1].Value;
49 | }
50 | }
51 | else if (t[i].Kind == TokenKind.Character && !foundAssignment)
52 | {
53 | if (t[i].Value == "[")
54 | {
55 | if (t[i - 1].Kind == TokenKind.Identifier)
56 | {
57 | foundIdentifier = true;
58 | constantName = t[i - 1].Value;
59 | }
60 | }
61 | }
62 | else if (t[i].Kind == TokenKind.EOL) //failsafe
63 | {
64 | return i;
65 | }
66 | }
67 | }
68 | return -1;
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMEnumConsumer.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using SourcepawnCondenser.SourcemodDefinition;
3 | using SourcepawnCondenser.Tokenizer;
4 |
5 | namespace SourcepawnCondenser
6 | {
7 | public partial class Condenser
8 | {
9 | private int ConsumeSMEnum()
10 | {
11 | var startIndex = t[position].Index;
12 | if ((position + 1) < length)
13 | {
14 | var iteratePosition = position;
15 | var enumName = string.Empty;
16 | while ((iteratePosition + 1) < length && t[iteratePosition].Kind != TokenKind.BraceOpen)
17 | {
18 | if (t[iteratePosition].Kind == TokenKind.Identifier)
19 | {
20 | enumName = t[iteratePosition].Value;
21 | }
22 | ++iteratePosition;
23 | }
24 | var braceState = 0;
25 | var inIgnoreMode = false;
26 | var endTokenIndex = -1;
27 | var entries = new List();
28 | for (; iteratePosition < length; ++iteratePosition)
29 | {
30 | if (t[iteratePosition].Kind == TokenKind.BraceOpen)
31 | {
32 | ++braceState;
33 | continue;
34 | }
35 | if (t[iteratePosition].Kind == TokenKind.BraceClose)
36 | {
37 | --braceState;
38 | if (braceState == 0)
39 | {
40 | endTokenIndex = iteratePosition;
41 | break;
42 | }
43 | continue;
44 | }
45 | if (inIgnoreMode)
46 | {
47 | if (t[iteratePosition].Kind == TokenKind.Comma)
48 | {
49 | inIgnoreMode = false;
50 | }
51 | continue;
52 | }
53 | if (t[iteratePosition].Kind == TokenKind.Identifier)
54 | {
55 | entries.Add(t[iteratePosition].Value);
56 | inIgnoreMode = true;
57 | }
58 | }
59 | if (endTokenIndex == -1)
60 | {
61 | return -1;
62 | }
63 | def.Enums.Add(new SMEnum()
64 | {
65 | Index = startIndex,
66 | Length = t[endTokenIndex].Index - startIndex + 1,
67 | File = FileName,
68 | Entries = entries.ToArray(),
69 | Name = enumName
70 | });
71 | return endTokenIndex;
72 | }
73 | return -1;
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMPPDirectiveConsumer.cs:
--------------------------------------------------------------------------------
1 | using SourcepawnCondenser.SourcemodDefinition;
2 | using SourcepawnCondenser.Tokenizer;
3 |
4 | namespace SourcepawnCondenser
5 | {
6 | public partial class Condenser
7 | {
8 | private int ConsumeSMPPDirective()
9 | {
10 | if (t[position].Value != "#define" || position + 1 >= length ||
11 | t[position + 1].Kind != TokenKind.Identifier)
12 | {
13 | return -1;
14 | }
15 |
16 | def.Defines.Add(new SMDefine
17 | {
18 | Index = t[position].Index,
19 | Length = t[position + 1].Index - t[position].Index + t[position + 1].Length,
20 | File = FileName,
21 | Name = t[position + 1].Value
22 | });
23 |
24 | for (var j = position + 1; j < length; ++j)
25 | {
26 | if (t[j].Kind == TokenKind.EOL)
27 | {
28 | return j;
29 | }
30 | }
31 |
32 | return position + 1;
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMStructConsumer.cs:
--------------------------------------------------------------------------------
1 | using SourcepawnCondenser.SourcemodDefinition;
2 | using SourcepawnCondenser.Tokenizer;
3 |
4 | namespace SourcepawnCondenser
5 | {
6 | public partial class Condenser
7 | {
8 | private int ConsumeSMStruct()
9 | {
10 | var startIndex = t[position].Index;
11 | if ((position + 1) < length)
12 | {
13 | var iteratePosition = position;
14 | var structName = string.Empty;
15 | while ((iteratePosition + 1) < length && t[iteratePosition].Kind != TokenKind.BraceOpen)
16 | {
17 | if (t[iteratePosition].Kind == TokenKind.Identifier)
18 | {
19 | structName = t[iteratePosition].Value;
20 | }
21 | ++iteratePosition;
22 | }
23 | var braceState = 0;
24 | var endTokenIndex = -1;
25 | for (; iteratePosition < length; ++iteratePosition)
26 | {
27 | if (t[iteratePosition].Kind == TokenKind.BraceOpen)
28 | {
29 | ++braceState;
30 | continue;
31 | }
32 | if (t[iteratePosition].Kind == TokenKind.BraceClose)
33 | {
34 | --braceState;
35 | if (braceState == 0)
36 | {
37 | endTokenIndex = iteratePosition;
38 | break;
39 | }
40 | continue;
41 | }
42 | }
43 | if (endTokenIndex == -1)
44 | {
45 | return -1;
46 | }
47 | def.Structs.Add(new SMStruct() { Index = startIndex, Length = t[endTokenIndex].Index - startIndex + 1, File = FileName, Name = structName });
48 | return endTokenIndex;
49 | }
50 | return -1;
51 | }
52 | }
53 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/CondenserFunctions/SMTypedefConsumer.cs:
--------------------------------------------------------------------------------
1 | using SourcepawnCondenser.SourcemodDefinition;
2 | using SourcepawnCondenser.Tokenizer;
3 |
4 | namespace SourcepawnCondenser
5 | {
6 | public partial class Condenser
7 | {
8 | private int ConsumeSMTypedef()
9 | {
10 | var startIndex = t[position].Index;
11 | if ((position + 2) < length)
12 | {
13 | ++position;
14 | if (t[position].Kind == TokenKind.Identifier)
15 | {
16 | var name = t[position].Value;
17 | for (var iteratePosition = position + 1; iteratePosition < length; ++iteratePosition)
18 | {
19 | if (t[iteratePosition].Kind == TokenKind.Semicolon)
20 | {
21 | def.Typedefs.Add(new SMTypedef()
22 | {
23 | Index = startIndex,
24 | Length = t[iteratePosition].Index - startIndex + 1,
25 | File = FileName,
26 | Name = name,
27 | FullName = source.Substring(startIndex, t[iteratePosition].Index - startIndex + 1)
28 | });
29 | return iteratePosition;
30 | }
31 | }
32 | }
33 | }
34 | return -1;
35 | }
36 |
37 | private int ConsumeSMTypeset()
38 | {
39 | var startIndex = t[position].Index;
40 | if ((position + 2) < length)
41 | {
42 | ++position;
43 | if (t[position].Kind == TokenKind.Identifier)
44 | {
45 | var name = t[position].Value;
46 | var bracketIndex = 0;
47 | for (var iteratePosition = position + 1; iteratePosition < length; ++iteratePosition)
48 | {
49 | if (t[iteratePosition].Kind == TokenKind.BraceClose)
50 | {
51 | --bracketIndex;
52 | if (bracketIndex == 0)
53 | {
54 | def.Typedefs.Add(new SMTypedef()
55 | {
56 | Index = startIndex,
57 | Length = t[iteratePosition].Index - startIndex + 1,
58 | File = FileName,
59 | Name = name,
60 | FullName = source.Substring(startIndex, t[iteratePosition].Index - startIndex + 1)
61 | });
62 | return iteratePosition;
63 | }
64 | }
65 | else if (t[iteratePosition].Kind == TokenKind.BraceOpen)
66 | {
67 | ++bracketIndex;
68 | }
69 | }
70 | }
71 | }
72 | return -1;
73 | }
74 | }
75 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/SourcemodDefinition/SMBaseDefinition.cs:
--------------------------------------------------------------------------------
1 | namespace SourcepawnCondenser.SourcemodDefinition;
2 |
3 | public abstract class SMBaseDefinition
4 | {
5 | public int Index = -1;
6 | public int Length = 0;
7 | public string File = string.Empty;
8 |
9 | public string Name = string.Empty;
10 | public string CommentString = string.Empty;
11 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/SourcemodDefinition/SMConstant.cs:
--------------------------------------------------------------------------------
1 | namespace SourcepawnCondenser.SourcemodDefinition
2 | {
3 | public class SMConstant : SMBaseDefinition
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/SourcemodDefinition/SMDefine.cs:
--------------------------------------------------------------------------------
1 | namespace SourcepawnCondenser.SourcemodDefinition
2 | {
3 | public class SMDefine : SMBaseDefinition
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/SourcemodDefinition/SMEnum.cs:
--------------------------------------------------------------------------------
1 | namespace SourcepawnCondenser.SourcemodDefinition
2 | {
3 | public class SMEnum : SMBaseDefinition
4 | {
5 | public string[] Entries = new string[0];
6 | }
7 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/SourcemodDefinition/SMEnumStruct.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 |
4 | namespace SourcepawnCondenser.SourcemodDefinition
5 | {
6 | public class SMEnumStruct : SMClasslike
7 | {
8 | }
9 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/SourcemodDefinition/SMFunction.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace SourcepawnCondenser.SourcemodDefinition
4 | {
5 | public class SMFunction : SMBaseDefinition
6 | {
7 | public int EndPos = -1;
8 |
9 | public string FullName = string.Empty;
10 | public string ReturnType = string.Empty;
11 | public string[] Parameters = new string[0];
12 | public SMFunctionKind FunctionKind = SMFunctionKind.Unknown;
13 | public List FuncVariables = new();
14 | }
15 |
16 | public enum SMFunctionKind
17 | {
18 | Stock,
19 | StockStatic,
20 | Native,
21 | Forward,
22 | Public,
23 | PublicNative,
24 | Static,
25 | Normal,
26 | Unknown
27 | }
28 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/SourcemodDefinition/SMMethodmap.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 |
4 | namespace SourcepawnCondenser.SourcemodDefinition
5 | {
6 | public class SMMethodmap : SMClasslike
7 | {
8 | public string InheritedType = string.Empty;
9 |
10 | public override List ProduceNodes(SMDefinition smDef)
11 | {
12 | var nodes = new List();
13 | nodes.AddRange(ACNode.ConvertFromStringList(Methods.Select(e => e.Name), true, "▲ "));
14 | nodes.AddRange(ACNode.ConvertFromStringList(Fields.Select(e => e.Name), false, "• "));
15 |
16 | // Find Fields and Methods inherited from the "super-class".
17 | var inheritedType = InheritedType;
18 | for (;;)
19 | {
20 | if (inheritedType.Length == 0)
21 | break;
22 |
23 | var mm = smDef.Methodmaps.Find(e => e.Name == inheritedType);
24 | if (mm == null)
25 | break;
26 |
27 | nodes.AddRange(ACNode.ConvertFromStringList(mm.Methods.Select(e => e.Name), true, "▲ "));
28 | nodes.AddRange(ACNode.ConvertFromStringList(mm.Fields.Select(e => e.Name), false, "• "));
29 |
30 | inheritedType = mm.InheritedType;
31 | }
32 |
33 | nodes.Sort((a, b) => string.CompareOrdinal(a.EntryName, b.EntryName));
34 |
35 | return nodes;
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/SourcemodDefinition/SMStruct.cs:
--------------------------------------------------------------------------------
1 | namespace SourcepawnCondenser.SourcemodDefinition
2 | {
3 | public class SMStruct : SMBaseDefinition
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/SourcemodDefinition/SMTypedef.cs:
--------------------------------------------------------------------------------
1 | namespace SourcepawnCondenser.SourcemodDefinition
2 | {
3 | public class SMTypedef : SMBaseDefinition
4 | {
5 | public string FullName = string.Empty;
6 | }
7 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/SourcemodDefinition/SMVariable.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace SourcepawnCondenser.SourcemodDefinition
4 | {
5 | public class SMVariable : SMBaseDefinition
6 | {
7 | public string Type = string.Empty;
8 | public string Value = string.Empty;
9 | public int Dimensions = 0;
10 | public List Size = new();
11 | }
12 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/SourcepawnCondenser.csproj.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | True
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/Tokenizer/Token.cs:
--------------------------------------------------------------------------------
1 | namespace SourcepawnCondenser.Tokenizer
2 | {
3 | public class Token
4 | {
5 | public Token(string Value_, TokenKind Kind_, int Index_)
6 | {
7 | Value = Value_;
8 | Kind = Kind_;
9 | Index = Index_;
10 | Length = Value_.Length;
11 | }
12 | public Token(char Value_, TokenKind Kind_, int Index_)
13 | {
14 | Value = Value_.ToString();
15 | Kind = Kind_;
16 | Index = Index_;
17 | Length = 1;
18 | }
19 | public string Value;
20 | public TokenKind Kind;
21 | public int Index;
22 | public int Length;
23 | }
24 | }
--------------------------------------------------------------------------------
/SourcepawnCondenser/SourcepawnCondenser/Tokenizer/TokenKind.cs:
--------------------------------------------------------------------------------
1 | namespace SourcepawnCondenser.Tokenizer
2 | {
3 | public enum TokenKind
4 | {
5 | Identifier, //done
6 | Number, //d
7 | Character, //d
8 | BraceOpen, //d
9 | BraceClose, //d
10 | ParenthesisOpen, //d
11 | ParenthesisClose, //d
12 | Quote, //d
13 | SingleLineComment, //d
14 | MultiLineComment, //d
15 | Semicolon, //d
16 | Comma, //d
17 | Assignment, //d
18 |
19 | FunctionIndicator, //d
20 | Constant, //d
21 | EnumStruct,
22 | Enum, //d
23 | Struct, //d
24 | MethodMap, //d
25 | Property, //d
26 | PreprocessorDirective, //d
27 | TypeDef, //d
28 | TypeSet, //d
29 | New,
30 |
31 | EOL, //d
32 | EOF, //d
33 | }
34 | }
--------------------------------------------------------------------------------
/Spcode.sln.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | True
3 | True
4 | True
5 | True
6 | True
7 | True
8 | True
9 | True
10 | True
11 | True
--------------------------------------------------------------------------------
/UI/Components/ColorChangeControl/ColorChangeControl.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/UI/Components/ColorChangeControl/ColorChangeControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using System.Windows.Media;
4 |
5 | namespace SPCode.UI.Components
6 | {
7 | public partial class ColorChangeControl : UserControl
8 | {
9 | public static readonly RoutedEvent ColorChangedEvent = EventManager.RegisterRoutedEvent(
10 | "ColorChanged", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(ColorChangeControl));
11 |
12 | public event RoutedEventHandler ColorChanged
13 | {
14 | add { AddHandler(ColorChangedEvent, value); }
15 | remove { RemoveHandler(ColorChangedEvent, value); }
16 | }
17 |
18 | private bool RaiseEventAllowed = false;
19 | public ColorChangeControl()
20 | {
21 | InitializeComponent();
22 | }
23 |
24 | public void SetContent(string SHName, Color c)
25 | {
26 | ColorName.Text = SHName;
27 | UpdateColor(c);
28 | }
29 |
30 | public Color GetColor()
31 | {
32 | return Color.FromArgb(0xFF, (byte)(int)RSlider.Value, (byte)(int)GSlider.Value, (byte)(int)BSlider.Value);
33 | }
34 |
35 | private void SliderValue_Changed(object sender, RoutedEventArgs e)
36 | {
37 | if (!RaiseEventAllowed) { return; }
38 | var c = Color.FromArgb(0xFF, (byte)(int)RSlider.Value, (byte)(int)GSlider.Value, (byte)(int)BSlider.Value);
39 | UpdateColor(c, true, false);
40 | var raiseEvent = new RoutedEventArgs(ColorChangedEvent);
41 | RaiseEvent(raiseEvent);
42 | }
43 |
44 | private void UpdateColor(Color c, bool UpdateTextBox = true, bool UpdateSlider = true)
45 | {
46 | RaiseEventAllowed = false;
47 | BrushRect.Background = new SolidColorBrush(c);
48 | var colorChannelMean = (c.R + c.G + c.B) / 3.0;
49 | BrushRect.Foreground = new SolidColorBrush((colorChannelMean > 128.0) ? Colors.Black : Colors.White);
50 | if (UpdateTextBox)
51 | {
52 | BrushRect.Text = ((c.R << 16) | (c.G << 8) | (c.B)).ToString("X").PadLeft(6, '0');
53 | }
54 | if (UpdateSlider)
55 | {
56 | RSlider.Value = c.R;
57 | GSlider.Value = c.G;
58 | BSlider.Value = c.B;
59 | }
60 | var raiseEvent = new RoutedEventArgs(ColorChangedEvent);
61 | RaiseEvent(raiseEvent);
62 | RaiseEventAllowed = true;
63 | }
64 |
65 | private void BrushRect_TextChanged(object sender, TextChangedEventArgs e)
66 | {
67 | if (!RaiseEventAllowed) { return; }
68 | var cVal = 0;
69 | var parseString = BrushRect.Text.Trim();
70 | if (parseString.StartsWith("0x", System.StringComparison.InvariantCultureIgnoreCase) && parseString.Length > 2)
71 | {
72 | parseString = parseString.Substring(2);
73 | }
74 | if (int.TryParse(parseString, System.Globalization.NumberStyles.HexNumber, System.Globalization.CultureInfo.InvariantCulture, out var result))
75 | {
76 | cVal = result;
77 | }
78 | UpdateColor(Color.FromArgb(0xFF, (byte)((cVal >> 16) & 0xFF), (byte)((cVal >> 8) & 0xFF), (byte)(cVal & 0xFF)), false, true);
79 | }
80 | }
81 | }
--------------------------------------------------------------------------------
/UI/Components/DASMElement/DASMElement.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/UI/Components/EditorElement/EditorElementBracketHighlighter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Media;
3 | using ICSharpCode.AvalonEdit.Document;
4 | using ICSharpCode.AvalonEdit.Rendering;
5 | using SPCode.Utils;
6 |
7 | namespace SPCode.UI.Components
8 | {
9 | public class BracketHighlightRenderer : IBackgroundRenderer
10 | {
11 | private BracketSearchResult result;
12 | private readonly Brush backgroundBrush = new SolidColorBrush(Color.FromArgb(0x40, 0x88, 0x88, 0x88));
13 | private readonly TextView textView;
14 |
15 | public void SetHighlight(BracketSearchResult result)
16 | {
17 | if (this.result != result)
18 | {
19 | this.result = result;
20 | textView.InvalidateLayer(Layer);
21 | }
22 | }
23 |
24 | public BracketHighlightRenderer(TextView textView)
25 | {
26 | this.textView = textView ?? throw new ArgumentNullException("textView");
27 |
28 | this.textView.BackgroundRenderers.Add(this);
29 | }
30 |
31 | public KnownLayer Layer => KnownLayer.Selection;
32 |
33 | public void Draw(TextView textView, DrawingContext drawingContext)
34 | {
35 | if (result == null)
36 | {
37 | return;
38 | }
39 |
40 | var builder = new BackgroundGeometryBuilder
41 | {
42 | CornerRadius = 1,
43 | AlignToWholePixels = true,
44 | BorderThickness = 0.0
45 | };
46 |
47 | builder.AddSegment(textView, new TextSegment() { StartOffset = result.OpeningBracketOffset, Length = result.OpeningBracketLength });
48 | builder.CloseFigure();
49 | builder.AddSegment(textView, new TextSegment() { StartOffset = result.ClosingBracketOffset, Length = result.ClosingBracketLength });
50 |
51 | var geometry = builder.CreateGeometry();
52 | if (geometry != null)
53 | {
54 | drawingContext.DrawGeometry(backgroundBrush, null, geometry);
55 | }
56 | }
57 | }
58 | }
--------------------------------------------------------------------------------
/UI/Components/EditorElement/Highlighting/BracketSearchResult.cs:
--------------------------------------------------------------------------------
1 | namespace SPCode.Utils
2 | {
3 | public class BracketSearchResult
4 | {
5 | public int OpeningBracketOffset { get; private set; }
6 |
7 | public int OpeningBracketLength { get; private set; }
8 |
9 | public int ClosingBracketOffset { get; private set; }
10 |
11 | public int ClosingBracketLength { get; private set; }
12 |
13 | public int DefinitionHeaderOffset { get; set; }
14 |
15 | public int DefinitionHeaderLength { get; set; }
16 |
17 | public BracketSearchResult(int openingBracketOffset, int openingBracketLength,
18 | int closingBracketOffset, int closingBracketLength)
19 | {
20 | OpeningBracketOffset = openingBracketOffset;
21 | OpeningBracketLength = openingBracketLength;
22 | ClosingBracketOffset = closingBracketOffset;
23 | ClosingBracketLength = closingBracketLength;
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/UI/Components/EditorElement/Highlighting/ColorizeSection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Media;
3 | using ICSharpCode.AvalonEdit.Document;
4 | using ICSharpCode.AvalonEdit.Rendering;
5 |
6 | namespace SPCode.UI.Components
7 | {
8 | public class ColorizeSelection : DocumentColorizingTransformer
9 | {
10 | public bool HighlightSelection;
11 | public string SelectionString = string.Empty;
12 |
13 | protected override void ColorizeLine(DocumentLine line)
14 | {
15 | if (HighlightSelection)
16 | {
17 | if (string.IsNullOrWhiteSpace(SelectionString))
18 | {
19 | return;
20 | }
21 |
22 | var lineStartOffset = line.Offset;
23 | var text = CurrentContext.Document.GetText(line);
24 | var start = 0;
25 | int index;
26 | while ((index = text.IndexOf(SelectionString, start, StringComparison.Ordinal)) >= 0)
27 | {
28 | ChangeLinePart(
29 | lineStartOffset + index,
30 | lineStartOffset + index + SelectionString.Length,
31 | element =>
32 | {
33 | element.BackgroundBrush = new SolidColorBrush(Color.FromArgb(80, 11, 95, 188));
34 | //element.TextRunProperties.SetForegroundBrush(new SolidColorBrush(Colors.White));
35 | });
36 | start = index + 1;
37 | }
38 | }
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/UI/Components/EditorElement/Indentation/EditorIndentation.cs:
--------------------------------------------------------------------------------
1 | using ICSharpCode.AvalonEdit.Document;
2 | using ICSharpCode.AvalonEdit.Indentation;
3 |
4 | namespace SPCode.UI.Components
5 | {
6 | public class EditorIndentationStrategy : IIndentationStrategy
7 | {
8 | public void IndentLine(TextDocument document, DocumentLine line)
9 | {
10 | if (document == null || line == null)
11 | {
12 | return;
13 | }
14 | var previousLine = line.PreviousLine;
15 | if (previousLine != null)
16 | {
17 | var indentationSegment = TextUtilities.GetWhitespaceAfter(document, previousLine.Offset);
18 | var indentation = document.GetText(indentationSegment);
19 | if (Program.OptionsObject.Editor_AgressiveIndentation)
20 | {
21 | var currentLineTextTrimmed = document.GetText(line).Trim();
22 | var lastLineTextTrimmed = document.GetText(previousLine).Trim();
23 | var currentLineFirstNonWhitespaceChar = ' ';
24 | if (currentLineTextTrimmed.Length > 0)
25 | {
26 | currentLineFirstNonWhitespaceChar = currentLineTextTrimmed[0];
27 | }
28 | var lastLineLastNonWhitespaceChar = ' ';
29 | if (lastLineTextTrimmed.Length > 0)
30 | {
31 | lastLineLastNonWhitespaceChar = lastLineTextTrimmed[lastLineTextTrimmed.Length - 1];
32 | }
33 | if (lastLineLastNonWhitespaceChar == '{' && currentLineFirstNonWhitespaceChar != '}')
34 | {
35 | indentation += Program.Indentation;
36 | }
37 | else if (currentLineFirstNonWhitespaceChar == '}')
38 | {
39 | if (indentation.Length > 0)
40 | {
41 | indentation = indentation.Substring(0, indentation.Length) + Program.Indentation + "\n" + indentation.Substring(0, indentation.Length);
42 | }
43 | else if (lastLineLastNonWhitespaceChar == '{')
44 | {
45 | indentation = Program.Indentation + "\n";
46 | }
47 | }
48 | }
49 | indentationSegment = TextUtilities.GetWhitespaceAfter(document, line.Offset);
50 | document.Replace(indentationSegment, indentation);
51 | }
52 | }
53 |
54 |
55 | public void IndentLines(TextDocument document, int beginLine, int endLine)
56 | { }
57 | }
58 | }
--------------------------------------------------------------------------------
/UI/Components/HotkeyEditorControl/HotkeyEditorControl.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/UI/Components/HotkeyEditorControl/HotkeyEditorControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using System.Windows;
3 | using System.Windows.Input;
4 | using SPCode.Utils;
5 |
6 | namespace SPCode.UI.Components
7 | {
8 | public partial class HotkeyEditorControl
9 | {
10 | public static readonly DependencyProperty HotkeyProperty =
11 | DependencyProperty.Register(nameof(Hotkey), typeof(Hotkey),
12 | typeof(HotkeyEditorControl),
13 | new FrameworkPropertyMetadata(default(Hotkey),
14 | FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
15 |
16 | private bool InputEnabled = true;
17 |
18 | public Hotkey Hotkey
19 | {
20 | get => (Hotkey)GetValue(HotkeyProperty);
21 | set => SetValue(HotkeyProperty, value);
22 | }
23 |
24 | public HotkeyEditorControl()
25 | {
26 | InitializeComponent();
27 | }
28 |
29 | private async void HotkeyTextBox_PreviewKeyDown(object sender, KeyEventArgs e)
30 | {
31 | // Don't let the event pass further
32 | // because we don't want standard textbox shortcuts working
33 | e.Handled = true;
34 |
35 | // Get modifiers and key data
36 | var key = e.Key;
37 | var modifiers = Keyboard.Modifiers;
38 |
39 | // When Alt is pressed, SystemKey is used instead
40 | if (key == Key.System)
41 | {
42 | key = e.SystemKey;
43 | }
44 |
45 | // Pressing delete, backspace or escape without modifiers clears the current value
46 | if (modifiers == ModifierKeys.None &&
47 | (key == Key.Delete || key == Key.Back || key == Key.Escape))
48 | {
49 | Hotkey = null;
50 | return;
51 | }
52 |
53 | if (HotkeyUtils.IsKeyModifier(key) || !InputEnabled)
54 | {
55 | return;
56 | }
57 |
58 | InputEnabled = false;
59 |
60 | // Update the value if it's not spamming the key
61 | if (!e.IsRepeat)
62 | {
63 | Hotkey = new Hotkey(key, modifiers);
64 | }
65 | await Task.Delay(500);
66 | InputEnabled = true;
67 | }
68 | }
69 | }
--------------------------------------------------------------------------------
/UI/Interop/LanguageChooserWindow.xaml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/UI/Interop/LanguageChooserWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Windows;
3 | using System.Windows.Controls;
4 | using MahApps.Metro.Controls;
5 |
6 | namespace SPCode.UI.Interop
7 | {
8 | public partial class LanguageChooserWindow : MetroWindow
9 | {
10 | public string SelectedID = string.Empty;
11 | public LanguageChooserWindow()
12 | {
13 | InitializeComponent();
14 | }
15 |
16 | public LanguageChooserWindow(List ids, List languages)
17 | {
18 | InitializeComponent();
19 |
20 | // Reorder English item to appear first
21 | languages.Remove("English");
22 | languages.Insert(0, "English");
23 | ids.Remove("default");
24 | ids.Insert(0, "default");
25 |
26 | for (var i = 0; i < ids.Count; i++)
27 | {
28 | LanguageBox.Items.Add(new ComboBoxItem
29 | {
30 | Content = languages[i],
31 | Tag = ids[i]
32 | });
33 | }
34 | if (ids.Count > 0)
35 | {
36 | LanguageBox.SelectedIndex = 0;
37 | }
38 | }
39 |
40 | private void Button_Click(object sender, RoutedEventArgs e)
41 | {
42 | if (LanguageBox.SelectedItem is ComboBoxItem selectedItem)
43 | {
44 | SelectedID = (string)selectedItem.Tag;
45 | }
46 | Close();
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/UI/MainWindow/MainWindowErrorStatus.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls.Primitives;
8 | using SPCode.Interop;
9 | using SPCode.Utils;
10 |
11 | namespace SPCode.UI
12 | {
13 | public partial class MainWindow
14 | {
15 | public bool HideErrors = false;
16 | public bool HideWarnings = false;
17 |
18 | private void Status_ErrorButton_Clicked(object sender, RoutedEventArgs e)
19 | {
20 | var isChecked = (sender as ToggleButton).IsChecked.Value;
21 | HideErrors = !isChecked;
22 | if (CurrentErrors.Count == 0 && CurrentWarnings.Count == 0)
23 | {
24 | return;
25 | }
26 |
27 | UpdateErrorGrid();
28 | }
29 |
30 | private void Status_WarningButton_Clicked(object sender, RoutedEventArgs e)
31 | {
32 | var isChecked = (sender as ToggleButton).IsChecked.Value;
33 | HideWarnings = !isChecked;
34 |
35 | if (CurrentErrors.Count == 0 && CurrentWarnings.Count == 0)
36 | {
37 | return;
38 | }
39 |
40 | UpdateErrorGrid();
41 | }
42 |
43 | private void Status_CopyErrorsButton_Click(object sender, RoutedEventArgs e)
44 | {
45 | if (!string.IsNullOrEmpty(CurrentErrorString))
46 | {
47 | Clipboard.SetText(CurrentErrorString);
48 | }
49 | }
50 |
51 | private void UpdateErrorGrid()
52 | {
53 | ErrorResultGrid.Items.Clear();
54 | var listBuffer = new List();
55 |
56 | if (!HideWarnings)
57 | {
58 | listBuffer.AddRange(CurrentWarnings);
59 | }
60 |
61 | if (!HideErrors)
62 | {
63 | listBuffer.AddRange(CurrentErrors);
64 | }
65 |
66 | listBuffer.OrderBy(x => int.Parse(x.Line)).ToList().ForEach(y => ErrorResultGrid.Items.Add(y));
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/UI/MainWindow/MainWindowLogBox.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 | using System.Windows.Controls;
3 | using System.Windows.Input;
4 |
5 | namespace SPCode.UI
6 | {
7 | public partial class MainWindow
8 | {
9 | private void LogTextbox_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
10 | {
11 | LogTextbox.ContextMenu = LogTextbox.Resources["LogContextMenu"] as ContextMenu;
12 | }
13 | private void ClearLogs_Click(object sender, RoutedEventArgs e)
14 | {
15 | LogTextbox.Clear();
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/UI/STheme/Brushes.xaml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
19 |
20 |
21 |
23 |
24 |
26 |
27 |
29 |
30 |
31 |
33 |
34 |
35 |
37 |
38 |
39 |
41 |
42 |
44 |
59 |
60 |
62 |
63 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/UI/STheme/Images/DockAnchorableBottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockAnchorableBottom.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockAnchorableLeft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockAnchorableLeft.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockAnchorableRight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockAnchorableRight.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockAnchorableTop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockAnchorableTop.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockDocumentAsAnchorableBottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockDocumentAsAnchorableBottom.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockDocumentAsAnchorableLeft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockDocumentAsAnchorableLeft.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockDocumentAsAnchorableRight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockDocumentAsAnchorableRight.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockDocumentAsAnchorableTop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockDocumentAsAnchorableTop.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockDocumentBottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockDocumentBottom.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockDocumentInside.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockDocumentInside.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockDocumentLeft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockDocumentLeft.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockDocumentRight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockDocumentRight.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockDocumentTop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockDocumentTop.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockPaneEmpty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockPaneEmpty.png
--------------------------------------------------------------------------------
/UI/STheme/Images/DockPaneLargeEmpty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/DockPaneLargeEmpty.png
--------------------------------------------------------------------------------
/UI/STheme/Images/HTabGroup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/HTabGroup.png
--------------------------------------------------------------------------------
/UI/STheme/Images/Locked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/Locked.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinAutoHide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinAutoHide.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinAutoHide_Black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinAutoHide_Black.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinAutoHide_Dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinAutoHide_Dark.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinClose.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinClose.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinClose_Black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinClose_Black.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinClose_Dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinClose_Dark.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinDocMenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinDocMenu.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinDocMenu_Black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinDocMenu_Black.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinMaximize.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinMaximize.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinMaximize_Black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinMaximize_Black.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinMaximize_Dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinMaximize_Dark.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinMenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinMenu.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinMenu_Black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinMenu_Black.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinMenu_Dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinMenu_Dark.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinRestore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinRestore.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinRestore_Black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinRestore_Black.png
--------------------------------------------------------------------------------
/UI/STheme/Images/PinRestore_Dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/PinRestore_Dark.png
--------------------------------------------------------------------------------
/UI/STheme/Images/VTabGroup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/UI/STheme/Images/VTabGroup.png
--------------------------------------------------------------------------------
/UI/STheme/SMetroTheme.cs:
--------------------------------------------------------------------------------
1 | /************************************************************************
2 |
3 | AvalonDock
4 |
5 | Copyright (C) 2007-2013 Xceed Software Inc.
6 |
7 | This program is provided to you under the terms of the New BSD
8 | License (BSD) as published at http://avalondock.codeplex.com/license
9 |
10 | For more features, controls, and fast professional support,
11 | pick up AvalonDock in Extended WPF Toolkit Plus at http://xceed.com/wpf_toolkit
12 |
13 | Stay informed: follow @datagrid on Twitter or Like facebook.com/datagrids
14 |
15 | **********************************************************************/
16 |
17 | using System;
18 | using Xceed.Wpf.AvalonDock.Themes;
19 |
20 | namespace SPCode.UI.STheme
21 | {
22 | public class SMetroTheme : Theme
23 | {
24 | public override Uri GetResourceUri()
25 | {
26 | return new Uri(
27 | "/SPCode;component/ui/stheme/stheme.xaml",
28 | UriKind.Relative);
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/UI/Windows/AboutWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.IO;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using System.Windows.Media;
6 | using System.Windows.Navigation;
7 | using MahApps.Metro;
8 | using SPCode.Utils;
9 | using static SPCode.Interop.TranslationProvider;
10 |
11 | namespace SPCode.UI.Windows
12 | {
13 | public partial class AboutWindow
14 | {
15 | public AboutWindow()
16 | {
17 | InitializeComponent();
18 | Language_Translate();
19 | EvaluateRTL();
20 | if (Program.OptionsObject.Program_AccentColor != "Red" || Program.OptionsObject.Program_Theme != "BaseDark")
21 | {
22 | ThemeManager.ChangeAppStyle(this, ThemeManager.GetAccent(Program.OptionsObject.Program_AccentColor),
23 | ThemeManager.GetAppTheme(Program.OptionsObject.Program_Theme));
24 | }
25 |
26 | Brush gridBrush = Program.OptionsObject.Program_Theme == "BaseDark" ?
27 | new SolidColorBrush(Color.FromArgb(0xC0, 0x10, 0x10, 0x10)) :
28 | new SolidColorBrush(Color.FromArgb(0xC0, 0xE0, 0xE0, 0xE0));
29 |
30 | gridBrush.Freeze();
31 |
32 | foreach (var c in ContentStackPanel.Children)
33 | {
34 | if (c is Grid g)
35 | {
36 | g.Background = gridBrush;
37 | }
38 | }
39 | TitleBox.Text = $"SPCode {NamesHelper.VersionString} - {Translate("SPCodeCap")}";
40 | if (File.Exists(Constants.LicenseFile))
41 | {
42 | FlyoutTextBox.Text = File.ReadAllText(Constants.LicenseFile);
43 | }
44 | }
45 |
46 | private void OpenLicenseFlyout(object sender, RoutedEventArgs e)
47 | {
48 | LicenseFlyout.IsOpen = true;
49 | }
50 |
51 | private void HyperlinkRequestNavigate(object sender, RequestNavigateEventArgs e)
52 | {
53 | Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
54 | e.Handled = true;
55 | }
56 |
57 | private void Language_Translate()
58 | {
59 | Title = Translate("About");
60 | OpenLicenseButton.Content = Translate("License");
61 | PeopleInvolvedBlock.Text = Translate("PeopleInv");
62 | }
63 |
64 | private void EvaluateRTL()
65 | {
66 | if (Program.IsRTL)
67 | {
68 | FlowDirection = FlowDirection.RightToLeft;
69 | }
70 | else
71 | {
72 | FlowDirection = FlowDirection.LeftToRight;
73 | }
74 | }
75 | }
76 | }
--------------------------------------------------------------------------------
/UI/Windows/ConfigWindow/ConfigWindowConfigsManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 |
8 | namespace SPCode.UI.Windows
9 | {
10 | public partial class ConfigWindow
11 | {
12 | private void BackupConfigsButton_Click(object sender, RoutedEventArgs e)
13 | {
14 |
15 | }
16 |
17 | private void LoadConfigsButton_Click(object sender, RoutedEventArgs e)
18 | {
19 |
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/UI/Windows/NewFileWindow.xaml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
61 |
62 |
63 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/UI/Windows/RenameWindow.xaml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/UI/Windows/SPDefinitionWindow.xaml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Utils/Constants.cs:
--------------------------------------------------------------------------------
1 | namespace SPCode.Utils
2 | {
3 | public static class Constants
4 | {
5 | #region GitHub
6 | public const string GitHubRepository = "https://github.com/SPCodeOrg/SPCode";
7 | public const string GitHubNewIssueLink = "https://github.com/SPCodeOrg/SPCode/issues/new";
8 | public const string GitHubReleases = "https://github.com/SPCodeOrg/SPCode/releases";
9 | public const string GitHubLatestRelease = "https://github.com/SPCodeOrg/SPCode/releases/latest";
10 | public const string GitHubWiki = "https://github.com/SPCodeOrg/SPCode/wiki";
11 | public const string OrgName = "SPCodeOrg";
12 | public const string MainRepoName = "SPCode";
13 | public const string TranslationsRepoName = "spcode-translations";
14 | public const string ProductHeaderValueName = "spcode-client";
15 | #endregion
16 |
17 | #region Icons
18 | public const string FolderIcon = "icon-folder.png";
19 | public const string IncludeIcon = "icon-include.png";
20 | public const string PluginIcon = "icon-plugin.png";
21 | public const string TxtIcon = "icon-txt.png";
22 | public const string SmxIcon = "icon-smx.png";
23 | public const string EmptyIcon = "empty-box.png";
24 | #endregion
25 |
26 | #region Files
27 | public const string HotkeysFile = "Hotkeys.xml";
28 | public const string LicenseFile = "License.txt";
29 | public const string LanguagesFile = "lang_0_spcode.xml";
30 | public const string DefaultTranslationsFile = "default.xml";
31 | public const string SPCompiler = "spcomp.exe";
32 | #endregion
33 |
34 | #region Filters
35 | public const string ErrorFilterRegex = @"^(?.+?)\((?[0-9]+(\s*--\s*[0-9]+)?)\)\s*:\s*(?[a-zA-Z]+\s+([a-zA-Z]+\s+)?[0-9]+)\s*:(?.+)";
36 | public const string FileSaveFilters = @"Sourcepawn Files (*.sp *.inc)|*.sp;*.inc|All Files (*.*)|*.*";
37 | public const string FileOpenFilters = @"Sourcepawn Files (*.sp *.inc)|*.sp;*.inc|Sourcemod Plugins (*.smx)|*.smx|All Files (*.*)|*.*";
38 | public const string DecompileFileFilters = "Sourcepawn Plugins (*.smx)|*.smx";
39 | public const string DatFilesFilter = "Dat files (.dat)|*.dat";
40 | public const string ServerExecutableFilter = "Executables *.exe|*.exe|All Files *.*|*.*";
41 | #endregion
42 |
43 | #region Other
44 | public const string GetSPCodeText = "Get SPCode";
45 | public const string DiscordRPCAppID = "692110664948514836";
46 | public const string DefaultLanguageID = "default";
47 | #endregion
48 | }
49 | }
--------------------------------------------------------------------------------
/Utils/DecompileUtil.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Text;
5 | using Microsoft.Win32;
6 | using static SPCode.Interop.TranslationProvider;
7 |
8 | namespace SPCode.Utils
9 | {
10 | public static class DecompileUtil
11 | {
12 | public static FileInfo GetFile()
13 | {
14 | string fileToDecompile;
15 |
16 | var ofd = new OpenFileDialog
17 | {
18 | Filter = Constants.DecompileFileFilters,
19 | Title = Translate("ChDecomp")
20 | };
21 | var result = ofd.ShowDialog();
22 | fileToDecompile = result.Value && !string.IsNullOrWhiteSpace(ofd.FileName) ? ofd.FileName : null;
23 |
24 | if (fileToDecompile == null)
25 | {
26 | return null;
27 | }
28 | return new FileInfo(fileToDecompile);
29 | }
30 |
31 | public static string GetDecompiledPlugin(FileInfo file)
32 | {
33 | var decompilerPath = PathsHelper.LysisDirectory;
34 | var destFile = file.FullName + ".sp";
35 | var standardOutput = new StringBuilder();
36 | using var process = new Process();
37 | var si = new ProcessStartInfo
38 | {
39 | WorkingDirectory = decompilerPath,
40 | UseShellExecute = false,
41 | RedirectStandardOutput = true,
42 | RedirectStandardError = true,
43 | CreateNoWindow = true,
44 | FileName = "cmd.exe",
45 | Arguments = $"/c LysisDecompiler.exe \"{file.FullName}\"",
46 | };
47 | process.StartInfo = si;
48 |
49 | if (File.Exists(destFile))
50 | {
51 | File.Delete(destFile);
52 | }
53 |
54 | try
55 | {
56 | process.Start();
57 | standardOutput.Append(process.StandardOutput.ReadToEnd());
58 | File.WriteAllText(destFile, standardOutput.ToString(), Encoding.UTF8);
59 | }
60 | catch (Exception)
61 | {
62 | throw;
63 | }
64 |
65 | return destFile;
66 | }
67 | }
68 | }
--------------------------------------------------------------------------------
/Utils/DirHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Reflection;
4 |
5 | namespace SPCode.Utils;
6 |
7 | public static class DirHelper
8 | {
9 | public static void ClearSPCodeTempFolder()
10 | {
11 | var tempDir = PathsHelper.TempDirectory;
12 | foreach (var file in Directory.GetFiles(tempDir))
13 | {
14 | File.Delete(file);
15 | }
16 | foreach (var dir in Directory.GetDirectories(tempDir))
17 | {
18 | Directory.Delete(dir, true);
19 | }
20 | }
21 |
22 | public static bool CanAccess(string path)
23 | {
24 | try
25 | {
26 | Directory.GetAccessControl(path);
27 | }
28 | catch (UnauthorizedAccessException)
29 | {
30 | return false;
31 | }
32 | return true;
33 | }
34 |
35 | public static bool CanAccess(DirectoryInfo dir)
36 | {
37 | try
38 | {
39 | dir.GetAccessControl();
40 | }
41 | catch (UnauthorizedAccessException)
42 | {
43 | return false;
44 | }
45 | return true;
46 | }
47 |
48 | public static bool HasValidTextExtension(FileInfo file)
49 | {
50 | return file.Extension
51 | is ".sp"
52 | or ".inc"
53 | or ".txt"
54 | or ".cfg"
55 | or ".ini";
56 | }
57 |
58 | public static bool IsBinary(FileInfo file) => file.Extension is ".smx";
59 | }
60 |
--------------------------------------------------------------------------------
/Utils/HotkeyUtils.cs:
--------------------------------------------------------------------------------
1 | using System.Windows.Input;
2 |
3 | namespace SPCode.Utils
4 | {
5 | public class HotkeyUtils
6 | {
7 | public static bool IsKeyModifier(Key key)
8 | {
9 | return key is
10 | Key.LeftCtrl or
11 | Key.RightCtrl or
12 | Key.LeftAlt or
13 | Key.RightAlt or
14 | Key.LeftShift or
15 | Key.RightShift or
16 | Key.LWin or
17 | Key.RWin or
18 | Key.Clear or
19 | Key.OemClear or
20 | Key.Apps;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/Utils/Models/ComboboxItem.cs:
--------------------------------------------------------------------------------
1 | namespace SPCode.Utils.Models
2 | {
3 | public class ComboboxItem
4 | {
5 | public string Text { get; set; }
6 | public string Value { get; set; }
7 |
8 | public override string ToString()
9 | {
10 | return Text;
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Utils/Models/Config.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using SourcepawnCondenser.SourcemodDefinition;
5 |
6 | namespace SPCode.Utils
7 | {
8 | public class Config : ICloneable
9 | {
10 | public bool AutoCopy;
11 | public bool AutoUpload;
12 | public bool AutoRCON;
13 | public string CopyDirectory = string.Empty;
14 | public bool DeleteAfterCopy;
15 | public string FTPDir = string.Empty;
16 | public string FTPHost = "ftp://localhost/";
17 | public string FTPPassword = string.Empty;
18 | public string FTPUser = string.Empty;
19 | public string Name = string.Empty;
20 | public int OptimizeLevel = 2;
21 | public string PostCmd = string.Empty;
22 | public string PreCmd = string.Empty;
23 | public string RConCommands = string.Empty;
24 | public string RConIP = "127.0.0.1";
25 | public string RConPassword = string.Empty;
26 | public ushort RConPort = 27015;
27 | public string ServerArgs = string.Empty;
28 | public string ServerFile = string.Empty;
29 |
30 | private SMDefinition SMDef;
31 |
32 | public List SMDirectories;
33 | public List RejectedPaths = new();
34 |
35 | public bool Standard;
36 | public int VerboseLevel = 1;
37 |
38 | public SMDefinition GetSMDef()
39 | {
40 | if (SMDef == null)
41 | {
42 | LoadSMDef();
43 | }
44 |
45 | return SMDef;
46 | }
47 |
48 | public void InvalidateSMDef()
49 | {
50 | SMDef = null;
51 | }
52 |
53 | public void LoadSMDef()
54 | {
55 | if (SMDef != null)
56 | {
57 | return;
58 | }
59 |
60 | try
61 | {
62 | var def = new SMDefinition();
63 | def.AppendFiles(SMDirectories, out var rejectedPaths);
64 |
65 | RejectedPaths.Clear();
66 |
67 | if (rejectedPaths.Any())
68 | {
69 | rejectedPaths.ForEach(x => RejectedPaths.Add(x));
70 | }
71 |
72 | SMDef = def;
73 | }
74 | catch (Exception)
75 | {
76 | SMDef = new SMDefinition();
77 | }
78 | }
79 |
80 | public object Clone()
81 | {
82 | return new Config
83 | {
84 | AutoCopy = AutoCopy,
85 | AutoUpload = AutoUpload,
86 | AutoRCON = AutoRCON,
87 | CopyDirectory = CopyDirectory,
88 | DeleteAfterCopy = DeleteAfterCopy,
89 | FTPDir = FTPDir,
90 | FTPHost = FTPHost,
91 | FTPPassword = FTPPassword,
92 | FTPUser = FTPUser,
93 | Name = Name,
94 | OptimizeLevel = OptimizeLevel,
95 | PostCmd = PostCmd,
96 | PreCmd = PreCmd,
97 | RConCommands = RConCommands,
98 | RConIP = RConIP,
99 | RConPort = RConPort,
100 | RConPassword = RConPassword,
101 | ServerArgs = ServerArgs,
102 | ServerFile = ServerFile,
103 | SMDef = SMDef,
104 | SMDirectories = new(SMDirectories),
105 | RejectedPaths = new(RejectedPaths),
106 | Standard = Standard,
107 | VerboseLevel = VerboseLevel
108 | };
109 | }
110 | }
111 | }
--------------------------------------------------------------------------------
/Utils/Models/ErrorDataGridRow.cs:
--------------------------------------------------------------------------------
1 | using System.Text.RegularExpressions;
2 |
3 | namespace SPCode.Utils
4 | {
5 | public class ErrorDataGridRow
6 | {
7 | public bool IsError => Type.Contains("error");
8 | public bool IsWarning => Type.Contains("warning");
9 |
10 | public string File { get; }
11 | public string Line { get; }
12 | public string Type { get; }
13 | public string Details { get; }
14 |
15 | public ErrorDataGridRow(Match match)
16 | {
17 | File = match.Groups["File"].Value.Trim();
18 | Line = match.Groups["Line"].Value.Trim();
19 | Type = match.Groups["Type"].Value.Trim();
20 | Details = match.Groups["Details"].Value.Trim();
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/Utils/Models/FTP.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Net;
4 | using System.Threading.Tasks;
5 | using Renci.SshNet;
6 | using Renci.SshNet.Common;
7 | using static SPCode.Interop.TranslationProvider;
8 |
9 | namespace SPCode.Utils
10 | {
11 | public class FTP
12 | {
13 | private readonly string _host;
14 | private readonly string _user;
15 | private readonly string _pass;
16 |
17 | public string ErrorMessage;
18 |
19 | public FTP(string host, string user, string password) { _host = host; _user = user; _pass = password; }
20 |
21 | public void Upload(string remoteFile, string localFile)
22 | {
23 | var requestUri = new UriBuilder(_host) { Path = remoteFile }.Uri;
24 |
25 | if (requestUri.Scheme == "sftp")
26 | {
27 | var connectionInfo = new ConnectionInfo(requestUri.Host, requestUri.Port == -1 ? 22 : requestUri.Port, _user, new PasswordAuthenticationMethod(_user, _pass));
28 | using var sftp = new SftpClient(connectionInfo);
29 | sftp.Connect();
30 |
31 | using (var stream = File.OpenRead(localFile))
32 | {
33 | sftp.UploadFile(stream, remoteFile, true);
34 | }
35 |
36 | sftp.Disconnect();
37 | }
38 | else
39 | {
40 | using var client = new WebClient
41 | {
42 | Credentials = new NetworkCredential(_user, _pass)
43 | };
44 | client.UploadFile(requestUri, WebRequestMethods.Ftp.UploadFile, localFile);
45 | }
46 | }
47 |
48 | ///
49 | /// Returns whether the specified credentials in the Configs Window can be used for a valid FTP/SFTP connection.
50 | ///
51 | public async Task TestConnection()
52 | {
53 | var requestUri = new UriBuilder(_host).Uri;
54 | var success = true;
55 | if (requestUri.Scheme == "sftp")
56 | {
57 | var connectionInfo = new ConnectionInfo(requestUri.Host, requestUri.Port == -1 ? 22 : requestUri.Port, _user, new PasswordAuthenticationMethod(_user, _pass));
58 | using var sftp = new SftpClient(connectionInfo);
59 | sftp.OperationTimeout = TimeSpan.FromSeconds(5);
60 | try
61 | {
62 | await Task.Run(() => sftp.Connect());
63 | }
64 | catch (SshAuthenticationException)
65 | {
66 | success = false;
67 | ErrorMessage = Translate("InvalidCredentials");
68 | }
69 | catch (Exception ex)
70 | {
71 | success = false;
72 | ErrorMessage = ex.Message;
73 | }
74 | finally
75 | {
76 | sftp.Disconnect();
77 | sftp.Dispose();
78 | }
79 | }
80 | else if (requestUri.Scheme == "ftp")
81 | {
82 | var requestDir = WebRequest.Create(requestUri);
83 | requestDir.Credentials = new NetworkCredential(_user, _pass);
84 | requestDir.Timeout = 5000;
85 | try
86 | {
87 | var response = await requestDir.GetResponseAsync();
88 | }
89 | catch (Exception ex)
90 | {
91 | success = false;
92 | ErrorMessage = ex.Message;
93 | }
94 | }
95 | else
96 | {
97 | success = false;
98 | ErrorMessage = Translate("InvalidFTPSchema");
99 | }
100 | return success;
101 | }
102 | }
103 | }
--------------------------------------------------------------------------------
/Utils/Models/Hotkey.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 | using System.Windows.Input;
4 |
5 | namespace SPCode.Utils
6 | {
7 | public class Hotkey
8 | {
9 | public Key Key { get; }
10 | public ModifierKeys Modifiers { get; }
11 |
12 | public Hotkey(Key key, ModifierKeys modifiers)
13 | {
14 | Key = key;
15 | Modifiers = modifiers;
16 | }
17 |
18 | public Hotkey(string keys)
19 | {
20 | foreach (var key in keys.Split('+'))
21 | {
22 | if (Enum.TryParse(key, out Key parsedKey))
23 | {
24 | Key = parsedKey;
25 | }
26 | var newKey = key == "Ctrl" ? "Control" : key;
27 | if (Enum.TryParse(newKey, out ModifierKeys parsedModifiers))
28 | {
29 | Modifiers |= parsedModifiers;
30 | }
31 | }
32 | }
33 |
34 | public override string ToString()
35 | {
36 | var str = new StringBuilder();
37 |
38 | if (Modifiers.HasFlag(ModifierKeys.Control))
39 | {
40 | str.Append("Ctrl+");
41 | }
42 |
43 | if (Modifiers.HasFlag(ModifierKeys.Shift))
44 | {
45 | str.Append("Shift+");
46 | }
47 |
48 | if (Modifiers.HasFlag(ModifierKeys.Alt))
49 | {
50 | str.Append("Alt+");
51 | }
52 |
53 | if (Modifiers.HasFlag(ModifierKeys.Windows))
54 | {
55 | str.Append("Win+");
56 | }
57 |
58 | str.Append(Key);
59 |
60 | return str.ToString();
61 | }
62 | }
63 | }
--------------------------------------------------------------------------------
/Utils/Models/HotkeyInfo.cs:
--------------------------------------------------------------------------------
1 | namespace SPCode.Utils
2 | {
3 | public class HotkeyInfo
4 | {
5 | public Hotkey Hotkey { get; set; }
6 | public string Command { get; set; }
7 |
8 | public HotkeyInfo(Hotkey hk, string command)
9 | {
10 | Hotkey = hk;
11 | Command = command;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/Utils/Models/TemplateInfo.cs:
--------------------------------------------------------------------------------
1 | namespace SPCode.Utils
2 | {
3 | public class TemplateInfo
4 | {
5 | public string FileName;
6 | public string Name;
7 | public string NewName;
8 | public string Path;
9 | }
10 | }
--------------------------------------------------------------------------------
/Utils/NamesHelper.cs:
--------------------------------------------------------------------------------
1 | namespace SPCode.Utils
2 | {
3 | public static class NamesHelper
4 | {
5 | #if BETA
6 | public static bool Beta = true;
7 | #else
8 | public static bool Beta = false;
9 | #endif
10 | public static string ProgramPublicName => Beta ? $"SPCode Beta (rev.{VersionHelper.GetRevisionNumber()})" : "SPCode";
11 | public static string PipeServerName => Beta ? "SPCodeBetaNamedPipeServer" : "SPCodeNamedPipeServer";
12 | public static string MutexName => Beta ? "SPCodeGlobalMutex" : "SPCodeGlobalMutexBeta";
13 | public static string VersionString => Beta ? VersionHelper.GetAssemblyInformationalVersion() : VersionHelper.GetAssemblyVersion().ToString();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Utils/ObjectBrowserUtils.cs:
--------------------------------------------------------------------------------
1 | namespace SPCode.Utils
2 | {
3 | public class ObjectBrowserTag
4 | {
5 | public ObjectBrowserItemKind Kind;
6 | public string? Value;
7 | }
8 |
9 | public enum ObjectBrowserItemKind
10 | {
11 | ParentDirectory,
12 | Directory,
13 | File,
14 | Empty
15 | }
16 | }
--------------------------------------------------------------------------------
/Utils/PathsHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace SPCode.Utils
5 | {
6 | public static class PathsHelper
7 | {
8 | #if BETA
9 | private static readonly string SPCodeAppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\spcodebeta";
10 | #else
11 | private static readonly string SPCodeAppDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\spcode";
12 | #endif
13 | public static readonly bool LocalInstallation = Directory.Exists(".\\sourcepawn");
14 |
15 | public static string ConfigsDirectory
16 | {
17 | get
18 | {
19 | var appDataPath = SPCodeAppDataPath + @"\sourcepawn\configs\sm_1_10_0_6509";
20 | var localPath = @".\sourcepawn\configs\sm_1_10_0_6509";
21 | return LocalInstallation ? localPath : appDataPath;
22 | }
23 | }
24 |
25 | public static string LysisDirectory
26 | {
27 | get
28 | {
29 | var appDataPath = SPCodeAppDataPath + @"\lysis";
30 | var localPath = @".\lysis";
31 | return LocalInstallation ? localPath : appDataPath;
32 | }
33 | }
34 |
35 | public static string CrashLogDirectory
36 | {
37 | get
38 | {
39 | var appDataPath = SPCodeAppDataPath + @"\crashlogs";
40 | var localPath = @".\crashlogs";
41 | if (LocalInstallation && !Directory.Exists(localPath))
42 | {
43 | Directory.CreateDirectory(localPath);
44 | return localPath;
45 | }
46 | return LocalInstallation ? localPath : appDataPath;
47 | }
48 | }
49 |
50 | public static string TempDirectory
51 | {
52 | get
53 | {
54 | var appDataPath = SPCodeAppDataPath + @"\sourcepawn\temp";
55 | var localPath = @".\sourcepawn\temp";
56 | return LocalInstallation ? localPath : appDataPath;
57 | }
58 | }
59 |
60 | public static string TemplatesDirectory
61 | {
62 | get
63 | {
64 | var appDataPath = SPCodeAppDataPath + @"\sourcepawn\templates";
65 | var localPath = @".\sourcepawn\templates";
66 | return LocalInstallation ? localPath : appDataPath;
67 | }
68 | }
69 |
70 | public static string TranslationsDirectory
71 | {
72 | get
73 | {
74 | var appDataPath = SPCodeAppDataPath + @"\translations";
75 | var localPath = @".\translations";
76 | return LocalInstallation ? localPath : appDataPath;
77 | }
78 | }
79 |
80 | public static string ConfigFilePath
81 | {
82 | get
83 | {
84 | var appDataPath = SPCodeAppDataPath + @"\sourcepawn\configs\Configs.xml";
85 | var localPath = @".\sourcepawn\configs\Configs.xml";
86 | return LocalInstallation ? localPath : appDataPath;
87 | }
88 | }
89 |
90 | public static string TemplatesFilePath
91 | {
92 | get
93 | {
94 | var appDataPath = SPCodeAppDataPath + @"\sourcepawn\templates\Templates.xml";
95 | var localPath = @".\sourcepawn\templates\Templates.xml";
96 | return LocalInstallation ? localPath : appDataPath;
97 | }
98 | }
99 |
100 | public static string OptionsFilePath
101 | {
102 | get
103 | {
104 | var appDataPath = SPCodeAppDataPath + @"\options_0.dat";
105 | var localPath = @".\options_0.dat";
106 | return LocalInstallation ? localPath : appDataPath;
107 | }
108 | }
109 | }
110 | }
--------------------------------------------------------------------------------
/Utils/RegexKeywordsHelper.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using System.Text;
4 | using System.Text.RegularExpressions;
5 |
6 | namespace SPCode.Utils
7 | {
8 | public static class RegexKeywordsHelper
9 | {
10 | ///
11 | /// Converts a string list a regexp matching all the given word.
12 | ///
13 | /// The words list
14 | ///
15 | public static Regex GetRegexFromKeywords(string[] keywords)
16 | {
17 | if (keywords.Length == 0)
18 | {
19 | return new Regex("SPEdit_Error"); //We must not return regex that matches any string
20 | }
21 |
22 | return new Regex(
23 | @$"\b({string.Join("|", keywords)})\b",
24 | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture);
25 | }
26 |
27 | public static Regex GetRegexFromKeywords(List keywords)
28 | {
29 | if (keywords.Count == 0)
30 | {
31 | return new Regex("SPEdit_Error"); //We must not return regex that matches any string
32 | }
33 |
34 | return new Regex(
35 | @$"\b({string.Join("|", keywords.Select(Regex.Escape))})\b",
36 | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture);
37 | }
38 |
39 |
40 | ///
41 | /// Used the match function class like "PrintToChat(...)"
42 | ///
43 | public static Regex GetFunctionRegex(string[] keywords)
44 | {
45 | if (keywords.Length == 0)
46 | {
47 | return new Regex("SPEdit_Error"); //We must not return regex that matches any string
48 | }
49 |
50 | return new Regex(
51 | @$"\b(?
56 | /// Used the match method class like "myArr.Push"
57 | ///
58 | public static Regex GetMethodRegex(List keywords)
59 | {
60 | if (keywords.Count == 0)
61 | {
62 | return new Regex("SPEdit_Error"); //We must not return regex that matches any string
63 | }
64 |
65 | return new Regex(
66 | @$"\b(?<=[^\s]+\.)({string.Join("|", keywords.Select(Regex.Escape))})\b",
67 | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture);
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/Utils/VersionHelper.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Reflection;
4 | using System.Text.RegularExpressions;
5 |
6 | namespace SPCode.Utils
7 | {
8 | public static class VersionHelper
9 | {
10 | public static Version GetAssemblyVersion()
11 | {
12 | return Assembly.GetEntryAssembly()?.GetName().Version;
13 | }
14 |
15 | public static string GetAssemblyInformationalVersion()
16 | {
17 | return ((AssemblyInformationalVersionAttribute)Assembly.GetExecutingAssembly()
18 | .GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false)
19 | .FirstOrDefault()).InformationalVersion;
20 | }
21 |
22 | public static int GetRevisionNumber()
23 | {
24 | var revRegex = new Regex("(?<=beta)[0-9]*");
25 | var attribute = (AssemblyInformationalVersionAttribute)Assembly.GetExecutingAssembly()
26 | .GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false).FirstOrDefault();
27 | if (!revRegex.IsMatch(attribute.InformationalVersion))
28 | {
29 | throw new Exception("No match found for specified informational version.");
30 | }
31 | return int.Parse(revRegex.Match(attribute.InformationalVersion).ToString());
32 | }
33 |
34 | public static int GetRevisionNumber(string informationalVersion)
35 | {
36 | var revRegex = new Regex("(?<=beta)[0-9]*");
37 | if (!revRegex.IsMatch(informationalVersion))
38 | {
39 | throw new Exception("No match found for specified informational version.");
40 | }
41 | return int.Parse(revRegex.Match(informationalVersion).ToString());
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/ValveQuery/ValveQuery.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SPCodeOrg/SPCode/a4fcb3df669ac96538b88cd7908e6c3d89294bd9/ValveQuery/ValveQuery.dll
--------------------------------------------------------------------------------
/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------