get banner data

This commit is contained in:
SpikeHD 2022-04-25 20:36:30 -07:00
parent 5873603821
commit 82b81bbd6b
9 changed files with 56 additions and 7 deletions

View File

@ -1,5 +1,5 @@
{
"applicationId": "js.grassclipper.app",
"version": "0.7.3",
"version": "0.7.2",
"resourcesURL": "https://github.com/Grasscutters/GrassClipper/releases/latest/download/resources.neu"
}

View File

@ -1,13 +1,12 @@
{
"applicationId": "js.grassclipper.app",
"version": "0.7.3",
"version": "0.7.2",
"defaultMode": "window",
"port": 0,
"documentRoot": "/resources/",
"url": "/",
"enableServer": true,
"enableNativeAPI": true,
"tokenSecurity": "one-time",
"logging": {
"enabled": true,
"writeToLogFile": true

View File

@ -1,6 +1,6 @@
{
"name": "grassclipper",
"version": "0.7.3",
"version": "0.7.2",
"repository": "https://github.com/Grasscutters/GrassClipper.git",
"author": "SpikeHD <spikegdofficial@gmail.com>",
"license": "Apache-2.0",

View File

@ -2,12 +2,14 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style/banner.css" />
<script src="js/neutralino.js"></script>
<script src="../js/neutralino.js"></script>
<script src="js/helpers.js"></script>
<script src="js/banner_data.js"></script>
<script src="js/banner_onload.js"></script>
</head>
<body>
<div id="base">
<span>Select a banner to use as a base (or select no banner to start from scratch)</span>
<span>Select a banner to use as a base:</span>
<select id="bannerDefaultSelect">
</select>

View File

@ -0,0 +1,3 @@
async function fillDefaultBanners() {
getBannerData()
}

View File

@ -0,0 +1,5 @@
document.addEventListener('DOMContentLoaded', async () => {
fillDefaultBanners()
console.log('loaded')
})

View File

@ -0,0 +1,22 @@
Neutralino.init()
const filesystem = Neutralino.filesystem
async function getBannerData() {
const bannerData = await filesystem.readFile('resources/banner_creator/data/banners.txt')
const lines = bannerData.split('\n')
let bannerObj = {}
for (const line of lines) {
const values = line.split(' ')
bannerObj[values[0]] = {
assetName: values[1],
fiveStar: values[2],
// The rest are a list of 4 stars
fourStars: values.slice(3)
}
}
console.log(bannerObj)
}

View File

@ -3,6 +3,24 @@ html { user-select: none; }
body {
overflow: hidden;
height: 95vh;
margin: 0;
margin: 5%;
font-family: Arial, Helvetica, sans-serif;
}
#base {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column
}
#base span {
display: block;
}
#base select {
display: block;
width: 60%;
height: 30px;
margin: 10px auto;
}