Emotes: sheet filename config option
このコミットが含まれているのは:
コミット
9edeea1491
|
@ -169,5 +169,6 @@ def toml_to_flask_section_nojs(config):
|
|||
def toml_to_flask_section_emote(config):
|
||||
cfg = config['emote']
|
||||
return {
|
||||
'EMOTE_SHEET': cfg['sheet'],
|
||||
'EMOTE_SCHEMA': cfg['schema'],
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ async def nojs_chat_messages(timestamp, user):
|
|||
user=user,
|
||||
users_by_token=USERS_BY_TOKEN,
|
||||
emotes=EMOTES,
|
||||
emotesheet=CONFIG['EMOTE_SHEET'],
|
||||
emotehash=get_emotehash(tuple(EMOTES)),
|
||||
messages=get_scrollback(current_app.messages),
|
||||
timeout=CONFIG['NOJS_TIMEOUT_CHAT'],
|
||||
|
|
|
@ -315,7 +315,7 @@ const update_emotes = async (emotes) => {
|
|||
}
|
||||
rules.sort();
|
||||
const emotehash = await hexdigest(rules.toString(), 6);
|
||||
const emotehash_rule = `.emote { background-image: url("/static/emotes.png?coords=${escape_css_string(encodeURIComponent(emotehash))}"); }`;
|
||||
const emotehash_rule = `.emote { background-image: url("/static/${escape_css_string(escape(emotesheet))}?coords=${escape_css_string(encodeURIComponent(emotehash))}"); }`;
|
||||
|
||||
const rules_set = new Set([emotehash_rule, ...rules]);
|
||||
const to_delete = [];
|
||||
|
@ -337,6 +337,7 @@ let users = {};
|
|||
let stats = null;
|
||||
let stats_received = null;
|
||||
let default_name = {true: "Broadcaster", false: "Anonymous"};
|
||||
let emotesheet = "emotes.png";
|
||||
let max_chat_scrollback = 256;
|
||||
let pingpong_period = 8.0;
|
||||
let ping = null;
|
||||
|
@ -734,7 +735,8 @@ const on_websocket_message = async (event) => {
|
|||
chat_appearance_form_name.setAttribute("placeholder", default_name[user.broadcaster]);
|
||||
chat_appearance_form_color.setAttribute("value", user.color);
|
||||
|
||||
// emote coordinates
|
||||
// emotes
|
||||
emotesheet = receipt.emotesheet;
|
||||
await update_emotes(receipt.emotes);
|
||||
|
||||
// insert new messages
|
||||
|
|
|
@ -134,7 +134,7 @@
|
|||
line-height: 1.3125;
|
||||
}
|
||||
.emote {
|
||||
background-image: url("{{ escape_css_string(url_for('static', filename='emotes.png', coords=emotehash)) | safe }}");
|
||||
background-image: url("{{ escape_css_string(url_for('static', filename=emotesheet, coords=emotehash)) | safe }}");
|
||||
display: inline-block;
|
||||
font-size: 0;
|
||||
vertical-align: middle;
|
||||
|
|
|
@ -38,6 +38,7 @@ async def websocket_outbound(queue, user):
|
|||
'digest': get_random_captcha_digest_for(user),
|
||||
'pingpong': CONFIG['TASK_BROADCAST_PING'],
|
||||
'emotes': get_emotes_for_websocket(),
|
||||
'emotesheet': CONFIG['EMOTE_SHEET'],
|
||||
})
|
||||
while True:
|
||||
payload = await queue.get()
|
||||
|
|
|
@ -91,4 +91,5 @@ refresh_users = 6.0
|
|||
timeout_chat = 30.0
|
||||
|
||||
[emote]
|
||||
sheet = "emotes.png"
|
||||
schema = "emotes.json"
|
||||
|
|
読み込み中…
新しいイシューから参照