Skip to content

Commit

Permalink
minor tweak on proliferator settings
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyZJX committed Dec 8, 2023
1 parent 1898c7e commit 1ec6edd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/batch_setting.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { GlobalStateContext, SchemeDataSetterContext } from './contexts';
import { HorizontalMultiButtonSelect } from './recipe.jsx';
// TODO refactor to some other modules
export const pro_num_item = {
[0]: { label: "无喷涂", item_icon: null },
[0]: { label: "", item_icon: null },
[1]: { label: "MK.Ⅰ", item_icon: "增产剂MK.Ⅰ" },
[2]: { label: "MK.Ⅱ", item_icon: "增产剂MK.Ⅱ" },
[4]: { label: "MK.Ⅲ", item_icon: "增产剂MK.Ⅲ" },
Expand Down Expand Up @@ -95,11 +95,10 @@ export function BatchSetting() {
});
}

const default_pro_item = pro_num_item[1].item_icon;
const current_pro_item = pro_num == 0 ? default_pro_item :
pro_num_item[pro_num] ? pro_num_item[pro_num].item_icon : default_pro_item;
const current_pro_item = pro_mode == 0 ? null :
pro_num_item[pro_num] ? pro_num_item[pro_num].item_icon : null;
const promode_options = [
{ value: 0, label: "不使用增产剂" },
{ value: 0, label: "" },
{ value: 1, label: "增产" },
{ value: 2, label: "加速" },
];
Expand Down
2 changes: 1 addition & 1 deletion src/item_select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export function ItemSelect({ item, set_item, text, btn_class }) {
<span className="ms-1"></span></>}
{(item) ?
<small className="text-nowrap">{item}</small>
: text}
: <span className="text-nowrap">{text}</span>}
</button>

{createPortal(
Expand Down
4 changes: 2 additions & 2 deletions src/needs_list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ export function NeedsList({ needs_list, set_needs_list }) {

return <>
<div className="w-fit mt-3 d-flex align-items-center">
<small className="me-3 fw-bold">添加需求</small>
<small className="me-3 fw-bold text-nowrap">添加需求</small>
<div className="input-group input-group-sm w-fit d-inline-flex">
<input type="text" className="form-control" style={{ width: "6em" }} ref={count_ref} defaultValue={60} />
<span className="input-group-text">/{is_min ? "min" : "sec"}</span>
<ItemSelect text="选择物品" set_item={add_need} />
<button className="btn btn-sm btn-outline-danger" onClick={() => set_needs_list({})}>清空需求</button>
<button className="btn btn-sm btn-outline-danger text-nowrap" onClick={() => set_needs_list({})}>清空需求</button>
</div>

{Object.keys(needs_list).length == 0 ||
Expand Down

0 comments on commit 1ec6edd

Please sign in to comment.