Coder Social home page Coder Social logo

atlanticaccent / starsector-mod-manager-rust Goto Github PK

View Code? Open in Web Editor NEW
33.0 1.0 1.0 2.04 MB

A mod manager for Starsector, a space fleet-battle and economics simulator. This time written in Rust.

Home Page: https://atlanticaccent.github.io/starsector-mod-manager-rust/

License: MIT License

Rust 95.44% Shell 1.53% JavaScript 3.03%
mod-manager starsector rust

starsector-mod-manager-rust's People

Contributors

atlanticaccent avatar thedukeoferl avatar

Stargazers

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

Watchers

 avatar

starsector-mod-manager-rust's Issues

Starsector version management

Potentially, allow mod profiles to encompass entire version of the game as well. This would mean that profiles would be tied not only to certain mod versions being available, but also certain starsector versions being installed and known.

Additional controls

  • Enable all
  • Disable all
  • Filters
    • Only outdated
    • Only unsupported
  • refresh
  • filter by [name, id, etc]
  • etc

Folder names are not preserved

ModManager should respect the names of the folders when updating a mod. Instead, it deletes an existing folder and creates mod-default one.

Reproduce

Organise your mods by renaming their default folders, for example:

000 LIBRARIES
001 LazyLib
002 MagicLib
003 GraphicsLib
010 UTILITIES
011 SomeUltility

Upgrade LazyLib - 001 LazyLib is replaced with LazyLib.2.6. Expected: 001 LazyLib is preserved as mod folder, contents updates.

Let user modify vmparams file from within app

This may be slightly beyond MVP, however it would be incredibly useful (I think).

Would need to pick where to put this: either in settings, or as some form of always visible widget, or in another modal entirely.

It may also be advisable to include warnings about the consequences of modifying vmparams values.

Definitely future work would include determining available system RAM to determine the limits of the values set through this feature, and estimating good vmparams values depending on the number/type of mods installed.

Warn of mod ID collisions on start/refresh

The application does not currently detect mod ID collisions (two mods installed with the same ID). This could be done on start, and present a warning to the user/the option to remove duplicates.

User facing logging

There's a couple of operations (primarily archive decompression) that can take a while - providing some feedback on their progress may be nice for users to see.

Having a history of actions would also be useful, though this would be even more useful if it were searchable or scrollable, rather than limited to a few of the most recent actions.

Enable and disable mods from mod list

  • On app startup, load the current configuration of enabled mods and indicate which mods are enabled in the mod list
  • Let user enabled a mod from the mod list
  • Let user disabled mod from the mod list

Break mod_list module into separate modules

The mod_list module currently contains, effectively, the entire core of the application. This was never the intention, however that is not necessarily an issue. What is an issue is the fact that, at this point, the length of the file now poses a maintainability issue, as it is difficult to track logic throughout the file. Multiple structs and submodules are contained within the module, and should thus be separated out into their own dedicated files.

7z support

compress-tools claims to support 7z files, but somethings seems to be going wrong there because my tests (on WSL) don't work, and it's not useable on Windows anywany.

Using the cxx crate, we may be able to either:

  • build our own wrapper around the most basic libarchive functions (ew, but necessary for linux, as demonstrated in the next point)
  • include the 7zip DLL and a wrapper around it, which gives us fantastically improved archive capabilities, but only on windows.

Refresh mod list on settings close only if install dir changes

Any time the mod list is reloaded, all data related to it is regenerated/re-requested. This results in both a waste of resources and an inconvenient user experience, as any time the mod list has reason to change, all mod version data has to be requested again and slowly displayed on the mod list.

The ideal result of solving this issue would be that mod version data is requested once for any mod, with the exception of mods that are installed or updated.

Allow resizing of columns in mods list

This would allow for each column to be resized to show any clipped/wrapped text. Would require finding a way to keep each entry the same height, or at least each cell in a row the same height.

Mod "profiles"

Mod profiles are specific named combinations of enabled mods that can be quickly loaded from a menu made available in the app. This would allows some users to quickly switch between differently modded playthroughs.

Possibly integrate with some kind of save management?

Support symbolically linked mod folders

Bug report indicates that folders that are represented in the mod folder by a symbolic link are invisible to the application/are not read.

I believe this stems from

as there is an additional file type for symlinks. Hopefully, just adding an or clause including symlinks here should be enough.

I'm currently attempting to build a test case to make sure the fix works.

Note: only some filesystems support symlinks (eg: NTFS does, exFAT doesn't)

Automate aspects of the mod update process

Most version files include links to the forum pages where an update can be found. The app could use system intents to automatically open a browser to this location when prompted to by a user.

If version files were to include direct links to the updated mod, this entire process could be automated. However, this would likely require petitioning of mod authors and the maintainers of the version file specification.

Export mod list

At very least export to a human readable list format that details:

  • Mod name
  • Mod version

Optionally, make list also machine readable, or have an option to produce a machine readable version that can then be imported (ie: imply the ability to import mod lists - track in separate issue).

A more advanced implementation may also include in the export forum links (if available) to support a hypothetical import function, which may notify a user on import if a mod in the list is not installed, and present the forum link for user's convenience.

Decompress mod archives into mods folder correctly

Decompress mod distributables/archives into folders, and only move the actual top-level mod folder. This means accounting for occasions where the mod folder itself is one or two layers deep into the archive (will require directory searching). Current approach also suggests that decompressing to a temporary location then moving the mod folder to the mods directory would be ideal.

Add debounce to install messages

When using the install from multiple archives functionality, many installation result messages can be generated in a short amount of time. Currently, these must all be individually acknowledged/dismissed before control returns to the main program - this can be very annoying for a user.

A solution is to add a "debounce" timer to messages. When the first message is received, it is added to a message queue and a timer started. If another message is received before the timer expires, it is added to the message queue and the timer reset. If the timer expires naturally then the entire contents of the message queue are printed. This will likely require the use of some kind of tokio timed future.

Utilise a virtual filesystem to reduce filesystem clutter

Using the rust-vfs crate (https://github.com/manuel-woelker/rust-vfs), archives could be extracted into memory, verified for integrity, and discarded afterwards. This means that if anything goes horribly wrong during installation, ideally nothing will actually be written to the actual filesystem.

This may not necessarily work, however. The current archive implementation simply calls out to different archive libs, which take as inputs archive paths and output directories. It remains to be seen if a virtual file path can simply dropped in as a replacement output for all these libs.

Make I/O intensive operations async

Archive decompression, file copying, etc are all time consuming, and will block the main application event loop until complete. Using something like Command::perform is the intended route, though this has been somewhat difficult to work with up till now.

Import mod list

Building on #33, allow for the importing of mod list in some manner.

This either means downloading, installing and enabling mods based on the list (generally unviable due to the lack of a central mod directory with download links) or enabling mods based on the list and mods already installed locally. Therefore:

  1. Iterate list
  2. For each list entry, check if mod is installed locally
    3a. If mod exists locally, set its enabled value to the value in the list entry
    3b. If mod does not exist locally, notify in some manner

Either notify before execution, or after, what mods are not installed locally but in the list, and if the former query if user wishes to continue.

[macOS] Freezes while browsing for Starsector install directory, and when setting (wrong?) directory manually

The macOS version of the mod manager launches correctly on macOS 10.14.6. However, when I go into Settings and click on Browse... to select the Starsector install directory, it opens up the Finder window, but then freezes, with the spinning beach ball of death. It does generate a crashlog with the system popup of whether you want to report after force-quitting, which I have attached in the hope it will be useful. It also froze when I set the install path manually to my users/username/applications directory, which is where Starsector is installed, with the following error message:

Alert:
Failed to parse mods folder. Mod list has not been populated.

Now it freezes with that error every time I open it - I presumably set the wrong directory. It would be useful to also in the setting's screen put which directory should be given - the one that Starsector is in, the Starsector.app itself, or the Mods folder.

Crash 1.txt is the log for the first case, Crash 2.txt for the second case.
Crash 2.txt

Crash 1.txt

Mod upgrading/mod ID collision checking

Currently, so long as two instances of a mod have differently named source archives/directories, they will be allowed to be installed alongside each other. All installed mods should have unique mod IDs, otherwise there is no way to distinguish between them.

As such, when installing a mod, there should be a check to ensure that no other mods with the same ID are already installed. An advanced implementation will also check for duplicates when parsing the mods directory on application start.

Add additional metadata to description box

Currently, things like authors and titles can get truncated quite easily/often. Adding this information in full to the description box in full when a mod is selected will go a ways to fixing that. Alternative solutions (like tooltips, or at least indicating truncation has occurred) should still be explored.

Start game from app

This might be pretty easy to do on unix (though it may not), however I have no idea where to start with this on Windows or OSX.

Minor styling improvements

  • Bolding
  • Italics
  • Underlines

I've made this issue to remember to come back to this at some point, and also to note a jank solution I've thought of that's ridiculously overkill:

  • Generate SVG text using svg crate + https://github.com /bodoni/svg/issues/8
  • Using the SVG and SVG::Handle widgets from Iced render SVG text

Long term solution to no text-wrapping in iced for mod entries

I really don't know how to do this nicely.

At the moment, iced doesn't provide configurable text shaping (I think that's the term?). Iced does automatically split text when it there's no more space on the current line, but it's not configurable beyond that.

Ideal solutions would be to:

  • insert ellipses to indicate that a string has not fit into the space available
  • Shrink and grow (to a maximum) rows to account for longer strings. This would be quite hard, but I can think of maybe a way to do it
    • Somehow get the width of the cell
    • somehow get the width of the string to go into the cell
    • check if string_width > cell_width
    • add space for a new line
    • repeat to max
    • Points one and two are the hardest, as they involve rendering without rendering (maybe?) and potentially private methods.

Configuration saving and loading

At the very least, save the Starsector install directory chosen in settings, load it on application startup, and save it again if it is ever changed later.

  • Load from file
  • Save to file
  • Update file

Crash on MacOS 10.15.2 due to missing libarchive

Hi,

the mod manager v 0.4.1 crashes on MacOS 10.15.2. It seems it does not ship with its dependency on libarchive.13. After installing libarchive.13 using homebrew the app is starting.

BTW: Thanks for your work!

Process:               starsector_mod_manager [19278]
Path:                  /private/var/folders/*/Starsector Mod Manager.app/Contents/MacOS/starsector_mod_manager
Identifier:            ???
Version:               0.4.1 (20210823.202941)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           starsector_mod_manager [19278]
User ID:               501

Date/Time:             2021-09-08 12:08:16.635 +0200
OS Version:            Mac OS X 10.15.2 (19C57)
Report Version:        12

Time Awake Since Boot: 350000 seconds
Time Since Wake:       1900 seconds

System Integrity Protection: enabled

Notes:                 Translocated Process

Crashed Thread:        0

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    DYLD, [0x1] Library missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Library not loaded: /usr/local/opt/libarchive/lib/libarchive.13.dylib
  Referenced from: /private/var/folders/*/Starsector Mod Manager.app/Contents/MacOS/starsector_mod_manager
  Reason: image not found

Settings page redesign

  • Rearrange close button
  • Add save and apply buttons
    • Save should write settings and close pane
    • Apply should write settings
    • Both should perform error checking

Mod version checking

Using the version files included with some mods, check that the mod is the most up to date version.

If a mod is out of date, provide a prompt (such as a colour coding or symbol) indicating that the mod is out of date, and provide information on the update, such as the new version number and where to get the updated mod.

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.