Skip to content

Commit

Permalink
Add support for english search in fabricators (#827)
Browse files Browse the repository at this point in the history
## About The Pull Request
Не модульно никак
  • Loading branch information
larentoun authored Nov 29, 2024
1 parent 736a2ef commit adf38be
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions code/game/machinery/autolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
var/icon_size = spritesheet.icon_size_id(design.id)
var/list/design_data = list(
"name" = design.name,
"original_name" = design.original_name, // BANDASTATION EDIT - Design Translate
"desc" = design.get_description(),
"cost" = cost,
"id" = design.id,
Expand Down
1 change: 1 addition & 0 deletions code/modules/research/machinery/_production.dm
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
var/icon_size = spritesheet.icon_size_id(design.id)
designs[design.id] = list(
"name" = design.name,
"original_name" = design.original_name, // BANDASTATION EDIT - Design Translate
"desc" = design.get_description(),
"cost" = cost,
"id" = design.id,
Expand Down
1 change: 1 addition & 0 deletions code/modules/vehicles/mecha/mech_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
var/icon_size = spritesheet.icon_size_id(design.id)
designs[design.id] = list(
"name" = design.name,
"original_name" = design.original_name, // BANDASTATION EDIT - Design Translate
"desc" = design.get_description(),
"cost" = cost,
"id" = design.id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/datum/design
var/original_name

/datum/design/New()
. = ..()
original_name = name
name = update_to_ru() || name

/datum/design/proc/update_to_ru()
Expand Down
14 changes: 10 additions & 4 deletions tgui/packages/tgui/interfaces/Fabrication/DesignBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,16 @@ export const DesignBrowser = <T extends Design = Design>(
Object.values(root.descendants),
(design: T) => design.name,
)
.filter((design) =>
design.name
.toLowerCase()
.includes(searchText.toLowerCase()),
// BANDASTATION EDIT START - Design Translate
.filter(
(design) =>
design.name
.toLowerCase()
.includes(searchText.toLowerCase()) ||
(design.original_name || design.name)
.toLowerCase()
.includes(searchText.toLowerCase()),
// BANDASTATION EDIT END
)
.map((design) =>
buildRecipeElement(
Expand Down
7 changes: 7 additions & 0 deletions tgui/packages/tgui/interfaces/Fabrication/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ export type Design = {
*/
name: string;

// BANDASTATION EDIT START - Design Translate
/**
* The original name of the design.
*/
original_name: string;
// BANDASTATION EDIT END

/**
* A human-readable description of the design.
*/
Expand Down

0 comments on commit adf38be

Please sign in to comment.