info overlay + script to update images in games and logs
This commit is contained in:
parent
0cb1cec210
commit
518092d269
14 changed files with 148 additions and 93 deletions
|
|
@ -162,11 +162,12 @@ function getPieceCount(gameId: string): number {
|
|||
}
|
||||
|
||||
function getImageUrl(gameId: string): string {
|
||||
return GAMES[gameId].puzzle.info.imageUrl
|
||||
}
|
||||
|
||||
function setImageUrl(gameId: string, imageUrl: string): void {
|
||||
GAMES[gameId].puzzle.info.imageUrl = imageUrl
|
||||
const imageUrl = GAMES[gameId].puzzle.info.image?.url
|
||||
|| GAMES[gameId].puzzle.info.imageUrl
|
||||
if (!imageUrl) {
|
||||
throw new Error('[2021-07-11] no image url set')
|
||||
}
|
||||
return imageUrl
|
||||
}
|
||||
|
||||
function getScoreMode(gameId: string): ScoreMode {
|
||||
|
|
@ -895,7 +896,6 @@ export default {
|
|||
getFinishedPiecesCount,
|
||||
getPieceCount,
|
||||
getImageUrl,
|
||||
setImageUrl,
|
||||
get,
|
||||
getAllGames,
|
||||
getPlayerBgColor,
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ export interface Image {
|
|||
|
||||
export interface GameSettings {
|
||||
tiles: number
|
||||
image: Image
|
||||
image: ImageInfo
|
||||
scoreMode: ScoreMode
|
||||
shapeMode: ShapeMode
|
||||
snapMode: SnapMode
|
||||
|
|
@ -152,11 +152,23 @@ export interface PieceChange {
|
|||
group?: number
|
||||
}
|
||||
|
||||
export interface ImageInfo
|
||||
{
|
||||
id: number
|
||||
filename: string
|
||||
url: string
|
||||
title: string
|
||||
tags: Tag[]
|
||||
created: Timestamp
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
|
||||
export interface PuzzleInfo {
|
||||
table: PuzzleTable
|
||||
targetTiles: number
|
||||
imageUrl: string
|
||||
imageTitle: string
|
||||
imageUrl?: string // deprecated, use image.url instead
|
||||
image?: ImageInfo
|
||||
|
||||
width: number
|
||||
height: number
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue