Git Product home page Git Product logo

roguelibs's People

Contributors

chasmical avatar dependabot[bot] avatar freiling87 avatar rafared avatar ztbbz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

roguelibs's Issues

[Feature] Custom Interactions

Describe the problem

Adding custom interactions with objects is really complicated, especially if you want your interactions to be compatible with other mods' interactions. Also the methods are really inconsistent, and sometimes you might just need a couple of postfix-patches, and sometimes even a transpiler.

Describe the solution

Implement custom interactions in RLv3 via hooks.

InteractionModel will manage the interactions for a PlayfieldObject. It will gather actions from a global list of IInteractionProviders, sort and filter them and then display the menu with buttons. The base class is abstract, and all actual instances derive from InteractionModel<T>.

IInteractionProvider will create Interactions, bind them to the current object and pass them to the manager. They are stored in RogueInteractions.Providers.

Interaction is a base class for managing the button-action itself: its name, price, extra information and etc. There will be two default implementations of that class - CustomInteraction, exposed for mod developers, and SimpleInteraction that uses a simplified syntax with delegates (see SimpleInteractionProvider).

Describe the alternatives

No response

How would that work?

Here's how vanilla Barbecue interactions could be defined:

// All of the used delegates must be static to avoid referencing outdated variables.
// Properties that should not be accessed should throw an InvalidOperationException.

// This method uses the simplified syntax, using SimpleInteractionProvider<Barbecue>
RogueInteractions.CreateProvider<Barbecue>(static h => // 'h' is for 'handler'
{
    if (h.Helper.interactingFar) return; // No buttons will be added

    if (h.Object.burntOut)
    {
        // Set what will happen, if the interaction is unsuccessful.
        // Interaction is unsuccessful only if there are no available buttons or if one
        // of the providers stopped the interaction forcefully (`h.StopInteraction()`).
        h.SetStopCallback(static m => m.Agent.SayDialogue("BarbecueBurntOut"));
        // Use it to tell the player why the operation was unsuccessful.
    }
    else if (h.Object.ora.hasParticleEffect)
    {
        if (h.Agent.inventory.HasItem(VanillaItems.Fud))
        {
            // Creates a button, that, when clicked, will call the specified delegate.
            h.AddButton("GrillFud", static m => // 'm' is for 'model'
            {
                m.Object.StartCoroutine(m.Object.Operating(m.Agent, null, 2f, true, "Grilling"));
            });
        }
        else h.SetStopCallback(static m => m.Agent.SayDialogue("CantGrillFud"));
    }
    else
    {
        if (h.Agent.inventory.HasItem(VanillaItems.CigaretteLighter))
        {
            h.AddButton("LightBarbecue", static m =>
            {
                m.Object.StartFireInObject();
                m.StopInteraction();
            });
        }
        else h.SetStopCallback(static m => m.Agent.SayDialogue("CantOperateBarbecue"));
    }
});

Open Questions

Should vanilla interactions derive from a separate class VanillaInteraction instead? If so, then should all vanilla interactions be rewritten as individual classes, or should a simplified syntax be used?

[Documentation] Missing screenshots

Missing screenshots

i18n/ru:

Describe the solution you'd like

Make these screenshots.

Collapsible Groups for ListBox items

Describe the problem

Mod content additions will make the player's List Boxes (for Mutators, Traits, etc.) crowded and difficult to traverse.

Describe the solution

Create a system that allows the modder to assign their content to Menu Groups. If RogueLibs detects a Menu Group, it will create a collapsible/expandable menu group. The ones used in AToM were ideal.

Describe the alternatives

No response

[Bug] Inconsistency of unlocks in the save file

Describe the bug

After uninstalling RogueLibs, all trait unlocks disappear from the Traits menu.

RogueLibs makes some changes to the way unlock fields work, and while it makes modding the game a little bit more manageable, the effects of RogueLibs on unlocks should at least be reversed, when saving them to a save file.

Expected behavior

After uninstalling RogueLibs, all trait unlocks should appear in the Traits menu and work as expected.

Screenshots and logs

No response

What operating system are you on?

Windows 64-bit

What version of the game are you running?

v95

What version of RogueLibs are you running?

v3.x.x

Installed mods

Only RogueLibs

[Bug] Lockdown wall highlighting

Describe the bug

When I come up to a lockdown wall, I can interact with it normally, but there's no highlighting, like with other interactable objects.

I've mentioned that in #50. It's not a critical issue, so I decided to postpone this bug fix.

Expected behavior

The lockdown wall, when approached and when having interactions, should be highlighted.

Screenshots and logs

No response

What operating system are you on?

Windows 64-bit

What version of the game are you running?

v96

What version of RogueLibs are you running?

v3.5.0

Installed mods

RogueLibs, EnableDebugTools

[Feature] "Operating" bar interactions

Describe the problem

I was planning on adding full support of "Operating" bar interactions during the v3.5.0 beta, but then forgot.

Describe the solution

Not really sure how it will work at the moment. There needs to be at least two handlers: one to handle an interruption, and another one to handle the completion.

Describe the alternatives

No response

[Feature] Rewrite Vanilla Interactions

Describe the problem

There's a ton of vanilla interactions to rewrite and objects to patch.
This issue will track the current progress.

Describe the solution

✅(?)Agent, ✅AirConditioner, ✅AlarmButton, ✅Altar, ✅AmmoDispenser, ✅ArcadeGame, ✅ATMMachine, ✅AugmentationBooth, ✅Barbecue, ✅BarbedWire, ✅Bars, ✅BarStool, ✅Bathtub, ✅Bed, ✅Boulder, ✅BoulderSmall, ✅Bush, ✅CapsuleMachine, ✅Chair, ✅ChestBasic, ✅CloneMachine, ✅Computer, ✅Counter, ✅Crate, ✅Desk, ✅Door, ✅Elevator, ✅ExplodingBarrel, ✅FireHydrant, ✅Fireplace, ✅FireSpewer, ✅FlameGrate, ✅FlamingBarrel, ✅GasVent, ✅Generator, ✅Generator2, ✅Gravestone, ✅(?)Item, ✅Jukebox, ✅KillerPlant, ✅Lamp, ✅LaserEmitter, ✅LoadoutMachine, ✅LockdownWall, ✅Manhole, ✅MineCart, ✅MovieScreen, ✅PawnShopMachine, ✅Plant, ✅Podium, ✅PoliceBox, ✅PoolTable, ✅PowerBox, ✅Refrigerator, ✅Safe, ✅SatelliteDish, ✅SawBlade, ✅SecurityCam, ✅Shelf, ✅Sign, ✅SlimeBarrel, ✅SlimePuddle, ✅SlotMachine, ✅Speaker, ✅Stove, ✅SwitchBasic, ✅Table, ✅TableBig, ✅Television, ✅Toilet, ✅Train, ✅TrapDoor, ✅TrashCan, ✅Tree, ✅Tube, ✅Turntables, ✅Turret, ✅VendorCart, ✅WasteBasket, ✅WaterPump, ✅Well, ✅Window.

Legend:
❌ - not implemented, 🔹 - not tested, 🔸 - testing failed, ✅ - implemented, (?) - may be tricky to implement.

Describe the alternatives

No response

[Feature] Tracking all existing names and categories

Is your feature request related to a problem? Please describe.

Consider the following situation: a developer, despite all recommendations and warnings, typed their own category strings in ItemCategoriesAttribute: [ItemCategories("Stealth", "Usalbe")], and they can't figure out why some feature, related to "Usable" category, isn't working.

Describe the solution you'd like

RogueLibs will track all existing categories and log a warning, if it encounters a name or a category, that it doesn't know about. You can add your own strings and INameValidators in RogueFramework. Custom names will be automatically added to an instance of the default INameValidator implementation.

It might be heavy on the performance, but, I guess, it can be helpful sometimes.

Describe alternatives you've considered

Don't make typos.

[Feature] Custom Weapon Classes

Is your feature request related to a problem? Please describe.

I'm always frustrated when I have to do over 20 patches just to make a simple Flaming Sword. I want to do it without patches, using some kind of a custom melee weapon class in RogueLibs.

Describe the solution you'd like

Custom weapon classes: CustomWeaponMelee, CustomWeaponThrown, CustomWeaponProjectile (+ extra interfaces that implement additional functionality)

[Bug] ConditionalWeakTable is broken in Mono

Describe the bug

I can't believe Mono managed to somehow mess up ConditionalWeakTable. It's literally its only purpose - to have weak references to the keys.

Expected behavior

When GC collects garbage, unreferenced keys are removed from ConditionalWeakTable.

Screenshots and logs

No response

What operating system are you on?

Windows 64-bit

What version of the game are you running?

v98

What version of RogueLibs are you running?

v4.0.0-beta.6

Installed mods

pretty much all of them

[Bug] Hackable NPCs do not have hacking options when you have Speed Coder

Describe the bug

When hacking a hackable NPC when you have the Speed Coder trait, none of the hacking options show up. The camera pans to the NPC as normal, but no options show up.

Same applies when playing as an SSA Hacker.

There's no option for it in the "What version of the game are you running?" section so I'm gonna say here it's latest vanilla SOR version (v98)

Expected behavior

When the NPC is hacked, the usual hacking options show up.

Screenshots and logs

No response

What operating system are you on?

Windows 64-bit

What version of the game are you running?

v97

What version of RogueLibs are you running?

v3.6.9

Installed mods

No response

[Problem] String consts

Currently, Vanilla_____ classes don't have all of the identifiers. For instance, VanillaTraits doesn't have a lot of + versions of traits.

Easier access to TraitUnlock display names

Describe the problem

Accessing in-game display name from TraitInfo class is relatively complicated.

Describe the solution

Considering the game's code uses string comparisons so frequently, I'd find it useful if that field were exposed.

Describe the alternatives

No response

[Bug] Sometimes you can't ask your followers to attack, stand guard or follow.

Describe the bug

Sometimes you can't ask your followers to attack, stand guard or follow. These interactions still exist, but are unresponsive. Maybe it's caused by the implementation of custom interactions.

Expected behavior

You can always ask your followers to attack, stand guard or follow.

Screenshots and logs

gif

What operating system are you on?

Windows 64-bit

What version of the game are you running?

v96

What version of RogueLibs are you running?

v3.5.2

Installed mods

No response

Yes button on Level Editor Yes/No prompts does not close prompt

Describe the bug

When using the level editor, pressing "Yes" on a Yes/No dialogue correctly loads the content, but does not close the dialogue

Expected behavior

Close the dialogue

Screenshots and logs

[Error  : Unity Log] IndexOutOfRangeException: Index was outside the bounds of the array.
Stack trace:
tk2dRuntime.TileMap.RenderMeshBuilder.BuildForChunk (tk2dTileMap tileMap, tk2dRuntime.TileMap.SpriteChunk chunk, tk2dRuntime.TileMap.ColorChunk colorChunk, System.Boolean useColor, System.Boolean skipPrefabs, System.Int32 baseX, System.Int32 baseY) (at <9086a7372c854d5a8678e46a74a50fc1>:0)
tk2dRuntime.TileMap.RenderMeshBuilder.Build (tk2dTileMap tileMap, System.Boolean editMode, System.Boolean forceBuild) (at <9086a7372c854d5a8678e46a74a50fc1>:0)
tk2dTileMap.Build (tk2dTileMap+BuildFlags buildFlags) (at <9086a7372c854d5a8678e46a74a50fc1>:0)
tk2dTileMap.Build () (at <9086a7372c854d5a8678e46a74a50fc1>:0)
LevelEditor.BuildAllTiles () (at <9086a7372c854d5a8678e46a74a50fc1>:0)
LevelEditor.RefreshChunks () (at <9086a7372c854d5a8678e46a74a50fc1>:0)
LevelEditor.PressedYesButton () (at <9086a7372c854d5a8678e46a74a50fc1>:0)
UnityEngine.Events.InvokableCall.Invoke () (at <a5d0703505154901897ebf80e8784beb>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <a5d0703505154901897ebf80e8784beb>:0)
UnityEngine.UI.Button.Press () (at <d5bb9c19c2a7429db6c6658c41074b11>:0)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at <d5bb9c19c2a7429db6c6658c41074b11>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <d5bb9c19c2a7429db6c6658c41074b11>:0)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <d5bb9c19c2a7429db6c6658c41074b11>:0)
UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)
Rewired.Integration.UnityUI.RewiredStandaloneInputModule:ProcessMousePress(MouseButtonEventData)
Rewired.Integration.UnityUI.RewiredStandaloneInputModule:ProcessMouseEvent(Int32, Int32)
Rewired.Integration.UnityUI.RewiredStandaloneInputModule:ProcessMouseEvents()
Rewired.Integration.UnityUI.RewiredStandaloneInputModule:Process()
UnityEngine.EventSystems.EventSystem:Update()

What operating system are you on?

Windows 64-bit

What version of the game are you running?

v95

What version of RogueLibs are you running?

v3.x.x

Installed mods

RL, SpritePackLoader, BTHarmonyUtils, CCU, DemolishThatFreakingWall

[Feature] Add non-generic extension methods to RogueExtensions for AddTrait, GetTrait and HasTrait

Describe the problem

I'm not frustrated, but I'm not happy with the current extension methods.
There currently is no clean way to call these methods with a dynamic (e.g. random) set of CustomTraits.

For example, one may want to do this:

Type[] traits = { typeof(Trait1), typeof(Trait2), typeof(Trait3) };
int random = Random.Range(0, 2);
agent.AddTrait(traits[random]);

There is a workaround of using TraitInfo.Get(traitType).Name but it would be nicer to have corresponding extension methods available.

Describe the solution

Create these overloads in RogueExtensions:

  • object AddTrait(this Agent agent, Type traitType)
  • object GetTrait(this Agent agent, Type traitType)
  • bool HasTrait(this Agent agent, Type traitType)

Describe the alternatives

You could also argue that the TraitInfo.Get workaround is sufficient and close this issue, but I'd rather you don't.

[Feature] Preserve custom content unlocks

Describe the problem

Custom content unlocks are not saved.

Describe the solution

Generate a file that keeps track of the player's unlocks.

Describe the alternatives

[Feature] Localization System

Describe the problem

The localization system in the game is awful. It's so bad that it's disturbing.

Here's how it works right now:

  • Load the entire .csv file into memory as a single string;
  • Split that giant string into lines with regular expressions;
    • And then split every line with an awfully long regular expression;
      • Use regular expressions to remove the surrounding quotes;
      • Use string.Replace to replace double quotes with single quotes;

And then for every single GetName call:

  • Type.GetTypeFromHandle to get the enum's type;
  • Parse the enum;
  • Convert it to int and use it as an index 😕;

Describe the solution

Here's my solution:

  • Simply use XML. It's way easier to read and edit. Plus, more capabilities.

As for GetName:

  • Use Dictionary<string, string>.

Describe the alternatives

No response

[Bug] Weapons' first frames are purple

Describe the bug

Weapons' first frames are purple.

To Reproduce

  1. Pick a character with a projectile weapon;
  2. Select a Fist;
  3. Select a projectile weapon;
  4. See the bug.

Expected behavior

A normal projectile weapon's sprite to appear.

Screenshots

3

Information

  • Operating system: Windows 64-bit
  • Version of the game: v94
  • Version of RogueLibs: v3.0.0-rc.2
  • Other installed mods: SpritePackLoader

Issue using custom abilities with sprites in Awake()

How to reproduce, run the game, select a character then return to menu.
I think that the method add sprite run twice producing the error.

[Error  : Unity Log] ArgumentException: An element with the same key already exists in the dictionary.
Stack trace:
System.Collections.Generic.Dictionary`2<string, UnityEngine.Sprite>.Add (string,UnityEngine.Sprite) <0x00330>
RogueLibsCore.RogueLibsPlugin.GameResources_SetupDics (GameResources) <0x0008f>
(wrapper dynamic-method) GameResources.DMD<GameResources..SetupDics> (GameResources) <0x143b1>
GameController.Awake () <0x002cd>

[Error  : Unity Log] NullReferenceException: Object reference not set to an instance of an object
Stack trace:
ProTip.Awake ()

ps: I also get the same error when using the custom item exemple with sprite.

Mutator List filtering

Describe the problem

Created Mutator Unlocks appear in all versions of the menu (Campaign, Level, and Home Base).

Describe the solution

Add virtual (true) bools to MutatorUnlock:

  • AppearsInCampaignMutatorList
  • AppearsInHomeBaseMutatorList
  • AppearsInLevelMutatorList

Vanilla code targets:

  • Campaign: LevelEditor.CreateMutatorListCampaign
  • Home Base: ScrollingMenu.SortUnlocks
  • Level: LevelEditor.CreateMutatorListLevel

Describe the alternatives

No response

[Bug] MoneyA has the same shadow size as MoneyB and MoneyC

Describe the bug

MoneyA has the same shadow size as MoneyB and MoneyC.

To Reproduce

  1. Create a local multiplayer game;
  2. Split-drop money until MoneyA sprite is displayed;
  3. See the bug.

Expected behavior

MoneyA to have a smaller shadow.

Screenshots

2

Information

  • Operating system: Windows 64-bit
  • Version of the game: v94
  • Version of RogueLibs: v3.0.0-rc.2
  • Other installed mods: SpritePackLoader

[Bug] Version text overlaps the inventory toolbar, if it's plus-shaped

Describe the bug

When someone plays with a controller, the inventory toolbar is plus-shaped, and the version text ("SoR v98, RL v4.0.0-beta.8") is rendered on top of it.

Expected behavior

When someone plays with a controller, the inventory toolbar and the version text don't overlap. If "SoR v98" is moved one line higher, RL's version text won't get in the way, if the version is stable (without SemVer pre-release identifiers).

Screenshots and logs

No response

What operating system are you on?

Windows 64-bit

What version of the game are you running?

v98

What version of RogueLibs are you running?

v4.0.0-beta.8

Installed mods

No response

Trait/Mutator Conflicts

Describe the problem

There's currently no simple way to register conflicts between Traits and Mutators. Some traits might be pointless for a player to take with a certain mutator. E.g., Lock & Load + Unlimited Ammo.

Describe the solution

Add lists to

Relevant vanilla code: ScrollingMenu.CanHaveTrait

Describe the alternatives

No response

[Bug] Dropped/spawned items are sometimes purple

Describe the bug

Dropped/spawned items are sometimes purple, when the player is not close to them.

To Reproduce

  1. Enable Sandbox and Sprite Testing Mode at Home Base;
  2. Get Sprite Pack Tester in the Item Teleporter;
  3. Use the Sprite Pack Tester;
  4. See the bug.

Expected behavior

Normal sprites to appear.

Screenshots

4

Information

  • Operating system: Windows 64-bit
  • Version of the game: v94
  • Version of RogueLibs: v3.0.0-rc.2
  • Other installed mods: SpritePackLoader

CustomMutator.IsActive does not work consistently

If player goes to Home Base, mutator shows as active but deactivates when going through elevator. It will stay active if you visit the Mutators hacker.

If player goes directly into Quick Start, mutator will not be active.

Add Custom content to LevelEditor lists

Describe the problem

Mutators are added to the Home Base menu, but not the Level Editor one

Describe the solution

Ensure this fix applies to all custom content, not just mutators

Describe the alternatives

No response

Weapon highlighting when held by NPCs

Describe the bug

A highlighted default spritesheet appears on the items held by NPCs.

To Reproduce

  1. Hover the cursor over any NPC holding an item.
  2. See the bug.

Expected behavior

A normal sprite to appear, without the highlighted spritesheet.

Screenshots

1

Information

Operating system: Windows 64-bit
Version of the game: v94
Version of RogueLibs: v3.0.0-rc.2
Other installed mods: SpritePackLoader

[Documentation] Unlocks Menus(?)

Is the issue related to an existing page?

No.

Describe the solution you'd like

Create a documentation page about unlocks menus. More info on how they work with RogueLibs' patches, possible caveats.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.