Commit b48fe04e authored by nanahira's avatar nanahira

fix

parent 87abac99
......@@ -1711,19 +1711,21 @@ ygopro.ctos_follow 'CHAT', true, (buffer, info, client, server)->
when '/color'
if settings.modules.chat_color.enabled
cip = (if settings.modules.mycard.enabled then client.name else client.ip.slice(7))
cip = if settings.modules.mycard.enabled then client.name else client.ip
if cmsg = cmd[1]
if cmsg.toLowerCase() == "help"
ygopro.stoc_send_chat(client, "${show_color_list}", ygopro.constants.COLORS.BABYBLUE)
for cname,cvalue of ygopro.constants.COLORS when cvalue > 10
ygopro.stoc_send_chat(client, cname, cvalue)
else if cmsg.toLowerCase() == "default"
setting_change(chat_color, 'save_list:' + cip, false)
chat_color.save_list[cip] = false
setting_save(chat_color)
ygopro.stoc_send_chat(client, "${set_chat_color_default}", ygopro.constants.COLORS.BABYBLUE)
else
ccolor = cmsg.toUpperCase()
if ygopro.constants.COLORS[ccolor] and ygopro.constants.COLORS[ccolor] > 10
setting_change(chat_color, 'save_list:' + cip, ccolor)
if ygopro.constants.COLORS[ccolor] and ygopro.constants.COLORS[ccolor] > 10 and ygopro.constants.COLORS[ccolor] < 20
chat_color.save_list[cip] = ccolor
setting_save(chat_color)
ygopro.stoc_send_chat(client, "${set_chat_color_part1}" + ccolor + "${set_chat_color_part2}", ygopro.constants.COLORS.BABYBLUE)
else
ygopro.stoc_send_chat(client, "${color_not_found_part1}" + ccolor + "${color_not_found_part2}", ygopro.constants.COLORS.RED)
......@@ -1909,7 +1911,7 @@ ygopro.stoc_follow 'CHAT', true, (buffer, info, client, server)->
for player in room.players when player and player.pos == pid
tplayer = player
return unless tplayer
tcolor = chat_color.save_list[(if settings.modules.mycard.enabled then tplayer.name else tplayer.ip.slice(7))]
tcolor = chat_color.save_list[if settings.modules.mycard.enabled then tplayer.name else tplayer.ip]
if tcolor
ygopro.stoc_send client, 'CHAT', {
player: ygopro.constants.COLORS[tcolor]
......
......@@ -2135,7 +2135,7 @@
break;
case '/color':
if (settings.modules.chat_color.enabled) {
cip = (settings.modules.mycard.enabled ? client.name : client.ip.slice(7));
cip = settings.modules.mycard.enabled ? client.name : client.ip;
if (cmsg = cmd[1]) {
if (cmsg.toLowerCase() === "help") {
ygopro.stoc_send_chat(client, "${show_color_list}", ygopro.constants.COLORS.BABYBLUE);
......@@ -2147,12 +2147,14 @@
}
}
} else if (cmsg.toLowerCase() === "default") {
setting_change(chat_color, 'save_list:' + cip, false);
chat_color.save_list[cip] = false;
setting_save(chat_color);
ygopro.stoc_send_chat(client, "${set_chat_color_default}", ygopro.constants.COLORS.BABYBLUE);
} else {
ccolor = cmsg.toUpperCase();
if (ygopro.constants.COLORS[ccolor] && ygopro.constants.COLORS[ccolor] > 10) {
setting_change(chat_color, 'save_list:' + cip, ccolor);
if (ygopro.constants.COLORS[ccolor] && ygopro.constants.COLORS[ccolor] > 10 && ygopro.constants.COLORS[ccolor] < 20) {
chat_color.save_list[cip] = ccolor;
setting_save(chat_color);
ygopro.stoc_send_chat(client, "${set_chat_color_part1}" + ccolor + "${set_chat_color_part2}", ygopro.constants.COLORS.BABYBLUE);
} else {
ygopro.stoc_send_chat(client, "${color_not_found_part1}" + ccolor + "${color_not_found_part2}", ygopro.constants.COLORS.RED);
......@@ -2406,7 +2408,7 @@
if (!tplayer) {
return;
}
tcolor = chat_color.save_list[(settings.modules.mycard.enabled ? tplayer.name : tplayer.ip.slice(7))];
tcolor = chat_color.save_list[settings.modules.mycard.enabled ? tplayer.name : tplayer.ip];
if (tcolor) {
ygopro.stoc_send(client, 'CHAT', {
player: ygopro.constants.COLORS[tcolor],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment