(更改推荐sp技能的操作界面)
 
(未显示同一用户的1个中间版本)
第2,013行: 第2,013行:
 
// =======编辑勇士图鉴/SP技能推荐器(end)=======//
 
// =======编辑勇士图鉴/SP技能推荐器(end)=======//
 
console.log("√ MediaWiki:Tools.js/SP技能推荐器");
 
console.log("√ MediaWiki:Tools.js/SP技能推荐器");
 +
 +
 +
 +
// ==================CQ小漫画制作(start)==================//
 +
var class_hn_text = '<option value="chara_wa">剑士</option><option value="chara_pa">骑士</option><option value="chara_ar">弓手</option><option value="chara_hu">猎人</option><option value="chara_wi">法师</option><option value="chara_pr">祭司</option>'
 +
 +
 +
$("#select_a_1").html('<select id="hero_class_change_a" class="createboxInput">'+class_hn_text+'</select>');
 +
$("#select_a_2").html('<select id="hero_name_list_a" class="createboxInput"></select>');
 +
$("#select_b_1").html('<select id="hero_class_change_b" class="createboxInput">'+class_hn_text+'</select>');
 +
$("#select_b_2").html('<select id="hero_name_list_b" class="createboxInput"></select>');
 +
 +
 +
$("#hero_class_change_a").change(function(){
 +
    $("#hero_name_list_a").html('');
 +
    get_hero_list($("#hero_class_change_a").val(),"#hero_name_list_a");
 +
});
 +
$("#hero_class_change_b").change(function(){
 +
    $("#hero_name_list_b").html('');
 +
    get_hero_list($("#hero_class_change_b").val(),"#hero_name_list_b");
 +
});
 +
 +
function get_hero_list(classID,idName){
 +
    var hero_arr = $("#" + classID).attr("data-title");
 +
    if(hero_arr == null || hero_arr == ""){
 +
        hero_arr = "null";
 +
    }
 +
    var harr = hero_arr.split(",");
 +
    for(var i=0;i<harr.length;i++){
 +
        $(idName).append('<option value ="'+i+'">'+harr[i]+'</option>');
 +
    }
 +
    draw_hero_img();
 +
}
 +
 +
$("#hero_name_list_a").change(function(){
 +
    draw_hero_img();
 +
});
 +
$("#hero_name_list_b").change(function(){
 +
    draw_hero_img();
 +
});
 +
 +
//画图
 +
function draw_hero_img(){
 +
    var class_a = $("#hero_class_change_a").val();
 +
    var id_a = parseInt($("#hero_name_list_a").val());
 +
    var class_b = $("#hero_class_change_b").val();
 +
    var id_b = parseInt($("#hero_name_list_b").val());
 +
 +
    console.log(id_a);
 +
    console.log(id_b);
 +
 +
    var c = document.getElementById("myCanvas");
 +
    var ctx = c.getContext("2d");
 +
    c.height = c.height;
 +
    var img1 = document.getElementsByClassName(class_a);
 +
    var img2 = document.getElementsByClassName(class_b);
 +
    var imgbg = document.getElementsByClassName("ghbg");
 +
    ctx.drawImage(imgbg[0], 0, 0);
 +
    ctx.drawImage(img1[id_a], -40, 0);
 +
    ctx.rotate(-0.8);
 +
    ctx.drawImage(img2[id_b], -540, 500);
 +
}
 +
// =======CQ小漫画制作(end)=======//
 +
console.log("√ MediaWiki:Tools.js/CQ小漫画制作");
 +
 +
  
 
console.log("===== MediaWiki:Tools.js 全部加载完毕 =====");
 
console.log("===== MediaWiki:Tools.js 全部加载完毕 =====");