Skip to content

Commit

Permalink
ClearSkies/FairSkies
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnAngela committed Jun 12, 2020
1 parent 91336a4 commit 068d77a
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 12 deletions.
16 changes: 8 additions & 8 deletions dist/index.js

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion src/Sightseeing.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import EorzeaClock from "./EorzeaTime";
import EorzeaWeather from "./EorzeaWeather";

type RegardedAsTheSameWeather = string[][];

export interface ISightseeingGroup {
groupName: string;
items: ISightseeingItem[];
Expand Down Expand Up @@ -52,13 +54,24 @@ export class Sightseeing {
this.startHour = item.startHour;
this.endHour = item.endHour;
}
compareWeather(a: string, b: string): boolean {
const regardedAsTheSameWeather: RegardedAsTheSameWeather = [
["weather.ClearSkies", "weather.FairSkies"]
];
for (let i: number = 0; i < regardedAsTheSameWeather.length; i++) {
if (regardedAsTheSameWeather[i].includes(a) && regardedAsTheSameWeather[i].includes(b)) {
return true;
}
}
return a === b;
}
calcNextAvailableTime(): void {
let nowet: EorzeaClock = new EorzeaClock(undefined);
let baseTime: EorzeaClock = EorzeaWeather.calcBaseDate(nowet);
for (let i: number = 0; i < 10000; i++) {
let forecastSeed: number[] = EorzeaWeather.forecastSeed(baseTime, [i]);
let forecast: string = EorzeaWeather.getForecast(this.area, forecastSeed)[0];
if (this.weather === forecast) {
if (this.compareWeather(this.weather, forecast)) {
// 天气匹配成功
let weatherAvaliableTime: number[] = Array.from(
{ length: 8 },
Expand Down
14 changes: 14 additions & 0 deletions src/components/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
@click="setFirstView()"
>{{$t('introdution.button')}}</button>
</div>
<div class="introdutionlead alert alert-info collapse" :class="isWeatherRegardedAsTheSameWeatherView ? 'show' : 'hidden'">
<p class="lead" v-html="$t('weatherRegardedAsTheSameWeather')"></p>
<button
type="button"
class="btn btn-success"
@click="setWeatherRegardedAsTheSameWeatherView()"
>{{$t('introdution.button')}}</button>
</div>
<ul class="nav nav-pills">
<li
class="nav-item"
Expand Down Expand Up @@ -252,6 +260,8 @@ export default class HomePage extends Vue {
};
isFirstView: boolean =
(localStorage.getItem("isFirstView") || "true") === "true";
isWeatherRegardedAsTheSameWeatherView: boolean =
(localStorage.getItem("isWeatherRegardedAsTheSameWeatherView") || "true") === "true";
alertClass: string = "";
created() {
localStorage.removeItem("firstView");
Expand Down Expand Up @@ -348,5 +358,9 @@ export default class HomePage extends Vue {
localStorage.setItem("isFirstView", "false");
this.isFirstView = false;
}
setWeatherRegardedAsTheSameWeatherView() {
localStorage.setItem("isWeatherRegardedAsTheSameWeatherView", "false");
this.isWeatherRegardedAsTheSameWeatherView = false;
}
}
</script>
3 changes: 2 additions & 1 deletion src/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ const en_US: any = {
sightseeingActGuide: "Sightseeing strategy",
sightseeingActGuideSeeHere: "See Here.",
sightseeingClickIntroduction: "Click the uncompleted line below to mark it as completed, and click the completed one to mark as uncompleted. ",
weatherRegardedAsTheSameWeather:"Due to the game update, \"Clear Skies\" and \"Fair Skies\" are now considered to be the same weather. This guide has been adapted to relevant changes.",
introdution: {
text: "This guide can calculate the forecast in Eorzea and find the sightseeings that match the weather and time condition.<br>This guide will alert you when there are new sightseeings that can be done via notifications come from right bottom. Then you can click the notifications to come to this page. (It needs your browser supports Notification API).<br>Please kindly noted: this guide can only alert you that there are new sightseeings can be done, but not how to do them. Please click the link in \"Sightseeing completion\" to learn how to do.",
text: "This guide can calculate the forecast in Eorzea and find the sightseeings that match the weather and time condition.<br>This guide will alert you when there are new sightseeings that can be done via notifications come from right bottom. Then you can click the notifications to come to this page. (It needs your browser supports Notification API).<br>",
button: "I got it.",
},
notification: {
Expand Down
3 changes: 2 additions & 1 deletion src/locales/ja-JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ const ja_JP: any = {
sightseeingActGuide: "探索笔记具体完成办法",
sightseeingActGuideSeeHere: "参见此处。",
sightseeingClickIntroduction: "点击下方未完成的条目可以标记该探索笔记为已完成,点击已完成的可以标记为未完成。",
weatherRegardedAsTheSameWeather:"由于版本更新,“碧空”和“晴朗”现在被视为是一样的天气。本指南已经适配相关改动。",
introdution: {
text: "本指南将会计算艾欧泽亚大陆上的天气情况以匹配将来符合天气和时间条件从而能够完成的探索笔记。<br>本指南将会在有新的探索笔记可以完成时通过浏览器右下角通知的形式告知您,您可以点击该通知来直接地返回到该页面。(需要您的浏览器支持通知功能)<br>请您悉知:本指南仅能提示您可以完成的探索笔记,如何完成它们不在本指南的提示范围内,请点击下方【探索笔记完成情况】一栏的链接以获取探索笔记的完成办法。",
text: "本指南将会计算艾欧泽亚大陆上的天气情况以匹配将来符合天气和时间条件从而能够完成的探索笔记。<br>本指南将会在有新的探索笔记可以完成时通过浏览器右下角通知的形式告知您,您可以点击该通知来直接地返回到该页面。(需要您的浏览器支持通知功能)",
button: "我知道了",
},
notification: {
Expand Down
3 changes: 2 additions & 1 deletion src/locales/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ const zh_CN: any = {
sightseeingActGuide: "探索笔记具体完成办法",
sightseeingActGuideSeeHere: "参见此处。",
sightseeingClickIntroduction: "点击下方未完成的条目可以标记该探索笔记为已完成,点击已完成的可以标记为未完成。",
weatherRegardedAsTheSameWeather:"由于版本更新,“碧空”和“晴朗”现在被视为是一样的天气。本指南已经适配相关改动。",
introdution: {
text: "本指南将会计算艾欧泽亚大陆上的天气情况以匹配将来符合天气和时间条件从而能够完成的探索笔记。<br>本指南将会在有新的探索笔记可以完成时通过浏览器右下角通知的形式告知您,您可以点击该通知来直接地返回到该页面。(需要您的浏览器支持通知功能)<br>请您悉知:本指南仅能提示您可以完成的探索笔记,如何完成它们不在本指南的提示范围内,请点击下方【探索笔记完成情况】一栏的链接以获取探索笔记的完成办法。",
text: "本指南将会计算艾欧泽亚大陆上的天气情况以匹配将来符合天气和时间条件从而能够完成的探索笔记。<br>本指南将会在有新的探索笔记可以完成时通过浏览器右下角通知的形式告知您,您可以点击该通知来直接地返回到该页面。(需要您的浏览器支持通知功能)",
button: "我知道了",
},
notification: {
Expand Down

0 comments on commit 068d77a

Please sign in to comment.