Skip to content

Commit

Permalink
⚡ 追加: [DX3] コンボ複製ボタン
Browse files Browse the repository at this point in the history
  • Loading branch information
yutorize committed May 28, 2024
1 parent ab8e768 commit e6ec3aa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
12 changes: 11 additions & 1 deletion _core/lib/dx3/edit-chara.js
Original file line number Diff line number Diff line change
Expand Up @@ -743,10 +743,20 @@ function calcCombo(num){
}
}
// 追加
function addCombo(){
function addCombo(copyBaseNum){
const row = createRow('combo','comboNum');
document.querySelector("#combo-list").append(row);

if(copyBaseNum){
row.querySelectorAll('[name]').forEach(node => {
const copyBaseName = node.getAttribute('name').replace(/^(combo)\d+(.+)$/, `$1${copyBaseNum}$2`)
if(node.type === 'checkbox'){
node.checked = form[copyBaseName].checked;
}
else { node.value = form[copyBaseName].value; }
});
calcCombo(form.comboNum.value);
}
comboSkillSet(form.comboNum.value);
makeComboConditionUtility(row);
}
Expand Down
2 changes: 1 addition & 1 deletion _core/lib/dx3/edit-chara.pl
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ sub comboStatusSet {
print <<"HTML";
</dl>
<div class="combo-note"><textarea name="combo${num}Note" rows="3" placeholder="解説">$pc{"combo${num}Note"}</textarea></div>
<div class="combo-calc">@{[ checkbox "combo${num}Manual",'技能レベル・能力値を自動挿入しない',"calcCombo(${num})" ]}</div>
<div class="combo-other">@{[ checkbox "combo${num}Manual",'技能レベル・能力値を自動挿入しない',"calcCombo(${num})" ]} <span class="button" onclick="addCombo($num)">コンボ複製</span></div>
</div>
HTML
if($num eq 'TMPL'){ print '</template>' }
Expand Down
17 changes: 13 additions & 4 deletions _core/skin/dx3/css/edit.css
Original file line number Diff line number Diff line change
Expand Up @@ -631,17 +631,25 @@ body:not(.mode-crc) .crc-only {
"HNDL NAME COMB COMB"
"HNDL IN IN OUT"
"HNDL NOTE NOTE OUT"
"HNDL NOTE NOTE CALC"
"HNDL NOTE NOTE OTHR"
;
}
#combo .combo-table .handle {
grid-area: HNDL;
display: grid;
place-items: center;
}
#combo .combo-table .combo-calc {
grid-area: CALC;
justify-self: end;
#combo .combo-table .combo-other {
grid-area: OTHR;
display: flex;
justify-content: space-between;
padding: 0 1px 2px .4rem;

> .button {
font-size: 88%;
padding: 3px 4px 1px;
font-family: var(--font-proportional);
}
}
#combo .combo-table .combo-combo,
#combo .combo-table .combo-in,
Expand Down Expand Up @@ -762,6 +770,7 @@ body:not(.mode-crc) .crc-only {
" IN IN"
" OUT OUT"
"NOTE NOTE"
"OTHR OTHR"
;
}
#combo .combo-table .combo-name {
Expand Down

0 comments on commit e6ec3aa

Please sign in to comment.