Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove changelog from about section #117

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions layout/pages/drawer/about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,8 @@
<Label class="about__description" html="true" text="#About_Description" />
</Panel>
<Panel class="about__main">
<Panel class="about__tabs tabs ">
<RadioButton id="CreditsButton" class="about__tab tabs__tab" group="AboutSections" selected="true" onactivate="About.switchSection('credits')">
<Label class="tabs__text" text="#About_Credits_Title" />
</RadioButton>
<RadioButton id="ChangelogButton" class="about__tab tabs__tab" group="AboutSections" onactivate="About.switchSection('changelog')">
<Label class="tabs__text" text="#About_Changelog_Title" />
</RadioButton>
</Panel>
<Panel class="about__section-container">
<Frame id="Credits" src="file://{resources}/layout/pages/drawer/credits.xml" class="about__section about-credits about__section--hidden" />
<Panel id="Changelog" class="about__section about__section--hidden">
</Panel>
<Frame id="Credits" src="file://{resources}/layout/pages/drawer/credits.xml" class="about__section about-credits" />
</Panel>
</Panel>
</Panel>
Expand Down
50 changes: 2 additions & 48 deletions scripts/pages/drawer/about.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,14 @@
const CHANGELOG_FILE_PATH = 'panorama/data/changelog.vdf';

class About {
static sections = {
/** @type {Panel} @static */
credits: $('#Credits'),
/** @type {Panel} @static */
changelog: $('#Changelog')
};
static credits = $('#Credits');

static onLoad() {
this.loadChangelog();

this.initCreditEvents();

this.switchSection('credits');

$.GetContextPanel().SetDialogVariable('version', MomentumAPI.GetVersionInfo().version);
}

static switchSection(section) {
const newSection = this.sections[section];

if (!newSection) return;

if (this.activeSection) this.activeSection.AddClass('about__section--hidden');

newSection.RemoveClass('about__section--hidden');

this.activeSection = newSection;
}

static initCreditEvents() {
for (const panel of this.sections.credits.FindChildrenWithClassTraverse('about-credits__name')) {
for (const panel of this.credits.FindChildrenWithClassTraverse('about-credits__name')) {
const name = panel.GetAttributeString('name', '');
const roles = panel.GetAttributeString('roles', '');
const bio = panel.GetAttributeString('bio', '');
Expand Down Expand Up @@ -69,27 +46,4 @@ class About {
panel.SetPanelEvent('onmouseout', () => UiToolkitAPI.HideCustomLayoutTooltip('CreditsTooltip'));
}
}

static loadChangelog() {
const changelogData = $.LoadKeyValuesFile(CHANGELOG_FILE_PATH);

for (const [version, versionData] of Object.entries(changelogData)) {
$.CreatePanel('Label', this.sections.changelog, '', {
class: 'about-changelog__version',
text: version
});

for (const [category, categoryData] of Object.entries(versionData)) {
$.CreatePanel('Label', this.sections.changelog, '', {
class: 'about-changelog__category',
text: category
});

$.CreatePanel('Label', this.sections.changelog, '', {
class: 'about-changelog__item',
text: ' • ' + Object.values(categoryData).join('\n • ')
});
}
}
}
}
23 changes: 0 additions & 23 deletions styles/pages/drawer/about.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@
flow-children: down;
overflow: squish scroll;
padding: 16px 24px;

&--hidden {
visibility: collapse;
}
}
}

Expand Down Expand Up @@ -124,22 +120,3 @@
}
}
}

.about-changelog {
&__version {
@include mixin.font-styles($use-header: true);
font-size: 36px;
margin-bottom: 6px;
}

&__category {
font-size: 18px;
font-weight: bold;
margin-left: 4px;
}

&__item {
font-size: 14px;
margin-bottom: 8px;
}
}
Loading