Skip to content

Commit

Permalink
Update script.min.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ItzCrazyChace authored Jan 19, 2024
1 parent dc9c2db commit 78874dc
Showing 1 changed file with 40 additions and 8 deletions.
48 changes: 40 additions & 8 deletions build/www/js/script.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,12 @@ var _createClass = (function () {
},
},
mute: {
name: function () {
name: function() {
return d.mute ? "Unmute" : "Mute";
},
callback: function () {
callback: function() {
d.cancel(), (d.mute = !d.mute);
d.userPublic.color_cross = "./img/bonzi/purple.png";
},
},
asshole: {
Expand All @@ -408,7 +409,7 @@ var _createClass = (function () {
name: "Quote",
callback: function () {
if (!d.last) {
alert("This person hasnt speaked yet")
alert("This person hasn't speaked yet. When this person speaks, you can quote it, usually reply to him/her/it.")
return;
}
$("#chat_message").val("<div data-style=\"quote\">" + d.last + "</div> ").focus()
Expand Down Expand Up @@ -573,7 +574,25 @@ var _createClass = (function () {
{
key: "update",
value: function () {

if (this.run) {

if (this.color == "empty" && this.userPublic.color_cross != 'none') {
this.$canvas.css("background-image", `url("${this.userPublic.color_cross}")`);
} else {
this.$canvas.css("background-image", `url("/img/bonzi/${this.color}.png")`);
}

} else {
if (this.color == "empty" && this.userPublic.color_cross != 'none') {
this.$canvas.css("background-image", `url("${this.userPublic.color_cross}")`);
} else {
this.$canvas.css("background-image", `url("/img/bonzi/empty.png")`);
}
}
this.$canvas.css("background-position-x", `-${Math.floor(this.sprite.currentFrame % 17) * this.data.size.x}px`);
this.$canvas.css("background-position-y", `-${Math.floor(this.sprite.currentFrame / 17) * this.data.size.y}px`);

if (
(0 !== this.eventQueue.length && this.eventQueue[0].index >= this.eventQueue[0].list.length && this.eventQueue.splice(0, 1), (this.event = this.eventQueue[0]), 0 !== this.eventQueue.length && this.eventRun)
) {
Expand Down Expand Up @@ -794,11 +813,24 @@ var _createClass = (function () {
{
key: "updateSprite",
value: function (a) {
var b = BonziHandler.stage;
this.cancel(),
b.removeChild(this.sprite),
this.colorPrev != this.color && (delete this.sprite, (this.sprite = new createjs.Sprite(BonziHandler.spriteSheets[this.color], a ? "gone" : "idle"))),
b.addChild(this.sprite),
var info = BonziData.sprite;
var stage = BonziHandler.stage;
var stage = BonziHandler.stage;
//this.cancel(),
stage.removeChild(this.sprite),
this.colorPrev != this.color &&
(delete this.sprite,
loadQueue.loadManifest([{ id: this.color, src: "./img/bonzi/" + this.color + ".png" }]),
(this.sprite = new createjs.Sprite(
new createjs.SpriteSheet({
images: ["./img/bonzi/" + this.color + ".png"],
frames: info.frames,
animations: info.animations,
}),
a ? "gone" : "idle"
)),
(this.sprite.id = this.id)),
stage.addChild(this.sprite),
this.move();
},
},
Expand Down

0 comments on commit 78874dc

Please sign in to comment.