Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow installing plugins #267

Closed
wants to merge 36 commits into from

Conversation

catornot
Copy link
Contributor

not sure about the whole thing.

also I merged #266 because I can't wait

@catornot catornot marked this pull request as ready for review April 17, 2023 17:05
@GeckoEidechse GeckoEidechse changed the title Install Plugins feat: Allow installing plugins Apr 17, 2023
@GeckoEidechse
Copy link
Member

Is there a plugin on Thunderstore yet to test this against? ^^

@catornot
Copy link
Contributor Author

Is there a plugin on Thunderstore yet to test this against? ^^

kyurid

@GeckoEidechse
Copy link
Member

GeckoEidechse commented Apr 19, 2023

As @ASpoonPlaysGames said here, a warning whenever a plugin is installed would be nice.

So like when you install a mod with plugin, it should show some pop-up requiring install confirmation (next to limiting plugin install to dev mode for now)

EDIT: @EladNLG had a good idea of adding an unskippable 5sec timer to the pop-up to prevent accidental confirms etc.

Thing is, I have no idea how to go Vue/TS -> Rust -> Vue/TS -> Rust without getting super ugly, so not sure if I can help you on that part :/

(Still haven't gotten around to testing btw, sorry about that).

@catornot
Copy link
Contributor Author

this will be the first and last time I work on the frontend

@catornot
Copy link
Contributor Author

added a warning to the installing process with an option to cancel the install

Copy link
Member

@GeckoEidechse GeckoEidechse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, so from quick testing trying to install kyurid I noticed that:

  • There was a second pop-up after some delay when installing plugin which is a bit confusing. Better would be to disable/enable the OK button (UI development is pain)
  • Because the Thunderstore mod only ships a plugin but no Northstar mod, FlightCore is unable to detect it as installed. Not sure how to solve that. Maybe we need to rework something in FlightCore, maybe we should rework plugin spec a bit
    Plugins detection and displaying #294
  • Enable plugin install, going to another view, and going back to DevView, shows it as disabled again. To resolve, you can add a new variable to FlightCoreStore tracking the state (https://github.com/R2NorthstarTools/FlightCore/blob/main/src-vue/src/plugins/store.ts#L61-L87).
  • Might even wanna persist it but don't worry to much about that part, we can look at that together later ^^

@catornot
Copy link
Contributor Author

so now

  1. the warning popups don't overlay but I did remove the 5 second wait since I have no idea how to implement properly.
  2. the disabled/enabled text in DevView updates correctly now

for the plugins not showing up as installed. I am not sure what would be the best way but I have some ideas.

  1. install a dummy mod in mods with data about plugins that came with it
  2. add a file to plugins folder to keep track of plugins's origin

@GeckoEidechse
Copy link
Member

CI failure on Windows is likely unrelated to this PR and cause by Rust toolchain update, see also #280

Copy link
Member

@GeckoEidechse GeckoEidechse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another quick skim.

As for forced timer on popup, I might poke Alystrasz to implement it later... :>

src-vue/src/plugins/store.ts Outdated Show resolved Hide resolved
src-vue/src/plugins/store.ts Outdated Show resolved Hide resolved
src-vue/src/plugins/store.ts Outdated Show resolved Hide resolved
src-tauri/src/main.rs Show resolved Hide resolved
@GeckoEidechse
Copy link
Member

I fixed CI issue on main now btw, so just update with main to get it resolved ^^

Copy link
Member

@GeckoEidechse GeckoEidechse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like something broke when merging recent main ._.

image

@catornot
Copy link
Contributor Author

Looks like something broke when merging recent main ._.

should be fixed now

Copy link
Contributor

@Alystrasz Alystrasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plugins don't appear as "installed" on online mods view, while they correctly appear as Thunderstore mods on local view:

image

image


Otherwise, features seems to be working correctly, I could install the Furnace plugin on my Ubuntu 23.04.

I however couldn't launch the game:


[SCRIPT UI] [errr] [SCRIPT UI] [error] COMPILE ERROR Undefined variable "FurnaceGetGrid"
[SCRIPT UI] [errr] [SCRIPT UI] [error] ui_furnace.nut line [11] column [48]

(you probably should add the mod repository URL to your plugin readme)

src-tauri/src/mod_management/mod.rs Outdated Show resolved Hide resolved
src-vue/src/i18n/lang/en.json Outdated Show resolved Hide resolved
src-vue/src/plugins/store.ts Outdated Show resolved Hide resolved
@catornot
Copy link
Contributor Author

catornot commented May 15, 2023

Plugins don't appear as "installed" on online mods view, while they correctly appear as Thunderstore mods on local view:

yes, this pr doesn't cover that
#294 does

Otherwise, features seems to be working correctly, I could install the Furnace plugin on my Ubuntu 23.04.

uh should work on main

this prs installs plugins into subdirs and since 1.14.2 plugins v2 can't load plugins from subdirs Furnace doesn't work :(

@catornot
Copy link
Contributor Author

more conflicts >:(
and also it would quite not pog if this doesn't get merged before soon:tm: plugins v3 pr

@GeckoEidechse
Copy link
Member

more conflicts >:(

Had quite some code refactoring going on the last week or so but should be better now ^^
Just resolve merge conflicts and we can do another round of review

src-tauri/Cargo.lock Outdated Show resolved Hide resolved
.join(&game_install.game_path)
.join("R2Northstar")
.join("plugins");
let temp_dir = TempDir::create(plugins_directory.join("___flightcore-temp-plugin-dir"))?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still open ig

src-tauri/src/plugin_management/download.rs Show resolved Hide resolved
@catornot
Copy link
Contributor Author

I don't want to deal with this anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants