Welcome to IOPWiki, Commander.
We are searching for new editors to keep track of Girls' Frontline 2 content, as well as veteran players to complete the data of Girls' Frontline and Project Neural Cloud characters.
You can contribute without an account. Learn how to contribute and join our Discord server.

Widget:chibiCostumeSwitcher: 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
m missing equals operand
Changed the way chibi costume IDs are determined
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><script>
<includeonly><script>
RLQ.push(function () {
RLQ.push(['jquery', function () {
   $(document).ready(function() {
   $(document).ready(function() {
     // Let's make sure the correct values are shown
     // Let's make sure the correct values are shown
     $('.modswitcher').change();
     $('.chibi-costume-switcher').change();
   });
   });
});
}]);
 
function updateCalculatedValues(data) {
  var ret = data;
 
  // Calculating Max HP for full dummied T-Doll
  if (ret.hasOwnProperty("max_hp_t")) {
    ret.hpmaxwd = ret.max_hp_t * 5;
  }
 
  return ret;
}


function swap_costume(element, targetId) {
function swap_costume(element, targetId) {
Line 33: Line 22:
         var selectBox = $(element);
         var selectBox = $(element);
          
          
         costumeSelectionIndex = selectBox.prop('selectedIndex');
         var chibiCostumeName = selectBox.val();
          
          
         var chibiCostumeName = "";
         if (chibiCostumeName != "") {
        if (costumeSelectionIndex != 0) {
           chibiCostumeName = "_" + chibiCostumeName;
           chibiCostumeName = "_costume" + costumeSelectionIndex
         }
         }
          
          
         var targetSelector = targetId == "" ? ".chibiAnimationContainer" : ("#" + targetId);
         var targetSelector = targetId == "" ? ".chibiAnimationContainer" : ("#" + targetId);
         $(targetSelector).find('.chibiAnimation,.live2dAnimation,.artTab').trigger("costume_changed", chibiCostumeName);
        $(targetSelector).attr('data-tdoll-costume', chibiCostumeName);
         $(targetSelector).find('.chibiAnimation').trigger("costume_changed", chibiCostumeName);
          
          
         var tdollId = selectBox.closest('.costumeContainer').find('.tdoll_chibi').data('tdollId');
         var tdollId = selectBox.closest('.costumeContainer').find('.tdoll_chibi').data('tdollId');
Line 55: Line 44:


</script>
</script>
<select class="gf-droplist" autocomplete="off" onchange="swap_costume(this, '<!--{$target|escape:'html'}-->')" >
<select class="gf-droplist chibi-costume-switcher" autocomplete="off" onchange="swap_costume(this, '<!--{$target|escape:'html'}-->')" >
<option value="{{BASEPAGENAME}}" selected="selected">Default</option>
<option value="" selected="selected">Default</option>
<!--{foreach from=$costumes key=key item=item}-->
<!--{foreach from=$costumes key=key item=item}-->
   <!--{if $item neq ''}--><option value="<!--{$key|escape:'html'}-->"><!--{$item|escape:'html'}--></option><!--{/if}-->
   <!--{if $item neq ''}--><option value="<!--{$key|escape:'html'}-->"><!--{$item|escape:'html'}--></option><!--{/if}-->

Latest revision as of 23:26, 7 April 2020