定型文・コア
by
cutfloss
05/01 [2026/05/01 13:11:50]
6連ボタン対応の完璧版
@@ -1,21 +1,26 @@
/*
- * @title 陣取り司令官mini
+ * @title 陣取り司令官・改
+ * @description 定型文ボタン独立&パネル寄り配置
+ * @include http://*
+ * @license MIT License
+ * @require
* @private
*/
(function(){
const $id = (id)=>document.getElementById(id);
const old = $id('j-all'); if(old) old.remove();
-
const chat = $id('tc-panel-chat'), team = $id('tc-panel-team'), log = $id('tc-panel-log');
- if(!chat) return console.log("チーム戦中に実行してください");
+ if(!chat) return console.log("パネル未検出");
const style = document.createElement('style');
style.innerHTML = `
- .j-box { position:fixed; background:rgba(10,20,40,0.9); border:2px solid #3b82f6; border-radius:5px; padding:5px; z-index:99999; pointer-events:auto; color:#fff; font-size:11px; }
- .j-btn { background:#2563eb; color:#fff; border:1px solid #60a5fa; border-radius:3px; padding:3px; cursor:pointer; font-size:10px; margin:2px; }
- #tc-panel-chat,#tc-panel-team,#tc-panel-log { display:block !important; visibility:visible !important; width:200px; }
- #team-chat-messages { height:150px !important; }
- #tc-team-stats,#tc-panel-log { height:120px !important; }
+ .j-box { position:fixed; background:rgba(10,20,40,0.95); border:2px solid #3b82f6; border-radius:8px; padding:8px; z-index:99999; pointer-events:auto; color:#fff; }
+ .j-btn-area { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
+ .j-btn { background:#2563eb; color:#fff; border:1px solid #60a5fa; border-radius:5px; padding:10px 5px; cursor:pointer; font-size:14px; font-weight:bold; }
+ .j-btn:hover { background:#1d4ed8; transform:scale(1.02); }
+ #tc-panel-chat { display:block !important; visibility:visible !important; width:280px; } /* 会話タブを少し大きく */
+ #tc-panel-team, #tc-panel-log { display:block !important; visibility:visible !important; width:200px; height:150px; overflow-y:auto; }
+ #team-chat-messages { height:250px !important; } /* チャット履歴を長く */
`;
document.head.appendChild(style);
@@ -24,22 +29,28 @@
root.style.cssText = 'position:fixed; top:0; left:0; width:100vw; height:100vh; pointer-events:none; z-index:99999;';
document.body.appendChild(root);
- // 右側:ボタン+チャット
+ // --- 右側:ボタン(上) + 会話(下) ---
const r = document.createElement('div'); r.className = 'j-box';
- r.style.right = '10px'; r.style.bottom = '10px';
+ r.style.right = '60px'; // プレー画面に寄せる(値を小さくすると右端へ、大きくすると中央へ)
+ r.style.bottom = '10px';
+
+ // ボタンを上に配置
const bArea = document.createElement('div');
- [['⚔️攻','攻めましょう!'],['🛡️守','守備!'],['🆘援','援護!'],['✨感','感謝!']].forEach(p=>{
+ bArea.className = 'j-btn-area';
+ [['⚔️ 攻め', '攻めましょう!'], ['🛡️ 守り', '守備お願いします!'], ['🆘 援護', '援護が必要です!'], ['✨ 感謝', 'ありがとうございます!']].forEach(p=>{
const b = document.createElement('button'); b.className='j-btn'; b.innerText=p[0];
b.onclick=()=>{ const i=$id('team-chat-input'); if(i){i.value=p[1]; sendTeamChat();} };
bArea.appendChild(b);
});
- r.appendChild(bArea); r.appendChild(chat); root.appendChild(r);
+ r.appendChild(bArea);
+ r.appendChild(chat); // その下に会話タブ
+ root.appendChild(r);
- // 左側:状況+戦歴
+ // --- 左側:状況 + 戦歴 ---
const l = document.createElement('div');
- l.style.cssText = 'position:absolute; left:10px; bottom:10px; display:flex; gap:5px; pointer-events:auto;';
- const p1 = document.createElement('div'); p1.className='j-box'; p1.style.position='relative'; p1.appendChild(team);
- const p2 = document.createElement('div'); p2.className='j-box'; p2.style.position='relative'; p2.appendChild(log);
+ l.style.cssText = 'position:absolute; left:60px; bottom:10px; display:flex; gap:10px; pointer-events:auto;';
+ const p1 = document.createElement('div'); p1.className='j-box'; p1.innerHTML='<div style="font-size:10px;color:#93c5fd">自軍状況</div>'; p1.appendChild(team);
+ const p2 = document.createElement('div'); p2.className='j-box'; p2.innerHTML='<div style="font-size:10px;color:#93c5fd">戦歴</div>'; p2.appendChild(log);
l.appendChild(p1); l.appendChild(p2); root.appendChild(l);
const orig = $id('team-chat'); if(orig) orig.style.visibility='hidden';
/*
* @title 陣取り司令官・改
* @description 定型文ボタン独立&パネル寄り配置
* @include http://*
* @license MIT License
* @require
* @private
*/
(function(){
const $id = (id)=>document.getElementById(id);
const old = $id('j-all'); if(old) old.remove();
const chat = $id('tc-panel-chat'), team = $id('tc-panel-team'), log = $id('tc-panel-log');
if(!chat) return console.log("パネル未検出");
const style = document.createElement('style');
style.innerHTML = `
.j-box { position:fixed; background:rgba(10,20,40,0.95); border:2px solid #3b82f6; border-radius:8px; padding:8px; z-index:99999; pointer-events:auto; color:#fff; }
.j-btn-area { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.j-btn { background:#2563eb; color:#fff; border:1px solid #60a5fa; border-radius:5px; padding:10px 5px; cursor:pointer; font-size:14px; font-weight:bold; }
.j-btn:hover { background:#1d4ed8; transform:scale(1.02); }
#tc-panel-chat { display:block !important; visibility:visible !important; width:280px; } /* 会話タブを少し大きく */
#tc-panel-team, #tc-panel-log { display:block !important; visibility:visible !important; width:200px; height:150px; overflow-y:auto; }
#team-chat-messages { height:250px !important; } /* チャット履歴を長く */
`;
document.head.appendChild(style);
const root = document.createElement('div');
root.id = 'j-all';
root.style.cssText = 'position:fixed; top:0; left:0; width:100vw; height:100vh; pointer-events:none; z-index:99999;';
document.body.appendChild(root);
// --- 右側:ボタン(上) + 会話(下) ---
const r = document.createElement('div'); r.className = 'j-box';
r.style.right = '60px'; // プレー画面に寄せる(値を小さくすると右端へ、大きくすると中央へ)
r.style.bottom = '10px';
// ボタンを上に配置
const bArea = document.createElement('div');
bArea.className = 'j-btn-area';
[['⚔️ 攻め', '攻めましょう!'], ['🛡️ 守り', '守備お願いします!'], ['🆘 援護', '援護が必要です!'], ['✨ 感謝', 'ありがとうございます!']].forEach(p=>{
const b = document.createElement('button'); b.className='j-btn'; b.innerText=p[0];
b.onclick=()=>{ const i=$id('team-chat-input'); if(i){i.value=p[1]; sendTeamChat();} };
bArea.appendChild(b);
});
r.appendChild(bArea);
r.appendChild(chat); // その下に会話タブ
root.appendChild(r);
// --- 左側:状況 + 戦歴 ---
const l = document.createElement('div');
l.style.cssText = 'position:absolute; left:60px; bottom:10px; display:flex; gap:10px; pointer-events:auto;';
const p1 = document.createElement('div'); p1.className='j-box'; p1.innerHTML='<div style="font-size:10px;color:#93c5fd">自軍状況</div>'; p1.appendChild(team);
const p2 = document.createElement('div'); p2.className='j-box'; p2.innerHTML='<div style="font-size:10px;color:#93c5fd">戦歴</div>'; p2.appendChild(log);
l.appendChild(p1); l.appendChild(p2); root.appendChild(l);
const orig = $id('team-chat'); if(orig) orig.style.visibility='hidden';
setInterval(()=>{ if(typeof refreshTeamStats==='function') refreshTeamStats(); if(typeof renderBattleLog==='function') renderBattleLog(); }, 2000);
})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。