mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'master' into dev
This commit is contained in:
commit
ad9f954699
@ -173,7 +173,7 @@
|
||||
"description": "If you want the body to have a tail like the Interloper."
|
||||
},
|
||||
"cometTailRotation": {
|
||||
"type": "#/$defs/vector3",
|
||||
"$ref": "#/$defs/vector3",
|
||||
"description": "If it has a comet tail, it'll be oriented according to these Euler angles."
|
||||
},
|
||||
"hasReferenceFrame": {
|
||||
@ -322,7 +322,7 @@
|
||||
"description": "Should the body always have one side facing its primary?"
|
||||
},
|
||||
"alignmentAxis": {
|
||||
"type": "#/$defs/vector3",
|
||||
"$ref": "#/$defs/vector3",
|
||||
"description": "If it is tidally locked, this direction will face towards the primary. Ex) Interloper uses 0, -1, 0. Most planets will want something like -1, 0, 0."
|
||||
},
|
||||
"showOrbitLine": {
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
{% from 'base/macros.jinja2' import external_link, is_active_page, nav_item, defer_css with context %}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
||||
87
docs/content/pages/faq.jinja2
Normal file
87
docs/content/pages/faq.jinja2
Normal file
@ -0,0 +1,87 @@
|
||||
{#~ Title:FAQ ~#}
|
||||
{#~ Sort-Priority:95 ~#}
|
||||
|
||||
|
||||
{% macro faq(id, q, a) %}
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header">
|
||||
<button id="{{ id }}-heading" class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#{{ id }}" aria-expanded="false" aria-controls="{{ id }}">
|
||||
Q: {{ q }}
|
||||
</button>
|
||||
</h2>
|
||||
<div id="{{ id }}" class="accordion-collapse collapse" aria-labelledby="{{ id }}-heading" data-bs-parent="#accordionFAQ">
|
||||
<div class="accordion-body">
|
||||
{{ ("A: " + a)|simple_md|replace('<p>', '<p class="my-0 ms-2">')|safe }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
<h1 class="text-center pb-2">FAQ</h1>
|
||||
|
||||
<div class="accordion" id="accordionFAQ">
|
||||
{{
|
||||
faq(
|
||||
"is-easy",
|
||||
"How easy is it to make a planet mod?",
|
||||
"Easy, you don't even need to know how to code! Just start off slowly and make a single planet with a few surface details. Don't try to make a full DLC-scale story mod on your first try."
|
||||
)
|
||||
}}
|
||||
{{
|
||||
faq(
|
||||
"model-whole-planet",
|
||||
"Can I model my entire planet in Blender and put it into the game?",
|
||||
"Yes! Follow the instructions on the Detailing page. All you have to do is add that model as a single detail prop at the center of the planet."
|
||||
)
|
||||
}}
|
||||
{{
|
||||
faq(
|
||||
"why-no-planet",
|
||||
"Why doesn't my planet show up in game?",
|
||||
"Have you checked the logs for errors? Are you using a program like [VSCode](https://code.visualstudio.com/){ target='_blank' } to write your configs that validates them against our schema to catch your errors? Do you incrementally test each new planet that you add, or did you write 10 json files and then try them all at once? If you're still not sure, come by our [Discord channel](https://discord.gg/9vE5aHxcF9){ target='_blank' } (`#nh-addon-discussion`) and we'll try to help out!"
|
||||
)
|
||||
}}
|
||||
{{
|
||||
faq(
|
||||
"ui-program",
|
||||
"Will you make a UI program to generate json files in the future?",
|
||||
"Maybe! Will have to wait until New Horizons gets to version 1.0.0."
|
||||
)
|
||||
}}
|
||||
{{
|
||||
faq(
|
||||
"when-version-1",
|
||||
"When will New Horizons get to version 1.0.0.",
|
||||
"Soon/eventually/never/yesterday."
|
||||
)
|
||||
}}
|
||||
{{
|
||||
faq(
|
||||
"feature-request",
|
||||
"When will (*insert feature request here*) be implemented into New Horizons?",
|
||||
"If it's on the road-map, eventually. If it's not on the road-map let us know and we'll see if it's something we can consider adding."
|
||||
)
|
||||
}}
|
||||
{{
|
||||
faq(
|
||||
"i-dont-use-reload-configs",
|
||||
"It takes so long to test my mod because I keep having to restart my game whenever I change something in a config.",
|
||||
"That's not a question. But go into your mod settings in game and enable Debug mode on New Horizons. Now there will be a “Reload Configs” button in your options screen that will reload all your planets without restarting your game!"
|
||||
)
|
||||
}}
|
||||
{{
|
||||
faq(
|
||||
"rails",
|
||||
"Will you ditch the physics simulation and instead track planet positions on their orbits as a function of time, effectively putting the planets on rails and thereby making the game more efficient and accurate at the expense of the game's original vision as being an actual simulation of orbital mechanics?",
|
||||
"**No.**"
|
||||
)
|
||||
}}
|
||||
{{
|
||||
faq(
|
||||
"jammer",
|
||||
"Will Jammer Be Added?",
|
||||
"Yes! Check **your front door**"
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
|
||||
@ -20,3 +20,17 @@ pre > code {
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #555;
|
||||
}
|
||||
|
||||
.accordion-button:not(.collapsed) {
|
||||
color: #effff7;
|
||||
background-color: #2b2b2b;
|
||||
}
|
||||
|
||||
.accordion-button:not(.collapsed)::after {
|
||||
color: #effff7;
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
|
||||
}
|
||||
|
||||
.accordion-item {
|
||||
border: 1px solid rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
@ -14,20 +14,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.accordion-button:not(.collapsed) {
|
||||
color: #effff7;
|
||||
background-color: #2b2b2b;
|
||||
}
|
||||
|
||||
.accordion-button:not(.collapsed)::after {
|
||||
color: #effff7;
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
|
||||
}
|
||||
|
||||
.accordion-item {
|
||||
border: 1px solid rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.bg-warning {
|
||||
color: #131313;
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ from pathlib import Path
|
||||
from shutil import rmtree
|
||||
|
||||
from jinja2 import Environment, select_autoescape, FileSystemLoader
|
||||
from markdown import Markdown
|
||||
|
||||
from lib.Content.CSSStaticItem import CSSStaticItem
|
||||
from lib.Content.HTMLPage import HTMLPage
|
||||
@ -42,12 +43,16 @@ meta_files = [MinifiedMetaItem(Path('browserconfig.jinja2'), '.xml'),
|
||||
|
||||
router = {}
|
||||
|
||||
filter_md = Markdown(extensions=['extra'], output_format='html5')
|
||||
|
||||
env.filters.update({
|
||||
'upper_first': lambda x: x[0].upper() + x[1:],
|
||||
'static': lambda path: str(Path(OUT_DIR, path).as_posix()),
|
||||
'route': lambda title: router.get(title.lower(), "#"),
|
||||
'full_url': lambda relative: BASE_URL + (relative[1:] if relative[0] == "/" else relative),
|
||||
'gen_time': lambda x: GEN_TIME
|
||||
'gen_time': lambda x: GEN_TIME,
|
||||
'simple_md': lambda s: filter_md.convert(s),
|
||||
'inline_md': lambda s: filter_md.convert(s)[3:-4].replace("<em>", "<span style=\"font-style: italic;\">").replace("</em>", "</span>")
|
||||
})
|
||||
|
||||
MetaItem.initialize(env)
|
||||
|
||||
@ -1,58 +0,0 @@
|
||||
from abc import ABC
|
||||
from pathlib import Path
|
||||
|
||||
from htmlmin import minify
|
||||
from jinja2 import Environment
|
||||
|
||||
|
||||
class AbstractContentItem(ABC):
|
||||
|
||||
output_ext: str = '.html'
|
||||
env: Environment
|
||||
in_path: Path
|
||||
out_path: Path
|
||||
root_dir: Path
|
||||
|
||||
def __init__(self, in_path: Path, ext: str = None):
|
||||
self.env = None
|
||||
if ext is not None:
|
||||
self.output_ext = ext
|
||||
self.in_path = in_path
|
||||
self.out_path = Path('out/', in_path.name).with_suffix(self.output_ext)
|
||||
|
||||
@classmethod
|
||||
def initialize(cls, env: Environment) -> list:
|
||||
raise NotImplementedError()
|
||||
|
||||
def render(self, **context) -> str:
|
||||
raise NotImplementedError()
|
||||
|
||||
def _save(self, rendered: str):
|
||||
self.out_path.parent.mkdir(mode=511, parents=True, exist_ok=True)
|
||||
with self.out_path.open(mode='w+', encoding='utf-8') as file:
|
||||
file.write(rendered)
|
||||
|
||||
def generate(self, **context) -> None:
|
||||
print("Building:", self.in_path, "->", self.out_path)
|
||||
self._save(self.render(**context))
|
||||
|
||||
def add_route(self, routes, out_dir):
|
||||
pass
|
||||
|
||||
|
||||
class MinifyMixin(AbstractContentItem, ABC):
|
||||
|
||||
MINIFY_SETTINGS = {
|
||||
'remove_empty_space': True,
|
||||
'keep_pre': True,
|
||||
'remove_optional_attribute_quotes': False
|
||||
}
|
||||
|
||||
def _save(self, rendered: str):
|
||||
rendered = minify(rendered, **self.MINIFY_SETTINGS)
|
||||
super(MinifyMixin, self)._save(rendered)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -14,14 +14,16 @@ class AbstractTemplatedItem(MinifyMixin, AbstractItem, ABC):
|
||||
sort_priority: int = None
|
||||
render_toc: bool = False
|
||||
table_of_contents: dict = {}
|
||||
meta: dict = {
|
||||
'title': None,
|
||||
'description': None,
|
||||
'sort_priority': 10
|
||||
}
|
||||
|
||||
def load_metadata(self):
|
||||
if self.title is None:
|
||||
self.title = self.in_path.stem
|
||||
if self.description is None:
|
||||
self.description = None
|
||||
if self.sort_priority is None:
|
||||
self.sort_priority = 10
|
||||
self.title = self.meta['title'] if self.meta['title'] is not None else self.in_path.stem
|
||||
self.description = self.meta['description']
|
||||
self.sort_priority = int(self.meta['sort_priority'])
|
||||
|
||||
@classmethod
|
||||
def initialize(cls, env: Environment):
|
||||
|
||||
@ -1,8 +1,19 @@
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
from lib.Content.AbstractTemplatedItem import AbstractTemplatedItem
|
||||
|
||||
|
||||
class HTMLPage(AbstractTemplatedItem):
|
||||
|
||||
def load_metadata(self):
|
||||
with self.in_path.open(mode='r', encoding='utf-8') as file:
|
||||
content = file.read()
|
||||
for match in re.findall(r"{#~(.*?)~#}", content, re.MULTILINE):
|
||||
seperated = match.strip().split(':')
|
||||
print(match.strip())
|
||||
self.meta[seperated[0].lower().replace('-', '_')] = seperated[1]
|
||||
super(HTMLPage, self).load_metadata()
|
||||
|
||||
root_dir = Path("pages/")
|
||||
extensions = ('html', 'jinja2', 'jinja')
|
||||
|
||||
@ -29,10 +29,10 @@ class JSONSchema(AbstractSchemaItem):
|
||||
extensions = ('json',)
|
||||
|
||||
def load_metadata(self):
|
||||
self.sort_priority = 10
|
||||
self.meta['sort_priority'] = 10
|
||||
with self.in_path.open(mode='r', encoding='utf-8') as file:
|
||||
self.title = json.load(file).get('title', self.in_path.stem)
|
||||
self.description = "Schema for a " + self.title + " in New Horizons"
|
||||
self.meta['title'] = json.load(file).get('title', self.in_path.stem)
|
||||
self.meta['description'] = "Schema for a " + self.meta['title'] + " in New Horizons"
|
||||
super(JSONSchema, self).load_metadata()
|
||||
|
||||
def render(self, **context):
|
||||
|
||||
@ -11,7 +11,8 @@ class MDPage(AbstractTemplatedItem):
|
||||
extensions = ('md', 'markdown')
|
||||
|
||||
MARKDOWN_SETTINGS = {
|
||||
'extensions': ['extra', 'toc', 'meta', BootstrapExtension()]
|
||||
'extensions': ['extra', 'toc', 'meta', BootstrapExtension()],
|
||||
'output-format': 'html5'
|
||||
}
|
||||
|
||||
def load_metadata(self):
|
||||
@ -19,14 +20,14 @@ class MDPage(AbstractTemplatedItem):
|
||||
with self.in_path.open(mode='r', encoding='utf-8') as file:
|
||||
md.convert(file.read())
|
||||
|
||||
self.title = md.Meta.get('title')[0]
|
||||
self.description = md.Meta.get('description', [None])[0]
|
||||
self.meta['title'] = md.Meta.get('title')[0]
|
||||
self.meta['description'] = md.Meta.get('description', [None])[0]
|
||||
self.render_toc = md.Meta.get('toc', ['True'])[0].strip().lower() == "true"
|
||||
if self.render_toc:
|
||||
self.table_of_contents = md.toc_tokens
|
||||
raw_priority = md.Meta.get('sort-priority')
|
||||
if raw_priority is not None:
|
||||
self.sort_priority = int(raw_priority[0])
|
||||
self.meta['sort_priority'] = int(raw_priority[0])
|
||||
out_name = md.Meta.get('out-file', None)
|
||||
if out_name is not None:
|
||||
self.out_path = self.out_path.with_stem(out_name[0])
|
||||
|
||||
@ -70,7 +70,7 @@ class XMLSchema(AbstractSchemaItem):
|
||||
file.readline()
|
||||
line = file.readline()
|
||||
if len(line.strip()) != 0 and '<!--' in line and '-->' in line:
|
||||
self.title = line.replace('<!--', '').replace('-->', '').strip()
|
||||
self.meta['title'] = line.replace('<!--', '').replace('-->', '').strip()
|
||||
super(XMLSchema, self).load_metadata()
|
||||
|
||||
def render(self, **context):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user