123ishaTest / igt-vue

A Vue project that consumes the igt-libray for developing incremental games.
https://123ishatest.github.io/igt-docs
MIT License
26 stars 8 forks source link

[SUGGESTIONS] List of possible suggestions #60

Open HLXII opened 3 years ago

HLXII commented 3 years ago

Been working with this framework for a bit. Just wanted to record all the small suggestions I've accumulated. Not sure how this list will be affected by the transition to an NPM package though.

Saving

There doesn't seem to be an entry in the docs for implementing saves. Adding some would be nice. Here are some suggestions for the saving implementation as well:

  1. Version Skew updates - Update functions that run when the save version doesn't match the current game version.
    • In addition to this, the base save framework should probably store the game version automatically as well.
    • This probably also really needs unit tests to make sure version skew update code doesn't break saves.
  2. Import/Export to file - Not sure why the framework doesn't have this already.
    • With this, there should probably be built methods for handling this (and maybe some built components as well).
  3. Docs on setting up saving for new features - Probably will be added to whenever you add a more in-depth explanation on how to create new features. Not sure if it's easy to tell you should extend the SaveData interface.
    • Is it possible to use generics in the Feature definition to force this somehow? Not too familiar with generics though...
  4. Pre-built saving helper functions - If we want to store complex data in the save like arrays, or objects, or arrays of objects, etc. Having a pre-built method for handling that would be nice.
  5. With the save documentation, mentioning the SAVE_KEY property in Game.ts would probably be good, as I found that out by skimming the code. That might also be something that's exported when this is transitioned to an NPM package though.

Hotkeys

  1. Describing a central location to actually add the Hotkeys would be good as well. It seems like they could be added anywhere based on the framework, but setting aside a central location would be easier for template users to understand.

Built-in UI

This section is mostly because I'm not that familiar with TailwindCSS yet.

  1. Modals - Again not too familiar with TailwindCSS yet, but it seems like modals might be a bit complicated to implement (at least compared to how Bootstrap has them pre-built). Having modals be part of the framework would be good.
  2. Tooltips - It seems like based on your showcases this was easily implemented. I can probably look through the source code there, but just thought to mention it here as well.
  3. Notifications - This also seems already built into the framework, there's just no documentation on it.
Ishadijcks commented 3 years ago

All great feedback!

Saving

  1. Good idea! That's definitely something I'd like to be added.
  2. True, would be nice if you could pick from a few encodings: 'base64' or 'something-with-a-key'.
  3. I'm planning a demo application that will handle most of this :). #62
  4. Interesting idea, it could work similar to the Developer Panel:
    save(): SaveField[] {
    return [
    new NumberField(this.money, 0).
    ]
    }
  5. See 3.

    Hotkeys

  6. The reason they can be added from anywhere is so you can define them in the initialization of your Feature. That way if you delete your feature, there is no more useless code hanging around.

Built-in UI

The main reason there is no docs on the UI yet, is that I wanted the project to be script first. After the library, all this stuff will be in the template, and explained in the demo.

  1. We can add SweetAlert to the dependencies. They make it super easy to show custom modals.
  2. Tooltips are handled with the .has-tooltip and .tooltip css classes.
  3. That's true.

Thanks gain for the feedback, very useful!