Skip to content
This repository has been archived by the owner on Mar 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #59 from RaenonX-DL/dev
Browse files Browse the repository at this point in the history
v1.7.0 Release
  • Loading branch information
RaenonX authored Jan 25, 2021
2 parents 8ab8335 + 59e6ae7 commit d0e78c3
Show file tree
Hide file tree
Showing 35 changed files with 1,047 additions and 123 deletions.
38 changes: 32 additions & 6 deletions public/locales/cht/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,39 @@
"data": {
"title_self": "遊戲資訊",
"title_active": "主動技能",
"title_cex": "CEX",
"title_ex": "EX / CEX",
"title_others": "其他",
"title_passive": "被動技能",
"title_print": "護符",
"title_skill_atk": "攻擊技能",
"title_skill_sup": "支援技能",
"title_story": "故事"
},
"ex": {
"name": {
"filter_element": "角色屬性",
"filter_ex_buff_param": "EX 加成參數",
"filter_chained_ex_buff_param": "CEX 加成參數",
"ex_ability": "EX 效果",
"chained_ex_ability": "CEX 效果"
},
"desc": {
"filter_element": "如果複選屬性,例如: 火、風,則所有火屬性角色或風屬性角色的條目將會被列入,否則略過。如果沒有選擇任何屬性,將會顯示所有條目。",
"filter_ex_buff_param": "如果複選條件,則顯示符合任一條件的條目。如果沒有選擇任何參數,將會顯示所有條目。",
"filter_chained_ex_buff_param": "如果複選條件,則顯示符合任一條件的條目。如果沒有選擇任何參數,將會顯示所有條目。",
"ex_ability": "同效果在隊伍內不可重複。套用效果範圍皆為全隊,並且不限受益者屬性。",
"chained_ex_ability": "又稱連鎖 EX。預設套用效果範圍皆為全隊,然而,通常會有目標屬性限制。和 EX 不同的是,CEX 的效果可以重複。"
},
"badge": {
"info_cooldown": "冷卻 {{cooldownSec}} 秒",
"info_duration_count": "可用 {{durationCount}} 次",
"info_duration_sec": "持續 {{durationSec}} 秒",
"info_max_occurrences": "最多 {{maxOccurrences}} 次",
"info_max_stack_count": "最多 {{maxStackCount}} 層",
"info_probability_pct": "{{probabilityPct}}% 機率",
"info_target_action": "目標行為: {{targetAction}}"
}
},
"skill_atk": {
"name": {
"atk": "攻擊",
Expand Down Expand Up @@ -130,10 +155,7 @@
"other_data": "屬性增傷 +{{otherElemBonusPct}}% / HP {{otherCurrentHpPct}}%"
},
"collapse": "摺疊/展開",
"search": "搜尋",
"warning": {
"truncated": "因條目過多,故只顯示部分條目 (顯示 {{displayed}} 條 / 共有 {{returned}} 條)。如果要顯示第 {{displayed}} 條後的結果,請縮小搜尋範圍。"
}
"search": "搜尋"
},
"tools": {
"title_self": "遊戲工具",
Expand All @@ -156,7 +178,10 @@
"in_use": "目前使用中"
},
"message": {
"page_nav": "確定要離開本頁面嗎?"
"warning": {
"page_nav": "確定要離開本頁面嗎?",
"truncated": "因條目過多,故只顯示部分條目 (顯示 {{displayed}} 條 / 共有 {{returned}} 條)。如果要顯示第 {{displayed}} 條後的結果,請縮小搜尋範圍。"
}
},
"misc": {
"add": "新增",
Expand All @@ -178,6 +203,7 @@
"site": "龍絆攻略站 by OM",
"suffix": " | 龍絆攻略站 by OM",
"game_data": {
"ex": "EX / CEX 查詢",
"skill_atk": "攻擊技能表"
}
},
Expand Down
33 changes: 31 additions & 2 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,39 @@
"data": {
"title_self": "Game Data",
"title_active": "Active",
"title_cex": "Chained Co-ability",
"title_ex": "Co-ability / CCA",
"title_others": "Others",
"title_passive": "Passive",
"title_print": "Wyrmprints",
"title_skill_atk": "Skill (Attack)",
"title_skill_sup": "Skill (Support)",
"title_story": "Story"
},
"ex": {
"name": {
"filter_element": "角色屬性",
"filter_ex_buff_param": "EX 加成參數",
"filter_chained_ex_buff_param": "CEX 加成參數",
"ex_ability": "EX 效果",
"chained_ex_ability": "CEX 效果"
},
"desc": {
"filter_element": "如果複選屬性,例如: 火、風,則所有火屬性角色或風屬性角色的條目將會被列入,否則略過。如果沒有選擇任何屬性,將會顯示所有條目。",
"filter_ex_buff_param": "如果複選條件,則顯示符合任一條件的條目。如果沒有選擇任何參數,將會顯示所有條目。",
"filter_chained_ex_buff_param": "如果複選條件,則顯示符合任一條件的條目。如果沒有選擇任何參數,將會顯示所有條目。",
"ex_ability": "同效果在隊伍內不可重複。套用效果範圍皆為全隊,並且不限受益者屬性。",
"chained_ex_ability": "又稱連鎖 EX。預設套用效果範圍皆為全隊,然而,通常會有目標屬性限制。和 EX 不同的是,CEX 的效果可以重複。"
},
"badge": {
"info_cooldown": "冷卻 {{cooldownSec}} 秒",
"info_duration_count": "可用 {{durationCount}} 次",
"info_duration_sec": "持續 {{durationSec}} 秒",
"info_max_occurrences": "最多 {{maxOccurrences}} 次",
"info_max_stack_count": "最多 {{maxStackCount}} 層",
"info_probability_pct": "{{probabilityPct}}% 機率",
"info_target_action": "目標行為: {{targetAction}}"
}
},
"skill_atk": {
"name": {
"atk": "STR",
Expand Down Expand Up @@ -153,7 +178,10 @@
"in_use": "Currently in-use"
},
"message": {
"page_nav": "Are you sure to leave this page?"
"warning": {
"page_nav": "Are you sure to leave this page?",
"truncated": "Due to excessive number of results, results are truncated ({{displayed}} Displayed / {{returned} Available). To display the truncated results, please narrow the search condition."
}
},
"misc": {
"add": "Add",
Expand All @@ -175,6 +203,7 @@
"site": "DL Info by OM",
"suffix": " | DL Info by OM",
"game_data": {
"ex": "Co-ab / CCA search",
"skill_atk": "Attacking skills"
}
},
Expand Down
33 changes: 31 additions & 2 deletions public/locales/jp/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,39 @@
"data": {
"title_self": "ゲーム情報",
"title_active": "スキル",
"title_cex": "リンクEXアビリティ",
"title_ex": "EX / リンクEX",
"title_others": "他の情報",
"title_passive": "アビリティ",
"title_print": "護符",
"title_skill_atk": "攻擊スキル",
"title_skill_sup": "サポートスキル",
"title_story": "ストーリー"
},
"ex": {
"name": {
"filter_element": "角色屬性",
"filter_ex_buff_param": "EX 加成參數",
"filter_chained_ex_buff_param": "CEX 加成參數",
"ex_ability": "EX 效果",
"chained_ex_ability": "CEX 效果"
},
"desc": {
"filter_element": "如果複選屬性,例如: 火、風,則所有火屬性角色或風屬性角色的條目將會被列入,否則略過。如果沒有選擇任何屬性,將會顯示所有條目。",
"filter_ex_buff_param": "如果複選條件,則顯示符合任一條件的條目。如果沒有選擇任何參數,將會顯示所有條目。",
"filter_chained_ex_buff_param": "如果複選條件,則顯示符合任一條件的條目。如果沒有選擇任何參數,將會顯示所有條目。",
"ex_ability": "同效果在隊伍內不可重複。套用效果範圍皆為全隊,並且不限受益者屬性。",
"chained_ex_ability": "又稱連鎖 EX。預設套用效果範圍皆為全隊,然而,通常會有目標屬性限制。和 EX 不同的是,CEX 的效果可以重複。"
},
"badge": {
"info_cooldown": "冷卻 {{cooldownSec}} 秒",
"info_duration_count": "可用 {{durationCount}} 次",
"info_duration_sec": "持續 {{durationSec}} 秒",
"info_max_occurrences": "最多 {{maxOccurrences}} 次",
"info_max_stack_count": "最多 {{maxStackCount}} 層",
"info_probability_pct": "{{probabilityPct}}% 機率",
"info_target_action": "目標行為: {{targetAction}}"
}
},
"skill_atk": {
"name": {
"atk": "攻擊",
Expand Down Expand Up @@ -153,7 +178,10 @@
"in_use": "使用中"
},
"message": {
"page_nav": "このページ閉じますか?"
"warning": {
"page_nav": "このページ閉じますか?",
"truncated": "項目が多過ぎるため、一部だけ展示されてます。({{displayed}} 表示中 / 全 {{returned}})。第{{displayed}}個項目の以後の結果も欲しいという方は検索範囲を指定してください。"
}
},
"misc": {
"add": "追加",
Expand All @@ -175,6 +203,7 @@
"site": "ドラガリ攻略サイト by OM",
"suffix": " | ドラガリ攻略サイト by OM",
"game_data": {
"ex": "TBA",
"skill_atk": "TBA"
}
},
Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap.css

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

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, {ChangeEventHandler} from 'react';
import {Col, Form, Image, Row} from 'react-bootstrap';
import {ButtonGroup, Col, Form, Image, Row, ToggleButton} from 'react-bootstrap';
import {ButtonVariant} from 'react-bootstrap/types';
import {useTranslation} from 'react-i18next';
import {DepotPaths, EnumEntry} from '../../../../utils/services/resources';

import {OverlayPopover} from '../../express';
import {OverlayPopover, OverlayTooltip} from '../../express';

type TitledProps = {
titleLabel: string,
Expand Down Expand Up @@ -68,30 +69,56 @@ export const NumericalInput = (props: NumericalInputProps) => {

type InlineChecksProps = TitledProps & {
onChange: ChangeEventHandler<HTMLInputElement>,
type?: 'checkbox' | 'radio' | 'switch',
type?: 'checkbox' | 'radio',
variant?: ButtonVariant,
groupName?: string,
imageUrl?: string,
id?: string,
checked?: boolean
checked?: boolean,
imageHeight?: string,
}


export const InlineChecks = (props: InlineChecksProps) => {
const {titleLabel, type = 'checkbox', groupName = '', imageUrl, id, checked, onChange} = props;
const {
titleLabel,
type = 'checkbox',
variant = 'outline-secondary',
groupName = '',
imageUrl,
id,
checked,
onChange,
imageHeight,
} = props;

const {t} = useTranslation();

let label;
if (imageUrl) {
label = <Image src={imageUrl} style={{height: '1.5rem'}}/>;
label = (
<OverlayTooltip text={t(titleLabel)}>
<Image src={imageUrl} style={{height: imageHeight || '1.5rem'}}/>
</OverlayTooltip>
);
} else {
label = t(titleLabel);
label = <span className="text-light">{t(titleLabel)}</span>;
}

return (
<Form.Check
inline label={label} type={type} name={groupName} id={id || titleLabel}
checked={checked} onChange={onChange}/>
<ButtonGroup toggle className="m-1">
<ToggleButton
type={type}
variant={variant}
checked={checked}
onChange={onChange}
name={groupName}
id={id || titleLabel}
value="1"
>
{label}
</ToggleButton>
</ButtonGroup>
);
};

Expand Down Expand Up @@ -127,15 +154,16 @@ export const RadioChecks = ({labels, groupName, onChangeWrap, checkedCode}: Radi

type EnumChecksProps = {
enumEntries: Array<EnumEntry>,
type: 'checkbox' | 'radio' | 'switch',
type: 'checkbox' | 'radio',
onChange: (code: number) => ChangeEventHandler<HTMLInputElement>,
groupName?: string,
isChecked?: (code: number) => boolean
isChecked?: (code: number) => boolean,
imageHeight?: string,
}


export const EnumResourceChecks = (props: EnumChecksProps) => {
const {enumEntries, type, onChange, groupName = '', isChecked} = props;
const {enumEntries, type, onChange, groupName = '', isChecked, imageHeight} = props;

const {i18n} = useTranslation();

Expand All @@ -148,6 +176,7 @@ export const EnumResourceChecks = (props: EnumChecksProps) => {
id={`${groupName}${enumEntry.name}`} key={enumEntry.name} type={type} groupName={groupName}
titleLabel={enumEntry.trans[i18n.language] || enumEntry.name}
imageUrl={enumEntry.imagePath ? DepotPaths.getImageURL(enumEntry.imagePath) : undefined}
imageHeight={imageHeight}
onChange={onChange(enumEntry.code)} checked={isChecked && isChecked(enumEntry.code)}/>
);
})
Expand Down
42 changes: 42 additions & 0 deletions src/components/elements/gameData/common/condition.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from 'react';
import {Badge, Col, Row} from 'react-bootstrap';
import {useTranslation} from 'react-i18next';
import {ConditionEnumMap} from '../../../../utils/services/resources/types';


export type ConditionBadgeProps = {
conditionCodes: Array<number>,
conditionEnums: ConditionEnumMap,
}


export const getConditionBadges = ({conditionCodes, conditionEnums}: ConditionBadgeProps) => {
const {i18n} = useTranslation();

return conditionCodes.map((conditionCode, idx: number) => {
const conditionEnum = conditionEnums[String(conditionCode)];

return (
<Badge key={idx} variant={conditionEnum?.colorTheme}>{conditionEnum?.trans[i18n.language]}</Badge>
);
});
};


export const ConditionBadges = ({conditionCodes, conditionEnums}: ConditionBadgeProps) => {
return (
<Row>
<Col>
{
getConditionBadges({conditionCodes, conditionEnums}).map((badge, idx: number) => {
return (
<React.Fragment key={idx}>
{idx > 0 && ' '}{badge}
</React.Fragment>
);
})
}
</Col>
</Row>
);
};
Loading

0 comments on commit d0e78c3

Please sign in to comment.