mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 21:55:52 +02:00
Archive update 0.53.1
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
.action-bar(
|
||||
[class.has-scroller]="hasScroller" [class.is-mobile]="mobile" [class.is-blurred]="blurred"
|
||||
#scroller (mousewheel)="scroll($event)" (scroll)="true")
|
||||
#scroller (mousewheel)="scroll($event)" (wheel)="scroll($event)" (scroll)="true")
|
||||
action-button(
|
||||
*ngFor="let a of actions; let i = index"
|
||||
[class.blur-me]="i < blurCount"
|
||||
|
||||
@@ -79,6 +79,11 @@
|
||||
| Clear action bar
|
||||
button.btn.btn-outline-secondary.mr-2.mb-2((click)="undo()")
|
||||
| Undo
|
||||
button.btn.btn-outline-secondary.mr-2.mb-2((click)="export()")
|
||||
| Export actions
|
||||
button.btn.btn-outline-secondary.mr-2.mb-2((click)="importFile.click()")
|
||||
| Import actions
|
||||
input.d-none(#importFile type="file" (change)="import(importFile.files[0])")
|
||||
|
||||
tab(*ngIf="dev" title="Dev" [icon]="devIcon")
|
||||
div(*tabContent)
|
||||
|
||||
@@ -2,14 +2,14 @@ import { Component, Output, EventEmitter, OnInit, OnDestroy } from '@angular/cor
|
||||
import { Subscription } from 'rxjs';
|
||||
import {
|
||||
createButtionActionActions, expressionButtonAction, createButtonCommandActions,
|
||||
createDefaultButtonActions, actionExpressionDefaultPalette, entityButtonAction
|
||||
createDefaultButtonActions, actionExpressionDefaultPalette, entityButtonAction, serializeActions, deserializeActions
|
||||
} from '../../../client/buttonActions';
|
||||
import * as sprites from '../../../generated/sprites';
|
||||
import {
|
||||
Eye, Muzzle, ColorExtraSet, ColorExtra, Iris, ExpressionExtra, PonyEye, ButtonAction, Action,
|
||||
ButtonActionSlot, EntityButtonAction
|
||||
} from '../../../common/interfaces';
|
||||
import { createExpression } from '../../../client/clientUtils';
|
||||
import { createExpression, readFileAsText } from '../../../client/clientUtils';
|
||||
import { ACTION_EXPRESSION_BG, ACTION_EXPRESSION_EYE_COLOR, fillToOutline } from '../../../common/colors';
|
||||
import { faLock, faApple, faLaughBeam, faComment, faCog, faCogs } from '../../../client/icons';
|
||||
import { createEyeSprite } from '../../../client/spriteUtils';
|
||||
@@ -151,4 +151,16 @@ export class ActionsModal implements OnInit, OnDestroy {
|
||||
this.entityAction = entityButtonAction(this.entityName);
|
||||
}
|
||||
}
|
||||
export() {
|
||||
const data = serializeActions(this.game.actions);
|
||||
saveAs(new Blob([data], { type: 'text/plain;charset=utf-8' }), `pony-town-actions.json`);
|
||||
}
|
||||
async import(file: File | undefined) {
|
||||
if (file) {
|
||||
const text = await readFileAsText(file);
|
||||
this.game.actions = deserializeActions(text);
|
||||
this.game.editingActions = false;
|
||||
setTimeout(() => this.game.editingActions = true, 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
nav.navbar.navbar-expand.justify-content-end(role="navigation")
|
||||
.d-none.d-md-block
|
||||
a.pixelart.logo(*ngIf="logo" routerLink="/" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }")
|
||||
img.pixelart.logo-large(revSrc="images/logo-large.png" alt="Pony Town")
|
||||
img.pixelart.logo-small(revSrc="images/logo-small.png" alt="Pony Town")
|
||||
img.pixelart.logo-large(revSrc="images/logo-large.png" alt="Pony Town" width="287" height="65")
|
||||
img.pixelart.logo-small(revSrc="images/logo-small.png" alt="Pony Town" width="37" height="43")
|
||||
|
||||
.navbar-collapse.text-right
|
||||
.navbar-nav.ml-auto
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
}
|
||||
|
||||
.logo-large {
|
||||
width: 287px;
|
||||
display: none;
|
||||
|
||||
@include media-breakpoint-up(lg) {
|
||||
@@ -32,7 +31,6 @@
|
||||
}
|
||||
|
||||
.logo-small {
|
||||
width: 37px;
|
||||
display: block;
|
||||
|
||||
@include media-breakpoint-up(lg) {
|
||||
|
||||
@@ -13,7 +13,10 @@ ng-template(#tooltip)
|
||||
span.ml-1 {{counters?.timeouts || 0}}
|
||||
div {{note}}
|
||||
|
||||
.btn-group.btn-group-xs.btn-group-shadow(*ngIf="check?.xcz?.vdw?.qwe?.mnb")
|
||||
.btn-group.btn-group-xs.btn-group-shadow(*ngIf="check?.hgf?.bvc?.wer?.ngf")
|
||||
//- button.btn.btn-xs.btn-default((click)="report()" tooltip="Report")
|
||||
fa-icon([icon]="flagIcon")
|
||||
|
||||
.btn-group.dropdown(dropdown)
|
||||
button.btn.btn-xs.btn-default(dropdownToggle)
|
||||
fa-icon([icon]="moreIcon")
|
||||
|
||||
@@ -2,3 +2,9 @@
|
||||
h5 General rules
|
||||
ul.text-muted.list-rules
|
||||
li(*ngFor="let r of rules") {{r}}
|
||||
|
||||
h5 Notice
|
||||
p.text-muted
|
||||
| This game is very #[strong early in development]. There might be bugs and occasional downtimes.
|
||||
p.text-muted
|
||||
| Please do not redistribute any of the game files or code.
|
||||
|
||||
@@ -123,10 +123,15 @@
|
||||
| Disable function keys (F1-F12)
|
||||
|
||||
.modal-footer.d-flex
|
||||
button.btn.btn-outline-secondary.d-none.d-sm-block((click)="reset()")
|
||||
button.btn.btn-wide.btn-outline-secondary.d-none.d-sm-block((click)="reset()")
|
||||
| Reset
|
||||
button.btn.btn-outline-secondary.d-none.d-sm-block((click)="export()" title="Export settings")
|
||||
fa-icon([icon]="exportIcon" [fixedWidth]="true")
|
||||
button.btn.btn-outline-secondary.d-none.d-sm-block((click)="importFile.click()" title="Import settings")
|
||||
fa-icon([icon]="importIcon" [fixedWidth]="true")
|
||||
input.d-none(#importFile type="file" (change)="import(importFile.files[0])")
|
||||
.flex-grow-1
|
||||
button.btn.btn-outline-secondary((click)="cancel()")
|
||||
button.btn.btn-wide.btn-outline-secondary((click)="cancel()")
|
||||
| Cancel
|
||||
button.btn.btn-outline-secondary.ml-2((click)="ok()")
|
||||
button.btn.btn-wide.btn-outline-secondary.ml-2((click)="ok()")
|
||||
| OK
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
}
|
||||
|
||||
.modal-footer {
|
||||
.btn {
|
||||
.btn-wide {
|
||||
min-width: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
import { StorageService } from '../../services/storageService';
|
||||
import { cloneDeep } from '../../../common/utils';
|
||||
import { PonyTownGame } from '../../../client/game';
|
||||
import { updateRangeIndicator } from '../../../client/clientUtils';
|
||||
import { faSlidersH, faCommentSlash, faGamepad, faImage } from '../../../client/icons';
|
||||
import { updateRangeIndicator, readFileAsText } from '../../../client/clientUtils';
|
||||
import { faSlidersH, faCommentSlash, faGamepad, faImage, faDownload, faUpload } from '../../../client/icons';
|
||||
|
||||
@Component({
|
||||
selector: 'settings-modal',
|
||||
@@ -24,6 +24,8 @@ export class SettingsModal implements OnInit, OnDestroy {
|
||||
readonly filtersIcon = faCommentSlash;
|
||||
readonly controlsIcon = faGamepad;
|
||||
readonly graphicsIcon = faImage;
|
||||
readonly exportIcon = faDownload;
|
||||
readonly importIcon = faUpload;
|
||||
@Output() close = new EventEmitter();
|
||||
account: AccountSettings = {};
|
||||
browser: BrowserSettings = {};
|
||||
@@ -119,4 +121,19 @@ export class SettingsModal implements OnInit, OnDestroy {
|
||||
this.account.filterWords = '';
|
||||
}
|
||||
}
|
||||
export() {
|
||||
const account = { ...this.account, actions: undefined };
|
||||
const browser = this.browser;
|
||||
const data = JSON.stringify({ account, browser });
|
||||
saveAs(new Blob([data], { type: 'text/plain;charset=utf-8' }), `pony-town-settings.json`);
|
||||
}
|
||||
async import(file: File | undefined) {
|
||||
if (file) {
|
||||
const text = await readFileAsText(file);
|
||||
const { account, browser } = JSON.parse(text);
|
||||
const actions = this.account.actions;
|
||||
Object.assign(this.account, { ...account, actions });
|
||||
Object.assign(this.browser, browser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user