定型文・コア
by
cutfloss
05/01 [2026/05/01 13:11:50]
6連ボタン対応の完璧版
@@ -1,92 +1,104 @@
/*
- * @title 陣取りチャット拡張
- * @description 画面端に戦術ボタンを追加&チャットを常時表示
+ * @title 陣取りマルチパネル拡張(最強レイヤー版)
+ * @description 隠れたパネルを最前面に引きずり出す
* @include http://*
* @license MIT License
- * @require
- * @private
*/
(function() {
+ console.log("マルチパネル拡張:物理配置を開始します...");
+
// 1. 二重起動防止
- const oldContainer = document.getElementById('jintori-ext-container');
- if (oldContainer) oldContainer.remove();
+ const old = document.getElementById('jintori-multi-panel');
+ if (old) old.remove();
- // 2. 本家のチャット欄を強制的に「常に表示」状態にする
- const originalChat = document.getElementById('team-chat');
- if (originalChat) {
- originalChat.style.display = 'block'; // 常に表示
- originalChat.style.bottom = '10px'; // 右下に固定
- originalChat.style.opacity = '0.9'; // 少し透かす
- // バッジ(丸いアイコン)は邪魔なので消す
- const badge = document.getElementById('team-chat-badge');
- if (badge) badge.style.display = 'none';
+ // 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. 全体コンテナの作成
+ // 3. スタイルを「最強」に設定
+ const styleId = 'jintori-ext-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; /* 何よりも上に */
+ }
+ .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;
+ }
+ .ext-title {
+ font-size: 12px; color: #93c5fd; font-weight: bold;
+ border-bottom: 1px solid #334155; margin-bottom: 8px;
+ }
+ /* 本家のパーツを強制表示 */
+ #tc-panel-chat, #tc-panel-team, #tc-panel-log {
+ display: block !important;
+ visibility: visible !important;
+ opacity: 1 !important;
+ }
+ #team-chat-messages { height: 300px !important; overflow-y: auto !important; }
+ #tc-team-stats, #tc-panel-log { height: 200px !important; overflow-y: auto !important; }
+ `;
+ document.head.appendChild(style);
+ }
+
+ // 4. 画面全体を覆う透明なレイヤーをbody直下に作る
const container = document.createElement('div');
- container.id = 'jintori-ext-container';
+ container.id = 'jintori-multi-panel';
+ container.className = 'ext-container-fixed';
document.body.appendChild(container);
- // 4. スタイルの追加
- const style = document.createElement('style');
- style.innerHTML = `
- .ext-sidebar {
- position: fixed;
- left: 10px;
- top: 50%;
- transform: translateY(-50%);
- z-index: 20000;
- display: flex;
- flex-direction: column;
- gap: 10px;
- }
- .ext-btn {
- background: #3b82f6;
- color: white;
- border: 1px solid #93c5fd;
- border-radius: 6px;
- padding: 10px;
- font-size: 14px;
- cursor: pointer;
- box-shadow: 0 4px 6px rgba(0,0,0,0.3);
- width: 120px;
- transition: 0.2s;
- }
- .ext-btn:hover { background: #2563eb; transform: scale(1.05); }
- `;
- document.head.appendChild(style);
-
- // 5. 左サイドバーの作成
- const sidebar = document.createElement('div');
- sidebar.className = 'ext-sidebar';
- container.appendChild(sidebar);
-
- // 6. 定型文ボタンを作る関数
- function addQuickBtn(label, text) {
- const btn = document.createElement('button');
- btn.className = 'ext-btn';
- btn.innerText = label;
- btn.onclick = () => {
- const input = document.getElementById('team-chat-input');
- if (input) {
- input.value = text; // 入力欄に文字を入れる
- // 本家の「送信」処理を呼び出す
- if (typeof sendTeamChat === 'function') {
- sendTeamChat();
- } else {
- alert('送信機能にアクセスできません');
- }
- }
- };
- sidebar.appendChild(btn);
+ // 5. 各パネルを配置
+ function setupPanel(title, side, bottom, width, content) {
+ 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);
}
- // --- ここに好きな定型文を追加 ---
- addQuickBtn('⚔️ 攻める!', '攻めましょう!');
- addQuickBtn('🛡️ 防衛!', '泉を守りましょう!');
- addQuickBtn('🆘 援護!', '援護お願いします!');
- addQuickBtn('✨ 感謝', 'ありがとうございます!');
+ // パネルを展開
+ 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("陣取りチャット拡張:起動完了");
+ console.log("マルチパネル拡張:最前面に再配置しました!");
})();
/*
* @title 陣取りマルチパネル拡張(最強レイヤー版)
* @description 隠れたパネルを最前面に引きずり出す
* @include http://*
* @license MIT License
*/
(function() {
console.log("マルチパネル拡張:物理配置を開始します...");
// 1. 二重起動防止
const old = document.getElementById('jintori-multi-panel');
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-ext-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; /* 何よりも上に */
}
.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;
}
.ext-title {
font-size: 12px; color: #93c5fd; font-weight: bold;
border-bottom: 1px solid #334155; margin-bottom: 8px;
}
/* 本家のパーツを強制表示 */
#tc-panel-chat, #tc-panel-team, #tc-panel-log {
display: block !important;
visibility: visible !important;
opacity: 1 !important;
}
#team-chat-messages { height: 300px !important; overflow-y: auto !important; }
#tc-team-stats, #tc-panel-log { height: 200px !important; overflow-y: auto !important; }
`;
document.head.appendChild(style);
}
// 4. 画面全体を覆う透明なレイヤーをbody直下に作る
const container = document.createElement('div');
container.id = 'jintori-multi-panel';
container.className = 'ext-container-fixed';
document.body.appendChild(container);
// 5. 各パネルを配置
function setupPanel(title, side, bottom, width, content) {
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("マルチパネル拡張:最前面に再配置しました!");
})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。