tagpro-game / tagpro-issues

Public repository to report and review TagPro bugs, enhancements and suggestions.
15 stars 4 forks source link

[suggestion] Make the NS object on the group page global #298

Open wilcooo opened 6 years ago

wilcooo commented 6 years ago

The in-game TagPro API is awesome and powerful, but on the group page all relevant variables are hidden :(. It would be awesome if the namespace object that is called n in the minified code would be global.

var n = {
    self:               null,
    players:            {},
    privateGame:        $(".group.container").hasClass("js-private-game"),
    privateGroup:       !1,
    currentGamePort:    null,
    chat:               [],
    selfAssignment:     !1,
    settings:           {},
    defaults:           { /*...*/ }
    maxPlayers:         0,
    maxSpectators:      0
};

I currently have to keep track of these variables myself by listening to all sockets (the socket object is global), but it would be much easier if the var above was somehow globally accesible. It would be small step for a mod, but a giant leap for mod-creators.