-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIRROR] Updates to orbit ui [READY] (#2517)
* Updates to orbit ui [READY] (#83186) ## About The Pull Request Pretty big orbit ui refactor. Check changelog for full list of features. <details> <summary>screenshots</summary> In game ![Screenshot 2024-05-15 133935](https://github.com/tgstation/tgstation/assets/42397676/60c2fc95-9fc5-4417-8477-d6fdae589100) Sort by department ![Screenshot 2024-05-15 133951](https://github.com/tgstation/tgstation/assets/42397676/96114884-3c10-4b03-a042-c19b25485bf3) Did you know ninjas had a hud icon that hasn't worked for four years? ![image](https://github.com/tgstation/tgstation/assets/42397676/74f1414e-df57-4586-8cfd-0a154b560b83) Criticals ![image](https://github.com/tgstation/tgstation/assets/42397676/b6ed9b94-bab3-4878-9a18-345efad9b92d) Orbit blade https://github.com/tgstation/tgstation/assets/42397676/99681548-bfb3-4895-9c95-3b650df71107 </details> ## Why It's Good For The Game Some QoL for the orbit menu, giving more info on where action is and isn't. Removes more of the uselocalstate hook which is deprecated anyways ## Changelog :cl: fix: Fixed an issue preventing space ninjas from having a hud icon add: ORBIT UI CHANGES: add: AFK players are greyed out. add: Living NPCs now display health. add: Icons displayed are now based on hud icons, which includes icons for player-visible antagonists add: You can now sort by job department (click health icon) add: Round ending "critical" items will be listed at the top. add: Click the settings button to expand for more info add: Your current orbit target is highlighted. /:cl: * Updates to orbit ui [READY] --------- Co-authored-by: Jeremiah <[email protected]> Co-authored-by: NovaBot13 <[email protected]>
- Loading branch information
1 parent
a0aa7b3
commit c41c9e9
Showing
17 changed files
with
1,112 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { DmIcon, Icon } from '../../components'; | ||
import { JOB2ICON } from '../common/JobToIcon'; | ||
import { Antagonist, Observable } from './types'; | ||
|
||
type Props = { | ||
item: Observable | Antagonist; | ||
}; | ||
|
||
type IconSettings = { | ||
dmi: string; | ||
transform: string; | ||
}; | ||
|
||
const normalIcon: IconSettings = { | ||
dmi: 'icons/mob/huds/hud.dmi', | ||
transform: 'scale(2.3) translateX(8px) translateY(1px)', | ||
}; | ||
|
||
const antagIcon: IconSettings = { | ||
dmi: 'icons/mob/huds/antag_hud.dmi', | ||
transform: 'scale(1.8) translateX(-16px) translateY(7px)', | ||
}; | ||
|
||
export function JobIcon(props: Props) { | ||
const { item } = props; | ||
|
||
let iconSettings: IconSettings; | ||
if ('antag' in item) { | ||
iconSettings = antagIcon; | ||
} else { | ||
iconSettings = normalIcon; | ||
} | ||
|
||
// We don't need to cast here but typescript isn't smart enough to know that | ||
const { icon = '', job = '' } = item; | ||
|
||
return ( | ||
<div className="JobIcon"> | ||
{icon === 'borg' ? ( | ||
<Icon color="lightblue" name={JOB2ICON[job]} mr={0.5} /> | ||
) : ( | ||
<div | ||
style={{ | ||
height: '17px', | ||
width: '18px', | ||
}} | ||
> | ||
<DmIcon | ||
icon={iconSettings.dmi} | ||
icon_state={icon} | ||
style={{ transform: iconSettings.transform }} | ||
/> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
} |
Oops, something went wrong.