Skip to content

Instantly share code, notes, and snippets.

@torralbaa
Last active November 25, 2019 13:58
Show Gist options
  • Save torralbaa/3150211f5ecc5e6f6699a26e93dc4225 to your computer and use it in GitHub Desktop.
Save torralbaa/3150211f5ecc5e6f6699a26e93dc4225 to your computer and use it in GitHub Desktop.
Example Box Critters standard mod.
var itemSS,itemData;function World(t,e){console.info("-----------------------------------"),console.info("[BOX CRITTERS]"),console.info("A awesome world created by RocketSnail and modded by the community!"),console.info("-----------------------------------"),console.info("https://twitter.com/rocketsnail"),console.info("https://rocketsnail.com"),console.info("-----------------------------------"),this.events={},this.player,this.settings={lobby:"tavern"},this.critters={},this.symbols={},this.effects={},this.items={},this.stage=new createjs.Stage(t),this.stage.room=new createjs.Container,this.stage.menu=new createjs.Container,this.stage.gear=new createjs.Container,this.stage.addChild(this.stage.room),this.stage.addChild(this.stage.menu),this.stage.addChild(this.stage.gear),this.beep=new BeepContainer(850,480),this.stage.addChild(this.beep),this.map=new MapContainer(this),this.stage.addChild(this.map),this.room,e&&(this.socket=e,this.chat=new Chat(e,this),this.code=new Code(e,this),this.handleSocket(e,this));var i=this;createjs.Ticker.framerate=60,createjs.Ticker.on("tick",function(t){i.stage.update(t)})}function World(t,e){console.info("-----------------------------------"),console.info("[BOX CRITTERS]"),console.info("An awesome created by RocketSnail"),console.info("-----------------------------------"),console.info("https://twitter.com/rocketsnail"),console.info("https://rocketsnail.com"),console.info("-----------------------------------"),this.events={},this.player,this.settings={lobby:"tavern"},this.critters={},this.symbols={},this.effects={},this.items={},this.stage=new createjs.Stage(t),this.stage.room=new createjs.Container,this.stage.menu=new createjs.Container,this.stage.gear=new createjs.Container,this.stage.addChild(this.stage.room),this.stage.addChild(this.stage.menu),this.stage.addChild(this.stage.gear),this.beep=new BeepContainer(850,480),this.stage.addChild(this.beep),this.map=new MapContainer(this),this.stage.addChild(this.map),this.room,e&&(this.socket=e,this.chat=new Chat(e,this),this.code=new Code(e,this),this.handleSocket(e,this));var i=this;createjs.Ticker.framerate=60,createjs.Ticker.on("tick",function(t){i.stage.update(t)})}function Chat(t,e){this.socket=t,(this.world=t).on("message",function(t){})}function Code(t,e){this.socket=t,this.world=e}function calculateDistance(t,e,i,o){var s=i-t,n=o-e;return Math.sqrt(s*s+n*n)}function calculateAngle(t,e,i,o){var s=i-t,n=e-o,r=Math.atan2(s,n),a=Math.floor(180*r/Math.PI);return a<0?a+360:a}function findDirection(t){var e=Math.floor((t+22.5)/45);return 7<e?0:e}function Crumb(t){this.playerId=t.i,this.nickname=t.n,this.critterId=t.c,this.gear=t.g,this.rotation=t.r,this.speed=t.s,this.x=t.x,this.y=t.y,this.z=t.z}function Player(t){this.playerId=t.playerId,this.nickname=t.nickname,this.critterId=t.critterId,this.inventory=t.inventory,this.friends=t.friends,this.gear=t.gear||{},this.status,this.level,this.weapon,this.def=10,this.str=10,this.armour,this.isDead,this.gems=t.gems||0,this.coins=t.coins||0,this.coinsInBank,this.xp,this.hp=100,this.mp,this.gems;var e=this;localStorage.setItem("playerId",e.playerId),setInterval(function(){e.getPlayerId()!=e.playerId&&socket&&socket.disconnect()},1e4)}function recordEvent(t,e){}World.prototype.on=function(t,e){"object"!=typeof this.events[t]&&(this.events[t]=[]),this.events[t].push(e)},World.prototype.emit=function(t){var e,i,o,s=[].slice.call(arguments,1);if("object"==typeof this.events[t])for(o=(i=this.events[t].slice()).length,e=0;e<o;e++)i[e].apply(this,s)},World.prototype.handleSocket=function(t,e){t.on("connect",function(){console.info("CONNECTED"),console.info("-----------------------------------")}),t.on("disconnect",function(){}),t.on("login",function(t){recordEvent("login"),console.info("PlayerId:",t.player.playerId),console.info("Nickname:",t.player.nickname),console.info("-----------------------------------"),e.updatePlayer(t.player),e.settings.lobby&&e.joinRoom(e.settings.lobby)}),t.on("joinRoom",function(t){recordEvent("joinRoom",{roomId:t.roomId}),e.updateRoom(t),e.addMenu(t)}),t.on("A",function(t){e.room.addPlayer(t)}),t.on("R",function(t){e.room.removePlayer(t)}),t.on("G",function(t){e.room.updateGear(t)}),t.on("X",function(t){e.room.movePlayer(t)}),t.on("E",function(t){e.room.addEffect(t)}),t.on("M",function(t){e.room.showMessage(t)}),t.on("updatePlayer",function(t){e.player&&(e.player.updateData(t),t&&t.coins&&coinUI.update(t.coins))}),t.on("beep",function(t){e.beep.show(t)})},World.prototype.sendMessage=function(t){"/"===(t=t.trim()).substr(0,1)?this.code.sendCode(t):this.chat.sendMessage(t,function(t){var e={i:this.player.playerId,n:this.player.nickname,m:t};recordEvent("sendMessage"),this.room.showMessage(e)}.bind(this))},World.prototype.login=function(t){this.socket.open(),this.socket.emit("login",{ticket:t})},World.prototype.logout=function(){sessionStorage.clear(),this.socket.disconnect()},World.prototype.joinRoom=function(t){this.socket.emit("joinRoom",{roomId:t})},World.prototype.trigger=function(t){this.socket&&this.socket.emit("trigger")},World.prototype.updatePlayer=function(t){this.player=new Player(t)},World.prototype.updateCritters=function(t){this.critters=t},World.prototype.updateSymbols=function(t){this.symbols=t},World.prototype.updateEffects=function(t){this.effects=t},World.prototype.updateItems=function(t){this.items=t,this.itemSS=new createjs.SpriteSheet(this.items)},World.prototype.updateRoom=function(t){this.removeRoom(),this.room=new RoomContainer(t),this.stage.room.addChild(this.room),t.playerlist&&0<t.playerlist.length&&this.room.addPlayers(t.playerlist);var o=this;this.room.background.on("click",function(t){var e=Math.floor(t.localX),i=Math.floor(t.localY);o.socket&&o.socket.emit("click",{x:e,y:i}),o.player&&o.room.movePlayer({i:o.player.playerId,x:e,y:i})})},World.prototype.removeRoom=function(){this.room&&(this.stage.room.removeAllChildren(),delete this.room)},World.prototype.addMenu=function(t){this.removeMenu();var e=new RoomUI(this);this.stage.menu.addChild(e)},World.prototype.removeMenu=function(){this.menu&&this.stage.menu.removeAllChildren()},World.prototype.showMouse=function(){},World.prototype.hideMouse=function(){},World.prototype.on=function(t,e){"object"!=typeof this.events[t]&&(this.events[t]=[]),this.events[t].push(e)},World.prototype.emit=function(t){var e,i,o,s=[].slice.call(arguments,1);if("object"==typeof this.events[t])for(o=(i=this.events[t].slice()).length,e=0;e<o;e++)i[e].apply(this,s)},World.prototype.handleSocket=function(t,e){t.on("connect",function(){console.info("CONNECTED"),console.info("-----------------------------------")}),t.on("disconnect",function(){}),t.on("login",function(t){recordEvent("login"),console.info("PlayerId:",t.player.playerId),console.info("Nickname:",t.player.nickname),console.info("-----------------------------------"),e.updatePlayer(t.player),e.settings.lobby&&e.joinRoom(e.settings.lobby)}),t.on("joinRoom",function(t){recordEvent("joinRoom",{roomId:t.roomId}),e.updateRoom(t),e.addMenu(t)}),t.on("A",function(t){e.room.addPlayer(t)}),t.on("R",function(t){e.room.removePlayer(t)}),t.on("G",function(t){e.room.updateGear(t)}),t.on("X",function(t){e.room.movePlayer(t)}),t.on("E",function(t){e.room.addEffect(t)}),t.on("M",function(t){e.room.showMessage(t)}),t.on("updatePlayer",function(t){e.player&&(e.player.updateData(t),t&&t.coins&&coinUI.update(t.coins))}),t.on("beep",function(t){e.beep.show(t)})},World.prototype.sendMessage=function(t){"/"===(t=t.trim()).substr(0,1)?this.code.sendCode(t):this.chat.sendMessage(t,function(t){var e={i:this.player.playerId,n:this.player.nickname,m:t};recordEvent("sendMessage"),this.room.showMessage(e)}.bind(this))},World.prototype.login=function(t){this.socket.open(),this.socket.emit("login",{ticket:t})},World.prototype.logout=function(){sessionStorage.clear(),this.socket.disconnect()},World.prototype.joinRoom=function(t){this.socket.emit("joinRoom",{roomId:t})},World.prototype.trigger=function(t){this.socket&&this.socket.emit("trigger")},World.prototype.updatePlayer=function(t){this.player=new Player(t)},World.prototype.updateCritters=function(t){this.critters=t},World.prototype.updateSymbols=function(t){this.symbols=t},World.prototype.updateEffects=function(t){this.effects=t},World.prototype.updateItems=function(t){this.items=t,this.itemSS=new createjs.SpriteSheet(this.items)},World.prototype.updateRoom=function(t){this.removeRoom(),this.room=new RoomContainer(t),this.stage.room.addChild(this.room),t.playerlist&&0<t.playerlist.length&&this.room.addPlayers(t.playerlist);var o=this;this.room.background.on("click",function(t){var e=Math.floor(t.localX),i=Math.floor(t.localY);o.socket&&o.socket.emit("click",{x:e,y:i}),o.player&&o.room.movePlayer({i:o.player.playerId,x:e,y:i})})},World.prototype.removeRoom=function(){this.room&&(this.stage.room.removeAllChildren(),delete this.room)},World.prototype.addMenu=function(t){this.removeMenu();var e=new RoomUI(this);this.stage.menu.addChild(e)},World.prototype.removeMenu=function(){this.menu&&this.stage.menu.removeAllChildren()},World.prototype.showMouse=function(){},World.prototype.hideMouse=function(){},Chat.prototype.sendMessage=function(t,e){"/"===(t=t.trim()).substr(0,1)||(this.socket.emit("sendMessage",{message:t}),e&&e(t))},Code.prototype.sendCode=function(t){var e=t.split(" "),i=e.shift().substr(1).toLowerCase();switch(recordEvent("code",{code:i}),i){case"nicknames":this.toggleNicknames();break;case"balloons":this.toggleBalloons();break;case"join":var o=e[0];o&&world.joinRoom(o.toLowerCase());break;case"darkmode":toggleDarkmode&&toggleDarkmode();default:this.socket.emit("code",{code:i,options:e})}},Code.prototype.toggleNicknames=function(){var t=this.world.room.nicknames;t.visible?t.visible=!1:t.visible=!0},Code.prototype.toggleBalloons=function(){var t=this.world.room.balloons;t.visible?t.visible=!1:t.visible=!0},Crumb.prototype.get=function(t){return this[t]},this.log=this.log||{},function(){var t={showInfo:!0,showSend:!0,showRemote:!0,showCrumb:!0,showLog:!0,showMessage:!0};function e(t,e){}log.log=e,log.event=e,log.info=function(t,e){},log.send=function(t,e){},log.remote=function(t,e){},log.crumb=function(t,e){},log.message=function(t){},log.settings=t}(),Player.prototype.getPlayerId=function(){return localStorage.getItem("playerId")},Player.prototype.getCrumb=function(){return{i:this.playerId,n:this.nickname,c:this.critterId}},Player.prototype.updateData=function(t){t.gear&&(this.gear=t.gear),t.inventory&&this.inventory.push(t.inventory),t.critterId&&(this.critterId=t.critterId),t.coins&&(this.coins=t.coins)},Player.prototype.updateGear=function(t){world.socket.emit("updateGear",t)},Player.prototype.addItem=function(t){var e=this.getItemFromInventory(t);e&&(this.gear[e.slot]=e.itemId)},Player.prototype.removeItem=function(t){delete this.gear[t]},Player.prototype.isItemActive=function(t){for(var e in this.gear)if(this.gear[e]==t)return!0;return!1},Player.prototype.getItemFromInventory=function(t){for(var e=0;e<this.inventory.length;e++)if(this.inventory[e].itemId==t)return this.inventory[e]};var uxData={images:["/media/ux/ux.png"],frames:[[1,1,85,108,0,0,0],[1,111,104,86,0,0,0],[88,1,84,84,0,0,0],[107,87,84,84,0,0,0],[107,173,40,40,0,0,0],[149,173,40,40,0,0,0]],animations:{stats:{frames:[0]},box:{frames:[1]},item_active:{frames:[2]},item:{frames:[3]},close:{frames:[4]},open_btn:{frames:[5]}}},uxSS=new createjs.SpriteSheet(uxData);function AssetContainer(t){createjs.Container.call(this),this.data=t,this.name&&(this.name=t.name),this.x=t.x||0,this.y=t.y||0,this.edit=artwork.edit.clone(),this.edit.visible=!1,this.hitArea=this.edit,this.regX=t.regX||0,this.regY=t.regY||0;var o=this;this.on("pressmove",function(t){if(o.edit.visible){var e=Math.floor(t.stageX-world.room.x),i=Math.floor(t.stageY-world.room.y);o.x=e,o.y=i,o.data.x=e,o.data.y=i}})}function BalloonContainer(t){createjs.Container.call(this),this.x=t.x,this.y=t.y}function createBalloon(t,e){var i=e+20,o=t+20,s=new createjs.Shape;return s.graphics.setStrokeStyle(1).beginStroke("#888888").beginFill("#FFFFFF"),s.graphics.moveTo(5,0).arcTo(o,0,o,5,5).arcTo(o,i,o-5,i,5).lineTo(80,i).lineTo(70,i+10).lineTo(70,i).arcTo(0,i,0,i-5,5).arcTo(0,0,5,0,5),s.x=0-o/2,s.y=-10,s}function BeepContainer(t,e){createjs.Container.call(this),this.width=t,this.height=e}function BeepItem(t){this.mc=new createjs.Container;var e=new createjs.Graphics;e.beginFill("black"),e.drawRect(0,100,850,200);var i=new createjs.Shape(e);this.mc.addChild(i);var o=new createjs.Bitmap("/media/icons/"+t.itemId+".png");o.regX=80,o.regY=80,o.x=425,o.y=120,this.mc.addChild(o),t.name&&(t.title=t.name);var s=new createjs.Text(t.title,"40px Luckiest Guy","#ffffff");if(s.textAlign="center",s.lineHeight=40,s.lineWidth=400,s.x=425,s.y=210,this.mc.addChild(s),t.text){var n=new createjs.Text(t.text,"16px Arial","#AAAAAA");n.textAlign="center",n.lineWidth=300,n.x=425,n.y=250,this.mc.addChild(n)}}function CritterContainer(t){createjs.MovieClip.call(this),this.state="stand",this.isMoving=!1,this.isForward=!0,this.hasTail=!1,this.direction=4,this.framerate=30,this.loop=-1,this.regX=68,this.regY=140;var e=new createjs.SpriteSheet(t);this.bodyContainer=new createjs.Container,this.feetContainer=new createjs.Container,this.baseContainer=new createjs.Container,this.addChild(this.baseContainer,this.feetContainer,this.bodyContainer),this.skin=new createjs.Container,this.face=new createjs.Container,this.feet=new createjs.Container,this.tail=new createjs.Container,this.skin.sprite=new createjs.Sprite(e,"body4"),this.skin.addChild(this.skin.sprite),this.face.sprite=new createjs.Sprite(e,"smile4"),this.face.addChild(this.face.sprite),this.feet.sprite=new createjs.Sprite(e,"feet"),this.feetContainer.addChild(this.feet.sprite),t.animations.tail4&&(this.tail.sprite=new createjs.Sprite(e,"tail4"),this.tail.addChild(this.tail.sprite),this.hasTail=!0),this.slots={eyes:new SlotContainer,ears:new SlotContainer,head:new SlotContainer,hand:new SlotContainer,cape:new SlotContainer,neck:new SlotContainer,belt:new SlotContainer,mask:new SlotContainer,body:new SlotContainer,pack:new SlotContainer,ride:new SlotContainer},this.backs={eyes:new SlotContainer("back"),ears:new SlotContainer("back"),head:new SlotContainer("back"),cape:new SlotContainer("back"),neck:new SlotContainer("back"),belt:new SlotContainer("back"),body:new SlotContainer("back"),pack:new SlotContainer("back"),hand:new SlotContainer("back"),ride:new SlotContainer("back")},this.forward=[this.backs.ride,this.tail,this.backs.hand,this.backs.cape,this.backs.pack,this.backs.neck,this.backs.belt,this.backs.eyes,this.backs.ears,this.backs.head,this.backs.body,this.skin,this.face,this.slots.mask,this.slots.body,this.slots.head,this.slots.ears,this.slots.eyes,this.slots.pack,this.slots.neck,this.slots.belt,this.slots.cape,this.slots.hand,this.slots.ride],this.backward=[this.backs.ride,this.backs.hand,this.backs.cape,this.backs.pack,this.backs.neck,this.backs.belt,this.backs.ears,this.backs.eyes,this.backs.head,this.backs.body,this.skin,this.face,this.slots.eyes,this.slots.mask,this.slots.body,this.slots.head,this.slots.ears,this.slots.pack,this.slots.belt,this.slots.neck,this.slots.hand,this.slots.cape,this.tail,this.slots.ride];for(var i=0;i<this.forward.length;i++)this.bodyContainer.addChild(this.forward[i]);t.animations.shadow&&(this.baseContainer.sprite=new createjs.Sprite(e,"shadow"),this.baseContainer.addChild(this.baseContainer.sprite)),this.timeline.addTween(createjs.Tween.get(this.bodyContainer).wait(1).to({y:4}).wait(1).to({y:-12}).wait(1).to({y:-16}).wait(1).to({y:-8}).wait(1)),this.timeline.addTween(createjs.Tween.get(this.feetContainer).wait(2).to({y:-8}).wait(1).to({y:-16}).wait(1).to({y:-6}).wait(1)),this.timeline.addTween(createjs.Tween.get(this.baseContainer)),this.updateDirection(),this.stop()}function MapContainer(t){createjs.Container.call(this),this.world=t,this.tiles=[],this.tiles[0]=new createjs.Graphics,this.tiles[0].beginStroke("white").beginFill("rgba(0, 0, 0, 0.02)").drawRect(0,0,40,40),this.tiles[1]=new createjs.Graphics,this.tiles[1].beginStroke("white").beginFill("green").drawRect(0,0,40,40),this.tiles[2]=new createjs.Graphics,this.tiles[2].beginStroke("white").beginFill("yellow").drawRect(0,0,40,40),this.tiles[3]=new createjs.Graphics,this.tiles[3].beginStroke("white").beginFill("red").drawRect(0,0,40,40),this.tiles[4]=new createjs.Graphics,this.tiles[4].beginStroke("white").beginFill("blue").drawRect(0,0,40,40),this.data=[],this.layers=[],this.activeTile=0,this.activeMouse=!1}function MascotContainer(t){createjs.MovieClip.call(this),this.scaleX=1,this.scaleY=1,this.framerate=30,this.loop=-1,this.currentDirection,this.directionFrames=[0,1,3,3,4,5,5,7];var e=new createjs.SpriteSheet(t);this.sprite=new createjs.Sprite(e,"body4"),this.addChild(this.sprite),this.stop()}function MonsterContainer(t){createjs.MovieClip.call(this),this.scaleX=1,this.scaleY=1,this.framerate=30,this.loop=-1,this.currentDirection=4;var e=new createjs.SpriteSheet(world.critters[t.critterId]);this.sprite=new createjs.Sprite(e,"wait4"),this.addChild(this.sprite),this.on("click",function(){world.socket.emit("attack",t.playerId)}),this.stop()}function NicknameContainer(t){createjs.Container.call(this);var e=new createjs.Text(t.n,"12px Arial","#000000");e.textAlign="center",e.lineWidth=100,e.y=15,this.addChild(e),this.x=t.x,this.y=t.y}function PlayerContainer(t,e){createjs.Container.call(this),this.isLocal=e||!1,this.playerId=t.i,this.critterId=t.c,this.isMoving=!1,this.nickname,this.balloon,this.animation="none",this.speed=5,this.extra=t.e||{},this.x=t.x,this.y=t.y,this.z=t.z||0,this.r=t.r||180,this.direction=findDirection(this.r),this.targetX=t.x,this.targetY=t.y,"RocketSnail"==t.n?this.critter=new MascotContainer(world.critters[this.critterId]):"huggable"==t.c?this.critter=new MonsterContainer(this):this.critter=new CritterContainer(world.critters[this.critterId]),this.extra.scale?(this.critter.scaleX=this.extra.scale/2,this.critter.scaleY=this.extra.scale/2):(this.critter.scaleX=.5,this.critter.scaleY=.5),t.g&&this.updateGear(t.g),this.addChild(this.critter),this.updateDirection(this.direction),this.updateState("stand")}AssetContainer.prototype=Object.create(createjs.Container.prototype),BalloonContainer.prototype=Object.create(createjs.Container.prototype),BalloonContainer.prototype.showMessage=function(t){var e=t.m,i=new createjs.Container,o=new createjs.Text(e,"12px Arial","#000000");o.textAlign="center",o.lineWidth=100;var s=o.getBounds(),n=createBalloon(100,s.height);i.addChild(n,o),i.y=0-s.height-80,this.addChild(i);n=this;setTimeout(function(){n.removeChild(i)},5e3)},BeepContainer.prototype=Object.create(createjs.Container.prototype),BeepContainer.prototype.show=function(t){t&&t.alert&&this.alert(t.alert),t&&t.news&&this.message(t.news),t&&t.item&&this.grant(t.item)},BeepContainer.prototype.alert=function(t,e){log.info("alert",t);var i=new boot.Message({text:t},{style:"warning",width:340,height:100});i.setTransform(250,20),i.on("click",function(){i.close()}),this.addChild(i)},BeepContainer.prototype.message=function(t){var e=new boot.Message(t,{style:"light"});e.setTransform(250,20),this.addChild(e),e.on("click",function(){e.close()})},BeepContainer.prototype.grant=function(t){log.info("grant",t);var e=this,i=new createjs.Graphics;i.beginFill("black"),i.drawRect(0,0,this.width,this.height);var o=new createjs.Shape(i);o.alpha=.6,o.on("click",function(){e.removeAllChildren()}),this.addChild(o);var s=new BeepItem(t);this.addChild(s.mc)},CritterContainer.prototype=Object.create(createjs.MovieClip.prototype),CritterContainer.prototype.addItem=function(t,e){this.removeItem(t),this.slots[t]&&this.slots[t].addItem(e,this.direction),this.backs[t]&&this.backs[t].addItem(e,this.direction)},CritterContainer.prototype.removeItem=function(t){this.slots[t]&&this.slots[t].removeItem(),this.backs[t]&&this.backs[t].removeItem()},CritterContainer.prototype.updateGear=function(t){for(var e in this.slots)this.removeItem(e);for(var e in t)this.addItem(e,t[e])},CritterContainer.prototype.updateDirection=function(t){for(var e in void 0===t&&(t=this.direction),1<t&&t<7?(this.isForward||(this.isForward=!0,this.updateDepth()),this.face.sprite.gotoAndStop("smile"+t),this.face.visible=!0):(this.isForward&&(this.isForward=!1,this.updateDepth()),this.face.visible=!1),this.slots){this.slots[e].updateDirection(t)}for(var e in this.backs){this.backs[e].updateDirection(t)}this.skin.sprite.gotoAndStop("body"+t),this.hasTail&&this.tail.sprite.gotoAndStop("tail"+t),this.direction=t},CritterContainer.prototype.updateDepth=function(){if(this.isForward)var t=this.forward;else t=this.backward;for(var e=0;e<t.length;e++){var i=t[e];this.bodyContainer.setChildIndex(i,e)}},CritterContainer.prototype.updateState=function(t){"move"==t?(this.state=t,this.gotoAndPlay(0)):(this.state=t,this.gotoAndStop(0))},MapContainer.prototype=Object.create(createjs.Container.prototype),MapContainer.prototype.new=function(t,e,i){for(var o=Math.floor(t/i),s=Math.floor(e/i),n=[],r=0;r<s;r++){n[r]=[];for(var a=0;a<o;a++)n[r][a]=0}this.data=n},MapContainer.prototype.show=function(t){this.data=t||this.world.room.tileMap;for(var e=0;e<this.data.length;e++)for(var i=0;i<this.data[e].length;i++)this.addTile(i,e,this.data[e][i]);this.world.room.addChild(this)},MapContainer.prototype.addTile=function(t,e,i){var o=new createjs.Shape(this.tiles[i]);o.setTransform(40*t,40*e),o.alpha=.4;var s=this;o.on("click",function(){s.activeMouse&&(s.removeChild(this),s.addTile(t,e,s.activeTile))}),s.data[e][t]=i,s.addChild(o)},MascotContainer.prototype=Object.create(createjs.MovieClip.prototype),MascotContainer.prototype.updateDirection=function(t){void 0===t?t=this.currentDirection:this.currentDirection=t;var e=this.directionFrames[t];null!=e&&this.sprite.gotoAndStop("body"+e)},MascotContainer.prototype.addItem=function(){},MascotContainer.prototype.removeItem=function(){},MascotContainer.prototype.updateGear=function(){},MascotContainer.prototype.updateState=function(t){"move"==t?this.sprite.gotoAndPlay("body"+this.currentDirection):this.updateDirection()},MonsterContainer.prototype=Object.create(createjs.MovieClip.prototype),MonsterContainer.prototype.updateDirection=function(t){void 0===t?t=this.currentDirection:this.currentDirection=t,this.sprite.gotoAndStop("wait"+t)},MonsterContainer.prototype.addItem=function(){},MonsterContainer.prototype.removeItem=function(){},MonsterContainer.prototype.updateGear=function(){},MonsterContainer.prototype.updateState=function(t){"move"==t?this.sprite.gotoAndPlay("move"+this.currentDirection):this.updateDirection()},MonsterContainer.prototype.remove=function(){this.sprite.gotoAndPlay("done")},NicknameContainer.prototype=Object.create(createjs.Container.prototype),PlayerContainer.prototype=Object.create(createjs.Container.prototype),PlayerContainer.prototype.updateDirection=function(t){this.direction=t,this.critter.updateDirection(t)},PlayerContainer.prototype.updateRotation=function(t){this.character.rotation=t},PlayerContainer.prototype.updateState=function(t){this.critter.updateState(t)},PlayerContainer.prototype.updateGear=function(t){this.critter.updateGear(t)},PlayerContainer.prototype.updateLayer=function(t){this.z=t},PlayerContainer.prototype.remove=function(){this.parent.removeChild(this)},PlayerContainer.prototype.moveTo=function(t,e,i){if(!this.isMoving||this.targetX!=t||this.targetY!=e){void 0===i&&(i=Math.floor(calculateAngle(this.x,this.y,t,e))),this.isMoving=!0,this.targetX=t,this.targetY=e;var o=findDirection(i);this.updateDirection(o),this.updateState("move");var s=calculateDistance(this.x,this.y,t,e)*this.speed,n=this;this.tween=createjs.Tween.get(this,{override:!0}).to({x:t,y:e},s,createjs.Ease.linear).call(function(){this.isMoving=!1,this.updateState("stand"),this.nickname.x=this.x,this.nickname.y=this.y,this.balloon.x=this.x,this.balloon.y=this.y,n.handleStop()}).addEventListener("change",function(){n.nickname.x=n.x,n.nickname.y=n.y,n.balloon.x=n.x,n.balloon.y=n.y,n.handleMove()})}},Player.prototype.handleMove=function(){},Player.prototype.handleStop=function(){};var coinUI,artwork=artwork||{};function RoomContainer(t){createjs.Container.call(this),this.data=t,this.name=t.name,this.width=t.width,this.height=t.height,this.tileSize=t.map.tileSize||40,this.tileMap=t.map.tileMap,this.maxLayer=0,this.startx=t.startx||Math.floor(this.width/2),this.starty=t.starty||Math.floor(this.height/2),this.startz=t.startz||0,this.layers=[],this.assets={},this.foreground=new createjs.Container,this.playground=new createjs.Container,this.background=new createjs.Container,this.addChild(this.background),this.addChild(this.playground),this.addChild(this.foreground),this.balloons=new createjs.Container,this.nicknames=new createjs.Container,this.addChild(this.nicknames),this.addChild(this.balloons),t.background&&this.addBackground(t.background),t.foreground&&this.addForeground(t.foreground),this.symbols=new createjs.SpriteSheet(world.symbols),this.effects=new createjs.SpriteSheet(world.effects),this.spritesheet=new createjs.SpriteSheet(t.spritesheet),t.layers&&this.addLayers(t.layers),this.players={},this.editor=new createjs.Container,this.addChild(this.editor)}function SlotContainer(t){createjs.Container.call(this),this.type=t||"front"}function Coins(){createjs.Container.call(this);var t=new createjs.Bitmap("/media/ui/coins_background.png");this.text=new createjs.Text("100","60px Luckiest Guy","#FFC636"),this.text.setTransform(100,32),this.addChild(t,this.text)}function Inventory(e){createjs.Container.call(this);var i=this;this.player=e;var t=new Background,o=new CritterContainer(world.critters[e.critterId]);o.setTransform(660,140);for(var s=[],n={},r=e.inventory.length,a=0;a<r;a++){var h=e.inventory[a],c=new boot.Item("/media/icons/"+h.itemId+".png");c.data=h,e.gear[h.slot]==h.itemId&&(n[h.slot]=c,o.addItem(h.slot,h.itemId),c.setActive(!0)),c.click(function(){var t=this.data.slot;this.isActive?(o.removeItem(t),delete n[t],this.setActive(!1)):(o.addItem(t,this.data.itemId),n[t]&&n[t].setActive(!1),(n[t]=this).setActive(!0)),recordEvent("click",{button:"item"})}),s.push(c)}var l=new boot.Grid(600,400,6,4,s);l.setTransform(20,20);var d=new boot.Icon("close");d.setTransform(790,20),d.click(function(){for(var t in e.gear={},n)e.gear[t]=n[t].data.itemId;world.player.updateGear(e.gear),recordEvent("updateGear"),i.close()});var p=new boot.Button("Next Page");p.setTransform(140,420),p.click(function(){l.nextPage()});var f=new boot.Button("Last Page");f.setTransform(20,420),f.click(function(){l.lastPage()}),this.addChild(t,l,o,p,f,d)}function Background(){createjs.Container.call(this);var t=new createjs.Graphics;t.beginFill("black"),t.drawRect(0,0,850,480);var e=new createjs.Shape(t);e.alpha=.6,e.on("click",function(){}),this.addChild(e)}function RoomUI(e){createjs.Container.call(this);var t=new boot.Icon("box");t.setTransform(760,420,.5,.5),t.click(function(){var t=new Inventory(e.player);e.stage.menu.addChild(t),recordEvent("click",{button:"inventory"})});var i=new boot.Icon("stats");i.setTransform(700,410,.5,.5),i.click(function(){recordEvent("click",{button:"stats"})}),this.addChild(t,i);var o=new Coins;o.setTransform(10,10,.3,.3),o.update(e.player.coins),o.on("click",function(){}),this.addChild(o),coinUI=o}function Beep(t,e){createjs.Container.call(this),this.width=t||850,this.height=t||480,this.addChild(this.messages,this.screens)}artwork.edit=new createjs.Bitmap("/media/ui/edit_btn.png").setTransform(-10,-10,.5,.5),artwork.crosshair=new createjs.Shape((new createjs.Graphics).setStrokeStyle(1).beginStroke("black").moveTo(-10,0).lineTo(10,0).moveTo(0,-10).lineTo(0,10)),RoomContainer.prototype=Object.create(createjs.Container.prototype),RoomContainer.prototype.addBackground=function(t){var e=new createjs.Bitmap(t);e.hitArea=new createjs.Shape((new createjs.Graphics).f("#FF0000").drawRect(0,0,this.width,this.height)),this.background.addChild(e)},RoomContainer.prototype.addForeground=function(t){var e=new createjs.Bitmap(t);e.hitArea=new createjs.Shape((new createjs.Graphics).f("#FF0000").drawRect(0,0,0,0)),this.foreground.addChild(e)},RoomContainer.prototype.addLayers=function(t){this.layers=[];for(var e=0;e<t.length;e++){var i=new createjs.Container;i.addEventListener("tick",function(t){t.target.children.sort(function(t,e){return t.y-e.y})}),this.playground.addChild(i),this.layers[e]=i,t[e]&&this.addAssets(i,t[e]),this.maxLayer=e}},RoomContainer.prototype.addAssets=function(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.group?this.addGroup(o,t):o.image?this.addImage(o,t):o.symbol?this.addSymbol(o,t):this.addSprite(o,t)}},RoomContainer.prototype.showEditor=function(e){this.editor.removeAllChildren(),this.layers.forEach(function(t){t.children.forEach(function(t){t.edit&&(t.edit.visible=e)})})},RoomContainer.prototype.showMap=function(t){this.editor.removeAllChildren()},RoomContainer.prototype.addImage=function(t,e){e=e||this.layers[0];var i=new AssetContainer(t),o=new createjs.Bitmap(t.image);i.addChild(o,i.edit),e.addChild(i)},RoomContainer.prototype.addSymbol=function(t,e){var i=new AssetContainer(t),o=new createjs.Sprite(this.symbols);o.gotoAndPlay(t.symbol),i.addChild(o,i.edit),e.addChild(i)},RoomContainer.prototype.addEffect=function(t){var e=t.z||0,i=this.layers[e],o=t.e||"smoke_green";if(world.effects&&world.effects.animations[o]){var s=new createjs.Sprite(this.effects);s.gotoAndPlay(o),s.x=t.x,s.y=t.y,s.on("animationend",function(t){t.target.parent.removeChild(s)}),i.addChild(s)}},RoomContainer.prototype.addSprite=function(t,e){var i=new AssetContainer(t);if(t.symbol){var o=new createjs.Sprite(this.symbols);t.frame=t.symbol}else o=new createjs.Sprite(this.spritesheet);t.sprite&&(t.frame=t.sprite),"string"==typeof t.frame?o.gotoAndPlay(t.frame):o.gotoAndStop(t.frame),"Obj_ShipWall"==t.sprite&&(this.wall=i),i.addChild(o,i.edit),e.addChild(i)},RoomContainer.prototype.addGroup=function(t,e){var i=new AssetContainer(t);if(t.group)for(var o=t.group.length,s=0;s<o;s++)this.addSprite(t.group[s],i);i.addChild(i.edit),e.addChild(i)},RoomContainer.prototype.addPlayers=function(t){for(var e=t.length,i=0;i<e;i++)this.addPlayer(t[i])},RoomContainer.prototype.addPlayer=function(t){var e=t.i;if(t.x=t.x||this.startx,t.y=t.y||this.starty,t.z=t.z||this.startz,null==this.players[e]){if(world.player.playerId==e)var i=!0;else i=!1;var o=new PlayerContainer(t,i);this.layers[o.z].addChild(o),(this.players[e]=o).balloon=new BalloonContainer(t),this.balloons.addChild(o.balloon),o.nickname=new NicknameContainer(t),this.nicknames.addChild(o.nickname),o.isLocal&&this.focus(o);var s=this;o.handleMove=function(){this.isLocal&&s.focus(this);var t=s.getTile(this.x,this.y),e=t-1;0<t&&e<=s.maxLayer&&this.z!=e&&(this.updateLayer(e),s.swapLayer(this,e),this.isLocal&&world.room.wall&&(world.room.wall.visible=0!=e))},o.handleStop=function(){this.isLocal&&(s.focus(this),world.trigger({x:this.x,y:this.y}))}}},RoomContainer.prototype.getPlayer=function(t){return this.players[t]},RoomContainer.prototype.removePlayer=function(t){var e=t.i,i=this.getPlayer(e);i&&(this.balloons.removeChild(i.balloon),this.nicknames.removeChild(i.nickname),i.remove(),delete this.players[e])},RoomContainer.prototype.getTile=function(t,e){var i=Math.floor(t/this.tileSize),o=Math.floor(e/this.tileSize);if(this.tileMap&&this.tileMap[o])return this.tileMap[o][i]},RoomContainer.prototype.updateGear=function(t){var e=this.getPlayer(t.i);e&&e.updateGear(t.g)},RoomContainer.prototype.getLayer=function(t){return this.layers[t]},RoomContainer.prototype.swapLayer=function(t,e){this.getLayer(e).addChild(t)},RoomContainer.prototype.showMessage=function(t){"RocketSnail"==t.n?console.info("%c💬 "+t.n+": "+t.m,"font-size:medium; color:green"):console.info("%c💬 "+t.n+": "+t.m,"font-size:medium");var e=this.getPlayer(t.i);e&&e.balloon.showMessage(t)},RoomContainer.prototype.movePlayer=function(t){this.getPlayer(t.i).moveTo(t.x,t.y,t.r)},RoomContainer.prototype.focus=function(t){var e=t.x,i=t.y;850<this.width&&(425<e?e<this.width-425?this.x=425-e:this.x=850-this.width:this.x=0),480<this.height&&(240<i?i<this.height-240?this.y=240-i:this.y=480-this.height:this.y=0)},SlotContainer.prototype=Object.create(createjs.Container.prototype),SlotContainer.prototype.addItem=function(t,e){var i=world.items.items[t];i?i&&i[this.type]&&(this.removeItem(),this.item=i,this.sprite=new createjs.Sprite(world.itemSS,0),this.addChild(this.sprite),this.updateDirection(e)):console.error("Item not found",t)},SlotContainer.prototype.removeItem=function(){this.removeAllChildren(),delete this.item,delete this.sprite},SlotContainer.prototype.updateDirection=function(t){if(this.sprite&&this.item[this.type])if(0<this.item[this.type][t]){var e=this.item[this.type][t];this.sprite.gotoAndStop(e),this.visible=!0}else this.sprite.gotoAndStop(0),this.visible=!1},Coins.prototype=Object.create(createjs.Container.prototype),Coins.prototype.update=function(t){this.text.text=t},Inventory.prototype=Object.create(createjs.Container.prototype),Inventory.prototype.close=function(){this.parent.removeChild(this)},Background.prototype=Object.create(createjs.Container.prototype),RoomUI.prototype=Object.create(createjs.Container.prototype),Beep.prototype=Object.create(createjs.Container.prototype),Beep.prototype.handleSocket=function(t){t.on("beep",function(t){t.warn&&this.addMessage(t.warn),t.item&&this.addItem(t.item),t.message&&this.addMessage(t.message)})},Beep.prototype.addMessage=function(t){var e=new boot.Message(t);e.center(this),e.y=20,e.click(function(){this.close()}),this.addChild(e)},Beep.prototype.showScreen=function(t){this.removeAllChildren();var e=this,i=new boot.Background(this);i.click(function(){e.removeAllChildern()}),this.addChild(i)};var boot=boot||{};!function(){function t(t){createjs.Container.call(this);var e=t.width,i=t.height,o=new createjs.Graphics;o.beginFill("black"),o.drawRect(0,0,e,i);var s=new createjs.Shape(o);s.alpha=.6,s.on("click",function(){}),this.addChild(s)}(t.prototype=Object.create(createjs.Container.prototype)).click=function(t){this.on("click",t)},boot.Background=t}();boot=boot||{};!function(){function t(t){createjs.Container.call(this);var e=new createjs.Sprite(uxSS,t);this.addChild(e)}function e(t){createjs.Container.call(this),this.background=new createjs.Sprite(uxSS,"item"),this.icon=new createjs.Bitmap(t),this.icon.setTransform(2,2,.5,.5),this.isActive=!1,this.addChild(this.background,this.icon)}(t.prototype=Object.create(createjs.Container.prototype)).click=function(t){this.on("click",t)},(e.prototype=Object.create(createjs.Container.prototype)).click=function(t){this.on("click",t)},e.prototype.setActive=function(t){t?(this.background.gotoAndStop("item_active"),this.isActive=!0):(this.background.gotoAndStop("item"),this.isActive=!1)},boot.Item=e,boot.Icon=t}();boot=boot||{};!function(){function t(t,e){createjs.Container.call(this);var i=(t=new boot.Data(t,e)).text,o=t.style.font,s=t.style.font_size,n=t.style.colour,r=t.style.fill,a=t.style.radius,h=t.style.mx,c=t.style.my,l=new createjs.Text(i,o,n);l.textBaseline="middle",l.x=h,l.y=c+s/2+2,l.snapToPixel=!0;var d=l.getBounds(),p=Math.floor(d.width)+2*h,f=s+2*c,m=new createjs.Shape;m.graphics.beginFill(r).drawRoundRect(0,0,p,f,a),this.addChild(m,l),this.setBounds(0,0,p,f)}(t.prototype=Object.create(createjs.Container.prototype)).click=function(t){this.on("click",t)},boot.Button=t}();boot=boot||{};!function(){function t(t){createjs.Container.call(this);var e=new createjs.Bitmap("/media/cards/spiral_bg.png");e.setTransform(10,10),this.addChild(e);var i=new createjs.Bitmap("/media/icons/viking.png");i.setTransform(20,20),this.addChild(i);var o=new createjs.Bitmap("/media/cards/card_common.png");this.addChild(o);var s=new createjs.Text("Viking Helmet","20px Luckiest Guy","black");s.textAlign="center",s.setTransform(100,200),this.addChild(s);var n=new createjs.Text("Description goes here","12px Arial","black");n.textAlign="center",n.setTransform(100,220),this.addChild(n)}(t.prototype=Object.create(createjs.Container.prototype)).click=function(t){this.on("click",t)},boot.Card=t}();boot=boot||{};!function(){function t(){createjs.Container.call(this);var t=new createjs.Bitmap("/media/ui/close_btn.png");t.setTransform(0,0,.5,.5),this.addChild(t)}(t.prototype=Object.create(createjs.Container.prototype)).click=function(t){this.on("click",t)},boot.Close=t}(),(boot=boot||{}).Data=function(t,e){if("string"==typeof t)var i={text:t};else i=t;return t.style?i.style=new boot.Style(t.style):i.style=new boot.Style(e),i};boot=boot||{};!function(){function t(t,e,i,o,s){createjs.Container.call(this),this.setBounds(2,2,t,e),this.width=t,this.height=e,this.columns=i,this.rows=o,this.tileWidth=Math.floor(t/i),this.tileHeight=Math.floor(e/o),this.lastTileX=0,this.lastTileY=0,this.maxItems=this.columns*this.rows,this.currentPage=0,s&&Array.isArray(s)?(this.list=s,this.update()):this.list=[]}(t.prototype=Object.create(createjs.Container.prototype)).update=function(t){this.removeAllChildren();for(var e=t||0,i=0;i<this.rows;i++)for(var o=0;o<this.columns;o++){var s=this.list[e];s&&(s.x=o*this.tileWidth,s.y=i*this.tileHeight,this.addChild(s),this.lastTileX=o,this.lastTileY=i),e++}},t.prototype.updateList=function(t){this.list=t,this.update(this.currentPage*this.maxItems)},t.prototype.addItem=function(t){this.list.push(t),this.update(this.currentPage*this.maxItems)},t.prototype.nextPage=function(){var t=Math.floor(this.list.length/this.maxItems),e=this.currentPage+1;e<=t&&(this.currentPage=e,this.update(e*this.maxItems))},t.prototype.lastPage=function(){var t=this.currentPage-1;0<=t&&(this.currentPage=t,this.update(t*this.maxItems))},boot.Grid=t}();boot=boot||{};!function(){function t(t,e){createjs.Container.call(this);e=(t=new boot.Data(t,e||"light")).style;var i=20;if(this.name="message",t.title){var o=new createjs.Text(t.title,"24px Luckiest Guy",e.colour);o.snapToPixel=!0,o.setTransform(20,20),o.lineWidth=300,this.addChild(o),i+=34}if(t.image){var s=new createjs.Bitmap(t.image);s.setTransform(20,i,.5,.5),this.addChild(s),i+=330}if(t.text){var n=new createjs.Text(t.text,e.font,e.colour);n.snapToPixel=!0,n.setTransform(20,i),n.lineWidth=300,i+=n.getBounds().height,this.addChild(n)}i+=20;var r=new createjs.Shape;r.graphics.beginFill(e.fill).drawRoundRect(0,0,360,i,4),r.shadow=new createjs.Shadow("rgba(0, 0, 0, 0.8)",0,2,4),this.addChildAt(r,0);var a=new boot.Close;a.setTransform(330,10),this.addChild(a),this.click(function(){})}(t.prototype=Object.create(createjs.Container.prototype)).center=function(t){var e=t.width;t.height;this.x=e/2-180},t.prototype.click=function(t){this.on("click",t)},t.prototype.close=function(){this.parent.removeChild(this)},boot.Message=t}();boot=boot||{};!function(){function t(t){createjs.Container.call(this);var e=(t=new boot.Style(t)).width||200,i=t.height||t.base,o=t.radius,s=new createjs.Shape;s.graphics.beginFill("#f8f9fa").drawRoundRect(0,0,e,i,o);var n=new createjs.Shape;n.graphics.beginFill(t.fill).drawRect(0,0,e,i),n.mask=s,n.scaleX=0,this.mc=n,this.addChild(s,n)}(t.prototype=Object.create(createjs.Container.prototype)).update=function(t){var e=t/100;this.mc.scaleX=e},t.prototype.center=function(){},boot.ProgressBar=t}();boot=boot||{};!function(){function t(t){createjs.Container.call(this),this.width=480,this.height=480;var e=new createjs.Graphics;e.setStrokeStyle(2).beginStroke("black"),e.drawRect(0,0,this.width,this.height);var i=new createjs.Shape(e);this.addChild(i);var o=this;t.forEach(function(t){if("button"==t.type){var e=new boot.Button(t.data.name,t.style);e.setTransform(t.x,t.y),o.addChild(e),e.click(function(){})}var i;"message"==t.type&&((i=new boot.Message(t.data,t.style)).setTransform(t.x,t.y),o.addChild(i));"alert"==t.type&&((i=new boot.Message(t.data,{theme:"warning"})).setTransform(t.x,t.y),o.addChild(i))})}t.prototype=Object.create(createjs.Container.prototype),boot.Screen=t}();boot=boot||{};!function(){var e={primary:{fill:"#007bff",text:"#ffffff"},secondary:{fill:"#6c757d",text:"#ffffff"},success:{fill:"#28a745",text:"#ffffff"},warning:{fill:"#ffc107",text:"#212529"},danger:{fill:"#dc3545",text:"#ffffff"},light:{fill:"#f8f9fa",text:"#212529"},dark:{fill:"#343a40",text:"#ffffff"}},i={sm:{font_size:.875,mx:.5,my:.5},md:{font_size:1,mx:1,my:.625},lg:{font_size:1.25,mx:1.25,my:.75}};boot.Style=function(t){t?"string"==typeof t&&(t={theme:t}):t={},this.theme=t.theme||"primary",this.size=t.size||"md",this.base=t.base||16,this.radius=.25*this.base,this.font_size=i[this.size].font_size*this.base,this.font_family="Arial",this.font=this.font_size+"px "+this.font_family,this.colour=t.colour||e[this.theme].text,this.fill=t.fill||e[this.theme].fill,this.mx=t.mx||i[this.size].mx*this.font_size,this.my=t.my||i[this.size].my*this.font_size}}();
console.log("Hello from after the client.");
function process_example(playerid, username, critterid)
{
console.log(playerid + ": { username: " + username + ", critterid: " + critterid + " }");
return 0;
}
function rewrite_example(player)
{
new_player = player;
if (player.critterId == "hamster")
{
player.scaleX += 0.5;
player.scaleY += 0.5;
}
return new_player;
}
boxcritters.process_users(process_example);
boxcritters.rewrite_users(rewrite_example);
alert("Hello from before the client.");
promt("Hello from before the <head> element?");
console.info("From here we cant't load the API:");
console.log(boxcritters.get_version().name);
{
"name": "Example",
"version": "0.1.0",
"author": "Alvarito050506",
"description": "Just an example",
"license": "GPL-v2.0-only",
"client": {
"146": {
"url": "https://cdn.jsdelivr.net/gh/Alvarito050506/example.bcm@master/client146.min.js",
"sha256": "d285425b722c2158e680cfd7573652157d41416aecd9c4c6fdf0e4728820d8f7"
}
},
"custom": {
"head": {
"url": "https://gist.githubusercontent.com/Alvarito050506/3150211f5ecc5e6f6699a26e93dc4225/raw/4eba7c73d62caf43284a30193f88724eb5d36931/custom_head.js",
"sha256": "d1dcd9a08719916fa249aa94486c1a07986f085d576e46259d3433474e80c171"
},
"before_client": {
"url": "https://gist.githubusercontent.com/Alvarito050506/3150211f5ecc5e6f6699a26e93dc4225/raw/4eba7c73d62caf43284a30193f88724eb5d36931/custom_before.js",
"sha256": "ade6b588c41dc17718b96e74b79a0b4b7f7affc687a4a0266a6e9bb84bc1ea69"
},
"after_client": {
"url": "https://gist.githubusercontent.com/Alvarito050506/3150211f5ecc5e6f6699a26e93dc4225/raw/4eba7c73d62caf43284a30193f88724eb5d36931/custom_after.js",
"sha256": "05c58f63e64dff2863852ac9fe4ef078524bf7269c18df052fa1c076d278f743"
}
}
}
{
"version": "0.1.0",
"author": "Alvarito050506",
"description": "This fails",
"license": "GPL-v2.0-only",
"client": {
"146": "https://cdn.jsdelivr.net/gh/Alvarito050506/example.bcm@master/client146.min.js"
},
"custom": {
"head": "https://gist.githubusercontent.com/Alvarito050506/3150211f5ecc5e6f6699a26e93dc4225/raw/4eba7c73d62caf43284a30193f88724eb5d36931/custom_head.js",
"before_client": "https://gist.githubusercontent.com/Alvarito050506/3150211f5ecc5e6f6699a26e93dc4225/raw/4eba7c73d62caf43284a30193f88724eb5d36931/custom_before.js",
"after_client": "https://gist.githubusercontent.com/Alvarito050506/3150211f5ecc5e6f6699a26e93dc4225/raw/4eba7c73d62caf43284a30193f88724eb5d36931/custom_after.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment