定型文・コア
by
cutfloss
05/01 [2026/05/01 13:11:50]
6連ボタン対応の完璧版
@@ -1,107 +1,47 @@
/*
- * @title 陣取り・司令官パネル拡張
- * @description 定型文ボタン+3パネル展開(左:状況・戦歴横並び / 右:会話)
- * @include http://*
- * @license MIT License
- * @require
+ * @title 陣取り司令官mini
* @private
*/
-
-(function() {
- console.log("オールインワン拡張:最終構成を開始します...");
+(function(){
+ const $id = (id)=>document.getElementById(id);
+ const old = $id('j-all'); if(old) old.remove();
- // 1. 二重起動防止
- const old = document.getElementById('jintori-all-in-one');
- if (old) old.remove();
-
- // 2. 本家のパネル要素を「救出」
- const chatPanel = document.getElementById('tc-panel-chat');
- const teamPanel = document.getElementById('tc-panel-team');
- const logPanel = document.getElementById('tc-panel-log');
-
- if (!chatPanel) {
- console.error("エラー:本家パネルが見つかりません。チーム戦中に実行してください。");
- return;
- }
-
- // 3. スタイル設定(横並びレイアウト調整)
- const styleId = 'jintori-all-style';
- if (!document.getElementById(styleId)) {
- const style = document.createElement('style');
- style.id = styleId;
- style.innerHTML = `
- .ext-container-fixed {
- position: fixed !important; top: 0; left: 0; width: 100vw; height: 100vh;
- pointer-events: none !important; z-index: 999999 !important;
- }
- .ext-panel {
- position: absolute !important; background: rgba(15, 23, 42, 0.95);
- border: 2px solid #3b82f6; border-radius: 8px; padding: 10px;
- pointer-events: auto !important; box-shadow: 0 0 15px rgba(0,0,0,0.7);
- color: white; overflow: hidden;
- }
- .ext-title {
- font-size: 11px; color: #93c5fd; font-weight: bold;
- border-bottom: 1px solid #334155; margin-bottom: 5px; padding-bottom: 2px;
- }
- /* ボタン用スタイル */
- .ext-btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 10px; }
- .ext-q-btn {
- background: #2563eb; color: white; border: 1px solid #60a5fa;
- border-radius: 4px; padding: 5px; font-size: 11px; cursor: pointer;
- }
- .ext-q-btn:hover { background: #1d4ed8; }
+ const chat = $id('tc-panel-chat'), team = $id('tc-panel-team'), log = $id('tc-panel-log');
+ if(!chat) return console.log("チーム戦中に実行してください");
- /* 本家パーツの表示強制 */
- #tc-panel-chat, #tc-panel-team, #tc-panel-log { display: block !important; visibility: visible !important; }
- #team-chat-messages { height: 200px !important; overflow-y: auto !important; }
- #tc-team-stats, #tc-panel-log { height: 150px !important; overflow-y: auto !important; font-size: 11px !important; }
- `;
- document.head.appendChild(style);
- }
-
- // 4. ベースコンテナ作成
- const container = document.createElement('div');
- container.id = 'jintori-all-in-one';
- container.className = 'ext-container-fixed';
- document.body.appendChild(container);
-
- // 5. 右側:定型文ボタン + 会話パネル
- const rightPanel = document.createElement('div');
- rightPanel.className = 'ext-panel';
- rightPanel.style.right = '20px';
- rightPanel.style.bottom = '20px';
- rightPanel.style.width = '260px';
- rightPanel.innerHTML = '<div class="ext-title">💬 チーム通信命令</div>';
-
- // ボタンエリア追加
- const btnGrid = document.createElement('div');
- btnGrid.className = 'ext-btn-grid';
- const phrases = [
- ['⚔️ 攻勢', '攻めましょう!'], ['🛡️ 防衛', '守りを固めて!'],
- ['🆘 援護', '援護が必要です!'], ['✨ 感謝', 'ありがとうございます!']
- ];
- phrases.forEach(p => {
- const b = document.createElement('button');
- b.className = 'ext-q-btn';
- b.innerText = p[0];
- b.onclick = () => {
- const input = document.getElementById('team-chat-input');
- if (input && typeof sendTeamChat === 'function') {
- input.value = p[1];
- sendTeamChat();
- }
- };
- btnGrid.appendChild(b);
+ 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; }
+ `;
+ 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 = '10px'; r.style.bottom = '10px';
+ const bArea = document.createElement('div');
+ [['⚔️攻','攻めましょう!'],['🛡️守','守備!'],['🆘援','援護!'],['✨感','感謝!']].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);
});
- rightPanel.appendChild(btnGrid);
- rightPanel.appendChild(chatPanel);
- container.appendChild(rightPanel);
+ r.appendChild(bArea); r.appendChild(chat); root.appendChild(r);
- // 6. 左側:状況 + 戦歴(横並び)
- const leftContainer = document.createElement('div');
- leftContainer.style.cssText = 'position:absolute; left:20px; bottom:20px; display:flex; gap:10px; pointer-events:auto;';
-
- function createLeftPanel(title, content, width) {
- const p = document.createElement('div');
- p.className
+ // 左側:状況+戦歴
+ 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.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);
+})();
/*
* @title 陣取り司令官mini
* @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.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; }
`;
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 = '10px'; r.style.bottom = '10px';
const bArea = document.createElement('div');
[['⚔️攻','攻めましょう!'],['🛡️守','守備!'],['🆘援','援護!'],['✨感','感謝!']].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: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.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 です。