Slimmmo / Slimmmo.github.io

AdVenture Capitalist calculator
http://slimmmo.github.io/
35 stars 42 forks source link

Profiles #46

Closed 61352151511 closed 8 years ago

61352151511 commented 8 years ago

DO NOT YET MERGE, READ ERROR BELOW

This adds the ability to have different profiles on the calculator (My feature request #18 finally). You can simultaneously calculate for your steam game, phone game, and tablet game, without having to export and import multiple saves.

Changes made: Uses a newer version of bootstrap, I did this to get the dropdown menu working, if there's a more minimalist way of doing it please let me know how and I will. The "Loaded Profile: {{profile}}" button is where the "Load saved state" file input was. That is now a button similar to the "Save State" button, "Save State" is now "Export State" and an "Import State" button is to the left of that. (These buttons are squished together, could not manage to seperate them a bit, perhaps this could be a later adjustment if it's an eye-soar) Should be backwards compatible with old saves, from what I can tell.

The only thing not changed over is the Export State/Import State, this does not export or import profiles, but rather just the currently loaded profile.

The only problem I can see is that when switching profiles this happens.

angular.min.js:107 Error: [$rootScope:inprog] http://errors.angularjs.org/1.4.4/$rootScope/inprog?p0=%24apply at Error (native) at https://rawgit.com/Zalth-One-Three/Slimmmo.github.io/master/js/angular.min.js:6:416 at q (https://rawgit.com/Zalth-One-Three/Slimmmo.github.io/master/js/angular.min.js:125:271) at n.$digest (https://rawgit.com/Zalth-One-Three/Slimmmo.github.io/master/js/angular.min.js:129:423) at loadExportedJson (https://rawgit.com/Zalth-One-Three/Slimmmo.github.io/master/js/main.js:215:12) at loadProfile (https://rawgit.com/Zalth-One-Three/Slimmmo.github.io/master/js/main.js:161:7) at n.$scope.switchProfile (https://rawgit.com/Zalth-One-Three/Slimmmo.github.io/master/js/main.js:1158:5) at fn (eval at (https://rawgit.com/Zalth-One-Three/Slimmmo.github.io/master/js/angular.min.js:212:346), :4:332) at f (https://rawgit.com/Zalth-One-Three/Slimmmo.github.io/master/js/angular.min.js:252:418) at n.$eval (https://rawgit.com/Zalth-One-Three/Slimmmo.github.io/master/js/angular.min.js:133:39)(anonymous function) @ angular.min.js:107(anonymous function) @ angular.min.js:80n.$apply @ angular.min.js:133(anonymous function) @ angular.min.js:252Hf.c @ angular.min.js:35

It does not seem to affect any functionality from my tests This seems to halt proper calculations for the recommendation table, and other places. Not sure where the code goes wrong, if you can see the error please point it out. You can test this by going to https://rawgit.com/Zalth-One-Three/Slimmmo.github.io/master/index.html Let me know what you think.

Slimmmo commented 8 years ago

I've actually got a working profile manager in a development version of the site (though you can't name profiles yet... I might steal your way of naming them though) which I've been holding off releasing because I want to get everything fully tested and there are some new features that need a lot of testing. I can release sooner and disable a couple of new features until they're fully tested though.

I think the error's being caused by the $scope.$digest() in loadExportedJson(). No real way to fix it that I know of other than not call it unfortunately.

EDIT: I'm getting a thing asking me if I want to hide additional boxes so I might not steal it.

61352151511 commented 8 years ago

Yea, whatever works for you. If you already have one working that's cool and maybe you could push it to a /dev/ folder on the site for people to try out

Slimmmo commented 8 years ago

Done. It's at http://slimmmo.github.io/dev/ but it's not at all a completed version. Some things that are working on the live version of the site don't work yet, other things don't work at all, etc.

61352151511 commented 8 years ago

Perhaps change the load buttons to be similar to how I have made it so that they look like the Save button and are closer together?