Added Luminance support

This commit is contained in:
GinYuH authored and Cameron Ewell committed 2024-04-28 23:19:47 -04:00
1 parent 02ca22b2b1
commit 4ea9b4f149
12 files changed
+2919 -11

No files matched your search

+3 -1
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.ModLoader.Core;
namespace CalamityMod.CalPlayer.Dashes
{
@@ -44,7 +45,8 @@ namespace CalamityMod.CalPlayer.Dashes
{
DashIdentificationTable = new();
Type baseType = typeof(PlayerDashEffect);
foreach (Type type in CalamityMod.Instance.Code.GetTypes())
Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code);
foreach (Type type in types)
{
// Ignore any types which are not dash effects or are abstract.
// This eliminates the PlayerDashEffect template type, which cannot have instances.
+4
View File
@@ -144,6 +144,7 @@ namespace CalamityMod
internal Mod crouchMod = null;
internal Mod dialogueTweak = null;
internal Mod fargos = null;
internal Mod luminance = null;
internal Mod magicStorage = null;
internal Mod overhaul = null;
internal Mod redemption = null;
@@ -179,6 +180,8 @@ namespace CalamityMod
ModLoader.TryGetMod("DialogueTweak", out dialogueTweak);
fargos = null;
ModLoader.TryGetMod("Fargowiltas", out fargos);
luminance = null;
ModLoader.TryGetMod("Luminance", out luminance);
magicStorage = null;
ModLoader.TryGetMod("MagicStorage", out magicStorage);
overhaul = null;
@@ -424,6 +427,7 @@ namespace CalamityMod
crouchMod = null;
dialogueTweak = null;
fargos = null;
luminance = null;
magicStorage = null;
overhaul = null;
redemption = null;
@@ -4,6 +4,7 @@ using System.Linq;
using System.Runtime.Serialization;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader.Core;
namespace CalamityMod.Items.VanillaArmorChanges
{
@@ -15,7 +16,8 @@ namespace CalamityMod.Items.VanillaArmorChanges
internal static void Load()
{
ArmorChanges = new List<VanillaArmorChange>();
foreach (Type type in CalamityMod.Instance.Code.GetTypes())
Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code);
foreach (Type type in types)
{
if (!type.IsSubclassOf(typeof(VanillaArmorChange)) || type.IsAbstract)
continue;
@@ -33,6 +33,7 @@ NoDifficultyInfo: The classic Terraria experience, with no Calamity difficulty c
Revengeance: Revengeance
RevMaster: Rev+Master
RevLegend: Rev+Legend
RevengeanceEnabled: Revengeance Mode is enabled
RevengeanceShortInfo: "[c/F54254:The intended Calamity experience!]"
RevengeanceExpandedInfo:
'''
@@ -49,6 +50,7 @@ RevengeanceDeactivate: Revengeance is not active.
Death: Death
DeathMaster: Death+Master
DeathLegend: Death+Legend
DeathEnabled: Death Mode is enabled
DeathShortInfo: "[c/C82DF7:A tougher challenge for the more experienced, or for those that want a step up from Revengeance Mode]"
DeathExpandedInfo:
'''
Binary file not shown.
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,38 @@
using CalamityMod.Systems;
using Luminance.Core.MenuInfoUI;
using System.Collections.Generic;
using Terraria.ModLoader;
namespace CalamityMod.ModSupport.LuminanceSupport
{
[JITWhenModsEnabled("Luminance")]
[ExtendsFromMod("Luminance")]
public sealed class CalamityUIManagers : InfoUIManager
{
public override IEnumerable<WorldInfoIcon> GetWorldInfoIcons()
{
yield return new WorldInfoIcon("CalamityMod/UI/ModeIndicator/ModeIndicator_Death",
"Mods.CalamityMod.UI.DeathEnabled",
worldData =>
{
if (!worldData.TryGetHeaderData<WorldSelectionDifficultySystem>(out var tagData))
return false;
return tagData.ContainsKey("DeathMode") && tagData.GetBool("DeathMode");
},
50);
yield return new WorldInfoIcon("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev",
"Mods.CalamityMod.UI.RevengeanceEnabled",
worldData =>
{
if (!worldData.TryGetHeaderData<WorldSelectionDifficultySystem>(out var tagData))
return false;
return tagData.ContainsKey("RevengeanceMode") && tagData.GetBool("RevengeanceMode") && !(tagData.ContainsKey("DeathMode") && tagData.GetBool("DeathMode"));
},
50);
}
}
}
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using Terraria.ModLoader.Core;
namespace CalamityMod.Projectiles.BaseProjectiles
{
@@ -25,7 +26,8 @@ namespace CalamityMod.Projectiles.BaseProjectiles
// Look through every type in the mod, and check if it's derived from BaseIdleHoldoutProjectile.
// If it is, cache it into the item/projectile relationship cache.
foreach (Type type in typeof(CalamityMod).Assembly.GetTypes())
Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code);
foreach (Type type in types)
{
// Don't load abstract classes; they cannot have instances.
if (type.IsAbstract)
+10 -6
View File
@@ -18,12 +18,16 @@ namespace CalamityMod.Systems
// Load all of the World Difficulties to the World Difficulty list
// The difficulty the world uses will be the latest applicable one, so these are added in order from easiest to hardest
// These colors are all picked from the wiki's colors for each Difficulty combo
WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Revengeance"), GetRevengeance, new(211, 42, 42)));
WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Death"), GetDeath, new(192, 64, 219)));
WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.RevMaster"), GetMasterRevengeance, new(124, 153, 242)));
WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.DeathMaster"), GetMasterDeath, new(255, 25, 255)));
WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.RevLegend"), GetLegendRevengeance, new(240, 128, 128))); // Malice color
WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.DeathLegend"), GetLegendDeath, new(220, 255, 132))); // Defiled color
// Calamity's own difficulties aren't added if the Luminance mod is on, as it adds its own world system
if (CalamityMod.Instance.luminance == null)
{
WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Revengeance"), GetRevengeance, new(211, 42, 42)));
WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Death"), GetDeath, new(192, 64, 219)));
WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.RevMaster"), GetMasterRevengeance, new(124, 153, 242)));
WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.DeathMaster"), GetMasterDeath, new(255, 25, 255)));
WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.RevLegend"), GetLegendRevengeance, new(240, 128, 128))); // Malice color
WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.DeathLegend"), GetLegendDeath, new(220, 255, 132))); // Defiled color
}
}
public override void SaveWorldHeader(TagCompound tag)
+3 -1
View File
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework.Graphics;
using Terraria.ModLoader.Core;
namespace CalamityMod.UI
{
@@ -25,7 +26,8 @@ namespace CalamityMod.UI
public static void LoadGUIs()
{
// Look through every type in the mod, and check if it's derived from InvasionProgressUI. If it is, create a copy and save it in the static list.
foreach (Type type in typeof(CalamityMod).Assembly.GetTypes())
Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code);
foreach (Type type in types)
{
// Don't load abstract classes since they cannot have instances.
if (type.IsAbstract)
+3 -1
View File
@@ -7,6 +7,7 @@ using ReLogic.Content;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.Core;
namespace CalamityMod.Waters
{
@@ -23,7 +24,8 @@ namespace CalamityMod.Waters
{
CustomLavaStyles = new List<CustomLavaStyle>();
foreach (Type type in typeof(CalamityMod).Assembly.GetTypes())
Type[] types = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code);
foreach (Type type in types)
{
// Ignore abstract types; they cannot have instances.
// Also ignore types which do not derive from CustomLavaStyle.
+1
View File
@@ -7,3 +7,4 @@ hideCode = false
hideResources = true
includeSource = false
includePDB = true
weakReferences = Luminance