Giter Club home page Giter Club logo

Comments (2)

zer0Kerbal avatar zer0Kerbal commented on June 25, 2024

moved from SpaceYCorp because the Category.cfg is in this addon.

from spaceyexpanded.

zer0Kerbal avatar zer0Kerbal commented on June 25, 2024

Pull Request applied.

Theory of operation: When the user creates their own custom categories, KSP happily saves the whole shebang on the file <ksp_root>/GameData/Squad/PartList/PartCategories.cfg.

Problem: this file is injected into the GameDatabase as usual. However, while loading the game again with the PartCategories.cfg file already with the data, KSP merges the original confignode (or patch) with the PartCategories.cfg one. On every boot (or, better, on every time ModuleManager rebuilts the ConfigCache - what it does every time the PartCaregories.cfg changes).

A Module Manager patch will solve the situation, but MM has a catch: :HAS can't be used on 'including" root nodes (i.e., patches that start with "+" or Nodes without sufixes), and so there's no way to use ModuleManager to conditionally add the Node CUSTOM_PARTLIST_CATEGORY for SpaceY. Could not use % neither.

The solution, so, is to use :NEEDS. This one can be used on root nodes. And the code from #109 checks at startup if the thing is already on the GameDatabase and only tells MM to apply that :NEEDS when it's not, effectively preventing double patching on this node.

The PR doesn't automate the deployment, right now you need to manually copy the DLL from the bin folder into the destination (I suggest GameData/SpaceY/SpaceYLifters/Plugins).

The thing was compiled using .NET 3.5 and KSP 1.2.2 assemblies, and it will work on anything from 1.2.2. to the latest, 1.12.5. But if you don't care about allowing the thing to work on older KSP versions, you can retarget it to .NET 4.5 and KSP 1.12.5 assemblies - you will artificially reduce your potential audience, though.

You will need to adjust the Assemblies' paths to your rig before compiling. Don't forget to execute the T4 script Version.tt everytime you change the SpaceYLifters.version file (VisualStudio only does it when opening the project).

from spaceyexpanded.

Related Issues (20)

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.