Skip to content

Commit

Permalink
Merge pull request #52 from InfSein/dev
Browse files Browse the repository at this point in the history
Update to v2.0.9
  • Loading branch information
InfSein authored Oct 22, 2024
2 parents e676c2a + d824064 commit d7e8284
Show file tree
Hide file tree
Showing 24 changed files with 412 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

#### Windows 应用

参见 [Release Electron v3](https://github.com/InfSein/hqhelper-dawntrail/releases/tag/electron.v3)
参见 [Release Electron v4](https://github.com/InfSein/hqhelper-dawntrail/releases/tag/electron.v4)

#### iOS 应用

Expand Down
2 changes: 1 addition & 1 deletion docs/README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ We may provide various types of applications, but it is difficult to guarantee t

#### Windows APP

See [Release Electron v3](https://github.com/InfSein/hqhelper-dawntrail/releases/tag/electron.v3)
See [Release Electron v4](https://github.com/InfSein/hqhelper-dawntrail/releases/tag/electron.v4)

#### iOS APP

Expand Down
2 changes: 1 addition & 1 deletion docs/README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

#### Windows アプリ

[Release Electron v3](https://github.com/InfSein/hqhelper-dawntrail/releases/tag/electron.v3) をご覧ください。
[Release Electron v4](https://github.com/InfSein/hqhelper-dawntrail/releases/tag/electron.v4) をご覧ください。

#### iOS アプリ

Expand Down
1 change: 1 addition & 0 deletions env.electron.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface ElectronAPI {
onUpdateProgress: (callback: (progressData: ProgressData) => void) => void;
openUrlByBrowser: (url: string) => void;
copyText: (text: string) => Promise<string>;
createNewWindow: (id: string, url: string, defaultWidth: number, defaultHeight: number) => void;
}

export interface ProgressData {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hqhelper-dawntrail",
"version": "2.0.8",
"version": "2.0.9",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion public/version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"hqhelper": "2.0.8",
"hqhelper": "2.0.9",
"electron": "v4"
}
28 changes: 26 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import { computed, provide, ref, getCurrentInstance, onMounted } from 'vue'
import {
darkTheme, lightTheme, useOsTheme,
zhCN, enUS, jaJP, dateZhCN, dateEnUS, dateJaJP,
NConfigProvider, NMessageProvider,
NLayout, NLayoutHeader, NLayoutContent
NConfigProvider, NGlobalStyle, NMessageProvider,
NLayout, NLayoutHeader, NLayoutContent,
type GlobalThemeOverrides
} from 'naive-ui'
// * import pages and components
Expand Down Expand Up @@ -216,14 +217,37 @@ onMounted(async () => {
}
}
})
const naiveUIThemeOverrides = computed(() : GlobalThemeOverrides => {
let fontFamily = 'Lato, -apple-system, Helvetica Neue, Segoe UI, Microsoft Yahei, 微软雅黑, Arial, Helvetica, sans-serif'
if (userConfig.value.custom_font) {
fontFamily = userConfig.value.custom_font + ', ' + fontFamily
}
fontFamily = 'FFXIV, ' + fontFamily
const fontSize = userConfig.value.custom_font_size || '14px'
return {
common: {
fontFamily,
fontSize,
fontSizeMedium: fontSize,
fontSizeSmall: fontSize,
fontSizeTiny: `calc(${fontSize} - 2px)`,
fontSizeMini: `calc(${fontSize} - 1px)`,
fontSizeLarge: `calc(${fontSize} + 1px)`,
fontSizeHuge: `calc(${fontSize} + 2px)`
}
}
})
</script>

<template>
<n-config-provider
:theme="naiveUiTheme"
:locale="naiveUiLocale"
:date-locale="naiveUiDateLocale"
:theme-overrides="naiveUIThemeOverrides"
>
<n-global-style />
<n-message-provider :placement="naiveUiMessagePlacement">
<div :class="appClass">
<n-layout id="main-layout" position="absolute" :native-scrollbar="false">
Expand Down
3 changes: 3 additions & 0 deletions src/assets/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
.font-center {
text-align: center;
}
.font-small {
font-size: calc(var(--n-font-size) - 2px);
}
.align-left {
text-align: left;
}
Expand Down
14 changes: 14 additions & 0 deletions src/assets/data/translations/xiv-item-remarks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"-99999": [
"此文件存放物品的备注(制作/采集提醒,物品功能,等等)",
"备注以string数组格式呈现,除了普通的笔记之外,还可以使用一些特殊的值,比如:",
"BR - 换行",
"~ITEM:22356 - 展示一个物品,ID为22356",
"~LOCATION:6640,12.3,21.9 - 展示一个带有坐标的地图,ID(xiv-maps.json的键)为6640,坐标为12.3,21.9"
],
"43668": [
"可通过雇员探险获得。",
"BR",
"91级捕鱼筹集委托,需要雇员获得力达到2336。雇员鉴别力达到3405时可一次筹集9条。"
]
}
2 changes: 1 addition & 1 deletion src/assets/data/unpacks/hq-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5546,4 +5546,4 @@
"normalCrafting": [],
"tradeShops": []
}
}
}
14 changes: 7 additions & 7 deletions src/assets/data/unpacks/item.json

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions src/components/custom-controls/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ const redirectToFoodAndTincPage = () => {
router.push('/fthelper')
}
const redirectToGatherClockPage = () => {
/*
if (window.electronAPI?.createNewWindow) {
const path = router.resolve({ path: '/gatherclock' }).href
window.electronAPI.createNewWindow(
'gatherclock',
document?.location?.origin + document.location.pathname + path,
300,
600
)
} else {
}
*/
router.push('/gatherclock')
}
Expand Down
76 changes: 74 additions & 2 deletions src/components/modals/ModalUserPreferences.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { inject, ref, watch, type Ref } from 'vue'
import {
NButton, NCard, NCascader, NCollapse, NCollapseItem, NIcon, NModal, NPopover, NRadioButton, NRadioGroup, NSelect, NSwitch, NTabs, NTabPane,
NButton, NCard, NCascader, NCollapse, NCollapseItem, NIcon, NInput, NModal, NPopover, NRadioButton, NRadioGroup, NSelect, NSwitch, NTabs, NTabPane,
type CascaderOption
} from 'naive-ui'
import { useStore } from '@/store/index'
Expand Down Expand Up @@ -48,7 +48,7 @@ interface UserPreferenceItem {
class: string
style: string
}[]
type: 'radio-group' | 'switch' | 'select' | 'cascader'
type: 'radio-group' | 'switch' | 'select' | 'cascader' | 'string'
options: CascaderOption[]
}
const dealSimOptions = (options: string[]) => {
Expand Down Expand Up @@ -145,6 +145,66 @@ const UserPreferenceGroups : UserPreferenceGroup[] = [
{ value: 'dark', label: t('深色') }
]
},
{
key: 'custom_font_size',
label: t('字体大小'),
descriptions: [
{
value: t('全局性地修改程序/网站的字体大小。'),
class: '',
style: ''
},
{
value: t('部分区域的字体大小不受此设置的影响。此外,还会受到浏览器“最小字号”设置的限制。'),
class: '',
style: ''
},
{
value: t('暂时无法保证“标准”大小之外的显示效果。除非有特殊需要,否则不建议修改。'),
class: '',
style: ''
},
],
warnings: [],
type: 'radio-group',
options: [
{ value: '12px', label: t('更小') },
{ value: '13px', label: t('较小') },
{ value: '14px', label: t('标准') },
{ value: '15px', label: t('较大') },
{ value: '16px', label: t('更大') },
]
},
{
key: 'custom_font',
label: t('自定义字体'),
descriptions: [
{
value: t('全局性地修改程序/网站的字体。'),
class: '',
style: ''
},
{
value: t('可以设置多个字体,用英文逗号分隔。当前一个字体字库未包括要显示的文字时,程序会使用下一个字体;如果均不包括,程序会使用设置前的字体。'),
class: '',
style: ''
},
{
value: t('字体名称出现空格时,建议用英文的单引号或双引号来将其包裹,例如"思源黑体 CN Medium"。'),
class: '',
style: ''
},
{
value: t('如果你对CSS有所了解,可以直接参照font-family的语法来填写。'),
class: '',
style: ''
}
],
warnings: [
],
type: 'string',
options: []
},
{
key: 'hide_collector_icons',
label: t('隐藏物品按钮的职业图标'),
Expand Down Expand Up @@ -782,6 +842,12 @@ const handleSave = () => {
filterable
:style="{ width: isMobile ? '85%' : '70%' }"
/>
<n-input
v-if="item.type === 'string'"
v-model:value="(formData as any)[item.key]"
type="text"
:style="{ width: isMobile ? '85%' : '70%' }"
/>
</template>
<div class="flex-column flex-center">
<p
Expand Down Expand Up @@ -827,6 +893,12 @@ const handleSave = () => {
filterable
:style="{ width: isMobile ? '85%' : '70%' }"
/>
<n-input
v-if="item.type === 'string'"
v-model:value="(formData as any)[item.key]"
type="text"
:style="{ width: isMobile ? '85%' : '70%' }"
/>
</div>
</div>
</div>
Expand Down
26 changes: 26 additions & 0 deletions src/data/change-logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,32 @@ export const getChangelogs = (
}
const isZh = ui_lang === 'zh'
return [
{
version: '2.0.9',
date: '2024-10-22',
changes: [
{
name: groupName.breaking,
changes: [
t('国服数据库更新至{ver}。', {
ver: '7.01'
})
]
},
{
name: groupName.feature,
changes: [
t('现在可以在“{f1}”的“{f2}”选项卡中调整程序/网站使用的字体及字体大小。', {
f1: t('偏好设置'),
f2: t('外观')
}),
t('现在“{f}”还会在当前可采集道具的采集卡片中显示现实世界的剩余时间。', {
f: t('采集时钟')
})
]
}
]
},
{
version: '2.0.8',
date: '2024-10-18',
Expand Down
21 changes: 20 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,5 +475,24 @@ export default {
"474": "You can change settings and check details in \"{f1}\"→\"{f2}\"→\"{f3}\"",
"475": "Cache got in old version would be expired after update due to data type adjustment.",
"476": "Now the item button popup shows not only \"This item could be reduced from\" but also \"Reducing this item could get (aethersand)\"",
"477": "To avoid infinite jumping of the item button popup, the latter will not display info icon that can open the popup."
"477": "To avoid infinite jumping of the item button popup, the latter will not display info icon that can open the popup.",
"478": "Now you can customize font and font size in \"{f1}\"→\"{f2}\".",
"479": "Remains:",
"480": "{minute}m",
"481": "{second}s",
"482": "Font size",
"483": "Change the size of text in program/website globally.",
"484": "Some areas do not follow this setting. In addition, it is also limited by the 'Minimum font size' setting of the browser.",
"485": "Now we could not guarantee the display effect of sizes other than \"Standard\". Unless there is a special need, we do not recommend modifying.",
"486": "Tiny",
"487": "Small",
"488": "Standard",
"489": "Large",
"490": "Huge",
"491": "Custom font",
"492": "Change the font of text in program/website globally.",
"493": "Allow multi fonts, separated by comma. If the font library of the first font does not include the text to be displayed, the program will use the second font; if none of them include the text, the program will use the font before the setting.",
"494": "Recommends to wrap the font name with single or double quotes, such as \"Source Han Sans Medium\".",
"495": "If you have knowledge about CSS, you can refer to the syntax of font-family to fill in.",
"496": "Now the \"{f}\" will also show the remaining earth time in the item card of the current collectible item."
}
21 changes: 20 additions & 1 deletion src/languages/idMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,5 +475,24 @@ export default {
"可以在 “{f1}”→“{f2}”→“{f3}” 设置和查看详细说明。": 474,
"由于进行了数据类型调整,旧版本获取到的物品价格缓存在更新后需要重新获取。": 475,
"现在物品按钮悬浮窗的精选栏目除了会展示“可以通过什么道具精选出此物品”还会显示“精选此物品有可能获得什么道具(限灵砂)”。": 476,
"为了避免物品按钮悬浮窗的无限跳转,后者不会展示可以打开悬浮窗的信息图标。": 477
"为了避免物品按钮悬浮窗的无限跳转,后者不会展示可以打开悬浮窗的信息图标。": 477,
"现在可以在“{f1}”的“{f2}”选项卡中调整程序/网站使用的字体及字体大小。": 478,
"剩余:": 479,
"{minute}分": 480,
"{second}秒": 481,
"字体大小": 482,
"全局性地修改程序/网站的字体大小。": 483,
"部分区域的字体大小不受此设置的影响。此外,还会受到浏览器“最小字号”设置的限制。": 484,
"暂时无法保证“标准”大小之外的显示效果。除非有特殊需要,否则不建议修改。": 485,
"更小": 486,
"较小": 487,
"标准": 488,
"较大": 489,
"更大": 490,
"自定义字体": 491,
"全局性地修改程序/网站的字体。": 492,
"可以设置多个字体,用英文逗号分隔。当前一个字体字库未包括要显示的文字时,程序会使用下一个字体;如果均不包括,程序会使用设置前的字体。": 493,
"字体名称出现空格时,建议用英文的单引号或双引号来将其包裹,例如\"思源黑体 CN Medium\"。": 494,
"如果你对CSS有所了解,可以直接参照font-family的语法来填写。": 495,
"现在“{f}”还会在当前可采集道具的采集卡片中显示现实世界的剩余时间。": 496
}
21 changes: 20 additions & 1 deletion src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,5 +475,24 @@ export default {
"474": "「{f1}」→「{f2}」→「{f3}」で詳細な説明を設定・確認できます。",
"475": "データタイプの調整が行われたため、旧バージョンで取得したアイテム価格のキャッシュは、アップデート後に再取得が必要です。",
"476": "アイテムボタンのツールチップの精選項目では、「どのアイテムでこのアイテムを精選可能か」のほか、「このアイテムを精選することで得られる可能性のあるアイテム(霊砂限定)」も表示されます。",
"477": "アイテムボタンのツールチップで無限ループが発生するのを防ぐため、後者ではツールチップを開けるアイコンは表示されません。"
"477": "アイテムボタンのツールチップで無限ループが発生するのを防ぐため、後者ではツールチップを開けるアイコンは表示されません。",
"478": "「{f1}」の「{f2}」タブでプログラム/Webサイトで使用するフォントとフォントのサイズを変更できるようになりました。",
"479": "残り:",
"480": "{minute}分",
"481": "{second}秒",
"482": "フォントサイズ",
"483": "プログラム/Webサイトのフォントサイズをグローバルに変更します。",
"484": "一部の領域のフォントサイズはこの設定に影響されません。また、ブラウザの「最小サイズ」設定によっても制限されます。",
"485": "「標準」サイズ以外の表示効果はしばらく保証できません。特別な必要がない限り、変更は推奨されません。",
"486": "さらに小さい",
"487": "小さい",
"488": "標準",
"489": "大さい",
"490": "さらに大きい",
"491": "カスタムフォント",
"492": "プログラム/Webサイトのフォントをグローバルに変更します。",
"493": "複数のフォントを英語のカンマで区切ることができます。現在のフォントライブラリに表示するテキストが含まれていない場合、プログラムは次のフォントを使用します。どちらも含まれていない場合は、プログラムは設定前のフォントを使用します。",
"494": "フォント名にスペースがある場合は、英文の一重引用符または二重引用符で囲むことをお勧めします。たとえば、\"Jupiter Pro\"です。",
"495": "CSSに詳しい場合は、font-familyの文法を直接参照して記入することができます。",
"496": "現在採取可能な道具の採取カードには、現実世界の残り時間が表示されるようになりました。"
}
Loading

0 comments on commit d7e8284

Please sign in to comment.