したらばTOP ■掲示板に戻る■ 全部 1-100 最新50 | メール | |

戦国IXA ツールスレPart49

37名無しさん:2024/02/26(月) 22:54:57 ID:o0bxJOiU
>>35
ちょうど直そうと思っていたので改修しました
あまり動作確認していないのでバグありましたらおしえてください
// === 同盟 === 〜 // ^ 同盟の間の最後のfunctionで
結構前に合戦と内政のポイントにも対応してどこ直したか覚えていないので全文載せます
何回かに分けます

// 同盟ポイント比較機能
function alliancePointComparison() {
if (!options.ar_point_cmp) {
return;
}
var $tr = $('table.common_table1 tr').not('.sub'),
$tr_sub = $('table.common_table1 tr.sub'),
disp_apc = function() {
var data = getStorage({}, 'ixamoko_ar_point');
$('#ar_update').html('( 更新:' + data.date + ' )');
$tr.slice(1).each(function(idx, elm) {
var now_ar_member = $(this).find('td').eq(2).find('a').text().trim();
var now_ar_point = ($(this).find('td').eq(3).text().split('(')[0] || '').replace(/\,|\s|\n/g, '');
var now_ar_point_fight = ($tr_sub.slice(1).eq(idx).find('td').eq(0).text().split('(')[0] || '').replace(/\,|\s|\n/g, '');
var now_ar_point_village = ($tr_sub.slice(1).eq(idx).find('td').eq(1).text().split('(')[0] || '').replace(/\,|\s|\n/g, '');
var recorded = data.point[now_ar_member][0];
var recorded_fight = data.point[now_ar_member][1];
var recorded_village = data.point[now_ar_member][2];
if (!recorded) {
recorded = now_ar_point;
}
var cmpd_value = now_ar_point - recorded;
if (cmpd_value > 999) {
cmpd_value = cmpd_value + '';
while (cmpd_value != (cmpd_value = cmpd_value.replace(/^(-?\d+)(\d{3})/, '$1,$2')));
}
if (!recorded_fight) {
recorded_fight = now_ar_point_fight;
}
var cmpd_value_fight = now_ar_point_fight - recorded_fight;
if (cmpd_value_fight > 999) {
cmpd_value_fight = cmpd_value_fight + '';
while (cmpd_value_fight != (cmpd_value_fight = cmpd_value_fight.replace(/^(-?\d+)(\d{3})/, '$1,$2')));
}
if (!recorded_village) {
recorded_village = now_ar_point_village;
}
var cmpd_value_village = now_ar_point_village - recorded_village;
if (cmpd_value_village > 999) {
cmpd_value_village = cmpd_value_village + '';
while (cmpd_value_village != (cmpd_value_village = cmpd_value_village.replace(/^(-?\d+)(\d{3})/, '$1,$2')));
}
var $td = $(this).find('td.cmpd_value');
if ($td.length) {
$td.remove();
}
var $td_sub = $tr_sub.slice(1).eq(idx).find('td.cmpd_value');
if ($td_sub.length) {
$td_sub.remove();
}
$(this).find('td').eq(3).after('<td colspan="2" class="cmpd_value" style="color:maroon;">' + cmpd_value + '</td>');
$tr_sub.slice(1).eq(idx).append('<td class="cmpd_value" style="color:maroon; white-space:nowrap; padding-left:5px; padding-right:5px;">' + cmpd_value_fight +
'</td><td class="cmpd_value" style="color:maroon; white-space:nowrap; padding-left:5px; padding-right:5px;">' + cmpd_value_village + '</td>')
});
},


新着レスの表示


名前: E-mail(省略可)

※書き込む際の注意事項はこちら

※画像アップローダーはこちら

(画像を表示できるのは「画像リンクのサムネイル表示」がオンの掲示板に限ります)

掲示板管理者へ連絡 無料レンタル掲示板