打开主菜单

少前百科GFwiki β

更改

Widget:ChibiCostumeSwitcher

添加588字节2023年8月26日 (六) 00:04
无编辑摘要
<includeonly><style>div#content { overflow: clip;}</style><script>
/* Original widget created by en.gfwiki.com/wiki/User:Messing_with_data, Copied under Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) License */
RLQ.push(function () {
var selectBox = $(element);
const costumeSelectionIndex = selectBox.prop('selectedIndex'); console.log('costumeSelectionIndex', costumeSelectionIndex, costumeSelectionIndex != 0);
var chibiCostumeName = "";
if (costumeSelectionIndex != 0) {
chibiCostumeName = "_"+selectBox.val()
}
var targetSelector = targetId == "" ? ".chibiAnimationContainer" : ("#" + targetId);
$(targetSelector).attr('data-tdoll-costume', chibiCostumeName);
$(targetSelector).find('.chibiAnimation').trigger("costume_changed", [chibiCostumeName]); if($(targetSelector).children('.chibiDormButton').hasClass('stateon')) { var currentDormButton = $(targetSelector).children('.chibiDormButton'); var futureEnabledState = currentDormButton.hasClass('stateoff'); if(futureEnabledState) { currentDormButton.addClass('stateon'); currentDormButton.removeClass('stateoff'); } else { currentDormButton.removeClass('stateon'); currentDormButton.addClass('stateoff'); } }
var tdollId = selectBox.closest('.costumeContainer').find('.tdoll_chibi').data('tdollId');
<option value="{{BASEPAGENAME}}" selected="selected">默认Q版</option>
<!--{foreach from=$costumes key=key item=item}-->
<!--{if $item key neq ''&& $item neq ""}--><option value="<!--{$key|escape:'html'}-->"><!--{$item|escape:'html'}--></option><!--{/if}-->
<!--{/foreach}-->
</select></includeonly>
{{#widget:ChibiCostumeSwitcher
|target=enemyChibiAnimation
|costumes.costume1mod=Elite formmod|costumes.costume2=Another variant|costumes.costume3=Third variant|costumes.costume4=|costumes.costume5=|costumes.costume6301=301
}}
<div id="enemyChibiAnimation" class="chibiAnimationContainer" data-tdoll-id="Executioner柯尔特左轮" data-tdoll-hidedormbutton="truefalse" style="border: thin dashed gray;">&nbsp;</div><p style="font-style: italic;">Original widget created by https://en.gfwiki.com/wiki/User:Messing_with_data, <b>Copied under Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) License</b></p></noinclude>