Skip to content

Commit

Permalink
UI日本語化
Browse files Browse the repository at this point in the history
# Conflicts:
#	reframework/autorun/village_reminders/constants.lua
  • Loading branch information
ruhiel committed Oct 11, 2022
1 parent cd5e0fc commit c6a8827
Show file tree
Hide file tree
Showing 4 changed files with 170 additions and 64 deletions.
98 changes: 59 additions & 39 deletions reframework/autorun/village_reminders/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,102 +3,102 @@ local constants = require("village_reminders.constants")

-- Constants
local ACTIVE_BELOW_PROPERTY = "activeBelow"
local ACTIVE_LABEL = "Remind About Active"
local ACTIVE_LABEL = "有効なクエストについてのリマインド"
local ACTIVE_PROPERTY = "active"
local ANCHOR_LABEL = "Anchor"
local ANCHOR_LABEL = "アンカー"
local ANCHORS = {
[constants.TOP_LEFT_ANCHOR] = "Top Left",
[constants.TOP_RIGHT_ANCHOR] = "Top Right",
[constants.BOTTOM_LEFT_ANCHOR] = "Bottom Left",
[constants.BOTTOM_RIGHT_ANCHOR] = "Bottom Right"
[constants.TOP_LEFT_ANCHOR] = "左上",
[constants.TOP_RIGHT_ANCHOR] = "右上",
[constants.BOTTOM_LEFT_ANCHOR] = "左下",
[constants.BOTTOM_RIGHT_ANCHOR] = "右下"
}
local ARGOSY_MODULE = "argosy"
local BACKGROUND_LABEL = "Background"
local BACKGROUND_LABEL = "背景色"
local BACKGROUND_PROPERTY = "background"
local BASE_ANCHOR_PROPERTY = "baseAnchor"
local BASE_MIN_WIDTH_PROPERTY = "baseMinWidth"
local BASE_X_PROPERTY = "baseX"
local BASE_Y_PROPERTY = "baseY"
local BOOSTS_BELOW_PROPERTY = "boostsBelow"
local BOOSTS_LABEL = "Remind About Boosts"
local BOOSTS_LABEL = "ブーストについてのリマインド"
local BOOSTS_PROPERTY = "boosts"
local BUDDIES_BELOW_PROPERTY = "buddiesBelow"
local BUDDIES_LABEL = "Remind About Buddies"
local BUDDIES_LABEL = "オトモについてのリマインド"
local BUDDIES_PROPERTY = "buddies"
local BUDDY_DOJO_MODULE = "buddyDojo"
local COHOOT_NEST_MODULE = "cohootNest"
local COLOR_EDIT_FLAGS = 1 << 3 --[[No Options]] | 1 << 7 --[[No Label]] | 1 << 16 --[[Alpha Bar]]
local COMPLETED_ABOVE_PROPERTY = "completedAbove"
local COMPLETED_LABEL = "Remind About Completed"
local COMPLETED_LABEL = "完了したクエストについてのリマインド"
local COMPLETED_PROPERTY = "completed"
local DIRTY_POUCH_LABEL = "Remind When Item Pouch Not Checked"
local DIRTY_POUCH_LABEL = "アイテムポーチが補充されていない場合のリマインド"
local DIRTY_POUCH_PROPERTY = "dirtyPouch"
local ENABLED_LABEL = "Enabled"
local ENABLED_LABEL = "有効無効"
local ENABLED_PROPERTY = "enabled"
local FILE = "village_reminders/config.json"
local FONT_SIZE_LABEL = "Font Size"
local FONT_SIZE_LABEL = "フォントサイズ"
local FONT_SIZE_PROPERTY = "fontSize"
local FOREGROUND_LABEL = "Foreground"
local FOREGROUND_LABEL = "前景色"
local FOREGROUND_PROPERTY = "foreground"
local GLOBAL_MODULE = "global"
local IDLE_LABEL = "Remind When Idle"
local IDLE_LABEL = "待機中のリマインド"
local IDLE_PROPERTY = "idle"
local INDENT_LABEL = "Indent"
local INDENT_LABEL = "インデント"
local INDENT_PROPERTY = "indent"
local ITEMS_MODULE = "items"
local LATEST_VERSION = "1.4.0"
local LINE_SPACING_LABEL = "Line Spacing"
local LINE_SPACING_LABEL = "行間"
local LINE_SPACING_PROPERTY = "lineSpacing"
local LOTTERY_LABEL = "Remind When Lottery Available"
local LOTTERY_LABEL = "福引のリマインド"
local LOTTERY_PROPERTY = "lottery"
local MARKET_MODULE = "market"
local MAXED_BUDDIES_ABOVE_PROPERTY = "maxedBuddiesAbove"
local MAXED_BUDDIES_LABEL = "Remind About Max Level Buddies"
local MAXED_BUDDIES_LABEL = "最大レベルに達したオトモについてのリマインド"
local MAXED_BUDDIES_PROPERTY = "maxedBuddies"
local MELDING_POT_MODULE = "meldingPot"
local MEOWCENARIES_MODULE = "meowcenaries"
local MIN_WIDTH_LABEL = "Min Width"
local MIN_WIDTH_LABEL = "最低幅"
local NPCS_MODULE = "npcs"
local ORDER_LABEL = "Order"
local ORDER_LABEL = "順序"
local ORDER_PROPERTY = "order"
local ORDERS_BELOW_PROPERTY = "ordersBelow"
local ORDERS_LABEL = "Remind About Orders"
local ORDERS_LABEL = "依頼についてのリマインド"
local ORDERS_PROPERTY = "orders"
local OVERLAY_MODULE = "overlay"
local PADDING_LABEL = "Padding"
local PADDING_LABEL = "パディング"
local PADDING_PROPERTY = "padding"
local QUEST_ANCHOR_PROPERTY = "questAnchor"
local QUEST_MIN_WIDTH_PROPERTY = "questMinWidth"
local QUEST_PROGRESS_LABEL = "Show Progress During Quests"
local QUEST_PROGRESS_LABEL = "クエストの進行を表示"
local QUEST_PROGRESS_PROPERTY = "showProgressDuringQuests"
local QUEST_X_PROPERTY = "questX"
local QUEST_Y_PROPERTY = "questY"
local RARE_FINDS_LABEL = "Remind When Rare Finds Stocked"
local RARE_FINDS_LABEL = "レア素材についてのリマインド"
local RARE_FINDS_PROPERTY = "rareFinds"
local REMINDER_MODES = {
[constants.ALWAYS_REMINDER_MODE] = "Always",
[constants.THRESHOLD_REMINDER_MODE] = "Conditional",
[constants.NEVER_REMINDER_MODE] = "Never"
[constants.ALWAYS_REMINDER_MODE] = "常にリマインド",
[constants.THRESHOLD_REMINDER_MODE] = "条件付きでリマインド",
[constants.NEVER_REMINDER_MODE] = "リマインドしない"
}
local ROUNDS_BELOW_PROPERTY = "roundsBelow"
local ROUNDS_LABEL = "Remind About Rounds"
local ROUNDS_LABEL = "回数についてのリマインド"
local ROUNDS_PROPERTY = "rounds"
local SALE_LABEL = "Remind When Sale"
local SALE_LABEL = "セールのリマインド"
local SALE_PROPERTY = "sale"
local SKILL_DURATION_BELOW_PROPERTY = "skillDurationBelow"
local SKILL_DURATION_LABEL = "Remind About Skill Duration"
local SKILL_DURATION_LABEL = "交渉術についてのリマインド"
local SKILL_DURATION_PROPERTY = "skillDuration"
local STEP_ABOVE_PROPERTY = "stepAbove"
local STEP_LABEL = "Remind About Step"
local STEP_LABEL = "調査状況についてのリマインド"
local STEP_PROPERTY = "step"
local SOUVENIR_LABEL = "Remind When Pingarh the Sailor Has Souvenir"
local SOUVENIR_LABEL = "船乗りのピンガルについてのリマインド"
local SOUVENIR_PROPERTY = "souvenir"
local SPEECH_BUBBLE_LABEL = "Remind When NPCs Have Speech Bubbles"
local SPEECH_BUBBLE_LABEL = "話をしたいNPCについてのリマインド"
local SPEECH_BUBBLE_PROPERTY = "speechBubble"
local SUBQUESTS_MODULE = "subquests"
local TITLE = "Village Reminders"
local UNCOLLECTED_ABOVE_PROPERTY = "uncollectedAbove"
local UNCOLLECTED_LABEL = "Remind About Uncollected"
local UNCOLLECTED_LABEL = "未受領のリマインド"
local UNCOLLECTED_PROPERTY = "uncollected"
local VERSION_PROPERTY = "version"
local X_LABEL = "X"
Expand Down Expand Up @@ -354,25 +354,42 @@ end
local config = {}

function config.draw()
local JP_FONT_NAME = "NotoSansJP-Regular.otf"
local JP_FONT_SIZE = 18
local CJK_GLYPH_RANGES = {
0x0020, 0x00FF, -- Basic Latin + Latin Supplement
0x2000, 0x206F, -- General Punctuation
0x3000, 0x30FF, -- CJK Symbols and Punctuations, Hiragana, Katakana
0x31F0, 0x31FF, -- Katakana Phonetic Extensions
0x4e00, 0x9FFF, -- CJK Ideograms
0xFF00, 0xFFEF, -- Half-width characters
0,
}
local font = imgui.load_font(JP_FONT_NAME, JP_FONT_SIZE, CJK_GLYPH_RANGES)

if font ~= nil then
imgui.push_font(font)
end

if imgui.button(TITLE) then
is_open = true
end

if imgui.begin_window(TITLE, is_open) then
local changed = false

if imgui.tree_node("Overlay") then
if imgui.tree_node("オーバーレイ") then
imgui.new_line()
local max_width, max_height = d2d.surface_size()
changed = draw_slider_int(OVERLAY_MODULE, FONT_SIZE_PROPERTY, FONT_SIZE_LABEL, 4, 72) or changed
imgui.text("Note: Changes to font size require the mod to be restarted.")
imgui.text("注意: フォントサイズの変更には再起動が必要です。")
imgui.new_line()
changed = draw_slider_int(OVERLAY_MODULE, LINE_SPACING_PROPERTY, LINE_SPACING_LABEL, 0, 72) or changed
changed = draw_slider_int(OVERLAY_MODULE, INDENT_PROPERTY, INDENT_LABEL, 0, 72) or changed
changed = draw_slider_int(OVERLAY_MODULE, PADDING_PROPERTY, PADDING_LABEL, 0, 72) or changed
imgui.new_line()

if imgui.tree_node("Position and Size (Base)") then
if imgui.tree_node("位置とサイズ(基本)") then
changed = draw_combo(OVERLAY_MODULE, BASE_ANCHOR_PROPERTY, ANCHOR_LABEL, ANCHORS) or changed
changed = draw_drag_int(OVERLAY_MODULE, BASE_X_PROPERTY, X_LABEL, 0, max_width) or changed
changed = draw_drag_int(OVERLAY_MODULE, BASE_Y_PROPERTY, Y_LABEL, 0, max_height) or changed
Expand All @@ -382,7 +399,7 @@ function config.draw()

imgui.new_line()

if imgui.tree_node("Position and Size (Quest)") then
if imgui.tree_node("位置とサイズ(クエスト)") then
changed = draw_combo(OVERLAY_MODULE, QUEST_ANCHOR_PROPERTY, ANCHOR_LABEL, ANCHORS) or changed
changed = draw_drag_int(OVERLAY_MODULE, QUEST_X_PROPERTY, X_LABEL, 0, max_width) or changed
changed = draw_drag_int(OVERLAY_MODULE, QUEST_Y_PROPERTY, Y_LABEL, 0, max_height) or changed
Expand Down Expand Up @@ -502,6 +519,9 @@ function config.draw()
else
is_open = false
end
if font ~= nil then
imgui.pop_font();
end
end

function config.get_argosy_enabled()
Expand Down
50 changes: 25 additions & 25 deletions reframework/autorun/village_reminders/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@ local constants = {
"Market (Elgado)"
},
-- Module Labels
ARGOSY_LABEL = "Argosy",
BUDDY_DOJO_LABEL = "Buddy Dojo",
COHOOT_NEST_LABEL = "Cohoot Nest",
ITEMS_LABEL = "Items",
MARKET_LABEL = "Market & Guild Store",
MELDING_POT_LABEL = "Melding Pot",
MEOWCENARIES_LABEL = "Meowcenaries",
NPCS_LABEL = "NPCs",
SUBQUESTS_LABEL = "Subquests",
ARGOSY_LABEL = "交易船",
BUDDY_DOJO_LABEL = "オトモ道場",
COHOOT_NEST_LABEL = "フクズクの巣",
ITEMS_LABEL = "アイテム",
MARKET_LABEL = "雑貨屋",
MELDING_POT_LABEL = "マカ錬金",
MEOWCENARIES_LABEL = "オトモ隠密隊",
NPCS_LABEL = "NPC",
SUBQUESTS_LABEL = "フリーサイドクエスト",
-- Rare Finds
RARE_FINDS_ITEMS = {
[68158516] = "Bhernastone",
[68157913] = "Dash Juice",
[68158517] = "Dundormarin",
[68157603] = "Flash Bomb",
[68158148] = "Gloamgrass Bud",
[68158222] = "Great Whetfish",
[68157803] = "Kelbi Horn",
[68158518] = "Loc Lac Ore",
[68158520] = "Minegardenite",
[68157677] = "Pale Extract",
[68157563] = "Pitfall Trap",
[68157444] = "Shock Trap",
[68157933] = "Sonic Bomb",
[68157910] = "Sushifish",
[68158519] = "Val Habar Quartz",
[68157939] = "Whetfish"
[68158516] = "ベルナストーン",
[68157913] = "強走薬",
[68158517] = "ドンドルマリン",
[68157603] = "閃光玉",
[68158148] = "落陽草の花",
[68158222] = "ドスキレアジ",
[68157803] = "ケルビの角",
[68158518] = "ロックラック鉱",
[68158520] = "ミナガルデナイト",
[68157677] = "アルビノエキス",
[68157563] = "落とし穴",
[68157444] = "シビレ罠",
[68157933] = "音爆弾",
[68157910] = "サシミウオ",
[68158519] = "バルバレクォーツ",
[68157939] = "キレアジ"
},
RARE_FINDS_ORDER = {
68158516,
Expand Down
86 changes: 86 additions & 0 deletions reframework/fonts/NotoSansJP-Regular.LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
SIL OPEN FONT LICENSE

Version 1.1 - 26 February 2007
PREAMBLE

The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS

"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting — in part or in whole — any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS

Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION

This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER

THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file added reframework/fonts/NotoSansJP-Regular.otf
Binary file not shown.

0 comments on commit c6a8827

Please sign in to comment.