diff --git a/README.md b/README.md new file mode 100644 index 0000000..20c7852 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# SubnauticaModSystem + +Change AutosortLockers to get all category and techtype information from json files. diff --git a/SubnauticaModSystem/AutosortLockers/.gitattributes b/SubnauticaModSystem/AutosortLockers/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/SubnauticaModSystem/AutosortLockers/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/SubnauticaModSystem/AutosortLockers/.gitignore b/SubnauticaModSystem/AutosortLockers/.gitignore new file mode 100644 index 0000000..9491a2f --- /dev/null +++ b/SubnauticaModSystem/AutosortLockers/.gitignore @@ -0,0 +1,363 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/Assets/Copy_Colors.bat b/SubnauticaModSystem/AutosortLockers/Assets/Copy_Colors.bat new file mode 100644 index 0000000..2ff1a47 --- /dev/null +++ b/SubnauticaModSystem/AutosortLockers/Assets/Copy_Colors.bat @@ -0,0 +1,2 @@ +xcopy /y /u colors.json D:\SteamLibrary\steamapps\common\Subnautica\QMods\AutosortLockersSML\Assets\colors.json +xcopy /y /u colors.json D:\SteamLibrary\steamapps\common\SubnauticaZero\QMods\AutosortLockersSML\Assets\colors.json \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/Assets/LockerScreen-old.png b/SubnauticaModSystem/AutosortLockers/Assets/LockerScreen-old.png new file mode 100644 index 0000000..08d9b34 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/Assets/LockerScreen-old.png differ diff --git a/SubnauticaModSystem/AutosortLockers/Assets/LockerScreen1.png b/SubnauticaModSystem/AutosortLockers/Assets/LockerScreen1.png new file mode 100644 index 0000000..594590e Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/Assets/LockerScreen1.png differ diff --git a/SubnauticaModSystem/AutosortLockers/Assets/colors - Copy.json b/SubnauticaModSystem/AutosortLockers/Assets/colors - Copy.json new file mode 100644 index 0000000..4474a7c --- /dev/null +++ b/SubnauticaModSystem/AutosortLockers/Assets/colors - Copy.json @@ -0,0 +1,704 @@ +[ + { + "r": 1.0, + "g": 1.0, + "b": 1.0, + "a": 1.0 + }, + { + "r": 0.827451, + "g": 1.0, + "b": 0.992156863, + "a": 1.0 + }, + { + "r": 0.6862745, + "g": 0.933333337, + "b": 0.933333337, + "a": 1.0 + }, + { + "r": 0.870588243, + "g": 0.721568644, + "b": 0.5294118, + "a": 1.0 + }, + { + "r": 0.8235294, + "g": 0.7058824, + "b": 0.549019635, + "a": 1.0 + }, + { + "r": 0.8039216, + "g": 0.360784322, + "b": 0.360784322, + "a": 1.0 + }, + { + "r": 0.9411765, + "g": 0.5019608, + "b": 0.5019608, + "a": 1.0 + }, + { + "r": 0.980392158, + "g": 0.5019608, + "b": 0.447058827, + "a": 1.0 + }, + { + "r": 0.9137255, + "g": 0.5882353, + "b": 0.478431374, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.627451, + "b": 0.478431374, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.498039216, + "b": 0.3137255, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.3882353, + "b": 0.2784314, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.270588249, + "b": 0.0, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.549019635, + "b": 0.0, + "a": 1.0 + }, + { + "r": 0.866666734, + "g": 0.196078449, + "b": 0.1254902, + "a": 1.0 + }, + { + "r": 0.8627451, + "g": 0.0784313753, + "b": 0.235294119, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.0, + "b": 0.0, + "a": 1.0 + }, + { + "r": 0.698039234, + "g": 0.13333334, + "b": 0.13333334, + "a": 1.0 + }, + { + "r": 0.545098066, + "g": 0.0, + "b": 0.0, + "a": 1.0 + }, + { + "r": 0.647058845, + "g": 0.164705887, + "b": 0.164705887, + "a": 1.0 + }, + { + "r": 0.5019608, + "g": 0.0, + "b": 0.0, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.7137255, + "b": 0.75686276, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.4117647, + "b": 0.7058824, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.0784313753, + "b": 0.5764706, + "a": 1.0 + }, + { + "r": 0.78039217, + "g": 0.08235294, + "b": 0.521568656, + "a": 1.0 + }, + { + "r": 0.858823538, + "g": 0.4392157, + "b": 0.5764706, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.627451, + "b": 0.478431374, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.647058845, + "b": 0.0, + "a": 1.0 + }, + { + "r": 0.9568628, + "g": 0.764705956, + "b": 0.0, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.843137264, + "b": 0.0, + "a": 1.0 + }, + { + "r": 1.0, + "g": 1.0, + "b": 0.0, + "a": 1.0 + }, + { + "r": 0.933333337, + "g": 0.9098039, + "b": 0.6666667, + "a": 1.0 + }, + { + "r": 0.9411765, + "g": 0.9019608, + "b": 0.549019635, + "a": 1.0 + }, + { + "r": 0.7411765, + "g": 0.7176471, + "b": 0.419607848, + "a": 1.0 + }, + { + "r": 0.9019608, + "g": 0.9019608, + "b": 0.980392158, + "a": 1.0 + }, + { + "r": 0.847058833, + "g": 0.7490196, + "b": 0.847058833, + "a": 1.0 + }, + { + "r": 0.8666667, + "g": 0.627451, + "b": 0.8666667, + "a": 1.0 + }, + { + "r": 0.933333337, + "g": 0.509803951, + "b": 0.933333337, + "a": 1.0 + }, + { + "r": 0.854901969, + "g": 0.4392157, + "b": 0.8392157, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.0, + "b": 1.0, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.0, + "b": 1.0, + "a": 1.0 + }, + { + "r": 0.7294118, + "g": 0.333333343, + "b": 0.827451, + "a": 1.0 + }, + { + "r": 0.5764706, + "g": 0.4392157, + "b": 0.858823538, + "a": 1.0 + }, + { + "r": 0.5411765, + "g": 0.168627456, + "b": 0.8862745, + "a": 1.0 + }, + { + "r": 0.6, + "g": 0.196078435, + "b": 0.8, + "a": 1.0 + }, + { + "r": 0.509803951, + "g": 0.0156862754, + "b": 0.9333334, + "a": 1.0 + }, + { + "r": 0.5803922, + "g": 0.0, + "b": 0.827451, + "a": 1.0 + }, + { + "r": 0.117647059, + "g": 0.5647059, + "b": 1.0, + "a": 1.0 + }, + { + "r": 0.4, + "g": 0.2, + "b": 0.6, + "a": 1.0 + }, + { + "r": 0.254901975, + "g": 0.4117647, + "b": 0.882352948, + "a": 1.0 + }, + { + "r": 0.545098066, + "g": 0.0, + "b": 0.545098066, + "a": 1.0 + }, + { + "r": 0.5019608, + "g": 0.0, + "b": 0.5019608, + "a": 1.0 + }, + { + "r": 0.294117659, + "g": 0.0, + "b": 0.509803951, + "a": 1.0 + }, + { + "r": 0.41568628, + "g": 0.3529412, + "b": 0.8039216, + "a": 1.0 + }, + { + "r": 0.282352954, + "g": 0.239215687, + "b": 0.545098066, + "a": 1.0 + }, + { + "r": 0.482352942, + "g": 0.407843143, + "b": 0.933333337, + "a": 1.0 + }, + { + "r": 0.6784314, + "g": 1.0, + "b": 0.184313729, + "a": 1.0 + }, + { + "r": 0.498039216, + "g": 1.0, + "b": 0.0, + "a": 1.0 + }, + { + "r": 0.4862745, + "g": 0.9882353, + "b": 0.0, + "a": 1.0 + }, + { + "r": 0.0, + "g": 1.0, + "b": 0.0, + "a": 1.0 + }, + { + "r": 0.2784314, + "g": 0.850980461, + "b": 0.0, + "a": 1.0 + }, + { + "r": 0.196078435, + "g": 0.8039216, + "b": 0.196078435, + "a": 1.0 + }, + { + "r": 0.596078455, + "g": 0.9843137, + "b": 0.596078455, + "a": 1.0 + }, + { + "r": 0.5647059, + "g": 0.933333337, + "b": 0.5647059, + "a": 1.0 + }, + { + "r": 0.0, + "g": 0.980392158, + "b": 0.6039216, + "a": 1.0 + }, + { + "r": 0.0, + "g": 1.0, + "b": 0.498039216, + "a": 1.0 + }, + { + "r": 0.235294119, + "g": 0.7019608, + "b": 0.443137258, + "a": 1.0 + }, + { + "r": 0.180392161, + "g": 0.545098066, + "b": 0.34117648, + "a": 1.0 + }, + { + "r": 0.13333334, + "g": 0.545098066, + "b": 0.13333334, + "a": 1.0 + }, + { + "r": 0.0, + "g": 0.5019608, + "b": 0.0, + "a": 1.0 + }, + { + "r": 0.0, + "g": 0.392156869, + "b": 0.0, + "a": 1.0 + }, + { + "r": 0.6039216, + "g": 0.8039216, + "b": 0.196078435, + "a": 1.0 + }, + { + "r": 0.419607848, + "g": 0.5568628, + "b": 0.137254909, + "a": 1.0 + }, + { + "r": 0.5019608, + "g": 0.5019608, + "b": 0.0, + "a": 1.0 + }, + { + "r": 0.333333343, + "g": 0.419607848, + "b": 0.184313729, + "a": 1.0 + }, + { + "r": 0.4, + "g": 0.8039216, + "b": 0.6666667, + "a": 1.0 + }, + { + "r": 0.56078434, + "g": 0.7372549, + "b": 0.545098066, + "a": 1.0 + }, + { + "r": 0.1254902, + "g": 0.698039234, + "b": 0.6666667, + "a": 1.0 + }, + { + "r": 0.0, + "g": 0.545098066, + "b": 0.545098066, + "a": 1.0 + }, + { + "r": 0.0, + "g": 0.5019608, + "b": 0.5019608, + "a": 1.0 + }, + { + "r": 0.0, + "g": 1.0, + "b": 1.0, + "a": 1.0 + }, + { + "r": 0.0, + "g": 1.0, + "b": 1.0, + "a": 1.0 + }, + { + "r": 0.2509804, + "g": 0.8784314, + "b": 0.8156863, + "a": 1.0 + }, + { + "r": 0.282352954, + "g": 0.819607854, + "b": 0.8, + "a": 1.0 + }, + { + "r": 0.0, + "g": 0.807843149, + "b": 0.819607854, + "a": 1.0 + }, + { + "r": 0.372549027, + "g": 0.619607866, + "b": 0.627451, + "a": 1.0 + }, + { + "r": 0.274509817, + "g": 0.509803951, + "b": 0.7058824, + "a": 1.0 + }, + { + "r": 0.6901961, + "g": 0.768627465, + "b": 0.870588243, + "a": 1.0 + }, + { + "r": 0.6901961, + "g": 0.8784314, + "b": 0.9019608, + "a": 1.0 + }, + { + "r": 0.6784314, + "g": 0.847058833, + "b": 0.9019608, + "a": 1.0 + }, + { + "r": 0.5294118, + "g": 0.807843149, + "b": 0.921568632, + "a": 1.0 + }, + { + "r": 0.5294118, + "g": 0.807843149, + "b": 0.980392158, + "a": 1.0 + }, + { + "r": 0.0, + "g": 0.7490196, + "b": 1.0, + "a": 1.0 + }, + { + "r": 0.392156869, + "g": 0.58431375, + "b": 0.929411769, + "a": 1.0 + }, + { + "r": 0.482352942, + "g": 0.407843143, + "b": 0.933333337, + "a": 1.0 + }, + { + "r": 0.0, + "g": 0.0, + "b": 1.0, + "a": 1.0 + }, + { + "r": 0.0, + "g": 0.321568638, + "b": 0.850980461, + "a": 1.0 + }, + { + "r": 0.0, + "g": 0.0, + "b": 0.8039216, + "a": 1.0 + }, + { + "r": 0.0, + "g": 0.0, + "b": 0.545098066, + "a": 1.0 + }, + { + "r": 0.0, + "g": 0.0, + "b": 0.5019608, + "a": 1.0 + }, + { + "r": 0.09803922, + "g": 0.09803922, + "b": 0.4392157, + "a": 1.0 + }, + { + "r": 0.7372549, + "g": 0.56078434, + "b": 0.56078434, + "a": 1.0 + }, + { + "r": 0.956862748, + "g": 0.6431373, + "b": 0.3764706, + "a": 1.0 + }, + { + "r": 0.854901969, + "g": 0.647058845, + "b": 0.1254902, + "a": 1.0 + }, + { + "r": 0.721568644, + "g": 0.5254902, + "b": 0.0431372561, + "a": 1.0 + }, + { + "r": 0.8039216, + "g": 0.521568656, + "b": 0.247058824, + "a": 1.0 + }, + { + "r": 0.8235294, + "g": 0.4117647, + "b": 0.117647059, + "a": 1.0 + }, + { + "r": 0.545098066, + "g": 0.270588249, + "b": 0.07450981, + "a": 1.0 + }, + { + "r": 0.627451, + "g": 0.321568638, + "b": 0.1764706, + "a": 1.0 + }, + { + "r": 0.6627451, + "g": 0.6627451, + "b": 0.6627451, + "a": 1.0 + }, + { + "r": 0.5019608, + "g": 0.5019608, + "b": 0.5019608, + "a": 1.0 + }, + { + "r": 0.4117647, + "g": 0.4117647, + "b": 0.4117647, + "a": 1.0 + }, + { + "r": 0.466666669, + "g": 0.533333361, + "b": 0.6, + "a": 1.0 + }, + { + "r": 0.4392157, + "g": 0.5019608, + "b": 0.5647059, + "a": 1.0 + }, + { + "r": 0.184313729, + "g": 0.309803933, + "b": 0.309803933, + "a": 1.0 + }, + { + "r": 0.3, + "g": 0.3, + "b": 0.3, + "a": 1.0 + }, + { + "r": 1.0, + "g": 0.3, + "b": 0.42, + "a": 1.0 + } +] \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/Assets/colors.json b/SubnauticaModSystem/AutosortLockers/Assets/colors.json index b4ff88e..b66c232 100644 --- a/SubnauticaModSystem/AutosortLockers/Assets/colors.json +++ b/SubnauticaModSystem/AutosortLockers/Assets/colors.json @@ -1,800 +1,841 @@ [ { - "r": 0.827451, + "r": 1.0, "g": 1.0, - "b": 0.992156863, + "b": 1.0, "a": 1.0 }, { - "r": 0.9568628, - "g": 0.764705956, - "b": 0.0, + "r": 0.97, + "g": 0.97, + "b": 0.97, "a": 1.0 }, { - "r": 0.866666734, - "g": 0.196078449, - "b": 0.1254902, + "r": 0.94, + "g": 0.94, + "b": 0.94, "a": 1.0 }, { - "r": 1.0, - "g": 1.0, - "b": 1.0, + "r": 0.91, + "g": 0.91, + "b": 0.91, "a": 1.0 }, { - "r": 0.2784314, - "g": 0.850980461, - "b": 0.0, + "r": 0.88, + "g": 0.88, + "b": 0.88, "a": 1.0 }, { - "r": 0.0, - "g": 0.321568638, - "b": 0.850980461, + "r": 0.85, + "g": 0.85, + "b": 0.85, "a": 1.0 }, { - "r": 0.509803951, - "g": 0.0156862754, - "b": 0.9333334, + "r": 0.82, + "g": 0.82, + "b": 0.82, "a": 1.0 }, { - "r": 0.8039216, - "g": 0.360784322, - "b": 0.360784322, + "r": 0.79, + "g": 0.79, + "b": 0.79, "a": 1.0 }, { - "r": 0.9411765, - "g": 0.5019608, - "b": 0.5019608, + "r": 0.76, + "g": 0.76, + "b": 0.76, "a": 1.0 }, { - "r": 0.980392158, - "g": 0.5019608, - "b": 0.447058827, + "r": 0.73, + "g": 0.73, + "b": 0.73, "a": 1.0 }, { - "r": 0.9137255, - "g": 0.5882353, - "b": 0.478431374, + "r": 0.70, + "g": 0.70, + "b": 0.70, "a": 1.0 }, { - "r": 1.0, - "g": 0.627451, - "b": 0.478431374, + "r": 0.67, + "g": 0.67, + "b": 0.67, "a": 1.0 }, { - "r": 0.8627451, - "g": 0.0784313753, - "b": 0.235294119, + "r": 0.64, + "g": 0.64, + "b": 0.64, "a": 1.0 }, { - "r": 1.0, - "g": 0.0, - "b": 0.0, + "r": 0.61, + "g": 0.61, + "b": 0.61, "a": 1.0 }, { - "r": 0.698039234, - "g": 0.13333334, - "b": 0.13333334, + "r": 0.58, + "g": 0.58, + "b": 0.58, "a": 1.0 }, { - "r": 0.545098066, - "g": 0.0, - "b": 0.0, + "r": 0.55, + "g": 0.55, + "b": 0.55, "a": 1.0 }, { - "r": 1.0, - "g": 0.7529412, - "b": 0.796078444, + "r": 0.52, + "g": 0.52, + "b": 0.52, "a": 1.0 }, { - "r": 1.0, - "g": 0.7137255, - "b": 0.75686276, + "r": 0.49, + "g": 0.49, + "b": 0.49, "a": 1.0 }, { - "r": 1.0, - "g": 0.4117647, - "b": 0.7058824, + "r": 0.46, + "g": 0.46, + "b": 0.46, "a": 1.0 }, { - "r": 1.0, - "g": 0.0784313753, - "b": 0.5764706, + "r": 0.43, + "g": 0.43, + "b": 0.43, "a": 1.0 }, { - "r": 0.78039217, - "g": 0.08235294, - "b": 0.521568656, + "r": 0.40, + "g": 0.40, + "b": 0.40, "a": 1.0 }, { - "r": 0.858823538, - "g": 0.4392157, - "b": 0.5764706, + "r": 0.37, + "g": 0.37, + "b": 0.37, "a": 1.0 }, { - "r": 1.0, - "g": 0.627451, - "b": 0.478431374, + "r": 0.34, + "g": 0.34, + "b": 0.34, "a": 1.0 }, { - "r": 1.0, - "g": 0.498039216, - "b": 0.3137255, + "r": 0.31, + "g": 0.31, + "b": 0.31, "a": 1.0 }, { - "r": 1.0, - "g": 0.3882353, - "b": 0.2784314, + "r": 0.28, + "g": 0.28, + "b": 0.28, "a": 1.0 }, { - "r": 1.0, - "g": 0.270588249, - "b": 0.0, + "r": 0.25, + "g": 0.25, + "b": 0.25, "a": 1.0 }, { - "r": 1.0, - "g": 0.549019635, - "b": 0.0, + "r": 0.22, + "g": 0.22, + "b": 0.22, "a": 1.0 }, { - "r": 1.0, - "g": 0.647058845, - "b": 0.0, + "r": 0.19, + "g": 0.19, + "b": 0.19, "a": 1.0 }, { - "r": 1.0, - "g": 0.843137264, - "b": 0.0, + "r": 0.16, + "g": 0.16, + "b": 0.16, "a": 1.0 }, { - "r": 1.0, - "g": 1.0, - "b": 0.0, + "r": 0.00, + "g": 0.00, + "b": 0.00, "a": 1.0 }, { - "r": 1.0, - "g": 1.0, - "b": 0.8784314, + "r": 1.00, + "g": 0.70, + "b": 1.00, "a": 1.0 }, { - "r": 1.0, - "g": 0.980392158, - "b": 0.8039216, + "r": 1.00, + "g": 0.50, + "b": 1.00, "a": 1.0 }, { - "r": 0.980392158, - "g": 0.980392158, - "b": 0.8235294, + "r": 1.00, + "g": 0.40, + "b": 1.00, "a": 1.0 }, { - "r": 1.0, - "g": 0.9372549, - "b": 0.8352941, + "r": 1.00, + "g": 0.30, + "b": 1.00, "a": 1.0 }, { - "r": 1.0, - "g": 0.894117653, - "b": 0.709803939, + "r": 1.00, + "g": 0.20, + "b": 1.00, "a": 1.0 }, { - "r": 1.0, - "g": 0.854901969, - "b": 0.7254902, + "r": 1.00, + "g": 0.10, + "b": 1.00, "a": 1.0 }, { - "r": 0.933333337, - "g": 0.9098039, - "b": 0.6666667, + "r": 1.00, + "g": 0.00, + "b": 1.00, "a": 1.0 }, { - "r": 0.9411765, - "g": 0.9019608, - "b": 0.549019635, + "r": 0.90, + "g": 0.00, + "b": 0.90, "a": 1.0 }, { - "r": 0.7411765, - "g": 0.7176471, - "b": 0.419607848, + "r": 0.80, + "g": 0.00, + "b": 0.80, "a": 1.0 }, { - "r": 0.9019608, - "g": 0.9019608, - "b": 0.980392158, + "r": 0.70, + "g": 0.00, + "b": 0.70, "a": 1.0 }, { - "r": 0.847058833, - "g": 0.7490196, - "b": 0.847058833, + "r": 0.95, + "g": 0.70, + "b": 1.00, "a": 1.0 }, { - "r": 0.8666667, - "g": 0.627451, - "b": 0.8666667, + "r": 0.92, + "g": 0.50, + "b": 1.00, "a": 1.0 }, { - "r": 0.933333337, - "g": 0.509803951, - "b": 0.933333337, + "r": 0.90, + "g": 0.40, + "b": 1.00, "a": 1.0 }, { - "r": 0.854901969, - "g": 0.4392157, - "b": 0.8392157, + "r": 0.88, + "g": 0.30, + "b": 1.00, "a": 1.0 }, { - "r": 1.0, - "g": 0.0, - "b": 1.0, + "r": 0.87, + "g": 0.20, + "b": 1.00, "a": 1.0 }, { - "r": 1.0, - "g": 0.0, - "b": 1.0, + "r": 0.85, + "g": 0.10, + "b": 1.00, "a": 1.0 }, { - "r": 0.7294118, - "g": 0.333333343, - "b": 0.827451, + "r": 0.83, + "g": 0.00, + "b": 1.00, "a": 1.0 }, { - "r": 0.5764706, - "g": 0.4392157, - "b": 0.858823538, + "r": 0.75, + "g": 0.00, + "b": 0.90, "a": 1.0 }, { - "r": 0.4, - "g": 0.2, - "b": 0.6, + "r": 0.67, + "g": 0.00, + "b": 0.80, "a": 1.0 }, { - "r": 0.5411765, - "g": 0.168627456, - "b": 0.8862745, + "r": 0.58, + "g": 0.00, + "b": 0.70, "a": 1.0 }, { - "r": 0.5803922, - "g": 0.0, - "b": 0.827451, + "r": 0.70, + "g": 0.70, + "b": 1.00, "a": 1.0 }, { - "r": 0.6, - "g": 0.196078435, - "b": 0.8, + "r": 0.50, + "g": 0.50, + "b": 1.00, "a": 1.0 }, { - "r": 0.545098066, - "g": 0.0, - "b": 0.545098066, + "r": 0.40, + "g": 0.40, + "b": 1.00, "a": 1.0 }, { - "r": 0.5019608, - "g": 0.0, - "b": 0.5019608, + "r": 0.30, + "g": 0.30, + "b": 1.00, "a": 1.0 }, { - "r": 0.294117659, - "g": 0.0, - "b": 0.509803951, + "r": 0.20, + "g": 0.20, + "b": 1.00, "a": 1.0 }, { - "r": 0.41568628, - "g": 0.3529412, - "b": 0.8039216, + "r": 0.10, + "g": 0.10, + "b": 1.00, "a": 1.0 }, { - "r": 0.282352954, - "g": 0.239215687, - "b": 0.545098066, + "r": 0.00, + "g": 0.00, + "b": 1.00, "a": 1.0 }, { - "r": 0.482352942, - "g": 0.407843143, - "b": 0.933333337, + "r": 0.00, + "g": 0.13, + "b": 0.80, "a": 1.0 }, { - "r": 0.6784314, - "g": 1.0, - "b": 0.184313729, + "r": 0.00, + "g": 0.12, + "b": 0.70, "a": 1.0 }, { - "r": 0.498039216, - "g": 1.0, - "b": 0.0, + "r": 0.00, + "g": 0.00, + "b": 0.70, "a": 1.0 }, { - "r": 0.4862745, - "g": 0.9882353, - "b": 0.0, + "r": 0.60, + "g": 0.93, + "b": 1.00, "a": 1.0 }, { - "r": 0.0, - "g": 1.0, - "b": 0.0, + "r": 0.50, + "g": 0.92, + "b": 1.00, "a": 1.0 }, { - "r": 0.196078435, - "g": 0.8039216, - "b": 0.196078435, + "r": 0.40, + "g": 0.90, + "b": 1.00, "a": 1.0 }, { - "r": 0.596078455, - "g": 0.9843137, - "b": 0.596078455, + "r": 0.30, + "g": 0.88, + "b": 1.00, "a": 1.0 }, { - "r": 0.5647059, - "g": 0.933333337, - "b": 0.5647059, + "r": 0.20, + "g": 0.87, + "b": 1.00, "a": 1.0 }, { - "r": 0.0, - "g": 0.980392158, - "b": 0.6039216, + "r": 0.10, + "g": 0.85, + "b": 1.00, "a": 1.0 }, { - "r": 0.0, - "g": 1.0, - "b": 0.498039216, + "r": 0.00, + "g": 0.84, + "b": 1.00, "a": 1.0 }, { - "r": 0.235294119, - "g": 0.7019608, - "b": 0.443137258, + "r": 0.00, + "g": 0.75, + "b": 0.90, "a": 1.0 }, { - "r": 0.180392161, - "g": 0.545098066, - "b": 0.34117648, + "r": 0.00, + "g": 0.67, + "b": 0.80, "a": 1.0 }, { - "r": 0.13333334, - "g": 0.545098066, - "b": 0.13333334, + "r": 0.00, + "g": 0.50, + "b": 0.60, "a": 1.0 }, { - "r": 0.0, - "g": 0.5019608, - "b": 0.0, + "r": 0.70, + "g": 1.00, + "b": 0.70, "a": 1.0 }, { - "r": 0.0, - "g": 0.392156869, - "b": 0.0, + "r": 0.50, + "g": 1.00, + "b": 0.50, "a": 1.0 }, { - "r": 0.6039216, - "g": 0.8039216, - "b": 0.196078435, + "r": 0.40, + "g": 1.00, + "b": 0.40, "a": 1.0 }, { - "r": 0.419607848, - "g": 0.5568628, - "b": 0.137254909, + "r": 0.30, + "g": 1.00, + "b": 0.30, "a": 1.0 }, { - "r": 0.5019608, - "g": 0.5019608, - "b": 0.0, + "r": 0.20, + "g": 1.00, + "b": 0.20, "a": 1.0 }, { - "r": 0.333333343, - "g": 0.419607848, - "b": 0.184313729, + "r": 0.10, + "g": 1.00, + "b": 0.10, "a": 1.0 }, { - "r": 0.4, - "g": 0.8039216, - "b": 0.6666667, + "r": 0.15, + "g": 0.90, + "b": 0.00, "a": 1.0 }, { - "r": 0.56078434, - "g": 0.7372549, - "b": 0.545098066, + "r": 0.00, + "g": 0.70, + "b": 0.00, "a": 1.0 }, { - "r": 0.1254902, - "g": 0.698039234, - "b": 0.6666667, + "r": 0.00, + "g": 0.60, + "b": 0.00, "a": 1.0 }, { - "r": 0.0, - "g": 0.545098066, - "b": 0.545098066, + "r": 0.00, + "g": 0.40, + "b": 0.00, "a": 1.0 }, { - "r": 0.0, - "g": 0.5019608, - "b": 0.5019608, + "r": 0.95, + "g": 1.00, + "b": 0.70, "a": 1.0 }, { - "r": 0.0, - "g": 1.0, - "b": 1.0, + "r": 0.92, + "g": 1.00, + "b": 0.50, "a": 1.0 }, { - "r": 0.0, - "g": 1.0, - "b": 1.0, + "r": 0.88, + "g": 1.00, + "b": 0.30, "a": 1.0 }, { - "r": 0.8784314, - "g": 1.0, - "b": 1.0, + "r": 0.87, + "g": 1.00, + "b": 0.20, "a": 1.0 }, { - "r": 0.6862745, - "g": 0.933333337, - "b": 0.933333337, + "r": 0.85, + "g": 1.00, + "b": 0.10, "a": 1.0 }, { - "r": 0.498039216, - "g": 1.0, - "b": 0.831372559, + "r": 0.83, + "g": 1.00, + "b": 0.00, "a": 1.0 }, { - "r": 0.2509804, - "g": 0.8784314, - "b": 0.8156863, + "r": 0.67, + "g": 0.80, + "b": 0.00, "a": 1.0 }, { - "r": 0.282352954, - "g": 0.819607854, - "b": 0.8, + "r": 0.50, + "g": 0.60, + "b": 0.00, "a": 1.0 }, { - "r": 0.0, - "g": 0.807843149, - "b": 0.819607854, + "r": 0.33, + "g": 0.40, + "b": 0.00, "a": 1.0 }, { - "r": 0.372549027, - "g": 0.619607866, - "b": 0.627451, + "r": 0.10, + "g": 0.30, + "b": 0.00, "a": 1.0 }, { - "r": 0.274509817, - "g": 0.509803951, - "b": 0.7058824, + "r": 1.00, + "g": 1.00, + "b": 0.70, "a": 1.0 }, { - "r": 0.6901961, - "g": 0.768627465, - "b": 0.870588243, + "r": 1.00, + "g": 1.00, + "b": 0.50, "a": 1.0 }, { - "r": 0.6901961, - "g": 0.8784314, - "b": 0.9019608, + "r": 1.00, + "g": 1.00, + "b": 0.40, "a": 1.0 }, { - "r": 0.6784314, - "g": 0.847058833, - "b": 0.9019608, + "r": 1.00, + "g": 1.00, + "b": 0.30, "a": 1.0 }, { - "r": 0.5294118, - "g": 0.807843149, - "b": 0.921568632, + "r": 1.00, + "g": 1.00, + "b": 0.20, "a": 1.0 }, { - "r": 0.5294118, - "g": 0.807843149, - "b": 0.980392158, + "r": 1.00, + "g": 1.00, + "b": 0.10, "a": 1.0 }, { - "r": 0.0, - "g": 0.7490196, - "b": 1.0, + "r": 1.00, + "g": 1.00, + "b": 0.00, "a": 1.0 }, { - "r": 0.117647059, - "g": 0.5647059, - "b": 1.0, + "r": 0.90, + "g": 0.90, + "b": 0.00, "a": 1.0 }, { - "r": 0.392156869, - "g": 0.58431375, - "b": 0.929411769, + "r": 0.80, + "g": 0.80, + "b": 0.00, "a": 1.0 }, { - "r": 0.482352942, - "g": 0.407843143, - "b": 0.933333337, + "r": 0.70, + "g": 0.70, + "b": 0.00, "a": 1.0 }, { - "r": 0.254901975, - "g": 0.4117647, - "b": 0.882352948, + "r": 1.00, + "g": 0.90, + "b": 0.70, "a": 1.0 }, { - "r": 0.0, - "g": 0.0, - "b": 1.0, + "r": 1.00, + "g": 0.83, + "b": 0.50, "a": 1.0 }, { - "r": 0.0, - "g": 0.0, - "b": 0.8039216, + "r": 1.00, + "g": 0.80, + "b": 0.40, "a": 1.0 }, { - "r": 0.0, - "g": 0.0, - "b": 0.545098066, + "r": 1.00, + "g": 0.76, + "b": 0.30, "a": 1.0 }, { - "r": 0.0, - "g": 0.0, - "b": 0.5019608, + "r": 1.00, + "g": 0.73, + "b": 0.20, "a": 1.0 }, { - "r": 0.09803922, - "g": 0.09803922, - "b": 0.4392157, + "r": 1.00, + "g": 0.70, + "b": 0.10, "a": 1.0 }, { - "r": 1.0, - "g": 0.972549, - "b": 0.8627451, + "r": 1.00, + "g": 0.67, + "b": 0.00, "a": 1.0 }, { - "r": 1.0, - "g": 0.921568632, - "b": 0.8039216, + "r": 0.90, + "g": 0.60, + "b": 0.00, "a": 1.0 }, { - "r": 1.0, - "g": 0.894117653, - "b": 0.768627465, + "r": 0.80, + "g": 0.53, + "b": 0.00, "a": 1.0 }, { - "r": 1.0, - "g": 0.870588243, - "b": 0.6784314, + "r": 0.60, + "g": 0.40, + "b": 0.00, "a": 1.0 }, { - "r": 0.9607843, - "g": 0.870588243, - "b": 0.7019608, + "r": 1.00, + "g": 0.85, + "b": 0.70, "a": 1.0 }, { - "r": 0.870588243, - "g": 0.721568644, - "b": 0.5294118, + "r": 1.00, + "g": 0.75, + "b": 0.50, "a": 1.0 }, { - "r": 0.8235294, - "g": 0.7058824, - "b": 0.549019635, + "r": 1.00, + "g": 0.70, + "b": 0.40, "a": 1.0 }, { - "r": 0.7372549, - "g": 0.56078434, - "b": 0.56078434, + "r": 1.00, + "g": 0.65, + "b": 0.30, "a": 1.0 }, { - "r": 0.956862748, - "g": 0.6431373, - "b": 0.3764706, + "r": 1.00, + "g": 0.60, + "b": 0.20, "a": 1.0 }, { - "r": 0.854901969, - "g": 0.647058845, - "b": 0.1254902, + "r": 1.00, + "g": 0.55, + "b": 0.10, "a": 1.0 }, { - "r": 0.721568644, - "g": 0.5254902, - "b": 0.0431372561, + "r": 1.00, + "g": 0.50, + "b": 0.00, "a": 1.0 }, { - "r": 0.8039216, - "g": 0.521568656, - "b": 0.247058824, + "r": 0.90, + "g": 0.45, + "b": 0.00, "a": 1.0 }, { - "r": 0.8235294, - "g": 0.4117647, - "b": 0.117647059, + "r": 0.80, + "g": 0.40, + "b": 0.00, "a": 1.0 }, { - "r": 0.545098066, - "g": 0.270588249, - "b": 0.07450981, + "r": 0.70, + "g": 0.35, + "b": 0.00, "a": 1.0 }, { - "r": 0.627451, - "g": 0.321568638, - "b": 0.1764706, + "r": 1.00, + "g": 0.70, + "b": 0.70, "a": 1.0 }, { - "r": 0.647058845, - "g": 0.164705887, - "b": 0.164705887, + "r": 1.00, + "g": 0.50, + "b": 0.50, "a": 1.0 }, { - "r": 0.5019608, - "g": 0.0, - "b": 0.0, + "r": 1.00, + "g": 0.40, + "b": 0.40, "a": 1.0 }, { - "r": 1.0, - "g": 0.980392158, - "b": 0.980392158, + "r": 1.00, + "g": 0.30, + "b": 0.30, "a": 1.0 }, { - "r": 0.9411765, - "g": 1.0, - "b": 0.9411765, + "r": 1.00, + "g": 0.20, + "b": 0.20, + "a": 1.0 + }, + { + "r": 1.00, + "g": 0.10, + "b": 0.10, + "a": 1.0 + }, + { + "r": 1.00, + "g": 0.00, + "b": 0.00, + "a": 1.0 }, + { + "r": 0.90, + "g": 0.00, + "b": 0.00, + "a": 1.0 + }, + { + "r": 0.80, + "g": 0.00, + "b": 0.00, + "a": 1.0 + }, + { + "r": 0.60, + "g": 0.00, + "b": 0.00, + "a": 1.0 + }, + { + "r": 1.00, + "g": 0.70, + "b": 0.75, + "a": 1.0 + }, + { + "r": 1.00, + "g": 0.50, + "b": 0.58, "a": 1.0 }, { - "r": 0.7529412, - "g": 0.7529412, - "b": 0.7529412, + "r": 1.00, + "g": 0.40, + "b": 0.50, "a": 1.0 }, { - "r": 0.6627451, - "g": 0.6627451, - "b": 0.6627451, + "r": 1.00, + "g": 0.30, + "b": 0.42, "a": 1.0 }, { - "r": 0.5019608, - "g": 0.5019608, - "b": 0.5019608, + "r": 1.00, + "g": 0.20, + "b": 0.33, "a": 1.0 }, { - "r": 0.4117647, - "g": 0.4117647, - "b": 0.4117647, + "r": 1.00, + "g": 0.10, + "b": 0.25, "a": 1.0 }, { - "r": 0.466666669, - "g": 0.533333361, - "b": 0.6, + "r": 1.00, + "g": 0.00, + "b": 0.17, "a": 1.0 }, { - "r": 0.4392157, - "g": 0.5019608, - "b": 0.5647059, + "r": 0.90, + "g": 0.00, + "b": 0.15, "a": 1.0 }, { - "r": 0.184313729, - "g": 0.309803933, - "b": 0.309803933, + "r": 0.80, + "g": 0.00, + "b": 0.13, "a": 1.0 }, { - "r": 0.3, - "g": 0.3, - "b": 0.3, + "r": 0.70, + "g": 0.00, + "b": 0.12, "a": 1.0 } ] \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/Assets/filters.json b/SubnauticaModSystem/AutosortLockers/Assets/filters.json deleted file mode 100644 index 2b39b59..0000000 --- a/SubnauticaModSystem/AutosortLockers/Assets/filters.json +++ /dev/null @@ -1,720 +0,0 @@ -[ - { - "Category": "", - "Types": [ - 3021 - ] - }, - { - "Category": "", - "Types": [ - 34 - ] - }, - { - "Category": "", - "Types": [ - 59 - ] - }, - { - "Category": "", - "Types": [ - 3063 - ] - }, - { - "Category": "", - "Types": [ - 504 - ] - }, - { - "Category": "", - "Types": [ - 61 - ] - }, - { - "Category": "", - "Types": [ - 27 - ] - }, - { - "Category": "", - "Types": [ - 3034 - ] - }, - { - "Category": "", - "Types": [ - 35 - ] - }, - { - "Category": "", - "Types": [ - 44 - ] - }, - { - "Category": "", - "Types": [ - 7 - ] - }, - { - "Category": "", - "Types": [ - 32 - ] - }, - { - "Category": "", - "Types": [ - 3502 - ] - }, - { - "Category": "", - "Types": [ - 23 - ] - }, - { - "Category": "", - "Types": [ - 3035 - ] - }, - { - "Category": "", - "Types": [ - 65 - ] - }, - { - "Category": "", - "Types": [ - 36 - ] - }, - { - "Category": "", - "Types": [ - 42 - ] - }, - { - "Category": "", - "Types": [ - 3 - ] - }, - { - "Category": "", - "Types": [ - 4514 - ] - }, - { - "Category": "", - "Types": [ - 2530 - ] - }, - { - "Category": "", - "Types": [ - 3010 - ] - }, - { - "Category": "", - "Types": [ - 15 - ] - }, - { - "Category": "", - "Types": [ - 21 - ] - }, - { - "Category": "", - "Types": [ - 1547 - ] - }, - { - "Category": "", - "Types": [ - 53 - ] - }, - { - "Category": "", - "Types": [ - 4210 - ] - }, - { - "Category": "", - "Types": [ - 66 - ] - }, - { - "Category": "", - "Types": [ - 4209 - ] - }, - { - "Category": "", - "Types": [ - 68 - ] - }, - { - "Category": "", - "Types": [ - 8 - ] - }, - { - "Category": "", - "Types": [ - 40 - ] - }, - { - "Category": "", - "Types": [ - 62 - ] - }, - { - "Category": "", - "Types": [ - 54 - ] - }, - { - "Category": "", - "Types": [ - 2 - ] - }, - { - "Category": "", - "Types": [ - 69 - ] - }, - { - "Category": "", - "Types": [ - 41 - ] - }, - { - "Category": "", - "Types": [ - 56 - ] - }, - { - "Category": "", - "Types": [ - 43 - ] - }, - { - "Category": "", - "Types": [ - 1 - ] - }, - { - "Category": "", - "Types": [ - 64 - ] - }, - { - "Category": "", - "Types": [ - 52 - ] - }, - { - "Category": "", - "Types": [ - 9 - ] - }, - { - "Category": "", - "Types": [ - 17 - ] - }, - { - "Category": "", - "Types": [ - 28 - ] - }, - { - "Category": "", - "Types": [ - 3504 - ] - }, - { - "Category": "", - "Types": [ - 57 - ] - }, - { - "Category": "", - "Types": [ - 3501 - ] - }, - { - "Category": "", - "Types": [ - 16 - ] - }, - { - "Category": "", - "Types": [ - 30 - ] - }, - { - "Category": "", - "Types": [ - 63 - ] - }, - { - "Category": "", - "Types": [ - 33 - ] - }, - - { - "Category": "Food", - "Types": [ - 4506, - 4509, - 4510, - 4504, - 4503, - 4512, - 4507, - 4519, - 4518, - 4511, - 4502, - 4505, - 4508, - 4517, - 4604, - 4607, - 4608, - 4602, - 4601, - 4610, - 4605, - 4613, - 4612, - 4609, - 4600, - 4603, - 4606, - 4611, - 4513, - 4520, - 4521, - 4522, - 3506, - 3513, - 3516, - 3514 - ] - }, - { - "Category": "Water", - "Types": [ - 4516, - 4523, - 4501, - 4500, - 4515 - ] - }, - { - "Category": "Plants & Seeds", - "Types": [ - 3509, - 3520, - 3506, - 2529, - 2503, - 3531, - 3529, - 3525, - 3513, - 3524, - 3503, - 3516, - 3517, - 3527, - 3507, - 3530, - 3528, - 3511, - 3518, - 3540, - 3521, - 3512, - 3533, - 3523, - 3508, - 3514, - 3534, - 3535, - 3536, - 3532, - 3539, - 3526, - 3537, - 3522, - 3515, - 3541, - 3519, - 3538, - 3510 - ] - }, - { - "Category": "Metals", - "Types": [ - 7, - 21, - 8, - 40, - 54, - 2, - 69, - 28, - 16 - ] - }, - { - "Category": "Electronics", - "Types": [ - 34, - 44, - 32, - 65, - 64, - 33 - ] - }, - { - "Category": "Batteries", - "Types": [ - 504, - 43, - 4210, - 4209 - ] - }, - { - "Category": "Natural Materials", - "Types": [ - 2530, - 3502, - 3035, - 3021, - 3501, - 3034, - 35, - 9, - 3063, - 3504, - 3010 - ] - }, - { - "Category": "Synthetic Materials", - "Types": [ - 59, - 57, - 61, - 27, - 42, - 3, - 15, - 1547, - 53, - 62, - 56, - 66, - 17, - 30, - 41 - ] - }, - { - "Category": "Crystal Materials", - "Types": [ - 52, - 36, - 68, - 1, - 23, - 63 - ] - }, - { - "Category": "Fish", - "Types": [ - 2515, - 2510, - 2554, - 2513, - 2555, - 2507, - 2501, - 2531, - 2546, - 2516, - 2505, - 2504, - 2519, - 2520, - 2522, - 2534, - 2550, - 2539, - 2509, - 2523, - 2517, - 2502, - 2551, - 2535, - 2506, - 2518, - 2524, - 2545, - 2512, - 2538 - ] - }, - { - "Category": "Eggs", - "Types": [ - 1266, - 1267, - 1283, - 1281, - 1285, - 1269, - 1265, - 1263, - 1287, - 1262, - 1261, - 1259, - 1264, - 1268, - 1260, - 1258, - 1253, - 1252, - 1251, - 1255, - 1257, - 1254, - 1250, - 1256, - 1270, - 1271, - 1272, - 1273, - 1274, - 1275, - 1276, - 1277, - 1278, - 1279, - 1280, - 1281, - 1282, - 1283, - 1284, - 1285, - 1286, - 1287, - 1288, - 1289, - 1290 - ] - }, - { - "Category": "Tools", - "Types": [ - 513, - 508, - 509, - 527, - 800, - 517, - 528, - 524, - 754, - 507, - 758, - 801, - 505, - 761, - 762, - 515, - 526, - 757, - 807, - 523, - 751, - 759, - 755, - 750, - 1807 - ] - }, - { - "Category": "Equipment", - "Types": [ - 525, - 518, - 512, - 502, - 804, - 803, - 521, - 520, - 519, - 522, - 529, - 808, - 806, - 503, - 805 - ] - }, - { - "Category": "Mysterious Tablets", - "Types": [ - 4201, - 4202, - 4204 - ] - }, - { - "Category": "Scanner Room Upgrades", - "Types": [ - 2250, - 2251, - 5527 - ] - }, - { - "Category": "General Upgrades", - "Types": [ - 1501, - 1516, - 2105, - 2101, - 2103 - ] - }, - { - "Category": "Seamoth Upgrades", - "Types": [ - 2104, - 2100, - 2102, - 2110, - 2112, - 2113, - 2114, - 2109 - ] - }, - { - "Category": "PrawnSuit Upgrades", - "Types": [ - 2128, - 2129, - 2116, - 2121, - 2115, - 2120, - 2117, - 2122 - ] - }, - { - "Category": "Cyclops Upgrades", - "Types": [ - 1554, - 1555, - 1537, - 1538, - 1558, - 1553, - 1551, - 1552, - 1557 - ] - }, - { - "Category": "Torpedoes", - "Types": [ - 2119, - 2111 - ] - }, - { - "Category": "Alterra Stuff", - "Types": [ - 1816, - 1817, - 1818, - 1808, - 1814, - 1815, - 1809, - 1810, - 1811, - 1143, - 1823, - 6005, - 1824, - 1825, - 1826, - 1827 - ] - } -] \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/Assets/type_reference.json b/SubnauticaModSystem/AutosortLockers/Assets/type_reference.json deleted file mode 100644 index 9b2c805..0000000 --- a/SubnauticaModSystem/AutosortLockers/Assets/type_reference.json +++ /dev/null @@ -1,1206 +0,0 @@ -[ - { - "Name": "Quartz", - "Value": 1 - }, - { - "Name": "ScrapMetal", - "Value": 2 - }, - { - "Name": "FiberMesh", - "Value": 3 - }, - { - "Name": "Copper", - "Value": 7 - }, - { - "Name": "Lead", - "Value": 8 - }, - { - "Name": "Salt", - "Value": 9 - }, - { - "Name": "MercuryOre", - "Value": 12 - }, - { - "Name": "Glass", - "Value": 15 - }, - { - "Name": "Titanium", - "Value": 16 - }, - { - "Name": "Silicone", - "Value": 17 - }, - { - "Name": "Gold", - "Value": 21 - }, - { - "Name": "Magnesium", - "Value": 22 - }, - { - "Name": "Sulphur", - "Value": 23 - }, - { - "Name": "SandLoot", - "Value": 26 - }, - { - "Name": "Bleach", - "Value": 27 - }, - { - "Name": "Silver", - "Value": 28 - }, - { - "Name": "TitaniumIngot", - "Value": 30 - }, - { - "Name": "CopperWire", - "Value": 32 - }, - { - "Name": "WiringKit", - "Value": 33 - }, - { - "Name": "AdvancedWiringKit", - "Value": 34 - }, - { - "Name": "CrashPowder", - "Value": 35 - }, - { - "Name": "Diamond", - "Value": 36 - }, - { - "Name": "Lithium", - "Value": 40 - }, - { - "Name": "PlasteelIngot", - "Value": 41 - }, - { - "Name": "EnameledGlass", - "Value": 42 - }, - { - "Name": "PowerCell", - "Value": 43 - }, - { - "Name": "ComputerChip", - "Value": 44 - }, - { - "Name": "Uranium", - "Value": 51 - }, - { - "Name": "AluminumOxide", - "Value": 52 - }, - { - "Name": "HydrochloricAcid", - "Value": 53 - }, - { - "Name": "Magnetite", - "Value": 54 - }, - { - "Name": "Polyaniline", - "Value": 56 - }, - { - "Name": "AramidFibers", - "Value": 57 - }, - { - "Name": "Aerogel", - "Value": 59 - }, - { - "Name": "Benzene", - "Value": 61 - }, - { - "Name": "Lubricant", - "Value": 62 - }, - { - "Name": "UraniniteCrystal", - "Value": 63 - }, - { - "Name": "ReactorRod", - "Value": 64 - }, - { - "Name": "DepletedReactorRod", - "Value": 65 - }, - { - "Name": "PrecursorIonCrystal", - "Value": 66 - }, - { - "Name": "PrecursorIonCrystalMatrix", - "Value": 67 - }, - { - "Name": "Kyanite", - "Value": 68 - }, - { - "Name": "Nickel", - "Value": 69 - }, - { - "Name": "Fins", - "Value": 502 - }, - { - "Name": "Tank", - "Value": 503 - }, - { - "Name": "Battery", - "Value": 504 - }, - { - "Name": "Knife", - "Value": 505 - }, - { - "Name": "Flashlight", - "Value": 507 - }, - { - "Name": "Beacon", - "Value": 508 - }, - { - "Name": "Builder", - "Value": 509 - }, - { - "Name": "Compass", - "Value": 512 - }, - { - "Name": "AirBladder", - "Value": 513 - }, - { - "Name": "Terraformer", - "Value": 514 - }, - { - "Name": "Pipe", - "Value": 515 - }, - { - "Name": "Thermometer", - "Value": 516 - }, - { - "Name": "DiveReel", - "Value": 517 - }, - { - "Name": "Rebreather", - "Value": 518 - }, - { - "Name": "RadiationSuit", - "Value": 519 - }, - { - "Name": "RadiationHelmet", - "Value": 520 - }, - { - "Name": "RadiationGloves", - "Value": 521 - }, - { - "Name": "ReinforcedDiveSuit", - "Value": 522 - }, - { - "Name": "Scanner", - "Value": 523 - }, - { - "Name": "FireExtinguisher", - "Value": 524 - }, - { - "Name": "MapRoomHUDChip", - "Value": 525 - }, - { - "Name": "PipeSurfaceFloater", - "Value": 526 - }, - { - "Name": "CyclopsDecoy", - "Value": 527 - }, - { - "Name": "DoubleTank", - "Value": 528 - }, - { - "Name": "ReinforcedGloves", - "Value": 529 - }, - { - "Name": "Welder", - "Value": 750 - }, - { - "Name": "Seaglide", - "Value": 751 - }, - { - "Name": "Constructor", - "Value": 752 - }, - { - "Name": "Transfuser", - "Value": 753 - }, - { - "Name": "Flare", - "Value": 754 - }, - { - "Name": "StasisRifle", - "Value": 755 - }, - { - "Name": "PropulsionCannon", - "Value": 757 - }, - { - "Name": "Gravsphere", - "Value": 758 - }, - { - "Name": "SmallStorage", - "Value": 759 - }, - { - "Name": "LaserCutter", - "Value": 761 - }, - { - "Name": "LEDLight", - "Value": 762 - }, - { - "Name": "DiamondBlade", - "Value": 800 - }, - { - "Name": "HeatBlade", - "Value": 801 - }, - { - "Name": "LithiumIonBattery", - "Value": 802 - }, - { - "Name": "PlasteelTank", - "Value": 803 - }, - { - "Name": "HighCapacityTank", - "Value": 804 - }, - { - "Name": "UltraGlideFins", - "Value": 805 - }, - { - "Name": "SwimChargeFins", - "Value": 806 - }, - { - "Name": "RepulsionCannon", - "Value": 807 - }, - { - "Name": "Stillsuit", - "Value": 808 - }, - { - "Name": "StasisRifleFragment", - "Value": 1101 - }, - { - "Name": "ReinforceHullFragment", - "Value": 1105 - }, - { - "Name": "PropulsionCannonFragment", - "Value": 1107 - }, - { - "Name": "SeaglideFragment", - "Value": 1117 - }, - { - "Name": "SolarPanelFragment", - "Value": 1119 - }, - { - "Name": "PowerTransmitterFragment", - "Value": 1120 - }, - { - "Name": "SpecimenAnalyzerFragment", - "Value": 1130 - }, - { - "Name": "LEDLightFragment", - "Value": 1143 - }, - { - "Name": "SafeShallowsEgg", - "Value": 1250 - }, - { - "Name": "KelpForestEgg", - "Value": 1251 - }, - { - "Name": "GrassyPlateausEgg", - "Value": 1252 - }, - { - "Name": "GrandReefsEgg", - "Value": 1253 - }, - { - "Name": "MushroomForestEgg", - "Value": 1254 - }, - { - "Name": "KooshZoneEgg", - "Value": 1255 - }, - { - "Name": "TwistyBridgesEgg", - "Value": 1256 - }, - { - "Name": "LavaZoneEgg", - "Value": 1257 - }, - { - "Name": "StalkerEgg", - "Value": 1258 - }, - { - "Name": "ReefbackEgg", - "Value": 1259 - }, - { - "Name": "SpadefishEgg", - "Value": 1260 - }, - { - "Name": "RabbitrayEgg", - "Value": 1261 - }, - { - "Name": "MesmerEgg", - "Value": 1262 - }, - { - "Name": "JumperEgg", - "Value": 1263 - }, - { - "Name": "SandsharkEgg", - "Value": 1264 - }, - { - "Name": "JellyrayEgg", - "Value": 1265 - }, - { - "Name": "BonesharkEgg", - "Value": 1266 - }, - { - "Name": "CrabsnakeEgg", - "Value": 1267 - }, - { - "Name": "ShockerEgg", - "Value": 1268 - }, - { - "Name": "GasopodEgg", - "Value": 1269 - }, - { - "Name": "CrashEgg", - "Value": 1281 - }, - { - "Name": "CrabsquidEgg", - "Value": 1283 - }, - { - "Name": "CutefishEgg", - "Value": 1285 - }, - { - "Name": "LavaLizardEgg", - "Value": 1287 - }, - { - "Name": "HullReinforcementModule", - "Value": 1501 - }, - { - "Name": "PowerUpgradeModule", - "Value": 1516 - }, - { - "Name": "CyclopsHullModule1", - "Value": 1537 - }, - { - "Name": "CyclopsHullModule2", - "Value": 1538 - }, - { - "Name": "HatchingEnzymes", - "Value": 1547 - }, - { - "Name": "CyclopsShieldModule", - "Value": 1551 - }, - { - "Name": "CyclopsSonarModule", - "Value": 1552 - }, - { - "Name": "CyclopsSeamothRepairModule", - "Value": 1553 - }, - { - "Name": "CyclopsDecoyModule", - "Value": 1554 - }, - { - "Name": "CyclopsFireSuppressionModule", - "Value": 1555 - }, - { - "Name": "CyclopsThermalReactorModule", - "Value": 1557 - }, - { - "Name": "CyclopsHullModule3", - "Value": 1558 - }, - { - "Name": "LuggageBag", - "Value": 1807 - }, - { - "Name": "ArcadeGorgetoy", - "Value": 1808 - }, - { - "Name": "LabEquipment1", - "Value": 1809 - }, - { - "Name": "LabEquipment2", - "Value": 1810 - }, - { - "Name": "LabEquipment3", - "Value": 1811 - }, - { - "Name": "Cap1", - "Value": 1814 - }, - { - "Name": "Cap2", - "Value": 1815 - }, - { - "Name": "LabContainer", - "Value": 1816 - }, - { - "Name": "LabContainer2", - "Value": 1817 - }, - { - "Name": "LabContainer3", - "Value": 1818 - }, - { - "Name": "StarshipSouvenir", - "Value": 1823 - }, - { - "Name": "PosterAurora", - "Value": 1824 - }, - { - "Name": "PosterExoSuit1", - "Value": 1825 - }, - { - "Name": "PosterExoSuit2", - "Value": 1826 - }, - { - "Name": "PosterKitty", - "Value": 1827 - }, - { - "Name": "Signal", - "Value": 2005 - }, - { - "Name": "SeamothReinforcementModule", - "Value": 2100 - }, - { - "Name": "VehiclePowerUpgradeModule", - "Value": 2101 - }, - { - "Name": "SeamothSolarCharge", - "Value": 2102 - }, - { - "Name": "VehicleStorageModule", - "Value": 2103 - }, - { - "Name": "SeamothElectricalDefense", - "Value": 2104 - }, - { - "Name": "VehicleArmorPlating", - "Value": 2105 - }, - { - "Name": "SeamothTorpedoModule", - "Value": 2109 - }, - { - "Name": "SeamothSonarModule", - "Value": 2110 - }, - { - "Name": "WhirlpoolTorpedo", - "Value": 2111 - }, - { - "Name": "VehicleHullModule1", - "Value": 2112 - }, - { - "Name": "VehicleHullModule2", - "Value": 2113 - }, - { - "Name": "VehicleHullModule3", - "Value": 2114 - }, - { - "Name": "ExosuitJetUpgradeModule", - "Value": 2115 - }, - { - "Name": "ExosuitDrillArmModule", - "Value": 2116 - }, - { - "Name": "ExosuitThermalReactorModule", - "Value": 2117 - }, - { - "Name": "GasTorpedo", - "Value": 2119 - }, - { - "Name": "ExosuitPropulsionArmModule", - "Value": 2120 - }, - { - "Name": "ExosuitGrapplingArmModule", - "Value": 2121 - }, - { - "Name": "ExosuitTorpedoArmModule", - "Value": 2122 - }, - { - "Name": "ExosuitPropulsionArmFragment", - "Value": 2124 - }, - { - "Name": "ExosuitGrapplingArmFragment", - "Value": 2125 - }, - { - "Name": "ExosuitTorpedoArmFragment", - "Value": 2126 - }, - { - "Name": "ExoHullModule1", - "Value": 2128 - }, - { - "Name": "ExoHullModule2", - "Value": 2129 - }, - { - "Name": "MapRoomUpgradeScanRange", - "Value": 2250 - }, - { - "Name": "MapRoomUpgradeScanSpeed", - "Value": 2251 - }, - { - "Name": "HoleFish", - "Value": 2501 - }, - { - "Name": "CreepvineSeedCluster", - "Value": 2503 - }, - { - "Name": "Peeper", - "Value": 2504 - }, - { - "Name": "Oculus", - "Value": 2505 - }, - { - "Name": "GarryFish", - "Value": 2507 - }, - { - "Name": "Boomerang", - "Value": 2510 - }, - { - "Name": "Eyeye", - "Value": 2513 - }, - { - "Name": "Bladderfish", - "Value": 2515 - }, - { - "Name": "Hoverfish", - "Value": 2516 - }, - { - "Name": "Reginald", - "Value": 2519 - }, - { - "Name": "Spadefish", - "Value": 2520 - }, - { - "Name": "Floater", - "Value": 2522 - }, - { - "Name": "CreepvinePiece", - "Value": 2529 - }, - { - "Name": "GasPod", - "Value": 2530 - }, - { - "Name": "Hoopfish", - "Value": 2531 - }, - { - "Name": "Spinefish", - "Value": 2546 - }, - { - "Name": "LavaBoomerang", - "Value": 2554 - }, - { - "Name": "LavaEyeye", - "Value": 2555 - }, - { - "Name": "JellyPlant", - "Value": 3010 - }, - { - "Name": "AcidMushroom", - "Value": 3021 - }, - { - "Name": "BloodOil", - "Value": 3034 - }, - { - "Name": "WhiteMushroom", - "Value": 3035 - }, - { - "Name": "PinkMushroom", - "Value": 3039 - }, - { - "Name": "PurpleRattle", - "Value": 3040 - }, - { - "Name": "SeaTreaderPoop", - "Value": 3063 - }, - { - "Name": "JeweledDiskPiece", - "Value": 3501 - }, - { - "Name": "CoralChunk", - "Value": 3502 - }, - { - "Name": "KooshChunk", - "Value": 3503 - }, - { - "Name": "StalkerTooth", - "Value": 3504 - }, - { - "Name": "BulboTreePiece", - "Value": 3506 - }, - { - "Name": "OrangeMushroomSpore", - "Value": 3507 - }, - { - "Name": "PurpleVasePlantSeed", - "Value": 3508 - }, - { - "Name": "AcidMushroomSpore", - "Value": 3509 - }, - { - "Name": "WhiteMushroomSpore", - "Value": 3510 - }, - { - "Name": "PinkMushroomSpore", - "Value": 3511 - }, - { - "Name": "PurpleRattleSpore", - "Value": 3512 - }, - { - "Name": "HangingFruit", - "Value": 3513 - }, - { - "Name": "PurpleVegetable", - "Value": 3514 - }, - { - "Name": "SmallMelon", - "Value": 3515 - }, - { - "Name": "Melon", - "Value": 3516 - }, - { - "Name": "MelonSeed", - "Value": 3517 - }, - { - "Name": "PurpleBrainCoralPiece", - "Value": 3518 - }, - { - "Name": "SpikePlantSeed", - "Value": 3519 - }, - { - "Name": "BluePalmSeed", - "Value": 3520 - }, - { - "Name": "PurpleFanSeed", - "Value": 3521 - }, - { - "Name": "SmallFanSeed", - "Value": 3522 - }, - { - "Name": "PurpleTentacleSeed", - "Value": 3523 - }, - { - "Name": "JellyPlantSeed", - "Value": 3524 - }, - { - "Name": "GabeSFeatherSeed", - "Value": 3525 - }, - { - "Name": "SeaCrownSeed", - "Value": 3526 - }, - { - "Name": "MembrainTreeSeed", - "Value": 3527 - }, - { - "Name": "PinkFlowerSeed", - "Value": 3528 - }, - { - "Name": "FernPalmSeed", - "Value": 3529 - }, - { - "Name": "OrangePetalsPlantSeed", - "Value": 3530 - }, - { - "Name": "EyesPlantSeed", - "Value": 3531 - }, - { - "Name": "RedGreenTentacleSeed", - "Value": 3532 - }, - { - "Name": "PurpleStalkSeed", - "Value": 3533 - }, - { - "Name": "RedBasketPlantSeed", - "Value": 3534 - }, - { - "Name": "RedBushSeed", - "Value": 3535 - }, - { - "Name": "RedConePlantSeed", - "Value": 3536 - }, - { - "Name": "ShellGrassSeed", - "Value": 3537 - }, - { - "Name": "SpottedLeavesPlantSeed", - "Value": 3538 - }, - { - "Name": "RedRollPlantSeed", - "Value": 3539 - }, - { - "Name": "PurpleBranchesSeed", - "Value": 3540 - }, - { - "Name": "SnakeMushroomSpore", - "Value": 3541 - }, - { - "Name": "PrecursorKey_Red", - "Value": 4200 - }, - { - "Name": "PrecursorKey_Blue", - "Value": 4201 - }, - { - "Name": "PrecursorKey_Orange", - "Value": 4202 - }, - { - "Name": "PrecursorKey_White", - "Value": 4203 - }, - { - "Name": "PrecursorKey_Purple", - "Value": 4204 - }, - { - "Name": "PrecursorIonPowerCell", - "Value": 4209 - }, - { - "Name": "PrecursorIonBattery", - "Value": 4210 - }, - { - "Name": "FilteredWater", - "Value": 4500 - }, - { - "Name": "DisinfectedWater", - "Value": 4501 - }, - { - "Name": "CookedPeeper", - "Value": 4502 - }, - { - "Name": "CookedHoleFish", - "Value": 4503 - }, - { - "Name": "CookedGarryFish", - "Value": 4504 - }, - { - "Name": "CookedReginald", - "Value": 4505 - }, - { - "Name": "CookedBladderfish", - "Value": 4506 - }, - { - "Name": "CookedHoverfish", - "Value": 4507 - }, - { - "Name": "CookedSpadefish", - "Value": 4508 - }, - { - "Name": "CookedBoomerang", - "Value": 4509 - }, - { - "Name": "CookedEyeye", - "Value": 4510 - }, - { - "Name": "CookedOculus", - "Value": 4511 - }, - { - "Name": "CookedHoopfish", - "Value": 4512 - }, - { - "Name": "NutrientBlock", - "Value": 4513 - }, - { - "Name": "FirstAidKit", - "Value": 4514 - }, - { - "Name": "StillsuitWater", - "Value": 4515 - }, - { - "Name": "BigFilteredWater", - "Value": 4516 - }, - { - "Name": "CookedSpinefish", - "Value": 4517 - }, - { - "Name": "CookedLavaEyeye", - "Value": 4518 - }, - { - "Name": "CookedLavaBoomerang", - "Value": 4519 - }, - { - "Name": "Snack1", - "Value": 4520 - }, - { - "Name": "Snack2", - "Value": 4521 - }, - { - "Name": "Snack3", - "Value": 4522 - }, - { - "Name": "Coffee", - "Value": 4523 - }, - { - "Name": "CuredPeeper", - "Value": 4600 - }, - { - "Name": "CuredHoleFish", - "Value": 4601 - }, - { - "Name": "CuredGarryFish", - "Value": 4602 - }, - { - "Name": "CuredReginald", - "Value": 4603 - }, - { - "Name": "CuredBladderfish", - "Value": 4604 - }, - { - "Name": "CuredHoverfish", - "Value": 4605 - }, - { - "Name": "CuredSpadefish", - "Value": 4606 - }, - { - "Name": "CuredBoomerang", - "Value": 4607 - }, - { - "Name": "CuredEyeye", - "Value": 4608 - }, - { - "Name": "CuredOculus", - "Value": 4609 - }, - { - "Name": "CuredHoopfish", - "Value": 4610 - }, - { - "Name": "CuredSpinefish", - "Value": 4611 - }, - { - "Name": "CuredLavaEyeye", - "Value": 4612 - }, - { - "Name": "CuredLavaBoomerang", - "Value": 4613 - }, - { - "Name": "MapRoomCamera", - "Value": 5527 - }, - { - "Name": "Poster", - "Value": 6005 - }, - { - "Name": "BoneShark", - "Value": 2534 - }, - { - "Name": "CrabSquid", - "Value": 2550 - }, - { - "Name": "Crabsnake", - "Value": 2539 - }, - { - "Name": "Crash", - "Value": 2509 - }, - { - "Name": "Gasopod", - "Value": 2523 - }, - { - "Name": "Jellyray", - "Value": 2517 - }, - { - "Name": "Jumper", - "Value": 2502 - }, - { - "Name": "LavaLizard", - "Value": 2551 - }, - { - "Name": "Mesmer", - "Value": 2535 - }, - { - "Name": "RabbitRay", - "Value": 2506 - }, - { - "Name": "Reefback", - "Value": 2518 - }, - { - "Name": "Sandshark", - "Value": 2524 - }, - { - "Name": "Shocker", - "Value": 2545 - }, - { - "Name": "Stalker", - "Value": 2512 - }, - { - "Name": "Cutefish", - "Value": 2538 - } -] \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/AutosortLocker.cs b/SubnauticaModSystem/AutosortLockers/AutosortLocker.cs index c454801..a89d585 100644 --- a/SubnauticaModSystem/AutosortLockers/AutosortLocker.cs +++ b/SubnauticaModSystem/AutosortLockers/AutosortLocker.cs @@ -7,369 +7,461 @@ using SMLHelper.V2.Crafting; using UnityEngine; using UnityEngine.UI; +#if SN +#elif BZ +using TMPro; +#endif namespace AutosortLockers { - public class AutosortLocker : MonoBehaviour - { - private static readonly Color MainColor = new Color(1, 0.2f, 0.2f); - private static readonly Color PulseColor = Color.white; - - private bool initialized; - private Constructable constructable; - private StorageContainer container; - private List singleItemTargets = new List(); - private List categoryTargets = new List(); - private List anyTargets = new List(); - - private int unsortableItems = 0; - - [SerializeField] - private Image background; - [SerializeField] - private Image icon; - [SerializeField] - private Text text; - [SerializeField] - private Text sortingText; - [SerializeField] - private bool isSorting; - [SerializeField] - private bool sortedItem; - - public bool IsSorting => isSorting; - - private void Awake() - { - constructable = GetComponent(); - container = GetComponent(); - container.hoverText = "Open autosorter"; - container.storageLabel = "Autosorter"; - } - - private void Update() - { - if (!initialized && constructable._constructed && transform.parent != null) - { - Initialize(); - } - - if (!initialized || !constructable._constructed) - { - return; - } - - UpdateText(); - } - - private void UpdateText() - { - string output = ""; - if (isSorting) - { - output = "Sorting..."; - } - else if (unsortableItems > 0) - { - output = "Unsorted Items: " + unsortableItems; - } - else - { - output = "Ready to Sort"; - } - - sortingText.text = output; - } - - private void Initialize() - { - background.gameObject.SetActive(true); - icon.gameObject.SetActive(true); - text.gameObject.SetActive(true); - sortingText.gameObject.SetActive(true); - - background.sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("LockerScreen.png")); - icon.sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("Sorter.png")); - - initialized = true; - } - - private IEnumerator Start() - { - while (true) - { - yield return new WaitForSeconds(Mathf.Max(0, Mod.config.SortInterval - (unsortableItems / 60.0f))); - - yield return Sort(); - } - } - - private void AccumulateTargets() - { - singleItemTargets.Clear(); - categoryTargets.Clear(); - anyTargets.Clear(); - - SubRoot subRoot = gameObject.GetComponentInParent(); - if (subRoot == null) - { - return; - } - - var allTargets = subRoot.GetComponentsInChildren().ToList(); - foreach (var target in allTargets) - { - if (target.isActiveAndEnabled && target.CanAddItems()) - { - if (target.CanTakeAnyItem()) - { - anyTargets.Add(target); - } - else - { - if (target.HasItemFilters()) - { - singleItemTargets.Add(target); - } - if (target.HasCategoryFilters()) - { - categoryTargets.Add(target); - } - } - } - } - } - - private IEnumerator Sort() - { - sortedItem = false; - unsortableItems = container.container.count; - - if (!initialized || container.IsEmpty()) - { - isSorting = false; - yield break; - } - - AccumulateTargets(); - if (NoTargets()) - { - isSorting = false; - yield break; - } - - isSorting = true; - yield return SortFilteredTargets(false); - if (sortedItem) - { - yield break; - } - - yield return SortFilteredTargets(true); - if (sortedItem) - { - yield break; - } - - yield return SortAnyTargets(); - if (sortedItem) - { - yield break; - } - - isSorting = false; - } - - private bool NoTargets() - { - return singleItemTargets.Count <= 0 && categoryTargets.Count <= 0 && anyTargets.Count <= 0; - } - - private IEnumerator SortFilteredTargets(bool byCategory) - { - int callsToCanAddItem = 0; - const int CanAddItemCallThreshold = 10; - - foreach (AutosortTarget target in byCategory ? categoryTargets : singleItemTargets) - { - foreach (AutosorterFilter filter in target.GetCurrentFilters()) - { - if (filter.IsCategory() == byCategory) - { - foreach (var techType in filter.Types) - { - callsToCanAddItem++; - var items = container.container.GetItems(techType); - if (items != null && items.Count > 0 && target.CanAddItem(items[0].item)) - { - unsortableItems -= items.Count; - SortItem(items[0].item, target); - sortedItem = true; - yield break; - } - else if (callsToCanAddItem > CanAddItemCallThreshold) - { - callsToCanAddItem = 0; - yield return null; - } - } - } - } - } - } - - private IEnumerator SortAnyTargets() - { - int callsToCanAddItem = 0; - const int CanAddItemCallThreshold = 10; - foreach (var item in container.container.ToList()) - { - foreach (AutosortTarget target in anyTargets) - { - callsToCanAddItem++; - if (target.CanAddItem(item.item)) - { - SortItem(item.item, target); - unsortableItems--; - sortedItem = true; - yield break; - } - else if (callsToCanAddItem > CanAddItemCallThreshold) - { - callsToCanAddItem = 0; - yield return null; - } - } - } - } - - private void SortItem(Pickupable pickup, AutosortTarget target) - { - container.container.RemoveItem(pickup, true); - target.AddItem(pickup); - - StartCoroutine(PulseIcon()); - } - - public IEnumerator PulseIcon() - { - float t = 0; - float rate = 0.5f; - while (t < 1.0) - { - t += Time.deltaTime * rate; - icon.color = Color.Lerp(PulseColor, MainColor, t); - yield return null; - } - } - - private AutosortTarget FindTarget(Pickupable item) - { - foreach (AutosortTarget target in singleItemTargets) - { - if (target.CanAddItemByItemFilter(item)) - { - return target; - } - } - foreach (AutosortTarget target in categoryTargets) - { - if (target.CanAddItemByCategoryFilter(item)) - { - return target; - } - } - foreach (AutosortTarget target in anyTargets) - { - if (target.CanAddItem(item)) - { - return target; - } - } - return null; - } - - internal class AutosortLockerBuildable : Buildable - { - public AutosortLockerBuildable() - : base("Autosorter", - "Autosort Locker", - "Small, wall-mounted smart-locker that automatically transfers items into linked Autosort Receptacles.") - { - } - - public override TechGroup GroupForPDA => TechGroup.InteriorModules; - - public override TechCategory CategoryForPDA => TechCategory.InteriorModule; - - public override GameObject GetGameObject() - { - GameObject originalPrefab = CraftData.GetPrefabForTechType(TechType.SmallLocker); - GameObject prefab = GameObject.Instantiate(originalPrefab); - - var container = prefab.GetComponent(); - container.width = Mod.config.AutosorterWidth; - container.height = Mod.config.AutosorterHeight; - container.container.Resize(Mod.config.AutosorterWidth, Mod.config.AutosorterHeight); - - var meshRenderers = prefab.GetComponentsInChildren(); - foreach (var meshRenderer in meshRenderers) - { - meshRenderer.material.color = new Color(1, 0, 0); - } - - var prefabText = prefab.GetComponentInChildren(); - var label = prefab.FindChild("Label"); - DestroyImmediate(label); - - var autoSorter = prefab.AddComponent(); - - var canvas = LockerPrefabShared.CreateCanvas(prefab.transform); - autoSorter.background = LockerPrefabShared.CreateBackground(canvas.transform); - autoSorter.icon = LockerPrefabShared.CreateIcon(autoSorter.background.transform, MainColor, 40); - autoSorter.text = LockerPrefabShared.CreateText(autoSorter.background.transform, prefabText, MainColor, 0, 14, "Autosorter"); - - autoSorter.sortingText = LockerPrefabShared.CreateText(autoSorter.background.transform, prefabText, MainColor, -120, 12, "Sorting..."); - autoSorter.sortingText.alignment = TextAnchor.UpperCenter; - - autoSorter.background.gameObject.SetActive(false); - autoSorter.icon.gameObject.SetActive(false); - autoSorter.text.gameObject.SetActive(false); - autoSorter.sortingText.gameObject.SetActive(false); - - return prefab; - } - - protected override TechData GetBlueprintRecipe() - { - return new TechData - { - craftAmount = 1, - Ingredients = Mod.config.EasyBuild - ? new List - { - new Ingredient(TechType.Titanium, 2) - } - : new List - { - new Ingredient(TechType.Titanium, 2), - new Ingredient(TechType.ComputerChip, 1), - new Ingredient(TechType.AluminumOxide, 2) - } - }; - } - - protected override Atlas.Sprite GetItemSprite() - { - return SMLHelper.V2.Utility.ImageUtils.LoadSpriteFromFile(Mod.GetAssetPath("AutosortLocker.png")); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - public static void AddBuildable() - { - var autosorter = new AutosortLockerBuildable(); - autosorter.Patch(); - } - } -} + public class AutosortLocker : MonoBehaviour + { + private static readonly Color MainColor = new Color(1, 0.2f, 0.2f); + private static readonly Color PulseColor = Color.white; + + private bool initialized; + private Constructable constructable; + private StorageContainer container; + private List singleItemTargets = new List(); + private List categoryTargets = new List(); + private List anyTargets = new List(); + + private int unsortableItems = 0; + + [SerializeField] + private Image background; + [SerializeField] + private Image icon; +#if SN + [SerializeField] + private Text text; + [SerializeField] + private Text sortingText; +#elif BZ + [SerializeField] + private TextMeshProUGUI text; + [SerializeField] + private TextMeshProUGUI sortingText; +#endif + [SerializeField] + private bool isSorting; + [SerializeField] + private bool sortedItem; + + public bool IsSorting => isSorting; + + private void Awake() + { + constructable = GetComponent(); + container = GetComponent(); + container.hoverText = "Open Autosorter"; + container.storageLabel = "Autosorter"; + } + + private void Update() + { + if (!initialized && constructable._constructed && transform.parent != null) + { + Initialize(); + } + + if (!initialized || !constructable._constructed) + { + return; + } + + UpdateText(); + } + + private void UpdateText() + { + string output = ""; + if (isSorting) + { + output = "Sorting..."; + } + else if (unsortableItems > 0) + { + output = "Unsorted Items: " + unsortableItems; + } + else + { + output = "Ready to Sort"; + } + + sortingText.text = output; + } + + private void Initialize() + { + background.gameObject.SetActive(true); + icon.gameObject.SetActive(true); + text.gameObject.SetActive(true); + sortingText.gameObject.SetActive(true); + + background.sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("LockerScreen.png")); + icon.sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("Sorter.png")); + + initialized = true; + } + + private IEnumerator Start() + { + while (true) + { + yield return new WaitForSeconds(Mathf.Max(0, Mod.config.SortInterval - (unsortableItems / 60.0f))); + + yield return Sort(); + } + } + + private void AccumulateTargets() + { + singleItemTargets.Clear(); + categoryTargets.Clear(); + anyTargets.Clear(); + + SubRoot subRoot = gameObject.GetComponentInParent(); + if (subRoot == null) + { + return; + } + + var allTargets = subRoot.GetComponentsInChildren().ToList(); + foreach (var target in allTargets) + { + if (target.isActiveAndEnabled && target.CanAddItems()) + { + if (target.CanTakeAnyItem()) + { + anyTargets.Add(target); + } + else + { + if (target.HasItemFilters()) + { + singleItemTargets.Add(target); + } + if (target.HasCategoryFilters()) + { + categoryTargets.Add(target); + } + } + } + } + } + + private IEnumerator Sort() + { + sortedItem = false; + unsortableItems = container.container.count; + + if (!initialized || container.IsEmpty()) + { + isSorting = false; + yield break; + } + + AccumulateTargets(); + if (NoTargets()) + { + isSorting = false; + yield break; + } + + isSorting = true; + yield return SortFilteredTargets(false); + if (sortedItem) + { + yield break; + } + + yield return SortFilteredTargets(true); + if (sortedItem) + { + yield break; + } + + yield return SortAnyTargets(); + if (sortedItem) + { + yield break; + } + isSorting = false; + } + + private bool NoTargets() + { + return singleItemTargets.Count <= 0 && categoryTargets.Count <= 0 && anyTargets.Count <= 0; + } + + private IEnumerator SortFilteredTargets(bool byCategory) + { + int callsToCanAddItem = 0; + const int CanAddItemCallThreshold = 10; + + foreach (AutosortTarget target in byCategory ? categoryTargets : singleItemTargets) + { + foreach (AutosorterFilter filter in target.GetCurrentFilters()) + { + if (filter.IsCategory() == byCategory) + { + foreach (var techType in filter.Types) + { + callsToCanAddItem++; + var items = container.container.GetItems(techType); + + if (items != null && items.Count > 0 && target.CanAddItem(items[0].item)) + { + unsortableItems -= items.Count; + SortItem(items[0].item, target); + sortedItem = true; + + yield break; + } + else if (callsToCanAddItem > CanAddItemCallThreshold) + { + callsToCanAddItem = 0; + yield return null; + } + } + } + } + } + } + + private IEnumerator SortAnyTargets() + { + int callsToCanAddItem = 0; + const int CanAddItemCallThreshold = 10; + foreach (var item in container.container.ToList()) + { + foreach (AutosortTarget target in anyTargets) + { + callsToCanAddItem++; + if (target.CanAddItem(item.item)) + { + SortItem(item.item, target); + unsortableItems--; + sortedItem = true; + yield break; + } + else if (callsToCanAddItem > CanAddItemCallThreshold) + { + callsToCanAddItem = 0; + yield return null; + } + } + } + } + + private void SortItem(Pickupable pickup, AutosortTarget target) + { + container.container.RemoveItem(pickup, true); + target.AddItem(pickup); + + StartCoroutine(PulseIcon()); + } + + public IEnumerator PulseIcon() + { + float t = 0; + float rate = 0.5f; + while (t < 1.0) + { + t += Time.deltaTime * rate; + icon.color = Color.Lerp(PulseColor, MainColor, t); + yield return null; + } + } + + private AutosortTarget FindTarget(Pickupable item) + { + foreach (AutosortTarget target in singleItemTargets) + { + if (target.CanAddItemByItemFilter(item)) + { + return target; + } + } + foreach (AutosortTarget target in categoryTargets) + { + if (target.CanAddItemByCategoryFilter(item)) + { + return target; + } + } + foreach (AutosortTarget target in anyTargets) + { + if (target.CanAddItem(item)) + { + return target; + } + } + return null; + } + + internal class AutosortLockerBuildable : Buildable + { + public AutosortLockerBuildable() + : base("Autosorter", + "Autosort Locker", + "Small, wall-mounted smart-locker that automatically transfers items into linked Autosort Receptacles.") + { + } + + public override TechGroup GroupForPDA => TechGroup.InteriorModules; + public override TechCategory CategoryForPDA => TechCategory.InteriorModule; + +#if SN + public override GameObject GetGameObject() + { + GameObject originalPrefab = CraftData.GetPrefabForTechType(TechType.SmallLocker); + GameObject prefab = GameObject.Instantiate(originalPrefab); + + var container = prefab.GetComponent(); + container.width = Mod.config.AutosorterWidth; + container.height = Mod.config.AutosorterHeight; + container.container.Resize(Mod.config.AutosorterWidth, Mod.config.AutosorterHeight); + + var meshRenderers = prefab.GetComponentsInChildren(); + foreach (var meshRenderer in meshRenderers) + { + meshRenderer.material.color = new Color(1, 0, 0); + } + + var prefabText = prefab.GetComponentInChildren(); + var label = prefab.FindChild("Label"); + label.SetActive(false); + DestroyImmediate(label); + + var autoSorter = prefab.AddComponent(); + + var canvas = LockerPrefabShared.CreateCanvas(prefab.transform); + autoSorter.background = LockerPrefabShared.CreateBackground(canvas.transform, autoSorter.name); + autoSorter.icon = LockerPrefabShared.CreateIcon(autoSorter.background.transform, MainColor, 40); + autoSorter.text = LockerPrefabShared.CreateText(autoSorter.background.transform, prefabText, MainColor, -4, 14, "Autosorter", "Autosorter"); + autoSorter.text.rectTransform.anchoredPosition += new Vector2(23, 0); + + autoSorter.sortingText = LockerPrefabShared.CreateText(autoSorter.background.transform, prefabText, MainColor, -120, 12, "Sorting...", "Autosorter"); + autoSorter.sortingText.alignment = TextAnchor.UpperCenter; + + autoSorter.background.gameObject.SetActive(false); + autoSorter.icon.gameObject.SetActive(false); + autoSorter.text.gameObject.SetActive(false); + autoSorter.sortingText.gameObject.SetActive(false); + + return prefab; + } +#endif + + public override IEnumerator GetGameObjectAsync(IOut gameObject) + { + CoroutineTask task = CraftData.GetPrefabForTechTypeAsync(TechType.SmallLocker); + yield return task; + + GameObject originalPrefab = task.GetResult(); + GameObject prefab = GameObject.Instantiate(originalPrefab); + + StorageContainer container = prefab.GetComponent(); + container.width = Mod.config.AutosorterWidth; + container.height = Mod.config.AutosorterHeight; + container.Resize(Mod.config.AutosorterWidth, Mod.config.AutosorterHeight); + var meshRenderers = prefab.GetComponentsInChildren(); + foreach (var meshRenderer in meshRenderers) + { + meshRenderer.material.color = new Color(1, 0, 0); + } + +#if SN + var prefabText = prefab.GetComponentInChildren(); +#elif BZ + var prefabText = prefab.GetComponentInChildren(); +#endif + var label = prefab.FindChild("Label"); + DestroyImmediate(label); + + var autoSorter = prefab.AddComponent(); + + var canvas = LockerPrefabShared.CreateCanvas(prefab.transform); + autoSorter.background = LockerPrefabShared.CreateBackground(canvas.transform, autoSorter.name); + autoSorter.icon = LockerPrefabShared.CreateIcon(autoSorter.background.transform, MainColor, 40); + // The first number is the vertical position, the second number is the font + autoSorter.text = LockerPrefabShared.CreateText(autoSorter.background.transform, prefabText, MainColor, 0, 14, "Autosorter", "Autosorter"); + autoSorter.text.rectTransform.anchoredPosition += new Vector2(19, 0); + + autoSorter.sortingText = LockerPrefabShared.CreateText(autoSorter.background.transform, prefabText, MainColor, -120, 18, "Sorting...", "Autosorter"); +#if SN + autoSorter.sortingText.alignment = TextAnchor.UpperCenter; +#elif BZ + autoSorter.sortingText.alignment = TextAlignmentOptions.Top; +#endif + + autoSorter.background.gameObject.SetActive(false); + autoSorter.icon.gameObject.SetActive(false); + autoSorter.text.gameObject.SetActive(false); + autoSorter.sortingText.gameObject.SetActive(false); + + gameObject.Set(prefab); + yield break; + } + +#if SN + protected override TechData GetBlueprintRecipe() + { + return new TechData + { + craftAmount = 1, + Ingredients = Mod.config.EasyBuild + ? new List + { + new Ingredient(TechType.Titanium, 2) + } + : new List + { + new Ingredient(TechType.Titanium, 2), + new Ingredient(TechType.ComputerChip, 1), + new Ingredient(TechType.AluminumOxide, 2) + } + }; + } + protected override Atlas.Sprite GetItemSprite() + { + return SMLHelper.V2.Utility.ImageUtils.LoadSpriteFromFile(Mod.GetAssetPath("AutosortLocker.png")); + } +#elif BZ + protected override RecipeData GetBlueprintRecipe() + { + return new RecipeData() + { + craftAmount = 1, + Ingredients = Mod.config.EasyBuild + ? new List + { + new Ingredient(TechType.Titanium, 2) + } + : new List + { + new Ingredient(TechType.Titanium, 2), + new Ingredient(TechType.ComputerChip, 1), + new Ingredient(TechType.AluminumOxide, 2) + } + }; + } + + protected override Sprite GetItemSprite() + { + return SMLHelper.V2.Utility.ImageUtils.LoadSpriteFromFile(Mod.GetAssetPath("AutosortLocker.png")); + } +#endif + } + + /*_____________________________________________________________________________________________________*/ + + public static void AddBuildable() + { + var autosorter = new AutosortLockerBuildable(); + autosorter.Patch(); + } + } +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/AutosortLockers.csproj b/SubnauticaModSystem/AutosortLockers/AutosortLockers.csproj deleted file mode 100644 index 8c1c9af..0000000 --- a/SubnauticaModSystem/AutosortLockers/AutosortLockers.csproj +++ /dev/null @@ -1,165 +0,0 @@ - - - - - Debug - AnyCPU - {6C883B28-31E6-4C26-B32B-BF5BE0D70190} - Library - Properties - AutosortLockers - AutosortLockersSML - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - Always - - - - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\0Harmony-1.2.0.1.dll - False - - - False - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\Assembly-CSharp.dll - False - - - False - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\Assembly-CSharp-firstpass.dll - False - - - False - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\Newtonsoft.Json.dll - False - - - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\QModInstaller.dll - False - - - D:\SteamLibrary\steamapps\common\Subnautica\QMods\Modding Helper\SMLHelper.dll - False - - - - - - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\UnityEngine.dll - False - - - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\UnityEngine.CoreModule.dll - False - - - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\UnityEngine.InputLegacyModule.dll - False - - - False - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\UnityEngine.Physics2DModule.dll - False - - - False - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\UnityEngine.PhysicsModule.dll - False - - - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\UnityEngine.TextCoreModule.dll - False - - - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\UnityEngine.TextRenderingModule.dll - False - - - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\UnityEngine.UI.dll - False - - - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\UnityEngine.UIElementsModule.dll - False - - - D:\SteamLibrary\steamapps\common\Subnautica\Subnautica_Data\Managed\UnityEngine.UIModule.dll - False - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Resources.resx - - - - - - PreserveNewest - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - - - xcopy $(TargetPath) D:\SteamLibrary\steamapps\common\Subnautica\QMods\$(ProjectName)\ /q /y -xcopy $(ProjectDir)mod.json D:\SteamLibrary\steamapps\common\Subnautica\QMods\$(ProjectName)\ /q /y -xcopy $(ProjectDir)Assets D:\SteamLibrary\steamapps\common\Subnautica\QMods\$(ProjectName)\Assets\ /q /y /i - -xcopy $(TargetPath) D:\EpicGames\Subnautica\QMods\$(ProjectName)\ /q /y -xcopy $(ProjectDir)mod.json D:\EpicGames\Subnautica\QMods\$(ProjectName)\ /q /y -xcopy $(ProjectDir)Assets D:\EpicGames\Subnautica\QMods\$(ProjectName)\Assets\ /q /y /i - - \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/AutosortLockersSML.csproj b/SubnauticaModSystem/AutosortLockers/AutosortLockersSML.csproj new file mode 100644 index 0000000..c9fcab5 --- /dev/null +++ b/SubnauticaModSystem/AutosortLockers/AutosortLockersSML.csproj @@ -0,0 +1,224 @@ + + + + + + Debug + AnyCPU + {6C883B28-31E6-4C26-B32B-BF5BE0D70190} + Library + Properties + AutosortLockers + AutosortLockersSML + $(SolutionDir)$(AssemblyName)\$(Configuration)\ + v4.7.2 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + Always + + + BZ + true + true + $(CommonDir)SubnauticaZero + SubnauticaZero_Data + SMLHelper_BZ + AnyCPU + 7.1 + prompt + false + + + SN + true + true + $(CommonDir)Subnautica + Subnautica_Data + Modding Helper + AnyCPU + 7.1 + prompt + false + + + + $(GameDir)\BepInEx\core\0Harmony.dll + False + + + $(GameDir)\$(DataFolder)\Managed\publicized_assemblies\Assembly-CSharp-firstpass_publicized.dll + False + + + $(GameDir)\$(DataFolder)\Managed\publicized_assemblies\Assembly-CSharp_publicized.dll + False + + + $(GameDir)\$(DataFolder)\Managed\Newtonsoft.Json.dll + False + + + $(GameDir)\BepInEx\plugins\QModManager\QModInstaller.dll + False + + + $(GameDir)\QMods\$(SMLHelperFolder)\SMLHelper.dll + False + + + + + + $(GameDir)\$(DataFolder)\Managed\Unity.TextMeshPro.dll + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.dll + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.AssetBundleModule.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.AudioModule.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.CoreModule.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.ImageConversionModule.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.IMGUIModule.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.InputLegacyModule.dll + False + + + False + $(GameDir)\$(DataFolder)\Managed\UnityEngine.Physics2DModule.dll + False + + + False + $(GameDir)\$(DataFolder)\Managed\UnityEngine.PhysicsModule.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.InputModule.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.ParticleSystemModule.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.PhysicsModule.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.UI.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.TextCoreModule.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.TextRenderingModule.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.UIElementsModule.dll + False + + + $(GameDir)\$(DataFolder)\Managed\UnityEngine.UIModule.dll + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + + + + + + + if $(ConfigurationName) == BZ ( +mkdir "D:\SteamLibrary\steamapps\common\SubnauticaZero\QMods\$(TargetName)" +xcopy /Y "$(TargetPath)" "D:\SteamLibrary\steamapps\common\SubnauticaZero\QMods\$(TargetName)" +xcopy /Y "$(ProjectDir)\mod_BZ.json" "D:\SteamLibrary\steamapps\common\SubnauticaZero\QMods\$(TargetName)\mod.json" +del "D:\SteamLibrary\steamapps\common\SubnauticaZero\qmodmanager_log-SubnauticaZero.txt" ) + +if $(ConfigurationName) == SN ( +mkdir "D:\SteamLibrary\steamapps\common\Subnautica\QMods\$(TargetName)" +xcopy /Y "$(TargetPath)" "D:\SteamLibrary\steamapps\common\Subnautica\QMods\$(TargetName)" +xcopy /Y "$(ProjectDir)\mod_SN.json" "D:\SteamLibrary\steamapps\common\Subnautica\QMods\$(TargetName)\mod.json" +del "D:\SteamLibrary\steamapps\common\Subnautica\qmodmanager_log-Subnautica.txt") + + \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/AutosortLockersSML/BZ/0Harmony.dll b/SubnauticaModSystem/AutosortLockers/AutosortLockersSML/BZ/0Harmony.dll new file mode 100644 index 0000000..fc1bc47 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/AutosortLockersSML/BZ/0Harmony.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/AutosortLockersSML/BZ/0Harmony.xml b/SubnauticaModSystem/AutosortLockers/AutosortLockersSML/BZ/0Harmony.xml new file mode 100644 index 0000000..e25d511 --- /dev/null +++ b/SubnauticaModSystem/AutosortLockers/AutosortLockersSML/BZ/0Harmony.xml @@ -0,0 +1,4109 @@ + + + + 0Harmony + + + + A factory to create delegate types + + + + Instance for the delegate type factory + + + Exists for API compatibility with Harmony + + + + + Creates a delegate type for a method + + Type of the return value + Types of the arguments + The new delegate type for the given type info + + + + Creates a delegate type for a method + + Type of the return value + Types of the arguments + Calling convention. If specified, adds to the delegate type + The new delegate type for the given type info + + + Creates a delegate type for a method + The method + The new delegate type + + + Creates a delegate type for a method + The method + Calling convention. If specified, adds to the delegate type. + The new delegate type + + + A getter delegate type + Type that getter gets field/property value from + Type of the value that getter gets + The instance get getter uses + An delegate + + + + A setter delegate type + Type that setter sets field/property value for + Type of the value that setter sets + The instance the setter uses + The value the setter uses + An delegate + + + + A constructor delegate type + Type that constructor creates + An delegate + + + + A helper class for fast access to getters and setters + + + Creates an instantiation delegate + Type that constructor creates + The new instantiation delegate + + + + Creates an getter delegate for a property + Type that getter reads property from + Type of the property that gets accessed + The property + The new getter delegate + + + + Creates an getter delegate for a field + Type that getter reads field from + Type of the field that gets accessed + The field + The new getter delegate + + + + Creates an getter delegate for a field (with a list of possible field names) + Type that getter reads field/property from + Type of the field/property that gets accessed + A list of possible field names + The new getter delegate + + + + Creates an setter delegate + Type that setter assigns property value to + Type of the property that gets assigned + The property + The new setter delegate + + + + Creates an setter delegate for a field + Type that setter assigns field value to + Type of the field that gets assigned + The field + The new getter delegate + + + + A delegate to invoke a method + The instance + The method parameters + The method result + + + A helper class to invoke method with delegates + + + Creates a fast invocation handler from a method + The method to invoke + Controls if boxed value object is accessed/updated directly + The + + + The directBoxValueAccess option controls how value types passed by reference (e.g. ref int, out my_struct) are handled in the arguments array + passed to the fast invocation handler. + Since the arguments array is an object array, any value types contained within it are actually references to a boxed value object. + Like any other object, there can be other references to such boxed value objects, other than the reference within the arguments array. + For example, + + var val = 5; + var box = (object)val; + var arr = new object[] { box }; + handler(arr); // for a method with parameter signature: ref/out/in int + + + + + If directBoxValueAccess is true, the boxed value object is accessed (and potentially updated) directly when the handler is called, + such that all references to the boxed object reflect the potentially updated value. + In the above example, if the method associated with the handler updates the passed (boxed) value to 10, both box and arr[0] + now reflect the value 10. Note that the original val is not updated, since boxing always copies the value into the new boxed value object. + + + If directBoxValueAccess is false (default), the boxed value object in the arguments array is replaced with a "reboxed" value object, + such that potential updates to the value are reflected only in the arguments array. + In the above example, if the method associated with the handler updates the passed (boxed) value to 10, only arr[0] now reflects the value 10. + + + + + Patch function helpers + + + Sorts patch methods by their priority rules + The original method + Patches to sort + Use debug mode + The sorted patch methods + + + + Sorts patch methods by their priority rules + The original method + Patches to sort + Use debug mode + The sorted patch methods + + + + Creates new replacement method with the latest patches and detours the original method + The original method + Information describing the patches + The newly created replacement method + + + + + High-level IL code manipulator for MonoMod that allows to manipulate a method as a stream of CodeInstructions. + + + + + Initialize IL transpiler + + Body of the method to transpile + Whether to always log everything for this instance + + + + Adds a transpiler method that edits the IL of the given method + + Transpiler method + Currently not implemented + + + + Processes and writes IL to the provided method body. + Note that this cleans the existing method body (removes insturctions and exception handlers). + + Method body to write to. + Original method that transpiler can optionally call into + + One of IL opcodes contains a CallSide (e.g. calli), which is currently not + fully supported. + + One of IL opcodes with an operand contains a null operand. + + + + Converts all branches to long types. This exists to mimic the behaviour of Harmony 2 + + Enumerable of instructions + Enumerable of fixed instructions + + + + Helper wrapper around ILProcessor to allow emitting code at certain positions + + + + + Write method body to a ILDasm -like representation + + Method body to write + String representation of the method body (locals and instruction) + Unexpected exception block type + + + + Patching methods potentially messes up the stack. + Especially calls to GetExecutingAssembly won't turn in correct methods + + + + Creates a patch sorter + Array of patches that will be sorted + Use debugging + + + Sorts internal PatchSortingWrapper collection and caches the results. + After first run the result is provided from the cache. + The original method + The sorted patch methods + + + Sorts internal PatchSortingWrapper collection and caches the results. + After first run the result is provided from the cache. + The original method + The sorted patch methods as instance + + + Checks if the sorter was created with the same patch list and as a result can be reused to + get the sorted order of the patches. + List of patches to check against + true if equal + + + Removes one unresolved dependency from the least important patch. + + + Outputs all unblocked patches from the waiting list to results list + + + Adds patch to both results list and handled patches set + Patch to add + + + Wrapper used over the Patch object to allow faster dependency access and + dependency removal in case of cyclic dependencies + + + Create patch wrapper object used for sorting + Patch to wrap + + + Determines how patches sort + The other patch + integer to define sort order (-1, 0, 1) + + + Determines whether patches are equal + The other patch + true if equal + + + Hash function + A hash code + + + Bidirectionally registers Patches as after dependencies + List of dependencies to register + + + Bidirectionally registers Patches as before dependencies + List of dependencies to register + + + Bidirectionally removes Patch from after dependencies + Patch to remove + + + Bidirectionally removes Patch from before dependencies + Patch to remove + + + Specifies the type of method + + + + This is a normal method + + + This is a getter + + + This is a setter + + + This is a constructor + + + This is a static constructor + + + Specifies the type of argument + + + + This is a normal argument + + + This is a reference argument (ref) + + + This is an out argument (out) + + + This is a pointer argument (&) + + + Specifies the type of patch + + + + Any patch + + + A prefix patch + + + A postfix patch + + + A transpiler + + + A finalizer + + + A reverse patch + + + A MonoMod + + + Specifies the type of reverse patch + + + + Use the unmodified original method (directly from IL) + + + Use the original as it is right now including previous patches but excluding future ones + + + Specifies the type of method call dispatching mechanics + + + + Call the method using dynamic dispatching if method is virtual (including overriden) + + + This is the built-in form of late binding (a.k.a. dynamic binding) and is the default dispatching mechanic in C#. + This directly corresponds with the instruction. + + + For virtual (including overriden) methods, the instance type's most-derived/overriden implementation of the method is called. + For non-virtual (including static) methods, same behavior as : the exact specified method implementation is called. + + + Note: This is not a fully dynamic dispatch, since non-virtual (including static) methods are still called non-virtually. + A fully dynamic dispatch in C# involves using + the dynamic type + (actually a fully dynamic binding, since even the name and overload resolution happens at runtime), which does not support. + + + + + Call the method using static dispatching, regardless of whether method is virtual (including overriden) or non-virtual (including static) + + + a.k.a. non-virtual dispatching, early binding, or static binding. + This directly corresponds with the instruction. + + + For both virtual (including overriden) and non-virtual (including static) methods, the exact specified method implementation is called, without virtual/override mechanics. + + + + + The base class for all Harmony annotations (not meant to be used directly) + + + + The common information for all attributes + + + Annotation to define your Harmony patch methods + + + + An empty annotation can be used together with TargetMethod(s) + + + + An annotation that specifies a class to patch + The declaring class/type + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The argument types of the method or constructor to patch + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The name of the method, property or constructor to patch + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The name of the method, property or constructor to patch + An array of argument types to target overloads + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The name of the method, property or constructor to patch + An array of argument types to target overloads + Array of + + + + An annotation that specifies a method, property or constructor to patch + Assembly-qualified name of the declaring class/type + The name of the method, property or constructor to patch + + + + An annotation that specifies a method, property or constructor to patch + Assembly-qualified name of the declaring class/type + The name of the method, property or constructor to patch + The + An array of argument types to target overloads + Array of + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The + An array of argument types to target overloads + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The + An array of argument types to target overloads + Array of + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The name of the method, property or constructor to patch + The + + + + An annotation that specifies a method, property or constructor to patch + The name of the method, property or constructor to patch + + + + An annotation that specifies a method, property or constructor to patch + The name of the method, property or constructor to patch + An array of argument types to target overloads + + + + An annotation that specifies a method, property or constructor to patch + The name of the method, property or constructor to patch + An array of argument types to target overloads + An array of + + + + An annotation that specifies a method, property or constructor to patch + The name of the method, property or constructor to patch + The + + + + An annotation that specifies a method, property or constructor to patch + The + + + + An annotation that specifies a method, property or constructor to patch + The + An array of argument types to target overloads + + + + An annotation that specifies a method, property or constructor to patch + The + An array of argument types to target overloads + An array of + + + + An annotation that specifies a method, property or constructor to patch + An array of argument types to target overloads + + + + An annotation that specifies a method, property or constructor to patch + An array of argument types to target overloads + An array of + + + + Annotation to define the original method for delegate injection + + + + An annotation that specifies a class to patch + The declaring class/type + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The argument types of the method or constructor to patch + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The name of the method, property or constructor to patch + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The name of the method, property or constructor to patch + An array of argument types to target overloads + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The name of the method, property or constructor to patch + An array of argument types to target overloads + Array of + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The + An array of argument types to target overloads + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The + An array of argument types to target overloads + Array of + + + + An annotation that specifies a method, property or constructor to patch + The declaring class/type + The name of the method, property or constructor to patch + The + + + + An annotation that specifies a method, property or constructor to patch + The name of the method, property or constructor to patch + + + + An annotation that specifies a method, property or constructor to patch + The name of the method, property or constructor to patch + An array of argument types to target overloads + + + + An annotation that specifies a method, property or constructor to patch + The name of the method, property or constructor to patch + An array of argument types to target overloads + An array of + + + + An annotation that specifies a method, property or constructor to patch + The name of the method, property or constructor to patch + The + + + + An annotation that specifies call dispatching mechanics for the delegate + The + + + + An annotation that specifies a method, property or constructor to patch + The + An array of argument types to target overloads + + + + An annotation that specifies a method, property or constructor to patch + The + An array of argument types to target overloads + An array of + + + + An annotation that specifies a method, property or constructor to patch + An array of argument types to target overloads + + + + An annotation that specifies a method, property or constructor to patch + An array of argument types to target overloads + An array of + + + + Annotation to define your standin methods for reverse patching + + + + An annotation that specifies the type of reverse patching + The of the reverse patch + + + + A Harmony annotation to define that all methods in a class are to be patched + + + + A Harmony annotation + + + + A Harmony annotation to define patch priority + The priority + + + + A Harmony annotation + + + + A Harmony annotation to define that a patch comes before another patch + The array of harmony IDs of the other patches + + + + A Harmony annotation + + + A Harmony annotation to define that a patch comes after another patch + The array of harmony IDs of the other patches + + + + A Harmony annotation + + + A Harmony annotation to debug a patch (output uses to log to your Desktop) + + + + A Harmony attribute + + + If specified on a prefix, postfix or a finalizer, the method will be automatically wrapped into try/catch. + + + + Specifies the Prepare function in a patch class + + + + Specifies the Cleanup function in a patch class + + + + Specifies the TargetMethod function in a patch class + + + + Specifies the TargetMethods function in a patch class + + + + Specifies the Prefix function in a patch class + + + + Specifies the Postfix function in a patch class + + + + Specifies the Transpiler function in a patch class + + + + Specifies the ILManipulator function in a patch class> + + + + Specifies the Finalizer function in a patch class + + + + A Harmony annotation + + + + The name of the original argument + + + + The index of the original argument + + + + The new name of the original argument + + + + An annotation to declare injected arguments by name + + + + An annotation to declare injected arguments by index + Zero-based index + + + + An annotation to declare injected arguments by renaming them + Name of the original argument + New name + + + + An annotation to declare injected arguments by index and renaming them + Zero-based index + New name + + + + An abstract wrapper around OpCode and their operands. Used by transpilers + + + + The opcode + + + + The operand + + + + All labels defined on this instruction + + + + All exception block boundaries defined on this instruction + + + + Creates a new CodeInstruction with a given opcode and optional operand + The opcode + The operand + + + + Create a full copy (including labels and exception blocks) of a CodeInstruction + The to copy + + + + Clones a CodeInstruction and resets its labels and exception blocks + A lightweight copy of this code instruction + + + + Clones a CodeInstruction, resets labels and exception blocks and sets its opcode + The opcode + A copy of this CodeInstruction with a new opcode + + + + Clones a CodeInstruction, resets labels and exception blocks and sets its operand + The operand + A copy of this CodeInstruction with a new operand + + + + Creates a CodeInstruction calling a method (CALL) + The class/type where the method is declared + The name of the method (case sensitive) + Optional parameters to target a specific overload of the method + Optional list of types that define the generic version of the method + A code instruction that calls the method matching the arguments + + + + Creates a CodeInstruction calling a method (CALL) + The target method in the form TypeFullName:MethodName, where the type name matches a form recognized by Type.GetType like Some.Namespace.Type. + Optional parameters to target a specific overload of the method + Optional list of types that define the generic version of the method + A code instruction that calls the method matching the arguments + + + + Creates a CodeInstruction calling a method (CALL) + The lambda expression using the method + + + + + Creates a CodeInstruction calling a method (CALL) + The lambda expression using the method + + + + + Creates a CodeInstruction calling a method (CALL) + The lambda expression using the method + + + + + Creates a CodeInstruction calling a method (CALL) + The lambda expression using the method + + + + + Creates a CodeInstruction loading a field (LD[S]FLD[A]) + The class/type where the field is defined + The name of the field (case sensitive) + Use address of field + + + + Creates a CodeInstruction storing to a field (ST[S]FLD) + The class/type where the field is defined + The name of the field (case sensitive) + + + + Returns a string representation of the code instruction + A string representation of the code instruction + + + + Exception block types + + + + The beginning of an exception block + + + + The beginning of a catch block + + + + The beginning of an except filter block + + + + The beginning of a fault block + + + + The beginning of a finally block + + + + The end of an exception block + + + + An exception block + + + + Block type + + + + Catch type + + + + Creates an exception block + The + The catch type + + + + + An exception thrown when a patch argument in a Harmony patch is invalid. + + + + + Original method to be patched. + + + + + Patch that was attempted to be applied. + + + + + + + + Constructs a new exception instance. + + Message of the exception. + Original method to be patched. + Patch that was attempted to be applied. + + + + An exception thrown when a reflection member is not found. + + + + + + + The Harmony instance is the main entry to Harmony. After creating one with an unique identifier, it is used to patch and query the current application domain + + + + Set to true before instantiating Harmony to debug Harmony or use an environment variable to set HARMONY_DEBUG to '1' like this: cmd /C "set HARMONY_DEBUG=1 && game.exe" + This is for full debugging. To debug only specific patches, use the attribute + + + + Creates a new Harmony instance + A unique identifier (you choose your own) + A Harmony instance + + + + The unique identifier + + + + Searches the current assembly for Harmony annotations and uses them to create patches + + + + Creates a empty patch processor for an original method + The original method/constructor + A new instance + + + + Creates a patch class processor from an annotated class + The class/type + A new instance + + + + Creates a patch class processor from an annotated class + The class/type + If true, the type doesn't need to have any attributes present for processing + A new instance + + + + Creates a reverse patcher for one of your stub methods + The original method/constructor + The stand-in stub method as + A new instance + + + + Searches an assembly for Harmony annotations and uses them to create patches + The assembly + + + + Searches the given type for Harmony annotation and uses them to create patches + The type to search + + + + Creates patches by manually specifying the methods + The original method/constructor + An optional prefix method wrapped in a object + An optional postfix method wrapped in a object + An optional transpiler method wrapped in a object + An optional finalizer method wrapped in a object + An optional ilmanipulator method wrapped in a + The replacement method that was created to patch the original method + + + + Creates patches by manually specifying the methods + The original method/constructor + An optional prefix method wrapped in a object + An optional postfix method wrapped in a object + An optional transpiler method wrapped in a object + An optional finalizer method wrapped in a object + The replacement method that was created to patch the original method + + + + Patches a foreign method onto a stub method of yours and optionally applies transpilers during the process + The original method/constructor you want to duplicate + Your stub method as that will become the original. Needs to have the correct signature (either original or whatever your transpilers generates) + An optional transpiler as method that will be applied during the process + An optional ilmanipulator as method that will be applied during the process + The replacement method that was created to patch the stub method + + + + Patches a foreign method onto a stub method of yours and optionally applies transpilers during the process + The original method/constructor you want to duplicate + Your stub method as that will become the original. Needs to have the correct signature (either original or whatever your transpilers generates) + An optional transpiler as method that will be applied during the process + The replacement method that was created to patch the stub method + + + + Unpatches methods by patching them with zero patches. Fully unpatching is not supported. Be careful, unpatching is global + The optional Harmony ID to restrict unpatching to a specific Harmony instance + This method could be static if it wasn't for the fact that unpatching creates a new replacement method that contains your harmony ID + + + + Unpatches all methods that were patched by this Harmony instance's ID. Unpatching is done by repatching methods without patches of this instance. + + + + Unpatches a method by patching it with zero patches. Fully unpatching is not supported. Be careful, unpatching is global + The original method/constructor + The + The optional Harmony ID to restrict unpatching to a specific Harmony instance + + + + Unpatches a method by patching it with zero patches. Fully unpatching is not supported. Be careful, unpatching is global + The original method/constructor + The patch method as method to remove + + + + Test for patches from a specific Harmony ID + The Harmony ID + True if patches for this ID exist + + + + Gets patch information for a given original method + The original method/constructor + The patch information as + + + + Gets the methods this instance has patched + An enumeration of original methods/constructors + + + + Gets all patched original methods in the appdomain + An enumeration of patched original methods/constructors + + + + Gets the original method from a given replacement method + A replacement method, for example from a stacktrace + The original method/constructor or null if not found + + + + Tries to get the method from a stackframe including dynamic replacement methods + The + For normal frames, frame.GetMethod() is returned. For frames containing patched methods, the replacement method is returned or null if no method can be found + + + + Gets Harmony version for all active Harmony instances + [out] The current Harmony version + A dictionary containing assembly versions keyed by Harmony IDs + + + + Creates a new Harmony instance and applies all patches specified in the type + The type to scan for patches. + The ID for the Harmony instance to create, which will be used. + + + + Applies all patches specified in the assembly + The assembly to scan. + The ID for the Harmony instance to create, which will be used. + + + + Under Mono, HarmonyException wraps IL compile errors with detailed information about the failure + + + + Default serialization constructor (not implemented) + The info + The context + + + + Get a list of IL instructions in pairs of offset+code + A list of key/value pairs which represent an offset and the code at that offset + + + + Get a list of IL instructions without offsets + A list of + + + + Get the error offset of the errornous IL instruction + The offset + + + + Get the index of the errornous IL instruction + The index into the list of instructions or -1 if not found + + + + A wrapper around a method to use it as a patch (for example a Prefix) + + + + The original method + + + + Class/type declaring this patch + + + + Patch method name + + + + Optional patch + + + + Array of argument types of the patch method + + + + of the patch + + + + Install this patch before patches with these Harmony IDs + + + + Install this patch after patches with these Harmony IDs + + + + Reverse patch type, see + + + + Create debug output for this patch + + + + Whether to use (true) or (false) mechanics + for -attributed delegate + + + + Whether to wrap the patch itself into a try/catch. + + + + Default constructor + + + + Creates a patch from a given method + The original method + + + + Creates a patch from a given method + The original method + The patch + A list of harmony IDs that should come after this patch + A list of harmony IDs that should come before this patch + Set to true to generate debug output + + + + Creates a patch from a given method + The patch class/type + The patch method name + The optional argument types of the patch method (for overloaded methods) + + + + Gets the names of all internal patch info fields + A list of field names + + + + Merges annotations + The list of to merge + The merged + + + + Returns a string that represents the annotation + A string representation + + + + Annotation extensions + + + + Copies annotation information + The source + The destination + + + + Clones an annotation + The to clone + A copied + + + + Merges annotations + The master + The detail + A new, merged + + + + Gets all annotations on a class/type + The class/type + A list of all + + + + Gets merged annotations on a class/type + The class/type + The merged + + + + Gets all annotations on a method + The method/constructor + A list of + + + + Gets merged annotations on a method + The method/constructor + The merged + + + + + A mutable representation of an inline signature, similar to Mono.Cecil's CallSite. + Used by the calli instruction, can be used by transpilers + + + + + See + + + + See + + + + See + + + + The list of all parameter types or function pointer signatures received by the call site + + + + The return type or function pointer signature returned by the call site + + + + Returns a string representation of the inline signature + A string representation of the inline signature + + + + + A mutable representation of a parameter type with an attached type modifier, + similar to Mono.Cecil's OptionalModifierType / RequiredModifierType and C#'s modopt / modreq + + + + + Whether this is a modopt (optional modifier type) or a modreq (required modifier type) + + + + The modifier type attached to the parameter type + + + + The modified parameter type + + + + Returns a string representation of the modifier type + A string representation of the modifier type + + + + Patch serialization + + + + Control the binding of a serialized object to a type + Specifies the assembly name of the serialized object + Specifies the type name of the serialized object + The type of the object the formatter creates a new instance of + + + + Serializes a patch info + The + The serialized data + + + + Deserialize a patch info + The serialized data + A + + + + Compare function to sort patch priorities + The patch + Zero-based index + The priority + A standard sort integer (-1, 0, 1) + + + + Serializable patch information + + + + Prefixes as an array of + + + + Postfixes as an array of + + + + Transpilers as an array of + + + + Finalizers as an array of + + + + ILManipulators as an array of + + + + Returns if any of the patches wants debugging turned on + + + + Adds prefixes + An owner (Harmony ID) + The patch methods + + + + Adds a prefix + + + Removes prefixes + The owner of the prefixes, or * for all + + + + Adds postfixes + An owner (Harmony ID) + The patch methods + + + + Adds a postfix + + + Removes postfixes + The owner of the postfixes, or * for all + + + + Adds transpilers + An owner (Harmony ID) + The patch methods + + + + Adds a transpiler + + + Removes transpilers + The owner of the transpilers, or * for all + + + + Adds finalizers + An owner (Harmony ID) + The patch methods + + + + Adds a finalizer + + + Removes finalizers + The owner of the finalizers, or * for all + + + + Adds ilmanipulators + An owner (Harmony ID) + The patch methods + + + + Removes ilmanipulators + The owner of the ilmanipulators, or * for all + + + + Removes a patch using its method + The method of the patch to remove + + + + Gets a concatenated list of patches + The Harmony instance ID adding the new patches + The patches to add + The current patches + + + + Gets a list of patches with any from the given owner removed + The owner of the methods, or * for all + The current patches + + + + A serializable patch + + + + Zero-based index + + + + The owner (Harmony ID) + + + + The priority, see + + + + Keep this patch before the patches indicated in the list of Harmony IDs + + + + Keep this patch after the patches indicated in the list of Harmony IDs + + + + A flag that will log the replacement method via every time this patch is used to build the replacement, even in the future + + + + Whether to wrap the patch into a general try/catch that logs the error + + + + The method of the static patch method + + + + Creates a patch + The method of the patch + Zero-based index + An owner (Harmony ID) + The priority, see + A list of Harmony IDs for patches that should run after this patch + A list of Harmony IDs for patches that should run before this patch + A flag that will log the replacement method via every time this patch is used to build the replacement, even in the future + + + + Creates a patch + The method of the patch + Zero-based index + An owner (Harmony ID) + The priority, see + A list of Harmony IDs for patches that should run after this patch + A list of Harmony IDs for patches that should run before this patch + A flag that will log the replacement method via every time this patch is used to build the replacement, even in the future + Whether to wrap the patch into a general try/catch that logs the error + + + + Creates a patch + The method of the patch + Zero-based index + An owner (Harmony ID) + + + Get the patch method or a DynamicMethod if original patch method is a patch factory + The original method/constructor + The method of the patch + + + + Determines whether patches are equal + The other patch + true if equal + + + + Determines how patches sort + The other patch + integer to define sort order (-1, 0, 1) + + + + Hash function + A hash code + + + + A PatchClassProcessor used to turn on a class/type into patches + + + + Creates a patch class processor by pointing out a class. Similar to PatchAll() but without searching through all classes. + The Harmony instance + The class to process (need to have at least a [HarmonyPatch] attribute if allowUnannotatedType is set to false) + + + + Creates a patch class processor by pointing out a class. Similar to PatchAll() but without searching through all classes. + The Harmony instance + The class to process (need to have at least a [HarmonyPatch] attribute if allowUnannotatedType is set to false) + If true, the type doesn't need to have any attributes present for processing + + + + Applies the patches + A list of all created replacement methods or null if patch class is not annotated + + + + A group of patches + + + + A collection of prefix + + + + A collection of postfix + + + + A collection of transpiler + + + + A collection of finalizer + + + + A collection of ILManipulator + + + + Gets all owners (Harmony IDs) or all known patches + The patch owners + + + + Creates a group of patches + An array of prefixes as + An array of postfixes as + An array of transpileres as + An array of finalizeres as + An array of ilmanipulators as + + + + Creates a group of patches + An array of prefixes as + An array of postfixes as + An array of transpileres as + An array of finalizeres as + + + + + IL manipulator to create Harmony-style patches + + + + + + Manipulates a by applying Harmony patches to it. + + Reference to the method that should be considered as original. Used to reference parameter and return types. + Collection of Harmony patches to apply. + Method body to manipulate as instance. Should contain instructions to patch. + + In most cases you will want to use to create or obtain global + patch info for the method that contains aggregated info of all Harmony instances. + + + + + + Method patcher for normal managed methods that have IL body attached to them. + Uses in order to apply hooks in a way compatible with MonoMod's own + hooking system. + + + + + + + + + + + + + + + + + + A handler for that checks if a method is a normal Managed method. + + Not used + Patch resolver arguments + + + + + A general method patcher for implementing custom Harmony patcher backends. + + + + + + Constructs a method patcher + + Original method to patch + + + + + Original method to patch. + + + + + + Prepares method body for the unpatched that simply calls + function. + + + A that contains a call to + the original method to pass to the IL manipulator. + If null, Harmony patches must be manually applied to the original via . + + + + + + Detours to the provided replacement function. If called multiple times, + is re-detoured to the new method. + + + Result of + if returned non-null. + Otherwise, this will be null, in which case you must manually generate Harmony-patched method + with . + + of the hook, if it's different from `replacement`. + + + + + Creates a copy of the original method. If not possible, creates a method that calls into the original method. + + Copy of the original method that is transpileable. If not possible, returns null. + + This method creates a pure copy of the original method that is usable with transpilers. Currently, this + method is used to generate reverse patchers. + If a purse IL copy is not possible, a best approximation should be generated + (e.g. a wrapper that calls original method). + If no best approximation is possible, this method should return null, in which case generating reverse + patchers for the method will fail. + + + + + + A method patcher that uses to patch internal calls, + methods marked with and any other managed method that CLR managed-to-native + trampolines for and which has no IL body defined. + + + + + Constructs a new instance of method patcher. + + + + + + + + + + + + + + + A handler for that checks if a method doesn't have a body + (e.g. it's icall or marked with ) and thus can be patched with + . + + Not used + Patch resolver arguments + + + + + A global manager for handling Harmony patch state. Contains information about all patched methods and all + actual instances that handle patching implementation. + + + + + + Method patcher resolve event. + + + When a method is to be patched, this resolver event is called once on the method to determine which + backend to use in order to patch the method. + To make Harmony use the specified backend, set to an + instance of the method patcher backend to use. + + + + + + Creates or gets an existing instance of that handles patching the method. + + Method to patch. + Instance of that handles patching the method. + No suitable patcher found for the method. + + + + + Gets patch info for the given target method. + + Method to get patch info for. + Current patch info of the method. + + + + + Gets or creates patch info for the given method. + + Method to get info from. + An existing or new patch info for the method containing information about the applied patches. + + + + + Gets all methods that have been patched. + + List of methods that have been patched. + + + + + Removes all method resolvers. Use with care, this removes the default ones too! + + + + + Patcher resolve event arguments. + + + + + + Original method that is to be patched. + + + + + + Method patcher to use to patch . + Set this value to specify which one to use. + + + + + A PatchProcessor handles patches on a method/constructor + + + + Creates an empty patch processor + The Harmony instance + The original method/constructor + + + + Adds a prefix + The prefix as a + A for chaining calls + + + + Adds a prefix + The prefix method + A for chaining calls + + + + Adds a postfix + The postfix as a + A for chaining calls + + + + Adds a postfix + The postfix method + A for chaining calls + + + + Adds a transpiler + The transpiler as a + A for chaining calls + + + + Adds a transpiler + The transpiler method + A for chaining calls + + + + Adds a finalizer + The finalizer as a + A for chaining calls + + + + Adds a finalizer + The finalizer method + A for chaining calls + + + + Adds an ilmanipulator + The ilmanipulator as a + A for chaining calls + + + + Adds an ilmanipulator + The ilmanipulator method + A for chaining calls + + + + Gets all patched original methods in the appdomain + An enumeration of patched method/constructor + + + + Applies all registered patches + The generated replacement method + + + + Unpatches patches of a given type and/or Harmony ID + The patch type + Harmony ID or * for any + A for chaining calls + + + + Unpatches a specific patch + The method of the patch + A for chaining calls + + + + Gets patch information on an original + The original method/constructor + The patch information as + + + + Sort patch methods by their priority rules + The original method + Patches to sort + The sorted patch methods + + + + Gets Harmony version for all active Harmony instances + [out] The current Harmony version + A dictionary containing assembly version keyed by Harmony ID + + + + Creates a new empty generator to use when reading method bodies + A new + + + + Creates a new generator matching the method/constructor to use when reading method bodies + The original method/constructor to copy method information from + A new + + + + Returns the methods unmodified list of code instructions + The original method/constructor + Optionally an existing generator that will be used to create all local variables and labels contained in the result (if not specified, an internal generator is used) + A list containing all the original + + + + Returns the methods unmodified list of code instructions + The original method/constructor + A new generator that now contains all local variables and labels contained in the result + A list containing all the original + + + + Returns the methods current list of code instructions after all existing transpilers have been applied + The original method/constructor + Apply only the first count of transpilers + Optionally an existing generator that will be used to create all local variables and labels contained in the result (if not specified, an internal generator is used) + A list of + + + + Returns the methods current list of code instructions after all existing transpilers have been applied + The original method/constructor + A new generator that now contains all local variables and labels contained in the result + Apply only the first count of transpilers + A list of + + + + A low level way to read the body of a method. Used for quick searching in methods + The original method + All instructions as opcode/operand pairs + + + + A low level way to read the body of a method. Used for quick searching in methods + The original method + An existing generator that will be used to create all local variables and labels contained in the result + All instructions as opcode/operand pairs + + + + A patch priority + + + + Patch last + + + + Patch with very low priority + + + + Patch with low priority + + + + Patch with lower than normal priority + + + + Patch with normal priority + + + + Patch with higher than normal priority + + + + Patch with high priority + + + + Patch with very high priority + + + + Patch first + + + + A reverse patcher + + + + Creates a reverse patcher + The Harmony instance + The original method/constructor + Your stand-in stub method as + + + + Applies the patch + The type of patch, see + The generated replacement method + + + + A collection of commonly used transpilers + + + + Returns an instruction to call the specified delegate + The delegate type to emit + The delegate to emit + The instruction to call the specified action + + + + A transpiler that replaces all occurrences of a given method with another one using the same signature + The enumeration of to act on + Method or constructor to search for + Method or constructor to replace with + Modified enumeration of + + + + A transpiler that alters instructions that match a predicate by calling an action + The enumeration of to act on + A predicate selecting the instructions to change + An action to apply to matching instructions + Modified enumeration of + + + + A transpiler that logs a text at the beginning of the method + The instructions to act on + The log text + Modified enumeration of + + + + A transpiler that replaces the entire body of the method with another one + The replacement method. It's up to the caller of this transpiler to make sure that the signatures match. + of the patch. This is passed via transpiler. + A collection of that contains instructions of replacement method. + The replacement method is not a managed method that contains any IL. + This transpiler has a side effect of clearing up all previous locals and previous transpilers. + Use to run this transpiler as early as possible. + + + A helper class for reflection related functions + + + + Shortcut for to simplify the use of reflections and make it work for any access level + + + + Shortcut for to simplify the use of reflections and make it work for any access level but only within the current type + + + + Enumerates all assemblies in the current app domain, excluding visual studio assemblies + An enumeration of + + + Gets a type by name. Prefers a full name with namespace but falls back to the first type matching the name otherwise + The name + A type or null if not found + + + + Gets all successfully loaded types from a given assembly + The assembly + An array of types + + This calls and returns , while catching any thrown . + If such an exception is thrown, returns the successfully loaded types (, + filtered for non-null values). + + + + + Enumerates all successfully loaded types in the current app domain, excluding visual studio assemblies + An enumeration of all in all assemblies, excluding visual studio assemblies + + + Applies a function going up the type hierarchy and stops at the first non-null result + Result type of func() + The class/type to start with + The evaluation function returning T + The first non-null result, or null if no match + + The type hierarchy of a class or value type (including struct) does NOT include implemented interfaces, + and the type hierarchy of an interface is only itself (regardless of whether that interface implements other interfaces). + The top-most type in the type hierarchy of all non-interface types (including value types) is . + + + + + Applies a function going into inner types and stops at the first non-null result + Generic type parameter + The class/type to start with + The evaluation function returning T + The first non-null result, or null if no match + + + + Gets the reflection information for a directly declared field + The class/type where the field is defined + The name of the field + A field or null when type/name is null or when the field cannot be found + + + + Gets the reflection information for a field by searching the type and all its super types + The class/type where the field is defined + The name of the field (case sensitive) + A field or null when type/name is null or when the field cannot be found + + + + Gets the reflection information for a field + The class/type where the field is declared + The zero-based index of the field inside the class definition + A field or null when type is null or when the field cannot be found + + + + Gets the reflection information for a directly declared property + The class/type where the property is declared + The name of the property (case sensitive) + A property or null when type/name is null or when the property cannot be found + + + + Gets the reflection information for the getter method of a directly declared property + The class/type where the property is declared + The name of the property (case sensitive) + A method or null when type/name is null or when the property cannot be found + + + + Gets the reflection information for the setter method of a directly declared property + The class/type where the property is declared + The name of the property (case sensitive) + A method or null when type/name is null or when the property cannot be found + + + + Gets the reflection information for a property by searching the type and all its super types + The class/type + The name + A property or null when type/name is null or when the property cannot be found + + + + Gets the reflection information for the getter method of a property by searching the type and all its super types + The class/type + The name + A method or null when type/name is null or when the property cannot be found + + + + Gets the reflection information for the setter method of a property by searching the type and all its super types + The class/type + The name + A method or null when type/name is null or when the property cannot be found + + + + Gets the reflection information for a directly declared method + The class/type where the method is declared + The name of the method (case sensitive) + Optional parameters to target a specific overload of the method + Optional list of types that define the generic version of the method + A method or null when type/name is null or when the method cannot be found + + + + Gets the reflection information for a method by searching the type and all its super types + The class/type where the method is declared + The name of the method (case sensitive) + Optional parameters to target a specific overload of the method + Optional list of types that define the generic version of the method + A method or null when type/name is null or when the method cannot be found + + + + Gets the reflection information for a method by searching the type and all its super types + The target method in the form TypeFullName:MethodName, where the type name matches a form recognized by Type.GetType like Some.Namespace.Type. + Optional parameters to target a specific overload of the method + Optional list of types that define the generic version of the method + A method or null when type/name is null or when the method cannot be found + + + + Gets the names of all method that are declared in a type + The declaring class/type + A list of method names + + + + Gets the names of all method that are declared in the type of the instance + An instance of the type to search in + A list of method names + + + + Gets the names of all fields that are declared in a type + The declaring class/type + A list of field names + + + + Gets the names of all fields that are declared in the type of the instance + An instance of the type to search in + A list of field names + + + + Gets the names of all properties that are declared in a type + The declaring class/type + A list of property names + + + + Gets the names of all properties that are declared in the type of the instance + An instance of the type to search in + A list of property names + + + + Gets the type of any class member of + A member + The class/type of this member + + + + Test if a class member is actually an concrete implementation + A member + True if the member is a declared + + + + Gets the real implementation of a class member + A member + The member itself if its declared. Otherwise the member that is actually implemented in some base type + + + + Gets the reflection information for a directly declared constructor + The class/type where the constructor is declared + Optional parameters to target a specific overload of the constructor + Optional parameters to only consider static constructors + A constructor info or null when type is null or when the constructor cannot be found + + + + Gets the reflection information for a constructor by searching the type and all its super types + The class/type where the constructor is declared + Optional parameters to target a specific overload of the method + Optional parameters to only consider static constructors + A constructor info or null when type is null or when the method cannot be found + + + + Gets reflection information for all declared constructors + The class/type where the constructors are declared + Optional parameters to only consider static constructors + A list of constructor infos + + + + Gets reflection information for all declared methods + The class/type where the methods are declared + A list of methods + + + + Gets reflection information for all declared properties + The class/type where the properties are declared + A list of properties + + + + Gets reflection information for all declared fields + The class/type where the fields are declared + A list of fields + + + + Gets the return type of a method or constructor + The method/constructor + The return type + + + + Given a type, returns the first inner type matching a recursive search by name + The class/type to start searching at + The name of the inner type (case sensitive) + The inner type or null if type/name is null or if a type with that name cannot be found + + + + Given a type, returns the first inner type matching a recursive search with a predicate + The class/type to start searching at + The predicate to search with + The inner type or null if type/predicate is null or if a type with that name cannot be found + + + + Given a type, returns the first method matching a predicate + The class/type to start searching at + The predicate to search with + The method or null if type/predicate is null or if a type with that name cannot be found + + + + Given a type, returns the first constructor matching a predicate + The class/type to start searching at + The predicate to search with + The constructor info or null if type/predicate is null or if a type with that name cannot be found + + + + Given a type, returns the first property matching a predicate + The class/type to start searching at + The predicate to search with + The property or null if type/predicate is null or if a type with that name cannot be found + + + + Returns an array containing the type of each object in the given array + An array of objects + An array of types or an empty array if parameters is null (if an object is null, the type for it will be object) + + + + Creates an array of input parameters for a given method and a given set of potential inputs + The method/constructor you are planing to call + The possible input parameters in any order + An object array matching the method signature + + + + A readable/assignable reference delegate to an instance field of a class or static field (NOT an instance field of a struct) + + An arbitrary type if the field is static; otherwise the class that defines the field, or a parent class (including ), + implemented interface, or derived class of this type + + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The runtime instance to access the field (ignored and can be omitted for static fields) + A readable/assignable reference to the field + Null instance passed to a non-static field ref delegate + + Instance of invalid type passed to a non-static field ref delegate + (this can happen if is a parent class or interface of the field's declaring type) + + + + This delegate cannot be used for instance fields of structs, since a struct instance passed to the delegate would be passed by + value and thus would be a copy that only exists within the delegate's invocation. This is fine for a readonly reference, + but makes assignment futile. Use instead. + + + Note that is not required to be the field's declaring type. It can be a parent class (including ), + implemented interface, or a derived class of the field's declaring type ("instanceOfT is FieldDeclaringType" must be possible). + Specifically, must be assignable from OR to the field's declaring type. + Technically, this allows Nullable, although Nullable is only relevant for structs, and since only static fields of structs + are allowed for this delegate, and the instance passed to such a delegate is ignored, this hardly matters. + + + Similarly, is not required to be the field's field type, unless that type is a non-enum value type. + It can be a parent class (including object) or implemented interface of the field's field type. It cannot be a derived class. + This variance is not allowed for value types, since that would require boxing/unboxing, which is not allowed for ref values. + Special case for enum types: can also be the underlying integral type of the enum type. + Specifically, for reference types, must be assignable from + the field's field type; for non-enum value types, must be exactly the field's field type; for enum types, + must be either the field's field type or the underyling integral type of that field type. + + + This delegate supports static fields, even those defined in structs, for legacy reasons. + For such static fields, is effectively ignored. + Consider using (and StaticFieldRefAccess methods that return it) instead for static fields. + + + + + + Creates a field reference delegate for an instance field of a class + The class that defines the instance field, or derived class of this type + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The name of the field + A readable/assignable delegate + + + For backwards compatibility, there is no class constraint on . + Instead, the non-value-type check is done at runtime within the method. + + + + + + Creates an instance field reference for a specific instance of a class + The class that defines the instance field, or derived class of this type + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The instance + The name of the field + A readable/assignable reference to the field + + + This method is meant for one-off access to a field's value for a single instance. + If you need to access a field's value for potentially multiple instances, use instead. + FieldRefAccess<T, F>(instance, fieldName) is functionally equivalent to FieldRefAccess<T, F>(fieldName)(instance). + + + For backwards compatibility, there is no class constraint on . + Instead, the non-value-type check is done at runtime within the method. + + + + + + Creates a field reference delegate for an instance field of a class or static field (NOT an instance field of a struct) + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + + The type that defines the field, or derived class of this type; must not be a struct type unless the field is static + + The name of the field + + A readable/assignable delegate with T=object + (for static fields, the instance delegate parameter is ignored) + + + + This method is meant for cases where the given type is only known at runtime and thus can't be used as a type parameter T + in e.g. . + + + This method supports static fields, even those defined in structs, for legacy reasons. + Consider using (and other overloads) instead for static fields. + + + + + + Creates a field reference delegate for an instance field of a class or static field (NOT an instance field of a struct) + + An arbitrary type if the field is static; otherwise the class that defines the field, or a parent class (including ), + implemented interface, or derived class of this type ("instanceOfT is FieldDeclaringType" must be possible) + + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The field + A readable/assignable delegate + + + This method is meant for cases where the field has already been obtained, avoiding the field searching cost in + e.g. . + + + This method supports static fields, even those defined in structs, for legacy reasons. + For such static fields, is effectively ignored. + Consider using (and other overloads) instead for static fields. + + + For backwards compatibility, there is no class constraint on . + Instead, the non-value-type check is done at runtime within the method. + + + + + + Creates a field reference for an instance field of a class + + The type that defines the field; or a parent class (including ), implemented interface, or derived class of this type + ("instanceOfT is FieldDeclaringType" must be possible) + + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The instance + The field + A readable/assignable reference to the field + + + This method is meant for one-off access to a field's value for a single instance and where the field has already been obtained. + If you need to access a field's value for potentially multiple instances, use instead. + FieldRefAccess<T, F>(instance, fieldInfo) is functionally equivalent to FieldRefAccess<T, F>(fieldInfo)(instance). + + + For backwards compatibility, there is no class constraint on . + Instead, the non-value-type check is done at runtime within the method. + + + + + + A readable/assignable reference delegate to an instance field of a struct + The struct that defines the instance field + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + A reference to the runtime instance to access the field + A readable/assignable reference to the field + + + + Creates a field reference delegate for an instance field of a struct + The struct that defines the instance field + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The name of the field + A readable/assignable delegate + + + + Creates an instance field reference for a specific instance of a struct + The struct that defines the instance field + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The instance + The name of the field + A readable/assignable reference to the field + + + This method is meant for one-off access to a field's value for a single instance. + If you need to access a field's value for potentially multiple instances, use instead. + StructFieldRefAccess<T, F>(ref instance, fieldName) is functionally equivalent to StructFieldRefAccess<T, F>(fieldName)(ref instance). + + + + + + Creates a field reference delegate for an instance field of a struct + The struct that defines the instance field + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The field + A readable/assignable delegate + + + This method is meant for cases where the field has already been obtained, avoiding the field searching cost in + e.g. . + + + + + + Creates a field reference for an instance field of a struct + The struct that defines the instance field + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The instance + The field + A readable/assignable reference to the field + + + This method is meant for one-off access to a field's value for a single instance and where the field has already been obtained. + If you need to access a field's value for potentially multiple instances, use instead. + StructFieldRefAccess<T, F>(ref instance, fieldInfo) is functionally equivalent to StructFieldRefAccess<T, F>(fieldInfo)(ref instance). + + + + + + A readable/assignable reference delegate to a static field + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + A readable/assignable reference to the field + + + + Creates a static field reference + The type (can be class or struct) the field is defined in + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The name of the field + A readable/assignable reference to the field + + + + Creates a static field reference + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The type (can be class or struct) the field is defined in + The name of the field + A readable/assignable reference to the field + + + + Creates a static field reference + An arbitrary type (by convention, the type the field is defined in) + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The field + A readable/assignable reference to the field + + The type parameter is only used in exception messaging and to distinguish between this method overload + and the overload (which returns a rather than a reference). + + + + + Creates a static field reference delegate + + The type of the field; or if the field's type is a reference type (a class or interface, NOT a struct or other value type), + a type that is assignable from that type; or if the field's type is an enum type, + either that type or the underlying integral type of that enum type + + The field + A readable/assignable delegate + + + + Creates a delegate to a given method + The delegate Type + The method to create a delegate from. + + Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate + where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound) + instance delegate where the delegate invocation always applies to the given . + + + Only applies for instance methods. If true (default) and is virtual, invocation of the delegate + calls the instance method virtually (the instance type's most-derived/overriden implementation of the method is called); + else, invocation of the delegate calls the exact specified (this is useful for calling base class methods) + Note: if false and is an interface method, an ArgumentException is thrown. + + A delegate of given to given + + + Delegate invocation is more performant and more convenient to use than + at a one-time setup cost. + + + Works for both type of static and instance methods, both open and closed (a.k.a. unbound and bound) instance methods, + and both class and struct methods. + + + + + + Creates a delegate for a given delegate definition, attributed with [] + The delegate Type, attributed with [] + + Only applies for instance methods. If null (default), returned delegate is an open (a.k.a. unbound) instance delegate + where an instance is supplied as the first argument to the delegate invocation; else, delegate is a closed (a.k.a. bound) + instance delegate where the delegate invocation always applies to the given . + + A delegate of given to the method specified via [] + attributes on + + This calls with the method and virtualCall arguments + determined from the [] attributes on , + and the given (for closed instance delegates). + + + + + Returns who called the current method + The calling method/constructor (excluding the caller) + + + + Rethrows an exception while preserving its stack trace (throw statement typically clobbers existing stack traces) + The exception to rethrow + + + + True if the current runtime is based on Mono, false otherwise (.NET) + + + + True if the current runtime is .NET Framework, false otherwise (.NET Core or Mono, although latter isn't guaranteed) + + + + True if the current runtime is .NET Core, false otherwise (Mono or .NET Framework) + + + + Throws a missing member runtime exception + The type that is involved + A list of names + + + + Gets default value for a specific type + The class/type + The default value + + + + Creates an (possibly uninitialized) instance of a given type + The class/type + The new instance + + + + Creates an (possibly uninitialized) instance of a given type + The class/type + The new instance + + + + + A cache for the or similar Add methods for different types. + + + + Makes a deep copy of any object + The type of the instance that should be created; for legacy reasons, this must be a class or interface + The original object + A copy of the original object but of type T + + + + Makes a deep copy of any object + The type of the instance that should be created + The original object + [out] The copy of the original object + Optional value transformation function (taking a field name and src/dst instances) + The optional path root to start with + + + + Makes a deep copy of any object + The original object + The type of the instance that should be created + Optional value transformation function (taking a field name and src/dst instances) + The optional path root to start with + The copy of the original object + + + + Tests if a type is a struct + The type + True if the type is a struct + + + + Tests if a type is a class + The type + True if the type is a class + + + + Tests if a type is a value type + The type + True if the type is a value type + + + + Tests if a type is an integer type + The type + True if the type represents some integer + + + + Tests if a type is a floating point type + The type + True if the type represents some floating point + + + + Tests if a type is a numerical type + The type + True if the type represents some number + + + + Tests if a type is void + The type + True if the type is void + + + + Test whether an instance is of a nullable type + Type of instance + An instance to test + True if instance is of nullable type, false if not + + + + Tests whether a type or member is static, as defined in C# + The type or member + True if the type or member is static + + + + Tests whether a type is static, as defined in C# + The type + True if the type is static + + + + Tests whether a property is static, as defined in C# + The property + True if the property is static + + + + Tests whether an event is static, as defined in C# + The event + True if the event is static + + + + Calculates a combined hash code for an enumeration of objects + The objects + The hash code + + + + A CodeInstruction match + + + The name of the match + + + The matched opcodes + + + The matched operands + + + The matched labels + + + The matched blocks + + + The jumps from the match + + + The jumps to the match + + + The match predicate + + + Creates a code match + The optional opcode + The optional operand + The optional name + + + + Creates a code match + The CodeInstruction + An optional name + + + + Creates a code match + The predicate + An optional name + + + + Returns a string that represents the match + A string representation + + + + A CodeInstruction matcher + + + The current position + The index or -1 if out of bounds + + + + Gets the number of code instructions in this matcher + The count + + + + Checks whether the position of this CodeMatcher is within bounds + True if this CodeMatcher is valid + + + + Checks whether the position of this CodeMatcher is outside its bounds + True if this CodeMatcher is invalid + + + + Gets the remaining code instructions + The remaining count + + + + Gets the opcode at the current position + The opcode + + + + Gets the operand at the current position + The operand + + + + Gets the labels at the current position + The labels + + + + Gets the exception blocks at the current position + The blocks + + + + Creates an empty code matcher + + + Creates a code matcher from an enumeration of instructions + The instructions (transpiler argument) + An optional IL generator + + + + Makes a clone of this instruction matcher + A copy of this matcher + + + + Gets instructions at the current position + The instruction + + + + Gets instructions at the current position with offset + The offset + The instruction + + + + Gets all instructions + A list of instructions + + + + Gets all instructions as an enumeration + A list of instructions + + + + Gets some instructions counting from current position + Number of instructions + A list of instructions + + + + Gets all instructions within a range + The start index + The end index + A list of instructions + + + + Gets all instructions within a range (relative to current position) + The start offset + The end offset + A list of instructions + + + + Gets a list of all distinct labels + The instructions (transpiler argument) + A list of Labels + + + + Reports a failure + The method involved + The logger + True if current position is invalid and error was logged + + + + Sets an instruction at current position + The instruction to set + The same code matcher + + + + Sets instruction at current position and advances + The instruction + The same code matcher + + + + Sets opcode and operand at current position + The opcode + The operand + The same code matcher + + + + Sets opcode and operand at current position and advances + The opcode + The operand + The same code matcher + + + + Sets opcode at current position and advances + The opcode + The same code matcher + + + + Sets operand at current position and advances + The operand + The same code matcher + + + + Creates a label at current position + [out] The label + The same code matcher + + + + Creates a label at a position + The position + [out] The new label + The same code matcher + + + + Adds an enumeration of labels to current position + The labels + The same code matcher + + + + Adds an enumeration of labels at a position + The position + The labels + The same code matcher + + + + Sets jump to + Branch instruction + Destination for the jump + [out] The created label + The same code matcher + + + + Inserts some instructions + The instructions + The same code matcher + + + + Inserts an enumeration of instructions + The instructions + The same code matcher + + + + Inserts a branch + The branch opcode + Branch destination + The same code matcher + + + + Inserts some instructions and advances the position + The instructions + The same code matcher + + + + Inserts an enumeration of instructions and advances the position + The instructions + The same code matcher + + + + Inserts a branch and advances the position + The branch opcode + Branch destination + The same code matcher + + + + Removes current instruction + The same code matcher + + + + Removes some instruction fro current position by count + Number of instructions + The same code matcher + + + + Removes the instructions in a range + The start + The end + The same code matcher + + + + Removes the instructions in a offset range + The start offset + The end offset + The same code matcher + + + + Advances the current position + The offset + The same code matcher + + + + Moves the current position to the start + The same code matcher + + + + Moves the current position to the end + The same code matcher + + + + Searches forward with a predicate and advances position + The predicate + The same code matcher + + + + Searches backwards with a predicate and reverses position + The predicate + The same code matcher + + + + Matches forward and advances position + True to set position to end of match, false to set it to the beginning of the match + Some code matches + The same code matcher + + + + Matches backwards and reverses position + True to set position to end of match, false to set it to the beginning of the match + Some code matches + The same code matcher + + + + Repeats a match action until boundaries are met + The match action + An optional action that is executed when no match is found + The same code matcher + + + + Gets a match by its name + The match name + An instruction + + + + General extensions for common cases + + + + Joins an enumeration with a value converter and a delimiter to a string + The inner type of the enumeration + The enumeration + An optional value converter (from T to string) + An optional delimiter + The values joined into a string + + + + Converts an array of types (for example methods arguments) into a human readable form + The array of types + A human readable description including brackets + + + + A full description of a type + The type + A human readable description + + + + A a full description of a method or a constructor without assembly details but with generics + The method/constructor + A human readable description + + + + A helper converting parameter infos to types + The array of parameter infos + An array of types + + + + A helper to access a value via key from a dictionary + The key type + The value type + The dictionary + The key + The value for the key or the default value (of T) if that key does not exist + + + + A helper to access a value via key from a dictionary with extra casting + The value type + The dictionary + The key + The value for the key or the default value (of T) if that key does not exist or cannot be cast to T + + + + Escapes Unicode and ASCII non printable characters + The string to convert + The string to convert + A string literal surrounded by + + + + Extensions for + + + + Shortcut for testing whether the operand is equal to a non-null value + The + The value + True if the operand has the same type and is equal to the value + + + + Shortcut for testing whether the operand is equal to a non-null value + The + The value + True if the operand is equal to the value + This is an optimized version of for + + + + Shortcut for code.opcode == opcode && code.OperandIs(operand) + The + The + The operand value + True if the opcode is equal to the given opcode and the operand has the same type and is equal to the given operand + + + + Shortcut for code.opcode == opcode && code.OperandIs(operand) + The + The + The operand value + True if the opcode is equal to the given opcode and the operand is equal to the given operand + This is an optimized version of for + + + + Tests for any form of Ldarg* + The + The (optional) index + True if it matches one of the variations + + + + Tests for Ldarga/Ldarga_S + The + The (optional) index + True if it matches one of the variations + + + + Tests for Starg/Starg_S + The + The (optional) index + True if it matches one of the variations + + + + Tests for any form of Ldloc* + The + The optional local variable + True if it matches one of the variations + + + + Tests for any form of Stloc* + The + The optional local variable + True if it matches one of the variations + + + + Tests if the code instruction branches + The + The label if the instruction is a branch operation or if not + True if the instruction branches + + + + Tests if the code instruction calls the method/constructor + The + The method + True if the instruction calls the method or constructor + + + + Tests if the code instruction loads a constant + The + True if the instruction loads a constant + + + + Tests if the code instruction loads an integer constant + The + The integer constant + True if the instruction loads the constant + + + + Tests if the code instruction loads a floating point constant + The + The floating point constant + True if the instruction loads the constant + + + + Tests if the code instruction loads an enum constant + The + The enum + True if the instruction loads the constant + + + + Tests if the code instruction loads a field + The + The field + Set to true if the address of the field is loaded + True if the instruction loads the field + + + + Tests if the code instruction stores a field + The + The field + True if the instruction stores this field + + + + Adds labels to the code instruction and return it + The + One or several to add + The same code instruction + + + Adds labels to the code instruction and return it + The + An enumeration of + The same code instruction + + + Extracts all labels from the code instruction and returns them + The + A list of + + + Moves all labels from the code instruction to a different one + The to move the labels from + The to move the labels to + The code instruction labels were moved from (now empty) + + + Moves all labels from a different code instruction to the current one + The to move the labels from + The to move the labels to + The code instruction that received the labels + + + Adds ExceptionBlocks to the code instruction and return it + The + One or several to add + The same code instruction + + + Adds ExceptionBlocks to the code instruction and return it + The + An enumeration of + The same code instruction + + + Extracts all ExceptionBlocks from the code instruction and returns them + The + A list of + + + Moves all ExceptionBlocks from the code instruction to a different one + The to move the ExceptionBlocks from + The to move the ExceptionBlocks to + The code instruction blocks were moved from (now empty) + + + Moves all ExceptionBlocks from a different code instruction to the current one + The to move the ExceptionBlocks from + The to move the ExceptionBlocks to + The code instruction that received the blocks + + + General extensions for collections + + + + A simple way to execute code for every element in a collection + The inner type of the collection + The collection + The action to execute + + + + A simple way to execute code for elements in a collection matching a condition + The inner type of the collection + The collection + The predicate + The action to execute + + + + A helper to add an item to a collection + The inner type of the collection + The collection + The item to add + The collection containing the item + + + + A helper to add an item to an array + The inner type of the collection + The array + The item to add + The array containing the item + + + + A helper to add items to an array + The inner type of the collection + The array + The items to add + The array containing the items + + + + General extensions for collections + + + + Tests a class member if it has an IL method body (external methods for example don't have a body) + The member to test + Returns true if the member has an IL body or false if not + + + A file log for debugging + + + + Full pathname of the log file, defaults to a file called harmony.log.txt on your Desktop + + + + The indent character. The default is tab + + + + The current indent level + + + + Changes the indentation level + The value to add to the indentation level + + + + Log a string in a buffered way. Use this method only if you are sure that FlushBuffer will be called + or else logging information is incomplete in case of a crash + The string to log + + + + Logs a list of string in a buffered way. Use this method only if you are sure that FlushBuffer will be called + or else logging information is incomplete in case of a crash + A list of strings to log (they will not be re-indented) + + + + Returns the log buffer and optionally empties it + True to empty the buffer + The buffer. + + + + Replaces the buffer with new lines + The lines to store + + + + Flushes the log buffer to disk (use in combination with LogBuffered) + + + + Log a string directly to disk. Slower method that prevents missing information in case of a crash + The string to log. + + + + Resets and deletes the log + + + + Logs some bytes as hex values + The pointer to some memory + The length of bytes to log + + + + + Default Harmony logger that writes to a file + + + + + Whether or not to enable writing the log. + + + + + Text writer to write the logs to. If not set, defaults to a file log. + + + + + File path of the log. + + + + + Main logger class that exposes log events. + + + + + A single log event that represents a single log message. + + + + + Log channel of the message. + + + + + The log message. + + + + + Log channel for the messages. + + + + + No channels (or an empty channel). + + + + + Basic information. + + + + + Full IL dumps of the generated dynamic methods. + + + + + Channel for warnings. + + + + + Channel for errors. + + + + + Additional debug information that is related to patching + + + + + All channels. + + + + + Filter for which channels should be listened to. + If the channel is in the filter, all log messages from that channel get propagated into event. + + + + + Event fired on any incoming message that passes the channel filter. + + + + + Pretty print a full type name. + + The . + The pretty printed full type name. + + + + A helper class to retrieve reflection info for non-private methods + + + + Given a lambda expression that calls a method, returns the method info + The lambda expression using the method + The method in the lambda expression + + + + Given a lambda expression that calls a method, returns the method info + The generic type + The lambda expression using the method + The method in the lambda expression + + + + Given a lambda expression that calls a method, returns the method info + The generic type + The generic result type + The lambda expression using the method + The method in the lambda expression + + + + Given a lambda expression that calls a method, returns the method info + The lambda expression using the method + The method in the lambda expression + + + + A reflection helper to read and write private elements + The result type defined by GetValue() + + + + Creates a traverse instance from an existing instance + The existing instance + + + + Gets/Sets the current value + The value to read or write + + + + A reflection helper to read and write private elements + + + + Creates a new traverse instance from a class/type + The class/type + A instance + + + + Creates a new traverse instance from a class T + The class + A instance + + + + Creates a new traverse instance from an instance + The object + A instance + + + + Creates a new traverse instance from a named type + The type name, for format see + A instance + + + + Creates a new and empty traverse instance + + + + Creates a new traverse instance from a class/type + The class/type + + + + Creates a new traverse instance from an instance + The object + + + + Gets the current value + The value + + + + Gets the current value + The type of the value + The value + + + + Invokes the current method with arguments and returns the result + The method arguments + The value returned by the method + + + + Invokes the current method with arguments and returns the result + The type of the value + The method arguments + The value returned by the method + + + + Sets a value of the current field or property + The value + The same traverse instance + + + + Gets the type of the current field or property + The type + + + + Moves the current traverse instance to a inner type + The type name + A traverse instance + + + + Moves the current traverse instance to a field + The type name + A traverse instance + + + + Moves the current traverse instance to a field + The type of the field + The type name + A traverse instance + + + + Gets all fields of the current type + A list of field names + + + + Moves the current traverse instance to a property + The type name + Optional property index + A traverse instance + + + + Moves the current traverse instance to a field + The type of the property + The type name + Optional property index + A traverse instance + + + + Gets all properties of the current type + A list of property names + + + + Moves the current traverse instance to a method + The name of the method + The arguments defining the argument types of the method overload + A traverse instance + + + + Moves the current traverse instance to a method + The name of the method + The argument types of the method + The arguments for the method + A traverse instance + + + + Gets all methods of the current type + A list of method names + + + + Checks if the current traverse instance is for a field + True if its a field + + + + Checks if the current traverse instance is for a property + True if its a property + + + + Checks if the current traverse instance is for a method + True if its a method + + + + Checks if the current traverse instance is for a type + True if its a type + + + + Iterates over all fields of the current type and executes a traverse action + Original object + The action receiving a instance for each field + + + + Iterates over all fields of the current type and executes a traverse action + Original object + Target object + The action receiving a pair of instances for each field pair + + + + Iterates over all fields of the current type and executes a traverse action + Original object + Target object + The action receiving a dot path representing the field pair and the instances + + + + Iterates over all properties of the current type and executes a traverse action + Original object + The action receiving a instance for each property + + + + Iterates over all properties of the current type and executes a traverse action + Original object + Target object + The action receiving a pair of instances for each property pair + + + + Iterates over all properties of the current type and executes a traverse action + Original object + Target object + The action receiving a dot path representing the property pair and the instances + + + + A default field action that copies fields to fields + + + + Returns a string that represents the current traverse + A string representation + + + + + Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library), + so this symbol will not be reported as unused (as well as by other usage inspections). + + + + + Can be applied to attributes, type parameters, and parameters of a type assignable from . + When applied to an attribute, the decorated attribute behaves the same as . + When applied to a type parameter or to a parameter of type , indicates that the corresponding type + is used implicitly. + + + + + Specify the details of implicitly used symbol when it is marked + with or . + + + + Only entity marked with attribute considered used. + + + Indicates implicit assignment to a member. + + + + Indicates implicit instantiation of a type with fixed constructor signature. + That means any unused constructor parameters won't be reported as such. + + + + Indicates implicit instantiation of a type. + + + + Specify what is considered to be used implicitly when marked + with or . + + + + Members of entity marked with attribute are considered used. + + + Inherited entities are considered used. + + + Entity marked with attribute and all its members considered used. + + + diff --git a/SubnauticaModSystem/AutosortLockers/AutosortLockersSML/BZ/AutosortLockersSML.dll b/SubnauticaModSystem/AutosortLockers/AutosortLockersSML/BZ/AutosortLockersSML.dll new file mode 100644 index 0000000..49121ba Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/AutosortLockersSML/BZ/AutosortLockersSML.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/AutosortLockersSML/BZ/Unity.TextMeshPro.dll b/SubnauticaModSystem/AutosortLockers/AutosortLockersSML/BZ/Unity.TextMeshPro.dll new file mode 100644 index 0000000..62f78c1 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/AutosortLockersSML/BZ/Unity.TextMeshPro.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/AutosortTarget.cs b/SubnauticaModSystem/AutosortLockers/AutosortTarget.cs index c311362..050bbc6 100644 --- a/SubnauticaModSystem/AutosortLockers/AutosortTarget.cs +++ b/SubnauticaModSystem/AutosortLockers/AutosortTarget.cs @@ -4,15 +4,20 @@ using Common.Mod; using Common.Utility; using SMLHelper.V2.Assets; -using SMLHelper.V2.Crafting; using UnityEngine; using UnityEngine.UI; +using UWE; +using SMLHelper.V2.Crafting; +#if SN +#elif BZ +using TMPro; +#endif namespace AutosortLockers { public class AutosortTarget : MonoBehaviour { - public const int MaxTypes = 7; + public const int MaxTypes = 10; public const float MaxDistance = 3; private bool initialized; @@ -23,8 +28,29 @@ public class AutosortTarget : MonoBehaviour private Coroutine plusCoroutine; private SaveDataEntry saveData; +#if SN [SerializeField] private Text textPrefab; + [SerializeField] + private Text text; + [SerializeField] + private Text label; + [SerializeField] + private Text plus; + [SerializeField] + private Text quantityText; +#elif BZ + [SerializeField] + private TextMeshProUGUI textPrefab; + [SerializeField] + private TextMeshProUGUI text; + [SerializeField] + private TextMeshProUGUI label; + [SerializeField] + private TextMeshProUGUI plus; + [SerializeField] + private TextMeshProUGUI quantityText; +#endif [SerializeField] private Image background; [SerializeField] @@ -38,14 +64,6 @@ public class AutosortTarget : MonoBehaviour [SerializeField] private Image customizeButtonImage; [SerializeField] - private Text text; - [SerializeField] - private Text label; - [SerializeField] - private Text plus; - [SerializeField] - private Text quantityText; - [SerializeField] private List currentFilters = new List(); private void Awake() @@ -103,7 +121,6 @@ private bool ContainsFilter(AutosorterFilter filter) return true; } } - return false; } @@ -126,16 +143,50 @@ public void RemoveFilter(AutosorterFilter filter) private void UpdateText() { + int strLen = 17; + string lockerType = container.name; + if (lockerType == "AutosortTarget(Clone)") + { + strLen = 17; // Trim filter lables so they don't wrap on the lockers + } + else + { + strLen = 22; // Trim filter lables so they don't wrap on the lockers + } + if (text != null) { if (currentFilters == null || currentFilters.Count == 0) { text.text = "[Any]"; +#if SN + text.alignment = TextAnchor.MiddleCenter; +#elif BZ + text.alignment = TextAlignmentOptions.Center; +#endif } else { - string filtersText = string.Join("\n", currentFilters.Select((f) => f.IsCategory() ? "[" + f.GetString() + "]" : f.GetString()).ToArray()); + string filtersText = string.Join("\n", currentFilters.Select((f) => f.IsCategory() ? "[" + (f.GetString().Length > strLen ? f.GetString().Substring(0, strLen) : f.GetString()) + "]" : f.GetString().Length > strLen ? f.GetString().Substring(0, strLen) : f.GetString()).ToArray()); + // Filter text displayed on the lockers text.text = filtersText; + + if (currentFilters.Count == 1) + { +#if SN + text.alignment = TextAnchor.MiddleCenter; +#elif BZ + text.alignment = TextAlignmentOptions.Center; +#endif + } + else + { +#if SN + text.alignment = TextAnchor.MiddleLeft; +#elif BZ + text.alignment = TextAlignmentOptions.Left; +#endif + } } } } @@ -212,7 +263,6 @@ private bool IsTypeAllowedByCategoryFilter(TechType techType) return true; } } - return false; } @@ -225,7 +275,6 @@ private bool IsTypeAllowedByItemFilter(TechType techType) return true; } } - return false; } @@ -238,7 +287,6 @@ private bool IsTypeAllowed(TechType techType) return true; } } - return false; } @@ -277,7 +325,6 @@ private void Update() { Mod.Save(); } - UpdateQuantityText(); } @@ -370,10 +417,26 @@ private void Initialize() UpdateText(); + StartCoroutine("FinalSetup"); + initialized = true; + } + + internal bool bPrefabsLoaded = false; + internal GameObject lockerPrefab; + + private IEnumerator FinalSetup() + { + IPrefabRequest request = PrefabDatabase.GetPrefabForFilenameAsync("Submarine/Build/SmallLocker.prefab"); + yield return request; + request.TryGetPrefab(out GameObject prefab); + + lockerPrefab = prefab; + bPrefabsLoaded = true; + CreatePicker(); CreateCustomizeScreen(); - initialized = true; + yield break; } private void InitializeFromSaveData() @@ -421,7 +484,9 @@ private List GetNewVersion(List filterData) { Dictionary validItems = new Dictionary(); Dictionary validCategories = new Dictionary(); + var filterList = AutosorterList.GetFilters(); + foreach (var filter in filterList) { if (filter.IsCategory()) @@ -449,15 +514,6 @@ private List GetNewVersion(List filterData) newData.Add(filter); continue; } - - var newTypes = AutosorterList.GetOldFilter(filter.Category, out bool success, out string newCategory); - if (success) - { - newData.Add(new AutosorterFilter() { Category = newCategory, Types = newTypes }); - continue; - } - - newData.Add(filter); } return newData; } @@ -472,7 +528,7 @@ private void CreatePicker() private void CreateCustomizeScreen() { - customizeScreen = CustomizeScreen.Create(background.transform, saveData); + customizeScreen = CustomizeScreen.Create(background.transform, saveData, lockerPrefab); customizeScreen.onModified += InitializeFromSaveData; customizeScreen.Initialize(saveData); customizeScreen.gameObject.SetActive(false); @@ -518,15 +574,16 @@ public IEnumerator ShowPlus() private void UpdateQuantityText() { var count = container.container.count; - quantityText.text = count == 0 ? "empty" : count.ToString(); + + quantityText.text = count == 0 ? "Empty" : count.ToString(); } internal class AutosortTargetBuildable : Buildable { public AutosortTargetBuildable() : base("AutosortTarget", - "Autosort Receptacle", - "Wall locker linked to an Autosorter that receives sorted items.") + "Autosort Receptacle", + "Wall locker linked to an Autosorter that receives sorted items.") { } @@ -534,6 +591,7 @@ public AutosortTargetBuildable() public override TechCategory CategoryForPDA => TechCategory.InteriorModule; +#if SN public override GameObject GetGameObject() { GameObject prefab = GetPrefab(TechType.SmallLocker); @@ -568,14 +626,55 @@ protected override Atlas.Sprite GetItemSprite() { return SMLHelper.V2.Utility.ImageUtils.LoadSpriteFromFile(Mod.GetAssetPath("AutosortTarget.png")); } +#elif BZ + public override IEnumerator GetGameObjectAsync(IOut gameObject) + { + TaskResult result = new TaskResult(); + yield return GetPrefabAsync(TechType.SmallLocker, result); + + GameObject basePrefab = result.Get(); + GameObject prefab = GameObject.Instantiate(basePrefab); + + StorageContainer container = prefab.GetComponent(); + container.width = Mod.config.ReceptacleWidth; + container.height = Mod.config.ReceptacleHeight; + container.Resize(Mod.config.ReceptacleWidth, Mod.config.ReceptacleHeight); + + gameObject.Set(prefab); + yield break; + } + + protected override RecipeData GetBlueprintRecipe() + { + return new RecipeData + { + craftAmount = 1, + Ingredients = Mod.config.EasyBuild + ? new List + { + new Ingredient(TechType.Titanium, 2) + } + : new List + { + new Ingredient(TechType.Titanium, 2), + new Ingredient(TechType.Magnetite, 1) + } + }; + } + + protected override Sprite GetItemSprite() + { + return SMLHelper.V2.Utility.ImageUtils.LoadSpriteFromFile(Mod.GetAssetPath("AutosortTarget.png")); + } +#endif } internal class AutosortStandingTargetBuildable : Buildable { public AutosortStandingTargetBuildable() : base("AutosortTargetStanding", - "Standing Autosort Receptacle", - "Large locker linked to an Autosorter that receives sorted items.") + "Standing Autosort Receptacle", + "Large locker linked to an Autosorter that receives sorted items.") { } @@ -583,6 +682,7 @@ public AutosortStandingTargetBuildable() public override TechCategory CategoryForPDA => TechCategory.InteriorModule; +#if SN public override GameObject GetGameObject() { var prefab = GetPrefab(TechType.Locker); @@ -619,9 +719,51 @@ protected override Atlas.Sprite GetItemSprite() { return SMLHelper.V2.Utility.ImageUtils.LoadSpriteFromFile(Mod.GetAssetPath("AutosortTargetStanding.png")); } +#elif BZ + public override IEnumerator GetGameObjectAsync(IOut gameObject) + { + TaskResult result = new TaskResult(); + yield return GetPrefabAsync(TechType.Locker, result); + + GameObject basePrefab = result.Get(); + GameObject prefab = GameObject.Instantiate(basePrefab); + + StorageContainer container = prefab.GetComponent(); + container.width = Mod.config.StandingReceptacleWidth; + container.height = Mod.config.StandingReceptacleHeight; + container.Resize(Mod.config.StandingReceptacleWidth, Mod.config.StandingReceptacleHeight); + gameObject.Set(prefab); + yield break; + } + + protected override RecipeData GetBlueprintRecipe() + { + return new RecipeData + { + craftAmount = 1, + Ingredients = Mod.config.EasyBuild + ? new List + { + new Ingredient(TechType.Titanium, 2), + new Ingredient(TechType.Quartz, 1) + } + : new List + { + new Ingredient(TechType.Titanium, 2), + new Ingredient(TechType.Quartz, 1), + new Ingredient(TechType.Magnetite, 1) + } + }; + } + + protected override Sprite GetItemSprite() + { + return SMLHelper.V2.Utility.ImageUtils.LoadSpriteFromFile(Mod.GetAssetPath("AutosortTargetStanding.png")); + } +#endif } + /*__________________________________________________________________________________________________________*/ - /////////////////////////////////////////////////////////////////////////////////////////// public static void AddBuildable() { var sorterTarget = new AutosortTargetBuildable(); @@ -631,6 +773,7 @@ public static void AddBuildable() sorterStandingTarget.Patch(); } +#if SN public static GameObject GetPrefab(TechType basePrefab) { GameObject originalPrefab = CraftData.GetPrefabForTechType(basePrefab); @@ -646,38 +789,101 @@ public static GameObject GetPrefab(TechType basePrefab) var smallLockerPrefab = CraftData.GetPrefabForTechType(TechType.SmallLocker); autosortTarget.textPrefab = GameObject.Instantiate(smallLockerPrefab.GetComponentInChildren()); + +#elif BZ + public static IEnumerator GetPrefabAsync(TechType basePrefab, IOut gameObject) + { + CoroutineTask task = CraftData.GetPrefabForTechTypeAsync(basePrefab); + yield return task; + + GameObject originalPrefab = task.GetResult(); + GameObject prefab = GameObject.Instantiate(originalPrefab); + + var meshRenderers = prefab.GetComponentsInChildren(); + foreach (var meshRenderer in meshRenderers) + { + meshRenderer.material.color = new Color(0.3f, 0.3f, 0.3f); + } + + var autosortTarget = prefab.AddComponent(); + + task = CraftData.GetPrefabForTechTypeAsync(TechType.SmallLocker); + yield return task; + var smallLockerPrefab = GameObject.Instantiate(task.GetResult()); + + autosortTarget.textPrefab = GameObject.Instantiate(smallLockerPrefab.GetComponentInChildren()); +#endif + // Destroys the lable on the small locker var label = prefab.FindChild("Label"); DestroyImmediate(label); var canvas = LockerPrefabShared.CreateCanvas(prefab.transform); if (basePrefab == TechType.Locker) { - canvas.transform.localPosition = new Vector3(0, 1.1f, 0.25f); + // Positions the rectangle on the standing locker horz, vert, depth + canvas.transform.localPosition = new Vector3(0.04f, 1.0f, 0.25f); } - autosortTarget.background = LockerPrefabShared.CreateBackground(canvas.transform); - autosortTarget.icon = LockerPrefabShared.CreateIcon(autosortTarget.background.transform, autosortTarget.textPrefab.color, 70); - autosortTarget.text = LockerPrefabShared.CreateText(autosortTarget.background.transform, autosortTarget.textPrefab, autosortTarget.textPrefab.color, -20, 12, "Any"); + autosortTarget.background = LockerPrefabShared.CreateBackground(canvas.transform, prefab.name); - autosortTarget.label = LockerPrefabShared.CreateText(autosortTarget.background.transform, autosortTarget.textPrefab, autosortTarget.textPrefab.color, 100, 12, "Locker"); + int iconPos = 75; // The vertical pos of the icon at the top of the container + int textPos = 110; // The vertical pos of the "Locker" text at the top of the container + int buttonPos = -104; // The vertical positions of the color and customize buttons + int labelFont = 12; // The font for the label on the lockers + if (Mod.config.ShowLabel) + { // This is a cludge until I can find the placeholder + labelFont = 0; // Set to zero and the Locker text does not display + } + else + { + labelFont = 12; + } + + // Change the positions for the Standing Locker + if (prefab.name == "Locker(Clone)") + { + iconPos = 93; + textPos = 120; + buttonPos = -120; + } + + // Position the locker icon + autosortTarget.icon = LockerPrefabShared.CreateIcon(autosortTarget.background.transform, autosortTarget.textPrefab.color, iconPos); + // Position the Filter lables, the first number is the horizontal position, the second number is the font size. + autosortTarget.text = LockerPrefabShared.CreateText(autosortTarget.background.transform, autosortTarget.textPrefab, autosortTarget.textPrefab.color, 0, 12, "[Any] - Doesn't display", prefab.name); + // Position the "Locker" text + autosortTarget.label = LockerPrefabShared.CreateText(autosortTarget.background.transform, autosortTarget.textPrefab, autosortTarget.textPrefab.color, textPos, labelFont, "Locker - Doesn't display", prefab.name); autosortTarget.background.gameObject.SetActive(false); autosortTarget.icon.gameObject.SetActive(false); autosortTarget.text.gameObject.SetActive(false); - - autosortTarget.plus = LockerPrefabShared.CreateText(autosortTarget.background.transform, autosortTarget.textPrefab, autosortTarget.textPrefab.color, 0, 30, "+"); + // The container filters ?? + autosortTarget.plus = LockerPrefabShared.CreateText(autosortTarget.background.transform, autosortTarget.textPrefab, autosortTarget.textPrefab.color, 0, 12, "+ - Doesn't display", prefab.name); + // Pos of the color picker autosortTarget.plus.color = new Color(autosortTarget.textPrefab.color.r, autosortTarget.textPrefab.color.g, autosortTarget.textPrefab.color.g, 0); - autosortTarget.plus.rectTransform.anchoredPosition += new Vector2(30, 70); - - autosortTarget.quantityText = LockerPrefabShared.CreateText(autosortTarget.background.transform, autosortTarget.textPrefab, autosortTarget.textPrefab.color, 0, 10, "XX"); - autosortTarget.quantityText.rectTransform.anchoredPosition += new Vector2(-35, -104); - - autosortTarget.configureButton = ConfigureButton.Create(autosortTarget.background.transform, autosortTarget.textPrefab.color, 40); + // Pos of the item count on the locker + autosortTarget.quantityText = LockerPrefabShared.CreateText(autosortTarget.background.transform, autosortTarget.textPrefab, autosortTarget.textPrefab.color, 0, 12, "XX - Doesn't display", prefab.name); + // Pos the quantity text on the locker + if (prefab.name == "Locker(Clone)") + { + autosortTarget.quantityText.rectTransform.anchoredPosition += new Vector2(14, -210); + } + else + { + autosortTarget.quantityText.rectTransform.anchoredPosition += new Vector2(4, -198); + } + // Pos of the configure button on the locker + autosortTarget.configureButton = ConfigureButton.Create(autosortTarget.background.transform, autosortTarget.textPrefab.color, 45, buttonPos); autosortTarget.configureButtonImage = autosortTarget.configureButton.GetComponent(); - autosortTarget.customizeButton = ConfigureButton.Create(autosortTarget.background.transform, autosortTarget.textPrefab.color, 20); + // Pos of the customize button on the locker + autosortTarget.customizeButton = ConfigureButton.Create(autosortTarget.background.transform, autosortTarget.textPrefab.color, 20, buttonPos); autosortTarget.customizeButtonImage = autosortTarget.customizeButton.GetComponent(); +#if BZ + gameObject.Set(prefab); +#elif SN return prefab; +#endif } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/AutosortTypePicker.cs b/SubnauticaModSystem/AutosortLockers/AutosortTypePicker.cs index 6c70d0d..4c08b94 100644 --- a/SubnauticaModSystem/AutosortLockers/AutosortTypePicker.cs +++ b/SubnauticaModSystem/AutosortLockers/AutosortTypePicker.cs @@ -3,6 +3,9 @@ using System.Linq; using Common.Mod; using Common.Utility; +#if BZ +using TMPro; +#endif using UnityEngine; using UnityEngine.UI; @@ -20,25 +23,30 @@ private enum Mode { Categories, Items } [SerializeField] private AutosortTarget locker; [SerializeField] - private PickerButton[] currentList = new PickerButton[AutosortTarget.MaxTypes]; + private FilterPickerButton[] currentList = new FilterPickerButton[AutosortTarget.MaxTypes]; [SerializeField] - private PickerButton[] availableList = new PickerButton[AutosortTarget.MaxTypes]; + private FilterPickerButton[] availableList = new FilterPickerButton[AutosortTarget.MaxTypes]; [SerializeField] private Image background; [SerializeField] private Image[] underlines = new Image[2]; [SerializeField] private PickerCloseButton closeButton; +#if SN [SerializeField] private Text pageText; +#elif BZ + [SerializeField] + private TextMeshProUGUI pageText; +#endif [SerializeField] private PickerPageButton prevPageButton; [SerializeField] private PickerPageButton nextPageButton; [SerializeField] - private PickerButton categoriesTabButton; + private FilterPickerButton categoriesTabButton; [SerializeField] - private PickerButton itemsTabButton; + private FilterPickerButton itemsTabButton; public void Initialize(AutosortTarget locker) { @@ -102,7 +110,6 @@ public void OnCurrentListItemClick(AutosorterFilter filter) { return; } - locker.RemoveFilter(filter); RefreshCurrentFilters(); } @@ -113,7 +120,6 @@ public void OnAvailableListItemClick(AutosorterFilter filter) { return; } - locker.AddFilter(filter); RefreshCurrentFilters(); } @@ -165,9 +171,14 @@ private void SetCurrentPage(int page) } } + public static AutosortTypePicker Create(Transform parent, +#if SN + Text textPrefab +#elif BZ + TextMeshProUGUI textPrefab +#endif + ) - - public static AutosortTypePicker Create(Transform parent, Text textPrefab) { var picker = LockerPrefabShared.CreateCanvas(parent).gameObject.AddComponent(); picker.GetComponent().sortingLayerID = 0; @@ -177,41 +188,62 @@ public static AutosortTypePicker Create(Transform parent, Text textPrefab) t.localEulerAngles = new Vector3(0, 180, 0); t.localPosition = new Vector3(0, 0, 0.4f); - picker.background = LockerPrefabShared.CreateBackground(picker.transform); + picker.background = LockerPrefabShared.CreateBackground(picker.transform, picker.name); picker.background.color = new Color(0, 0, 0, 1); picker.background.type = Image.Type.Simple; - RectTransformExtensions.SetSize(picker.background.rectTransform, 240, 220); + // Set the size of the Item Picker background - first number width, second height + RectTransformExtensions.SetSize(picker.background.rectTransform, 260, 295); + // Position the Item Picker on the locker + if (parent.name.Contains("Standing(Clone)")) + { + picker.background.rectTransform.anchoredPosition = new Vector2(0.13f, 0.0f); + } + else + { + picker.background.rectTransform.anchoredPosition = new Vector2(0.15f, 0.0f); + } + // Hoizontal spacing between items in the picker int spacing = 20; - int startY = 60; - int x = 55; - - picker.underlines[0] = CreateUnderline(picker.background.transform, x); - picker.underlines[1] = CreateUnderline(picker.background.transform, -x); - - var currentText = LockerPrefabShared.CreateText(picker.background.transform, textPrefab, Color.white, 90, 12, "Current"); - currentText.rectTransform.anchoredPosition = new Vector2(-x, 90); - - picker.categoriesTabButton = CreatePickerButton(picker.background.transform, x - 23 + 2, 90, textPrefab, picker.OnCategoriesButtonClick, 60); - picker.categoriesTabButton.Override("Categories", true); - - picker.itemsTabButton = CreatePickerButton(picker.background.transform, x + 30 + 2, 90, textPrefab, picker.OnItemsButtonClick, 38); - picker.itemsTabButton.Override("Items", false); - - picker.pageText = LockerPrefabShared.CreateText(picker.background.transform, textPrefab, Color.white, 90, 10, "1/X"); - picker.pageText.rectTransform.anchoredPosition = new Vector2(x, -80); - - picker.prevPageButton = AddPageButton(picker.background.transform, picker, -1, x - 20, -80); - picker.nextPageButton = AddPageButton(picker.background.transform, picker, +1, x + 20, -80); - + // Top position of the Item Picker list, but not the Item and Category buttons + int startY = 88; + // Offset from the center of Selected and Available Item columns in the picker + int centOff = 61; + // The horizontal offset of the Current Filters, Category, and Items + // and the Close and Page buttons + int horzOff = 120; + + picker.underlines[0] = CreateUnderline(picker.background.transform, 60); + picker.underlines[1] = CreateUnderline(picker.background.transform, -63); + + // The first number is the vertical pos of the Item button, the second number is the font size + var currentText = LockerPrefabShared.CreateText(picker.background.transform, textPrefab, Color.white, 120, 12, "Current Filters", "Picker"); + // The vertical position of the "Current Filters" text in the picker is set by the second number + currentText.rectTransform.anchoredPosition = new Vector2(-45, 28); + // The width of the Categories button is the last number, horzOff is the horizontal pos, the next number is the vertical pos + picker.categoriesTabButton = CreatePickerButton(picker.background.transform, 38, horzOff, textPrefab, picker.OnCategoriesButtonClick, 67); + // Prefix with space until I can find the button instance to override + picker.categoriesTabButton.Override(" Categories", true); + // The width of the Items button is the last number, x - is the horizontal pos, the next number is the vertical pos + picker.itemsTabButton = CreatePickerButton(picker.background.transform, 96, horzOff, textPrefab, picker.OnItemsButtonClick, 42); + // Prefix with space until I can find the button instance to override + picker.itemsTabButton.Override(" Items", false); + // The smaller number is the font size, the vertical position is overwritten below + picker.pageText = LockerPrefabShared.CreateText(picker.background.transform, textPrefab, Color.white, 0, 14, "1/X", "Picker"); + // The vertical position of the page numbers + picker.pageText.rectTransform.anchoredPosition = new Vector2(95, -211); + + // The vertical and horizontal position of the page arrows + picker.prevPageButton = AddPageButton(picker.background.transform, picker, -1, 28, -120); + picker.nextPageButton = AddPageButton(picker.background.transform, picker, +1, 89, -120); + // The vertical position of the close button ? picker.closeButton = AddCloseButton(picker.background.transform); for (int i = 0; i < AutosortTarget.MaxTypes; ++i) { - picker.currentList[i] = CreatePickerButton(picker.background.transform, -x, startY - (i * spacing), textPrefab, picker.OnCurrentListItemClick); - picker.availableList[i] = CreatePickerButton(picker.background.transform, x, startY - (i * spacing), textPrefab, picker.OnAvailableListItemClick); + picker.currentList[i] = CreatePickerButton(picker.background.transform, -centOff, startY - (i * spacing), textPrefab, picker.OnCurrentListItemClick); + picker.availableList[i] = CreatePickerButton(picker.background.transform, centOff, startY - (i * spacing), textPrefab, picker.OnAvailableListItemClick); } - return picker; } @@ -220,7 +252,8 @@ private static PickerPageButton AddPageButton(Transform parent, AutosortTypePick var pageButton = LockerPrefabShared.CreateIcon(parent, Color.white, y); pageButton.sprite = ImageUtils.LoadSprite(Mod.GetAssetPath(pageOffset < 0 ? "ArrowLeft.png" : "ArrowRight.png")); pageButton.rectTransform.anchoredPosition = new Vector2(x, y); - RectTransformExtensions.SetSize(pageButton.rectTransform, 44 / 4.0f, 73 / 4.0f); + // Sets the size of the arrows + RectTransformExtensions.SetSize(pageButton.rectTransform, 14.0f, 16.0f); var controller = pageButton.gameObject.AddComponent(); controller.target = target; @@ -233,9 +266,10 @@ private static Image CreateUnderline(Transform parent, int x) { var underline = new GameObject("Underline", typeof(RectTransform)).AddComponent(); RectTransformExtensions.SetParams(underline.rectTransform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); - RectTransformExtensions.SetSize(underline.rectTransform, 272 / 3, 78 / 3); + RectTransformExtensions.SetSize(underline.rectTransform, 90.6f, 26.0f); underline.sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("TitleUnderline.png")); - underline.rectTransform.anchoredPosition = new Vector2(x, 90); + // Vertical position of Underline + underline.rectTransform.anchoredPosition = new Vector2(x, 115); return underline; } @@ -246,16 +280,24 @@ public static PickerCloseButton AddCloseButton(Transform parent) RectTransformExtensions.SetParams(closeImage.rectTransform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); RectTransformExtensions.SetSize(closeImage.rectTransform, 20, 20); closeImage.sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("Close.png")); - closeImage.rectTransform.anchoredPosition = new Vector2(0, -90); + // Vertical and horizontal pos of the X - close button + closeImage.rectTransform.anchoredPosition = new Vector2(0, -120); var closeButton = closeImage.gameObject.AddComponent(); return closeButton; } - public static PickerButton CreatePickerButton(Transform parent, int x, int y, Text textPrefab, Action action, int width = 100) + public static FilterPickerButton CreatePickerButton(Transform parent, int x, int y, +#if SN + Text textPrefab, +#elif BZ + TextMeshProUGUI textPrefab, +#endif + // The width of the picker button is set here + Action action, int width = 116) { - var button = PickerButton.Create(parent, textPrefab, action, width); + var button = FilterPickerButton.Create(parent, textPrefab, action, width); var rt = button.transform as RectTransform; rt.anchoredPosition = new Vector2(x, y); @@ -263,4 +305,4 @@ public static PickerButton CreatePickerButton(Transform parent, int x, int y, Te return button; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/AutosorterCategories.cs b/SubnauticaModSystem/AutosortLockers/AutosorterCategories.cs index 2873056..8fa832b 100644 --- a/SubnauticaModSystem/AutosortLockers/AutosorterCategories.cs +++ b/SubnauticaModSystem/AutosortLockers/AutosorterCategories.cs @@ -1,452 +1,21 @@ -using Oculus.Newtonsoft.Json; +#if SN +using Oculus.Newtonsoft.Json; +#elif BZ +using Newtonsoft.Json; +#endif using System; -using System.Collections; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; -using UnityEngine; namespace AutosortLockers { - [Serializable] - public enum AutoSorterCategory - { - None, - Food, - Water, - PlantsAndSeeds, - Metals, - Electronics, - Batteries, - NaturalMaterials, - SyntheticMaterials, - CrystalMaterials, - Fish, - Eggs, - Tools, - Equipment, - MysteriousTablets, - ScannerRoomUpgrades, - GeneralUpgrades, - SeamothUpgrades, - PrawnSuitUpgrades, - CyclopsUpgrades, - Torpedoes, - AlterraStuff, - } - - public static class AutosorterCategoryData - { - public static List Fish = new List { - TechType.Bladderfish, - TechType.Boomerang, - TechType.LavaBoomerang, - TechType.Eyeye, - TechType.LavaEyeye, - TechType.GarryFish, - TechType.HoleFish, - TechType.Hoopfish, - TechType.Spinefish, - TechType.Hoverfish, - TechType.Oculus, - TechType.Peeper, - TechType.Reginald, - TechType.Spadefish, - }; - - public static List AlterraArtifacts = new List { - TechType.LabContainer, - TechType.LabContainer2, - TechType.LabContainer3, - TechType.ArcadeGorgetoy, - TechType.Cap1, - TechType.Cap2, - TechType.LabEquipment1, - TechType.LabEquipment2, - TechType.LabEquipment3, - TechType.LEDLightFragment, - TechType.StarshipSouvenir, - TechType.Poster, - TechType.PosterAurora, - TechType.PosterExoSuit1, - TechType.PosterExoSuit2, - TechType.PosterKitty, - }; - - public static List MysteriousTablets = new List { - TechType.PrecursorKey_Blue, - TechType.PrecursorKey_Orange, - TechType.PrecursorKey_Purple, - }; - - public static List CreatureEggs = new List { - TechType.BonesharkEgg, - TechType.CrabsnakeEgg, - TechType.CrabsquidEgg, - TechType.CrashEgg, - TechType.CutefishEgg, - TechType.GasopodEgg, - TechType.JellyrayEgg, - TechType.JumperEgg, - TechType.LavaLizardEgg, - TechType.MesmerEgg, - TechType.RabbitrayEgg, - TechType.ReefbackEgg, - TechType.SandsharkEgg, - TechType.ShockerEgg, - TechType.SpadefishEgg, - TechType.StalkerEgg, - TechType.GrandReefsEgg, - TechType.GrassyPlateausEgg, - TechType.KelpForestEgg, - TechType.KooshZoneEgg, - TechType.LavaZoneEgg, - TechType.MushroomForestEgg, - TechType.SafeShallowsEgg, - TechType.TwistyBridgesEgg, - TechType.RabbitrayEggUndiscovered, - TechType.JellyrayEggUndiscovered, - TechType.StalkerEggUndiscovered, - TechType.ReefbackEggUndiscovered, - TechType.JumperEggUndiscovered, - TechType.BonesharkEggUndiscovered, - TechType.GasopodEggUndiscovered, - TechType.MesmerEggUndiscovered, - TechType.SandsharkEggUndiscovered, - TechType.ShockerEggUndiscovered, - TechType.GenericEgg, - TechType.CrashEgg, - TechType.CrashEggUndiscovered, - TechType.CrabsquidEgg, - TechType.CrabsquidEggUndiscovered, - TechType.CutefishEgg, - TechType.CutefishEggUndiscovered, - TechType.LavaLizardEgg, - TechType.LavaLizardEggUndiscovered, - TechType.CrabsnakeEggUndiscovered, - TechType.SpadefishEggUndiscovered - }; - - public static List Food = new List { - TechType.CookedBladderfish, - TechType.CookedBoomerang, - TechType.CookedEyeye, - TechType.CookedGarryFish, - TechType.CookedHoleFish, - TechType.CookedHoopfish, - TechType.CookedHoverfish, - TechType.CookedLavaBoomerang, - TechType.CookedLavaEyeye, - TechType.CookedOculus, - TechType.CookedPeeper, - TechType.CookedReginald, - TechType.CookedSpadefish, - TechType.CookedSpinefish, - TechType.CuredBladderfish, - TechType.CuredBoomerang, - TechType.CuredEyeye, - TechType.CuredGarryFish, - TechType.CuredHoleFish, - TechType.CuredHoopfish, - TechType.CuredHoverfish, - TechType.CuredLavaBoomerang, - TechType.CuredLavaEyeye, - TechType.CuredOculus, - TechType.CuredPeeper, - TechType.CuredReginald, - TechType.CuredSpadefish, - TechType.CuredSpinefish, - TechType.NutrientBlock, - TechType.Snack1, - TechType.Snack2, - TechType.Snack3, - TechType.BulboTreePiece, - TechType.HangingFruit, - TechType.Melon, - TechType.PurpleVegetable, - }; - - public static List Water = new List { - TechType.BigFilteredWater, - TechType.Coffee, - TechType.DisinfectedWater, - TechType.FilteredWater, - TechType.StillsuitWater, - }; - - public static List ScannerRoomUpgrades = new List { - TechType.MapRoomUpgradeScanRange, - TechType.MapRoomUpgradeScanSpeed, - TechType.MapRoomCamera, - }; - - public static List CyclopsUpgrades = new List { - TechType.CyclopsDecoyModule, - TechType.CyclopsFireSuppressionModule, - TechType.CyclopsHullModule1, - TechType.CyclopsHullModule2, - TechType.CyclopsHullModule3, - TechType.CyclopsSeamothRepairModule, - TechType.CyclopsShieldModule, - TechType.CyclopsSonarModule, - TechType.CyclopsThermalReactorModule, - }; - - public static List PrawnSuitUpgrades = new List { - TechType.ExoHullModule1, - TechType.ExoHullModule2, - TechType.ExosuitDrillArmModule, - TechType.ExosuitGrapplingArmModule, - TechType.ExosuitJetUpgradeModule, - TechType.ExosuitPropulsionArmModule, - TechType.ExosuitThermalReactorModule, - TechType.ExosuitTorpedoArmModule, - }; - - public static List SeamothUpgrades = new List { - TechType.SeamothElectricalDefense, - TechType.SeamothReinforcementModule, - TechType.SeamothSolarCharge, - TechType.SeamothSonarModule, - TechType.SeamothTorpedoModule, - }; - - public static List GeneralUpgrades = new List { - TechType.HullReinforcementModule, - TechType.PowerUpgradeModule, - TechType.VehicleArmorPlating, - TechType.VehicleHullModule1, - TechType.VehicleHullModule2, - TechType.VehicleHullModule3, - TechType.VehiclePowerUpgradeModule, - TechType.VehicleStorageModule, - }; - - public static List Equipment = new List { - TechType.MapRoomHUDChip, - TechType.Rebreather, - TechType.Compass, - TechType.Fins, - TechType.HighCapacityTank, - TechType.PlasteelTank, - TechType.RadiationGloves, - TechType.RadiationHelmet, - TechType.RadiationSuit, - TechType.ReinforcedDiveSuit, - TechType.ReinforcedGloves, - TechType.Stillsuit, - TechType.SwimChargeFins, - TechType.Tank, - TechType.UltraGlideFins, - }; - - public static List Tools = new List { - TechType.AirBladder, - TechType.Beacon, - TechType.Builder, - TechType.CyclopsDecoy, - TechType.DiamondBlade, - TechType.DiveReel, - TechType.DoubleTank, - TechType.FireExtinguisher, - TechType.Flare, - TechType.Flashlight, - TechType.Gravsphere, - TechType.HeatBlade, - TechType.Knife, - TechType.LaserCutter, - TechType.LEDLight, - TechType.Pipe, - TechType.PipeSurfaceFloater, - TechType.PropulsionCannon, - TechType.RepulsionCannon, - TechType.Scanner, - TechType.Seaglide, - TechType.SmallStorage, - TechType.StasisRifle, - TechType.Welder, - TechType.LuggageBag, - }; - - public static List Torpedoes = new List { - TechType.GasTorpedo, - TechType.WhirlpoolTorpedo - }; - - public static List PlantsAndSeeds = new List { - TechType.AcidMushroomSpore, - TechType.BluePalmSeed, - TechType.BulboTreePiece, - TechType.CreepvinePiece, - TechType.CreepvineSeedCluster, - TechType.EyesPlantSeed, - TechType.FernPalmSeed, - TechType.GabeSFeatherSeed, - TechType.HangingFruit, - TechType.JellyPlantSeed, - TechType.KooshChunk, - TechType.Melon, - TechType.MelonSeed, - TechType.MembrainTreeSeed, - TechType.OrangeMushroomSpore, - TechType.OrangePetalsPlantSeed, - TechType.PinkFlowerSeed, - TechType.PinkMushroomSpore, - TechType.PurpleBrainCoralPiece, - TechType.PurpleBranchesSeed, - TechType.PurpleFanSeed, - TechType.PurpleRattleSpore, - TechType.PurpleStalkSeed, - TechType.PurpleTentacleSeed, - TechType.PurpleVasePlantSeed, - TechType.PurpleVegetable, - TechType.RedBasketPlantSeed, - TechType.RedBushSeed, - TechType.RedConePlantSeed, - TechType.RedGreenTentacleSeed, - TechType.RedRollPlantSeed, - TechType.SeaCrownSeed, - TechType.ShellGrassSeed, - TechType.SmallFanSeed, - TechType.SmallMelon, - TechType.SnakeMushroomSpore, - TechType.SpikePlantSeed, - TechType.SpottedLeavesPlantSeed, - TechType.WhiteMushroomSpore, - }; - - public static List Metals = new List { - TechType.Copper, - TechType.Gold, - TechType.Lead, - TechType.Lithium, - TechType.Magnetite, - TechType.ScrapMetal, - TechType.Nickel, - TechType.PlasteelIngot, - TechType.Silver, - TechType.Titanium, - TechType.TitaniumIngot, - }; - - public static List NaturalMaterials = new List { - TechType.GasPod, - TechType.CoralChunk, - TechType.WhiteMushroom, - TechType.AcidMushroom, - TechType.JeweledDiskPiece, - TechType.BloodOil, - TechType.CrashPowder, - TechType.Salt, - TechType.SeaTreaderPoop, - TechType.StalkerTooth, - TechType.JellyPlant, - }; - - public static List Electronics = new List { - TechType.AdvancedWiringKit, - TechType.ComputerChip, - TechType.CopperWire, - TechType.DepletedReactorRod, - TechType.ReactorRod, - TechType.WiringKit, - }; - - public static List SyntheticMaterials = new List { - TechType.Aerogel, - TechType.AramidFibers, - TechType.Benzene, - TechType.Bleach, - TechType.EnameledGlass, - TechType.FiberMesh, - TechType.Glass, - TechType.HatchingEnzymes, - TechType.HydrochloricAcid, - TechType.Lubricant, - TechType.Polyaniline, - TechType.PrecursorIonCrystal, - TechType.Silicone, - }; - - public static List CrystalMaterials = new List { - TechType.AluminumOxide, - TechType.Diamond, - TechType.Kyanite, - TechType.Quartz, - TechType.Sulphur, - TechType.UraniniteCrystal, - }; - - public static List Batteries = new List { - TechType.Battery, - TechType.PowerCell, - TechType.PrecursorIonBattery, - TechType.PrecursorIonPowerCell, - }; - - public static List IndividualItems = new List { - TechType.GasPod, - TechType.CoralChunk, - TechType.WhiteMushroom, - TechType.AcidMushroom, - TechType.JeweledDiskPiece, - TechType.AdvancedWiringKit, - TechType.Aerogel, - TechType.AluminumOxide, - TechType.AramidFibers, - TechType.Benzene, - TechType.Bleach, - TechType.BloodOil, - TechType.ComputerChip, - TechType.Copper, - TechType.CopperWire, - TechType.CrashPowder, - TechType.DepletedReactorRod, - TechType.Diamond, - TechType.EnameledGlass, - TechType.FiberMesh, - TechType.FirstAidKit, - TechType.Glass, - TechType.Gold, - TechType.HatchingEnzymes, - TechType.HydrochloricAcid, - TechType.JellyPlant, - TechType.Kyanite, - TechType.Lead, - TechType.Lithium, - TechType.Lubricant, - TechType.Magnetite, - TechType.ScrapMetal, - TechType.Nickel, - TechType.PlasteelIngot, - TechType.Polyaniline, - TechType.PrecursorIonCrystal, - TechType.Quartz, - TechType.ReactorRod, - TechType.Salt, - TechType.SeaTreaderPoop, - TechType.Silicone, - TechType.Silver, - TechType.StalkerTooth, - TechType.Sulphur, - TechType.Titanium, - TechType.TitaniumIngot, - TechType.UraniniteCrystal, - TechType.WiringKit, - TechType.Battery, - TechType.PowerCell, - TechType.PrecursorIonBattery, - TechType.PrecursorIonPowerCell, - }; - } - [Serializable] public class AutosorterFilter { public string Category; public List Types = new List(); - public bool IsCategory() => !string.IsNullOrEmpty(Category); public string GetString() @@ -487,106 +56,39 @@ public static List GetFilters() return Filters; } - public static List GetOldFilter(string oldCategory, out bool success, out string newCategory) - { - var category = AutoSorterCategory.None; - if (!Int32.TryParse(oldCategory, out int oldCategoryInt)) - { - newCategory = ""; - success = false; - return new List(); - } - category = (AutoSorterCategory)oldCategoryInt; - newCategory = category.ToString(); - - success = true; - switch (category) - { - default: - case AutoSorterCategory.None: return AutosorterCategoryData.IndividualItems; - - case AutoSorterCategory.Food: return AutosorterCategoryData.Food; - case AutoSorterCategory.Water: return AutosorterCategoryData.Water; - case AutoSorterCategory.PlantsAndSeeds: return AutosorterCategoryData.PlantsAndSeeds; - case AutoSorterCategory.Metals: return AutosorterCategoryData.Metals; - case AutoSorterCategory.NaturalMaterials: return AutosorterCategoryData.NaturalMaterials; - case AutoSorterCategory.SyntheticMaterials: return AutosorterCategoryData.SyntheticMaterials; - case AutoSorterCategory.Electronics: return AutosorterCategoryData.Electronics; - case AutoSorterCategory.CrystalMaterials: return AutosorterCategoryData.CrystalMaterials; - case AutoSorterCategory.Batteries: return AutosorterCategoryData.Batteries; - case AutoSorterCategory.Fish: return AutosorterCategoryData.Fish; - case AutoSorterCategory.Eggs: return AutosorterCategoryData.CreatureEggs; - case AutoSorterCategory.Tools: return AutosorterCategoryData.Tools; - case AutoSorterCategory.Equipment: return AutosorterCategoryData.Equipment; - case AutoSorterCategory.MysteriousTablets: return AutosorterCategoryData.MysteriousTablets; - case AutoSorterCategory.ScannerRoomUpgrades: return AutosorterCategoryData.ScannerRoomUpgrades; - case AutoSorterCategory.GeneralUpgrades: return AutosorterCategoryData.GeneralUpgrades; - case AutoSorterCategory.SeamothUpgrades: return AutosorterCategoryData.SeamothUpgrades; - case AutoSorterCategory.PrawnSuitUpgrades: return AutosorterCategoryData.PrawnSuitUpgrades; - case AutoSorterCategory.CyclopsUpgrades: return AutosorterCategoryData.CyclopsUpgrades; - case AutoSorterCategory.Torpedoes: return AutosorterCategoryData.Torpedoes; - case AutoSorterCategory.AlterraStuff: return AutosorterCategoryData.AlterraArtifacts; - } - } - [Serializable] private class TypeReference { - public string Name = ""; - public TechType Value = TechType.None; + public string TechName = ""; + public TechType TechID = TechType.None; } private static void InitializeFilters() { - var path = Mod.GetAssetPath("filters.json"); - var file = JsonConvert.DeserializeObject>(File.ReadAllText(path)); - Filters = file.Where((f) => f.IsCategory()).ToList(); - - if (Mod.config.ShowAllItems) - { - var typeRefPath = Mod.GetAssetPath("type_reference.json"); - List typeReferences = - JsonConvert.DeserializeObject>(File.ReadAllText(typeRefPath)); - typeReferences.Sort((TypeReference a, TypeReference b) => - { - string aName = Language.main.Get(a.Value); - string bName = Language.main.Get(b.Value); - return String.Compare(aName.ToLowerInvariant(), bName.ToLowerInvariant(), StringComparison.Ordinal); - }); + string getFilters; + // Gets the list of Cateories that are UsedInMod = true + getFilters = GetLists.GetFiltersFromJson('C', Mod.config.GameVersion); + var categoryList = JsonConvert.DeserializeObject>(getFilters); + Filters = categoryList.Where((f) => f.IsCategory()).ToList(); - foreach (var typeRef in typeReferences) - { - Filters.Add(new AutosorterFilter() {Category = "", Types = new List {typeRef.Value}}); - } - return; - } - var sorted = file.Where(f => !f.IsCategory()).ToList(); - sorted.Sort((x, y) => - { - string xName = Language.main.Get(x.Types.First()); - string yName = Language.main.Get(y.Types.First()); - return string.Compare(xName.ToLowerInvariant(), yName.ToLowerInvariant(), StringComparison.Ordinal); - }); - foreach (var filter in sorted) + // Gets the list of TechTypes for the Game Version SN or BZ + getFilters = GetLists.GetFiltersFromJson('T', Mod.config.GameVersion); + List techTypeList = JsonConvert.DeserializeObject>(getFilters); + + techTypeList.Sort((TypeReference a, TypeReference b) => { - Filters.Add(filter); - } - } + string aName = Language.main.Get(a.TechID); + string bName = Language.main.Get(b.TechID); - private static void AddEntry(string category, List types) - { - Filters.Add(new AutosorterFilter { - Category = category, - Types = types + //Returns the list of items from techtypes.json + return aName.CompareTo(bName); }); - } - private static void AddEntry(TechType type) - { - Filters.Add(new AutosorterFilter { - Category = "", - Types = new List { type } - }); + foreach (var typeRef in techTypeList) + { + Filters.Add(new AutosorterFilter() { Category = "", Types = new List { typeRef.TechID } }); + } + return; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/BZ/AutosortLockersSML.dll b/SubnauticaModSystem/AutosortLockers/BZ/AutosortLockersSML.dll new file mode 100644 index 0000000..3026259 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/AutosortLockersSML.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/Unity.TextMeshPro.dll b/SubnauticaModSystem/AutosortLockers/BZ/Unity.TextMeshPro.dll new file mode 100644 index 0000000..62f78c1 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/Unity.TextMeshPro.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.ARModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.ARModule.dll new file mode 100644 index 0000000..eeab9f4 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.ARModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.AccessibilityModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.AccessibilityModule.dll new file mode 100644 index 0000000..84b4157 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.AccessibilityModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.AndroidJNIModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.AndroidJNIModule.dll new file mode 100644 index 0000000..cafb06c Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.AndroidJNIModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.ClothModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.ClothModule.dll new file mode 100644 index 0000000..4a09482 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.ClothModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.ClusterInputModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.ClusterInputModule.dll new file mode 100644 index 0000000..6094dab Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.ClusterInputModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.ClusterRendererModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.ClusterRendererModule.dll new file mode 100644 index 0000000..532fb22 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.ClusterRendererModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.CrashReportingModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.CrashReportingModule.dll new file mode 100644 index 0000000..2af0576 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.CrashReportingModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.DSPGraphModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.DSPGraphModule.dll new file mode 100644 index 0000000..b0d97c5 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.DSPGraphModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.GameCenterModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.GameCenterModule.dll new file mode 100644 index 0000000..7b7e8d2 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.GameCenterModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.GridModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.GridModule.dll new file mode 100644 index 0000000..8d91d26 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.GridModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.LocalizationModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.LocalizationModule.dll new file mode 100644 index 0000000..be2fab6 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.LocalizationModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.PerformanceReportingModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.PerformanceReportingModule.dll new file mode 100644 index 0000000..864be50 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.PerformanceReportingModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.SpriteMaskModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.SpriteMaskModule.dll new file mode 100644 index 0000000..8ba6184 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.SpriteMaskModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.SpriteShapeModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.SpriteShapeModule.dll new file mode 100644 index 0000000..fc5b9b8 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.SpriteShapeModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.SubsystemsModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.SubsystemsModule.dll new file mode 100644 index 0000000..c82575a Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.SubsystemsModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.TerrainPhysicsModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.TerrainPhysicsModule.dll new file mode 100644 index 0000000..a4efa03 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.TerrainPhysicsModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.TilemapModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.TilemapModule.dll new file mode 100644 index 0000000..e32861a Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.TilemapModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UNETModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UNETModule.dll new file mode 100644 index 0000000..c9c248a Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UNETModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UnityAnalyticsModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UnityAnalyticsModule.dll new file mode 100644 index 0000000..261a0da Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UnityAnalyticsModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UnityConnectModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UnityConnectModule.dll new file mode 100644 index 0000000..d54023e Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UnityConnectModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UnityWebRequestAudioModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UnityWebRequestAudioModule.dll new file mode 100644 index 0000000..5ea9735 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UnityWebRequestAudioModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UnityWebRequestTextureModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UnityWebRequestTextureModule.dll new file mode 100644 index 0000000..09359e5 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.UnityWebRequestTextureModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.VFXModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.VFXModule.dll new file mode 100644 index 0000000..5ae2cc7 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.VFXModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.VRModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.VRModule.dll new file mode 100644 index 0000000..1da04e9 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.VRModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.VehiclesModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.VehiclesModule.dll new file mode 100644 index 0000000..bc77444 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.VehiclesModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.VideoModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.VideoModule.dll new file mode 100644 index 0000000..971c88e Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.VideoModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.XRModule.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.XRModule.dll new file mode 100644 index 0000000..4c8bb99 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.XRModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.dll b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.dll new file mode 100644 index 0000000..87a2f2e Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/BZ/UnityEngine.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/CanvasLink_Patch.cs b/SubnauticaModSystem/AutosortLockers/CanvasLink_Patch.cs new file mode 100644 index 0000000..0ba2135 --- /dev/null +++ b/SubnauticaModSystem/AutosortLockers/CanvasLink_Patch.cs @@ -0,0 +1,41 @@ +using HarmonyLib; +using System.Collections.Generic; +using System.Reflection; +using UnityEngine; + +namespace AutosortLockers +{ +#if BZ + [HarmonyPatch(typeof(CanvasLink))] + public class CanvasLink_Patch + { + private static readonly FieldInfo canvasesInfo = typeof(CanvasLink).GetField("canvases", BindingFlags.NonPublic | BindingFlags.Instance); + + [HarmonyPatch("SetCanvasesEnabled")] + [HarmonyPrefix] + public static bool PrefixSetCanvasesEnabled(ref CanvasLink __instance) + { + if (__instance == null) + return false; + + Canvas[] array = (Canvas[])(canvasesInfo.GetValue(__instance)); + List list = new List(); + if (array != null && array.Length > 0) + { + for (int i = 0; i < array.Length; i++) + { + if (array[i] != null) + { + list.Add(array[i]); + } + else + { + } + } + canvasesInfo.SetValue(__instance, list.ToArray()); + } + return true; + } + } +#endif +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/ColorPicker.cs b/SubnauticaModSystem/AutosortLockers/ColorPicker.cs index 2889211..40cf801 100644 --- a/SubnauticaModSystem/AutosortLockers/ColorPicker.cs +++ b/SubnauticaModSystem/AutosortLockers/ColorPicker.cs @@ -15,6 +15,7 @@ public void Initialize(Color initialColor) base.Initialize(); var sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("Circle.png"), new Vector2(0.5f, 0.5f)); + for (int i = 0; i < buttons.Count; ++i) { var button = buttons[i]; @@ -51,21 +52,20 @@ public override void Open() int buttonPage = index / ButtonsPerPage; ShowPage(buttonPage); } + + /*_____________________________________________________________________________________________________*/ - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////// - public static ColorPicker Create(Transform parent) + public static ColorPicker Create(Transform parent, GameObject lockerPrefab = null) { var beaconColorPicker = new GameObject("ColorPicker", typeof(RectTransform)).AddComponent(); - + // Used to calculate the size of the color picker background beaconColorPicker.ButtonSize = 15; beaconColorPicker.Spacing = 15; - beaconColorPicker.ButtonsPerPage = 72; - beaconColorPicker.ButtonsPerRow = 8; - - Picker.Create(parent, beaconColorPicker, Mod.colors.Count); + beaconColorPicker.ButtonsPerPage = 140; + beaconColorPicker.ButtonsPerRow = 10; + Picker.Create(parent, beaconColorPicker, Mod.colors.Count, lockerPrefab); return beaconColorPicker; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/ColorPickerButton.cs b/SubnauticaModSystem/AutosortLockers/ColorPickerButton.cs index 1c97187..34f89f6 100644 --- a/SubnauticaModSystem/AutosortLockers/ColorPickerButton.cs +++ b/SubnauticaModSystem/AutosortLockers/ColorPickerButton.cs @@ -32,12 +32,6 @@ public void OnPointerClick(PointerEventData eventData) } public void Initialize(int id, Color color, bool toggled, Sprite imageSprite) - { - var sprite = new Atlas.Sprite(imageSprite); - Initialize(id, color, toggled, sprite); - } - - public void Initialize(int id, Color color, bool toggled, Atlas.Sprite imageSprite) { this.id = id; this.toggled = toggled; @@ -52,8 +46,14 @@ public void Initialize(int id, Color color, bool toggled, Atlas.Sprite imageSpri } highlight.sprite = hoverSprite; +#if SN + imageSprite = ImageUtils.LoadSprite(Mod.GetAssetPath("Circle.png"), new Vector2(0.5f, 0.5f)); + var sprite = new Atlas.Sprite(imageSprite); + image.sprite = sprite; +#elif BZ image.sprite = imageSprite; +#endif image.color = color; } @@ -74,9 +74,8 @@ public void OnPointerExit(PointerEventData eventData) pointerOver = false; } + /*_____________________________________________________________________________________________________*/ - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public static ColorPickerButton Create(Transform parent, float width, float iconWidth) { var button = new GameObject("ColorPickerButton", typeof(RectTransform)).AddComponent(); @@ -99,4 +98,4 @@ public static ColorPickerButton Create(Transform parent, float width, float icon return button; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/ColorPickerPageButton.cs b/SubnauticaModSystem/AutosortLockers/ColorPickerPageButton.cs index 48e1f01..57632e6 100644 --- a/SubnauticaModSystem/AutosortLockers/ColorPickerPageButton.cs +++ b/SubnauticaModSystem/AutosortLockers/ColorPickerPageButton.cs @@ -42,7 +42,6 @@ public void Initialize(Sprite sprite, Color color) public void Update() { var color = (pointerDown ? DownColor : (pointerOver ? HoverColor : UpColor)); - if (image != null) { image.color = color; @@ -69,20 +68,17 @@ public void OnPointerUp(PointerEventData eventData) pointerDown = false; } + /*_____________________________________________________________________________________________________*/ - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public static ColorPickerPageButton Create(Transform parent, Color color, float iconWidth = 20) { var pageButton = new GameObject("ColorPickerPageButton", typeof(RectTransform)); var rt = pageButton.transform as RectTransform; RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); - RectTransformExtensions.SetSize(rt, iconWidth, iconWidth); - rt.anchoredPosition = new Vector2(0, 0); var icon = LockerPrefabShared.CreateIcon(rt, color, 0); + // Size of the arrows RectTransformExtensions.SetSize(icon.rectTransform, iconWidth, iconWidth); - icon.rectTransform.anchoredPosition = new Vector2(0, 0); pageButton.AddComponent(); @@ -92,4 +88,4 @@ public static ColorPickerPageButton Create(Transform parent, Color color, float return button; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/ColorSetting.cs b/SubnauticaModSystem/AutosortLockers/ColorSetting.cs index bf727f2..cdc24cf 100644 --- a/SubnauticaModSystem/AutosortLockers/ColorSetting.cs +++ b/SubnauticaModSystem/AutosortLockers/ColorSetting.cs @@ -1,10 +1,10 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using UnityEngine; -using UnityEngine.EventSystems; +#if SN using UnityEngine.UI; +#elif BZ +using TMPro; +#endif namespace AutosortLockers { @@ -20,12 +20,18 @@ private void Awake() { rectTransform = transform as RectTransform; } - +#if SN private void Initialize(Text textPrefab, string label) { activeButton = ColoredIconButton.Create(transform, CustomizeScreen.ScreenContentColor, textPrefab, label, 100, 15); activeButton.text.supportRichText = true; } +#elif BZ + private void Initialize(TextMeshProUGUI textPrefab, string label) + { + activeButton = ColoredIconButton.Create(transform, CustomizeScreen.ScreenContentColor, textPrefab, label, 100, 15); + } +#endif internal void SetInitialValue(Color initialColor) { @@ -43,15 +49,17 @@ private void OnClick() onClick(); } + /*_____________________________________________________________________________________________________*/ - /////////////////////////////////////////////////////////////////////////////////////////// - public static ColorSetting Create(Transform parent, string label) + public static ColorSetting Create(Transform parent, string label, GameObject lockerPrefab = null) { - var lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); +#if SN + lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); - textPrefab.fontSize = 12; - textPrefab.color = new Color32(66, 134, 244, 255); - +#elif BZ + var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); +#endif + var beaconController = new GameObject("ColorSettings", typeof(RectTransform)).AddComponent(); var rt = beaconController.gameObject.transform as RectTransform; RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); @@ -60,4 +68,4 @@ public static ColorSetting Create(Transform parent, string label) return beaconController; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/ColoredIconButton.cs b/SubnauticaModSystem/AutosortLockers/ColoredIconButton.cs index a453539..a74bd40 100644 --- a/SubnauticaModSystem/AutosortLockers/ColoredIconButton.cs +++ b/SubnauticaModSystem/AutosortLockers/ColoredIconButton.cs @@ -1,12 +1,12 @@ using Common.Mod; using Common.Utility; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; +#if BZ +using TMPro; +#endif namespace AutosortLockers { @@ -23,7 +23,11 @@ public class ColoredIconButton : MonoBehaviour, IPointerClickHandler, IPointerEn public Color imageColor; public Image image; +#if SN public Text text; +#elif BZ + public TextMeshProUGUI text; +#endif public Action onClick = delegate { }; private Color imageDisabledColor; @@ -87,9 +91,15 @@ public void OnPointerUp(PointerEventData eventData) pointerDown = false; } + /*_____________________________________________________________________________________________________*/ - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - public static ColoredIconButton Create(Transform parent, Color color, Text textPrefab = null, string label = "", float width = 100, float iconWidth = 20) + public static ColoredIconButton Create(Transform parent, Color color, +#if SN + Text textPrefab = null, +#elif BZ + TextMeshProUGUI textPrefab = null, +#endif + string label = "", float width = 100, float iconWidth = 20) { var checkboxButton = new GameObject("Checkbox", typeof(RectTransform)); var rt = checkboxButton.transform as RectTransform; @@ -101,14 +111,23 @@ public static ColoredIconButton Create(Transform parent, Color color, Text textP RectTransformExtensions.SetSize(checkbox.rectTransform, iconWidth, iconWidth); checkbox.rectTransform.anchoredPosition = new Vector2(textPrefab != null ? - width / 2 + 10 : 0, 0); +#if SN Text text = null; +#elif BZ + TextMeshProUGUI text = null; +#endif + if (textPrefab != null) { var spacing = 5; - text = LockerPrefabShared.CreateText(rt, textPrefab, color, 0, 10, label); + text = LockerPrefabShared.CreateText(rt, textPrefab, color, 0, 10, label, "Label"); RectTransformExtensions.SetSize(text.rectTransform, width - 20 - spacing, 20); text.rectTransform.anchoredPosition = new Vector2(10 + spacing, 0); +#if SN text.alignment = TextAnchor.MiddleLeft; +#elif BZ + text.alignment = TextAlignmentOptions.MidlineLeft; +#endif } checkboxButton.AddComponent(); @@ -121,4 +140,4 @@ public static ColoredIconButton Create(Transform parent, Color color, Text textP return button; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/Config.cs b/SubnauticaModSystem/AutosortLockers/Config.cs index 4cc282a..e355dd2 100644 --- a/SubnauticaModSystem/AutosortLockers/Config.cs +++ b/SubnauticaModSystem/AutosortLockers/Config.cs @@ -1,18 +1,27 @@ -using Oculus.Newtonsoft.Json; +#if SN +using Oculus.Newtonsoft.Json; +#elif BZ +using Newtonsoft.Json; +#endif namespace AutosortLockers { - [JsonObject] - public class Config - { - public bool EasyBuild { get; set; } = false; - public float SortInterval { get; set; } = 1.0f; - public bool ShowAllItems { get; set; } = false; - public int AutosorterWidth { get; set; } = 5; - public int AutosorterHeight { get; set; } = 6; - public int ReceptacleWidth { get; set; } = 6; - public int ReceptacleHeight { get; set; } = 8; - public int StandingReceptacleWidth { get; set; } = 6; - public int StandingReceptacleHeight { get; set; } = 8; - } -} + [JsonObject] + public class Config + { + public bool ShowLabel { get; set; } = false; + public bool EasyBuild { get; set; } = true; + public float SortInterval { get; set; } = 1.0f; + public int AutosorterWidth { get; set; } = 5; + public int AutosorterHeight { get; set; } = 6; + public int ReceptacleWidth { get; set; } = 6; + public int ReceptacleHeight { get; set; } = 8; + public int StandingReceptacleWidth { get; set; } = 6; + public int StandingReceptacleHeight { get; set; } = 8; +#if SN + public char GameVersion { get; set; } = '1'; +#elif BZ + public char GameVersion { get; set; } = '2'; +#endif + } +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/ConfigureButton.cs b/SubnauticaModSystem/AutosortLockers/ConfigureButton.cs index 9a3bd66..932ea09 100644 --- a/SubnauticaModSystem/AutosortLockers/ConfigureButton.cs +++ b/SubnauticaModSystem/AutosortLockers/ConfigureButton.cs @@ -44,11 +44,11 @@ public void OnPointerExit(PointerEventData eventData) } - public static ConfigureButton Create(Transform parent, Color color, float x) + public static ConfigureButton Create(Transform parent, Color color, float x, int buttonPos) { var config = LockerPrefabShared.CreateIcon(parent, color, 0); RectTransformExtensions.SetSize(config.rectTransform, 20, 20); - config.rectTransform.anchoredPosition = new Vector2(x, -104); + config.rectTransform.anchoredPosition = new Vector2(x, buttonPos); config.gameObject.AddComponent(); var button = config.gameObject.AddComponent(); @@ -56,4 +56,4 @@ public static ConfigureButton Create(Transform parent, Color color, float x) return button; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/CustomizeScreen.cs b/SubnauticaModSystem/AutosortLockers/CustomizeScreen.cs index 09debf6..8ef1266 100644 --- a/SubnauticaModSystem/AutosortLockers/CustomizeScreen.cs +++ b/SubnauticaModSystem/AutosortLockers/CustomizeScreen.cs @@ -1,11 +1,10 @@ -using Common.Mod; -using Common.Utility; +using Common.Utility; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using UnityEngine; using UnityEngine.UI; +#if BZ +using TMPro; +#endif namespace AutosortLockers { @@ -20,13 +19,11 @@ class CustomizeScreen : MonoBehaviour [SerializeField] private Image background; [SerializeField] - private Text labelLabel; - [SerializeField] private LabelController label; [SerializeField] private ConfigureButton exitButton; [SerializeField] - private ColorSetting labelColorSetting; + private ColorSetting labelSetting; [SerializeField] private ColorSetting iconColorSetting; [SerializeField] @@ -59,9 +56,6 @@ internal void Initialize(SaveDataEntry saveData) label.onModified += OnLabelChanged; exitButton.onClick += OnExitButtonClicked; - labelColorSetting.SetInitialValue(saveData.LabelColor.ToColor()); - labelColorSetting.onClick += OnLabelColorSettingClicked; - iconColorSetting.SetInitialValue(saveData.IconColor.ToColor()); iconColorSetting.onClick += OnIconColorSettingClicked; @@ -78,7 +72,6 @@ internal void Initialize(SaveDataEntry saveData) private void SetColor(SaveDataEntry saveData) { label.text.color = saveData.LabelColor.ToColor(); - labelColorSetting.SetColor(saveData.LabelColor.ToColor()); iconColorSetting.SetColor(saveData.IconColor.ToColor()); textColorSetting.SetColor(saveData.OtherTextColor.ToColor()); buttonsColorSetting.SetColor(saveData.ButtonsColor.ToColor()); @@ -155,7 +148,7 @@ private void OnButtonsColorPicked(int index) SetColor(target); } - + private void OnLockerColorSettingClicked() { colorPicker.Initialize(target.LockerColor.ToColor()); @@ -171,56 +164,67 @@ private void OnLockerColorPicked(int index) SetColor(target); } + /*_____________________________________________________________________________________________________*/ - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - public static CustomizeScreen Create(Transform parent, SaveDataEntry data) + public static CustomizeScreen Create(Transform parent, SaveDataEntry data, GameObject lockerPrefab = null) { - var lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); +#if SN + lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); +#elif BZ + var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); +#endif + textPrefab.fontSize = 12; textPrefab.color = CustomizeScreen.ScreenContentColor; - + // The color picker settings var screen = new GameObject("CustomizeScreen", typeof(RectTransform)).AddComponent(); RectTransformExtensions.SetParams(screen.rectTransform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); RectTransformExtensions.SetSize(screen.rectTransform, 114, 241); screen.background = new GameObject("Background").AddComponent(); screen.background.sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("CustomizeScreen.png")); - RectTransformExtensions.SetParams(screen.background.rectTransform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), screen.transform); - RectTransformExtensions.SetSize(screen.background.rectTransform, 114, 241); - - screen.labelLabel = LockerPrefabShared.CreateText(screen.background.transform, textPrefab, ScreenContentColor, 100, 9, "Label:"); - RectTransformExtensions.SetSize(screen.labelLabel.rectTransform, 90, 40); - screen.labelLabel.alignment = TextAnchor.MiddleLeft; - - screen.label = LabelController.Create(data, screen.background.transform); - screen.label.rectTransform.anchoredPosition = new Vector2(0, 80); - - screen.exitButton = ConfigureButton.Create(screen.background.transform, Color.white, 40); + // 1st = 2nd = 3rd = horizontal 4th = vertical positon of the color settings + if (parent.parent.parent.name == "AutosortTarget(Clone)") + { + RectTransformExtensions.SetParams(screen.background.rectTransform, new Vector2(0.5f, 0.5f), new Vector2(0.52f, 0.4f), screen.transform); + } + else // Standing locker + { + RectTransformExtensions.SetParams(screen.background.rectTransform, new Vector2(0.5f, 0.5f), new Vector2(0.41f, 0.4f), screen.transform); + } + RectTransformExtensions.SetSize(screen.background.rectTransform, 114, 220); + + screen.label = LabelController.Create(data, screen.background.transform, lockerPrefab); + // The position of the Label, it is hidden sort of so this pushes it off the background + screen.label.rectTransform.anchoredPosition = new Vector2(0, 300); + // Set the fontsize to zero to make it disappear, DestroyImmediate(label) doesn't work + screen.label.text.fontSize = 0; + screen.labelSetting = ColorSetting.Create(screen.background.transform, "Color Settings", lockerPrefab); + // The position of the Color Settings string + screen.labelSetting.rectTransform.anchoredPosition = new Vector2(-10, 70); + // The position of the close (X) button on the color settings + screen.exitButton = ConfigureButton.Create(screen.background.transform, Color.white, 0, -85); var startX = 0; var startY = 30; - screen.labelColorSetting = ColorSetting.Create(screen.background.transform, "Label Color"); - screen.labelColorSetting.rectTransform.anchoredPosition = new Vector2(startX, startY); + screen.lockerColorSetting = ColorSetting.Create(screen.background.transform, "Locker Color", lockerPrefab); + screen.lockerColorSetting.rectTransform.anchoredPosition = new Vector2(startX, startY); - screen.iconColorSetting = ColorSetting.Create(screen.background.transform, "Icon Color"); + screen.iconColorSetting = ColorSetting.Create(screen.background.transform, "Icon Color", lockerPrefab); screen.iconColorSetting.rectTransform.anchoredPosition = new Vector2(startX, startY - 19); - screen.textColorSetting = ColorSetting.Create(screen.background.transform, "Filters Color"); + screen.textColorSetting = ColorSetting.Create(screen.background.transform, "Filters Color", lockerPrefab); screen.textColorSetting.rectTransform.anchoredPosition = new Vector2(startX, startY - (19 * 2)); - screen.buttonsColorSetting = ColorSetting.Create(screen.background.transform, "Misc Color"); + screen.buttonsColorSetting = ColorSetting.Create(screen.background.transform, "Misc Color", lockerPrefab); screen.buttonsColorSetting.rectTransform.anchoredPosition = new Vector2(startX, startY - (19 * 3)); - screen.lockerColorSetting = ColorSetting.Create(screen.background.transform, "Locker Color"); - screen.lockerColorSetting.rectTransform.anchoredPosition = new Vector2(startX, startY - (19 * 4)); - - screen.colorPicker = ColorPicker.Create(screen.background.transform); + screen.colorPicker = ColorPicker.Create(screen.background.transform, lockerPrefab); screen.colorPicker.gameObject.SetActive(false); screen.colorPicker.rectTransform.anchoredPosition = new Vector2(0, 30); return screen; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/PickerButton.cs b/SubnauticaModSystem/AutosortLockers/FilterPickerButton.cs similarity index 78% rename from SubnauticaModSystem/AutosortLockers/PickerButton.cs rename to SubnauticaModSystem/AutosortLockers/FilterPickerButton.cs index 5c9f294..1459a3a 100644 --- a/SubnauticaModSystem/AutosortLockers/PickerButton.cs +++ b/SubnauticaModSystem/AutosortLockers/FilterPickerButton.cs @@ -1,22 +1,21 @@ using Common.Utility; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; +#if BZ +using TMPro; +#endif namespace AutosortLockers { - public class PickerButton : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler + public class FilterPickerButton : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler { private static readonly Color inactiveColor = new Color(0.7f, 0.7f, 0.7f, 0.5f); private static readonly Color inactiveHoverColor = new Color(0.7f, 0.7f, 0.7f, 1f); private static readonly Color upColor = new Color(0.9f, 0.9f, 0.9f, 1f); private static readonly Color hoverColor = new Color(1, 1, 1); private const int Slice = 70; - private bool hover; private bool tabActive = true; private AutosorterFilter filter; @@ -26,7 +25,11 @@ public class PickerButton : MonoBehaviour, IPointerClickHandler, IPointerEnterHa [SerializeField] private Image background; [SerializeField] +#if SN private Text text; +#elif BZ + private TextMeshProUGUI text; +#endif public AutosorterFilter GetTechType() { @@ -46,10 +49,11 @@ public void SetFilter(AutosorterFilter value) filter = value; if (filter != null) { + // The filter text displayed on the lockers text.text = filter.GetString(); + SetBackgroundSprite(filter.IsCategory()); } - gameObject.SetActive(filter != null); } @@ -97,32 +101,46 @@ public void SetTabActive(bool active) tabActive = active; } - - - public static PickerButton Create(Transform parent, Text textPrefab, Action action, int width = 100, int height = 18) + public static FilterPickerButton Create(Transform parent, +#if SN + Text textPrefab, +#elif BZ + TextMeshProUGUI textPrefab, +#endif + // The size of the picker buttons, only the height is useful, the width is overwritten later + Action action, int width = 100, int height = 18) { - var button = new GameObject("PickerButton", typeof(RectTransform)).AddComponent(); + var button = new GameObject("PickerButton", typeof(RectTransform)).AddComponent(); button.transform.SetParent(parent, false); button.background = new GameObject("Background", typeof(RectTransform)).AddComponent(); RectTransformExtensions.SetParams(button.background.rectTransform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), button.transform); RectTransformExtensions.SetSize(button.background.rectTransform, width * 10, height * 10); - button.background.rectTransform.localScale = new Vector3(0.1f, 0.1f, 1); + button.background.rectTransform.localScale = new Vector3(0.1f, 0.1f, 0.5f); button.background.sprite = ImageUtils.Load9SliceSprite(Mod.GetAssetPath("MainMenuStandardSprite.png"), new RectOffset(Slice, Slice, Slice, Slice)); button.background.color = upColor; button.background.type = Image.Type.Sliced; - +#if SN button.text = new GameObject("Text", typeof(RectTransform)).AddComponent(); + button.text.alignment = TextAnchor.MiddleCenter; +#elif BZ + button.text = new GameObject("TextMeshProUGUI", typeof(RectTransform)).AddComponent(); +#endif RectTransformExtensions.SetParams(button.text.rectTransform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), button.transform); RectTransformExtensions.SetSize(button.text.rectTransform, width, height); button.text.color = new Color(1, 1, 1); button.text.font = textPrefab.font; button.text.fontSize = 10; - button.text.alignment = TextAnchor.MiddleCenter; - button.onClick += action; +#if SN + button.text.alignment = TextAnchor.MiddleLeft; +#elif BZ + button.text.alignment = TextAlignmentOptions.Left; + // Set the left margin + button.text.margin = new Vector4(5.0f, 0.0f); +#endif return button; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/GetLists.cs b/SubnauticaModSystem/AutosortLockers/GetLists.cs new file mode 100644 index 0000000..8aae828 --- /dev/null +++ b/SubnauticaModSystem/AutosortLockers/GetLists.cs @@ -0,0 +1,77 @@ +using System.Collections.Generic; +using System.Linq; +using System.IO; +#if SN +using Oculus.Newtonsoft.Json; +using Oculus.Newtonsoft.Json.Linq; +#elif BZ +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +#endif + +namespace AutosortLockers +{ + class GetLists + { + // Class to get valid lists of Category and TechTypes + + //Vince + //Logger.Log("Vince: " + text.text); + //QModManager.Utility.Logger.Log(QModManager.Utility.Logger.Level.Debug, $"Vince: " + text.text); + + private static string FilterFromJson; + + public static string GetFiltersFromJson(char listType, char gameVersion) + { + // Load categories.json + JObject catObj = JObject.Load(new JsonTextReader(File.OpenText(Mod.GetModPath() + "/categories.json"))); + // Load techtypes.json + JObject ttObj = JObject.Load(new JsonTextReader(File.OpenText(Mod.GetModPath() + "/techtypes.json"))); + + foreach (var categoriesJson in catObj) + { + // Filter variables + var gameVersions = new HashSet { 'A', gameVersion }; + var categoryIDs = new HashSet { }; + var useInMod = new HashSet { true }; + + // Right outer join on catObj. Select all Items[*] array items + var query = from c in catObj.SelectTokens("Categories[*]").OfType() + // Join catObj with ttObj on CategoryID + join t in ttObj.SelectTokens("TechTypes[*]") on (string)c["CategoryID"] equals (string)t["CategoryID"] + // Process the filters + where categoryIDs.Count() > 0 ? + useInMod.Contains((bool)c["UseInMod"]) + && gameVersions.Contains((char)c["GameVersion"]) + && gameVersions.Contains((char)t["GameVersion"]) + && categoryIDs.Contains((string)c["CategoryID"]) : + useInMod.Contains((bool)c["UseInMod"]) + && gameVersions.Contains((char)c["GameVersion"]) + && gameVersions.Contains((char)t["GameVersion"]) + select new + { + CategoryDescription = c["CategoryDescription"], + CategoryID = c["CategoryID"], + TechName = t["TechName"], + TechType = t["TechType"], + TechID = t["TechID"], + GameVersion = t["GameVersion"] + }; + // Convert the query into a formatted list + if (listType == 'T') + { + FilterFromJson = JsonConvert.SerializeObject(query.ToArray(), Formatting.Indented); + } + else + { + var results = query.GroupBy( + i => i.CategoryDescription, + t => t.TechID, + (key, g) => new { Category = key, Types = g.ToList() }); + FilterFromJson = JsonConvert.SerializeObject(results, Formatting.Indented); + } + } + return FilterFromJson; + } + } +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/LabelController.cs b/SubnauticaModSystem/AutosortLockers/LabelController.cs index 9f1d516..247928e 100644 --- a/SubnauticaModSystem/AutosortLockers/LabelController.cs +++ b/SubnauticaModSystem/AutosortLockers/LabelController.cs @@ -1,10 +1,11 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using UnityEngine; using UnityEngine.EventSystems; +#if SN using UnityEngine.UI; +#elif BZ +using TMPro; +#endif namespace AutosortLockers { @@ -14,8 +15,11 @@ class LabelController : MonoBehaviour, IPointerClickHandler, IPointerEnterHandle public RectTransform rectTransform; public Action onModified = delegate { }; +#if SN public Text text; - +#elif BZ + public TextMeshProUGUI text; +#endif [SerializeField] private SaveDataEntry target; @@ -24,12 +28,16 @@ private void Awake() rectTransform = transform as RectTransform; } +#if SN private void Initialize(SaveDataEntry data, Text textPrefab) +#elif BZ + private void Initialize(SaveDataEntry data, TextMeshProUGUI textPrefab) +#endif { target = data; text = GameObject.Instantiate(textPrefab); - text.fontSize = 16; + text.fontSize = 12; text.gameObject.name = "Text"; text.rectTransform.SetParent(transform, false); RectTransformExtensions.SetSize(text.rectTransform, 140, 50); @@ -65,17 +73,25 @@ private void Update() if (hover) { HandReticle.main.SetIcon(HandReticle.IconType.Rename); +#if SN HandReticle.main.SetInteractTextRaw("Set Locker Label", ""); +#elif BZ + HandReticle.main.SetTextRaw(HandReticle.TextType.Hand, "Set Locker Label"); +#endif } } + /*__________________________________________________________________________________________________________*/ - - /////////////////////////////////////////////////////////////////////////////////////////// - public static LabelController Create(SaveDataEntry data, Transform parent) + public static LabelController Create(SaveDataEntry data, Transform parent, GameObject lockerPrefab = null) { - var lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); +#if SN + lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); +#elif BZ + var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); +#endif + textPrefab.fontSize = 12; textPrefab.color = CustomizeScreen.ScreenContentColor; @@ -87,4 +103,4 @@ public static LabelController Create(SaveDataEntry data, Transform parent) return habitatNameController; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/Mod.cs b/SubnauticaModSystem/AutosortLockers/Mod.cs index f617fa2..c66f8ed 100644 --- a/SubnauticaModSystem/AutosortLockers/Mod.cs +++ b/SubnauticaModSystem/AutosortLockers/Mod.cs @@ -4,15 +4,26 @@ using System.IO; using System.Reflection; using Common.Mod; -using Harmony; +using HarmonyLib; +#if SN using Oculus.Newtonsoft.Json; +#elif BZ +using Newtonsoft.Json; +#endif using UnityEngine; namespace AutosortLockers { internal static class Mod { +#if SN public const string SaveDataFilename = "AutosortLockerSMLSaveData.json"; +#elif BZ + public const string SaveDataFilename = "AutosortLockerSMLBZSaveData.json"; +#endif + + private const int MAX_LOCKER_WIDTH = 8; + private const int MAX_LOCKER_HEIGHT = 10; public static Config config; public static SaveData saveData; public static List colors = new List(); @@ -25,13 +36,16 @@ internal static class Mod public static void Patch(string modDirectory = null) { Logger.Log("Starting patching"); - - Mod.modDirectory = modDirectory ?? "Subnautica_Data/Managed"; +#if SN + Mod.modDirectory = modDirectory ?? "Subnautica_Data/Managed"; +#elif BZ + Mod.modDirectory = modDirectory ?? "SubnauticaZero_Data/Managed"; +#endif LoadConfig(); AddBuildables(); - HarmonyInstance harmony = HarmonyInstance.Create("com.AutosortLockersSML.mod"); + Harmony harmony = new Harmony("com.AutosortLockersSML.mod"); harmony.PatchAll(Assembly.GetExecutingAssembly()); Logger.Log("Patched"); @@ -58,7 +72,7 @@ private static void LoadConfig() config = ModUtils.LoadConfig(GetModPath() + "/config.json"); ValidateConfig(); - var serializedColors = JsonConvert.DeserializeObject>(File.ReadAllText(GetAssetPath("colors.json"))); + List serializedColors = JsonConvert.DeserializeObject>(File.ReadAllText(GetAssetPath("colors.json"))); foreach (var sColor in serializedColors) { colors.Add(sColor.ToColor()); @@ -70,10 +84,17 @@ private static void ValidateConfig() Config defaultConfig = new Config(); ModUtils.ValidateConfigValue("SortInterval", 0.1f, 10.0f, ref config, ref defaultConfig); - ModUtils.ValidateConfigValue("AutosorterWidth", 1, 8, ref config, ref defaultConfig); - ModUtils.ValidateConfigValue("AutosorterHeight", 1, 10, ref config, ref defaultConfig); - ModUtils.ValidateConfigValue("ReceptacleWidth", 1, 8, ref config, ref defaultConfig); - ModUtils.ValidateConfigValue("ReceptacleHeight", 1, 10, ref config, ref defaultConfig); + ModUtils.ValidateConfigValue("AutosorterWidth", 1, MAX_LOCKER_WIDTH, ref config, ref defaultConfig); + ModUtils.ValidateConfigValue("AutosorterHeight", 1, MAX_LOCKER_HEIGHT, ref config, ref defaultConfig); + ModUtils.ValidateConfigValue("ReceptacleWidth", 1, MAX_LOCKER_WIDTH, ref config, ref defaultConfig); + ModUtils.ValidateConfigValue("ReceptacleHeight", 1, MAX_LOCKER_HEIGHT, ref config, ref defaultConfig); + ModUtils.ValidateConfigValue("StandingReceptacleWidth", 1, MAX_LOCKER_WIDTH, ref config, ref defaultConfig); + ModUtils.ValidateConfigValue("StandingReceptacleHeight", 1, MAX_LOCKER_HEIGHT, ref config, ref defaultConfig); +#if SN + ModUtils.ValidateConfigValue("GameVersion", '1', '1', ref config, ref defaultConfig); +#elif BZ + ModUtils.ValidateConfigValue("GameVersion", '2', '2', ref config, ref defaultConfig); +#endif } public static SaveData GetSaveData() diff --git a/SubnauticaModSystem/AutosortLockers/Patches/Initializer_Patch.cs b/SubnauticaModSystem/AutosortLockers/Patches/Initializer_Patch.cs index 70f33e5..2cbfddf 100644 --- a/SubnauticaModSystem/AutosortLockers/Patches/Initializer_Patch.cs +++ b/SubnauticaModSystem/AutosortLockers/Patches/Initializer_Patch.cs @@ -1,5 +1,4 @@ - -using Harmony; +using HarmonyLib; namespace AutosortLockers.Patches { @@ -44,4 +43,4 @@ private static void PostFix() } } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/Picker.cs b/SubnauticaModSystem/AutosortLockers/Picker.cs index 7e75d8b..8462e1f 100644 --- a/SubnauticaModSystem/AutosortLockers/Picker.cs +++ b/SubnauticaModSystem/AutosortLockers/Picker.cs @@ -2,10 +2,11 @@ using Common.Utility; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using UnityEngine; using UnityEngine.UI; +#if BZ +using TMPro; +#endif namespace AutosortLockers { @@ -28,12 +29,6 @@ class Picker : MonoBehaviour [SerializeField] private Image background; [SerializeField] - private ColorPickerPageButton prevPageButton; - [SerializeField] - private ColorPickerPageButton nextPageButton; - [SerializeField] - private Text pageText; - [SerializeField] protected List buttons = new List(); private void Awake() @@ -43,50 +38,20 @@ private void Awake() public virtual void Initialize() { - bool firstInitialize = false; - if (background.sprite == null) - { - background.sprite = ImageUtils.Load9SliceSprite(Mod.GetAssetPath("PickerBackground.png"), new RectOffset(100, 100, 100, 100)); - firstInitialize = true; - } - - int pages = GetPageCount(); - int rows = Mathf.CeilToInt(ButtonsPerPage / (float)ButtonsPerRow); float StartX = -(Spacing * (ButtonsPerRow - 1) / 2.0f); - float StartY = (Spacing * ((rows - 0.5f) / 2.0f)) + 10; + float StartY = (Spacing * ((rows - 0.5f) / 2.0f)); for (int i = 0; i < this.buttons.Count; ++i) { var button = this.buttons[i]; int page = i / ButtonsPerPage; int row = (i / ButtonsPerRow) % (ButtonsPerPage / ButtonsPerRow); int col = i % ButtonsPerRow; - button.rectTransform.anchoredPosition = new Vector2(StartX + (Spacing * col), StartY - (row * Spacing)); + button.rectTransform.anchoredPosition = new Vector2(StartX + (Spacing * col), StartY - (row * Spacing) - 3); button.onClick += OnClick; button.gameObject.SetActive(page == 0); button.toggled = false; } - - prevPageButton.Initialize("Left.png", Color.white); - nextPageButton.Initialize("Right.png", Color.white); - - var paginationY = -Spacing * rows / 2.0f; - (prevPageButton.transform as RectTransform).anchoredPosition = new Vector2(-20, paginationY); - (nextPageButton.transform as RectTransform).anchoredPosition = new Vector2(20, paginationY); - pageText.rectTransform.anchoredPosition = new Vector2(0, paginationY); - - if (firstInitialize) - { - prevPageButton.onClick += OnPrevPage; - nextPageButton.onClick += OnNextPage; - } - - page = 0; - //prevPageButton.gameObject.SetActive(pages > 1); - //nextPageButton.gameObject.SetActive(pages > 1); - //pageText.gameObject.SetActive(pages > 1); - - UpdateText(); } private int GetPageCount() @@ -94,12 +59,6 @@ private int GetPageCount() return Mathf.CeilToInt((float)buttons.Count / ButtonsPerPage); } - private void UpdateText() - { - int pages = GetPageCount(); - pageText.text = (page + 1) + "/" + pages; - } - private void OnPrevPage() { ShowPage(page - 1); @@ -114,6 +73,7 @@ protected void ShowPage(int newPage) { int pages = GetPageCount(); page = newPage; + if (page < 0) { page = pages - 1; @@ -129,7 +89,6 @@ protected void ShowPage(int newPage) int buttonPage = i / ButtonsPerPage; button.gameObject.SetActive(page == buttonPage); } - UpdateText(); } protected void OnClick(int index) @@ -168,40 +127,39 @@ public void Close() gameObject.SetActive(false); } + /*__________________________________________________________________________________________________________*/ - - /////////////////////////////////////////////////////////////////////////////////////////////////////// - protected static void Create(Transform parent, Picker instance, int buttonCount) + protected static void Create(Transform parent, Picker colorGrid, int buttonCount, GameObject lockerPrefab = null) { - var lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); +#if SN + lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); - textPrefab.fontSize = 16; +#elif BZ + var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); +#endif + + textPrefab.fontSize = 12; textPrefab.color = ScreenContentColor; - float padding = 30; - float width = padding + instance.ButtonSize + ((instance.ButtonsPerRow - 1) * instance.Spacing) - 20; - int rowCount = Mathf.CeilToInt(instance.ButtonsPerPage / (float)instance.ButtonsPerRow); - float height = padding + instance.ButtonSize + ((rowCount - 0.5f) * instance.Spacing); + float padding = 10; + float width = padding + colorGrid.ButtonSize + (colorGrid.ButtonsPerRow * colorGrid.Spacing); + int rowCount = Mathf.CeilToInt(colorGrid.ButtonsPerPage / (float)colorGrid.ButtonsPerRow); + float height = 20 + colorGrid.ButtonSize + ((rowCount - 0.5f) * colorGrid.Spacing); - var rt = instance.rectTransform; - RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); + var rt = colorGrid.rectTransform; + // The first Vector2 positions the colorGrid on the locker horz / vert. + RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.6f), parent); RectTransformExtensions.SetSize(rt, width, height); - instance.background = instance.gameObject.AddComponent(); - instance.background.type = Image.Type.Sliced; - instance.background.rectTransform.anchoredPosition = new Vector2(0, -20); - - instance.pageText = LockerPrefabShared.CreateText(instance.transform, textPrefab, Color.white, 0, 10, "X/X"); - RectTransformExtensions.SetSize(instance.pageText.rectTransform, 30, 20); + colorGrid.background = colorGrid.gameObject.AddComponent(); + colorGrid.background.sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("Background.png")); + colorGrid.background.color = new Color(1, 1, 1); for (int i = 0; i < buttonCount; ++i) { - var colorButton = ColorPickerButton.Create(instance.transform, instance.ButtonSize, instance.ButtonSize * 0.7f); - instance.buttons.Add(colorButton); + var colorButton = ColorPickerButton.Create(colorGrid.transform, colorGrid.ButtonSize, colorGrid.ButtonSize * 0.7f); + colorGrid.buttons.Add(colorButton); } - - instance.prevPageButton = ColorPickerPageButton.Create(instance.transform, Color.white); - instance.nextPageButton = ColorPickerPageButton.Create(instance.transform, Color.white); } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/PickerCloseButton.cs b/SubnauticaModSystem/AutosortLockers/PickerCloseButton.cs index 011986b..864cbc6 100644 --- a/SubnauticaModSystem/AutosortLockers/PickerCloseButton.cs +++ b/SubnauticaModSystem/AutosortLockers/PickerCloseButton.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using UnityEngine; +using UnityEngine; using UnityEngine.EventSystems; namespace AutosortLockers diff --git a/SubnauticaModSystem/AutosortLockers/PickerPageButton.cs b/SubnauticaModSystem/AutosortLockers/PickerPageButton.cs index 22d9504..f0f56e2 100644 --- a/SubnauticaModSystem/AutosortLockers/PickerPageButton.cs +++ b/SubnauticaModSystem/AutosortLockers/PickerPageButton.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using UnityEngine; +using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; @@ -24,7 +20,7 @@ public void Awake() { image = GetComponent(); } - + public void OnPointerClick(PointerEventData eventData) { if (canChangePage) @@ -48,4 +44,4 @@ public void OnPointerExit(PointerEventData eventData) pointerOver = false; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/Properties/AssemblyInfo.cs b/SubnauticaModSystem/AutosortLockers/Properties/AssemblyInfo.cs index e3dfa55..c999243 100644 --- a/SubnauticaModSystem/AutosortLockers/Properties/AssemblyInfo.cs +++ b/SubnauticaModSystem/AutosortLockers/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.0.0.0")] -[assembly: AssemblyFileVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/Properties/Resources.Designer.cs b/SubnauticaModSystem/AutosortLockers/Properties/Resources.Designer.cs index 35b3449..164a01a 100644 --- a/SubnauticaModSystem/AutosortLockers/Properties/Resources.Designer.cs +++ b/SubnauticaModSystem/AutosortLockers/Properties/Resources.Designer.cs @@ -60,15 +60,6 @@ internal Resources() { } } - /// - /// Looks up a localized string similar to Build an auto-sorter locker and containers to hold sorted items. - /// - internal static string desc { - get { - return ResourceManager.GetString("desc", resourceCulture); - } - } - /// /// Looks up a localized string similar to AutosortLockers. /// diff --git a/SubnauticaModSystem/AutosortLockers/README.md b/SubnauticaModSystem/AutosortLockers/README.md new file mode 100644 index 0000000..d54e2f6 --- /dev/null +++ b/SubnauticaModSystem/AutosortLockers/README.md @@ -0,0 +1,27 @@ +# AutoSortLocker_Tweaks +Tweaks to the original ASL mod that I find useful. Only Below Zero at the moment. + +To date, 19/06/2021, I have changed the following: + +1) Made the background on the StandingLockers larger. +2) Changed some of the preprocessor directives #if/#endif. + a) Added a directive to AutosortLockerSMLSaveData and AutosortLockerSMLBZSaveData. + b) Added a directive to Subnautica_Data and SubnauticaZero_Data. +3) Left justified the list of Filters when there is more than one filter. +4) Truncated Category names when they exceed 17 or 22 characters. Small or Large locker +5) Elminated the AutoSorterCategory enum. It is now 100% read in from the new json files. +6) All categories are now confifured in the categories.json file. +7) Hardcoded category names have been eliminated. +8) TechTypes are now read in from the techtypes.json. +9) Increased the size of the category/item picker from 7 to 10. +10) Left justified the filter names in the picker. +11) Changed the config to allow users to disable display of locker names. +12) Changed the color picker. +13) Eliminated the coloring of the Locker Name. +14) Consolidated the color picker to one page and increased the size. +15) Changed colors.json to group colors together (whites, grays, reds, purples, etc.) +16) Changed LOCKER to "Color Settings" + +Going forward, I would like to: + +2) Truncate the TechType names that are read in from the game files. diff --git a/SubnauticaModSystem/AutosortLockers/SN/AutosortLockersSML.dll b/SubnauticaModSystem/AutosortLockers/SN/AutosortLockersSML.dll new file mode 100644 index 0000000..f7d7a9e Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/AutosortLockersSML.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.AIModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.AIModule.dll new file mode 100644 index 0000000..08a5cee Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.AIModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.ARModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.ARModule.dll new file mode 100644 index 0000000..a84c32c Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.ARModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.AccessibilityModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.AccessibilityModule.dll new file mode 100644 index 0000000..fdf96de Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.AccessibilityModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.AndroidJNIModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.AndroidJNIModule.dll new file mode 100644 index 0000000..bcc76da Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.AndroidJNIModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.ClothModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.ClothModule.dll new file mode 100644 index 0000000..8f5ce4d Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.ClothModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.ClusterInputModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.ClusterInputModule.dll new file mode 100644 index 0000000..ccabd89 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.ClusterInputModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.ClusterRendererModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.ClusterRendererModule.dll new file mode 100644 index 0000000..bf12d7b Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.ClusterRendererModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.CrashReportingModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.CrashReportingModule.dll new file mode 100644 index 0000000..2108c82 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.CrashReportingModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.DSPGraphModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.DSPGraphModule.dll new file mode 100644 index 0000000..25f982e Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.DSPGraphModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.GameCenterModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.GameCenterModule.dll new file mode 100644 index 0000000..c4d2044 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.GameCenterModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.GridModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.GridModule.dll new file mode 100644 index 0000000..6f9df6a Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.GridModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.LocalizationModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.LocalizationModule.dll new file mode 100644 index 0000000..deef003 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.LocalizationModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.PerformanceReportingModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.PerformanceReportingModule.dll new file mode 100644 index 0000000..c259518 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.PerformanceReportingModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.SpriteMaskModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.SpriteMaskModule.dll new file mode 100644 index 0000000..93bfc60 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.SpriteMaskModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.SpriteShapeModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.SpriteShapeModule.dll new file mode 100644 index 0000000..377034a Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.SpriteShapeModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.StreamingModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.StreamingModule.dll new file mode 100644 index 0000000..82c6dd6 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.StreamingModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.TerrainPhysicsModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.TerrainPhysicsModule.dll new file mode 100644 index 0000000..1174bc2 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.TerrainPhysicsModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.TilemapModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.TilemapModule.dll new file mode 100644 index 0000000..1f3106f Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.TilemapModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UNETModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UNETModule.dll new file mode 100644 index 0000000..90e6429 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UNETModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UnityAnalyticsModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UnityAnalyticsModule.dll new file mode 100644 index 0000000..04c4e74 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UnityAnalyticsModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UnityConnectModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UnityConnectModule.dll new file mode 100644 index 0000000..4da27d0 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UnityConnectModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UnityWebRequestAudioModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UnityWebRequestAudioModule.dll new file mode 100644 index 0000000..8f23dbc Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UnityWebRequestAudioModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UnityWebRequestTextureModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UnityWebRequestTextureModule.dll new file mode 100644 index 0000000..3a5adf9 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.UnityWebRequestTextureModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.VFXModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.VFXModule.dll new file mode 100644 index 0000000..bb07597 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.VFXModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.VehiclesModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.VehiclesModule.dll new file mode 100644 index 0000000..211f1de Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.VehiclesModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.VideoModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.VideoModule.dll new file mode 100644 index 0000000..5707566 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.VideoModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.WindModule.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.WindModule.dll new file mode 100644 index 0000000..7d9b4b2 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.WindModule.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.dll b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.dll new file mode 100644 index 0000000..bc73a68 Binary files /dev/null and b/SubnauticaModSystem/AutosortLockers/SN/UnityEngine.dll differ diff --git a/SubnauticaModSystem/AutosortLockers/SaveData.cs b/SubnauticaModSystem/AutosortLockers/SaveData.cs index ff43937..a9eccb1 100644 --- a/SubnauticaModSystem/AutosortLockers/SaveData.cs +++ b/SubnauticaModSystem/AutosortLockers/SaveData.cs @@ -1,8 +1,6 @@ using Common.Mod; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using UnityEngine; namespace AutosortLockers @@ -12,7 +10,7 @@ public class SaveDataEntry { public string Id; public List FilterData = new List(); - public string Label = "Locker"; + public string Label = ""; public SerializableColor LabelColor = Color.white; public SerializableColor IconColor = Color.white; public SerializableColor OtherTextColor = Color.white; @@ -25,4 +23,4 @@ public class SaveData { public List Entries = new List(); } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/categories.json b/SubnauticaModSystem/AutosortLockers/categories.json new file mode 100644 index 0000000..363ad99 --- /dev/null +++ b/SubnauticaModSystem/AutosortLockers/categories.json @@ -0,0 +1,118 @@ +{ + "Categories": [ + { + "CategoryID": "batteries", + "CategoryDescription": "Batteries", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "baseupgrades", + "CategoryDescription": "Base Upgrades", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "crystalline", + "CategoryDescription": "Crystalline Materials", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "decorations", + "CategoryDescription": "Decorations", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "eggs", + "CategoryDescription": "Eggs", + "UseInMod": false, + "GameVersion": "A" + }, + { + "CategoryID": "electronics", + "CategoryDescription": "Electronics", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "CategoryDescription": "Equipment", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "fish", + "CategoryDescription": "Fish", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "food", + "CategoryDescription": "Food", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "metals", + "CategoryDescription": "Metals", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "natural", + "CategoryDescription": "Natural Materials", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "none", + "CategoryDescription": "None", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "CategoryDescription": "Plants & Seeds", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "synthetics", + "CategoryDescription": "Synthetic Materials", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "tablets", + "CategoryDescription": "Precursor Tablets", + "UseInMod": true, + "GameVersion": "1" + }, + { + "CategoryID": "tools", + "CategoryDescription": "Hand Held Tools", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "torpedoes", + "CategoryDescription": "Torpedoes", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "CategoryDescription": "Vehicle Upgrades", + "UseInMod": true, + "GameVersion": "A" + }, + { + "CategoryID": "water", + "CategoryDescription": "Water", + "UseInMod": true, + "GameVersion": "A" + } + ] +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/mod.json b/SubnauticaModSystem/AutosortLockers/mod_BZ.json similarity index 90% rename from SubnauticaModSystem/AutosortLockers/mod.json rename to SubnauticaModSystem/AutosortLockers/mod_BZ.json index 0a7eed4..d55260d 100644 --- a/SubnauticaModSystem/AutosortLockers/mod.json +++ b/SubnauticaModSystem/AutosortLockers/mod_BZ.json @@ -1,4 +1,5 @@ { + "Game": "BelowZero", "Id": "AutosortLockersSML", "DisplayName": "Autosort Lockers SML", "Author": "RandyKnapp w/PrimeSonic", diff --git a/SubnauticaModSystem/AutosortLockers/mod_SN.json b/SubnauticaModSystem/AutosortLockers/mod_SN.json new file mode 100644 index 0000000..f59a68e --- /dev/null +++ b/SubnauticaModSystem/AutosortLockers/mod_SN.json @@ -0,0 +1,10 @@ +{ + "Game": "Subnautica", + "Id": "AutosortLockersSML", + "DisplayName": "Autosort Lockers SML", + "Author": "RandyKnapp w/PrimeSonic", + "Version": "2.0.0", + "Requires": [ "SMLHelper" ], + "Enable": true, + "AssemblyName": "AutosortLockersSML.dll" +} \ No newline at end of file diff --git a/SubnauticaModSystem/AutosortLockers/techtypes.json b/SubnauticaModSystem/AutosortLockers/techtypes.json new file mode 100644 index 0000000..2fc3e7a --- /dev/null +++ b/SubnauticaModSystem/AutosortLockers/techtypes.json @@ -0,0 +1,2628 @@ +{ + "TechTypes": [ + { + "CategoryID": "crystalline", + "TechName": "Quartz", + "TechType": "Quartz", + "TechID": 1, + "GameVersion": "A" + }, + { + "CategoryID": "metals", + "TechName": "Metal Salvage", + "TechType": "ScrapMetal", + "TechID": 2, + "GameVersion": "A" + }, { + "CategoryID": "synthetics", + "TechName": "Fiber Mesh", + "TechType": "Fiber", + "TechID": 3, + "GameVersion": "A" + }, + { + "CategoryID": "metals", + "TechName": "Copper Ore", + "TechType": "Copper", + "TechID": 7, + "GameVersion": "A" + }, + { + "CategoryID": "metals", + "TechName": "Lead", + "TechType": "Lead", + "TechID": 8, + "GameVersion": "A" + }, + { + "CategoryID": "crystalline", + "TechName": "Salt Deposit", + "TechType": "Salt", + "TechID": 9, + "GameVersion": "A" + }, + { + "CategoryID": "synthetics", + "TechName": "Glass", + "TechType": "Glass", + "TechID": 15, + "GameVersion": "A" + }, + { + "CategoryID": "metals", + "TechName": "Titanium", + "TechType": "Titanium", + "TechID": 16, + "GameVersion": "A" + }, + { + "CategoryID": "synthetics", + "TechName": "Silicone Rubber", + "TechType": "Silicone", + "TechID": 17, + "GameVersion": "A" + }, + { + "CategoryID": "metals", + "TechName": "Gold", + "TechType": "Gold", + "TechID": 21, + "GameVersion": "A" + }, + { + "CategoryID": "crystalline", + "TechName": "Crystalline Sulfur", + "TechType": "Sulfur", + "TechID": 23, + "GameVersion": "A" + }, + { + "CategoryID": "synthetics", + "TechName": "Bleach", + "TechType": "Bleach", + "TechID": 27, + "GameVersion": "A" + }, + { + "CategoryID": "metals", + "TechName": "Silver Ore", + "TechType": "Silver", + "TechID": 28, + "GameVersion": "A" + }, + { + "CategoryID": "metals", + "TechName": "Titanium Ingot", + "TechType": "TitaniumIngot", + "TechID": 30, + "GameVersion": "A" + }, + { + "CategoryID": "electronics", + "TechName": "Copper Wire", + "TechType": "CopperWire", + "TechID": 32, + "GameVersion": "A" + }, + { + "CategoryID": "electronics", + "TechName": "Wiring Kit", + "TechType": "WiringKit", + "TechID": 33, + "GameVersion": "A" + }, + { + "CategoryID": "electronics", + "TechName": "Advanced Wiring Kit", + "TechType": "AdvancedWiringKit", + "TechID": 34, + "GameVersion": "A" + }, + { + "CategoryID": "natural", + "TechName": "Cave Sulfur", + "TechType": "CrashPowder", + "TechID": 35, + "GameVersion": "1" + }, + { + "CategoryID": "crystalline", + "TechName": "Diamond", + "TechType": "Diamond", + "TechID": 36, + "GameVersion": "A" + }, + { + "CategoryID": "metals", + "TechName": "Lithium", + "TechType": "Lithium", + "TechID": 40, + "GameVersion": "A" + }, + { + "CategoryID": "metals", + "TechName": "Plasteel Ingot", + "TechType": "PlasteelIngot", + "TechID": 41, + "GameVersion": "A" + }, + { + "CategoryID": "synthetics", + "TechName": "Enameled Glass", + "TechType": "EnameledGlass", + "TechID": 42, + "GameVersion": "A" + }, + { + "CategoryID": "batteries", + "TechName": "Power Cell", + "TechType": "PowerCell", + "TechID": 43, + "GameVersion": "A" + }, + { + "CategoryID": "electronics", + "TechName": "Computer Chip", + "TechType": "ComputerChip", + "TechID": 44, + "GameVersion": "A" + }, + { + "CategoryID": "crystalline", + "TechName": "Ruby", + "TechType": "AluminumOxide", + "TechID": 52, + "GameVersion": "A" + }, + { + "CategoryID": "synthetics", + "TechName": "Hydrochloric Acid", + "TechType": "HydroChloricAcid", + "TechID": 53, + "GameVersion": "A" + }, + { + "CategoryID": "metals", + "TechName": "Magnetite", + "TechType": "Magnetite", + "TechID": 54, + "GameVersion": "A" + }, + { + "CategoryID": "synthetics", + "TechName": "Polyaniline", + "TechType": "Polyaniline", + "TechID": 56, + "GameVersion": "A" + }, + { + "CategoryID": "synthetics", + "TechName": "Synthetic Fibers", + "TechType": "AramidFibers", + "TechID": 57, + "GameVersion": "A" + }, + { + "CategoryID": "synthetics", + "TechName": "Aerogel", + "TechType": "Aerogel", + "TechID": 59, + "GameVersion": "A" + }, + { + "CategoryID": "synthetics", + "TechName": "Benzene", + "TechType": "Benzene", + "TechID": 61, + "GameVersion": "A" + }, + { + "CategoryID": "synthetics", + "TechName": "Lubricant", + "TechType": "Lubricant", + "TechID": 62, + "GameVersion": "A" + }, + { + "CategoryID": "crystalline", + "TechName": "Uraninite Crystal", + "TechType": "UraniniteCrystal", + "TechID": 63, + "GameVersion": "A" + }, + { + "CategoryID": "electronics", + "TechName": "Reactor Rod", + "TechType": "ReactorRod", + "TechID": 64, + "GameVersion": "A" + }, + { + "CategoryID": "batteries", + "TechName": "Depleted Reactor Rod", + "TechType": "DepletedReactorRod", + "TechID": 65, + "GameVersion": "A" + }, + { + "CategoryID": "crystalline", + "TechName": "Ion Cube", + "TechType": "PrecursorIonCrystal", + "TechID": 66, + "GameVersion": "A" + }, + { + "CategoryID": "crystalline", + "TechName": "Kyanite", + "TechType": "Kyanite", + "TechID": 68, + "GameVersion": "2" + }, + { + "CategoryID": "metals", + "TechName": "Nickel Ore", + "TechType": "Nickel", + "TechID": 69, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": "Dive Suit", + "TechType": "DiveSuit", + "TechID": 500, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": "Fins", + "TechType": "Fins", + "TechID": 502, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": "Standard O₂ Tank", + "TechType": "Tank", + "TechID": 503, + "GameVersion": "A" + }, + { + "CategoryID": "batteries", + "TechName": "Battery", + "TechType": "Battery", + "TechID": 504, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Survival Knife", + "TechType": "Knife", + "TechID": 505, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Drill", + "TechType": "Drill", + "TechID": 506, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Flashlight", + "TechType": "Flashlight", + "TechID": 507, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Beacon", + "TechType": "Beacon", + "TechID": 508, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Habitat Builder", + "TechType": "Builder", + "TechID": 509, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": "Compass", + "TechType": "Compass", + "TechID": 512, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Air Bladder", + "TechType": "AirBladder", + "TechID": 513, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Terraformer", + "TechType": "Terraformer", + "TechID": 514, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": "Pipe", + "TechType": "Pipe", + "TechID": 515, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Pathfinder Tool", + "TechType": "DiveReel", + "TechID": 517, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": "Rebreather", + "TechType": "Rebreather", + "TechID": 518, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": "Radiation Suit", + "TechType": "RadiationSuit", + "TechID": 519, + "GameVersion": "1" + }, + { + "CategoryID": "equipment", + "TechName": "Radiation Helmet", + "TechType": "RadiationHelmet", + "TechID": 520, + "GameVersion": "1" + }, + { + "CategoryID": "equipment", + "TechName": "Radiation Gloves", + "TechType": "RadiationGloves", + "TechID": 521, + "GameVersion": "1" + }, + { + "CategoryID": "equipment", + "TechName": "Reinforced Dive Suit", + "TechType": "ReinforcedDiveSuit", + "TechID": 522, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Scanner", + "TechType": "Scanner", + "TechID": 523, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Fire Extinguisher", + "TechType": "FireExtinguisher", + "TechID": 524, + "GameVersion": "1" + }, + { + "CategoryID": "baseupgrades", + "TechName": "Scanner Room HUD Chip", + "TechType": "MapRoomHudChip", + "TechID": 525, + "GameVersion": "A" + }, + { + "CategoryID": "torpedoes", + "TechName": "Creature Decoy", + "TechType": "CyclopsDecoy", + "TechID": 527, + "GameVersion": "1" + }, + { + "CategoryID": "equipment", + "TechName": "High Capacity O₂ Tank", + "TechType": "DoubleTank", + "TechID": 528, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": "Reinforced Gloves", + "TechType": "ReinforcedGloves", + "TechID": 529, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Thumper", + "TechType": "Thumper", + "TechID": 530, + "GameVersion": "2" + }, + { + "CategoryID": "tools", + "TechName": "Precursor Tether", + "TechType": "TeleportationTool", + "TechID": 531, + "GameVersion": "2" + }, + { + "CategoryID": "tools", + "TechName": "Metal Detector", + "TechType": "MetalDetector", + "TechID": 532, + "GameVersion": "2" + }, + { + "CategoryID": "tools", + "TechName": "Headlamp", + "TechType": "FlashLightHelmet", + "TechID": 533, + "GameVersion": "2" + }, + { + "CategoryID": "tools", + "TechName": "Repair Tool", + "TechType": "Welder", + "TechID": 750, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Seaglide", + "TechType": "Seaglide", + "TechID": 751, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Mobile Vehicle Bay ", + "TechType": "Constructor", + "TechID": 752, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Flare", + "TechType": "Flare", + "TechID": 754, + "GameVersion": "2" + }, + { + "CategoryID": "tools", + "TechName": "Stasis Rifle", + "TechType": "StasisRifle", + "TechID": 755, + "GameVersion": "1" + }, + { + "CategoryID": "tools", + "TechName": "Propulsion Cannon", + "TechType": "PropulsionCannon", + "TechID": 757, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Grav Trap", + "TechType": "Gravsphere", + "TechID": 758, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Waterproof Locker", + "TechType": "SmallStorage", + "TechID": 759, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Laser Cutter", + "TechType": "LaserCutter", + "TechID": 761, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Light Stick", + "TechType": "LEDLight", + "TechID": 762, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Thermoblade", + "TechType": "HeatBlade", + "TechID": 801, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": "Lightweight High Capacity Tank", + "TechType": "PlasteelTank", + "TechID": 803, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": "Ultra High Capacity Tank", + "TechType": "HighCapacityTank", + "TechID": 804, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": " Ultra Glide Fins", + "TechType": "UltraGlideFins", + "TechID": 805, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": "Swim Charge Fins", + "TechType": "SwimChargeFins", + "TechID": 806, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Repulsion Cannon", + "TechType": "RepulsionCannon", + "TechID": 807, + "GameVersion": "1" + }, + { + "CategoryID": "equipment", + "TechName": "Stillsuit", + "TechType": "Stillsuit", + "TechID": 808, + "GameVersion": "A" + }, + { + "CategoryID": "equipment", + "TechName": "Cold Suit", + "TechType": "ColdSuit", + "TechID": 810, + "GameVersion": "2" + }, + { + "CategoryID": "equipment", + "TechName": "Cold Suit Gloves", + "TechType": "ColdSuitGloves", + "TechID": 811, + "GameVersion": "2" + }, + { + "CategoryID": "equipment", + "TechName": "Cold Suit Helmet", + "TechType": "ColdSuitHelmet", + "TechID": 812, + "GameVersion": "2" + }, + { + "CategoryID": "equipment", + "TechName": "Booster Tank", + "TechType": "SuitBoosterTank", + "TechID": 813, + "GameVersion": "2" + }, + { + "CategoryID": "eggs", + "TechName": "Safe Shallows Egg", + "TechType": "SafeShallowsEgg", + "TechID": 1250, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Kelp Forest Egg", + "TechType": "KelpForestEgg", + "TechID": 1251, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Grassy Plateaus Egg", + "TechType": "GrassyPlateausEgg", + "TechID": 1252, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Grand Reefs Egg", + "TechType": "GrandReefsEgg", + "TechID": 1253, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Mushroom Forest Egg", + "TechType": "MushroomForestEgg", + "TechID": 1254, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Bulb Zone Egg ", + "TechType": "KooshZoneEgg", + "TechID": 1255, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Identified Lava Lizard Egg", + "TechType": "LavaZoneEgg", + "TechID": 1257, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Stalker Egg", + "TechType": "StalkerEgg", + "TechID": 1258, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Reefback Leviathan Egg", + "TechType": "ReefbackEgg", + "TechID": 1259, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Spadefish Egg", + "TechType": "SpadefishEgg", + "TechID": 1260, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Rabbit Ray Egg", + "TechType": "RabbitrayEgg", + "TechID": 1261, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Mesmer Egg", + "TechType": "MesmerEgg", + "TechID": 1262, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Jumper Egg Undiscovered", + "TechType": "JumperEgg", + "TechID": 1263, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Sand Shark Egg", + "TechType": "SandsharkEgg", + "TechID": 1264, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Jellyray Egg", + "TechType": "JellyrayEgg", + "TechID": 1265, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Boneshark Egg Undiscovered", + "TechType": "BonesharkEgg", + "TechID": 1266, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Crabsnake Egg", + "TechType": "CrabsnakeEgg", + "TechID": 1267, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Ampeel Egg", + "TechType": "ShockerEgg", + "TechID": 1268, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Gasopod Egg", + "TechType": "GasopodEgg", + "TechID": 1269, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Generic Egg", + "TechType": "GenericEgg", + "TechID": 1280, + "GameVersion": "A" + }, + { + "CategoryID": "eggs", + "TechName": "Crashfish Egg", + "TechType": "CrashEgg", + "TechID": 1281, + "GameVersion": "A" + }, + { + "CategoryID": "eggs", + "TechName": "Crabsquid Egg", + "TechType": "CrabsquidEgg", + "TechID": 1283, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Cutefish Egg", + "TechType": "CutefishEgg", + "TechID": 1285, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "LavaLizard Egg", + "TechType": "LavalizardEgg", + "TechID": 1287, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Sea Monkey Egg", + "TechType": "SeamonkeyEgg", + "TechID": 1291, + "GameVersion": "2" + }, + { + "CategoryID": "eggs", + "TechName": "Arctic Ray Egg ", + "TechType": "ArcticrayEgg", + "TechID": 1292, + "GameVersion": "2" + }, + { + "CategoryID": "eggs", + "TechName": "Brute Shark Egg", + "TechType": "BrutesharkEgg", + "TechID": 1294, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Lily Paddler Egg", + "TechType": "LilyPaddlerEgg", + "TechID": 1296, + "GameVersion": "2" + }, + { + "CategoryID": "eggs", + "TechName": "Pinnacarid Egg", + "TechType": "pinnacaridEgg", + "TechID": 1298, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Squidshark Egg", + "TechType": "SquidsharkEgg", + "TechID": 1310, + "GameVersion": "A" + }, + { + "CategoryID": "eggs", + "TechName": "Titan Holefish Egg", + "TechType": "TitanHolefishEgg", + "TechID": 1312, + "GameVersion": "A" + }, + { + "CategoryID": "eggs", + "TechName": "Trivalve Egg Blue", + "TechType": "TrivalveBlueEgg", + "TechID": 1314, + "GameVersion": "A" + }, + { + "CategoryID": "eggs", + "TechName": "Trivalve Egg Gold", + "TechType": "TrivalveYellowEgg", + "TechID": 1315, + "GameVersion": "A" + }, + { + "CategoryID": "eggs", + "TechName": "Brinewing Egg", + "TechType": "BrinewingEgg", + "TechID": 1318, + "GameVersion": "1" + }, + { + "CategoryID": "eggs", + "TechName": "Cryptosuchus Egg", + "TechType": "CryptosuchusEgg", + "TechID": 1320, + "GameVersion": "A" + }, + { + "CategoryID": "eggs", + "TechName": "Glow Whale Egg", + "TechType": "GlowWhaleEgg", + "TechID": 1322, + "GameVersion": "A" + }, + { + "CategoryID": "eggs", + "TechName": "Jellyfish Egg", + "TechType": "JellyfishEgg", + "TechID": 1324, + "GameVersion": "A" + }, + { + "CategoryID": "eggs", + "TechName": "Pengwing Egg", + "TechType": "PenguinEgg", + "TechID": 1326, + "GameVersion": "2" + }, + { + "CategoryID": "eggs", + "TechName": "Rock Puncher Egg", + "TechType": "RockPuncherEgg", + "TechID": 1328, + "GameVersion": "2" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Cyclops Pressure Compensator", + "TechType": "HullRreinforcementModule", + "TechID": 1501, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Base Cyclops Rreinforcement Module", + "TechType": "HullRreinforcementModule2", + "TechID": 1514, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Chelonian Hull Rreinforcement Module", + "TechType": "HullRreinforcementModule3", + "TechID": 1515, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Cyclops Engine Efficiency Module", + "TechType": "PowerUpgradeModule", + "TechID": 1516, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Picture Frame", + "TechType": "PictureFrame", + "TechID": 1526, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Cyclops Depth Module MK1", + "TechType": "CyclopsHullModule1", + "TechID": 1537, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Cyclops Depth Module MK2", + "TechType": "CyclopsHullModule2", + "TechID": 1538, + "GameVersion": "1" + }, + { + "CategoryID": "synthetics", + "TechName": "Hatching Enzymes", + "TechType": "HatchingEnzymes", + "TechID": 1547, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Cyclops Shield GeneRator", + "TechType": "CyclopsShieldModule", + "TechID": 1551, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Cyclops Sonar Upgrade", + "TechType": "CyclopsSonArmodule", + "TechID": 1552, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Cyclops Docking Bay Repair Module", + "TechType": "CyclopsSeamothRepairModule", + "TechID": 1553, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Cyclops Decoy Tube Upgrade", + "TechType": "CyclopsDecoyModule", + "TechID": 1554, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Cyclops Fire Suppression System", + "TechType": "CyclopsFireSuppressionModule", + "TechID": 1555, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Cyclops Thermal Reactor Module", + "TechType": "CyclopsThermalReactorModule", + "TechID": 1557, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Cyclops Depth Module MK3", + "TechType": "CyclopsHullModule3", + "TechID": 1558, + "GameVersion": "1" + }, + { + "CategoryID": "tools", + "TechName": "Quantum Locker", + "TechType": "QuantumLocker", + "TechID": 1567, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Carry-all", + "TechType": "LuggageBag", + "TechID": 1807, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Electron Microscope", + "TechType": "LabEquipment1", + "TechID": 1809, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Fluid Analyser", + "TechType": "LabEquipment2", + "TechID": 1810, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Sample Analyser", + "TechType": "LabEquipment3", + "TechID": 1811, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Gray Cap", + "TechType": "Cap1", + "TechID": 1814, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Blue Cap", + "TechType": "Cap2", + "TechID": 1815, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Large Sample Flask", + "TechType": "LabContainer", + "TechID": 1816, + "GameVersion": "A" + }, + { + "CategoryID": "decorations", + "TechName": "Small Sample Flask", + "TechType": "LabContainer2", + "TechID": 1817, + "GameVersion": "A" + }, + { + "CategoryID": "decorations", + "TechName": "Cylindrical Sample Flask", + "TechType": "LabContainer3", + "TechID": 1818, + "GameVersion": "A" + }, + { + "CategoryID": "decorations", + "TechName": "Aurora Miniature", + "TechType": "StarShipSouvenir", + "TechID": 1823, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Aurora Poster", + "TechType": "PosterAurora", + "TechID": 1824, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Prawn Suit Poster", + "TechType": "PosterExosuit1", + "TechID": 1825, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Prawn Suit Poster", + "TechType": "PosterExosuit2", + "TechID": 1826, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Keep Calm Poster", + "TechType": "PosterKitty", + "TechID": 1827, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Toy Car", + "TechType": "ToyCar", + "TechID": 1828, + "GameVersion": "1" + }, + { + "CategoryID": "decorations", + "TechName": "Spy Pengling Poster", + "TechType": "PosterSpyPenguin", + "TechID": 1830, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Alterra Facilities Map", + "TechType": "RocketBaseWorldMap", + "TechID": 1836, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Motivational Poster", + "TechType": "PosterMotivational", + "TechID": 1837, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Seatruck X12 Poster", + "TechType": "SeatruckPoster", + "TechID": 1838, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Jeremiah's Bird Wall", + "TechType": "PosterJeremiahBirds", + "TechID": 1839, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Architect Poster", + "TechType": "PosterLilArchitect", + "TechID": 1840, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Bird Poster", + "TechType": "PosterJeremiahNobirds", + "TechID": 1842, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Pengling Picture", + "TechType": "PictureFredPengling", + "TechID": 1843, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Vinh Pham's Postcard", + "TechType": "PictureVinhPostcard", + "TechID": 1844, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Sam and Potato", + "TechType": "PictureSamPotato", + "TechID": 1845, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Fred's Shaving Kit", + "TechType": "FredShavingKit", + "TechID": 1847, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Seatruck Poster", + "TechType": "PosterSeatruck2", + "TechID": 1848, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Mercury Spaceship Poster", + "TechType": "PosterMercury", + "TechID": 1849, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Potato Portrait", + "TechType": "PicturePotatoPortrait", + "TechID": 1850, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Motivational Poster 2", + "TechType": "PosterMotivational2", + "TechID": 1852, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Motivational Poster 3", + "TechType": "PosterMotivational3", + "TechID": 1853, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Sam & Danielle", + "TechType": "PictureSamDanielleHappy", + "TechID": 1855, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Biological Art", + "TechType": "PictureVinhBiologyArt", + "TechID": 1857, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Abstract Art", + "TechType": "PictureDanielleAbstractArt", + "TechID": 1858, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Robot Hand Poster", + "TechType": "PictureSamHand", + "TechID": 1868, + "GameVersion": "2" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seamoth Depth Module", + "TechType": "SeamothRreinforcementModule", + "TechID": 2100, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Engine Efficiency Module", + "TechType": "VehiclePowerUpgradeModule", + "TechID": 2101, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seamoth Solar Charger", + "TechType": "SeamothSolarCharge", + "TechID": 2102, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Storage Module", + "TechType": "VehicleStorageModule", + "TechID": 2103, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seamoth Perimeter Defense System", + "TechType": "SeamothElectricalDefense", + "TechID": 2104, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Hull Rreinforcement", + "TechType": "VehicleArmorPlating", + "TechID": 2105, + "GameVersion": "1" + }, + { + "CategoryID": "tools", + "TechName": "Metal Sensor", + "TechType": "LootSensorMetal", + "TechID": 2106, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seamoth Torpedo System", + "TechType": "SeamothTorpedoModule", + "TechID": 2109, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seamoth Sonar", + "TechType": "SeamothSonArmodule", + "TechID": 2110, + "GameVersion": "1" + }, + { + "CategoryID": "torpedoes", + "TechName": "Vortex Torpedo", + "TechType": "WhirlpoolTorpedo", + "TechID": 2111, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seamoth Depth Module MK1", + "TechType": "VehicleHullModule1", + "TechID": 2112, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seamoth Depth Module MK2", + "TechType": "VehicleHullModule2", + "TechID": 2113, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seamoth Depth Module MK3", + "TechType": "VehicleHullModule3", + "TechID": 2114, + "GameVersion": "1" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Prawn Suit Jump Jet Upgrade", + "TechType": "ExosuitJetUpgradeModule", + "TechID": 2115, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Prawn Suit Drill Arm", + "TechType": "ExosuitDrillArmModule", + "TechID": 2116, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Prawn Suit Thermal Reactor", + "TechType": "ExosuitThermalReactorModule", + "TechID": 2117, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Prawn Suit Claw Arm", + "TechType": "ExosuitClawArmModule", + "TechID": 2118, + "GameVersion": "A" + }, + { + "CategoryID": "torpedoes", + "TechName": "Gas Torpedo", + "TechType": "GasTorpedo", + "TechID": 2119, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Prawn Suit Propulsion Cannon", + "TechType": "ExosuitPropulsionArmModule", + "TechID": 2120, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Prawn Suit Grappling Arm", + "TechType": "ExosuitGrapplingArmModule", + "TechID": 2121, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Prawn Suit Torpedo Arm", + "TechType": "ExosuitTorpedoArmModule", + "TechID": 2122, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Prawn Suit Depth Module MK1", + "TechType": "ExoHullModule1", + "TechID": 2128, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Prawn Suit Depth Module MK2", + "TechType": "ExoHullModule2", + "TechID": 2129, + "GameVersion": "A" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "SnowfoHop Module", + "TechType": "HoverbikeJumpModule", + "TechID": 2130, + "GameVersion": "2" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seatruck Afterburner", + "TechType": "SeatruckUpgradeAfterBurnerce", + "TechID": 2131, + "GameVersion": "2" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seatruck Thruster Upgrade", + "TechType": "SeatruckUpgradeThruster", + "TechID": 2132, + "GameVersion": "2" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seatruck Energy Efficiency Upgrade", + "TechType": "SeatruckUpgradeEnergyEfficiency", + "TechID": 2133, + "GameVersion": "2" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seatruck Perimeter Defense", + "TechType": "SeatruckUpgradePerimeterDefense", + "TechID": 2134, + "GameVersion": "2" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seatruck Horse Power Upgrade", + "TechType": "SeatruckUpgradeHorsePower", + "TechID": 2135, + "GameVersion": "2" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seatruck Depth Module MK1", + "TechType": "SeatruckUpgradeHull1", + "TechID": 2136, + "GameVersion": "2" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seatruck Depth Module MK2", + "TechType": "SeatruckUpgradeHull2", + "TechID": 2137, + "GameVersion": "2" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Seatruck Depth Module MK3", + "TechType": "SeatruckUpgradeHull3", + "TechID": 2138, + "GameVersion": "2" + }, + { + "CategoryID": "vehicleupgrades", + "TechName": "Snowfox Ice Worm Attack Reduction Module", + "TechType": "HoverbikeIceWormReductionModule", + "TechID": 2139, + "GameVersion": "2" + }, + { + "CategoryID": "baseupgrades", + "TechName": "Scanner Room Range Upgrade", + "TechType": "MapRoomUpgradeScanRange", + "TechID": 2250, + "GameVersion": "A" + }, + { + "CategoryID": "baseupgrades", + "TechName": "Scanner Room Speed Upgrade", + "TechType": "MapRoomUpgradeScanSpeed", + "TechID": 2251, + "GameVersion": "A" + }, + { + "CategoryID": "fish", + "TechName": "Holefish", + "TechType": "Holefish", + "TechID": 2501, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Creepvine Seed Cluster", + "TechType": "CreepvineSeedCluster", + "TechID": 2503, + "GameVersion": "A" + }, + { + "CategoryID": "fish", + "TechName": "Peeper", + "TechType": "Peeper", + "TechID": 2504, + "GameVersion": "1" + }, + { + "CategoryID": "fish", + "TechName": "Oculus", + "TechType": "Oculus", + "TechID": 2505, + "GameVersion": "1" + }, + { + "CategoryID": "fish", + "TechName": "Garryfish", + "TechType": "Garryfish", + "TechID": 2507, + "GameVersion": "1" + }, + { + "CategoryID": "fish", + "TechName": "Boomerang", + "TechType": "Boomerang", + "TechID": 2510, + "GameVersion": "A" + }, + { + "CategoryID": "eggs", + "TechName": "Lava Larva", + "TechType": "LavaLarva", + "TechID": 2511, + "GameVersion": "1" + }, + { + "CategoryID": "fish", + "TechName": "Eyeye", + "TechType": "Eyeye", + "TechID": 2513, + "GameVersion": "1" + }, + { + "CategoryID": "fish", + "TechName": "Bladderfish", + "TechType": "Bladderfish", + "TechID": 2515, + "GameVersion": "A" + }, + { + "CategoryID": "fish", + "TechName": "Hoverfish", + "TechType": "Hoverfish", + "TechID": 2516, + "GameVersion": "1" + }, + { + "CategoryID": "fish", + "TechName": "Reginald", + "TechType": "Reginald", + "TechID": 2519, + "GameVersion": "1" + }, + { + "CategoryID": "fish", + "TechName": "Spadefish", + "TechType": "Spadefish", + "TechID": 2520, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Creepvine Sample", + "TechType": "CreepvinePiece", + "TechID": 2529, + "GameVersion": "A" + }, + { + "CategoryID": "natural", + "TechName": "Gas Pod", + "TechType": "Gaspod", + "TechID": 2530, + "GameVersion": "A" + }, + { + "CategoryID": "fish", + "TechName": "Hoop Fish", + "TechType": "Hoopfish", + "TechID": 2531, + "GameVersion": "A" + }, + { + "CategoryID": "fish", + "TechName": "Spinefish", + "TechType": "Spinefish", + "TechID": 2546, + "GameVersion": "2" + }, + { + "CategoryID": "fish", + "TechName": "Spinner Fish", + "TechType": "spinnerfish", + "TechID": 2571, + "GameVersion": "2" + }, + { + "CategoryID": "fish", + "TechName": "Pengling", + "TechType": "PenguinBaby", + "TechID": 2575, + "GameVersion": "2" + }, + { + "CategoryID": "fish", + "TechName": "Arctic Peeper", + "TechType": "ArcticPeeper", + "TechID": 2578, + "GameVersion": "2" + }, + { + "CategoryID": "fish", + "TechName": "Arrow Ray", + "TechType": "ArrowRay", + "TechID": 2579, + "GameVersion": "2" + }, + { + "CategoryID": "fish", + "TechName": "Noot Fish", + "TechType": "Nootfish", + "TechID": 2585, + "GameVersion": "2" + }, + { + "CategoryID": "fish", + "TechName": "Triops", + "TechType": "Triops", + "TechID": 2587, + "GameVersion": "2" + }, + { + "CategoryID": "fish", + "TechName": "Feather Fish", + "TechType": "FeatherFish", + "TechID": 2593, + "GameVersion": "2" + }, + { + "CategoryID": "fish", + "TechName": "Feather Fish (Red)", + "TechType": "FeatherFishRed", + "TechID": 2594, + "GameVersion": "2" + }, + { + "CategoryID": "fish", + "TechName": "Discus Fish", + "TechType": "DiscusFish", + "TechID": 2600, + "GameVersion": "2" + }, + { + "CategoryID": "natural", + "TechName": "Gel Sack", + "TechType": "JellyPlant", + "TechID": 3010, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Acid Mushroom", + "TechType": "AcidMushroom", + "TechID": 3021, + "GameVersion": "1" + }, + { + "CategoryID": "natural", + "TechName": "Blood Oil", + "TechType": "BloodOil", + "TechID": 3034, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Deep Shroom", + "TechType": "WhiteMushroom", + "TechID": 3035, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Speckled Rattler", + "TechType": "PurpleRattle", + "TechID": 3040, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Bulbo Tree", + "TechType": "BulboTree", + "TechID": 3041, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Ming Plant", + "TechType": "PurpleVasePlant", + "TechID": 3042, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Jaffa Cup", + "TechType": "OrangeMushroom", + "TechID": 3043, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Chinese Potato Plant", + "TechType": "PurpleVegetablePlant", + "TechID": 3046, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Marblemelon Plant", + "TechType": "MelonPlant", + "TechID": 3047, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Gabe's Feather", + "TechType": "GabesFeather", + "TechID": 3049, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Eye Stalk", + "TechType": "EyesPlant", + "TechID": 3052, + "GameVersion": "1" + }, + { + "CategoryID": "natural", + "TechName": "Table Coral", + "TechType": "GenericJeweledDisk", + "TechID": 3064, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Spiral Plant", + "TechType": "GenericSpiral", + "TechID": 3078, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Ribbon Plant", + "TechType": "GenericRibbon", + "TechID": 3079, + "GameVersion": "2" + }, + { + "CategoryID": "natural", + "TechName": "Root Pustule", + "TechType": "KelpRootPustule", + "TechID": 3092, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Bullseye Shroom", + "TechType": "TwistyBridgesMushroom", + "TechID": 3099, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Young Cotton Anemone", + "TechType": "DeepLilyShroom", + "TechID": 3107, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Frost Vase Plant", + "TechType": "FrozenRiverPlant2", + "TechID": 3121, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Antennae Fruit", + "TechType": "SmallMaroonPlantFruit", + "TechID": 3132, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Preston's Delight", + "TechType": "SnowStalkerFruit", + "TechID": 3133, + "GameVersion": "2" + }, + { + "CategoryID": "natural", + "TechName": "Preston's Plant Leaf", + "TechType": "SnowStalkerPlantLeaf", + "TechID": 3135, + "GameVersion": "2" + }, + { + "CategoryID": "natural", + "TechName": "Table Coral Sample", + "TechType": "JeweledDiskPiece", + "TechID": 3501, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Bulb Bush Sample", + "TechType": "KooshChunk", + "TechID": 3503, + "GameVersion": "1" + }, + { + "CategoryID": "natural", + "TechName": "Stalker Tooth", + "TechType": "StalkerTooth", + "TechID": 3504, + "GameVersion": "1" + }, + { + "CategoryID": "natural", + "TechName": "Fungal Sample", + "TechType": "TreeMushroomPiece", + "TechID": 3505, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Bulbo Tree Sample", + "TechType": "BulboTreePiece", + "TechID": 3506, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Jaffa Cup Seed", + "TechType": "OrangeMushroomSpore", + "TechID": 3507, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Ming Plant Seed", + "TechType": "PurplevasePlantSeed", + "TechID": 3508, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Acid Mushroom Spore", + "TechType": "AcidMushroomSpore", + "TechID": 3509, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Deep Shroom Spore", + "TechType": "WhiteMushroomSpore", + "TechID": 3510, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Pink Cap Spore", + "TechType": "PinkMushroomSpore", + "TechID": 3511, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Speckled Rattler Spore", + "TechType": "PurpleRattleSpore", + "TechID": 3512, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Lantern Fruit", + "TechType": "HangingFruit", + "TechID": 3513, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Chinese Potato", + "TechType": "PurpleVegetable", + "TechID": 3514, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Small Marblemelon", + "TechType": "SmallMelon", + "TechID": 3515, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Marblemelon", + "TechType": "Melon", + "TechID": 3516, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Marblemelon Seeds", + "TechType": "MelonSeed", + "TechID": 3517, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Brain Coral Sample", + "TechType": "PurpleBrainCoralPiece", + "TechID": 3518, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Tiger Plant Seed", + "TechType": "SpikePlantSeed", + "TechID": 3519, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Blue Palm Seed", + "TechType": "BluepPalmSeed", + "TechID": 3520, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Veined Nettle Seed", + "TechType": "PurpleFanSeed", + "TechID": 3521, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Pygmy Fan Seed", + "TechType": "SmallFanSeed", + "TechID": 3522, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Writhing Weed Seed", + "TechType": "PurpleTentacleSeed", + "TechID": 3523, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Gel Sack Spores", + "TechType": "JellyPlantSeed", + "TechID": 3524, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Gabe's Feather Seed", + "TechType": "GabesFeatherSeed", + "TechID": 3525, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Sea Crown Seed", + "TechType": "SeaCrownSeed", + "TechID": 3526, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Membrain Tree Seed", + "TechType": "MembrainTreeSeed", + "TechID": 3527, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Voxel Shrub Seed", + "TechType": "PinkFlowerSeed", + "TechID": 3528, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Fern Palm Seed", + "TechType": "FernPalmSeed", + "TechID": 3529, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Grub Basket Seed", + "TechType": "OrangePetalsPlantSeed", + "TechID": 3530, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Eye Stalk Seed", + "TechType": "EyesPlantSeed", + "TechID": 3531, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Ghost Weed Seed", + "TechType": "RedGreenTentacleSeed", + "TechID": 3532, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Violet Beau Seed", + "TechType": "PurpleStalkSeed", + "TechID": 3533, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Rouge Cradle Seed", + "TechType": "RedBasketPlantSeed", + "TechID": 3534, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Redwort Seed", + "TechType": "RedBushSeed", + "TechID": 3535, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Regress Shell Seed", + "TechType": "RedConePlantSeed", + "TechID": 3536, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Spiked Horn Grass Seed", + "TechType": "ShellGrassSeed", + "TechID": 3537, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Spotted Dockleaf Seed", + "TechType": "SpottedLeavesPlantSeed", + "TechID": 3538, + "GameVersion": "A" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Furled Papyrus Seed", + "TechType": "RedRollPlantSeed", + "TechID": 3539, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Hardy Cave Bush Seed", + "TechType": "PurpleBranchesSeed", + "TechID": 3540, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Jellyshroom Spore", + "TechType": "SnakeMushroomSpore", + "TechID": 3541, + "GameVersion": "1" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Fevered Pepper", + "TechType": "HeatFruit", + "TechID": 3542, + "GameVersion": "2" + }, + { + "CategoryID": "natural", + "TechName": "Snow Stalker Fur", + "TechType": "SnowStalkerfur", + "TechID": 3543, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Ribbon Plant Seed", + "TechType": "GenericRibbonSeed", + "TechID": 3544, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Shrub Nut", + "TechType": "LeafyFruit", + "TechID": 3546, + "GameVersion": "2" + }, + { + "CategoryID": "food", + "TechName": "Frost Anemone Heart", + "TechType": "IceFruit", + "TechID": 3547, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Bullseye Shroom Chunck", + "TechType": "TwistyBridgesMushroomChunk", + "TechID": 3548, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Frost Vase Plant Seed", + "TechType": "FrozenRiverPlant2Seeds", + "TechID": 3549, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Spiral Chunk", + "TechType": "GenericSpiralChunk", + "TechID": 3550, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Deep Lily Shroom Seed", + "TechType": "DeepLilyShroomSeed", + "TechID": 3551, + "GameVersion": "2" + }, + { + "CategoryID": "plantsandseeds", + "TechName": "Antennae Seed", + "TechType": "SmallMaroonPlantSeed", + "TechID": 3552, + "GameVersion": "2" + }, + { + "CategoryID": "natural", + "TechName": "Snowball", + "TechType": "Snowball", + "TechID": 4020, + "GameVersion": "2" + }, + { + "CategoryID": "tablet", + "TechName": "Red Tablet", + "TechType": "PrecursorKey_Red", + "TechID": 4200, + "GameVersion": "1" + }, + { + "CategoryID": "tablet", + "TechName": "Blue Tablet", + "TechType": "PrecursorKey_Blue", + "TechID": 4201, + "GameVersion": "1" + }, + { + "CategoryID": "tablet", + "TechName": "Orange Tablet", + "TechType": "PrecursorKey_Orange", + "TechID": 4202, + "GameVersion": "1" + }, + { + "CategoryID": "tablet", + "TechName": "White Tablet", + "TechType": "PrecursorKey_White", + "TechID": 4203, + "GameVersion": "1" + }, + { + "CategoryID": "tablet", + "TechName": "Purple Tablet", + "TechType": "PrecursorKey_Purple", + "TechID": 4204, + "GameVersion": "1" + }, + { + "CategoryID": "batteries", + "TechName": "Ion Power Cell", + "TechType": "PrecursorIonPowerCell", + "TechID": 4209, + "GameVersion": "A" + }, + { + "CategoryID": "batteries", + "TechName": "Ion Battery", + "TechType": "PrecursorIonBattery", + "TechID": 4210, + "GameVersion": "A" + }, + { + "CategoryID": "water", + "TechName": "Filtered Water", + "TechType": "FilteredWater", + "TechID": 4500, + "GameVersion": "A" + }, + { + "CategoryID": "water", + "TechName": "Disinfected Water", + "TechType": "DisinfectedWater", + "TechID": 4501, + "GameVersion": "A" + }, + { + "CategoryID": "food", + "TechName": "Nutrient Block", + "TechType": "NutrientBlock", + "TechID": 4513, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "First Aid Kit", + "TechType": "FirstAidKit", + "TechID": 4514, + "GameVersion": "A" + }, + { + "CategoryID": "water", + "TechName": "Reclaimed Water", + "TechType": "StillSuitWater", + "TechID": 4515, + "GameVersion": "A" + }, + { + "CategoryID": "water", + "TechName": "Large Filtered Water", + "TechType": "BigFilteredWater", + "TechID": 4516, + "GameVersion": "A" + }, + { + "CategoryID": "food", + "TechName": "MiChips", + "TechType": "Snack1", + "TechID": 4520, + "GameVersion": "A" + }, + { + "CategoryID": "food", + "TechName": "Rice Snack", + "TechType": "Snack2", + "TechID": 4521, + "GameVersion": "A" + }, + { + "CategoryID": "food", + "TechName": "Potato Mi", + "TechType": "Snack3", + "TechID": 4522, + "GameVersion": "A" + }, + { + "CategoryID": "food", + "TechName": "Coffee Americano", + "TechType": "Coffee", + "TechID": 4523, + "GameVersion": "A" + }, + { + "CategoryID": "water", + "TechName": "Water Purification Tablet", + "TechType": "WaterPurificationTablet", + "TechID": 4534, + "GameVersion": "2" + }, + { + "CategoryID": "food", + "TechName": "Spicy Fruit Salad", + "TechType": "SpicyFruitSalad", + "TechID": 4535, + "GameVersion": "2" + }, + { + "CategoryID": "food", + "TechName": "Cured Peeper", + "TechType": "CuredPeeper", + "TechID": 4600, + "GameVersion": "1" + }, + { + "CategoryID": "food", + "TechName": "Cured Holefish", + "TechType": "CuredHolefish", + "TechID": 4601, + "GameVersion": "1" + }, + { + "CategoryID": "food", + "TechName": "Cured Garryfish", + "TechType": "CuredGarryfish", + "TechID": 4602, + "GameVersion": "1" + }, + { + "CategoryID": "food", + "TechName": "Cured Reginald", + "TechType": "CuredReginald", + "TechID": 4603, + "GameVersion": "1" + }, + { + "CategoryID": "food", + "TechName": "Cured Bladderfish", + "TechType": "CuredBladderfish", + "TechID": 4604, + "GameVersion": "A" + }, + { + "CategoryID": "food", + "TechName": "Cured Hoverfish", + "TechType": "CuredHoverfish", + "TechID": 4605, + "GameVersion": "1" + }, + { + "CategoryID": "food", + "TechName": "Cured Spadefish", + "TechType": "CuredSpadefish", + "TechID": 4606, + "GameVersion": "1" + }, + { + "CategoryID": "food", + "TechName": "Cured Boomerang", + "TechType": "CuredBoomerang", + "TechID": 4607, + "GameVersion": "A" + }, + { + "CategoryID": "food", + "TechName": "Cured Eyeye", + "TechType": "CuredEyeye", + "TechID": 4608, + "GameVersion": "1" + }, + { + "CategoryID": "food", + "TechName": "Cured Oculus", + "TechType": "CuredOculus", + "TechID": 4609, + "GameVersion": "1" + }, + { + "CategoryID": "food", + "TechName": "Cured Hoopfish", + "TechType": "CuredHoopfish", + "TechID": 4610, + "GameVersion": "A" + }, + { + "CategoryID": "food", + "TechName": "Cured Spinefish", + "TechType": "CuredSpinefish", + "TechID": 4611, + "GameVersion": "2" + }, + { + "CategoryID": "food", + "TechName": "Cured Red Eyeye", + "TechType": "CuredLavaEyeye", + "TechID": 4612, + "GameVersion": "1" + }, + { + "CategoryID": "food", + "TechName": "Cured Magmarang", + "TechType": "CuredLavaBoomerang", + "TechID": 4613, + "GameVersion": "1" + }, + { + "CategoryID": "food", + "TechName": "Cured Spinnerfish", + "TechType": "CuredSpinnerfish", + "TechID": 4614, + "GameVersion": "2" + }, + { + "CategoryID": "food", + "TechName": "Cured Symbiote", + "TechType": "CuredSymbiote", + "TechID": 4615, + "GameVersion": "2" + }, + { + "CategoryID": "food", + "TechName": "Cured Arctic Peeper", + "TechType": "CuredArcticPeeper", + "TechID": 4616, + "GameVersion": "2" + }, + { + "CategoryID": "food", + "TechName": "Cured Arrow Ray", + "TechType": "CuredArrowRay", + "TechID": 4617, + "GameVersion": "2" + }, + { + "CategoryID": "food", + "TechName": "Cured Noot Fish", + "TechType": "CuredNootfish", + "TechID": 4618, + "GameVersion": "2" + }, + { + "CategoryID": "food", + "TechName": "Cured Triops", + "TechType": "CuredTriops", + "TechID": 4619, + "GameVersion": "2" + }, + { + "CategoryID": "food", + "TechName": "Cured Feather Fish", + "TechType": "CuredFeatherfish", + "TechID": 4620, + "GameVersion": "2" + }, + { + "CategoryID": "food", + "TechName": "Cured Red Feather Fish", + "TechType": "CuredFeatherfishred", + "TechID": 4621, + "GameVersion": "2" + }, + { + "CategoryID": "food", + "TechName": "Cured Discus Fish", + "TechType": "CuredDiscusfish", + "TechID": 4622, + "GameVersion": "2" + }, + { + "CategoryID": "tools", + "TechName": "Camera Drone", + "TechType": "MapRoomCamera", + "TechID": 5527, + "GameVersion": "A" + }, + { + "CategoryID": "tools", + "TechName": "Floating Pump", + "TechType": "BasePipeConnector", + "TechID": 5530, + "GameVersion": "A" + }, + { + "CategoryID": "decorations", + "TechName": "Natural Selection 2 Poster", + "TechType": "Poster", + "TechID": 6005, + "GameVersion": "1" + }, + { + "CategoryID": "natural", + "TechName": "Flower Spore", + "TechType": "LilypadResource", + "TechID": 8005, + "GameVersion": "2" + }, + { + "CategoryID": "tools", + "TechName": "Spy Pengling", + "TechType": "SpyPenguin", + "TechID": 8030, + "GameVersion": "2" + }, + { + "CategoryID": "tools", + "TechName": "Spy Pengling Remote", + "TechType": "SpyPenguinRemote", + "TechID": 8033, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Alterra Bounty Poster", + "TechType": "AlterraBountyPoster", + "TechID": 8036, + "GameVersion": "2" + }, + { + "CategoryID": "tools", + "TechName": "Parallel Processing Unit", + "TechType": "RadioTowerPPU", + "TechID": 8039, + "GameVersion": "2" + }, + { + "CategoryID": "synthetics", + "TechName": "Hydraulic Fluid", + "TechType": "HydraulicFluid", + "TechID": 8044, + "GameVersion": "2" + }, + { + "CategoryID": "tools", + "TechName": "Test Override Module", + "TechType": "RadioTowerTOM", + "TechID": 8045, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Sea Creature Poster", + "TechType": "PosterParvan", + "TechID": 8047, + "GameVersion": "2" + }, + { + "CategoryID": "synthetics", + "TechName": "Kharaa Antidote", + "TechType": "FrozenCreatureAntidote", + "TechID": 8049, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Community Poster", + "TechType": "Posterbunkercommunity", + "TechID": 8050, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Glacial Basin Map", + "TechType": "SpyPenguinMap", + "TechID": 8051, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Hoverball Poster", + "TechType": "PosterZetaRollerDerby", + "TechID": 8052, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Spy Pengling Concepts", + "TechType": "PosterSpyPenguinConcepts", + "TechID": 8053, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Alien Intruder Poster", + "TechType": "PosterBoardgame", + "TechID": 8054, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Hang in there Poster", + "TechType": "PosterHangInThere", + "TechID": 8055, + "GameVersion": "2" + }, + { + "CategoryID": "decorations", + "TechName": "Poster Spy Penguin Blueprint", + "TechType": "PosterSpyPenguinBlueprint", + "TechID": 8056, + "GameVersion": "2" + }, + { + "CategoryID": "tools", + "TechName": "Tech Pistol", + "TechType": "TechPistol", + "TechID": 11698, + "GameVersion": "2" + }, + { + "CategoryID": "equipment", + "TechName": "SeaTruck Scanner HUD Chip", + "TechType": "SeaTruckScannerHUDChip", + "TechID": 11702, + "GameVersion": "2" + }, + { + "CategoryID": "tools", + "TechName": "Grav Trap MK2", + "TechType": "GravTrapMK2", + "TechID": 11708, + "GameVersion": "2" + } + ] +} \ No newline at end of file diff --git a/SubnauticaModSystem/Common/Mod/ImageUtils.cs b/SubnauticaModSystem/Common/Mod/ImageUtils.cs index e81b1ff..334ca4b 100644 --- a/SubnauticaModSystem/Common/Mod/ImageUtils.cs +++ b/SubnauticaModSystem/Common/Mod/ImageUtils.cs @@ -49,4 +49,4 @@ public static class ImageUtils return Sprite.Create(tex, new Rect(0f, 0f, tex.width, tex.height), pivot, pixelsPerUnit, 0u, spriteType, border); } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/Common/Mod/LockerPrefabShared.cs b/SubnauticaModSystem/Common/Mod/LockerPrefabShared.cs index ef9eca8..c58c814 100644 --- a/SubnauticaModSystem/Common/Mod/LockerPrefabShared.cs +++ b/SubnauticaModSystem/Common/Mod/LockerPrefabShared.cs @@ -1,5 +1,9 @@ -using UnityEngine; +using System; +using UnityEngine; using UnityEngine.UI; +#if BELOWZERO +using TMPro; +#endif namespace Common.Mod { @@ -15,9 +19,10 @@ internal static Canvas CreateCanvas(Transform parent) var raycaster = canvas.gameObject.AddComponent(); var rt = t as RectTransform; + // Positions the ?? RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f)); RectTransformExtensions.SetSize(rt, 1.7f, 3.0f); - + // Seems to be the front to back position of the small locker t.localPosition = new Vector3(0, 0, 0.345f); t.localRotation = new Quaternion(0, 1, 0, 0); t.localScale = new Vector3(0.5f, 0.5f, 0.5f); @@ -32,25 +37,52 @@ internal static Canvas CreateCanvas(Transform parent) return canvas; } - internal static Image CreateBackground(Transform parent) +#if SUBNAUTICA + internal static Image CreateBackground(Transform parent) + { + var background = new GameObject("Background", typeof(RectTransform)).AddComponent(); + var rt = background.rectTransform; + RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); + RectTransformExtensions.SetSize(rt, 114, 241); + background.color = new Color(0, 0, 0); + + background.transform.localScale = new Vector3(0.01f, 0.01f, 1); + background.type = Image.Type.Sliced; + + return background; + } +#elif BELOWZERO + internal static Image CreateBackground(Transform parent, string lockerType) { var background = new GameObject("Background", typeof(RectTransform)).AddComponent(); var rt = background.rectTransform; - RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); - RectTransformExtensions.SetSize(rt, 114, 241); - background.color = new Color(0, 0, 0); - background.transform.localScale = new Vector3(0.01f, 0.01f, 1); + // The size of the rectangle on the locker, adjusted for locker type + if (lockerType == "Locker(Clone)") + { // The second Vector2 positions the background on the locker, the 1st number is horizontal and the 2nd is vertical + RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.43f, 0.5f), parent); + RectTransformExtensions.SetSize(rt, 150, 280); + } + else //(lockerType == "SmallLocker(Clone)") + { + RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.52f, 0.49f), parent); + RectTransformExtensions.SetSize(rt, 128, 264); + } + // Overrides the color of the png image + background.color = new Color(0, 0, 0); + background.transform.localScale = new Vector3(0.01f, 0.01f, 1f); background.type = Image.Type.Sliced; return background; } +#endif internal static Image CreateIcon(Transform parent, Color color, int y) { var icon = new GameObject("Text", typeof(RectTransform)).AddComponent(); var rt = icon.rectTransform; RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); + // The size of the locker icon RectTransformExtensions.SetSize(rt, 40, 40); rt.anchoredPosition = new Vector2(0, y); @@ -59,21 +91,37 @@ internal static Image CreateIcon(Transform parent, Color color, int y) return icon; } +#if SUBNAUTICA internal static Text CreateText(Transform parent, Text prefab, Color color, int y, int size, string initial) { var text = new GameObject("Text", typeof(RectTransform)).AddComponent(); +#elif BELOWZERO + internal static TextMeshProUGUI CreateText(Transform parent, TextMeshProUGUI prefab, Color color, int y, int size, string initial, string lockerType) + { + var text = new GameObject("TextMeshProUGUI", typeof(RectTransform)).AddComponent(); +#endif var rt = text.rectTransform; + // Positions the "Locker" label on the locker RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); - RectTransformExtensions.SetSize(rt, 120, 200); - rt.anchoredPosition = new Vector2(0, y); + // The size of the Filter rectangle for each locker type + if (lockerType == "Locker(Clone)") + { + RectTransformExtensions.SetSize(rt, 138, 200); + } + else + { + RectTransformExtensions.SetSize(rt, 112, 200); + } + + rt.anchoredPosition = new Vector2(0, y); + text.font = prefab.font; text.fontSize = size; text.color = color; - text.alignment = TextAnchor.MiddleCenter; text.text = initial; return text; } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/Common/Mod/ModUtils.cs b/SubnauticaModSystem/Common/Mod/ModUtils.cs index ad851b2..2576041 100644 --- a/SubnauticaModSystem/Common/Mod/ModUtils.cs +++ b/SubnauticaModSystem/Common/Mod/ModUtils.cs @@ -5,23 +5,26 @@ using System.Linq; using System.Reflection; using System.Text; -using Oculus.Newtonsoft.Json; +using Newtonsoft.Json; +#if SUBNAUTICA using UnityEngine; using UnityEngine.UI; +#elif BELOWZERO +using TMPro; +#endif +using UnityEngine; namespace Common.Mod { internal static class ModUtils { - //private static FieldInfo CraftData_techMapping = typeof(CraftData).GetField("techMapping", BindingFlags.NonPublic | BindingFlags.Static); - - //private static List pickupableTypes; private static MonoBehaviour coroutineObject; public static ConfigT LoadConfig(string configFilePath) where ConfigT : class, new() { if (!File.Exists(configFilePath)) { + QModManager.Utility.Logger.Log(QModManager.Utility.Logger.Level.Error, $"Could not find config file {configFilePath}", null, true); return WriteDefaultConfig(configFilePath); } @@ -31,6 +34,7 @@ internal static class ModUtils if (string.IsNullOrEmpty(serialilzedConfig)) { + QModManager.Utility.Logger.Log(QModManager.Utility.Logger.Level.Error, $"Config file {configFilePath} empty; creating default config", null, true); return new ConfigT(); } @@ -38,13 +42,15 @@ internal static class ModUtils if (config == null) { + QModManager.Utility.Logger.Log(QModManager.Utility.Logger.Level.Error, $"Failed to deserialise configuration object from file {configFilePath}", null, true); config = new ConfigT(); } return config; } - catch + catch (Exception e) { + QModManager.Utility.Logger.Log(QModManager.Utility.Logger.Level.Error, $"Exception caught while parsing config file {configFilePath}", e, true); return WriteDefaultConfig(configFilePath); } } @@ -64,13 +70,16 @@ public static void ValidateConfigValue(string field, T min, T max, r var value = (T)fieldInfo.GetValue(config, null); if (value.CompareTo(min) < 0 || value.CompareTo(max) > 0) { - Console.WriteLine("Config value for '{0}' ({1}) was not valid. Must be between {2} and {3}", - field, - value, - min, - max - ); - fieldInfo.SetValue(config, fieldInfo.GetValue(defaultConfig, null), null); + string errorString = $"Config value for '{field}' ({value}) was not valid. Must be between {min} and {max}"; + + QModManager.Utility.Logger.Log(QModManager.Utility.Logger.Level.Error, errorString, null, true); + var newValue = value; + if (value.CompareTo(min) < 0) + newValue = min; + else if (value.CompareTo(max) > 0) + newValue = max; + + fieldInfo.SetValue(config, newValue, null); } } @@ -213,22 +222,29 @@ public static void PrintObjectFields(object obj, string indent = "") Console.WriteLine(indent + " " + property.Name + " : " + property.GetValue(obj, new object[] { })); } } - +#if SUBNAUTICA public static Text GetTextPrefab() { - Text prefab = GameObject.FindObjectOfType().interactPrimaryText; - if (prefab == null) - { - return null; - } - + Text prefab = null; + prefab = GameObject.FindObjectOfType().interactPrimaryText; +#elif BELOWZERO + public static TextMeshProUGUI GetTextPrefab() + { + TextMeshProUGUI prefab = GameObject.FindObjectOfType().progressText; +#endif return prefab; } +#if SUBNAUTICA public static Text InstantiateNewText(string name, Transform parent) { Text text = GameObject.Instantiate(GetTextPrefab()); - text.gameObject.layer = parent.gameObject.layer; +#elif BELOWZERO + public static TextMeshProUGUI InstantiateNewText(string name, Transform parent) + { + TextMeshProUGUI text = GameObject.Instantiate(GetTextPrefab()); +#endif + text.gameObject.layer = parent.gameObject.layer; text.gameObject.name = name; text.transform.SetParent(parent, false); text.transform.localScale = new Vector3(1, 1, 1); @@ -264,36 +280,6 @@ public static GameObject GetChildByName(GameObject parent, string name, bool rec return found; } - /* - public static List GetPickupableTechTypes() - { - if (pickupableTypes != null) - { - return pickupableTypes; - } - - Console.WriteLine("[ModUtils] Initialize Pickupable Types"); - pickupableTypes = new List(); - - var techMapping = (Dictionary)CraftData_techMapping.GetValue(null); - foreach (var entry in techMapping) - { - var techType = entry.Key; - var prefab = CraftData.GetPrefabForTechType(techType); - if (prefab != null) - { - if (prefab.GetComponent() != null) - { - Console.WriteLine("" + techType); - pickupableTypes.Add(techType); - } - } - } - - return pickupableTypes; - } - */ - public static T CopyComponent(T original, GameObject destination) where T : Component { Type type = original.GetType(); @@ -317,4 +303,4 @@ private static Coroutine StartCoroutine(IEnumerator coroutine) return coroutineObject.StartCoroutine(coroutine); } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/Common/Mod/SerializableColor.cs b/SubnauticaModSystem/Common/Mod/SerializableColor.cs index 1ecdcce..093c222 100644 --- a/SubnauticaModSystem/Common/Mod/SerializableColor.cs +++ b/SubnauticaModSystem/Common/Mod/SerializableColor.cs @@ -35,4 +35,4 @@ public static SerializableColor Create(Color c) } } -} +} \ No newline at end of file diff --git a/SubnauticaModSystem/GameDir.targets b/SubnauticaModSystem/GameDir.targets new file mode 100644 index 0000000..112228b --- /dev/null +++ b/SubnauticaModSystem/GameDir.targets @@ -0,0 +1,9 @@ + + + + + S:\Steam\steamapps\common\ + $(CommonDir)\Subnautica\ + $(CommonDir)\SubnauticaZero\ + + \ No newline at end of file