jakcodex / muledump

all your mules are belong to you
BSD 3-Clause "New" or "Revised" License
43 stars 20 forks source link

Change vault display #1

Closed vinstaal0 closed 7 years ago

vinstaal0 commented 7 years ago

Currently the vault do not show the way they are ingame, we used to fix it with this:

var VAULTORDER = [ 0, 0, 0, 0, 0,26,21,17,22,27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,14,12,11,13,15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 6, 4, 7,10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 2, 1, 3, 8, 0, 0, 0, 0, 0, 69,57,45,33,19, 0, 0, 0, 0, 0,23,35,47,60,80, 67,55,43,29,16, 0, 0, 0, 0, 0,18,32,44,56,68, 70,58,46,34,20, 0, 0, 0, 0, 0,24,36,48,59,80, 80,63,49,37,25, 0, 0, 0, 0, 0,28,38,50,64,80, 80,65,53,41,30, 0, 0, 0, 0, 0,31,42,54,66,80, 80,80,61,51,39, 0, 0, 0, 0, 0,40,52,62,80,80,];

And that would fix it, but that seems to call all sorts of undefined errors

jakcodex commented 7 years ago

I'm guessing the undefined errors were fixed in 0.7.4. Some chest data was simply null or an empty object. That vault order is not throwing errors for me, tho vaults still aren't formed properly. Needs some tweaking. The cell isn't wide enough to support it.

Can you explain why 80 pads the edges? In the existing VAULTORDER there are no duplicate values.

Thanks.

jakcodex commented 7 years ago

Got it working. Just need to get the proper ids in where all the duplicate 80s are. For reference, vault 80 is the lower right corner vault.

jakcodex commented 7 years ago

Here's the correct vault object:

var VAULTORDER = [
    0, 0, 0, 26,21,17,22,27, 0, 0, 0,
    0, 0, 0, 14,12,11,13,15, 0, 0, 0,
    0, 0, 0, 9, 6, 4, 7,10, 0, 0, 0,
    0, 0, 0, 5, 2, 1, 3, 8, 0, 0, 0,
    69,57,45,33,19, 0, 23,35,47,60,73,
    67,55,43,29,16, 0, 18,32,44,56,68,
    70,58,46,34,20, 0, 24,36,48,59,72,
    75,63,49,37,25, 0, 28,38,50,64,74,
    77,65,53,41,30, 0, 31,42,54,66,76,
    79,71,61,51,39, 0, 40,52,62,78,80];

I will make a test branch for you to check it out.

vinstaal0 commented 7 years ago

Yeah I got that from somebody else, but we never got the complete list, I'll test it out tonight, cause currently no vaults are displaying.

Also about the extension, is it possible to whitelist or blacklist sites? Thanks

jakcodex commented 7 years ago

Check out the branch vaultorder1. In order to display the vaults the rowlength has to be increased to 11. This is a variable set in accounts.js, but letting it be user-changeable would break the vault layout. Be sure to update your accounts.js.

Having it set to 11 makes things quite wide too. I end up with a bit horizontal scrolling.

Regarding the extension, with version 0.7.4 I added new recommended settings for the CORS extention. This included changing the Intercepted URL filter to list just the Rotmg service. Check out the current README.md for more info.

vinstaal0 commented 7 years ago

Aha thanks, it now works fine (even with row length 9) for the amount of chests I have (like 25), but is there a reason why you only have a 1 chest space for the middle?

jakcodex commented 7 years ago

If you have all vault chests unlocked then the minimum width is 11. Spacing it so it is aesthetically similar to in-game would make the width 16. Getting excessive there.

Also, I had 4 vaults out of place in that previous var. Branch is updated again.

    var VAULTORDER = [
        0, 0, 0, 26,21,17,22,27, 0, 0, 0,
        0, 0, 0, 14,12,11,13,15, 0, 0, 0,
        0, 0, 0, 9, 6, 4, 7,10, 0, 0, 0,
        0, 0, 0, 5, 2, 1, 3, 8, 0, 0, 0,
        69,57,45,33,19, 0, 23,35,47,60,73,
        67,55,43,29,16, 0, 18,32,44,56,68,
        70,58,46,34,20, 0, 24,36,48,59,74,
        75,63,49,37,25, 0, 28,38,50,64,76,
        77,65,53,41,30, 0, 31,42,54,66,78,
        79,71,61,51,39, 0, 40,52,62,72,80];
jakcodex commented 7 years ago

Making it so you could customize the formatting wouldn't be too hard. A new, optional config key VAULTWIDTH could be set. This would be used to modify the mathematics inside arrangevaults(). As it stands, Muledump had hardcoded the vault width to 7.

vinstaal0 commented 7 years ago

Uhh, that last update broke it for me, now it won't load any of my accounts

jakcodex commented 7 years ago

Oh? Working peachy for me. What's it doing for you? In chrome, hit F12 and go to Console. Then try again. Logging should tell us.

jakcodex commented 7 years ago

I was able to replicate the issue. It's fixed on my end. So here's what I plan to do:

I've added the VAULTWIDTH key which will make supporting custom vaultorders a lot easier. I'm going to add a few predefined vault orders that people can choose between and then get the ui mechanics working for that.

Any thoughts or opinions on that?

Vault order configuration changing to look like:

//  support switching between multiple vault layouts
var vaultorders = [
    //  vaultlayout=0; full view
    {
        layoutname: "full",
        vaultwidth: 11,
        vaultorder:
            [0, 0, 0,26,21,17,22,27, 0, 0, 0,
            0, 0, 0, 14,12,11,13,15, 0, 0, 0,
            0, 0, 0, 9, 6, 4, 7, 10, 0, 0, 0,
            0, 0, 0, 5, 2, 1, 3, 8, 0, 0, 0,
            69,57,45,33,19, 0, 23,35,47,60,73,
            67,55,43,29,16, 0, 18,32,44,56,68,
            70,58,46,34,20, 0, 24,36,48,59,74,
            75,63,49,37,25, 0, 28,38,50,64,76,
            77,65,53,41,30, 0, 31,42,54,66,78,
            79,71,61,51,39, 0, 40,52,62,72,80]
    },
    //  vaultlayout=1; compact view
    {
        layoutname: "compact",
        vaultwidth: 5,
        vaultorder:
            [26, 21, 17, 22, 27,
            14, 12, 11, 13, 15,
            9, 6, 4, 7, 10,
            5, 2, 1, 3, 8,
            0, 0, 0, 0, 0,
            69, 57, 45, 33, 19,
            67, 55, 43, 29, 16,
            70, 58, 46, 34, 20,
            75, 63, 49, 37, 25,
            77, 65, 53, 41, 30,
            79, 71, 61, 51, 39,
            0, 0, 0, 0, 0,
            23, 35, 47, 60, 73,
            18, 32, 44, 56, 68,
            24, 36, 48, 59, 74,
            28, 38, 50, 64, 76,
            31, 42, 54, 66, 78,
            40, 52, 62, 72, 80]
    }
];

//  prepare selected vault layout (compact view is default)
var vaultlayout = ( window.vaultlayout && typeof vaultorders[window.vaultlayout] === 'object' ) ? window.vaultlayout : 1;
var vaultwidth = ( typeof vaultorders[vaultlayout] === 'object' && vaultorders[vaultlayout].vaultwidth ) ? vaultorders[vaultlayout].vaultwidth : ROW;
VAULTORDER = vaultorders[vaultlayout].vaultorder;
jakcodex commented 7 years ago

UI options added and pushed to the branch. Changing vault layout switches immediately. Option can be set per account.

I want to make it so if you add a custom vaultorder it will automatically be added to the options UI bit. Thinking I need to add a staticvars file as it wouldn't be reasonable to ask people to add vaultorder to their accounts.js. Reason for this is because vaultorder isn't currently available to options.js due to processing order. This will be in the next commit.

jakcodex commented 7 years ago

This is all set. I added your layout under the name 'wide'. Working on a few more things then will release 0.7.5.

jakcodex commented 7 years ago

Okay I lied. While attempting to break the new code I found a handful of obscure bugs (relating to #2 implementation). Working on it.

jakcodex commented 7 years ago

This has been released in v0.7.5.

vinstaal0 commented 7 years ago

Thanks man, this version of Muledump has been the best for me so far!