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

Display a special welcome message when the plugin is first installed #402

Open
jmakhack opened this issue Nov 16, 2022 · 4 comments
Open
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed java Pull requests that update Java code up for grabs Any issue that is up for grabs
Milestone

Comments

@jmakhack
Copy link
Owner

jmakhack commented Nov 16, 2022

Feature Reasoning

It would be nice to have an initial message displayed when first downloading and installing the plugin on how to get started with using the plugin.

Feature Description

When the plugin is first installed, there should be a special welcome message displayed to the user in the form of a chat game message.

It should be something like:
Welcome and thanks for installing the RuneLite Hydrate Reminder plugin v2.0.0!
Adjust settings in the plugin configuration menu and type "::hr help" in chat to view available commands.

If the user installs the plugin before actually logging in the OSRS, the logic should wait until the user logs in before displaying the chat message.

Possible Alternatives

Any alternatives to the suggested install message can be suggested and implemented.

Additional Context

In order to get this to work and only display when the plugin is first installed, a flag should be added within hydrateReminderStats.json: installMessageFlag. This flag should be set to 0 by default and then set to 1 after the message has been displayed. As long as the flag is set to 1, the user should never see the install message ever again.

Please refer to CONTRIBUTING.md for info on how to setup, build, run, and test this project.

@jmakhack jmakhack added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers java Pull requests that update Java code up for grabs Any issue that is up for grabs labels Nov 16, 2022
@jmakhack jmakhack added this to the v2.0.0 milestone Nov 16, 2022
@dcechano
Copy link
Contributor

dcechano commented Dec 9, 2022

This could be implemented pretty easy. I'm having trouble however figuring out how to keep people with the plugin already installed from having the default flag once changes are released. How do we tell if the person is a fresh install or a returning user?

@jmakhack
Copy link
Owner Author

Hi @dcechano, this is a good point. There may be some method in the RuneLite API to determine if this is a fresh install or an upgrade for a returning user.

However since this next release is going to be a major v2.0 release, I wouldn't mind displaying a message for both situations. We can just adjust the message accordingly to be something like: Welcome and thanks for installing or upgrading to the RuneLite Hydrate Reminder plugin v2.0.0!

@dcechano
Copy link
Contributor

Hi @jmakhack, I've been working on a solution but I am having a lot of trouble coming up with a valid test. The issue is that I read and write from the hydrateReminderStats.json but the testing environment does not have access to this file. I tried mocking the file but Mockito cant Mock java.nio.file.Path and throws a org.mockito.exceptions.base.MockitoException. I created a couple Gists. Can you take a look?

HydrateWelcomeMessageDictionary.java
HydrateWelcomeMessageDictionaryTest.java

@jmakhack
Copy link
Owner Author

Hi @dcechano, sorry for such a late reply. If mockito is giving you issues with mocking the java.nio.file.Path methods then it will be tricky to write tests for the newly added isFreshInstall method.

In this case, I'll open a new issue to investigate how to best write unit tests for cases similar to this. You can open a pull request with the new code and for now, we can just test this functionality manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed java Pull requests that update Java code up for grabs Any issue that is up for grabs
Projects
None yet
Development

No branches or pull requests

2 participants