When a to-do is checked off, the rewards are increased by the number of checklist items that have been completed. However as reported in https://github.com/HabitRPG/habitrpg/issues/3474, if the to-do is later un-checked, then the rewards subtracted are not being similarly increased by the number of checklist items completed. This fix will change that - the number of checklist items completed will have an equal effect on checking and unchecking a to-do. This of course won't fix the problem of, upon unchecking, not being able to calculate the exact value of the rewards that had been given upon checking, so there will still be a discrepancy between checking and unchecking, but it will be much smaller than it is currently.
Shared resources useful for the multiple HabitRPG repositories, that way all the repositories remain in-sync with common characteristics. Includes things like:
- Assets - sprites, images, etc
- CSS - especially, esp. sprite-sheet mapping
- Algorithms - level up algorithm, scoring functions, etc
- View helper functions that may come in handy for multiple client MVCs
- Item definitions - weapons, armor, pets
##Installation
-
npm install -
grunt- after you've made modifications and want to compile the dist files for browser -
Node.js
require ('coffee-script')require('./script/algos.coffee'),require('./script/helpers.coffee'), etc.
-
Browser
- Use
<script/>tag to include ./dist/habitrpg-shared.js it will exportwindow.habitrpgSharedobject. - // Use `browser.debug.js' if you want to have sourcemaps. - EDIT: Only one file now, and it has sourcemaps. Fix this
- Use
-
Note how to invoke scoring function:
algos.score(user, task, direction), etc- TODO document all the functions
##Tests
npm test
##CSS Shared CSS between the website and the mobile app is a fuzzy area. Spritesheets definitely go in habitrpg-shared (since mobile uses them too). Other things, like customizer buttons, may want to go here? As you find sharable components, (1) move them from the website into habitrpg-shared, (2) remove from website & make sure all html/css references are updated.
Currently, all or most spritesheets are available. They're in css/*.css, but that's not what you want. You want /spritesheets.css
which is the concat'd file (using grunt) which includes all the spritesheets. I'd prefer this be in /dist/spritesheets.css
for consistency, but it's having image referencing weirdness
