定型文・コア
by
cutfloss
05/01 [2026/05/01 13:11:50]
6連ボタン対応の完璧版
@@ -1,105 +1,107 @@
/*
- * @title 陣取りマルチパネル拡張(最強レイヤー版)
- * @description 隠れたパネルを最前面に引きずり出す
+ * @title 陣取り・司令官パネル拡張
+ * @description 定型文ボタン+3パネル展開(左:状況・戦歴横並び / 右:会話)
* @include http://*
* @license MIT License
-* @private
+ * @require
+ * @private
*/
(function() {
- console.log("マルチパネル拡張:物理配置を開始します...");
+ console.log("オールインワン拡張:最終構成を開始します...");
// 1. 二重起動防止
- const old = document.getElementById('jintori-multi-panel');
+ const old = document.getElementById('jintori-all-in-one');
if (old) old.remove();
- // 2. 本家のパネル要素を「救出」する
+ // 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("エラー:本家のチャットパネルが見つかりません。チーム戦中ですか?");
+ console.error("エラー:本家パネルが見つかりません。チーム戦中に実行してください。");
return;
}
- // 3. スタイルを「最強」に設定
- const styleId = 'jintori-ext-style';
+ // 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 !important;
- left: 0 !important;
- width: 100vw !important;
- height: 100vh !important;
- pointer-events: none !important; /* 背景のゲーム操作を邪魔しない */
- z-index: 999999 !important; /* 何よりも上に */
+ 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) !important;
- border: 2px solid #3b82f6 !important;
- border-radius: 8px !important;
- padding: 10px !important;
- pointer-events: auto !important; /* パネル内はクリック可能 */
- box-shadow: 0 0 20px rgba(0,0,0,0.8) !important;
- color: white !important;
+ 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: 12px; color: #93c5fd; font-weight: bold;
- border-bottom: 1px solid #334155; margin-bottom: 8px;
+ font-size: 11px; color: #93c5fd; font-weight: bold;
+ border-bottom: 1px solid #334155; margin-bottom: 5px; padding-bottom: 2px;
}
- /* 本家のパーツを強制表示 */
- #tc-panel-chat, #tc-panel-team, #tc-panel-log {
- display: block !important;
- visibility: visible !important;
- opacity: 1 !important;
+ /* ボタン用スタイル */
+ .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;
}
- #team-chat-messages { height: 300px !important; overflow-y: auto !important; }
- #tc-team-stats, #tc-panel-log { height: 200px !important; overflow-y: auto !important; }
+ .ext-q-btn:hover { background: #1d4ed8; }
+
+ /* 本家パーツの表示強制 */
+ #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. 画面全体を覆う透明なレイヤーをbody直下に作る
+ // 4. ベースコンテナ作成
const container = document.createElement('div');
- container.id = 'jintori-multi-panel';
+ container.id = 'jintori-all-in-one';
container.className = 'ext-container-fixed';
document.body.appendChild(container);
- // 5. 各パネルを配置
- function setupPanel(title, side, bottom, width, content) {
+ // 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);
+ });
+ rightPanel.appendChild(btnGrid);
+ rightPanel.appendChild(chatPanel);
+ container.appendChild(rightPanel);
+
+ // 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 = 'ext-panel';
- p.style[side] = '20px';
- p.style.bottom = bottom + 'px';
- p.style.width = width + 'px';
- p.innerHTML = `<div class="ext-title">${title}</div>`;
- if (content) p.appendChild(content);
- container.appendChild(p);
- }
-
- // パネルを展開
- setupPanel('💬 チーム会話(右端)', 'right', 20, 260, chatPanel);
- setupPanel('⚔️ 戦歴(左端下)', 'left', 20, 240, logPanel);
- setupPanel('👥 自軍状況(左端上)', 'left', 280, 240, teamPanel);
-
- // 6. オリジナルの親枠を完全に消す
- const original = document.getElementById('team-chat');
- if (original) original.style.display = 'none';
-
- // 7. 更新タイマー
- const timerId = setInterval(() => {
- if (!document.getElementById('jintori-multi-panel')) {
- clearInterval(timerId);
- return;
- }
- if (typeof refreshTeamStats === 'function') refreshTeamStats();
- if (typeof renderBattleLog === 'function') renderBattleLog();
- }, 2000);
-
- console.log("マルチパネル拡張:最前面に再配置しました!");
-})();
+ p.className
/*
* @title 陣取り・司令官パネル拡張
* @description 定型文ボタン+3パネル展開(左:状況・戦歴横並び / 右:会話)
* @include http://*
* @license MIT License
* @require
* @private
*/
(function() {
console.log("オールインワン拡張:最終構成を開始します...");
// 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; }
/* 本家パーツの表示強制 */
#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);
});
rightPanel.appendChild(btnGrid);
rightPanel.appendChild(chatPanel);
container.appendChild(rightPanel);
// 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
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。