Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
v1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Chasmical committed Jul 16, 2020
1 parent 189f862 commit d2eb3b2
Show file tree
Hide file tree
Showing 24 changed files with 193 additions and 282 deletions.
Binary file modified .vs/RogueLibs/v16/.suo
Binary file not shown.
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.1.0")]
[assembly: AssemblyFileVersion("1.3.1.0")]
[assembly: AssemblyVersion("1.3.3.0")]
[assembly: AssemblyFileVersion("1.3.3.0")]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## Contents ##

1. **Main page**
2. [RogueLibs](/md/RogueLibs.md)
3. [CustomMutators](/md/CustomMutators.md)
4. [CustomItems](/md/CustomItems.md)
5. [CustomNames](/md/CustomNames.md)
6. [Extras](/md/Extras.md)
7. [RogueLibs Changelog](/md/Changelog.md)
8. [Mod Examples](/md/Examples.md)
2. [RogueLibs](./md/RogueLibs.md)
3. [CustomMutators](./md/CustomMutators.md)
4. [CustomItems](./md/CustomItems.md)
5. [CustomNames](./md/CustomNames.md)
6. [Extras](./md/Extras.md)
7. [RogueLibs Changelog](./md/Changelog.md)
8. [Mod Examples](./md/Examples.md)

## Links ##
* [Download RogueLibs](https://github.com/Abbysssal/RogueLibs/releases)
Expand Down Expand Up @@ -39,7 +39,7 @@ You can find these mods in [the official Streets of Rogue Discord server](https:
* Explosion Damage x0.25/x0.5/x2/x4/x8;
* Explosion Power x0.25/x0.5/x2/x4/x8;

# RogueLibs v1.3.2 #
# RogueLibs v1.3.3 #
This modding library allows you to easily add custom mutators, items and localization lines, plus it has some extra functions that you might need.

## How to use RogueLibs in your mods ##
Expand Down
1 change: 0 additions & 1 deletion RogueLibs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="source\CustomItem.cs" />
<Compile Include="source\MessageArgs.cs" />
<Compile Include="source\RogueChat.cs" />
<Compile Include="source\RogueLibs.cs" />
<Compile Include="source\RogueLibsPlugin.cs" />
Expand Down
Binary file modified bin/Debug/RogueLibs.dll
Binary file not shown.
Binary file modified bin/Debug/RogueLibs.pdb
Binary file not shown.
31 changes: 11 additions & 20 deletions bin/Debug/RogueLibs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 25 additions & 20 deletions md/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,50 @@
## Changelog ##
Here you will find all updates on RogueLibs, so you can specify your RogueLibs' version dependency better.

#### RogueLibs v1.3.3 ####
* Optimized and cleaned up the code;
* Replaced `CustomMutator.OnChangeState` and `CustomMutator.OnState` delegates with `System.Action` and `System.Action<bool>`;
* Now RogueLibs will check if the combinable/targetable item was depleted after usage, so there is no need to check that at the end of `InvItem.TargetObject`/`InvItem.CombineItem`;

#### RogueLibs v1.3.2 ####
* RogueLibs source code is now available on [GitHub](https://github.com/Abbysssal/RogueLibs)!;
* Added RogueUtilities.ConvertToSprite(string filePath, int ppu) and RogueUtilities.ConvertToSprite(byte[] data, int ppu), so you can specify your image's pixel-per-unit scale;
* Added `RogueUtilities.ConvertToSprite(string filePath, int ppu)` and `RogueUtilities.ConvertToSprite(byte[] data, int ppu)`, so you can specify your image's pixel-per-unit scale;

#### RogueLibs v1.3.1 ####
* Added InvItem.CombineTooltip delegate to determine the tooltip text when combining items;
* Added `InvItem.CombineTooltip` delegate to determine the tooltip text when combining items;

#### RogueLibs v1.3 ####
* **Added CustomItem class, more info [here](./CustomItems.md)**;
* **Added `CustomItem` class, more info [here](./CustomItems.md)**;
* Added [Examples.md](./Examples.md) section;
* Added missing XML comments;

#### RogueLibs v1.2 ####
* Added RogueUtilities.CrossConflict(params CustomMutator[] mutators) method;
* Added RogueUtilities.EachConflict(IEnumerable\<string\> conflicts, params CustomMutator[] mutators) method;
* Added CustomMutator.OnChangedState event;
* Added CustomMutator.SortingOrder and CustomMutator.SortingIndex properties;
* Added a small class RogueChat, more info [here](./Extras.md#roguechat);
* Added `RogueUtilities.CrossConflict(params CustomMutator[] mutators)` method;
* Added `RogueUtilities.EachConflict(IEnumerable\<string\> conflicts, params CustomMutator[] mutators)` method;
* Added `CustomMutator.OnChangedState` event;
* Added `CustomMutator.SortingOrder` and `CustomMutator.SortingIndex` properties;
* Added a small class `RogueChat`, more info [here](./Extras.md#roguechat);
* Fixed a bug, when custom mutators replaced original mutators in the Mutator Menu;
* Fixed a bug, when CustomMutator's OnEnabled and OnDisabled weren't triggered;
* Fixed a bug, when `CustomMutator`'s `OnEnabled` and `OnDisabled` weren't triggered;

#### RogueLibs v1.1.2 ####
* Fixed configuration loading errors;

#### RogueLibs v1.1 ####
* **Renamed Mutator class to CustomMutator!**;
* **Removed MutatorInfo class, use CustomNameInfo instead!**;
* **Removed Mutator.Cancellations and CancelledBy, use Conflicting instead!**;
* **Removed SetMutator(id, unlocked, english,..), use SetMutator(id, unlocked, name, description) instead!**;
* **Removed SetCustomName(id, type, english,..), use SetCustomName(id, type, info) instead!**;
* **Removed GetCustomName(id), use GetCustomName(id, type) instead!**;
* **Removed DeleteCustomName(id), use DeleteCustomName(id, type) instead!**;
* CustomNameInfo is now a struct;
* **Renamed `Mutator` class to `CustomMutator`!**;
* **Removed `MutatorInfo` class, use `CustomNameInfo` instead!**;
* **Removed `Mutator.Cancellations` and `CancelledBy`, use `Conflicting` instead!**;
* **Removed `SetMutator(id, unlocked, english,..)`, use `SetMutator(id, unlocked, name, description)` instead!**;
* **Removed `SetCustomName(id, type, english,..)`, use `SetCustomName(id, type, info)` instead!**;
* **Removed `GetCustomName(id)`, use `GetCustomName(id, type)` instead!**;
* **Removed `DeleteCustomName(id)`, use `DeleteCustomName(id, type)` instead!**;
* `CustomNameInfo` is now a `struct`;
* Changed some configuration loading code;
* Added class RoguePatcher, more info [here](./Extras.md#roguepatcher);
* Added static class RogueUtilities, more info [here](./Extras.md#rogueutilities);
* Added class `RoguePatcher`, more info [here](./Extras.md#roguepatcher);
* Added static class `RogueUtilities`, more info [here](./Extras.md#rogueutilities);

#### RogueLibs v1.0.1 ####
* Fixed a bug, when deleted mods' mutators were showing in the Mutator Menu;

#### RogueLibs v1.0 ####
* **Added Mutator and CustomName classes and some extra functions.**
* **Added `Mutator` and `CustomName` classes and some extra functions.**
7 changes: 1 addition & 6 deletions md/CustomItems.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ repairer.CombineItem = (item, agent, otherItem, slotNum) =>
agent.agentInvDatabase.SubtractFromItemCount(item, 1);

item.gc.audioHandler.Play(agent, "CombineItem");

if (item.invItemCount < 1) // Stop combining if the repairer has 0 uses left
{
agent.mainGUI.invInterface.HideDraggedItem();
agent.mainGUI.invInterface.HideTarget();
}
};
repairer.CombineTooltip = (item, agent, otherItem) =>
{
Expand Down Expand Up @@ -130,6 +124,7 @@ remoteGiantizer.TargetFilter = (item, agent, target) => target is Agent a && !a.
remoteGiantizer.TargetObject = (item, agent, target) =>
{
item.invInterface.HideTarget();
// after using, you will need to select this item again
Agent a = (Agent)target;
a.statusEffects.AddStatusEffect("Giant", true, true, 999999);
Expand Down
6 changes: 0 additions & 6 deletions md/Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@ namespace RogueLibsCore.Examples
agent.agentInvDatabase.SubtractFromItemCount(item, 1);

item.gc.audioHandler.Play(agent, "CombineItem");

if (item.invItemCount <= 0)
{
agent.mainGUI.invInterface.HideDraggedItem();
agent.mainGUI.invInterface.HideTarget();
}
};
repairer.CombineTooltip = (item, agent, otherItem) =>
{
Expand Down
2 changes: 1 addition & 1 deletion obj/Debug/RogueLibs.csproj.CoreCompileInputs.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ef1e1d2e9aedf86c8814c5385d68ba3965765f6f
3de47e75845e4d3015c34eb1b1edfbb57cfa232a
Binary file modified obj/Debug/RogueLibs.csprojAssemblyReference.cache
Binary file not shown.
Binary file modified obj/Debug/RogueLibs.dll
Binary file not shown.
Binary file modified obj/Debug/RogueLibs.pdb
Binary file not shown.
12 changes: 4 additions & 8 deletions source/BaseUnityPluginExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ public static void LogErrorWith(this BaseUnityPlugin plugin, string message, Exc
/// </summary>
public static bool PatchPrefix(this BaseUnityPlugin me, Type type, string methodName, Type patchType, string patchMethodName, params Type[] types)
{
if (types.Length == 0)
types = null;
MethodInfo original;
MethodInfo patch;
if (types.Length == 0) types = null;
MethodInfo original, patch;
try
{
original = AccessTools.Method(type, methodName, types);
Expand Down Expand Up @@ -67,10 +65,8 @@ public static bool PatchPrefix(this BaseUnityPlugin me, Type type, string method
/// </summary>
public static bool PatchPostfix(this BaseUnityPlugin me, Type type, string methodName, Type patchType, string patchMethodName, params Type[] types)
{
if (types.Length == 0)
types = null;
MethodInfo original;
MethodInfo patch;
if (types.Length == 0) types = null;
MethodInfo original, patch;
try
{
original = AccessTools.Method(type, methodName, types);
Expand Down
24 changes: 5 additions & 19 deletions source/CustomItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ public class CustomItem
/// </summary>
public string Id { get; }

internal CustomItem(string id)
{
Id = id;
SpawnDictionary = new Dictionary<string, int>();
}
internal CustomItem(string id) => Id = id;

/// <summary>
/// <para>Delegate that will be invoked when setting up this custom item. See <see cref="InvItem.SetupDetails(bool)"/> for more details.</para>
Expand Down Expand Up @@ -74,37 +70,27 @@ internal CustomItem(string id)
/// </summary>
public CustomName Name
{
get
{
if (name == null)
name = RogueLibs.GetCustomName(Id, "Item");
return name;
}
get => name = name ?? RogueLibs.GetCustomName(Id, "Item");
set => name = value;
}
/// <summary>
/// <para>Localizable description of this <see cref="CustomItem"/>.</para>
/// </summary>
public CustomName Description
{
get
{
if (description == null)
description = RogueLibs.GetCustomName(Id, "Description");
return description;
}
get => description = description ?? RogueLibs.GetCustomName(Id, "Description");
set => description = value;
}

/// <summary>
/// <para>Dictionary of RandomLists' names that this item will spawn in and spawn chances. See <see cref="RandomItems.fillItems"/> for more details.</para>
/// </summary>
public Dictionary<string, int> SpawnDictionary { get; set; }
public Dictionary<string, int> SpawnDictionary { get; set; } = new Dictionary<string, int>();

/// <summary>
/// <para>Sets this item's hover text.</para>
/// </summary>
public void SetHoverText(CustomNameInfo info) => HoverText = RogueLibs.SetCustomName("Verb" + Id, "Interface", info);
public CustomName SetHoverText(CustomNameInfo info) => HoverText = RogueLibs.SetCustomName("Verb" + Id, "Interface", info);
/// <summary>
/// <para>Adds this item to a <see cref="RandomList"/> with the specified <paramref name="listName"/>, with the specified <paramref name="spawnChance"/>. See <see cref="RandomItems.fillItems"/> for more info.</para>
/// </summary>
Expand Down
Loading

0 comments on commit d2eb3b2

Please sign in to comment.