Welcome to IOPWiki, Commander.
We are searching for editors to complete gameplay topics in all games. You can contribute without an account. Learn how to contribute and join our Discord server.

Widget:costumeSwitcher: Difference between revisions

Welcome to IOP Wiki. This website is maintained by the Girls' Frontline community and is free to edit by anyone.
Jump to navigation Jump to search
Set "autocomplete" from the costume selector off
swap_costume now triggers "costume_changed" for all ".chibiAnimation,.live2dAnimation" in the surrounding ".costumeContainer"
Line 1: Line 1:
<includeonly><script>
<includeonly><script>
function swap_costume() {
function swap_costume(element) {
        var tdollId = mw.config.get("wgPageName");
 
         costumeSelectionPathsString = document.getElementById("costumeSelection").value;
         costumeSelectionPathsString = document.getElementById("costumeSelection").value;
         costumeSelectionIndex = document.getElementById("costumeSelection").selectedIndex;
         costumeSelectionIndex = document.getElementById("costumeSelection").selectedIndex;
Line 10: Line 8:
           chibiCostumeName = "_costume" + costumeSelectionIndex
           chibiCostumeName = "_costume" + costumeSelectionIndex
         }
         }
       
 
         var baseview = window.chibiAnimationBaseview; // ToDo: There are several baseviews. We should find it without global scope vars
         $(element).closest('.costumeContainer').find('.chibiAnimation,.live2dAnimation').trigger("costume_changed", chibiCostumeName);
        loadGirl(baseview, tdollId, chibiCostumeName );


         costumePaths = costumeSelectionPathsString.split(",,");
         costumePaths = costumeSelectionPathsString.split(",,");
Line 46: Line 43:
}
}


</script><select id="costumeSelection" class=skill style="background-color:rgba(250,250,250,0.9);width:100%" autocomplete="off" onchange="swap_costume()" >
</script><select class="skill" style="background-color:rgba(250,250,250,0.9);width:100%" autocomplete="off" onchange="swap_costume(this)" >
<option value="<!--{$defaultpaths|escape:'html'}-->" selected="selected">Default</option>
<option value="<!--{$defaultpaths|escape:'html'}-->" selected="selected">Default</option>
<!--{if $costume1name neq ''}--><option value="<!--{$costume1paths|escape:'html'}-->"><!--{$costume1name|escape:'html'}--></option><!--{/if}-->
<!--{if $costume1name neq ''}--><option value="<!--{$costume1paths|escape:'html'}-->"><!--{$costume1name|escape:'html'}--></option><!--{/if}-->

Revision as of 15:26, 7 January 2018


test