mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 01:27:51 -05:00
feat: discord linking, @tags, music and sfx sliders, required device ids
- Discord: the account page links a player's Discord account through Discord's sign-in (lib/discord.js); only linked names are shown on cards (typed ones are cleared). A bot keeps the Server Booster badge on linked accounts that boost. The game tells the client where the player is, for the client's Discord rich presence (flashvars discordAppId). - @username tags in chat, chat balloons and wall posts: only real players' names (asked of the server, "xmn"), names with spaces too, drawn on a blue box; a click opens the player's card. - Settings: separate Music and SFX volume sliders for the old one. - Device ids required: a launcher that sends none (before 1.3.0) is told at the game's login "Your client is outdated. Update at https://burrow.moe/download". AJ_REQUIRE_DEVICE=0 turns it off. - Panels: clear a player's Jammer Wall posts; turning away masterpieces and player items asks first. - Item Giver: negative colour ids (the same colour written signed). - buildVersion 71; the client rebuilt with Snipzil's sitting fix.
This commit is contained in:
1 parent
1d9b70f32e
commit
33f56074a4
35 files changed
+2076
-101
No files matched your search
@@ -3,9 +3,11 @@ package gui
|
||||
import flash.display.MovieClip;
|
||||
import flash.display.Sprite;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.events.TextEvent;
|
||||
import flash.geom.ColorTransform;
|
||||
import flash.geom.Point;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.text.TextField;
|
||||
import flash.utils.setTimeout;
|
||||
import loader.MediaHelper;
|
||||
import localization.LocalizationManager;
|
||||
@@ -133,6 +135,7 @@ package gui
|
||||
this.visible = true;
|
||||
}
|
||||
clearInline();
|
||||
clearMentionBacks();
|
||||
_msgTxt.text = inlineEmotes(param1);
|
||||
_msgTxt.height;
|
||||
// AJClient.whisperNext is set by the server's "xw" just ahead of a
|
||||
@@ -167,6 +170,33 @@ package gui
|
||||
{
|
||||
_msgTxt.textColor = 4477529;
|
||||
}
|
||||
// tags (AJClient.resolveMentions): once the server says which "@"s
|
||||
// are players', light blue and underlined, each a link to that
|
||||
// player's card, if the balloon still says the same. (the field is
|
||||
// another on some frames.)
|
||||
if(!param2 && _msgTxt is TextField && _msgTxt.text.indexOf("@") != -1)
|
||||
{
|
||||
var field:TextField = TextField(_msgTxt);
|
||||
var shown:String = field.text;
|
||||
field.addEventListener("link",onMentionLink,false,0,true);
|
||||
AJClient.resolveMentions(shown,function(param1:Array):void
|
||||
{
|
||||
if(field.text == shown)
|
||||
{
|
||||
// in the message's own colour here: the blue box marks it
|
||||
AJClient.styleMentions(field,param1,true,4477529);
|
||||
// and their backgrounds, now and once laid out for sure
|
||||
AJClient.drawMentionBacks(field,param1,AJClient.MENTION_BACK_LIGHT);
|
||||
setTimeout(function():void
|
||||
{
|
||||
if(field.text == shown)
|
||||
{
|
||||
AJClient.drawMentionBacks(field,param1,AJClient.MENTION_BACK_LIGHT);
|
||||
}
|
||||
},42);
|
||||
}
|
||||
});
|
||||
}
|
||||
_timeout = 8000;
|
||||
if(param3 && this.parent)
|
||||
{
|
||||
@@ -438,6 +468,7 @@ package gui
|
||||
|
||||
public function setCustomAdventureMessage(param1:String, param2:String, param3:int, param4:Boolean = false, param5:Boolean = false) : void
|
||||
{
|
||||
clearMentionBacks();
|
||||
var _loc6_:int = 0;
|
||||
var _loc7_:int = 0;
|
||||
var _loc8_:Array = param2.split("|");
|
||||
@@ -582,6 +613,25 @@ package gui
|
||||
}
|
||||
}
|
||||
|
||||
// the backgrounds of the tags of the text before (setText)
|
||||
private function clearMentionBacks() : void
|
||||
{
|
||||
if(_msgTxt is TextField)
|
||||
{
|
||||
AJClient.drawMentionBacks(TextField(_msgTxt),null);
|
||||
}
|
||||
}
|
||||
|
||||
// a tag clicked: "@name" (setText)
|
||||
private function onMentionLink(param1:TextEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
if(param1.text && param1.text.charAt(0) == "@")
|
||||
{
|
||||
AJClient.openProfile(param1.text.substr(1));
|
||||
}
|
||||
}
|
||||
|
||||
private function onBtnBG(param1:MouseEvent) : void
|
||||
{
|
||||
param1.stopPropagation();
|
||||
@@ -610,6 +660,7 @@ package gui
|
||||
|
||||
public function setEmote(param1:Sprite, param2:int = -1) : void
|
||||
{
|
||||
clearMentionBacks();
|
||||
if(this.currentFrameLabel != "advBtn")
|
||||
{
|
||||
_permEmoteMediaId = param2;
|
||||
|
||||
Reference in new issue
Block a user