11import { classes } from 'common/react' ;
22import { useBackend } from '../backend' ;
3- import { Box , Button , Icon , LabeledList , Section , Stack , Tooltip } from '../components' ;
3+ import { Box , Button , Icon , LabeledList , ProgressBar , Section , Stack , Tooltip } from '../components' ;
44import { Window } from '../layouts' ;
55
66export const SkillMenu = ( props , context ) => {
@@ -10,7 +10,7 @@ export const SkillMenu = (props, context) => {
1010 return (
1111 < Window
1212 title = "Skills"
13- width = { 224 }
13+ width = { 320 }
1414 height = { 262 }
1515 >
1616 < Window . Content >
@@ -21,30 +21,35 @@ export const SkillMenu = (props, context) => {
2121 name = "Physiology"
2222 index = { 0 }
2323 tooltip = "Medical knowledge and surgical precision."
24+ color = 'blue'
2425 />
2526 < AdjustSkill
2627 skill = "mechanics"
2728 name = "Mechanics"
2829 index = { 1 }
2930 tooltip = "Construction and repair of structures, machinery, and exosuits."
31+ color = 'orange'
3032 />
3133 < AdjustSkill
3234 skill = "technical"
3335 name = "Technical"
3436 index = { 2 }
3537 tooltip = "Electrical work, robot maintenance, and piloting exosuits or ships."
38+ color = 'yellow'
3639 />
3740 < AdjustSkill
3841 skill = "science"
3942 name = "Science"
4043 index = { 3 }
4144 tooltip = "Knowledge of biology, chemistry, or other scientific fields."
45+ color = 'rebeccapurple'
4246 />
4347 < AdjustSkill
4448 skill = "fitness"
4549 name = "Fitness"
4650 index = { 4 }
4751 tooltip = "Physical prowess and accuracy with weapons."
52+ color = 'red'
4853 />
4954 </ LabeledList >
5055 < Button
@@ -67,9 +72,11 @@ export const SkillMenu = (props, context) => {
6772
6873const AdjustSkill = ( props , context ) => {
6974 const { act, data } = useBackend ( context ) ;
70- const { skill, name, index, tooltip } = props ;
71- const { skills, skill_points, allocated_points, exceptional_skill } = data ;
72- const { base, allocated } = skills [ index ] ;
75+ const { skill, name, index, tooltip, color } = props ;
76+ const { skills, skill_points, allocated_points, exceptional_skill, exp_per_level } = data ;
77+ const { base, allocated, exp_progress } = skills [ index ] ;
78+
79+ const exp_required = exp_per_level * Math . pow ( 2 , base )
7380
7481 return (
7582 < Stack >
@@ -103,6 +110,16 @@ const AdjustSkill = (props, context) => {
103110 amount : 1 ,
104111 } ) }
105112 />
113+ < ProgressBar
114+ value = { exp_progress }
115+ maxValue = { exp_required }
116+ color = { color }
117+ width = { 7.5 }
118+ ml = { 1 }
119+ textAlign = "left"
120+ >
121+ { Math . floor ( exp_progress ) } / { Math . floor ( exp_required ) }
122+ </ ProgressBar >
106123 </ Box >
107124 </ LabeledList . Item >
108125 </ Stack >
0 commit comments