mirror of
https://github.com/placeAtlas/atlas.git
synced 2025-01-25 01:10:18 +01:00
Merge branch 'cleanup' of github.com:GeoDash897/place-atlas into cleanup
This commit is contained in:
commit
f1d20629b6
6 changed files with 8161 additions and 8158 deletions
|
@ -9721,3 +9721,15 @@ up7z2o
|
||||||
up58ba
|
up58ba
|
||||||
up3yfl
|
up3yfl
|
||||||
up3ty4
|
up3ty4
|
||||||
|
uqixxl
|
||||||
|
uqgttl
|
||||||
|
uqg3it
|
||||||
|
upzg49
|
||||||
|
urripm
|
||||||
|
usn581
|
||||||
|
usn14a
|
||||||
|
usmv6w
|
||||||
|
usmfke
|
||||||
|
usmdg8
|
||||||
|
usm0g8
|
||||||
|
uslwi8
|
||||||
|
|
|
@ -2,9 +2,16 @@
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
|
import math
|
||||||
import traceback
|
import traceback
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
END_NORMAL_IMAGE = "164"
|
||||||
|
END_WHITEOUT_IMAGE = "166"
|
||||||
|
|
||||||
|
NORMAL_IMAGE_SUFFIX = "-" + END_NORMAL_IMAGE
|
||||||
|
WHITEOUT_IMAGE_SUFFIX = "-" + END_WHITEOUT_IMAGE
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Examples:
|
Examples:
|
||||||
1. - /r/place
|
1. - /r/place
|
||||||
|
@ -282,11 +289,6 @@ def extend_entries_to_whiteout(entry: dict):
|
||||||
"""
|
"""
|
||||||
If an entry ends on the final non-whiteout image, extends the image to the last whiteout image where entries cans still be made out.
|
If an entry ends on the final non-whiteout image, extends the image to the last whiteout image where entries cans still be made out.
|
||||||
"""
|
"""
|
||||||
END_NORMAL_IMAGE = "164"
|
|
||||||
END_WHITEOUT_IMAGE = "166"
|
|
||||||
|
|
||||||
NORMAL_IMAGE_SUFFIX = "-" + END_NORMAL_IMAGE
|
|
||||||
WHITEOUT_IMAGE_SUFFIX = "-" + END_WHITEOUT_IMAGE
|
|
||||||
for outer_key in ["path", "center"]:
|
for outer_key in ["path", "center"]:
|
||||||
image_keys: List[str] = list(entry[outer_key].keys())
|
image_keys: List[str] = list(entry[outer_key].keys())
|
||||||
for image_key in image_keys:
|
for image_key in image_keys:
|
||||||
|
@ -300,6 +302,24 @@ def extend_entries_to_whiteout(entry: dict):
|
||||||
|
|
||||||
return entry
|
return entry
|
||||||
|
|
||||||
|
def floor_points(entry: dict):
|
||||||
|
"""
|
||||||
|
Floors points on path and center, removing the decimal count.
|
||||||
|
"""
|
||||||
|
|
||||||
|
for period in entry["path"]:
|
||||||
|
for points in entry["path"][period]:
|
||||||
|
points[0] = math.floor(points[0])
|
||||||
|
points[1] = math.floor(points[1])
|
||||||
|
|
||||||
|
for period in entry["center"]:
|
||||||
|
points = entry["center"][period]
|
||||||
|
points[0] = math.floor(points[0])
|
||||||
|
points[1] = math.floor(points[1])
|
||||||
|
|
||||||
|
return entry
|
||||||
|
|
||||||
|
|
||||||
def validate(entry: dict):
|
def validate(entry: dict):
|
||||||
"""
|
"""
|
||||||
Validates the entry. Catch errors and tell warnings related to the entry.
|
Validates the entry. Catch errors and tell warnings related to the entry.
|
||||||
|
@ -385,6 +405,9 @@ def format_all(entry: dict, silent=False):
|
||||||
entry = sort_image_keys(entry)
|
entry = sort_image_keys(entry)
|
||||||
print_("Extending entries to whiteout...")
|
print_("Extending entries to whiteout...")
|
||||||
entry = extend_entries_to_whiteout(entry)
|
entry = extend_entries_to_whiteout(entry)
|
||||||
|
print_("Flooring points...")
|
||||||
|
entry = floor_points(entry)
|
||||||
|
|
||||||
print_("Validating...")
|
print_("Validating...")
|
||||||
status_code = validate(entry)
|
status_code = validate(entry)
|
||||||
print_("Completed!")
|
print_("Completed!")
|
||||||
|
|
|
@ -270,8 +270,8 @@ function initDraw() {
|
||||||
|
|
||||||
pathWithPeriodsTemp.forEach(([key, value]) => {
|
pathWithPeriodsTemp.forEach(([key, value]) => {
|
||||||
// TODO: Compress periods on something like 0-13, 14.
|
// TODO: Compress periods on something like 0-13, 14.
|
||||||
exportObject.path[key] = value
|
exportObject.path[key] = value.map(point => point.map(int => int - 0.5))
|
||||||
exportObject.center[key] = calculateCenter(value)
|
exportObject.center[key] = calculateCenter(value).map(int => int - 0.5)
|
||||||
})
|
})
|
||||||
|
|
||||||
const inputWebsite = websiteGroupElements.map(element => element.value.trim()).filter(element => element)
|
const inputWebsite = websiteGroupElements.map(element => element.value.trim()).filter(element => element)
|
||||||
|
|
|
@ -516,17 +516,6 @@ async function init() {
|
||||||
|
|
||||||
function updateAtlasAll(atlas = atlasAll) {
|
function updateAtlasAll(atlas = atlasAll) {
|
||||||
for (const atlasIndex in atlas) {
|
for (const atlasIndex in atlas) {
|
||||||
if (Array.isArray(atlas[atlasIndex].path)) {
|
|
||||||
const currentPath = atlas[atlasIndex].path
|
|
||||||
atlas[atlasIndex].path = {}
|
|
||||||
atlas[atlasIndex].path[defaultPeriod] = currentPath
|
|
||||||
}
|
|
||||||
if (Array.isArray(atlas[atlasIndex].center)) {
|
|
||||||
const currentCenter = atlas[atlasIndex].center
|
|
||||||
atlas[atlasIndex].center = {}
|
|
||||||
atlas[atlasIndex].center[defaultPeriod] = currentCenter
|
|
||||||
}
|
|
||||||
if (atlas[atlasIndex].links) {
|
|
||||||
const currentLinks = atlas[atlasIndex].links
|
const currentLinks = atlas[atlasIndex].links
|
||||||
atlas[atlasIndex].links = {
|
atlas[atlasIndex].links = {
|
||||||
website: [],
|
website: [],
|
||||||
|
@ -535,20 +524,16 @@ function updateAtlasAll(atlas = atlasAll) {
|
||||||
wiki: [],
|
wiki: [],
|
||||||
...currentLinks
|
...currentLinks
|
||||||
}
|
}
|
||||||
} else {
|
const currentPath = atlas[atlasIndex].path
|
||||||
atlas[atlasIndex].links = {
|
const currentCenter = atlas[atlasIndex].center
|
||||||
website: [],
|
for (const key in currentPath) {
|
||||||
subreddit: [],
|
currentPath[key] = currentPath[key].map(point => point.map(int => int + 0.5))
|
||||||
discord: [],
|
|
||||||
wiki: []
|
|
||||||
}
|
}
|
||||||
|
for (const key in currentCenter) {
|
||||||
if (atlas[atlasIndex].website) atlas[atlasIndex].links.website = [atlas[atlasIndex].website]
|
currentCenter[key] = currentCenter[key].map(int => int + 0.5)
|
||||||
if (atlas[atlasIndex].subreddit) atlas[atlasIndex].links.subreddit = atlas[atlasIndex].subreddit.split(',').map(subreddit => subreddit.trim().replace(/^\/r\//, ''))
|
|
||||||
|
|
||||||
delete atlas[atlasIndex].website
|
|
||||||
delete atlas[atlasIndex].subreddit
|
|
||||||
}
|
}
|
||||||
|
atlas[atlasIndex].path = currentPath
|
||||||
|
atlas[atlasIndex].center = currentCenter
|
||||||
}
|
}
|
||||||
return atlas
|
return atlas
|
||||||
}
|
}
|
16211
web/atlas.json
16211
web/atlas.json
File diff suppressed because one or more lines are too long
|
@ -358,7 +358,7 @@
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body d-flex flex-column">
|
<div class="modal-body d-flex flex-column">
|
||||||
<div class="period-status alert alert-warning small py-2" role="alert">We've just released our "remaster" of the new atlas, expect some bugs to show after submitting. If something happens, join our discord!</div>
|
<div class="period-status alert alert-warning small py-2" role="alert">We've just released our "remaster" of the Atlas. Bugs may happen after submitting. If something happens, tell us on Discord!</div>
|
||||||
<p>Use the Post Direct to Reddit button or manually copy the text below and submit it as a new text post to <a href="https://www.reddit.com/r/placeAtlas2/" target="_blank" rel="noopener noreferrer">r/placeAtlas2</a> on Reddit.</p>
|
<p>Use the Post Direct to Reddit button or manually copy the text below and submit it as a new text post to <a href="https://www.reddit.com/r/placeAtlas2/" target="_blank" rel="noopener noreferrer">r/placeAtlas2</a> on Reddit.</p>
|
||||||
<p>Don't forget to flair it with the <span class="badge rounded-pill bg-primary"><i class="bi bi-tag" aria-hidden="true"></i> <span id="redditFlair">New Entry</span></span> tag.</p>
|
<p>Don't forget to flair it with the <span class="badge rounded-pill bg-primary"><i class="bi bi-tag" aria-hidden="true"></i> <span id="redditFlair">New Entry</span></span> tag.</p>
|
||||||
<p>We will then check it and add it to the atlas.</p>
|
<p>We will then check it and add it to the atlas.</p>
|
||||||
|
|
Loading…
Add table
Reference in a new issue