├── .gitattributes ├── .gitignore └── SubnauticaModSystem ├── AutosortLockers ├── Assets │ ├── ArrowLeft.png │ ├── ArrowRight.png │ ├── AutosortLocker.png │ ├── AutosortTarget.png │ ├── AutosortTargetStanding.png │ ├── Background.png │ ├── Circle.png │ ├── Close.png │ ├── Configure.png │ ├── CustomizeScreen.png │ ├── Edit.png │ ├── Left.png │ ├── LockerScreen.png │ ├── MainMenuPressedSprite.png │ ├── MainMenuStandardSprite.png │ ├── PickerBackground.png │ ├── Receptacle.png │ ├── Right.png │ ├── SelectorHover.png │ ├── SelectorSelected.png │ ├── Sorter.png │ ├── TitleUnderline.png │ ├── colors.json │ ├── filters.json │ └── type_reference.json ├── AutosortLocker.cs ├── AutosortLockers.csproj ├── AutosortTarget.cs ├── AutosortTypePicker.cs ├── AutosorterCategories.cs ├── ColorPicker.cs ├── ColorPickerButton.cs ├── ColorPickerPageButton.cs ├── ColorSetting.cs ├── ColoredIconButton.cs ├── Config.cs ├── ConfigureButton.cs ├── CustomizeScreen.cs ├── LabelController.cs ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ ├── BuilderUtils_Patches.cs │ └── Initializer_Patch.cs ├── Picker.cs ├── PickerButton.cs ├── PickerCloseButton.cs ├── PickerPageButton.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── SaveData.cs └── mod.json ├── BaseTeleporters ├── Assets │ └── BaseTeleporter.png ├── BaseTeleporter.cs ├── BaseTeleporters.csproj ├── Config.cs ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ ├── BuilderUtils_Patches.cs │ └── Teleporter_Patches.cs ├── Properties │ └── AssemblyInfo.cs └── mod.json ├── BetterPowerInfo ├── BetterPowerInfo.csproj ├── Config.cs ├── Consumers │ ├── ChargerPowerConsumerInfo.cs │ ├── FiltrationMachinePowerConsumerInfo.cs │ ├── PowerConsumerInfoBase.cs │ ├── ScannerRoomPowerConsumerInfo.cs │ ├── SpotLightPowerConsumerInfo.cs │ └── TechLightPowerConsumerInfo.cs ├── GameController.cs ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ └── uGUI_PowerIndicator_Initialize_Patch.cs ├── PowerDisplayBase.cs ├── PowerDisplayEntry.cs ├── PowerProductionDisplay.cs ├── PowerProductionTracker.cs ├── Producers │ ├── BioreactorPowerSourceInfo.cs │ ├── GenericPowerSourceInfo.cs │ ├── NuclearReactorPowerSourceInfo.cs │ ├── PowerSourceInfo.cs │ ├── RegenPowerSourceInfo.cs │ ├── SolarPanelPowerSourceInfo.cs │ └── ThermalPlantPowerSourceInfo.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx └── mod.json ├── BetterScannerBlips ├── BetterScannerBlips.csproj ├── Config.cs ├── CustomBlip.cs ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ └── uGUI_ResourceTracker_UpdateBlips_Patch.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx └── mod.json ├── BlueprintTracker ├── Assets │ ├── pin_not_pinned.png │ ├── pin_pinned.png │ └── remove_pin.png ├── BlueprintTracker.cs ├── BlueprintTracker.csproj ├── BlueprintTrackerEntry.cs ├── BlueprintTrackerIcon.cs ├── BlueprintTrackerPdaEntry.cs ├── BlueprintTrackerRemoveButton.cs ├── Config.cs ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ ├── uGUI_BlueprintEntry_SetIcon_Patch.cs │ └── uGUI_PowerIndicator_Initialize_Patch.cs ├── PinButton.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── SaveData.cs └── mod.json ├── Common ├── Common.projitems ├── Common.shproj ├── Mod │ ├── BuilderUtils.cs │ ├── CallbackOnDestroy.cs │ ├── CustomTechInfo.cs │ ├── ImageUtils.cs │ ├── LockerPrefabShared.cs │ ├── ModBase.cs │ ├── ModSaver.cs │ ├── ModUtils.cs │ ├── ProtoBufSerializerPatcher.cs │ └── SerializableColor.cs └── Utility │ ├── ImageUtils.cs │ └── SimpleJSON.cs ├── CustomPings ├── Assets │ ├── Circle.png │ ├── Edit.png │ ├── Left.png │ ├── PickerBackground.png │ ├── Pings │ │ ├── 00_CyclopsA.png │ │ ├── 00_CyclopsB.png │ │ ├── 00_CyclopsC.png │ │ ├── 00_CyclopsHeart.png │ │ ├── 00_CyclopsStar.png │ │ ├── 00_PrawnsuitA.png │ │ ├── 00_PrawnsuitB.png │ │ ├── 00_PrawnsuitC.png │ │ ├── 00_PrawnsuitHeart.png │ │ ├── 00_PrawnsuitStar.png │ │ ├── 00_SeamothA.png │ │ ├── 00_SeamothB.png │ │ ├── 00_SeamothC.png │ │ ├── 00_SeamothHeart.png │ │ ├── 00_SeamothStar.png │ │ ├── 01_Anchor.png │ │ ├── 01_Cave.png │ │ ├── 01_Emergency.png │ │ ├── 01_Fish.png │ │ ├── 01_Food.png │ │ ├── 01_Garden.png │ │ ├── 01_Gears.png │ │ ├── 01_Heart.png │ │ ├── 01_Heat.png │ │ ├── 01_MapPin.png │ │ ├── 01_Mining.png │ │ ├── 01_Player.png │ │ ├── 01_Power.png │ │ ├── 01_Question.png │ │ ├── 01_Scan.png │ │ ├── 01_Skull.png │ │ ├── 01_Star.png │ │ ├── 01_Storage.png │ │ ├── 01_Watch.png │ │ ├── 01_Water.png │ │ ├── 01_Whirlpool.png │ │ ├── 02_Habitat.png │ │ ├── 02_HabitatAnchor.png │ │ ├── 02_HabitatEmergency.png │ │ ├── 02_HabitatFish.png │ │ ├── 02_HabitatFood.png │ │ ├── 02_HabitatGarden.png │ │ ├── 02_HabitatGears.png │ │ ├── 02_HabitatHeart.png │ │ ├── 02_HabitatMapPin.png │ │ ├── 02_HabitatMining.png │ │ ├── 02_HabitatPlayer.png │ │ ├── 02_HabitatPower.png │ │ ├── 02_HabitatQuestion.png │ │ ├── 02_HabitatScan.png │ │ ├── 02_HabitatSkull.png │ │ ├── 02_HabitatStar.png │ │ ├── 02_HabitatStorage.png │ │ ├── 02_HabitatWatch.png │ │ ├── 02_HabitatWater.png │ │ ├── 03_HabitatA.png │ │ ├── 03_HabitatB.png │ │ ├── 03_HabitatC.png │ │ ├── 03_HabitatD.png │ │ ├── 04_Habitat1.png │ │ ├── 04_Habitat2.png │ │ ├── 04_Habitat3.png │ │ ├── 04_Habitat4.png │ │ ├── 05_A.png │ │ ├── 05_B.png │ │ ├── 05_C.png │ │ ├── 05_D.png │ │ ├── 06_1.png │ │ ├── 06_2.png │ │ ├── 06_3.png │ │ ├── 06_4.png │ │ ├── 07_Cuddlefish.png │ │ ├── 07_GhostLeviathan.png │ │ ├── 07_Peeper.png │ │ ├── 07_Reaper.png │ │ └── 07_SeaDragon.png │ ├── Right.png │ ├── SelectorHover.png │ ├── SelectorSelected.png │ └── colors.json ├── BeaconColorPicker.cs ├── BeaconIconPicker.cs ├── Config.cs ├── CustomBeacons.csproj ├── CustomPings.cs ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ ├── PingTab_Patches.cs │ └── Ping_Patches.cs ├── Picker.cs ├── PickerButton.cs ├── PickerPageButton.cs ├── PingColorButton.cs ├── PingEntryController.cs ├── PingInstanceSaver.cs ├── Properties │ └── AssemblyInfo.cs └── mod.json ├── CustomizedStorage ├── Config.cs ├── CustomizedStorage.csproj ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ └── Patches.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── config.json └── mod.json ├── DockedVehicleStorageAccess ├── Assets │ ├── CheckboxChecked.png │ ├── CheckboxUnchecked.png │ ├── Exosuit.png │ ├── LockerScreen.png │ ├── Receptacle.png │ ├── Seamoth.png │ └── StorageAccess.png ├── CheckboxButton.cs ├── Config.cs ├── DockedVehicleStorageAccess.csproj ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── MoonpoolTerminalController.cs ├── Patches │ ├── BuilderUtils_Patches.cs │ └── DockingBay_Patches.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── SaveData.cs ├── VehicleStorageAccess.cs └── mod.json ├── HabitatControlPanel ├── Assets │ ├── Background.png │ ├── BlueprintIcon.png │ ├── CheckboxChecked.png │ ├── CheckboxUnchecked.png │ ├── Circle.png │ ├── Left.png │ ├── PickerBackground.png │ ├── Right.png │ ├── Scrim.png │ ├── SelectorHover.png │ ├── SelectorSelected.png │ └── SmallBackground.png ├── BatteryIndicator.cs ├── BeaconColorPicker.cs ├── BeaconColorSettings.cs ├── BeaconIconPicker.cs ├── BeaconIconSettings.cs ├── BeaconSettings.cs ├── CheckboxButton.cs ├── ColoredIconButton.cs ├── Config.cs ├── HabitatColorPicker.cs ├── HabitatColorSettings.cs ├── HabitatControlPanel.cs ├── HabitatControlPanel.csproj ├── HabitatNameController.cs ├── LockerPrefabShared.cs ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ └── Ping_Patches.cs ├── Picker.cs ├── PickerButton.cs ├── PickerPageButton.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Secret │ ├── SecretButton.cs │ └── SecretGame.cs ├── SubmenuCloseButton.cs ├── mod.json └── uGUI_ColoredIconButton.cs ├── HudConfig ├── Assets │ └── config.json ├── Config.cs ├── HudConfig.csproj ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ └── HUD_Patches.cs └── mod.json ├── LongLockerNames ├── Assets │ ├── color_down.png │ └── color_up.png ├── Config.cs ├── Logger.cs ├── LongLockerNames.csproj ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ └── uGUI_SignInput_Awake_Patch.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx └── mod.json ├── ModInjector_MoreQuickSlots ├── App.config ├── Form1.Designer.cs ├── Form1.cs ├── Form1.resx ├── Injector.cs ├── ModInjector_MoreQuickSlots.csproj ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── cross.png ├── folder.png ├── inject128.ico ├── inject32.ico ├── inject64.png ├── tick.png └── uninstall.png ├── MoreQuickSlots ├── GameController.cs ├── MoreQuickSlots-2.0.zip ├── MoreQuickSlots.cs ├── MoreQuickSlots.csproj ├── Patches │ ├── QuickSlots_Ctor_Patch.cs │ └── uGUI_QuickSlots_Init_Patch.cs └── Properties │ └── AssemblyInfo.cs ├── PrawnsuitLightswitch ├── Config.cs ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ └── Exosuit_Patches.cs ├── PrawnsuitLightswitch.csproj ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx └── mod.json ├── QuitToDesktop ├── Configuration │ └── Config.cs ├── ModLoaderIntegration.cs ├── Patches │ └── IngameMenu_Open_Patch.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── QuitToDesktop.csproj └── mod.json ├── SeaglideMapMod ├── Config.cs ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ ├── ScannerTool_Patches.cs │ └── Seaglide_Patches.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── SeaglideMapControls.csproj └── mod.json ├── SubnauticaModSystem.sln ├── TorpedoImprovements ├── Assets │ ├── Background.png │ └── Selected.png ├── Config.cs ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ ├── Exosuit_Patches.cs │ └── Seamoth_Patches.cs ├── PrimaryTorpedo.cs ├── TorpedoHud.cs ├── TorpedoHudController.cs ├── TorpedoHudIcon.cs ├── TorpedoImprovements.csproj └── mod.json ├── WhiteLights ├── Assets │ └── config.json ├── Config.cs ├── Logger.cs ├── Mod.cs ├── ModLoaderIntegration.cs ├── Patches │ ├── Exosuit_Patches.cs │ ├── Seaglide_Patches.cs │ └── Seamoth_Patches.cs ├── WhiteLights.csproj └── mod.json ├── readme.txt └── zzzEnableConsole ├── ModLoaderIntegration.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs └── Resources.resx ├── mod.json └── zzzEnableConsole.csproj /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/ArrowLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/ArrowLeft.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/ArrowRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/ArrowRight.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/AutosortLocker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/AutosortLocker.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/AutosortTarget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/AutosortTarget.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/AutosortTargetStanding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/AutosortTargetStanding.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/Background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/Background.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/Circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/Circle.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/Close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/Close.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/Configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/Configure.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/CustomizeScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/CustomizeScreen.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/Edit.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/Left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/Left.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/LockerScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/LockerScreen.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/MainMenuPressedSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/MainMenuPressedSprite.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/MainMenuStandardSprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/MainMenuStandardSprite.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/PickerBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/PickerBackground.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/Receptacle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/Receptacle.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/Right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/Right.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/SelectorHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/SelectorHover.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/SelectorSelected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/SelectorSelected.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/Sorter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/Sorter.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Assets/TitleUnderline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/AutosortLockers/Assets/TitleUnderline.png -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/ColorPicker.cs: -------------------------------------------------------------------------------- 1 | using Common.Utility; 2 | using UnityEngine; 3 | 4 | namespace AutosortLockers 5 | { 6 | class ColorPicker : Picker 7 | { 8 | private void Awake() 9 | { 10 | rectTransform = transform as RectTransform; 11 | } 12 | 13 | public void Initialize(Color initialColor) 14 | { 15 | base.Initialize(); 16 | 17 | var sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("Circle.png"), new Vector2(0.5f, 0.5f)); 18 | for (int i = 0; i < buttons.Count; ++i) 19 | { 20 | var button = buttons[i]; 21 | var color = Mod.colors[i]; 22 | button.Initialize(i, color, color == initialColor, sprite); 23 | } 24 | 25 | onSelect = OnSelect; 26 | } 27 | 28 | public void OnSelect(int index) 29 | { 30 | foreach (var button in buttons) 31 | { 32 | button.toggled = false; 33 | } 34 | Close(); 35 | } 36 | 37 | public override void Open() 38 | { 39 | base.Open(); 40 | 41 | var index = 0; 42 | for (int i = 0; i < buttons.Count; ++i) 43 | { 44 | if (buttons[i].toggled) 45 | { 46 | index = i; 47 | break; 48 | } 49 | } 50 | 51 | int buttonPage = index / ButtonsPerPage; 52 | ShowPage(buttonPage); 53 | } 54 | 55 | 56 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////// 57 | public static ColorPicker Create(Transform parent) 58 | { 59 | var beaconColorPicker = new GameObject("ColorPicker", typeof(RectTransform)).AddComponent(); 60 | 61 | beaconColorPicker.ButtonSize = 15; 62 | beaconColorPicker.Spacing = 15; 63 | beaconColorPicker.ButtonsPerPage = 72; 64 | beaconColorPicker.ButtonsPerRow = 8; 65 | 66 | Picker.Create(parent, beaconColorPicker, Mod.colors.Count); 67 | 68 | return beaconColorPicker; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/ColorSetting.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | using UnityEngine.EventSystems; 7 | using UnityEngine.UI; 8 | 9 | namespace AutosortLockers 10 | { 11 | class ColorSetting : MonoBehaviour 12 | { 13 | public RectTransform rectTransform; 14 | public Action onClick = delegate { }; 15 | 16 | [SerializeField] 17 | private ColoredIconButton activeButton; 18 | 19 | private void Awake() 20 | { 21 | rectTransform = transform as RectTransform; 22 | } 23 | 24 | private void Initialize(Text textPrefab, string label) 25 | { 26 | activeButton = ColoredIconButton.Create(transform, CustomizeScreen.ScreenContentColor, textPrefab, label, 100, 15); 27 | activeButton.text.supportRichText = true; 28 | } 29 | 30 | internal void SetInitialValue(Color initialColor) 31 | { 32 | SetColor(initialColor); 33 | activeButton.onClick += OnClick; 34 | } 35 | 36 | internal void SetColor(Color initialColor) 37 | { 38 | activeButton.Initialize("Circle.png", initialColor); 39 | } 40 | 41 | private void OnClick() 42 | { 43 | onClick(); 44 | } 45 | 46 | 47 | /////////////////////////////////////////////////////////////////////////////////////////// 48 | public static ColorSetting Create(Transform parent, string label) 49 | { 50 | var lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); 51 | var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); 52 | textPrefab.fontSize = 12; 53 | textPrefab.color = new Color32(66, 134, 244, 255); 54 | 55 | var beaconController = new GameObject("ColorSettings", typeof(RectTransform)).AddComponent(); 56 | var rt = beaconController.gameObject.transform as RectTransform; 57 | RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); 58 | beaconController.Initialize(textPrefab, label); 59 | 60 | return beaconController; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Config.cs: -------------------------------------------------------------------------------- 1 | using Oculus.Newtonsoft.Json; 2 | 3 | namespace AutosortLockers 4 | { 5 | [JsonObject] 6 | public class Config 7 | { 8 | public bool EasyBuild { get; set; } = false; 9 | public float SortInterval { get; set; } = 1.0f; 10 | public bool ShowAllItems { get; set; } = false; 11 | public int AutosorterWidth { get; set; } = 5; 12 | public int AutosorterHeight { get; set; } = 6; 13 | public int ReceptacleWidth { get; set; } = 6; 14 | public int ReceptacleHeight { get; set; } = 8; 15 | public int StandingReceptacleWidth { get; set; } = 6; 16 | public int StandingReceptacleHeight { get; set; } = 8; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/ConfigureButton.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using UnityEngine; 7 | using UnityEngine.EventSystems; 8 | 9 | namespace AutosortLockers 10 | { 11 | public class ConfigureButton : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler 12 | { 13 | public bool pointerOver; 14 | public RectTransform rectTransform; 15 | public Action onClick = delegate { }; 16 | 17 | public void OnPointerClick(PointerEventData eventData) 18 | { 19 | if (enabled) 20 | { 21 | onClick(); 22 | } 23 | } 24 | 25 | private void Awake() 26 | { 27 | rectTransform = transform as RectTransform; 28 | } 29 | 30 | public void Update() 31 | { 32 | var hover = enabled && pointerOver; 33 | transform.localScale = new Vector3(hover ? 1.3f : 1, hover ? 1.3f : 1, 1); 34 | } 35 | 36 | public void OnPointerEnter(PointerEventData eventData) 37 | { 38 | pointerOver = true; 39 | } 40 | 41 | public void OnPointerExit(PointerEventData eventData) 42 | { 43 | pointerOver = false; 44 | } 45 | 46 | 47 | public static ConfigureButton Create(Transform parent, Color color, float x) 48 | { 49 | var config = LockerPrefabShared.CreateIcon(parent, color, 0); 50 | RectTransformExtensions.SetSize(config.rectTransform, 20, 20); 51 | config.rectTransform.anchoredPosition = new Vector2(x, -104); 52 | 53 | config.gameObject.AddComponent(); 54 | var button = config.gameObject.AddComponent(); 55 | 56 | return button; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/LabelController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | using UnityEngine.EventSystems; 7 | using UnityEngine.UI; 8 | 9 | namespace AutosortLockers 10 | { 11 | class LabelController : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler 12 | { 13 | private bool hover; 14 | 15 | public RectTransform rectTransform; 16 | public Action onModified = delegate { }; 17 | public Text text; 18 | 19 | [SerializeField] 20 | private SaveDataEntry target; 21 | 22 | private void Awake() 23 | { 24 | rectTransform = transform as RectTransform; 25 | } 26 | 27 | private void Initialize(SaveDataEntry data, Text textPrefab) 28 | { 29 | target = data; 30 | 31 | text = GameObject.Instantiate(textPrefab); 32 | text.fontSize = 16; 33 | text.gameObject.name = "Text"; 34 | text.rectTransform.SetParent(transform, false); 35 | RectTransformExtensions.SetSize(text.rectTransform, 140, 50); 36 | 37 | text.text = target.Label; 38 | } 39 | 40 | public void OnPointerClick(PointerEventData eventData) 41 | { 42 | uGUI.main.userInput.RequestString("Label", "Submit", target.Label, 25, new uGUI_UserInput.UserInputCallback(SetLabel)); 43 | } 44 | 45 | public void SetLabel(string newLabel) 46 | { 47 | target.Label = newLabel; 48 | text.text = newLabel; 49 | 50 | onModified(newLabel); 51 | } 52 | 53 | public void OnPointerEnter(PointerEventData eventData) 54 | { 55 | hover = true; 56 | } 57 | 58 | public void OnPointerExit(PointerEventData eventData) 59 | { 60 | hover = false; 61 | } 62 | 63 | private void Update() 64 | { 65 | if (hover) 66 | { 67 | HandReticle.main.SetIcon(HandReticle.IconType.Rename); 68 | HandReticle.main.SetInteractTextRaw("Set Locker Label", ""); 69 | } 70 | } 71 | 72 | 73 | 74 | /////////////////////////////////////////////////////////////////////////////////////////// 75 | public static LabelController Create(SaveDataEntry data, Transform parent) 76 | { 77 | var lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); 78 | var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); 79 | textPrefab.fontSize = 12; 80 | textPrefab.color = CustomizeScreen.ScreenContentColor; 81 | 82 | var habitatNameController = new GameObject("LabelController", typeof(RectTransform)).AddComponent(); 83 | var rt = habitatNameController.gameObject.transform as RectTransform; 84 | RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); 85 | habitatNameController.Initialize(data, textPrefab); 86 | 87 | return habitatNameController; 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace AutosortLockers 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[AutosortLockersSML] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[AutosortLockersSML:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | using QModManager.API.ModLoading; 2 | 3 | namespace AutosortLockers 4 | { 5 | // https://github.com/Qwiso/QModManager 6 | [QModCore] 7 | public static class QPatch 8 | { 9 | [QModPatch] 10 | public static void Patch() 11 | { 12 | Mod.Patch("QMods/AutosortLockersSML"); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Patches/Initializer_Patch.cs: -------------------------------------------------------------------------------- 1 |  2 | using Harmony; 3 | 4 | namespace AutosortLockers.Patches 5 | { 6 | class AutosortLocker_Initializer_Patches 7 | { 8 | private static bool initialized; 9 | 10 | [HarmonyPatch(typeof(uGUI_PowerIndicator))] 11 | [HarmonyPatch("Initialize")] 12 | class uGUI_PowerIndicator_Initialize_Patch 13 | { 14 | private static void Postfix(uGUI_PowerIndicator __instance) 15 | { 16 | if (initialized) 17 | { 18 | if (Player.main == null) 19 | { 20 | Logger.Log("Deinitialize from no player"); 21 | initialized = false; 22 | } 23 | return; 24 | } 25 | 26 | if (Inventory.main == null) 27 | { 28 | return; 29 | } 30 | 31 | Mod.LoadSaveData(); 32 | initialized = true; 33 | } 34 | } 35 | 36 | [HarmonyPatch(typeof(uGUI_PowerIndicator))] 37 | [HarmonyPatch("Deinitialize")] 38 | class uGUI_PowerIndicator_Deinitialize_Patch 39 | { 40 | private static void PostFix() 41 | { 42 | Logger.Log("Deinitialize"); 43 | initialized = false; 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/PickerCloseButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | using UnityEngine.EventSystems; 7 | 8 | namespace AutosortLockers 9 | { 10 | public class PickerCloseButton : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler 11 | { 12 | public bool pointerOver; 13 | public AutosortTarget target; 14 | 15 | public void OnPointerClick(PointerEventData eventData) 16 | { 17 | if (target != null && enabled) 18 | { 19 | target.HideConfigureMenu(); 20 | } 21 | } 22 | 23 | public void Update() 24 | { 25 | transform.localScale = new Vector3(pointerOver ? 1.3f : 1, pointerOver ? 1.3f : 1, 1); 26 | } 27 | 28 | public void OnPointerEnter(PointerEventData eventData) 29 | { 30 | pointerOver = true; 31 | } 32 | 33 | public void OnPointerExit(PointerEventData eventData) 34 | { 35 | pointerOver = false; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/PickerPageButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | using UnityEngine.EventSystems; 7 | using UnityEngine.UI; 8 | 9 | namespace AutosortLockers 10 | { 11 | public class PickerPageButton : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler 12 | { 13 | private static readonly Color DisabledColor = new Color(0.5f, 0.5f, 0.5f, 0.3f); 14 | private static readonly Color NormalColor = new Color(0.7f, 0.7f, 0.7f, 1f); 15 | private static readonly Color HoverColor = Color.white; 16 | 17 | public bool canChangePage; 18 | public bool pointerOver; 19 | public AutosortTypePicker target; 20 | public int pageOffset; 21 | public Image image; 22 | 23 | public void Awake() 24 | { 25 | image = GetComponent(); 26 | } 27 | 28 | public void OnPointerClick(PointerEventData eventData) 29 | { 30 | if (canChangePage) 31 | { 32 | target.ChangePage(pageOffset); 33 | } 34 | } 35 | 36 | public void Update() 37 | { 38 | image.color = canChangePage ? (pointerOver ? HoverColor : NormalColor) : DisabledColor; 39 | } 40 | 41 | public void OnPointerEnter(PointerEventData eventData) 42 | { 43 | pointerOver = true; 44 | } 45 | 46 | public void OnPointerExit(PointerEventData eventData) 47 | { 48 | pointerOver = false; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("AutosortLockersSML")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("AutosortLockersSML")] 12 | [assembly: AssemblyCopyright("Copyright © 2020")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("2.0.0.0")] 35 | [assembly: AssemblyFileVersion("2.0.0.0")] 36 | -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/SaveData.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using UnityEngine; 7 | 8 | namespace AutosortLockers 9 | { 10 | [Serializable] 11 | public class SaveDataEntry 12 | { 13 | public string Id; 14 | public List FilterData = new List(); 15 | public string Label = "Locker"; 16 | public SerializableColor LabelColor = Color.white; 17 | public SerializableColor IconColor = Color.white; 18 | public SerializableColor OtherTextColor = Color.white; 19 | public SerializableColor ButtonsColor = Color.white; 20 | public SerializableColor LockerColor = new Color(0.3f, 0.3f, 0.3f); 21 | } 22 | 23 | [Serializable] 24 | public class SaveData 25 | { 26 | public List Entries = new List(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SubnauticaModSystem/AutosortLockers/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "AutosortLockersSML", 3 | "DisplayName": "Autosort Lockers SML", 4 | "Author": "RandyKnapp w/PrimeSonic", 5 | "Version": "2.0.0", 6 | "Requires": [ "SMLHelper" ], 7 | "Enable": true, 8 | "AssemblyName": "AutosortLockersSML.dll" 9 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/BaseTeleporters/Assets/BaseTeleporter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/BaseTeleporters/Assets/BaseTeleporter.png -------------------------------------------------------------------------------- /SubnauticaModSystem/BaseTeleporters/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BaseTeleporters 4 | { 5 | [Serializable] 6 | class Config 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BaseTeleporters/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BaseTeleporters 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[BaseTeleporters] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[BaseTeleporters:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BaseTeleporters/Mod.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using Common.Utility; 3 | using Harmony; 4 | using System; 5 | using System.Collections; 6 | using System.Collections.Generic; 7 | using System.IO; 8 | using System.Reflection; 9 | using UnityEngine; 10 | using Oculus.Newtonsoft.Json; 11 | 12 | namespace BaseTeleporters 13 | { 14 | enum CustomTechType 15 | { 16 | BaseTeleporter = 11140 17 | } 18 | 19 | static class Mod 20 | { 21 | public static Config config; 22 | 23 | private static string modDirectory; 24 | 25 | public static void Patch(string modDirectory = null) 26 | { 27 | Mod.modDirectory = modDirectory ?? "Subnautica_Data/Managed"; 28 | LoadConfig(); 29 | 30 | HarmonyInstance harmony = HarmonyInstance.Create("com.BaseTeleporters.mod"); 31 | harmony.PatchAll(Assembly.GetExecutingAssembly()); 32 | 33 | BaseTeleporter.AddBuildable(); 34 | 35 | Logger.Log("Patched"); 36 | } 37 | 38 | public static string GetModPath() 39 | { 40 | return Environment.CurrentDirectory + "/" + modDirectory; 41 | } 42 | 43 | public static string GetAssetPath(string filename) 44 | { 45 | return GetModPath() + "/Assets/" + filename; 46 | } 47 | 48 | private static string GetModInfoPath() 49 | { 50 | return GetModPath() + "/mod.json"; 51 | } 52 | 53 | private static void LoadConfig() 54 | { 55 | config = ModUtils.LoadConfig(GetModInfoPath()); 56 | ValidateConfig(); 57 | } 58 | 59 | private static void ValidateConfig() 60 | { 61 | Config defaultConfig = new Config(); 62 | if (config == null) 63 | { 64 | config = defaultConfig; 65 | return; 66 | } 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/BaseTeleporters/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | namespace BaseTeleporters 2 | { 3 | // QMods by qwiso https://github.com/Qwiso/QModManager 4 | public static class QPatch 5 | { 6 | public static void Patch() 7 | { 8 | Mod.Patch("QMods/BaseTeleporters"); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/BaseTeleporters/Patches/Teleporter_Patches.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using Harmony; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | 8 | namespace BaseTeleporters.Patches 9 | { 10 | [HarmonyPatch(typeof(PrecursorTeleporter))] 11 | [HarmonyPatch("Start")] 12 | class PrecursorTeleporter_Start_Patch 13 | { 14 | private static bool once; 15 | 16 | private static void Postfix(PrecursorTeleporter __instance) 17 | { 18 | if (once) 19 | { 20 | return; 21 | } 22 | once = true; 23 | 24 | Logger.Log("Teleporter:"); 25 | ModUtils.PrintObject(__instance.gameObject); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BaseTeleporters/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MoreQuickSlots")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BaseTeleporters/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "BaseTeleporters", 3 | "DisplayName": "BaseTeleporters", 4 | "Author": "RandyKnapp", 5 | "Version": "1.0.0", 6 | "Requires": [ "0Harmony.dll" ], 7 | "Enable": true, 8 | "AssemblyName": "BaseTeleporters.dll", 9 | "EntryMethod": "BaseTeleporters.QPatch.Patch", 10 | "Config": { 11 | } 12 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BetterPowerInfo 4 | { 5 | [Serializable] 6 | public class Config 7 | { 8 | public bool Debug; 9 | public string ViewToggleKey = "p"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Consumers/ChargerPowerConsumerInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using UnityEngine; 7 | 8 | namespace BetterPowerInfo.Consumers 9 | { 10 | class ChargerPowerConsumerInfo : PowerConsumerInfoBase 11 | { 12 | private static FieldInfo Charger_batteries; 13 | 14 | private Charger charger; 15 | 16 | public ChargerPowerConsumerInfo(Charger charger) : base(charger.name) 17 | { 18 | this.charger = charger; 19 | } 20 | 21 | protected override string GetDisplayText() 22 | { 23 | string n = base.GetDisplayText() + " [ "; 24 | var batteries = GetChargerBatteries(charger); 25 | List batteryStrings = new List(); 26 | 27 | foreach (KeyValuePair keyValuePair in batteries) 28 | { 29 | IBattery value = keyValuePair.Value; 30 | if (value != null) 31 | { 32 | float charge = value.charge; 33 | float capacity = value.capacity; 34 | float x = charge / capacity; 35 | Color color = (x >= 0.5f) ? Color.Lerp(charger.colorHalf, charger.colorFull, 2f * x - 1f) : Color.Lerp(charger.colorEmpty, charger.colorHalf, 2f * x); 36 | batteryStrings.Add(string.Format("{0}% ", Mathf.RoundToInt(x * 100), ColorUtility.ToHtmlStringRGBA(color))); 37 | } 38 | else 39 | { 40 | batteryStrings.Add(" - "); 41 | } 42 | } 43 | n += string.Join(" | ", batteryStrings.ToArray()) + " ]"; 44 | return n; 45 | } 46 | 47 | protected override float GetPowerConsumedPerMinute() 48 | { 49 | float total = 0f; 50 | var batteries = GetChargerBatteries(charger); 51 | foreach (KeyValuePair keyValuePair in batteries) 52 | { 53 | IBattery value = keyValuePair.Value; 54 | if (value != null) 55 | { 56 | float charge = value.charge; 57 | float capacity = value.capacity; 58 | if (charge < capacity) 59 | { 60 | float chargeAmount = DayNightCycle.main.dayNightSpeed * charger.chargeSpeed * capacity; 61 | total += chargeAmount; 62 | } 63 | } 64 | } 65 | 66 | return total; 67 | } 68 | 69 | private Dictionary GetChargerBatteries(Charger charger) 70 | { 71 | if (Charger_batteries == null) 72 | { 73 | Charger_batteries = typeof(Charger).GetField("batteries", BindingFlags.NonPublic | BindingFlags.Instance); 74 | } 75 | 76 | return (Dictionary)Charger_batteries.GetValue(charger); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Consumers/FiltrationMachinePowerConsumerInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace BetterPowerInfo.Consumers 8 | { 9 | public class FiltrationMachinePowerConsumerInfo : PowerConsumerInfoBase 10 | { 11 | private FiltrationMachine filter; 12 | 13 | public FiltrationMachinePowerConsumerInfo(FiltrationMachine filter) : base(filter.name) 14 | { 15 | this.filter = filter; 16 | } 17 | 18 | protected override string GetDisplayText() 19 | { 20 | string n = base.GetDisplayText(); 21 | 22 | string salt = filter.storageContainer.container.GetCount(TechType.Salt).ToString(); 23 | string water = filter.storageContainer.container.GetCount(TechType.BigFilteredWater).ToString(); 24 | if (filter.timeRemainingSalt >= 0) 25 | { 26 | float saltProgress = 1f - Mathf.Clamp01(filter.timeRemainingSalt / 420f); 27 | salt = string.Format("{0} ({1}%)", salt, Mathf.RoundToInt(saltProgress * 100)); 28 | } 29 | if (filter.timeRemainingWater >= 0) 30 | { 31 | float waterProgress = 1f - Mathf.Clamp01(filter.timeRemainingWater / 840f); 32 | water = string.Format("{0} ({1}%)", water, Mathf.RoundToInt(waterProgress * 100)); 33 | } 34 | n += string.Format(" [ H₂0: {1} | NaCl: {0} ]", salt, water); 35 | return n; 36 | } 37 | 38 | protected override float GetPowerConsumedPerMinute() 39 | { 40 | PowerRelay relay = filter.gameObject.GetComponentInParent(); 41 | bool powered = relay.GetPower() >= 0.85f; 42 | bool working = filter.timeRemainingWater > 0f || filter.timeRemainingSalt > 0f; 43 | float powerPerSecond = DayNightCycle.main.dayNightSpeed * 0.85f; 44 | return (working && powered) ? powerPerSecond * 60 : 0; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Consumers/PowerConsumerInfoBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace BetterPowerInfo.Consumers 7 | { 8 | public class PowerConsumerInfoBase 9 | { 10 | public virtual bool Show { get { return ShouldShowInList(); } } 11 | public virtual float PowerConsumedPerMinute { get { return GetPowerConsumedPerMinute(); } } 12 | public virtual string DisplayText { get { return GetDisplayText(); } } 13 | 14 | protected string name; 15 | protected float consumption; 16 | 17 | public PowerConsumerInfoBase(string name = "", float consumption = 0) 18 | { 19 | this.name = name; 20 | this.consumption = consumption; 21 | } 22 | 23 | protected virtual bool ShouldShowInList() 24 | { 25 | return true; 26 | } 27 | 28 | protected virtual float GetPowerConsumedPerMinute() 29 | { 30 | return consumption; 31 | } 32 | 33 | protected virtual string GetDisplayText() 34 | { 35 | return Mod.FormatName(name); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Consumers/ScannerRoomPowerConsumerInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using UnityEngine; 7 | 8 | namespace BetterPowerInfo.Consumers 9 | { 10 | public class ScannerRoomPowerConsumerInfo : PowerConsumerInfoBase 11 | { 12 | private static FieldInfo MapRoomFunctionality_scanActive; 13 | private MapRoomFunctionality scanner; 14 | 15 | public ScannerRoomPowerConsumerInfo(MapRoomFunctionality scanner) : base(scanner.name) 16 | { 17 | this.scanner = scanner; 18 | } 19 | 20 | protected override string GetDisplayText() 21 | { 22 | bool isScanning = IsScannerActive(); 23 | float range = scanner.GetScanRange(); 24 | float speed = scanner.GetScanInterval(); 25 | return string.Format("Scanner Room {0}( {1}m | {2}s )", 26 | isScanning ? "[Scanning...] " : "", 27 | Mathf.RoundToInt(range), 28 | Mathf.RoundToInt(speed) 29 | ); 30 | } 31 | 32 | protected override float GetPowerConsumedPerMinute() 33 | { 34 | bool isScanning = IsScannerActive(); 35 | return isScanning ? 0.5f * 60 : 0; 36 | } 37 | 38 | private bool IsScannerActive() 39 | { 40 | if (MapRoomFunctionality_scanActive == null) 41 | { 42 | MapRoomFunctionality_scanActive = typeof(MapRoomFunctionality).GetField("scanActive", BindingFlags.NonPublic | BindingFlags.Instance); 43 | } 44 | 45 | return (bool)MapRoomFunctionality_scanActive.GetValue(scanner); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Consumers/SpotLightPowerConsumerInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | 7 | namespace BetterPowerInfo.Consumers 8 | { 9 | class SpotLightPowerConsumerInfo : PowerConsumerInfoBase 10 | { 11 | private static FieldInfo BaseSpotLight_powerPerSecond; 12 | private static FieldInfo BaseSpotLight__powered; 13 | 14 | private BaseSpotLight light; 15 | 16 | public SpotLightPowerConsumerInfo(BaseSpotLight light) : base(light.name) 17 | { 18 | this.light = light; 19 | } 20 | 21 | protected override string GetDisplayText() 22 | { 23 | string n = base.GetDisplayText(); 24 | return n; 25 | } 26 | 27 | protected override float GetPowerConsumedPerMinute() 28 | { 29 | if (BaseSpotLight_powerPerSecond == null) 30 | { 31 | BaseSpotLight_powerPerSecond = typeof(BaseSpotLight).GetField("powerPerSecond", BindingFlags.NonPublic | BindingFlags.Static); 32 | } 33 | 34 | if (BaseSpotLight__powered == null) 35 | { 36 | BaseSpotLight__powered = typeof(BaseSpotLight).GetField("_powered", BindingFlags.NonPublic | BindingFlags.Instance); 37 | } 38 | 39 | float powerPerSecond = (float)BaseSpotLight_powerPerSecond.GetValue(null); 40 | bool powered = (bool)BaseSpotLight__powered.GetValue(light); 41 | return powered ? powerPerSecond * 60 : 0; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Consumers/TechLightPowerConsumerInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace BetterPowerInfo.Consumers 7 | { 8 | public class TechLightPowerConsumerInfo : PowerConsumerInfoBase 9 | { 10 | private TechLight light; 11 | 12 | public TechLightPowerConsumerInfo(TechLight light) : base(light.name) 13 | { 14 | this.light = light; 15 | } 16 | 17 | protected override string GetDisplayText() 18 | { 19 | return base.GetDisplayText(); 20 | } 21 | 22 | protected override float GetPowerConsumedPerMinute() 23 | { 24 | return base.GetPowerConsumedPerMinute(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace BetterPowerInfo 7 | { 8 | public static class Logger 9 | { 10 | public static void Log(string message) 11 | { 12 | Console.WriteLine("[BetterPowerInfo] " + message); 13 | } 14 | 15 | public static void Log(string format, params object[] args) 16 | { 17 | Console.WriteLine("[BetterPowerInfo] " + string.Format(format, args)); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | using Harmony; 2 | using System; 3 | using System.Reflection; 4 | using UnityEngine; 5 | 6 | namespace BetterPowerInfo 7 | { 8 | // QMods by qwiso https://github.com/Qwiso/QModManager 9 | public static class QPatch 10 | { 11 | public static void Patch() 12 | { 13 | Mod.Patch("QMods/BetterPowerInfo"); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Patches/uGUI_PowerIndicator_Initialize_Patch.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using Harmony; 6 | using System.Reflection; 7 | 8 | namespace BetterPowerInfo.Patches 9 | { 10 | [HarmonyPatch(typeof(uGUI_PowerIndicator))] 11 | [HarmonyPatch("Initialize")] 12 | class uGUI_PowerIndicator_Initialize_Patch 13 | { 14 | private static FieldInfo initializedField; 15 | private static bool initialized; 16 | 17 | private static void Postfix(uGUI_PowerIndicator __instance) 18 | { 19 | bool indicatorInitialized = IsInitialized(__instance); 20 | if (!indicatorInitialized || __instance.text == null) 21 | { 22 | initialized = false; 23 | return; 24 | } 25 | 26 | if (initialized) 27 | { 28 | return; 29 | } 30 | 31 | if (__instance.gameObject.GetComponent() == null) 32 | { 33 | __instance.gameObject.AddComponent(); 34 | initialized = true; 35 | } 36 | } 37 | 38 | private static bool IsInitialized(uGUI_PowerIndicator instance) 39 | { 40 | if (initializedField == null) 41 | { 42 | initializedField = typeof(uGUI_PowerIndicator).GetField("initialized", BindingFlags.NonPublic | BindingFlags.Instance); 43 | } 44 | 45 | return (bool)initializedField.GetValue(instance); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/PowerProductionTracker.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using UnityEngine; 3 | 4 | namespace BetterPowerInfo 5 | { 6 | class PowerProductionTracker : MonoBehaviour 7 | { 8 | private const float updateInterval = 1.0f; 9 | private const int windowSize = 20; 10 | 11 | private float[] productionWindow = new float[windowSize]; 12 | private float previousPower = 0; 13 | private int currentSlot = 0; 14 | 15 | private IEnumerator Start() 16 | { 17 | for (;;) 18 | { 19 | yield return new WaitForSeconds(updateInterval); 20 | 21 | PowerSource source = gameObject.GetComponent(); 22 | if (source != null) 23 | { 24 | float powerProduced = source.GetPower() - previousPower; 25 | 26 | int slot = (currentSlot++) % windowSize; 27 | productionWindow[slot] = powerProduced; 28 | 29 | previousPower = source.GetPower(); 30 | } 31 | } 32 | } 33 | 34 | public float GetPowerProductionPerMinute() 35 | { 36 | float sum = 0; 37 | foreach (float f in productionWindow) 38 | { 39 | sum += f; 40 | } 41 | return (sum / windowSize) * (60 / updateInterval); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Producers/BioreactorPowerSourceInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using UnityEngine; 7 | 8 | namespace BetterPowerInfo.Producers 9 | { 10 | public class BioreactorPowerSourceInfo : PowerSourceInfo 11 | { 12 | protected static MethodInfo BaseBioreactor_get_container; 13 | protected static FieldInfo BaseBioreactor_charge; 14 | 15 | private BaseBioReactor reactor; 16 | 17 | public BioreactorPowerSourceInfo(PowerSource source) : base(source, TechType.BaseBioReactor) 18 | { 19 | reactor = source.GetComponent(); 20 | } 21 | 22 | protected override string GetPowerSourceCustomText() 23 | { 24 | bool inactive = !reactor.producingPower && (Source.GetPower() < Source.GetMaxPower()); 25 | float availableCharge = GetBioreactorAvailableCharge(reactor); 26 | return string.Format("Bioreactor ", 27 | (inactive ? "red>[Inactive]" : "silver>[" + Mathf.RoundToInt(availableCharge) + "]") 28 | ); 29 | } 30 | 31 | protected override float GetPowerProductionPerMinute() 32 | { 33 | return (reactor.producingPower ? 0.8333333f : 0) * 60; 34 | } 35 | 36 | protected float GetBioreactorAvailableCharge(BaseBioReactor reactor) 37 | { 38 | if (BaseBioreactor_charge == null) 39 | { 40 | BaseBioreactor_charge = typeof(BaseBioReactor).GetField("charge", BindingFlags.NonPublic | BindingFlags.Static); 41 | } 42 | 43 | Dictionary chargeValues = (Dictionary)BaseBioreactor_charge.GetValue(null); 44 | ItemsContainer items = GetBioreactorItems(reactor); 45 | 46 | float sum = 0; 47 | foreach (InventoryItem inventoryItem in items) 48 | { 49 | Pickupable item = inventoryItem.item; 50 | TechType techType = item.GetTechType(); 51 | float itemChargeValue = 0; 52 | if (chargeValues.TryGetValue(techType, out itemChargeValue)) 53 | { 54 | sum += itemChargeValue; 55 | } 56 | } 57 | 58 | return sum - reactor._toConsume; 59 | } 60 | 61 | protected ItemsContainer GetBioreactorItems(BaseBioReactor reactor) 62 | { 63 | if (BaseBioreactor_get_container == null) 64 | { 65 | BaseBioreactor_get_container = typeof(BaseBioReactor).GetMethod("get_container", BindingFlags.NonPublic | BindingFlags.Instance); 66 | } 67 | 68 | return (ItemsContainer)BaseBioreactor_get_container.Invoke(reactor, new object[] { }); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Producers/GenericPowerSourceInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace BetterPowerInfo.Producers 8 | { 9 | public class GenericPowerSourceInfo : PowerSourceInfo 10 | { 11 | private IPowerInterface iSource; 12 | private string displayOverride; 13 | 14 | public GenericPowerSourceInfo(IPowerInterface source, string displayOverride = null) : base(null, TechType.None) 15 | { 16 | iSource = source; 17 | this.displayOverride = displayOverride; 18 | } 19 | 20 | public override int CurrentPower { get { return Mathf.RoundToInt(iSource.GetPower()); } } 21 | public override int MaxPower { get { return Mathf.RoundToInt(iSource.GetMaxPower()); } } 22 | 23 | protected override string GetPowerSourceCustomText() 24 | { 25 | if ((iSource as Component) != null) 26 | { 27 | string name = Mod.FormatName((iSource as Component).name).Replace("Base", "").Replace("Module", ""); 28 | if (Input.GetKey(KeyCode.X)) 29 | { 30 | foreach (var c in (iSource as Component).gameObject.GetComponents()) 31 | { 32 | name += "," + c.GetType(); 33 | } 34 | } 35 | return name; 36 | } 37 | 38 | return iSource.ToString(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Producers/NuclearReactorPowerSourceInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using UnityEngine; 7 | 8 | namespace BetterPowerInfo.Producers 9 | { 10 | public class NuclearReactorPowerSourceInfo : PowerSourceInfo 11 | { 12 | protected static MethodInfo BaseNuclearReactor_get_equipment; 13 | protected static FieldInfo BaseNuclearReactor_charge; 14 | 15 | private BaseNuclearReactor reactor; 16 | 17 | public NuclearReactorPowerSourceInfo(PowerSource source) : base(source, TechType.BaseNuclearReactor) 18 | { 19 | reactor = source.GetComponent(); 20 | } 21 | 22 | protected override string GetPowerSourceCustomText() 23 | { 24 | bool inactive = !reactor.producingPower && (Source.GetPower() < Source.GetMaxPower()); 25 | float availableCharge = GetNuclearReactorAvailableCharge(reactor); 26 | return string.Format("Nuclear Reactor ", 27 | (inactive ? "red>[Inactive]" : "silver>[" + Mathf.RoundToInt(availableCharge) + "]") 28 | ); 29 | } 30 | 31 | protected override float GetPowerProductionPerMinute() 32 | { 33 | return (reactor.producingPower ? 4.16666651f : 0) * 60; 34 | } 35 | 36 | protected float GetNuclearReactorAvailableCharge(BaseNuclearReactor reactor) 37 | { 38 | if (BaseNuclearReactor_charge == null) 39 | { 40 | BaseNuclearReactor_charge = typeof(BaseNuclearReactor).GetField("charge", BindingFlags.NonPublic | BindingFlags.Static); 41 | } 42 | 43 | Dictionary chargeValues = (Dictionary)BaseNuclearReactor_charge.GetValue(null); 44 | Equipment items = GetNuclearReactorItems(reactor); 45 | 46 | var e = items.GetEquipment(); 47 | float sum = 0; 48 | while (e.MoveNext()) 49 | { 50 | if (e.Current.Value == null) 51 | continue; 52 | 53 | Pickupable item = e.Current.Value.item; 54 | TechType techType = item.GetTechType(); 55 | float itemChargeValue = 0; 56 | if (chargeValues.TryGetValue(techType, out itemChargeValue)) 57 | { 58 | sum += itemChargeValue; 59 | } 60 | } 61 | 62 | return sum - reactor._toConsume; 63 | } 64 | 65 | protected Equipment GetNuclearReactorItems(BaseNuclearReactor reactor) 66 | { 67 | if (BaseNuclearReactor_get_equipment == null) 68 | { 69 | BaseNuclearReactor_get_equipment = typeof(BaseNuclearReactor).GetMethod("get_equipment", BindingFlags.NonPublic | BindingFlags.Instance); 70 | } 71 | 72 | return (Equipment)BaseNuclearReactor_get_equipment.Invoke(reactor, new object[] { }); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Producers/PowerSourceInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using UnityEngine; 7 | 8 | namespace BetterPowerInfo.Producers 9 | { 10 | public class PowerSourceInfo 11 | { 12 | public virtual string Name { get { return GetPowerSourceNameText(); } } 13 | public virtual string CustomText { get { return GetPowerSourceCustomText(); } } 14 | public virtual int CurrentPower { get { return Mathf.RoundToInt(Source.GetPower()); } } 15 | public virtual int MaxPower { get { return Mathf.RoundToInt(Source.GetMaxPower()); } } 16 | public virtual float ProductionPerMinute { get { return GetPowerProductionPerMinute(); } } 17 | 18 | public PowerSource Source { get; private set; } 19 | public TechType TechType { get; private set; } 20 | 21 | public PowerSourceInfo(PowerSource source, TechType techType) 22 | { 23 | this.TechType = techType; 24 | this.Source = source; 25 | } 26 | 27 | protected virtual string GetPowerSourceNameText() 28 | { 29 | return GetDefaultPowerSourceNameText(); 30 | } 31 | 32 | protected virtual string GetPowerSourceCustomText() 33 | { 34 | return ""; 35 | } 36 | 37 | private string GetDefaultPowerSourceNameText() 38 | { 39 | return Mod.FormatName(Source.name).Replace("Base", "").Replace("Module", ""); 40 | } 41 | 42 | protected virtual float GetPowerProductionPerMinute() 43 | { 44 | return 0; 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Producers/RegenPowerSourceInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace BetterPowerInfo.Producers 7 | { 8 | public class RegenPowerSourceInfo : PowerSourceInfo 9 | { 10 | private RegeneratePowerSource regen; 11 | 12 | public RegenPowerSourceInfo(PowerSource source) : base(source, TechType.PowerCell) 13 | { 14 | regen = source.gameObject.GetComponent(); 15 | } 16 | 17 | protected override float GetPowerProductionPerMinute() 18 | { 19 | return regen.regenerationAmount / (regen.regenerationInterval / 60); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Producers/SolarPanelPowerSourceInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | using System.Text; 6 | using UnityEngine; 7 | 8 | namespace BetterPowerInfo.Producers 9 | { 10 | class SolarPanelPowerSourceInfo : PowerSourceInfo 11 | { 12 | protected static MethodInfo SolarPanel_GetRechargeScalar; 13 | 14 | private SolarPanel panel; 15 | 16 | public SolarPanelPowerSourceInfo(PowerSource source) : base(source, TechType.SolarPanel) 17 | { 18 | panel = source.gameObject.GetComponent(); 19 | } 20 | 21 | protected override float GetPowerProductionPerMinute() 22 | { 23 | float rechargeScalar = GetRechargeScalar(); 24 | return rechargeScalar * 0.25f * 5.0f * 60; 25 | } 26 | 27 | protected override string GetPowerSourceCustomText() 28 | { 29 | string name = base.GetPowerSourceCustomText(); 30 | float rechargeScalar = GetRechargeScalar(); 31 | return string.Format("{0} ({1}%)", name, Mathf.RoundToInt(rechargeScalar * 100), Mod.GetChargeColorString(rechargeScalar)); 32 | } 33 | 34 | protected float GetRechargeScalar() 35 | { 36 | if (SolarPanel_GetRechargeScalar == null) 37 | { 38 | SolarPanel_GetRechargeScalar = typeof(SolarPanel).GetMethod("GetRechargeScalar", BindingFlags.NonPublic | BindingFlags.Instance); 39 | } 40 | 41 | return (float)SolarPanel_GetRechargeScalar.Invoke(panel, new object[] { }); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Producers/ThermalPlantPowerSourceInfo.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace BetterPowerInfo.Producers 4 | { 5 | class ThermalPlantPowerSourceInfo : PowerSourceInfo 6 | { 7 | private ThermalPlant plant; 8 | 9 | public ThermalPlantPowerSourceInfo(PowerSource source) : base(source, TechType.ThermalPlant) 10 | { 11 | plant = source.gameObject.GetComponent(); 12 | } 13 | 14 | protected override float GetPowerProductionPerMinute() 15 | { 16 | float num = 2f * DayNightCycle.main.dayNightSpeed; 17 | float num2 = 1.6500001f * num * Mathf.Clamp01(Mathf.InverseLerp(25f, 100f, plant.temperature)); 18 | return num2 * 30; 19 | } 20 | 21 | protected override string GetPowerSourceCustomText() 22 | { 23 | Color color = plant.temperatureText.color; 24 | string name = base.GetPowerSourceCustomText(); 25 | return string.Format("{0} ({1})", name, plant.temperatureText.text, ColorUtility.ToHtmlStringRGBA(color)); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MoreQuickSlots")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterPowerInfo/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "BetterPowerInfo", 3 | "DisplayName": "Better Power Info", 4 | "Author": "RandyKnapp", 5 | "Version": "1.0.1", 6 | "Requires": [ "0Harmony-1.2.0.1.dll" ], 7 | "Enable": true, 8 | "AssemblyName": "BetterPowerInfo.dll", 9 | "EntryMethod": "BetterPowerInfo.QPatch.Patch", 10 | "Config": { 11 | "ViewToggleKey": "p" 12 | } 13 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterScannerBlips/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BetterScannerBlips 4 | { 5 | [Serializable] 6 | class Config 7 | { 8 | public float MaxRange = 200.0f; 9 | public float MaxRangeScale = 0.2f; 10 | public float CloseRange = 12.0f; 11 | public float CloseRangeScale = 1.0f; 12 | public float MinRange = 1.0f; 13 | public float MinRangeScale = 10.0f; 14 | public float TextRange = 100.0f; 15 | public float AlphaOutRange = 150.0f; 16 | public float MaxAlpha = 1f; 17 | public float MinAlpha = 0.4f; 18 | public bool CustomColors = false; 19 | public string CircleColor = "#00FF00FF"; 20 | public string TextColor = "#00FF00FF"; 21 | public bool ShowDistance = true; 22 | public bool NoText = false; 23 | public string ToggleKey = "l"; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterScannerBlips/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BetterScannerBlips 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[BetterScannerBlips] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[BetterScannerBlips:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterScannerBlips/Mod.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using Common.Utility; 3 | using Harmony; 4 | using System; 5 | using System.Collections; 6 | using System.Collections.Generic; 7 | using System.IO; 8 | using System.Reflection; 9 | using UnityEngine; 10 | using Oculus.Newtonsoft.Json; 11 | using System.Threading; 12 | using System.Globalization; 13 | 14 | namespace BetterScannerBlips 15 | { 16 | static class Mod 17 | { 18 | public static Config config; 19 | 20 | private static string modDirectory; 21 | 22 | public static void Patch(string modDirectory = null) 23 | { 24 | Mod.modDirectory = modDirectory ?? "Subnautica_Data/Managed"; 25 | LoadConfig(); 26 | 27 | HarmonyInstance harmony = HarmonyInstance.Create("com.BetterScannerBlips.mod"); 28 | harmony.PatchAll(Assembly.GetExecutingAssembly()); 29 | 30 | CustomBlip.InitializeColors(); 31 | 32 | Logger.Log("Patched"); 33 | } 34 | 35 | public static string GetModPath() 36 | { 37 | return Environment.CurrentDirectory + "/" + modDirectory; 38 | } 39 | 40 | public static string GetAssetPath(string filename) 41 | { 42 | return GetModPath() + "/Assets/" + filename; 43 | } 44 | 45 | private static string GetModInfoPath() 46 | { 47 | return GetModPath() + "/mod.json"; 48 | } 49 | 50 | private static void LoadConfig() 51 | { 52 | Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; 53 | config = ModUtils.LoadConfig(GetModInfoPath()); 54 | ValidateConfig(); 55 | } 56 | 57 | private static void ValidateConfig() 58 | { 59 | Config defaultConfig = new Config(); 60 | if (config == null) 61 | { 62 | config = defaultConfig; 63 | return; 64 | } 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterScannerBlips/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | namespace BetterScannerBlips 2 | { 3 | // QMods by qwiso https://github.com/Qwiso/QModManager 4 | public static class QPatch 5 | { 6 | public static void Patch() 7 | { 8 | Mod.Patch("QMods/BetterScannerBlips"); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterScannerBlips/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MoreQuickSlots")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BetterScannerBlips/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "BetterScannerBlips", 3 | "DisplayName": "BetterScannerBlips", 4 | "Author": "RandyKnapp", 5 | "Version": "1.0.3", 6 | "Requires": [ "0Harmony-1.2.0.1.dll" ], 7 | "Enable": true, 8 | "AssemblyName": "BetterScannerBlips.dll", 9 | "EntryMethod": "BetterScannerBlips.QPatch.Patch", 10 | "Config": { 11 | "MaxRange": 200.0, 12 | "MaxRangeScale": 0.2, 13 | "CloseRange": 12.0, 14 | "CloseRangeScale": 1.0, 15 | "MinRange": 0, 16 | "MinRangeScale": 6.0, 17 | "TextRange": 100.0, 18 | "AlphaOutRange": 150.0, 19 | "MaxAlpha": 1, 20 | "MinAlpha": 0.4, 21 | "CustomColors": false, 22 | "CircleColor": "#00FF00FF", 23 | "TextColor": "#00FF00FF", 24 | "ShowDistance": true, 25 | "NoText": false, 26 | "ToggleKey": "l" 27 | } 28 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/Assets/pin_not_pinned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/BlueprintTracker/Assets/pin_not_pinned.png -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/Assets/pin_pinned.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/BlueprintTracker/Assets/pin_pinned.png -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/Assets/remove_pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/BlueprintTracker/Assets/remove_pin.png -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/BlueprintTrackerPdaEntry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | 5 | namespace BlueprintTracker 6 | { 7 | class BlueprintTrackerPdaEntry : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler 8 | { 9 | public TechType techType; 10 | 11 | private PinButton addPinButton; 12 | private PinButton removePinButton; 13 | private bool hover; 14 | 15 | public void Awake() 16 | { 17 | addPinButton = CreateButton("AddPin", PinButton.Mode.Add, OnAddPinButtonClicked); 18 | removePinButton = CreateButton("RemovePin", PinButton.Mode.Remove, OnRemovePinButtonClicked); 19 | 20 | BlueprintTracker.onTrackingChanged += Refresh; 21 | 22 | Refresh(); 23 | } 24 | 25 | public void OnDestroy() 26 | { 27 | BlueprintTracker.onTrackingChanged -= Refresh; 28 | } 29 | 30 | private void Refresh() 31 | { 32 | bool isTracked = BlueprintTracker.IsTracked(techType); 33 | bool canTrack = BlueprintTracker.CanTrack(techType); 34 | 35 | if (isTracked) 36 | { 37 | addPinButton.gameObject.SetActive(false); 38 | removePinButton.gameObject.SetActive(true); 39 | } 40 | else 41 | { 42 | removePinButton.gameObject.SetActive(false); 43 | addPinButton.gameObject.SetActive(hover && canTrack); 44 | } 45 | } 46 | 47 | public void OnPointerEnter(PointerEventData eventData) 48 | { 49 | hover = true; 50 | Refresh(); 51 | } 52 | 53 | public void OnPointerExit(PointerEventData eventData) 54 | { 55 | hover = false; 56 | Refresh(); 57 | } 58 | 59 | private void OnAddPinButtonClicked() 60 | { 61 | BlueprintTracker.StartTracking(techType); 62 | Refresh(); 63 | } 64 | 65 | private void OnRemovePinButtonClicked() 66 | { 67 | BlueprintTracker.StopTracking(techType); 68 | Refresh(); 69 | } 70 | 71 | public PinButton CreateButton(string name, PinButton.Mode mode, Action onClick) 72 | { 73 | var button = new GameObject(name, typeof(RectTransform)).AddComponent(); 74 | button.transform.SetParent(transform, false); 75 | 76 | button.SetMode(mode); 77 | button.onClick += onClick; 78 | 79 | return button; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/BlueprintTrackerRemoveButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using UnityEngine; 7 | using UnityEngine.UI; 8 | 9 | namespace BlueprintTracker 10 | { 11 | class BlueprintTrackerRemoveButton : MonoBehaviour 12 | { 13 | public const float Width = BlueprintTrackerEntry.Height; 14 | 15 | private TechType techType; 16 | private LayoutElement layout; 17 | private Image background; 18 | private PinButton button; 19 | 20 | public static BlueprintTrackerRemoveButton Create(Transform parent, TechType techType, bool first, bool last) 21 | { 22 | var go = new GameObject("StopTrackingButton", typeof(RectTransform)); 23 | go.transform.SetParent(parent, false); 24 | go.layer = parent.gameObject.layer; 25 | var icon = go.AddComponent(); 26 | icon.Init(techType, first, last); 27 | 28 | return icon; 29 | } 30 | 31 | private void Init(TechType techType, bool first, bool last) 32 | { 33 | this.techType = techType; 34 | 35 | var quickSlots = GameObject.FindObjectOfType(); 36 | var bgSprite = first ? quickSlots.spriteLeft : last ? quickSlots.spriteRight : quickSlots.spriteCenter; 37 | 38 | (transform as RectTransform).SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, bgSprite.rect.width); 39 | (transform as RectTransform).SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, bgSprite.rect.height); 40 | 41 | layout = gameObject.AddComponent(); 42 | layout.minWidth = bgSprite.rect.width; 43 | layout.minHeight = bgSprite.rect.height; 44 | 45 | background = gameObject.AddComponent(); 46 | background.color = new Color(1, 1, 1, 0.5f); 47 | background.raycastTarget = false; 48 | background.material = quickSlots.materialBackground; 49 | background.sprite = bgSprite; 50 | 51 | button = new GameObject(name, typeof(RectTransform)).AddComponent(); 52 | var brt = button.transform as RectTransform; 53 | RectTransformExtensions.SetParams(brt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), transform); 54 | brt.anchoredPosition = new Vector2(0, 0); 55 | RectTransformExtensions.SetSize(brt, 30, 30); 56 | 57 | button.SetMode(PinButton.Mode.Cross); 58 | button.onClick += OnButtonClick; 59 | } 60 | 61 | private void OnButtonClick() 62 | { 63 | BlueprintTracker.StopTracking(techType); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlueprintTracker 4 | { 5 | [Serializable] 6 | class Config 7 | { 8 | public int MaxPinnedBlueprints = 4; 9 | public string Position = "TopRight"; 10 | public int CornerOffsetX = 20; 11 | public int CornerOffsetY = 20; 12 | public float TrackerScale = 1.0f; 13 | public int FontSize = 16; 14 | public float BackgroundAlpha = 0.5f; 15 | public bool ShowWhilePiloting = false; 16 | public bool ColorblindMode = false; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace BlueprintTracker 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[BlueprintTracker] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[BlueprintTracker:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | namespace BlueprintTracker 2 | { 3 | // QMods by qwiso https://github.com/Qwiso/QModManager 4 | public static class QPatch 5 | { 6 | public static void Patch() 7 | { 8 | Mod.Patch("QMods/BlueprintTracker"); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/Patches/uGUI_BlueprintEntry_SetIcon_Patch.cs: -------------------------------------------------------------------------------- 1 | using Harmony; 2 | 3 | namespace BlueprintTracker.Patches 4 | { 5 | [HarmonyPatch(typeof(uGUI_BlueprintEntry))] 6 | [HarmonyPatch("SetIcon")] 7 | public static class uGUI_BlueprintEntry_SetIcon_Patch 8 | { 9 | private static void Postfix(uGUI_BlueprintEntry __instance, TechType techType) 10 | { 11 | var techData = CraftData.Get(techType); 12 | if (techData != null && techData.ingredientCount > 0) 13 | { 14 | __instance.gameObject.AddComponent().techType = techType; 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/Patches/uGUI_PowerIndicator_Initialize_Patch.cs: -------------------------------------------------------------------------------- 1 | using Harmony; 2 | using System.Reflection; 3 | using UnityEngine; 4 | 5 | namespace BlueprintTracker.Patches 6 | { 7 | [HarmonyPatch(typeof(uGUI_PowerIndicator))] 8 | [HarmonyPatch("Initialize")] 9 | class uGUI_PowerIndicator_Initialize_Patch 10 | { 11 | private static BlueprintTracker tracker; 12 | 13 | private static void Postfix(uGUI_PowerIndicator __instance) 14 | { 15 | if (tracker != null) 16 | { 17 | return; 18 | } 19 | 20 | if (Inventory.main == null) 21 | { 22 | return; 23 | } 24 | 25 | InitializeTracker(__instance); 26 | } 27 | 28 | private static void InitializeTracker(uGUI_PowerIndicator __instance) 29 | { 30 | if (tracker == null) 31 | { 32 | tracker = GameObject.FindObjectOfType(); 33 | if (tracker == null) 34 | { 35 | CreateTracker(__instance); 36 | } 37 | } 38 | } 39 | 40 | private static void CreateTracker(uGUI_PowerIndicator __instance) 41 | { 42 | var parent = __instance.text.transform.parent; 43 | if (parent == null) 44 | { 45 | Logger.Error("Tried to create tracker but hud was null!"); 46 | } 47 | 48 | tracker = BlueprintTracker.Create(parent); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MoreQuickSlots")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/SaveData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace BlueprintTracker 7 | { 8 | [Serializable] 9 | class SaveData 10 | { 11 | public List TrackedTech; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SubnauticaModSystem/BlueprintTracker/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "BlueprintTracker", 3 | "DisplayName": "BlueprintTracker", 4 | "Author": "RandyKnapp", 5 | "Version": "1.1.3", 6 | "Requires": [ "0Harmony-1.2.0.1.dll" ], 7 | "Enable": true, 8 | "AssemblyName": "BlueprintTracker.dll", 9 | "EntryMethod": "BlueprintTracker.QPatch.Patch", 10 | "Config": { 11 | "MaxPinnedBlueprints": 13, 12 | "Position": "TopRight", 13 | "CornerOffsetX": 20, 14 | "CornerOffsetY": 20, 15 | "TrackerScale": 1.0, 16 | "FontSize": 16, 17 | "BackgroundAlpha": 0.5, 18 | "ShowWhilePiloting": true, 19 | "ColorblindMode": false 20 | } 21 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/Common/Common.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | dd1d2dc7-3bdc-4dc1-99c8-2d0ccbf2b171 7 | 8 | 9 | Common 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /SubnauticaModSystem/Common/Common.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | dd1d2dc7-3bdc-4dc1-99c8-2d0ccbf2b171 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /SubnauticaModSystem/Common/Mod/CallbackOnDestroy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using UnityEngine; 5 | 6 | namespace Common.Mod 7 | { 8 | class CallbackOnDestroy : MonoBehaviour 9 | { 10 | public Action onDestroy = delegate { }; 11 | 12 | private void OnDestroy() 13 | { 14 | onDestroy(gameObject); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SubnauticaModSystem/Common/Mod/CustomTechInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using UnityEngine; 5 | 6 | namespace Common.Mod 7 | { 8 | public delegate GameObject GetPrefabDelegate(); 9 | 10 | public class CustomIngredient : IIngredient 11 | { 12 | public TechType techType; 13 | public int amount; 14 | 15 | TechType IIngredient.techType => techType; 16 | int IIngredient.amount => amount; 17 | } 18 | 19 | public class CustomTechInfo : ITechData 20 | { 21 | public GetPrefabDelegate getPrefab; 22 | 23 | public TechType techType; 24 | public string classID; 25 | public TechGroup techGroup; 26 | public TechCategory techCategory; 27 | public string assetPath; 28 | public bool knownAtStart; 29 | public Atlas.Sprite sprite; 30 | public string displayString; 31 | public string techTypeKey; 32 | public string tooltip; 33 | public List recipe = new List(); 34 | public List linkedItems = new List(); 35 | 36 | public int craftAmount { get; set; } 37 | public int ingredientCount => recipe.Count; 38 | public int linkedItemCount => linkedItems.Count; 39 | 40 | public IIngredient GetIngredient(int index) 41 | { 42 | return recipe[index]; 43 | } 44 | 45 | public TechType GetLinkedItem(int index) 46 | { 47 | return linkedItems[index]; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /SubnauticaModSystem/Common/Mod/ImageUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | 5 | namespace Common.Utility 6 | { 7 | public static class ImageUtils 8 | { 9 | private static Dictionary spriteCache = new Dictionary(); 10 | 11 | public static Sprite LoadSprite(string path, Vector2 pivot = new Vector2(), TextureFormat format = TextureFormat.BC7, float pixelsPerUnit = 100f, SpriteMeshType spriteType = SpriteMeshType.Tight) 12 | { 13 | if (spriteCache.TryGetValue(path, out Sprite foundSprite)) 14 | { 15 | return foundSprite; 16 | } 17 | 18 | Texture2D texture2D = SMLHelper.V2.Utility.ImageUtils.LoadTextureFromFile(path, format); 19 | if (!texture2D) 20 | { 21 | return null; 22 | } 23 | Sprite sprite = TextureToSprite(texture2D, pivot, pixelsPerUnit, spriteType); 24 | spriteCache.Add(path, sprite); 25 | return sprite; 26 | } 27 | 28 | public static Sprite Load9SliceSprite(string path, RectOffset slices, Vector2 pivot = new Vector2(), TextureFormat format = TextureFormat.BC7, float pixelsPerUnit = 100f, SpriteMeshType spriteType = SpriteMeshType.Tight) 29 | { 30 | string spriteKey = path + slices; 31 | if (spriteCache.TryGetValue(spriteKey, out Sprite foundSprite)) 32 | { 33 | return foundSprite; 34 | } 35 | 36 | Texture2D texture2D = SMLHelper.V2.Utility.ImageUtils.LoadTextureFromFile(path, format); 37 | if (!texture2D) 38 | { 39 | return null; 40 | } 41 | var border = new Vector4(slices.left, slices.right, slices.top, slices.bottom); 42 | Sprite sprite = TextureToSprite(texture2D, pivot, pixelsPerUnit, spriteType, border); 43 | spriteCache.Add(spriteKey, sprite); 44 | return sprite; 45 | } 46 | 47 | public static Sprite TextureToSprite(Texture2D tex, Vector2 pivot = new Vector2(), float pixelsPerUnit = 100f, SpriteMeshType spriteType = SpriteMeshType.Tight, Vector4 border = new Vector4()) 48 | { 49 | return Sprite.Create(tex, new Rect(0f, 0f, tex.width, tex.height), pivot, pixelsPerUnit, 0u, spriteType, border); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /SubnauticaModSystem/Common/Mod/ModBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using UnityEngine; 7 | using UnityEngine.UI; 8 | 9 | namespace Common.Mod 10 | { 11 | public static class ModUtils 12 | { 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SubnauticaModSystem/Common/Mod/ModSaver.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace Common.Mod 4 | { 5 | public class ModSaver : MonoBehaviour 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /SubnauticaModSystem/Common/Mod/SerializableColor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace Common.Mod 5 | { 6 | [Serializable] 7 | public class SerializableColor 8 | { 9 | public float r = 1; 10 | public float g = 1; 11 | public float b = 1; 12 | public float a = 1; 13 | 14 | public SerializableColor(Color c) 15 | { 16 | r = c.r; 17 | g = c.g; 18 | b = c.b; 19 | a = c.a; 20 | } 21 | 22 | public static implicit operator SerializableColor(Color c) 23 | { 24 | return new SerializableColor(c); 25 | } 26 | 27 | public Color ToColor() 28 | { 29 | return new Color(r, g, b, a); 30 | } 31 | 32 | public static SerializableColor Create(Color c) 33 | { 34 | return new SerializableColor(c); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /SubnauticaModSystem/Common/Utility/ImageUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | 5 | namespace Common.Utility 6 | { 7 | public static class ImageUtils 8 | { 9 | private static Dictionary spriteCache = new Dictionary(); 10 | 11 | public static Sprite LoadSprite(string path, Vector2 pivot = new Vector2(), TextureFormat format = TextureFormat.BC7, float pixelsPerUnit = 100f, SpriteMeshType spriteType = SpriteMeshType.Tight) 12 | { 13 | if (spriteCache.TryGetValue(path, out Sprite foundSprite)) 14 | { 15 | return foundSprite; 16 | } 17 | 18 | Texture2D texture2D = SMLHelper.V2.Utility.ImageUtils.LoadTextureFromFile(path, format); 19 | if (!texture2D) 20 | { 21 | return null; 22 | } 23 | Sprite sprite = TextureToSprite(texture2D, pivot, pixelsPerUnit, spriteType); 24 | spriteCache.Add(path, sprite); 25 | return sprite; 26 | } 27 | 28 | public static Sprite Load9SliceSprite(string path, RectOffset slices, Vector2 pivot = new Vector2(), TextureFormat format = TextureFormat.BC7, float pixelsPerUnit = 100f, SpriteMeshType spriteType = SpriteMeshType.Tight) 29 | { 30 | string spriteKey = path + slices; 31 | if (spriteCache.TryGetValue(spriteKey, out Sprite foundSprite)) 32 | { 33 | return foundSprite; 34 | } 35 | 36 | Texture2D texture2D = SMLHelper.V2.Utility.ImageUtils.LoadTextureFromFile(path, format); 37 | if (!texture2D) 38 | { 39 | return null; 40 | } 41 | var border = new Vector4(slices.left, slices.right, slices.top, slices.bottom); 42 | Sprite sprite = TextureToSprite(texture2D, pivot, pixelsPerUnit, spriteType, border); 43 | spriteCache.Add(spriteKey, sprite); 44 | return sprite; 45 | } 46 | 47 | public static Sprite TextureToSprite(Texture2D tex, Vector2 pivot = new Vector2(), float pixelsPerUnit = 100f, SpriteMeshType spriteType = SpriteMeshType.Tight, Vector4 border = new Vector4()) 48 | { 49 | return Sprite.Create(tex, new Rect(0f, 0f, tex.width, tex.height), pivot, pixelsPerUnit, 0u, spriteType, border); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Circle.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Edit.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Left.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/PickerBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/PickerBackground.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_CyclopsA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_CyclopsA.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_CyclopsB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_CyclopsB.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_CyclopsC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_CyclopsC.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_CyclopsHeart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_CyclopsHeart.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_CyclopsStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_CyclopsStar.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_PrawnsuitA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_PrawnsuitA.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_PrawnsuitB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_PrawnsuitB.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_PrawnsuitC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_PrawnsuitC.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_PrawnsuitHeart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_PrawnsuitHeart.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_PrawnsuitStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_PrawnsuitStar.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_SeamothA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_SeamothA.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_SeamothB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_SeamothB.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_SeamothC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_SeamothC.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_SeamothHeart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_SeamothHeart.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/00_SeamothStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/00_SeamothStar.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Anchor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Anchor.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Cave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Cave.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Emergency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Emergency.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Fish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Fish.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Food.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Food.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Garden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Garden.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Gears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Gears.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Heart.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Heat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Heat.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_MapPin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_MapPin.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Mining.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Mining.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Player.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Power.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Question.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Scan.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Skull.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Star.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Storage.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Watch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Watch.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Water.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/01_Whirlpool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/01_Whirlpool.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_Habitat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_Habitat.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatAnchor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatAnchor.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatEmergency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatEmergency.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatFish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatFish.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatFood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatFood.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatGarden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatGarden.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatGears.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatGears.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatHeart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatHeart.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatMapPin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatMapPin.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatMining.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatMining.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatPlayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatPlayer.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatPower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatPower.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatQuestion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatQuestion.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatScan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatScan.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatSkull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatSkull.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatStar.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatStorage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatStorage.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatWatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatWatch.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatWater.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/02_HabitatWater.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/03_HabitatA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/03_HabitatA.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/03_HabitatB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/03_HabitatB.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/03_HabitatC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/03_HabitatC.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/03_HabitatD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/03_HabitatD.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/04_Habitat1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/04_Habitat1.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/04_Habitat2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/04_Habitat2.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/04_Habitat3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/04_Habitat3.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/04_Habitat4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/04_Habitat4.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/05_A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/05_A.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/05_B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/05_B.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/05_C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/05_C.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/05_D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/05_D.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/06_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/06_1.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/06_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/06_2.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/06_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/06_3.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/06_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/06_4.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/07_Cuddlefish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/07_Cuddlefish.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/07_GhostLeviathan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/07_GhostLeviathan.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/07_Peeper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/07_Peeper.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/07_Reaper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/07_Reaper.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Pings/07_SeaDragon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Pings/07_SeaDragon.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/Right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/Right.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/SelectorHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/SelectorHover.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/SelectorSelected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/CustomPings/Assets/SelectorSelected.png -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Assets/colors.json: -------------------------------------------------------------------------------- 1 | { 2 | "Colors": [ 3 | { 4 | "r": 0.4392157, 5 | "g": 0.7529412, 6 | "b": 0.254901975, 7 | "a": 1.0 8 | }, 9 | { 10 | "r": 0.2509804, 11 | "g": 0.7529412, 12 | "b": 0.5764706, 13 | "a": 1.0 14 | }, 15 | { 16 | "r": 0.7019608, 17 | "g": 0.41568628, 18 | "b": 0.8862745, 19 | "a": 1.0 20 | }, 21 | { 22 | "r": 0.8862745, 23 | "g": 0.4117647, 24 | "b": 0.819607854, 25 | "a": 1.0 26 | }, 27 | { 28 | "r": 1.0, 29 | "g": 0.0, 30 | "b": 0.0, 31 | "a": 1.0 32 | }, 33 | { 34 | "r": 1.0, 35 | "g": 0.647058845, 36 | "b": 0.0, 37 | "a": 1.0 38 | }, 39 | { 40 | "r": 1.0, 41 | "g": 0.921568632, 42 | "b": 0.0156862754, 43 | "a": 1.0 44 | }, 45 | { 46 | "r": 0.0, 47 | "g": 1.0, 48 | "b": 0.0, 49 | "a": 1.0 50 | }, 51 | { 52 | "r": 0.0, 53 | "g": 1.0, 54 | "b": 1.0, 55 | "a": 1.0 56 | }, 57 | { 58 | "r": 0.0, 59 | "g": 0.0, 60 | "b": 1.0, 61 | "a": 1.0 62 | }, 63 | { 64 | "r": 0.5137255, 65 | "g": 0.0, 66 | "b": 1.0, 67 | "a": 1.0 68 | }, 69 | { 70 | "r": 1.0, 71 | "g": 0.0, 72 | "b": 1.0, 73 | "a": 1.0 74 | }, 75 | { 76 | "r": 1.0, 77 | "g": 1.0, 78 | "b": 1.0, 79 | "a": 1.0 80 | }, 81 | { 82 | "r": 0.5, 83 | "g": 0.5, 84 | "b": 0.5, 85 | "a": 1.0 86 | }, 87 | { 88 | "r": 0.235294119, 89 | "g": 0.235294119, 90 | "b": 0.235294119, 91 | "a": 1.0 92 | } 93 | ] 94 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/BeaconColorPicker.cs: -------------------------------------------------------------------------------- 1 | using Common.Utility; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using UnityEngine; 7 | using UnityEngine.UI; 8 | 9 | namespace CustomBeacons 10 | { 11 | class BeaconColorPicker : Picker 12 | { 13 | private PingInstance target; 14 | 15 | private void Awake() 16 | { 17 | rectTransform = transform as RectTransform; 18 | } 19 | 20 | public void Initialize(PingInstance target) 21 | { 22 | base.Initialize(); 23 | 24 | this.target = target; 25 | 26 | var sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("Circle.png"), new Vector2(0.5f, 0.5f)); 27 | for (int i = 0; i < buttons.Count; ++i) 28 | { 29 | var button = buttons[i]; 30 | button.Initialize(i, CustomPings.GetColor(i), i == target.colorIndex, sprite); 31 | } 32 | 33 | onSelect = OnSelect; 34 | } 35 | 36 | public void OnSelect(int index) 37 | { 38 | target.SetColor(index); 39 | Close(); 40 | } 41 | 42 | public override void Open() 43 | { 44 | base.Open(); 45 | int buttonPage = target.colorIndex / ButtonsPerPage; 46 | ShowPage(buttonPage); 47 | } 48 | 49 | 50 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////// 51 | public static BeaconColorPicker Create(Transform parent) 52 | { 53 | var beaconColorPicker = new GameObject("BeaconColorPicker", typeof(RectTransform)).AddComponent(); 54 | 55 | beaconColorPicker.ButtonSize = 50; 56 | beaconColorPicker.Spacing = 50; 57 | beaconColorPicker.ButtonsPerPage = 20; 58 | beaconColorPicker.ButtonsPerRow = 10; 59 | 60 | Picker.Create(parent, beaconColorPicker, PingManager.colorOptions.Length); 61 | 62 | return beaconColorPicker; 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CustomBeacons 4 | { 5 | [Serializable] 6 | class Config 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CustomBeacons 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[CustomBeacons] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[CustomBeacons:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | namespace CustomBeacons 2 | { 3 | // QMods by qwiso https://github.com/Qwiso/QModManager 4 | public static class QPatch 5 | { 6 | public static void Patch() 7 | { 8 | Mod.Patch("QMods/CustomBeacons"); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/PingInstanceSaver.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using Oculus.Newtonsoft.Json; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Text; 8 | using UnityEngine; 9 | 10 | namespace CustomBeacons 11 | { 12 | [Serializable] 13 | class PingInstanceSaveData 14 | { 15 | public int PingType = 0; 16 | } 17 | 18 | class PingInstanceSaver : MonoBehaviour, IProtoEventListener 19 | { 20 | private PingInstance ping; 21 | private string id; 22 | 23 | private void Awake() 24 | { 25 | ping = GetComponent(); 26 | var uniqueIdentifier = GetComponent(); 27 | if (uniqueIdentifier != null) 28 | { 29 | id = uniqueIdentifier.Id; 30 | } 31 | else if (gameObject.name == "EscapePod") 32 | { 33 | id = "EscapePod"; 34 | } 35 | else 36 | { 37 | Logger.Error("Created a PingInstance with no uniqueIdentifier (" + gameObject.name + ")"); 38 | Destroy(this); 39 | } 40 | } 41 | 42 | private string GetSaveDataPath() 43 | { 44 | var saveFile = Path.Combine("CustomBeacons", id + ".json"); 45 | return saveFile; 46 | } 47 | 48 | private PingInstanceSaveData CreateSaveData() 49 | { 50 | var saveData = new PingInstanceSaveData { 51 | PingType = (int)ping.pingType 52 | }; 53 | 54 | return saveData; 55 | } 56 | 57 | public void OnProtoSerialize(ProtobufSerializer serializer) 58 | { 59 | var userStorage = PlatformUtils.main.GetUserStorage(); 60 | userStorage.CreateContainerAsync(Path.Combine(SaveLoadManager.main.GetCurrentSlot(), "CustomBeacons")); 61 | 62 | var saveDataFile = GetSaveDataPath(); 63 | var saveData = CreateSaveData(); 64 | ModUtils.Save(saveData, saveDataFile); 65 | } 66 | 67 | public void OnProtoDeserialize(ProtobufSerializer serializer) 68 | { 69 | var saveDataFile = GetSaveDataPath(); 70 | ModUtils.LoadSaveData(saveDataFile, OnLoadSaveData); 71 | } 72 | 73 | private void OnLoadSaveData(PingInstanceSaveData saveData) 74 | { 75 | if (ping != null && saveData != null) 76 | { 77 | ping.pingType = (PingType)saveData.PingType; 78 | PingManager.NotifyColor(ping); 79 | PingManager.NotifyVisible(ping); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MoreQuickSlots")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomPings/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "CustomBeacons", 3 | "DisplayName": "CustomBeacons", 4 | "Author": "RandyKnapp", 5 | "Version": "1.1.2", 6 | "Requires": [ "0Harmony.dll" ], 7 | "Enable": true, 8 | "AssemblyName": "CustomBeacons.dll", 9 | "EntryMethod": "CustomBeacons.QPatch.Patch", 10 | "Config": { 11 | } 12 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomizedStorage/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace CustomizedStorage 5 | { 6 | [Serializable] 7 | class Size : IComparable 8 | { 9 | public int width; 10 | public int height; 11 | 12 | public Size(int w, int h) 13 | { 14 | width = w; 15 | height = h; 16 | } 17 | 18 | public int CompareTo(object otherObj) 19 | { 20 | Size other = otherObj as Size; 21 | if (width < other.width || height < other.height) 22 | { 23 | return -1; 24 | } 25 | else if (width > other.width || height > other.height) 26 | { 27 | return 1; 28 | } 29 | return 0; 30 | } 31 | 32 | public override string ToString() 33 | { 34 | return "(" + width + ", " + height + ")"; 35 | } 36 | } 37 | 38 | [Serializable] 39 | class ExosuitConfig 40 | { 41 | public int width = 6; 42 | public int baseHeight = 4; 43 | public int heightPerStorageModule = 1; 44 | } 45 | 46 | [Serializable] 47 | class FiltrationMachineConfig 48 | { 49 | public int width = 2; 50 | public int height = 2; 51 | public int maxSalt = 2; 52 | public int maxWater = 2; 53 | } 54 | 55 | [Serializable] 56 | class Config 57 | { 58 | public Size Inventory = new Size(6, 8); 59 | public Size SmallLocker = new Size(5, 6); 60 | public Size Locker = new Size(6, 8); 61 | public Size EscapePodLocker = new Size(4, 8); 62 | public Size CyclopsLocker = new Size(3, 6); 63 | public Size WaterproofLocker = new Size(4, 4); 64 | public Size CarryAll = new Size(3, 3); 65 | public ExosuitConfig Exosuit = new ExosuitConfig(); 66 | public Size SeamothStorage = new Size(4, 4); 67 | public Size BioReactor = new Size(4, 4); 68 | public FiltrationMachineConfig FiltrationMachine = new FiltrationMachineConfig(); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomizedStorage/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CustomizedStorage 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[CustomizedStorage] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[CustomizedStorage:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomizedStorage/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | namespace CustomizedStorage 2 | { 3 | // QMods by qwiso https://github.com/Qwiso/QModManager 4 | public static class QPatch 5 | { 6 | public static void Patch() 7 | { 8 | Mod.Patch("QMods/CustomizedStorage"); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomizedStorage/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MoreQuickSlots")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomizedStorage/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "Inventory": { 3 | "width": 6, 4 | "height": 8 5 | }, 6 | "SmallLocker": { 7 | "width": 5, 8 | "height": 6 9 | }, 10 | "Locker": { 11 | "width": 6, 12 | "height": 8 13 | }, 14 | "EscapePodLocker": { 15 | "width": 4, 16 | "height": 8 17 | }, 18 | "CyclopsLocker": { 19 | "width": 3, 20 | "height": 6 21 | }, 22 | "WaterproofLocker": { 23 | "width": 4, 24 | "height": 4 25 | }, 26 | "CarryAll": { 27 | "width": 3, 28 | "height": 3 29 | }, 30 | "Exosuit": { 31 | "width": 6, 32 | "baseHeight": 4, 33 | "heightPerStorageModule": 1 34 | }, 35 | "SeamothStorage": { 36 | "width": 6, 37 | "height": 6 38 | }, 39 | "BioReactor": { 40 | "width": 4, 41 | "height": 4 42 | }, 43 | "FiltrationMachine": { 44 | "width": 4, 45 | "height": 4, 46 | "maxSalt": 8, 47 | "maxWater": 8 48 | } 49 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/CustomizedStorage/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "CustomizedStorage", 3 | "DisplayName": "CustomizedStorage", 4 | "Author": "RandyKnapp", 5 | "Version": "1.0.4", 6 | "Requires": [ "0Harmony-1.2.0.1.dll" ], 7 | "Enable": true, 8 | "AssemblyName": "CustomizedStorage.dll", 9 | "EntryMethod": "CustomizedStorage.QPatch.Patch" 10 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/Assets/CheckboxChecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/DockedVehicleStorageAccess/Assets/CheckboxChecked.png -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/Assets/CheckboxUnchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/DockedVehicleStorageAccess/Assets/CheckboxUnchecked.png -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/Assets/Exosuit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/DockedVehicleStorageAccess/Assets/Exosuit.png -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/Assets/LockerScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/DockedVehicleStorageAccess/Assets/LockerScreen.png -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/Assets/Receptacle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/DockedVehicleStorageAccess/Assets/Receptacle.png -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/Assets/Seamoth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/DockedVehicleStorageAccess/Assets/Seamoth.png -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/Assets/StorageAccess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/DockedVehicleStorageAccess/Assets/StorageAccess.png -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/Config.cs: -------------------------------------------------------------------------------- 1 | using Oculus.Newtonsoft.Json; 2 | 3 | namespace DockedVehicleStorageAccess 4 | { 5 | [JsonObject] 6 | internal class Config 7 | { 8 | public int LockerWidth { get; set; } = 6; 9 | public int LockerHeight { get; set; } = 8; 10 | public float CheckVehiclesInterval { get; set; } = 2.0f; 11 | public float ExtractInterval { get; set; } = 0.25f; 12 | public float AutosortTransferInterval { get; set; } = 0.25f; 13 | 14 | [JsonIgnore] 15 | internal bool UseAutosortMod { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace DockedVehicleStorageAccess 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[DockedVehicleStorageAccessSML] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[DockedVehicleStorageAccessSML:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/Mod.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using Common.Mod; 4 | using Harmony; 5 | using QModManager.API; 6 | 7 | namespace DockedVehicleStorageAccess 8 | { 9 | internal static class Mod 10 | { 11 | public static Config config; 12 | 13 | private static string modDirectory; 14 | 15 | public static void Patch(string modDirectory = null) 16 | { 17 | Logger.Log("Starting patching"); 18 | 19 | Mod.modDirectory = modDirectory ?? "Subnautica_Data/Managed"; 20 | LoadConfig(); 21 | 22 | AddBuildables(); 23 | 24 | HarmonyInstance harmony = HarmonyInstance.Create("com.DockedVehicleStorageAccessSML.mod"); 25 | harmony.PatchAll(Assembly.GetExecutingAssembly()); 26 | 27 | Logger.Log("Patched"); 28 | } 29 | 30 | public static void AddBuildables() 31 | { 32 | VehicleStorageAccess.AddBuildable(); 33 | } 34 | 35 | public static string GetModPath() 36 | { 37 | return Environment.CurrentDirectory + "/" + modDirectory; 38 | } 39 | 40 | public static string GetAssetPath(string filename) 41 | { 42 | return GetModPath() + "/Assets/" + filename; 43 | } 44 | 45 | private static void LoadConfig() 46 | { 47 | config = ModUtils.LoadConfig(GetModPath() + "/config.json"); 48 | config.UseAutosortMod = QModServices.Main.ModPresent("AutosortLockersSML"); 49 | 50 | if (config.UseAutosortMod) 51 | Logger.Log("AutosortLockersSML detected. Cross-mod features enabled."); 52 | else 53 | Logger.Log("Running in standalone mode."); 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | using QModManager.API.ModLoading; 2 | 3 | namespace DockedVehicleStorageAccess 4 | { 5 | // https://github.com/Qwiso/QModManager 6 | [QModCore] 7 | public static class QPatch 8 | { 9 | [QModPatch] 10 | public static void Patch() 11 | { 12 | Mod.Patch("QMods/DockedVehicleStorageAccessSML"); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("DockedVehicleStorageAccessSML")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("DockedVehicleStorageAccessSML")] 12 | [assembly: AssemblyCopyright("Copyright © 2020")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("2.0.0.0")] 35 | [assembly: AssemblyFileVersion("2.0.0.0")] 36 | -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/SaveData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace DockedVehicleStorageAccess 7 | { 8 | [Serializable] 9 | public class SaveDataEntry 10 | { 11 | public string Id; 12 | } 13 | 14 | [Serializable] 15 | public class SaveData 16 | { 17 | public List Entries = new List(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SubnauticaModSystem/DockedVehicleStorageAccess/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "DockedVehicleStorageAccessSML", 3 | "DisplayName": "Docked Vehicle Storage Access", 4 | "Author": "RandyKnapp w/PrimeSonic", 5 | "Version": "2.0.0", 6 | "Requires": [ "SMLHelper" ], 7 | "Enable": true, 8 | "AssemblyName": "DockedVehicleStorageAccessSML.dll" 9 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Assets/Background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/HabitatControlPanel/Assets/Background.png -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Assets/BlueprintIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/HabitatControlPanel/Assets/BlueprintIcon.png -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Assets/CheckboxChecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/HabitatControlPanel/Assets/CheckboxChecked.png -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Assets/CheckboxUnchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/HabitatControlPanel/Assets/CheckboxUnchecked.png -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Assets/Circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/HabitatControlPanel/Assets/Circle.png -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Assets/Left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/HabitatControlPanel/Assets/Left.png -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Assets/PickerBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/HabitatControlPanel/Assets/PickerBackground.png -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Assets/Right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/HabitatControlPanel/Assets/Right.png -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Assets/Scrim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/HabitatControlPanel/Assets/Scrim.png -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Assets/SelectorHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/HabitatControlPanel/Assets/SelectorHover.png -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Assets/SelectorSelected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/HabitatControlPanel/Assets/SelectorSelected.png -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Assets/SmallBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/HabitatControlPanel/Assets/SmallBackground.png -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/BeaconColorPicker.cs: -------------------------------------------------------------------------------- 1 | using Common.Utility; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using UnityEngine; 7 | using UnityEngine.UI; 8 | 9 | namespace HabitatControlPanel 10 | { 11 | class BeaconColorPicker : Picker 12 | { 13 | private HabitatControlPanel target; 14 | 15 | private void Awake() 16 | { 17 | rectTransform = transform as RectTransform; 18 | } 19 | 20 | public void Initialize(HabitatControlPanel target, int initialIndex) 21 | { 22 | base.Initialize(); 23 | 24 | this.target = target; 25 | 26 | var sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("Circle.png"), new Vector2(0.5f, 0.5f)); 27 | for (int i = 0; i < buttons.Count; ++i) 28 | { 29 | var button = buttons[i]; 30 | button.Initialize(i, PingManager.colorOptions[i], i == initialIndex, sprite); 31 | } 32 | 33 | onSelect += OnSelect; 34 | } 35 | 36 | public void OnSelect(int index) 37 | { 38 | target.BeaconColorIndex = index; 39 | target.CloseSubmenu(); 40 | } 41 | 42 | 43 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////// 44 | public static BeaconColorPicker Create(Transform parent) 45 | { 46 | var beaconColorPicker = new GameObject("BeaconColorPicker", typeof(RectTransform)).AddComponent(); 47 | 48 | Picker.Create(parent, beaconColorPicker, PingManager.colorOptions.Length); 49 | 50 | return beaconColorPicker; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/BeaconColorSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | using UnityEngine.EventSystems; 7 | using UnityEngine.UI; 8 | 9 | namespace HabitatControlPanel 10 | { 11 | class BeaconColorSettings : MonoBehaviour 12 | { 13 | private bool hasPower = false; 14 | 15 | public RectTransform rectTransform; 16 | public Action onClick = delegate { }; 17 | 18 | [SerializeField] 19 | private HabitatControlPanel target; 20 | [SerializeField] 21 | private ColoredIconButton activeButton; 22 | 23 | private void Awake() 24 | { 25 | rectTransform = transform as RectTransform; 26 | } 27 | 28 | private void Initialize(HabitatControlPanel controlPanel, Text textPrefab) 29 | { 30 | target = controlPanel; 31 | 32 | activeButton = ColoredIconButton.Create(transform, HabitatControlPanel.ScreenContentColor, textPrefab, "Beacon Color", 100, 15); 33 | activeButton.text.supportRichText = true; 34 | } 35 | 36 | internal void SetInitialValue(int colorIndex) 37 | { 38 | SetColor(colorIndex); 39 | activeButton.onClick += OnClick; 40 | } 41 | 42 | internal void SetColor(int colorIndex) 43 | { 44 | var color = PingManager.colorOptions[colorIndex]; 45 | activeButton.Initialize("Circle.png", color); 46 | } 47 | 48 | private void OnClick() 49 | { 50 | onClick(); 51 | } 52 | 53 | private void Update() 54 | { 55 | if (Mod.config.RequireBatteryToUse) 56 | { 57 | hasPower = target != null && target.GetPower() > 0; 58 | activeButton.isEnabled = hasPower; 59 | } 60 | } 61 | 62 | 63 | /////////////////////////////////////////////////////////////////////////////////////////// 64 | public static BeaconColorSettings Create(HabitatControlPanel controlPanel, Transform parent) 65 | { 66 | var lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); 67 | var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); 68 | textPrefab.fontSize = 12; 69 | textPrefab.color = HabitatControlPanel.ScreenContentColor; 70 | 71 | var beaconController = new GameObject("BeaconColorSettings", typeof(RectTransform)).AddComponent(); 72 | var rt = beaconController.gameObject.transform as RectTransform; 73 | RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); 74 | beaconController.Initialize(controlPanel, textPrefab); 75 | 76 | return beaconController; 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/BeaconIconPicker.cs: -------------------------------------------------------------------------------- 1 | using Common.Utility; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using UnityEngine; 7 | using UnityEngine.UI; 8 | 9 | namespace HabitatControlPanel 10 | { 11 | class BeaconIconPicker : Picker 12 | { 13 | private HabitatControlPanel target; 14 | 15 | private void Awake() 16 | { 17 | rectTransform = transform as RectTransform; 18 | } 19 | 20 | public void Initialize(HabitatControlPanel target, PingType initialType) 21 | { 22 | base.Initialize(); 23 | 24 | this.target = target; 25 | 26 | var names = Enum.GetNames(typeof(PingType)); 27 | var values = (PingType[])Enum.GetValues(typeof(PingType)); 28 | var color = PingManager.colorOptions[target.BeaconColorIndex]; 29 | int initialPage = 0; 30 | for (int i = 0; i < buttons.Count; ++i) 31 | { 32 | var button = buttons[i]; 33 | var name = names[i + 1]; 34 | var value = values[i + 1]; 35 | var sprite = SpriteManager.Get(SpriteManager.Group.Pings, name); 36 | button.Initialize((int)value, color, value == initialType, sprite); 37 | 38 | if (value == initialType) 39 | { 40 | initialPage = i / ButtonsPerPage; 41 | } 42 | } 43 | 44 | onSelect = OnSelect; 45 | ShowPage(initialPage); 46 | } 47 | 48 | public void OnSelect(int index) 49 | { 50 | target.BeaconPingType = (PingType)index; 51 | target.CloseSubmenu(); 52 | } 53 | 54 | 55 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////// 56 | public static BeaconIconPicker Create(Transform parent) 57 | { 58 | var beaconIconPicker = new GameObject("BeaconIconPicker", typeof(RectTransform)).AddComponent(); 59 | 60 | var count = Enum.GetNames(typeof(PingType)).Length - 1; 61 | Picker.Create(parent, beaconIconPicker, count); 62 | 63 | return beaconIconPicker; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/BeaconIconSettings.cs: -------------------------------------------------------------------------------- 1 | using Common.Utility; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using UnityEngine; 7 | using UnityEngine.EventSystems; 8 | using UnityEngine.UI; 9 | 10 | namespace HabitatControlPanel 11 | { 12 | class BeaconIconSettings : MonoBehaviour 13 | { 14 | private bool hasPower = false; 15 | 16 | public RectTransform rectTransform; 17 | public Action onClick = delegate { }; 18 | 19 | [SerializeField] 20 | private HabitatControlPanel target; 21 | [SerializeField] 22 | private uGUI_ColoredIconButton activeButton; 23 | 24 | private void Awake() 25 | { 26 | rectTransform = transform as RectTransform; 27 | } 28 | 29 | private void Initialize(HabitatControlPanel controlPanel, Text textPrefab) 30 | { 31 | target = controlPanel; 32 | 33 | activeButton = uGUI_ColoredIconButton.Create(transform, HabitatControlPanel.ScreenContentColor, textPrefab, "Beacon Icon", 100, 15); 34 | activeButton.text.supportRichText = true; 35 | } 36 | 37 | internal void SetInitialValue(PingType type, int colorIndex) 38 | { 39 | SetValue(type, colorIndex); 40 | activeButton.onClick += OnClick; 41 | } 42 | 43 | internal void SetValue(PingType type, int colorIndex) 44 | { 45 | var color = PingManager.colorOptions[colorIndex]; 46 | 47 | var spriteName = Enum.GetName(typeof(PingType), type); 48 | var sprite = SpriteManager.Get(SpriteManager.Group.Pings, spriteName); 49 | activeButton.Initialize(sprite, color); 50 | } 51 | 52 | private void OnClick() 53 | { 54 | onClick(); 55 | } 56 | 57 | private void Update() 58 | { 59 | if (Mod.config.RequireBatteryToUse) 60 | { 61 | hasPower = target != null && target.GetPower() > 0; 62 | activeButton.isEnabled = hasPower; 63 | } 64 | } 65 | 66 | 67 | /////////////////////////////////////////////////////////////////////////////////////////// 68 | public static BeaconIconSettings Create(HabitatControlPanel controlPanel, Transform parent) 69 | { 70 | var lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); 71 | var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); 72 | textPrefab.fontSize = 12; 73 | textPrefab.color = HabitatControlPanel.ScreenContentColor; 74 | 75 | var beaconController = new GameObject("BeaconIconSettings", typeof(RectTransform)).AddComponent(); 76 | var rt = beaconController.gameObject.transform as RectTransform; 77 | RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); 78 | beaconController.Initialize(controlPanel, textPrefab); 79 | 80 | return beaconController; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Config.cs: -------------------------------------------------------------------------------- 1 | using Oculus.Newtonsoft.Json; 2 | 3 | namespace HabitatControlPanel 4 | { 5 | [JsonObject] 6 | public class Config 7 | { 8 | [JsonProperty] 9 | public bool RequireBatteryToUse { get; set; } = false; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/HabitatColorPicker.cs: -------------------------------------------------------------------------------- 1 | using Common.Utility; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using UnityEngine; 7 | using UnityEngine.UI; 8 | 9 | namespace HabitatControlPanel 10 | { 11 | class HabitatColorPicker : Picker 12 | { 13 | private static readonly List Colors = new List() { 14 | Color.white, Color.red, new Color32(255, 165, 0, 255), Color.yellow, Color.green, 15 | Color.cyan, Color.blue, new Color32(131, 0, 255, 255), Color.magenta, Color.gray 16 | }; 17 | 18 | private HabitatControlPanel target; 19 | 20 | public Action onColorSelect = delegate { }; 21 | 22 | private void Awake() 23 | { 24 | rectTransform = transform as RectTransform; 25 | } 26 | 27 | public void Initialize(HabitatControlPanel target, Color initialColor) 28 | { 29 | base.Initialize(); 30 | 31 | this.target = target; 32 | 33 | var sprite = ImageUtils.LoadSprite(Mod.GetAssetPath("Circle.png"), new Vector2(0.5f, 0.5f)); 34 | for (int i = 0; i < buttons.Count; ++i) 35 | { 36 | var button = buttons[i]; 37 | button.Initialize(i, Colors[i], Colors[i] == initialColor, sprite); 38 | } 39 | 40 | onSelect = OnSelect; 41 | } 42 | 43 | public void OnSelect(int index) 44 | { 45 | onColorSelect(Colors[index]); 46 | target.CloseSubmenu(); 47 | } 48 | 49 | 50 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////// 51 | public static HabitatColorPicker Create(Transform parent) 52 | { 53 | var habitatColorPicker = new GameObject("HabitatColorPicker", typeof(RectTransform)).AddComponent(); 54 | 55 | Picker.Create(parent, habitatColorPicker, Colors.Count); 56 | 57 | return habitatColorPicker; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/HabitatColorSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | using UnityEngine.EventSystems; 7 | using UnityEngine.UI; 8 | 9 | namespace HabitatControlPanel 10 | { 11 | class HabitatColorSettings : MonoBehaviour 12 | { 13 | private bool hasPower = false; 14 | 15 | public RectTransform rectTransform; 16 | public Action onClick = delegate { }; 17 | 18 | [SerializeField] 19 | private HabitatControlPanel target; 20 | [SerializeField] 21 | private ColoredIconButton activeButton; 22 | 23 | private void Awake() 24 | { 25 | rectTransform = transform as RectTransform; 26 | } 27 | 28 | private void Initialize(HabitatControlPanel controlPanel, Text textPrefab, string label) 29 | { 30 | target = controlPanel; 31 | 32 | activeButton = ColoredIconButton.Create(transform, HabitatControlPanel.ScreenContentColor, textPrefab, label, 150, 15); 33 | activeButton.text.supportRichText = true; 34 | } 35 | 36 | internal void SetInitialValue(Color color) 37 | { 38 | SetColor(color); 39 | activeButton.onClick += OnClick; 40 | } 41 | 42 | internal void SetColor(Color color) 43 | { 44 | activeButton.Initialize("Circle.png", color); 45 | } 46 | 47 | private void OnClick() 48 | { 49 | onClick(); 50 | } 51 | 52 | private void Update() 53 | { 54 | if (Mod.config.RequireBatteryToUse) 55 | { 56 | hasPower = target != null && target.GetPower() > 0; 57 | activeButton.isEnabled = hasPower; 58 | } 59 | } 60 | 61 | 62 | /////////////////////////////////////////////////////////////////////////////////////////// 63 | public static HabitatColorSettings Create(HabitatControlPanel controlPanel, Transform parent, string label) 64 | { 65 | var lockerPrefab = Resources.Load("Submarine/Build/SmallLocker"); 66 | var textPrefab = Instantiate(lockerPrefab.GetComponentInChildren()); 67 | textPrefab.fontSize = 12; 68 | textPrefab.color = HabitatControlPanel.ScreenContentColor; 69 | 70 | var habitatColorSettings = new GameObject("HabitatColorSettings", typeof(RectTransform)).AddComponent(); 71 | var rt = habitatColorSettings.gameObject.transform as RectTransform; 72 | RectTransformExtensions.SetParams(rt, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); 73 | habitatColorSettings.Initialize(controlPanel, textPrefab, label); 74 | 75 | return habitatColorSettings; 76 | } 77 | 78 | internal void SetInitialValue(object interiorColor) 79 | { 80 | throw new NotImplementedException(); 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HabitatControlPanel 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[HabitatControlPanelSML] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[HabitatControlPanelSML:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Mod.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using Harmony; 3 | using System; 4 | using System.Reflection; 5 | 6 | namespace HabitatControlPanel 7 | { 8 | public enum CustomTechType 9 | { 10 | HabitatControlPanel = 11120 11 | } 12 | 13 | static class Mod 14 | { 15 | public const string SaveDataFilename = "HabitatControlPanelSaveData.json"; 16 | public static Config config; 17 | 18 | private static string modDirectory; 19 | 20 | public static void Patch(string modDirectory = null) 21 | { 22 | Mod.modDirectory = modDirectory ?? "Subnautica_Data/Managed"; 23 | LoadConfig(); 24 | 25 | AddBuildables(); 26 | 27 | HarmonyInstance harmony = HarmonyInstance.Create("com.HabitatControlPanelSML.mod"); 28 | harmony.PatchAll(Assembly.GetExecutingAssembly()); 29 | ProtobufSerializerPatcher.Patch(harmony); 30 | 31 | Logger.Log("Patched"); 32 | } 33 | 34 | public static void AddBuildables() 35 | { 36 | HabitatControlPanel.AddBuildable(); 37 | } 38 | 39 | public static string GetModPath() 40 | { 41 | return Environment.CurrentDirectory + "/" + modDirectory; 42 | } 43 | 44 | public static string GetAssetPath(string filename) 45 | { 46 | return GetModPath() + "/Assets/" + filename; 47 | } 48 | 49 | private static void LoadConfig() 50 | { 51 | config = ModUtils.LoadConfig(GetModPath() + "/config.json"); 52 | ValidateConfig(); 53 | } 54 | 55 | private static void ValidateConfig() 56 | { 57 | Config defaultConfig = new Config(); 58 | if (config == null) 59 | { 60 | config = defaultConfig; 61 | return; 62 | } 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | using QModManager.API.ModLoading; 2 | 3 | namespace HabitatControlPanel 4 | { 5 | [QModCore] 6 | public static class QPatch 7 | { 8 | [QModPatch] 9 | public static void Patch() 10 | { 11 | Mod.Patch("QMods/HabitatControlPanelSML"); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Patches/Ping_Patches.cs: -------------------------------------------------------------------------------- 1 | using Harmony; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Reflection; 5 | 6 | namespace HabitatControlPanel.Patches 7 | { 8 | [HarmonyPatch(typeof(uGUI_Pings))] 9 | [HarmonyPatch("OnWillRenderCanvases")] 10 | internal class uGUI_Pings_OnWillRenderCanvases_Patch 11 | { 12 | private static readonly FieldInfo uGUI_Pings_pings = typeof(uGUI_Pings).GetField("pings", BindingFlags.NonPublic | BindingFlags.Instance); 13 | 14 | private static uGUI_Pings staticInstance; 15 | private static Dictionary pings; 16 | 17 | [HarmonyPostfix] 18 | private static void Postfix(uGUI_Pings __instance) 19 | { 20 | if (staticInstance != __instance) 21 | { 22 | staticInstance = __instance; 23 | pings = (Dictionary)uGUI_Pings_pings.GetValue(__instance); 24 | } 25 | 26 | foreach (var entry in pings) 27 | { 28 | var ping = PingManager.Get(entry.Key); 29 | var guiPing = entry.Value; 30 | 31 | if (ping.colorIndex >= 0 && ping.colorIndex < PingManager.colorOptions.Length) 32 | { 33 | guiPing.SetColor(PingManager.colorOptions[ping.colorIndex]); 34 | } 35 | 36 | var sprite = SpriteManager.Get(SpriteManager.Group.Pings, Enum.GetName(typeof(PingType), ping.pingType)); 37 | guiPing.SetIcon(sprite); 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("HabitatControlPanelSML")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("HabitatControlPanel")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("2.0.0.0")] 36 | [assembly: AssemblyFileVersion("2.0.0.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/Secret/SecretButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | using UnityEngine.EventSystems; 7 | using UnityEngine.UI; 8 | 9 | namespace HabitatControlPanel.Secret 10 | { 11 | class SecretButton : MonoBehaviour, IPointerClickHandler 12 | { 13 | public Action onActivate = delegate { }; 14 | 15 | public void OnPointerClick(PointerEventData eventData) 16 | { 17 | onActivate(); 18 | } 19 | 20 | 21 | 22 | public static SecretButton Create(Transform parent) 23 | { 24 | var button = new GameObject("SecretButton", typeof(RectTransform)).AddComponent(); 25 | RectTransformExtensions.SetParams(button.transform as RectTransform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), parent); 26 | RectTransformExtensions.SetSize(button.transform as RectTransform, 15, 15); 27 | 28 | var image = button.gameObject.AddComponent(); 29 | image.color = new Color(0, 0, 0, 0.0001f); 30 | 31 | return button; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/SubmenuCloseButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | using UnityEngine.EventSystems; 7 | 8 | namespace HabitatControlPanel 9 | { 10 | class SubmenuCloseButton : MonoBehaviour, IPointerClickHandler 11 | { 12 | public HabitatControlPanel target; 13 | 14 | public void OnPointerClick(PointerEventData eventData) 15 | { 16 | if (target != null) 17 | { 18 | target.CloseSubmenu(); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HabitatControlPanel/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "HabitatControlPanelSML", 3 | "DisplayName": "HabitatControlPanelSML", 4 | "Author": "RandyKnapp", 5 | "Version": "2.0.0", 6 | "Enable": true, 7 | "AssemblyName": "HabitatControlPanelSML.dll" 8 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/HudConfig/Assets/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "HudElements": [ 3 | { 4 | "Name": "QuickSlots", 5 | }, 6 | { 7 | "Name": "BarsPanel", 8 | }, 9 | { 10 | "Name": "PowerIndicator", 11 | }, 12 | { 13 | "Name": "RadiationWarning" 14 | }, 15 | { 16 | "Name": "UserInput" 17 | }, 18 | { 19 | "Name": "IconNotifications" 20 | }, 21 | { 22 | "Name": "ScannerIcon" 23 | }, 24 | { 25 | "Name": "PopupNotification" 26 | }, 27 | { 28 | "Name": "ErrorMessageCanvas" 29 | }, 30 | { 31 | "Name": "Seamoth", 32 | }, 33 | { 34 | "Name": "Exosuit", 35 | }, 36 | { 37 | "Name": "DepthCompass", 38 | }, 39 | { 40 | "Name": "ItemSelector" 41 | }, 42 | { 43 | "Name": "HandReticle" 44 | }, 45 | { 46 | "Name": "CameraCyclops" 47 | }, 48 | { 49 | "Name": "CameraScannerRoom" 50 | } 51 | ] 52 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/HudConfig/Config.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using System; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace HudConfig 7 | { 8 | [Serializable] 9 | public class ConfigEntry 10 | { 11 | public string Name; 12 | public float Scale = 1; 13 | public float XOffset = 0; 14 | public float YOffset = 0; 15 | } 16 | 17 | [Serializable] 18 | public class Config 19 | { 20 | public List HudElements; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HudConfig/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HudConfig 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[HudConfig] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[HudConfig:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HudConfig/Mod.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using Harmony; 3 | using Oculus.Newtonsoft.Json; 4 | using System; 5 | using System.IO; 6 | using System.Reflection; 7 | 8 | namespace HudConfig 9 | { 10 | static class Mod 11 | { 12 | public static Config config; 13 | 14 | private static string modDirectory; 15 | 16 | public static void Patch(string modDirectory) 17 | { 18 | Mod.modDirectory = modDirectory; 19 | LoadConfig(); 20 | 21 | HarmonyInstance harmony = HarmonyInstance.Create("com.HudConfig.mod"); 22 | harmony.PatchAll(Assembly.GetExecutingAssembly()); 23 | 24 | Logger.Log("Patched"); 25 | } 26 | 27 | public static string GetModPath() 28 | { 29 | return Path.Combine(Environment.CurrentDirectory, modDirectory); 30 | } 31 | 32 | public static string GetAssetPath(string filename) 33 | { 34 | return Path.Combine(Path.Combine(GetModPath(), "Assets"), filename); 35 | } 36 | 37 | private static string GetModInfoPath() 38 | { 39 | return Path.Combine(GetModPath(), "mod.json"); 40 | } 41 | 42 | private static void LoadConfig() 43 | { 44 | var configPath = GetAssetPath("config.json"); 45 | config = JsonConvert.DeserializeObject(File.ReadAllText(configPath)); 46 | if (config == null) 47 | { 48 | config = new Config(); 49 | } 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/HudConfig/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | namespace HudConfig 2 | { 3 | // QMods by qwiso https://github.com/Qwiso/QModManager 4 | public static class QPatch 5 | { 6 | public static void Patch() 7 | { 8 | Mod.Patch("QMods/HudConfig"); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/HudConfig/Patches/HUD_Patches.cs: -------------------------------------------------------------------------------- 1 | using Harmony; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using UnityEngine; 8 | 9 | namespace HudConfig.Patches 10 | { 11 | [HarmonyPatch(typeof(uGUI_SceneHUD))] 12 | [HarmonyPatch("Initialize")] 13 | public static class uGUI_SceneHUD_Initialize_Patch 14 | { 15 | private static readonly FieldInfo SceneHud_initialized = typeof(uGUI_SceneHUD).GetField("_initialized", BindingFlags.NonPublic | BindingFlags.Instance); 16 | 17 | private static bool preInitialized; 18 | private static bool initialized; 19 | 20 | private static bool Prefix(uGUI_SceneHUD __instance) 21 | { 22 | preInitialized = (bool)SceneHud_initialized.GetValue(__instance); 23 | return true; 24 | } 25 | 26 | private static void Postfix(uGUI_SceneHUD __instance) 27 | { 28 | initialized = (bool)SceneHud_initialized.GetValue(__instance); 29 | if (!preInitialized && initialized) 30 | { 31 | Logger.Log("HUD Initialize"); 32 | 33 | var hudContentRoot = __instance.transform.Find("Content"); 34 | if (hudContentRoot == null) 35 | { 36 | Logger.Error("Could not find HUD Content Root!"); 37 | return; 38 | } 39 | 40 | foreach (var entry in Mod.config.HudElements) 41 | { 42 | var element = hudContentRoot.Find(entry.Name) as RectTransform; 43 | if (element == null) 44 | { 45 | Logger.Error($"Could not find HUD element named ({entry.Name})"); 46 | continue; 47 | } 48 | 49 | element.localScale = new Vector3(entry.Scale, entry.Scale); 50 | element.anchoredPosition += new Vector2(entry.XOffset, entry.YOffset); 51 | } 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /SubnauticaModSystem/HudConfig/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "HudConfig", 3 | "DisplayName": "HudConfig", 4 | "Author": "RandyKnapp", 5 | "Version": "1.0.3", 6 | "Requires": [ "0Harmony-1.2.0.1.dll" ], 7 | "Enable": true, 8 | "AssemblyName": "HudConfig.dll", 9 | "EntryMethod": "HudConfig.QPatch.Patch", 10 | "Config": { 11 | } 12 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/LongLockerNames/Assets/color_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/LongLockerNames/Assets/color_down.png -------------------------------------------------------------------------------- /SubnauticaModSystem/LongLockerNames/Assets/color_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/LongLockerNames/Assets/color_up.png -------------------------------------------------------------------------------- /SubnauticaModSystem/LongLockerNames/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace LongLockerNames 5 | { 6 | [Serializable] 7 | class Config 8 | { 9 | public int SmallLockerTextLimit = 60; 10 | public int SignTextLimit = 100; 11 | public bool ColorPickerOnLockers = true; 12 | public bool ExtraColorsOnLockers = true; 13 | public bool ColorPickerOnSigns = true; 14 | public bool ExtraColorsOnSigns = true; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SubnauticaModSystem/LongLockerNames/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace LongLockerNames 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[LongLockerNames] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[LongLockerNames:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/LongLockerNames/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace LongLockerNames 4 | { 5 | // QMods by qwiso https://github.com/Qwiso/QModManager 6 | public static class QPatch 7 | { 8 | public static void Patch() 9 | { 10 | Mod.Patch("QMods/LongLockerNames"); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/LongLockerNames/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MoreQuickSlots")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/LongLockerNames/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "LongLockerNames", 3 | "DisplayName": "LongLockerNames", 4 | "Author": "RandyKnapp", 5 | "Version": "1.1.2", 6 | "Requires": [ "0Harmony-1.2.0.1.dll" ], 7 | "Enable": true, 8 | "AssemblyName": "LongLockerNames.dll", 9 | "EntryMethod": "LongLockerNames.QPatch.Patch", 10 | "Config": { 11 | "SmallLockerTextLimit": 60, 12 | "SignTextLimit": 100, 13 | "ColorPickerOnLockers": true, 14 | "ExtraColorsOnLockers": true, 15 | "ColorPickerOnSigns": true, 16 | "ExtraColorsOnSigns": true 17 | } 18 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/ModInjector_MoreQuickSlots/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SubnauticaModSystem/ModInjector_MoreQuickSlots/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace ModInjector_MoreQuickSlots 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SubnauticaModSystem/ModInjector_MoreQuickSlots/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ModInjector_MoreQuickSlots")] 9 | [assembly: AssemblyDescription("Standalone Injector for MoreQuickSlots Subnautica Mod")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("RandyKnapp")] 12 | [assembly: AssemblyProduct("ModInjector_MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("09868e2d-416a-441c-9d9a-19d791e8fc42")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/ModInjector_MoreQuickSlots/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ModInjector_MoreQuickSlots.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SubnauticaModSystem/ModInjector_MoreQuickSlots/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SubnauticaModSystem/ModInjector_MoreQuickSlots/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/ModInjector_MoreQuickSlots/cross.png -------------------------------------------------------------------------------- /SubnauticaModSystem/ModInjector_MoreQuickSlots/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/ModInjector_MoreQuickSlots/folder.png -------------------------------------------------------------------------------- /SubnauticaModSystem/ModInjector_MoreQuickSlots/inject128.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/ModInjector_MoreQuickSlots/inject128.ico -------------------------------------------------------------------------------- /SubnauticaModSystem/ModInjector_MoreQuickSlots/inject32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/ModInjector_MoreQuickSlots/inject32.ico -------------------------------------------------------------------------------- /SubnauticaModSystem/ModInjector_MoreQuickSlots/inject64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/ModInjector_MoreQuickSlots/inject64.png -------------------------------------------------------------------------------- /SubnauticaModSystem/ModInjector_MoreQuickSlots/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/ModInjector_MoreQuickSlots/tick.png -------------------------------------------------------------------------------- /SubnauticaModSystem/ModInjector_MoreQuickSlots/uninstall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/ModInjector_MoreQuickSlots/uninstall.png -------------------------------------------------------------------------------- /SubnauticaModSystem/MoreQuickSlots/MoreQuickSlots-2.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/MoreQuickSlots/MoreQuickSlots-2.0.zip -------------------------------------------------------------------------------- /SubnauticaModSystem/MoreQuickSlots/Patches/QuickSlots_Ctor_Patch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using System; 3 | using UnityEngine; 4 | 5 | namespace MoreQuickSlots.Patches 6 | { 7 | [HarmonyPatch(typeof(QuickSlots), MethodType.Constructor, new Type[] { typeof(GameObject), typeof(Transform), typeof(Transform), typeof(Inventory), typeof(Transform), typeof(int) })] 8 | public static class QuickSlots_Ctor_Patch 9 | { 10 | [HarmonyPrefix] 11 | public static void Prefix(ref int slotCount, ref string[] ___slotNames) 12 | { 13 | slotCount = MoreQuickSlots.SlotCount.Value; 14 | 15 | var newSlotNames = new string[slotCount]; 16 | for (var i = 0; i < slotCount; ++i) 17 | { 18 | newSlotNames[i] = "QuickSlot" + i; 19 | } 20 | ___slotNames = newSlotNames; 21 | } 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /SubnauticaModSystem/MoreQuickSlots/Patches/uGUI_QuickSlots_Init_Patch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | 3 | namespace MoreQuickSlots.Patches 4 | { 5 | [HarmonyPatch(typeof(uGUI_QuickSlots), nameof(uGUI_QuickSlots.Init))] 6 | public static class uGUI_QuickSlots_Init_Patch 7 | { 8 | public static void Postfix(uGUI_QuickSlots __instance) 9 | { 10 | InstantiateGameController(__instance); 11 | } 12 | 13 | public static void InstantiateGameController(uGUI_QuickSlots instance) 14 | { 15 | var controller = instance.gameObject.GetComponent(); 16 | if (controller == null) 17 | { 18 | controller = instance.gameObject.AddComponent(); 19 | } 20 | controller.AddHotkeyLabels(instance); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SubnauticaModSystem/MoreQuickSlots/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MoreQuickSlots")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.1.8.0")] 36 | [assembly: AssemblyFileVersion("1.1.8.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/PrawnsuitLightswitch/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PrawnsuitLightswitch 4 | { 5 | [Serializable] 6 | class Config 7 | { 8 | public bool PrawnsuitLightsUseEnergy = true; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /SubnauticaModSystem/PrawnsuitLightswitch/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PrawnsuitLightswitch 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[PrawnsuitLightswitch] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[PrawnsuitLightswitch:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/PrawnsuitLightswitch/Mod.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using Harmony; 3 | using System; 4 | using System.Reflection; 5 | 6 | namespace PrawnsuitLightswitch 7 | { 8 | static class Mod 9 | { 10 | public static Config config; 11 | 12 | private static string modDirectory; 13 | 14 | public static void Patch(string modDirectory = null) 15 | { 16 | Mod.modDirectory = modDirectory ?? "Subnautica_Data/Managed"; 17 | LoadConfig(); 18 | 19 | HarmonyInstance harmony = HarmonyInstance.Create("com.PrawnsuitLightswitch.mod"); 20 | harmony.PatchAll(Assembly.GetExecutingAssembly()); 21 | 22 | Logger.Log("Patched"); 23 | } 24 | 25 | public static string GetModPath() 26 | { 27 | return Environment.CurrentDirectory + "/" + modDirectory; 28 | } 29 | 30 | public static string GetAssetPath(string filename) 31 | { 32 | return GetModPath() + "/Assets/" + filename; 33 | } 34 | 35 | private static string GetModInfoPath() 36 | { 37 | return GetModPath() + "/mod.json"; 38 | } 39 | 40 | private static void LoadConfig() 41 | { 42 | config = ModUtils.LoadConfig(GetModInfoPath()); 43 | ValidateConfig(); 44 | } 45 | 46 | private static void ValidateConfig() 47 | { 48 | Config defaultConfig = new Config(); 49 | if (config == null) 50 | { 51 | config = defaultConfig; 52 | return; 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/PrawnsuitLightswitch/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | namespace PrawnsuitLightswitch 2 | { 3 | // QMods by qwiso https://github.com/Qwiso/QModManager 4 | public static class QPatch 5 | { 6 | public static void Patch() 7 | { 8 | Mod.Patch("QMods/PrawnsuitLightswitch"); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/PrawnsuitLightswitch/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MoreQuickSlots")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/PrawnsuitLightswitch/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "PrawnsuitLightswitch", 3 | "DisplayName": "PrawnsuitLightswitch", 4 | "Author": "RandyKnapp", 5 | "Version": "1.0.2", 6 | "Requires": [ "0Harmony-1.2.0.1.dll" ], 7 | "Enable": true, 8 | "AssemblyName": "PrawnsuitLightswitch.dll", 9 | "EntryMethod": "PrawnsuitLightswitch.QPatch.Patch", 10 | "Config": { 11 | "PrawnsuitLightsUseEnergy": true 12 | } 13 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/QuitToDesktop/Configuration/Config.cs: -------------------------------------------------------------------------------- 1 | using SMLHelper.V2.Json; 2 | using SMLHelper.V2.Options.Attributes; 3 | 4 | namespace QuitToDesktop.Configuration 5 | { 6 | [Menu("Quit To Desktop", LoadOn = MenuAttribute.LoadEvents.MenuOpened | MenuAttribute.LoadEvents.MenuRegistered)] 7 | public class Config : ConfigFile 8 | { 9 | [Toggle("Show Confirmation Dialog (restart required)")] 10 | public bool ShowConfirmationDialog = true; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SubnauticaModSystem/QuitToDesktop/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using System; 3 | using System.Reflection; 4 | using QModManager.API.ModLoading; 5 | using SMLHelper.V2.Handlers; 6 | using QuitToDesktop.Configuration; 7 | namespace QuitToDesktop 8 | { 9 | // QMods by qwiso https://github.com/Qwiso/QModManager 10 | [QModCore] 11 | public static class QPatch 12 | { 13 | internal static Config Config { get; private set; } 14 | private static Assembly myAssembly = Assembly.GetExecutingAssembly(); 15 | [QModPatch] 16 | public static void Patch() 17 | { 18 | Config = OptionsPanelHandler.RegisterModOptions(); 19 | IngameMenuHandler.RegisterOnSaveEvent(Config.Save); 20 | 21 | Harmony.CreateAndPatchAll(myAssembly, "com.QuitToDesktop.mod"); 22 | 23 | Console.WriteLine("[QuitToDesktop] Patched"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SubnauticaModSystem/QuitToDesktop/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MoreQuickSlots")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.4.0")] 36 | [assembly: AssemblyFileVersion("1.0.4.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/QuitToDesktop/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "QuitToDesktop", 3 | "DisplayName": "QuitToDesktop", 4 | "Author": "RandyKnapp - Metious", 5 | "Version": "1.0.4", 6 | "Game": "Subnautica", 7 | "Enable": true, 8 | "AssemblyName": "QuitToDesktop.dll" 9 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/SeaglideMapMod/Config.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SeaglideMapControls 4 | { 5 | [Serializable] 6 | class Config 7 | { 8 | public bool SeaglideMapStartOn = false; 9 | public bool FixScannerToolTextBug = true; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SubnauticaModSystem/SeaglideMapMod/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SeaglideMapControls 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[SeaglideMapControls] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[SeaglideMapControls:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/SeaglideMapMod/Mod.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using Harmony; 3 | using System; 4 | using System.Reflection; 5 | 6 | namespace SeaglideMapControls 7 | { 8 | static class Mod 9 | { 10 | public static Config config; 11 | 12 | private static string modDirectory; 13 | 14 | public static void Patch(string modDirectory = null) 15 | { 16 | Mod.modDirectory = modDirectory ?? "Subnautica_Data/Managed"; 17 | LoadConfig(); 18 | 19 | HarmonyInstance harmony = HarmonyInstance.Create("com.SeaglideMapControls.mod"); 20 | harmony.PatchAll(Assembly.GetExecutingAssembly()); 21 | 22 | Logger.Log("Patched"); 23 | } 24 | 25 | public static string GetModPath() 26 | { 27 | return Environment.CurrentDirectory + "/" + modDirectory; 28 | } 29 | 30 | public static string GetAssetPath(string filename) 31 | { 32 | return GetModPath() + "/Assets/" + filename; 33 | } 34 | 35 | private static string GetModInfoPath() 36 | { 37 | return GetModPath() + "/mod.json"; 38 | } 39 | 40 | private static void LoadConfig() 41 | { 42 | config = ModUtils.LoadConfig(GetModInfoPath()); 43 | ValidateConfig(); 44 | } 45 | 46 | private static void ValidateConfig() 47 | { 48 | Config defaultConfig = new Config(); 49 | if (config == null) 50 | { 51 | config = defaultConfig; 52 | return; 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/SeaglideMapMod/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | namespace SeaglideMapControls 2 | { 3 | // QMods by qwiso https://github.com/Qwiso/QModManager 4 | public static class QPatch 5 | { 6 | public static void Patch() 7 | { 8 | Mod.Patch("QMods/SeaglideMapControls"); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/SeaglideMapMod/Patches/ScannerTool_Patches.cs: -------------------------------------------------------------------------------- 1 | using Harmony; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using UnityEngine; 8 | 9 | namespace SeaglideMapControls.Patches 10 | { 11 | [HarmonyPatch(typeof(ScannerTool))] 12 | [HarmonyPatch("Update")] 13 | class ScannerTool_Update_Patch 14 | { 15 | private static readonly MethodInfo PlayerTool_get_isDrawn = typeof(PlayerTool).GetMethod("get_isDrawn", BindingFlags.NonPublic | BindingFlags.Instance); 16 | private static readonly FieldInfo ScannerTool_idleTimer = typeof(ScannerTool).GetField("idleTimer", BindingFlags.NonPublic | BindingFlags.Instance); 17 | 18 | private static bool Prefix(ScannerTool __instance) 19 | { 20 | if (!Mod.config.FixScannerToolTextBug) 21 | { 22 | return true; 23 | } 24 | 25 | bool isDrawn = (bool)PlayerTool_get_isDrawn.Invoke(__instance, new object[] { }); 26 | if (isDrawn) 27 | { 28 | float idleTimer = (float)ScannerTool_idleTimer.GetValue(__instance); 29 | if (idleTimer > 0f) 30 | { 31 | float newValue = Mathf.Max(0f, idleTimer - Time.deltaTime); 32 | ScannerTool_idleTimer.SetValue(__instance, newValue); 33 | } 34 | } 35 | return false; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /SubnauticaModSystem/SeaglideMapMod/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MoreQuickSlots")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/SeaglideMapMod/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "SeaglideMapControls", 3 | "DisplayName": "SeaglideMapControls", 4 | "Author": "RandyKnapp", 5 | "Version": "1.0.4", 6 | "Requires": [ "0Harmony.dll" ], 7 | "Enable": true, 8 | "AssemblyName": "SeaglideMapControls.dll", 9 | "EntryMethod": "SeaglideMapControls.QPatch.Patch", 10 | "Config": { 11 | "SeaglideMapStartOn": false, 12 | "FixScannerToolTextBug": true 13 | } 14 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/TorpedoImprovements/Assets/Background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/TorpedoImprovements/Assets/Background.png -------------------------------------------------------------------------------- /SubnauticaModSystem/TorpedoImprovements/Assets/Selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RandyKnapp/SubnauticaModSystem/142ee2ed3db896de671cc4ac59845f14246c0d08/SubnauticaModSystem/TorpedoImprovements/Assets/Selected.png -------------------------------------------------------------------------------- /SubnauticaModSystem/TorpedoImprovements/Config.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using System; 3 | using UnityEngine; 4 | 5 | namespace TorpedoImprovements 6 | { 7 | [Serializable] 8 | class Config 9 | { 10 | public float TorpedoShotCooldown = 3; 11 | public int TorpedoStorageWidth = 6; 12 | public int TorpedoStorageHeight = 2; 13 | public int HudXOffset = 200; 14 | public int HudXSpacing = -30; 15 | public int HudYOffset = -480; 16 | public int HudYSpacing = 70; 17 | public float HudBackgroundAlpha = 0.9f; 18 | public float HudIconYOffset = -60; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SubnauticaModSystem/TorpedoImprovements/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace TorpedoImprovements 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[TorpedoImprovements] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[TorpedoImprovements:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/TorpedoImprovements/Mod.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using Harmony; 3 | using Oculus.Newtonsoft.Json; 4 | using System; 5 | using System.IO; 6 | using System.Reflection; 7 | 8 | namespace TorpedoImprovements 9 | { 10 | static class Mod 11 | { 12 | public static Config config; 13 | 14 | private static string modDirectory; 15 | 16 | public static void Patch(string modDirectory) 17 | { 18 | Mod.modDirectory = modDirectory; 19 | LoadConfig(); 20 | 21 | HarmonyInstance harmony = HarmonyInstance.Create("com.TorpedoImprovements.mod"); 22 | harmony.PatchAll(Assembly.GetExecutingAssembly()); 23 | 24 | Logger.Log("Patched"); 25 | } 26 | 27 | public static string GetModPath() 28 | { 29 | return Path.Combine(Environment.CurrentDirectory, modDirectory); 30 | } 31 | 32 | public static string GetAssetPath(string filename) 33 | { 34 | return Path.Combine(Path.Combine(GetModPath(), "Assets"), filename); 35 | } 36 | 37 | private static string GetModInfoPath() 38 | { 39 | return Path.Combine(GetModPath(), "mod.json"); 40 | } 41 | 42 | private static void LoadConfig() 43 | { 44 | config = ModUtils.LoadConfig(GetModInfoPath()); 45 | ValidateConfig(); 46 | } 47 | 48 | private static void ValidateConfig() 49 | { 50 | Config defaultConfig = new Config(); 51 | if (config == null) 52 | { 53 | config = defaultConfig; 54 | return; 55 | } 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/TorpedoImprovements/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | namespace TorpedoImprovements 2 | { 3 | // QMods by qwiso https://github.com/Qwiso/QModManager 4 | public static class QPatch 5 | { 6 | public static void Patch() 7 | { 8 | Mod.Patch("QMods/TorpedoImprovements"); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/TorpedoImprovements/Patches/Exosuit_Patches.cs: -------------------------------------------------------------------------------- 1 | using Harmony; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using UnityEngine; 7 | 8 | namespace TorpedoImprovements.Patches 9 | { 10 | [HarmonyPatch(typeof(Exosuit))] 11 | [HarmonyPatch("Start")] 12 | class Exosuit_Start_Patch 13 | { 14 | private static bool Prefix(Exosuit __instance) 15 | { 16 | return true; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SubnauticaModSystem/TorpedoImprovements/PrimaryTorpedo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace TorpedoImprovements 8 | { 9 | class PrimaryTorpedo : MonoBehaviour 10 | { 11 | public List Types { get; set; } 12 | public TechType PrimaryTorpedoType { get => Types[index]; } 13 | 14 | private int index; 15 | 16 | public void Next() 17 | { 18 | index = (index + 1) % Types.Count; 19 | 20 | var seamoth = GetComponent(); 21 | List torpedoTypes = seamoth.torpedoTypes.ToList(); 22 | torpedoTypes.Sort((a, b) => { 23 | return a.techType == b.techType ? 0 : (a.techType == PrimaryTorpedoType ? -1 : 1); 24 | }); 25 | seamoth.torpedoTypes = torpedoTypes.ToArray(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SubnauticaModSystem/TorpedoImprovements/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "TorpedoImprovements", 3 | "DisplayName": "TorpedoImprovements", 4 | "Author": "RandyKnapp", 5 | "Version": "1.0.5", 6 | "Requires": [ "0Harmony-1.2.0.1.dll" ], 7 | "Enable": true, 8 | "AssemblyName": "TorpedoImprovements.dll", 9 | "EntryMethod": "TorpedoImprovements.QPatch.Patch", 10 | "Config": { 11 | "TorpedoShotCooldown": 3, 12 | "TorpedoStorageWidth": 6, 13 | "TorpedoStorageHeight": 2, 14 | "HudXOffset": 200, 15 | "HudXSpacing": -30, 16 | "HudYOffset": -480, 17 | "HudYSpacing": 70, 18 | "HudBackgroundAlpha": 0.9, 19 | "HudIconYOffset": -60 20 | } 21 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/WhiteLights/Assets/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "Seaglide": { 3 | "r": 1.0, 4 | "g": 1.0, 5 | "b": 1.0, 6 | "a": 1.0 7 | }, 8 | "SeamothLeft": { 9 | "r": 1.0, 10 | "g": 1.0, 11 | "b": 1.0, 12 | "a": 1.0 13 | }, 14 | "SeamothRight": { 15 | "r": 1.0, 16 | "g": 1.0, 17 | "b": 1.0, 18 | "a": 1.0 19 | }, 20 | "PrawnsuitLeft": { 21 | "r": 1.0, 22 | "g": 1.0, 23 | "b": 1.0, 24 | "a": 1.0 25 | }, 26 | "PrawnsuitRight": { 27 | "r": 1.0, 28 | "g": 1.0, 29 | "b": 1.0, 30 | "a": 1.0 31 | } 32 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/WhiteLights/Config.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using System; 3 | using UnityEngine; 4 | 5 | namespace WhiteLights 6 | { 7 | [Serializable] 8 | class Config 9 | { 10 | public SerializableColor Seaglide = Color.white; 11 | public SerializableColor SeamothLeft = Color.white; 12 | public SerializableColor SeamothRight = Color.white; 13 | public SerializableColor PrawnsuitLeft = Color.white; 14 | public SerializableColor PrawnsuitRight = Color.white; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SubnauticaModSystem/WhiteLights/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WhiteLights 4 | { 5 | public static class Logger 6 | { 7 | public static void Log(string message) 8 | { 9 | Console.WriteLine("[WhiteLights] " + message); 10 | } 11 | 12 | public static void Log(string format, params object[] args) 13 | { 14 | Log(string.Format(format, args)); 15 | } 16 | 17 | public static void Error(string message) 18 | { 19 | Console.WriteLine("[WhiteLights:ERROR] " + message); 20 | } 21 | 22 | public static void Error(string format, params object[] args) 23 | { 24 | Error(string.Format(format, args)); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SubnauticaModSystem/WhiteLights/Mod.cs: -------------------------------------------------------------------------------- 1 | using Common.Mod; 2 | using Harmony; 3 | using Oculus.Newtonsoft.Json; 4 | using System; 5 | using System.IO; 6 | using System.Reflection; 7 | 8 | namespace WhiteLights 9 | { 10 | static class Mod 11 | { 12 | public static Config config; 13 | 14 | private static string modDirectory; 15 | 16 | public static void Patch(string modDirectory) 17 | { 18 | Mod.modDirectory = modDirectory; 19 | LoadConfig(); 20 | 21 | HarmonyInstance harmony = HarmonyInstance.Create("com.WhiteLights.mod"); 22 | harmony.PatchAll(Assembly.GetExecutingAssembly()); 23 | 24 | Logger.Log("Patched"); 25 | } 26 | 27 | public static string GetModPath() 28 | { 29 | return Path.Combine(Environment.CurrentDirectory, modDirectory); 30 | } 31 | 32 | public static string GetAssetPath(string filename) 33 | { 34 | return Path.Combine(Path.Combine(GetModPath(), "Assets"), filename); 35 | } 36 | 37 | private static void LoadConfig() 38 | { 39 | var configPath = GetAssetPath("config.json"); 40 | config = JsonConvert.DeserializeObject(File.ReadAllText(configPath)); 41 | if (config == null) 42 | { 43 | config = new Config(); 44 | } 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/WhiteLights/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | namespace WhiteLights 2 | { 3 | // QMods by qwiso https://github.com/Qwiso/QModManager 4 | public static class QPatch 5 | { 6 | public static void Patch() 7 | { 8 | Mod.Patch("QMods/WhiteLights"); 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/WhiteLights/Patches/Exosuit_Patches.cs: -------------------------------------------------------------------------------- 1 | using Harmony; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using UnityEngine; 7 | 8 | namespace WhiteLights.Patches 9 | { 10 | [HarmonyPatch(typeof(Exosuit))] 11 | [HarmonyPatch("Start")] 12 | class Exosuit_Start_Patch 13 | { 14 | private static bool Prefix(Exosuit __instance) 15 | { 16 | var lights = __instance.transform.Find("lights_parent").GetComponentsInChildren(); 17 | foreach (var light in lights) 18 | { 19 | if (light.gameObject.name.Contains("left")) 20 | { 21 | light.color = Mod.config.PrawnsuitLeft.ToColor(); 22 | } 23 | else 24 | { 25 | light.color = Mod.config.PrawnsuitRight.ToColor(); 26 | } 27 | } 28 | return true; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SubnauticaModSystem/WhiteLights/Patches/Seaglide_Patches.cs: -------------------------------------------------------------------------------- 1 | using Harmony; 2 | using UnityEngine; 3 | 4 | namespace WhiteLights.Patches 5 | { 6 | [HarmonyPatch(typeof(Seaglide))] 7 | [HarmonyPatch("Start")] 8 | class Seaglide_Start_Patch 9 | { 10 | private static bool Prefix(Seaglide __instance) 11 | { 12 | var lights = __instance.toggleLights.lightsParent.GetComponentsInChildren(); 13 | foreach (var light in lights) 14 | { 15 | light.color = Mod.config.Seaglide.ToColor(); 16 | } 17 | return true; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SubnauticaModSystem/WhiteLights/Patches/Seamoth_Patches.cs: -------------------------------------------------------------------------------- 1 | using Harmony; 2 | using UnityEngine; 3 | 4 | namespace WhiteLights.Patches 5 | { 6 | [HarmonyPatch(typeof(SeaMoth))] 7 | [HarmonyPatch("Awake")] 8 | class Seamoth_Awake_Patch 9 | { 10 | private static void Postfix(SeaMoth __instance) 11 | { 12 | var lights = __instance.toggleLights.lightsParent.GetComponentsInChildren(); 13 | foreach (var light in lights) 14 | { 15 | if (light.gameObject.name.Contains("left")) 16 | { 17 | light.color = Mod.config.SeamothLeft.ToColor(); 18 | } 19 | else 20 | { 21 | light.color = Mod.config.SeamothRight.ToColor(); 22 | } 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SubnauticaModSystem/WhiteLights/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "WhiteLights", 3 | "DisplayName": "WhiteLights", 4 | "Author": "RandyKnapp", 5 | "Version": "1.0.3", 6 | "Requires": [ "0Harmony-1.2.0.1.dll" ], 7 | "Enable": true, 8 | "AssemblyName": "WhiteLights.dll", 9 | "EntryMethod": "WhiteLights.QPatch.Patch", 10 | "Config": { 11 | } 12 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/readme.txt: -------------------------------------------------------------------------------- 1 | MoreQuickSlots 2 | by RandyKnapp 3 | 4 | // Standalone Injector Instructions: 5 | ////////////////////////////////////////////////////////////////////////// 6 | 1. Extract MoreQuickSlots_Standalone.zip to some location 7 | 2. Copy the contents of Managed to \Subnautica_Data\Managed\ 8 | 3. Run ModInjector_MoreQuickSlots.exe 9 | 4. Make sure the directory in the "Subnautica Directory" field is correct, use the folder button to select a new directory if necessary 10 | 5. Click "Inject" 11 | 6. You should get a message saying that the mod was installed successfully 12 | 7. Run the game 13 | 14 | // QMods Instructions: 15 | ////////////////////////////////////////////////////////////////////////// 16 | 1. Extract MoreQuickSlots_Standalone.zip to some location 17 | 2. Copy the contents of QMods to \QMods\ 18 | 3. Copy 0Harmony.dll to \Subnautica_Data\Managed\ 19 | 4. Run the game 20 | 21 | // Config 22 | ////////////////////////////////////////////////////////////////////////// 23 | 1. Open mod.json in a text editor 24 | 2. Under the "config" object, edit the values as you want 25 | - SlotCount: [Number between 1 and 12] Sets the number of quick slots 26 | - ShowInputText: [Bool] Show or hide the input labels on the quick slots -------------------------------------------------------------------------------- /SubnauticaModSystem/zzzEnableConsole/ModLoaderIntegration.cs: -------------------------------------------------------------------------------- 1 | namespace zzzEnableConsole 2 | { 3 | public static class QPatch 4 | { 5 | public static void Patch() 6 | { 7 | DevConsole.disableConsole = false; 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /SubnauticaModSystem/zzzEnableConsole/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MoreQuickSlots")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("MoreQuickSlots")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("2b390daa-56b9-42d9-bad4-8a47736c0563")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SubnauticaModSystem/zzzEnableConsole/mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "zzzEnableConsole", 3 | "DisplayName": "zzzEnableConsole", 4 | "Author": "RandyKnapp", 5 | "Version": "1.0.0", 6 | "Requires": [], 7 | "Enable": true, 8 | "AssemblyName": "zzzEnableConsole.dll", 9 | "EntryMethod": "zzzEnableConsole.QPatch.Patch", 10 | "Config": {} 11 | } --------------------------------------------------------------------------------