@rpg-engine/long-bow 0.8.190 → 0.8.192

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.8.190",
3
+ "version": "0.8.192",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -27,6 +27,7 @@ export interface ISkillProgressBarProps {
27
27
  atlasJSON: any;
28
28
  atlasIMG: any;
29
29
  buffAndDebuff?: number;
30
+ onClick?: () => void;
30
31
  }
31
32
 
32
33
  export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
@@ -43,6 +44,7 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
43
44
  atlasJSON,
44
45
 
45
46
  buffAndDebuff,
47
+ onClick,
46
48
  }) => {
47
49
  // Use CharacterClass.None as default if skillKey is provided but characterClass is not
48
50
  const effectiveClass = characterClass ?? CharacterClass.None;
@@ -107,7 +109,7 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
107
109
  };
108
110
 
109
111
  return (
110
- <>
112
+ <ClickableRow onClick={onClick} $isClickable={!!onClick}>
111
113
  <ProgressTitle>
112
114
  {buffAndDebuff !== undefined && (
113
115
  <>
@@ -182,7 +184,7 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
182
184
  <SkillPointsDisplay>{progress.toFixed(2)}%</SkillPointsDisplay>
183
185
  </SkillDisplayContainer>
184
186
  )}
185
- </>
187
+ </ClickableRow>
186
188
  );
187
189
  };
188
190
 
@@ -263,3 +265,20 @@ const TitleNameContainer = styled.div`
263
265
  display: flex;
264
266
  justify-content: space-between;
265
267
  `;
268
+
269
+ const ClickableRow = styled.div<{ $isClickable: boolean }>`
270
+ cursor: ${({ $isClickable }) => ($isClickable ? 'pointer' : 'default')};
271
+ border-radius: 4px;
272
+ transition: background-color 0.15s ease;
273
+
274
+ ${({ $isClickable }) =>
275
+ $isClickable &&
276
+ `
277
+ &:hover {
278
+ background-color: rgba(255, 255, 255, 0.05);
279
+ }
280
+ &:active {
281
+ background-color: rgba(255, 255, 255, 0.1);
282
+ }
283
+ `}
284
+ `;
@@ -19,6 +19,7 @@ export interface ISkillContainerProps {
19
19
  atlasJSON: any;
20
20
  atlasIMG: any;
21
21
  scale?: number;
22
+ onSkillClick?: (skillKey: string) => void;
22
23
  }
23
24
 
24
25
  const skillProps = {
@@ -93,6 +94,7 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
93
94
  atlasIMG,
94
95
  atlasJSON,
95
96
  scale,
97
+ onSkillClick,
96
98
  }) => {
97
99
  const onRenderSkillCategory = (
98
100
  category: 'attributes' | 'combat' | 'crafting'
@@ -135,6 +137,7 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
135
137
  atlasIMG={atlasIMG}
136
138
  atlasJSON={atlasJSON}
137
139
  buffAndDebuff={skillDetails.buffAndDebuff}
140
+ onClick={onSkillClick ? () => onSkillClick(key) : undefined}
138
141
  />
139
142
  );
140
143
  }
@@ -168,6 +171,7 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
168
171
  texturePath={'swords/broad-sword.png'}
169
172
  atlasIMG={atlasIMG}
170
173
  atlasJSON={atlasJSON}
174
+ onClick={onSkillClick ? () => onSkillClick('level') : undefined}
171
175
  />
172
176
 
173
177
  <p>Combat Skills</p>
package/src/index.tsx CHANGED
@@ -7,6 +7,7 @@ export * from './components/Chat/Chat';
7
7
  export * from './components/Chatdeprecated/ChatDeprecated';
8
8
  export * from './components/ChatRevamp/ChatRevamp';
9
9
  export * from './components/CheckButton';
10
+ export * from './components/ConfirmModal';
10
11
  export * from './components/CheckItem';
11
12
  export * from './components/CircularController/CircularController';
12
13
  export * from './components/CraftBook/CraftBook';