From 6e0b9a4f99bbb969f6fdfa8d557a25c62becb2d4 Mon Sep 17 00:00:00 2001 From: JimmyZJX Date: Tue, 5 Dec 2023 00:27:03 +0800 Subject: [PATCH] fix [is_time_unit_minute], wrap recipe select with border --- css/App.css | 4 ++++ src/batch_setting.jsx | 2 +- src/needs_list.jsx | 6 ++++-- src/result.jsx | 20 ++++++++++---------- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/css/App.css b/css/App.css index 852234d..cf88f5a 100644 --- a/css/App.css +++ b/css/App.css @@ -13,6 +13,10 @@ color: white !important; } +.border-recipe-item { + border: 1px dashed #484 !important; +} + .bg-unselected { background-color: #AAA !important; color: white !important; diff --git a/src/batch_setting.jsx b/src/batch_setting.jsx index 0e4f514..56cf4d3 100644 --- a/src/batch_setting.jsx +++ b/src/batch_setting.jsx @@ -108,7 +108,7 @@ export function BatchSetting() { } return
- 批量预设 + 批量预设 {factory_doms} diff --git a/src/needs_list.jsx b/src/needs_list.jsx index 65499a0..35b0f50 100644 --- a/src/needs_list.jsx +++ b/src/needs_list.jsx @@ -64,12 +64,14 @@ export function NeedsList({ needs_list, set_needs_list }) { set_needs_list(new_needs_list); } + const is_min = global_state.ui_settings.is_time_unit_minute; + return <>
- 添加需求 + 添加需求
- /min + /{is_min ? "min" : "sec"}
diff --git a/src/result.jsx b/src/result.jsx index fd86bba..7cd5efb 100644 --- a/src/result.jsx +++ b/src/result.jsx @@ -10,15 +10,15 @@ export function RecipeSelect({ item, choice, onChange }) { let game_data = global_state.game_data; let item_data = global_state.item_data; - let doms = []; - for (let i = 1; i < item_data[item].length; i++) { - let recipe_index = item_data[item][i]; + if (item_data[item].length == 2) { + let recipe_index = item_data[item][1]; let recipe = game_data.recipe_data[recipe_index]; - if (item_data[item].length == 2) { - // only one recipe - doms.push(
onChange(i)}>
); - } else { + return
+ } else { + let doms = []; + for (let i = 1; i < item_data[item].length; i++) { + let recipe_index = item_data[item][i]; + let recipe = game_data.recipe_data[recipe_index]; let bg_class = (i == choice) ? "selected" : ""; doms.push( ); } - } - return <>{doms}; + return
{doms}
; + } } export const pro_num_text = {