Skip to content

Commit

Permalink
Revert "xde"
Browse files Browse the repository at this point in the history
This reverts commit 4387662.
  • Loading branch information
InvalidArgument3 committed Jun 5, 2024
1 parent 4387662 commit ff063d3
Show file tree
Hide file tree
Showing 16 changed files with 2,884 additions and 0 deletions.
296 changes: 296 additions & 0 deletions TSTSSESCoresAddon/Data/CubeBlocks/CubeBlocks_ShipCoreAssemblies_1.sbc
Original file line number Diff line number Diff line change
@@ -0,0 +1,296 @@
<?xml version="1.0" encoding="utf-8"?>
<Definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CubeBlocks>
<!-- frigate_reactor -->
<Definition xsi:type="MyObjectBuilder_ReactorDefinition">
<Id>
<TypeId>Reactor</TypeId>
<SubtypeId>FrigateCore_Reactor</SubtypeId>
</Id>
<DisplayName>FrigateCore_Reactor</DisplayName>
<Icon>Textures\GUI\Icons\Cubes\nuclear_reactor.dds</Icon>
<Description>FrigateCore_Reactor</Description>
<CubeSize>Large</CubeSize>
<BlockTopology>TriangleMesh</BlockTopology>
<Size x="1" y="1" z="1" />
<ModelOffset x="0" y="0" z="0" />
<Model>Models\Cubes\Large\GeneratorSmall.mwm</Model>
<Components>
<Component Subtype="SteelPlate" Count="50" />
<Component Subtype="Construction" Count="40" />
<Component Subtype="MetalGrid" Count="4" />
<Component Subtype="LargeTube" Count="8" />
<Component Subtype="Reactor" Count="100" />
<Component Subtype="Motor" Count="6" />
<Component Subtype="Computer" Count="25" />
<Component Subtype="SteelPlate" Count="30" />
</Components>
<CriticalComponent Subtype="Computer" Index="0" />
<MountPoints>
<MountPoint Side="Top" StartX="0.15" StartY="0.15" EndX="0.85" EndY="0.85" CouplingTag="FrigateCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Back" StartX="0.15" StartY="0.15" EndX="0.85" EndY="0.85" CouplingTag="FrigateCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Right" StartX="0.3" StartY="0.3" EndX="0.7" EndY="0.7" CouplingTag="FrigateCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Left" StartX="0.3" StartY="0.3" EndX="0.7" EndY="0.7" CouplingTag="FrigateCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Bottom" StartX="0.3" StartY="0.3" EndX="0.7" EndY="0.7" Default="true" CouplingTag="FrigateCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Front" StartX="0.3" StartY="0.3" EndX="0.7" EndY="0.7" CouplingTag="FrigateCoreMount" AllowCouplingWithItself="false"/>
</MountPoints>
<BuildProgressModels>
<Model BuildPercentUpperBound="0.33" File="Models\Cubes\Large\GeneratorSmallConstruction_1.mwm" />
<Model BuildPercentUpperBound="0.66" File="Models\Cubes\Large\GeneratorSmallConstruction_2.mwm" />
<Model BuildPercentUpperBound="1.00" File="Models\Cubes\Large\GeneratorSmallConstruction_3.mwm" />
</BuildProgressModels>
<MirroringY>Z</MirroringY>
<MirroringZ>Y</MirroringZ>
<EdgeType>Light</EdgeType>
<BuildTimeSeconds>40</BuildTimeSeconds>

<ResourceSourceGroup>Reactors</ResourceSourceGroup>
<MaxPowerOutput>15</MaxPowerOutput>

<InventorySize>
<X>1</X>
<Y>1</Y>
<Z>1</Z>
</InventorySize>

<!--
Values are volume fill ratio, means how much fuel reactor pulls from conveyor system to the inventory.
If volume fill ratio is bellow minimum, reactor starts pulling fuel up to maximum value.
Warning: Changing these values will affect performance.
-->
<InventoryFillFactorMin>0.0005</InventoryFillFactorMin>
<InventoryFillFactorMax>0.001</InventoryFillFactorMax>

<!--
This is how much of fuel is pulled from conveyor system in one tick.
It's in minutes, means that it will pull X minutes of fuel in one tick.
Warning: Changing this value will affect performance.
-->
<FuelPullAmountFromConveyorInMinutes>10.0</FuelPullAmountFromConveyorInMinutes>

<FuelInfos>
<FuelInfo>
<Id>
<TypeId>Ingot</TypeId>
<SubtypeId>Uranium</SubtypeId>
</Id>
</FuelInfo>
</FuelInfos>

<PrimarySound>ShipLrgNuclearSm</PrimarySound>
<DamageEffectName>Damage_Reactor_Damaged</DamageEffectName>
<DamagedSound>ParticleReactor</DamagedSound>
<EmissiveColorPreset>Default</EmissiveColorPreset>
<DestroyEffect>BlockDestroyedExplosion_Large</DestroyEffect>
<DestroySound>WepSmallWarheadExpl</DestroySound>
<PCU>25</PCU>
<IsAirTight>false</IsAirTight>
<TieredUpdateTimes>
<unsignedInt>900</unsignedInt>
<unsignedInt>1800</unsignedInt>
<unsignedInt>3600</unsignedInt>
</TieredUpdateTimes>
<TargetingGroups>
<string>PowerSystems</string>
</TargetingGroups>
</Definition>
<!-- frigate_cargo -->
<Definition xsi:type="MyObjectBuilder_CargoContainerDefinition">
<Id>
<TypeId>CargoContainer</TypeId>
<SubtypeId>FrigateCore_Cargo</SubtypeId>
</Id>
<DisplayName>FrigateCore_Cargo</DisplayName>
<Icon>Textures\GUI\Icons\Cubes\container.dds</Icon>
<Description>FrigateCore_Cargo</Description>
<CubeSize>Large</CubeSize>
<BlockTopology>TriangleMesh</BlockTopology>
<Size x="1" y="1" z="1" />
<ModelOffset x="0" y="0" z="0" />
<Model>Models\Cubes\Large\CargoContainerSmall.mwm</Model>
<Components>
<Component Subtype="InteriorPlate" Count="30" />
<Component Subtype="Construction" Count="35" />
<Component Subtype="MetalGrid" Count="4" />
<Component Subtype="SmallTube" Count="20" />
<Component Subtype="Motor" Count="4" />
<Component Subtype="Display" Count="1" />
<Component Subtype="Computer" Count="2" />
<Component Subtype="Construction" Count="5" />
<Component Subtype="InteriorPlate" Count="10" />
</Components>
<CriticalComponent Subtype="Computer" Index="0" />
<MountPoints>
<MountPoint Side="Right" StartX="0" StartY="0" EndX="1" EndY="1" CouplingTag="FrigateCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Left" StartX="0" StartY="0" EndX="1" EndY="1" CouplingTag="FrigateCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Top" StartX="0" StartY="0" EndX="1" EndY="1" CouplingTag="FrigateCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Bottom" StartX="0" StartY="0" EndX="1" EndY="1" Default="true" CouplingTag="FrigateCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Front" StartX="0" StartY="0" EndX="1" EndY="1" CouplingTag="FrigateCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Back" StartX="0" StartY="0" EndX="1" EndY="1" CouplingTag="FrigateCoreMount" AllowCouplingWithItself="false"/>
</MountPoints>
<BuildProgressModels>
<Model BuildPercentUpperBound="0.33" File="Models\Cubes\Large\CargoContainerSmallConstruction_1.mwm" />
<Model BuildPercentUpperBound="0.66" File="Models\Cubes\Large\CargoContainerSmallConstruction_2.mwm" />
<Model BuildPercentUpperBound="1.00" File="Models\Cubes\Large\CargoContainerSmallConstruction_3.mwm" />
</BuildProgressModels>
<BlockPairName>SmallCargoContainer</BlockPairName>
<MirroringY>Z</MirroringY>
<MirroringZ>Y</MirroringZ>
<EdgeType>Light</EdgeType>
<BuildTimeSeconds>15</BuildTimeSeconds>
<DamageEffectName>Damage_HeavyMech_Damaged</DamageEffectName>
<DamagedSound>ParticleHeavyMech</DamagedSound>
<DestroyEffect>BlockDestroyedExplosion_Large</DestroyEffect>
<DestroySound>WepSmallWarheadExpl</DestroySound>
<PCU>10</PCU>
<IsAirTight>true</IsAirTight>
</Definition>

<!-- destroyer_reactor -->
<Definition xsi:type="MyObjectBuilder_ReactorDefinition">
<Id>
<TypeId>Reactor</TypeId>
<SubtypeId>DestroyerCore_Reactor</SubtypeId>
</Id>
<DisplayName>DestroyerCore_Reactor</DisplayName>
<Icon>Textures\GUI\Icons\Cubes\nuclear_reactor.dds</Icon>
<Description>DestroyerCore_Reactor</Description>
<CubeSize>Large</CubeSize>
<BlockTopology>TriangleMesh</BlockTopology>
<Size x="1" y="1" z="1" />
<ModelOffset x="0" y="0" z="0" />
<Model>Models\Cubes\Large\GeneratorSmall.mwm</Model>
<Components>
<Component Subtype="SteelPlate" Count="50" />
<Component Subtype="Construction" Count="40" />
<Component Subtype="MetalGrid" Count="4" />
<Component Subtype="LargeTube" Count="8" />
<Component Subtype="Reactor" Count="100" />
<Component Subtype="Motor" Count="6" />
<Component Subtype="Computer" Count="25" />
<Component Subtype="SteelPlate" Count="30" />
</Components>
<CriticalComponent Subtype="Computer" Index="0" />
<MountPoints>
<MountPoint Side="Top" StartX="0.15" StartY="0.15" EndX="0.85" EndY="0.85" CouplingTag="DestroyerCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Back" StartX="0.15" StartY="0.15" EndX="0.85" EndY="0.85" CouplingTag="DestroyerCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Right" StartX="0.3" StartY="0.3" EndX="0.7" EndY="0.7" CouplingTag="DestroyerCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Left" StartX="0.3" StartY="0.3" EndX="0.7" EndY="0.7" CouplingTag="DestroyerCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Bottom" StartX="0.3" StartY="0.3" EndX="0.7" EndY="0.7" Default="true" CouplingTag="DestroyerCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Front" StartX="0.3" StartY="0.3" EndX="0.7" EndY="0.7" CouplingTag="DestroyerCoreMount" AllowCouplingWithItself="false"/>
</MountPoints>
<BuildProgressModels>
<Model BuildPercentUpperBound="0.33" File="Models\Cubes\Large\GeneratorSmallConstruction_1.mwm" />
<Model BuildPercentUpperBound="0.66" File="Models\Cubes\Large\GeneratorSmallConstruction_2.mwm" />
<Model BuildPercentUpperBound="1.00" File="Models\Cubes\Large\GeneratorSmallConstruction_3.mwm" />
</BuildProgressModels>
<MirroringY>Z</MirroringY>
<MirroringZ>Y</MirroringZ>
<EdgeType>Light</EdgeType>
<BuildTimeSeconds>40</BuildTimeSeconds>

<ResourceSourceGroup>Reactors</ResourceSourceGroup>
<MaxPowerOutput>15</MaxPowerOutput>

<InventorySize>
<X>1</X>
<Y>1</Y>
<Z>1</Z>
</InventorySize>

<!--
Values are volume fill ratio, means how much fuel reactor pulls from conveyor system to the inventory.
If volume fill ratio is bellow minimum, reactor starts pulling fuel up to maximum value.
Warning: Changing these values will affect performance.
-->
<InventoryFillFactorMin>0.0005</InventoryFillFactorMin>
<InventoryFillFactorMax>0.001</InventoryFillFactorMax>

<!--
This is how much of fuel is pulled from conveyor system in one tick.
It's in minutes, means that it will pull X minutes of fuel in one tick.
Warning: Changing this value will affect performance.
-->
<FuelPullAmountFromConveyorInMinutes>10.0</FuelPullAmountFromConveyorInMinutes>

<FuelInfos>
<FuelInfo>
<Id>
<TypeId>Ingot</TypeId>
<SubtypeId>Uranium</SubtypeId>
</Id>
</FuelInfo>
</FuelInfos>

<PrimarySound>ShipLrgNuclearSm</PrimarySound>
<DamageEffectName>Damage_Reactor_Damaged</DamageEffectName>
<DamagedSound>ParticleReactor</DamagedSound>
<EmissiveColorPreset>Default</EmissiveColorPreset>
<DestroyEffect>BlockDestroyedExplosion_Large</DestroyEffect>
<DestroySound>WepSmallWarheadExpl</DestroySound>
<PCU>25</PCU>
<IsAirTight>false</IsAirTight>
<TieredUpdateTimes>
<unsignedInt>900</unsignedInt>
<unsignedInt>1800</unsignedInt>
<unsignedInt>3600</unsignedInt>
</TieredUpdateTimes>
<TargetingGroups>
<string>PowerSystems</string>
</TargetingGroups>
</Definition>
<!-- destroyer_cargo -->
<Definition xsi:type="MyObjectBuilder_CargoContainerDefinition">
<Id>
<TypeId>CargoContainer</TypeId>
<SubtypeId>DestroyerCore_Cargo</SubtypeId>
</Id>
<DisplayName>DestroyerCore_Cargo</DisplayName>
<Icon>Textures\GUI\Icons\Cubes\container.dds</Icon>
<Description>DestroyerCore_Cargo</Description>
<CubeSize>Large</CubeSize>
<BlockTopology>TriangleMesh</BlockTopology>
<Size x="1" y="1" z="1" />
<ModelOffset x="0" y="0" z="0" />
<Model>Models\Cubes\Large\CargoContainerSmall.mwm</Model>
<Components>
<Component Subtype="InteriorPlate" Count="30" />
<Component Subtype="Construction" Count="35" />
<Component Subtype="MetalGrid" Count="4" />
<Component Subtype="SmallTube" Count="20" />
<Component Subtype="Motor" Count="4" />
<Component Subtype="Display" Count="1" />
<Component Subtype="Computer" Count="2" />
<Component Subtype="Construction" Count="5" />
<Component Subtype="InteriorPlate" Count="10" />
</Components>
<CriticalComponent Subtype="Computer" Index="0" />
<MountPoints>
<MountPoint Side="Right" StartX="0" StartY="0" EndX="1" EndY="1" CouplingTag="DestroyerCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Left" StartX="0" StartY="0" EndX="1" EndY="1" CouplingTag="DestroyerCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Top" StartX="0" StartY="0" EndX="1" EndY="1" CouplingTag="DestroyerCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Bottom" StartX="0" StartY="0" EndX="1" EndY="1" Default="true" CouplingTag="DestroyerCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Front" StartX="0" StartY="0" EndX="1" EndY="1" CouplingTag="DestroyerCoreMount" AllowCouplingWithItself="false"/>
<MountPoint Side="Back" StartX="0" StartY="0" EndX="1" EndY="1" CouplingTag="DestroyerCoreMount" AllowCouplingWithItself="false"/>
</MountPoints>
<BuildProgressModels>
<Model BuildPercentUpperBound="0.33" File="Models\Cubes\Large\CargoContainerSmallConstruction_1.mwm" />
<Model BuildPercentUpperBound="0.66" File="Models\Cubes\Large\CargoContainerSmallConstruction_2.mwm" />
<Model BuildPercentUpperBound="1.00" File="Models\Cubes\Large\CargoContainerSmallConstruction_3.mwm" />
</BuildProgressModels>
<BlockPairName>SmallCargoContainer</BlockPairName>
<MirroringY>Z</MirroringY>
<MirroringZ>Y</MirroringZ>
<EdgeType>Light</EdgeType>
<BuildTimeSeconds>15</BuildTimeSeconds>
<DamageEffectName>Damage_HeavyMech_Damaged</DamageEffectName>
<DamagedSound>ParticleHeavyMech</DamagedSound>
<DestroyEffect>BlockDestroyedExplosion_Large</DestroyEffect>
<DestroySound>WepSmallWarheadExpl</DestroySound>
<PCU>10</PCU>
<IsAirTight>true</IsAirTight>
</Definition>


</CubeBlocks>
</Definitions>
6 changes: 6 additions & 0 deletions TSTSSESCoresAddon/Data/Scripts/ScriptsAddon/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
</configuration>
53 changes: 53 additions & 0 deletions TSTSSESCoresAddon/Data/Scripts/ScriptsAddon/Language.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Sandbox.ModAPI;
using Sandbox.Game;
using VRage;
using VRage.Game.Components;
using VRage.Utils;

namespace Example {
[MySessionComponentDescriptor(MyUpdateOrder.NoUpdate)]
public class Mod : MySessionComponentBase {

public MyLanguagesEnum? Language { get; private set; }

public override void LoadData() {
LoadLocalization("Localization");
LoadLocalization("Localization/Other");

MyAPIGateway.Gui.GuiControlRemoved += OnGuiControlRemoved;
}

protected override void UnloadData() {
MyAPIGateway.Gui.GuiControlRemoved -= OnGuiControlRemoved;
}

private void LoadLocalization(string folder) {
var path = Path.Combine(ModContext.ModPathData, folder);
var supportedLanguages = new HashSet<MyLanguagesEnum>();
MyTexts.LoadSupportedLanguages(path, supportedLanguages);

var currentLanguage = supportedLanguages.Contains(MyAPIGateway.Session.Config.Language) ? MyAPIGateway.Session.Config.Language : MyLanguagesEnum.English;
if (Language != null && Language == currentLanguage) {
return;
}

Language = currentLanguage;
var languageDescription = MyTexts.Languages.Where(x => x.Key == currentLanguage).Select(x => x.Value).FirstOrDefault();
if (languageDescription != null) {
var cultureName = string.IsNullOrWhiteSpace(languageDescription.CultureName) ? null : languageDescription.CultureName;
var subcultureName = string.IsNullOrWhiteSpace(languageDescription.SubcultureName) ? null : languageDescription.SubcultureName;
MyTexts.LoadTexts(path, cultureName, subcultureName);
}
}

private void OnGuiControlRemoved(object obj) {
if (obj.ToString().EndsWith("ScreenOptionsSpace")) {
LoadLocalization("Localization");
LoadLocalization("Localization/Other");
}
}
}
}
15 changes: 15 additions & 0 deletions TSTSSESCoresAddon/Data/Scripts/ScriptsAddon/Shared/Action2.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MIG.Shared.CSharp {
public interface Action2<T, K> {
void run(T t, K k);
}

public interface Action1<T> {
void run(T t);
}
}
Loading

0 comments on commit ff063d3

Please sign in to comment.