mirror of
https://github.com/YouHaveTrouble/DiscipleOfLand.git
synced 2026-05-12 06:26:56 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c652821b85 | |||
| 44c2ec5b25 | |||
| 3ff7d43086 | |||
| 521da22993 | |||
| 3e26ee2559 |
+141
@@ -0,0 +1,141 @@
|
||||
# How to contribute
|
||||
|
||||
All meaningful contributions are welcome. If you're not sure about something,
|
||||
open an issue or [join the discord server](https://discord.youhavetrouble.me/)
|
||||
to talk it out.
|
||||
|
||||
## Reporting issues
|
||||
|
||||
If you find a bug or unexpected behavior, open an issue. Include information about
|
||||
how to reproduce the issue, and any relevant error messages from your browser's
|
||||
console.
|
||||
|
||||
## Pull requests
|
||||
PLEASE OPEN AN ISSUE OR DISCUSS ON DISCORD BEFORE MAKING A PULL REQUEST.
|
||||
|
||||
Noone likes to waste time on a PR that won't be accepted, so please ask first!
|
||||
|
||||
## Inputting data
|
||||
|
||||
Entire project is data-driven and contributions can be made either via pull request or
|
||||
submitting a json file with the data formatted as described below. If anything's unclear,
|
||||
[ask on discord](https://discord.youhavetrouble.me/).
|
||||
|
||||
### Items
|
||||
You can see the existing data [here](https://github.com/YouHaveTrouble/DiscipleOfLand/blob/master/public/data/items.json).
|
||||
Item data adheres to following json schema:
|
||||
```json
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"type": "object",
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z0-9-]+$": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
"level": { "type": "integer" },
|
||||
"stars": { "type": "integer" },
|
||||
"perception": { "type": "integer" }
|
||||
},
|
||||
"required": ["name", "level"]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Zones
|
||||
You can see the existing data [here](https://github.com/YouHaveTrouble/DiscipleOfLand/blob/master/public/data/zones.json).
|
||||
Zone data adheres to following json schema:
|
||||
```json
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"type": "object",
|
||||
"patternProperties": {
|
||||
"^[a-zA-Z0-9-]+$": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"en": { "type": "string" }
|
||||
},
|
||||
"required": ["en"]
|
||||
},
|
||||
"aetherytes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"position": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"x": { "type": "number" },
|
||||
"y": { "type": "number" }
|
||||
},
|
||||
"required": ["x", "y"]
|
||||
},
|
||||
"name": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"en": { "type": "string" }
|
||||
},
|
||||
"required": ["en"]
|
||||
}
|
||||
},
|
||||
"required": ["position", "name"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["name", "aetherytes"]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
```
|
||||
|
||||
### Nodes
|
||||
You can see the existing data [here](https://github.com/YouHaveTrouble/DiscipleOfLand/blob/master/public/data/nodes.json).
|
||||
Node data adheres to following json schema:
|
||||
```json
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"job": {
|
||||
"type": "string",
|
||||
"enum": ["botanist", "miner"]
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["unspoiled", "legendary"]
|
||||
},
|
||||
"position": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"zone": { "type": "string" },
|
||||
"x": { "type": "number" },
|
||||
"y": { "type": "number" }
|
||||
},
|
||||
"required": ["zone", "x", "y"]
|
||||
},
|
||||
"times": {
|
||||
"type": "array",
|
||||
"items": { "type": "string", "pattern": "^\\d{2}:\\d{2}-\\d{2}:\\d{2}$" },
|
||||
"minItems": 2,
|
||||
"maxItems": 2
|
||||
},
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
}
|
||||
},
|
||||
"required": ["job", "type", "position", "times", "items"]
|
||||
}
|
||||
```
|
||||
`times` is an array of two strings representing the time the node is available in Eorzea time.
|
||||
First value is the time the node becomes available, second value is the time the node disappears.
|
||||
|
||||
`items` elements are ids corresponding to the items in the items.json file.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discipleofland",
|
||||
"version": "0.0.7",
|
||||
"version": "0.0.9",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
</main>
|
||||
<footer>
|
||||
<p>v{{ version }}</p>
|
||||
<p><a href="https://github.com/YouHaveTrouble/DiscipleOfLand/blob/master/CONTRIBUTING.MD">Need YOUR help to input node, item and zone data!</a></p>
|
||||
</footer>
|
||||
</div>
|
||||
</template>
|
||||
@@ -227,7 +228,13 @@ nav {
|
||||
}
|
||||
footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 1rem 0.25rem;
|
||||
gap: 0.5rem;
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -135,8 +135,7 @@ export default defineComponent({
|
||||
watch: {
|
||||
filters: {
|
||||
handler(newFilters) {
|
||||
const filters = new Filters(newFilters);
|
||||
window.localStorage.setItem("filters", filters.serialize());
|
||||
window.localStorage.setItem("filters", newFilters.serialize());
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
|
||||
@@ -72,7 +72,7 @@ export default defineComponent(
|
||||
let filters: Filters | null = null;
|
||||
let filtersString = window.localStorage.getItem("filters");
|
||||
if (filtersString === null) {
|
||||
window.localStorage.setItem("filters", JSON.stringify(new Filters()));
|
||||
window.localStorage.setItem("filters", new Filters().serialize());
|
||||
filtersString = window.localStorage.getItem("filters");
|
||||
}
|
||||
if (filtersString === null) {
|
||||
|
||||
+20
-5
@@ -18,7 +18,13 @@ export default class Filters {
|
||||
) {
|
||||
this.minLevel = data?.minLevel || 91;
|
||||
this.maxLevel = data?.maxLevel || 100;
|
||||
const jobData = data?.jobs || [Job.BOTANIST, Job.MINER];
|
||||
let jobData = [
|
||||
Job.BOTANIST.toLowerCase(),
|
||||
Job.MINER.toLowerCase()
|
||||
];
|
||||
if (data?.jobs && Array.isArray(data?.jobs) && data?.jobs?.length > 0) {
|
||||
jobData = data.jobs;
|
||||
}
|
||||
|
||||
for (const job of jobData) {
|
||||
const parsedJob = jobFromString(job);
|
||||
@@ -26,24 +32,33 @@ export default class Filters {
|
||||
this.jobs.add(parsedJob);
|
||||
}
|
||||
|
||||
const nodeTypeData = data?.nodeTypes || [
|
||||
NodeType.UNSPOILED,
|
||||
let nodeTypeData = [
|
||||
NodeType.UNSPOILED.toLowerCase(),
|
||||
];
|
||||
if (data?.nodeTypes && Array.isArray(data?.nodeTypes) && data?.nodeTypes?.length > 0) {
|
||||
nodeTypeData = data.nodeTypes;
|
||||
}
|
||||
|
||||
if (Array.isArray(nodeTypeData)) {
|
||||
for (const nodeType of nodeTypeData) {
|
||||
const parsedNodeType = nodeTypeFromString(nodeType);
|
||||
if (!parsedNodeType) continue;
|
||||
this.nodeTypes.add(parsedNodeType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
serialize(): string {
|
||||
const serializedJobs = Array.from(this.jobs);
|
||||
const serializedNodeTypes = Array.from(this.nodeTypes);
|
||||
|
||||
return JSON.stringify({
|
||||
minLevel: this.minLevel,
|
||||
maxLevel: this.maxLevel,
|
||||
jobs: Array.from(this.jobs).map(job => job),
|
||||
nodeTypes: Array.from(this.nodeTypes).map(nodeType => nodeType),
|
||||
jobs: serializedJobs,
|
||||
nodeTypes: serializedNodeTypes,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user