mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-04 05:48:11 +00:00
Nowe filtry statusów scenerii; aktualizacja scenerii
This commit is contained in:
@@ -168,6 +168,10 @@ export default defineComponent({
|
|||||||
StorageManager.setStringValue("lang", lang);
|
StorageManager.setStringValue("lang", lang);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateToNewest() {
|
||||||
|
// to do
|
||||||
|
},
|
||||||
|
|
||||||
loadLang() {
|
loadLang() {
|
||||||
const storageLang = StorageManager.getStringValue("lang");
|
const storageLang = StorageManager.getStringValue("lang");
|
||||||
|
|
||||||
|
|||||||
+45
-1
@@ -31,6 +31,14 @@
|
|||||||
"value": true,
|
"value": true,
|
||||||
"defaultValue": true
|
"defaultValue": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "unavailable",
|
||||||
|
"name": "unavailable",
|
||||||
|
"iconName": "user",
|
||||||
|
"section": "access",
|
||||||
|
"value": false,
|
||||||
|
"defaultValue": false
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"id": "SPK",
|
"id": "SPK",
|
||||||
@@ -130,7 +138,43 @@
|
|||||||
"section": "status",
|
"section": "status",
|
||||||
"value": true,
|
"value": true,
|
||||||
"defaultValue": true
|
"defaultValue": true
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"id": "endingStatus",
|
||||||
|
"name": "ending-status",
|
||||||
|
"iconName": "",
|
||||||
|
|
||||||
|
"section": "status",
|
||||||
|
"value": true,
|
||||||
|
"defaultValue": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "afkStatus",
|
||||||
|
"name": "afk-status",
|
||||||
|
"iconName": "",
|
||||||
|
|
||||||
|
"section": "status",
|
||||||
|
"value": true,
|
||||||
|
"defaultValue": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "noSpaceStatus",
|
||||||
|
"name": "no-space-status",
|
||||||
|
"iconName": "",
|
||||||
|
|
||||||
|
"section": "status",
|
||||||
|
"value": true,
|
||||||
|
"defaultValue": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "unavailableStatus",
|
||||||
|
"name": "unavailable-status",
|
||||||
|
"iconName": "",
|
||||||
|
|
||||||
|
"section": "status",
|
||||||
|
"value": true,
|
||||||
|
"defaultValue": true
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"sliders": [{
|
"sliders": [{
|
||||||
"id": "min-lvl",
|
"id": "min-lvl",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -50,11 +50,18 @@
|
|||||||
"donate": "DONATE"
|
"donate": "DONATE"
|
||||||
},
|
},
|
||||||
"filters": {
|
"filters": {
|
||||||
|
"endingStatus": "ENDS SOON",
|
||||||
|
"afkStatus": "AFK",
|
||||||
|
"noSpaceStatus":"NO SPACE",
|
||||||
|
"unavailableStatus": "UNAVAILABLE",
|
||||||
|
|
||||||
"title": "STATION FILTER",
|
"title": "STATION FILTER",
|
||||||
"default": "DEFAULT",
|
"default": "DEFAULT",
|
||||||
"not-default": "OTHER",
|
"not-default": "OTHER",
|
||||||
"real": "REAL",
|
"real": "REAL",
|
||||||
"fictional": "FICTIONAL",
|
"fictional": "FICTIONAL",
|
||||||
|
"unavailable": "UNSUPPORTED",
|
||||||
|
|
||||||
"SPK": "SPK",
|
"SPK": "SPK",
|
||||||
"SCS": "SCS",
|
"SCS": "SCS",
|
||||||
"SPE": "SPE",
|
"SPE": "SPE",
|
||||||
|
|||||||
@@ -50,11 +50,17 @@
|
|||||||
"donate": "WESPRZYJ"
|
"donate": "WESPRZYJ"
|
||||||
},
|
},
|
||||||
"filters": {
|
"filters": {
|
||||||
|
"endingStatus": "KOŃCZY",
|
||||||
|
"afkStatus": "Z/W",
|
||||||
|
"noSpaceStatus":"BRAK MIEJSCA",
|
||||||
|
"unavailableStatus": "NIEDOSTĘPNY",
|
||||||
|
|
||||||
"title": "FILTRUJ STACJE",
|
"title": "FILTRUJ STACJE",
|
||||||
"default": "DOMYŚLNA",
|
"default": "DOMYŚLNA",
|
||||||
"not-default": "POZA PACZKĄ",
|
"not-default": "POZA PACZKĄ",
|
||||||
"real": "REALNA",
|
"real": "REALNA",
|
||||||
"fictional": "FIKCYJNA",
|
"fictional": "FIKCYJNA",
|
||||||
|
"unavailable": "NIEDOSTĘPNA",
|
||||||
"SPK": "SPK",
|
"SPK": "SPK",
|
||||||
"SCS": "SCS",
|
"SCS": "SCS",
|
||||||
"SPE": "SPE",
|
"SPE": "SPE",
|
||||||
|
|||||||
@@ -25,6 +25,12 @@ export default interface Filter {
|
|||||||
'include-selected': boolean;
|
'include-selected': boolean;
|
||||||
free: boolean;
|
free: boolean;
|
||||||
occupied: boolean;
|
occupied: boolean;
|
||||||
ending: boolean;
|
|
||||||
nonPublic: boolean;
|
nonPublic: boolean;
|
||||||
|
unavailable: boolean;
|
||||||
|
|
||||||
|
endingStatus: boolean;
|
||||||
|
afkStatus: boolean;
|
||||||
|
noSpaceStatus: boolean;
|
||||||
|
unavailableStatus: boolean;
|
||||||
|
unsignedStatus: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const sortStations = (a: Station, b: Station, sorter: { index: number; dir: numb
|
|||||||
case 7:
|
case 7:
|
||||||
if (a.currentUsers > b.currentUsers) return sorter.dir;
|
if (a.currentUsers > b.currentUsers) return sorter.dir;
|
||||||
if (a.currentUsers < b.currentUsers) return -sorter.dir;
|
if (a.currentUsers < b.currentUsers) return -sorter.dir;
|
||||||
|
|
||||||
if (a.maxUsers > b.maxUsers) return sorter.dir;
|
if (a.maxUsers > b.maxUsers) return sorter.dir;
|
||||||
if (a.maxUsers < b.maxUsers) return -sorter.dir;
|
if (a.maxUsers < b.maxUsers) return -sorter.dir;
|
||||||
break;
|
break;
|
||||||
@@ -60,8 +60,14 @@ const filterStations = (station: Station, filters: Filter) => {
|
|||||||
|
|
||||||
if (station.online && station.statusID == 'ending' && filters['ending']) return returnMode;
|
if (station.online && station.statusID == 'ending' && filters['ending']) return returnMode;
|
||||||
|
|
||||||
|
if (station.statusID == 'ending' && filters['endingStatus']) return returnMode;
|
||||||
|
if (station.statusID == 'not-signed' && filters['unavailableStatus']) return returnMode;
|
||||||
|
if (station.statusID == 'brb' && filters['afkStatus']) return returnMode;
|
||||||
|
if (station.statusID == 'no-space' && filters['noSpaceStatus']) return returnMode;
|
||||||
|
|
||||||
if (station.online && filters['occupied']) return returnMode;
|
if (station.online && filters['occupied']) return returnMode;
|
||||||
if (!station.online && filters['free']) return returnMode;
|
if (!station.online && filters['free']) return returnMode;
|
||||||
|
if (station.unavailable && filters['unavailable']) return returnMode;
|
||||||
|
|
||||||
if (station.default && filters['default']) return returnMode;
|
if (station.default && filters['default']) return returnMode;
|
||||||
if (!station.default && filters['notDefault']) return returnMode;
|
if (!station.default && filters['notDefault']) return returnMode;
|
||||||
@@ -97,6 +103,7 @@ const filterStations = (station: Station, filters: Filter) => {
|
|||||||
|
|
||||||
if (filters['SBL'] && station.SBL) return returnMode;
|
if (filters['SBL'] && station.SBL) return returnMode;
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,7 +135,13 @@ export default class StationFilterManager {
|
|||||||
free: true,
|
free: true,
|
||||||
occupied: false,
|
occupied: false,
|
||||||
ending: false,
|
ending: false,
|
||||||
nonPublic: false
|
nonPublic: false,
|
||||||
|
unavailable: true,
|
||||||
|
afkStatus: false,
|
||||||
|
endingStatus: false,
|
||||||
|
noSpaceStatus: false,
|
||||||
|
unavailableStatus: false,
|
||||||
|
unsignedStatus: false
|
||||||
};
|
};
|
||||||
|
|
||||||
private filters: Filter = { ...this.filterInitStates };
|
private filters: Filter = { ...this.filterInitStates };
|
||||||
@@ -151,19 +164,19 @@ export default class StationFilterManager {
|
|||||||
|
|
||||||
invertFilters() {
|
invertFilters() {
|
||||||
Object.keys(this.filters).forEach(prop => {
|
Object.keys(this.filters).forEach(prop => {
|
||||||
if(typeof this.filters[prop] !== "boolean") return;
|
if (typeof this.filters[prop] !== "boolean") return;
|
||||||
|
|
||||||
this.filters[prop] = !this.filters[prop];
|
this.filters[prop] = !this.filters[prop];
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// for(let prop in this.filters) {
|
// for(let prop in this.filters) {
|
||||||
// if(typeof prop !== "boolean") continue;
|
// if(typeof prop !== "boolean") continue;
|
||||||
|
|
||||||
// this.filters[prop] = !this.filterInitStates[prop];
|
// this.filters[prop] = !this.filterInitStates[prop];
|
||||||
|
|
||||||
// console.log("inverted!");
|
// console.log("inverted!");
|
||||||
|
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user