Слияние ui -> main #1

Merged
sasheg merged 145 commits from ui into main 2026-08-20 13:54:02 +00:00
5 changed files with 59 additions and 8 deletions
Showing only changes of commit 2d6355ea57 - Show all commits
+6
View File
@@ -172,10 +172,12 @@
<fileVersion>${project.version}.${hotfix}</fileVersion> <fileVersion>${project.version}.${hotfix}</fileVersion>
<txtFileVersion>${project.version}.${hotfix}</txtFileVersion> <txtFileVersion>${project.version}.${hotfix}</txtFileVersion>
<fileDescription>ZernMC Launcher</fileDescription> <fileDescription>ZernMC Launcher</fileDescription>
<copyright>Copyright (c) 2023-2026 ZernMC</copyright>
<productVersion>${project.version}.${hotfix}</productVersion> <productVersion>${project.version}.${hotfix}</productVersion>
<txtProductVersion>${project.version}.${hotfix}</txtProductVersion> <txtProductVersion>${project.version}.${hotfix}</txtProductVersion>
<productName>ZernMC</productName> <productName>ZernMC</productName>
<companyName>ZernMC</companyName> <companyName>ZernMC</companyName>
<trademarks>ZernMC</trademarks>
<internalName>zernmc</internalName> <internalName>zernmc</internalName>
<originalFilename>zernmc.exe</originalFilename> <originalFilename>zernmc.exe</originalFilename>
</versionInfo> </versionInfo>
@@ -207,10 +209,12 @@
<fileVersion>${project.version}.${hotfix}</fileVersion> <fileVersion>${project.version}.${hotfix}</fileVersion>
<txtFileVersion>${project.version}.${hotfix}</txtFileVersion> <txtFileVersion>${project.version}.${hotfix}</txtFileVersion>
<fileDescription>ZernMC Launcher CLI</fileDescription> <fileDescription>ZernMC Launcher CLI</fileDescription>
<copyright>Copyright (c) 2023-2026 ZernMC</copyright>
<productVersion>${project.version}.${hotfix}</productVersion> <productVersion>${project.version}.${hotfix}</productVersion>
<txtProductVersion>${project.version}.${hotfix}</txtProductVersion> <txtProductVersion>${project.version}.${hotfix}</txtProductVersion>
<productName>ZernMC CLI</productName> <productName>ZernMC CLI</productName>
<companyName>ZernMC</companyName> <companyName>ZernMC</companyName>
<trademarks>ZernMC</trademarks>
<internalName>zernmc-cli</internalName> <internalName>zernmc-cli</internalName>
<originalFilename>zernmc-cli.exe</originalFilename> <originalFilename>zernmc-cli.exe</originalFilename>
</versionInfo> </versionInfo>
@@ -242,10 +246,12 @@
<fileVersion>${project.version}.${hotfix}</fileVersion> <fileVersion>${project.version}.${hotfix}</fileVersion>
<txtFileVersion>${project.version}.${hotfix}</txtFileVersion> <txtFileVersion>${project.version}.${hotfix}</txtFileVersion>
<fileDescription>ZernMC Launcher CLI + JFX</fileDescription> <fileDescription>ZernMC Launcher CLI + JFX</fileDescription>
<copyright>Copyright (c) 2023-2026 ZernMC</copyright>
<productVersion>${project.version}.${hotfix}</productVersion> <productVersion>${project.version}.${hotfix}</productVersion>
<txtProductVersion>${project.version}.${hotfix}</txtProductVersion> <txtProductVersion>${project.version}.${hotfix}</txtProductVersion>
<productName>ZernMC CLI JFX</productName> <productName>ZernMC CLI JFX</productName>
<companyName>ZernMC</companyName> <companyName>ZernMC</companyName>
<trademarks>ZernMC</trademarks>
<internalName>zernmc-cli-jfx</internalName> <internalName>zernmc-cli-jfx</internalName>
<originalFilename>zernmc-cli-jfx.exe</originalFilename> <originalFilename>zernmc-cli-jfx.exe</originalFilename>
</versionInfo> </versionInfo>
+12 -6
View File
@@ -141,9 +141,12 @@
</div> </div>
</nav> </nav>
<div class="sidebar-section"> <div class="sidebar-section section-collapsible" id="server-packs-section">
<div class="section-header"> <div class="section-header" id="server-packs-header" title="Toggle">
<span class="section-title" data-i18n="sidebar.serverPacks">Server Packs</span> <span class="section-title-wrap">
<svg class="section-chevron" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>
<span class="section-title" data-i18n="sidebar.serverPacks">Server Packs</span>
</span>
<button class="btn-icon" id="add-server-pack-btn" title="Install server pack"> <button class="btn-icon" id="add-server-pack-btn" title="Install server pack">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
</button> </button>
@@ -151,9 +154,12 @@
<div id="server-packs-list" class="pack-list"></div> <div id="server-packs-list" class="pack-list"></div>
</div> </div>
<div class="sidebar-section" id="local-packs-section"> <div class="sidebar-section section-collapsible" id="local-packs-section">
<div class="section-header"> <div class="section-header" id="local-packs-header" title="Toggle">
<span class="section-title" data-i18n="sidebar.localPacks">Local Packs</span> <span class="section-title-wrap">
<svg class="section-chevron" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>
<span class="section-title" data-i18n="sidebar.localPacks">Local Packs</span>
</span>
<button class="btn-icon" id="add-pack-btn" title="Add pack"> <button class="btn-icon" id="add-pack-btn" title="Add pack">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg> <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
</button> </button>
@@ -460,6 +460,7 @@ class ZernMCLauncher {
this._playtimeAccumulated = 0; this._playtimeAccumulated = 0;
this._playtimeStartTime = null; this._playtimeStartTime = null;
this._currentPlaytimePack = null; this._currentPlaytimePack = null;
this._openSection = undefined;
this.init(); this.init();
} }
@@ -893,6 +894,20 @@ class ZernMCLauncher {
document.getElementById('add-pack-btn').addEventListener('click', () => this.showInstallModal()); document.getElementById('add-pack-btn').addEventListener('click', () => this.showInstallModal());
document.getElementById('add-server-pack-btn').addEventListener('click', () => this.showInstallModal()); document.getElementById('add-server-pack-btn').addEventListener('click', () => this.showInstallModal());
// Accordion sidebar sections: max one pack list open at a time
const serverHeader = document.getElementById('server-packs-header');
const localHeader = document.getElementById('local-packs-header');
[serverHeader, localHeader].forEach(header => {
if (!header) return;
header.addEventListener('click', (e) => {
if (e.target.closest('.btn-icon')) return;
const name = header.id === 'server-packs-header' ? 'server' : 'local';
this._openSection = this._openSection === name ? null : name;
this.syncOpenSections();
});
});
document.getElementById('close-modal-btn').addEventListener('click', () => this.hideInstallModal()); document.getElementById('close-modal-btn').addEventListener('click', () => this.hideInstallModal());
document.querySelectorAll('.modal-tab').forEach(t => { document.querySelectorAll('.modal-tab').forEach(t => {
t.addEventListener('click', () => this.switchInstallTab(t.dataset.tab)); t.addEventListener('click', () => this.switchInstallTab(t.dataset.tab));
@@ -1044,6 +1059,13 @@ class ZernMCLauncher {
return inst && inst.isServerPack && this.state.updateMap && this.state.updateMap[inst.name] === true; return inst && inst.isServerPack && this.state.updateMap && this.state.updateMap[inst.name] === true;
} }
syncOpenSections() {
const serverSection = document.getElementById('server-packs-section');
const localSection = document.getElementById('local-packs-section');
if (serverSection) serverSection.classList.toggle('collapsed', this._openSection !== 'server');
if (localSection) localSection.classList.toggle('collapsed', this._openSection !== 'local');
}
renderSidebar() { renderSidebar() {
const serverList = document.getElementById('server-packs-list'); const serverList = document.getElementById('server-packs-list');
const localList = document.getElementById('local-packs-list'); const localList = document.getElementById('local-packs-list');
@@ -1085,6 +1107,13 @@ class ZernMCLauncher {
if (localSection && localList.children.length > 0) { if (localSection && localList.children.length > 0) {
localSection.classList.remove('hidden'); localSection.classList.remove('hidden');
} }
// Default: open the section that has packs (server list first)
if (this._openSection === undefined) {
this._openSection = serverList.children.length > 0 ? 'server'
: (localList.children.length > 0 ? 'local' : null);
}
this.syncOpenSections();
} }
selectPack(inst) { selectPack(inst) {
+11 -1
View File
@@ -219,7 +219,17 @@ body {
display: flex; align-items: center; justify-content: space-between; display: flex; align-items: center; justify-content: space-between;
margin-bottom: 8px; padding: 0 4px; margin-bottom: 8px; padding: 0 4px;
} }
.section-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); } .section-collapsible .section-header { cursor: pointer; user-select: none; }
.section-collapsible .section-header:hover .section-title { color: var(--text-secondary); }
.section-title-wrap {
display: flex; align-items: center; gap: 6px; min-width: 0;
}
.section-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); transition: var(--transition); }
.section-chevron { flex-shrink: 0; color: var(--text-muted); transition: transform .2s var(--ease, ease); }
.section-collapsible.collapsed .section-chevron { transform: rotate(-90deg); }
.section-collapsible.collapsed .pack-list { display: none; }
.section-collapsible.collapsed .section-header { margin-bottom: 0; }
.section-collapsible.collapsed .section-title { color: var(--text-muted); }
.pack-list { .pack-list {
display: flex; flex-direction: column; gap: 3px; display: flex; flex-direction: column; gap: 3px;
+1 -1
View File
@@ -20,7 +20,7 @@
<properties> <properties>
<revision>1.0.16</revision> <revision>1.0.16</revision>
<hotfix>17</hotfix> <hotfix>18</hotfix>
<maven.compiler.source>21</maven.compiler.source> <maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target> <maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>