Code Monkey home page Code Monkey logo

openrct2-statistics's Introduction

OpenRCT2 Statistics

A way for you to track your in-game statistics (overall and per-park) such as:

  • Time you've spent in-game

...that's all you need, right?

Getting the plugin

Important

Requires OpenRCT2 v0.4.0 or newer.

Download the .js file from the latest release and place it in the "plugin" folder. This can be found by opening OpenRCT2 and selecting "Open custom content folder" under the toolbox in the main menu.

Future development

Okay, so there might be other statistics you would want to track in-game. These have not been implemented yet. Some ideas which come to mind:

  • Scenarios beaten
  • Multiplayer messages sent
  • Rides built
  • Rides crashed
  • Guests drowned

Some of these would require an update to openrct2.d.ts to track, though some can be implemented right now with contributions!

If you're feeling motivated, you can contribute to this project following the guidelines in CONTRIBUTING.md.

openrct2-statistics's People

Contributors

katiezeldakat avatar ltssmitty avatar

Stargazers

 avatar  avatar

Watchers

 avatar

openrct2-statistics's Issues

Set a minApiVersion on a widget-by-widget basis

As more features get added to the plugin API, more statistics may be added to take advantage of the increased data. However, this also poses the risk of people still using older versions which cannot track these statistics. As it stands, there is no check to ensure players are using a compatible version of the plugin API.

There exists a minApiVersion when registering a plugin, but for the purposes of this project, this is not a good fit. Say, a player wishes to track time spent in parks. However, they are using the previous version of the plugin API after we updated to track a brand new statistic. Well, the player doesn't need to track that new statistic, but we are locking them out despite time tracking still having support.


The proposed solution is to make a new class: UnsupportedStatistic. It will extend Statistic so it may be returned in its place when being added to the StatController. It should have a very basic definition, where the only thing needed is the API version that needs to be supported. It should override the get widget() method to display to the player what version of OpenRCT2 is needed to track the statistic. Priority should be taken to main releases (i.e. v0.4.1 or v0.3.0), and only if there hasn't been an main release should a develop version be suggested (and for simplicity, suggesting the most recent develop version should be fine).

No documentation states a minimum OpenRCT2 version to run

This plugin is intransient, and as such, works only with OpenRCT2 v0.4.0 or newer. Nothing in the documentation states this. This should be in the README at a minimum (maybe in CONTRIBUTING.md, but this is likely not needed).

Icon to reset statistics does not display in versions older than v0.4.3

In OpenRCT2 v0.4.3 and onward, the reload icon displays as intended. In older versions, the plugin API doesn't have the ability to take a string and convert it to the image id. What complicates the matter is that the reload icon was only introduced in v0.4.2, so setting the value to a constant number will not solve the problem for older versions.


A proposed solution is to check for if the API version is less than that for v0.4.3 and use a different icon instead. Ideally one that would be the same across v0.4.0 to 0.4.2 (so most likely something in G1). Perhaps the sprite for demolish (5165)?

Add mechanism to show more detailed widgets

Users may be interested in seeing more stats than can fit into the small widget space. For instance, they might want to see a table view of how much they've played each day for the last month, and that wouldn't fit in the current main widget layout.

I'm interested in implementing a tab system, where each Statistic could have a detailedExtendedDisplay property (I'm not attached to this specific name) which would return a TabCreator. Then each Statistic with a detailedExtendedDisplay would get a new tab added to the window, and no tabs added for a Statistic that doesn't have an extended display.

I actually tried implementing this using just two tabs - the main content tab, and a single other tab with a dropdown that would let you select which extended display you'd like to view. Unfortunately, there isn't a concept of visibility hierarchy,(e.g. there's no way to set a parent horizontal visibility to "none" and have all its children also be turned to visibility none), so creating separate tabs is the only way I see to do this.

Another way to display more details could be to make the main window larger to fit bigger widgets. I like this less because I like the uniformity of the current createWidget() output, and it might be challenging to figure out how to add future new widgets if the main window is clogged up with these extended details.

Included is a proposed screenshot of what the tabs could look like. The flexUI window auto resizes the window height based on the size of the content in it, which I very much like. If it wasn't desirable, a static height could be used.

Would you be interested in seeing a PR of this, and if so how would you prefer I submit since I see there being 3 parts: a potential new Statistic, the architecture for an extended display, and some potential extended display implementation ideas.

image image

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.