@rpg-engine/long-bow 0.8.138 → 0.8.140

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.138",
3
+ "version": "0.8.140",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -84,7 +84,7 @@
84
84
  "dependencies": {
85
85
  "@capacitor/core": "^6.1.0",
86
86
  "@rollup/plugin-image": "^2.1.1",
87
- "@rpg-engine/shared": "0.10.70",
87
+ "@rpg-engine/shared": "0.10.83",
88
88
  "dayjs": "^1.11.2",
89
89
  "font-awesome": "^4.7.0",
90
90
  "fs-extra": "^10.1.0",
@@ -116,13 +116,13 @@ export const DCHistoryPanel: React.FC<IDCHistoryPanelProps> = ({
116
116
  const subtitle = tx.note ?? (tx.relatedCharacterName ? tx.relatedCharacterName : '');
117
117
 
118
118
  return (
119
- <TransactionRow key={tx._id}>
119
+ <TransactionRow key={tx._id} style={{ borderLeft: `3px solid ${color}` }}>
120
120
  <TxLeft>
121
- <TxType $color={color}>{label}</TxType>
121
+ <TxType style={{ color }}>{label}</TxType>
122
122
  {subtitle ? <TxNote>{subtitle}</TxNote> : null}
123
123
  </TxLeft>
124
124
  <TxRight>
125
- <TxAmount $credit={isCredit}>
125
+ <TxAmount style={{ color: isCredit ? '#4CAF50' : '#D04648' }}>
126
126
  {isCredit ? '+' : ''}{tx.amount} DC
127
127
  </TxAmount>
128
128
  <TxDate>{formatDate(tx.createdAt)}</TxDate>
@@ -237,16 +237,14 @@ const TxRight = styled.div`
237
237
  flex-shrink: 0;
238
238
  `;
239
239
 
240
- const TxType = styled.span<{ $color: string }>`
240
+ const TxType = styled.span`
241
241
  font-size: 7px;
242
- color: ${({ $color }) => $color};
243
242
  font-family: 'Press Start 2P', cursive;
244
243
  `;
245
244
 
246
- const TxAmount = styled.span<{ $credit: boolean }>`
245
+ const TxAmount = styled.span`
247
246
  font-size: 8px;
248
247
  font-family: 'Press Start 2P', cursive;
249
- color: ${({ $credit }) => ($credit ? uiColors.green : uiColors.red)};
250
248
  white-space: nowrap;
251
249
  `;
252
250
 
@@ -64,7 +64,7 @@ export const DCWalletModal: React.FC<IDCWalletModalProps> = ({
64
64
  {onBuyDC && (
65
65
  <BuyButton onPointerDown={onBuyDC} title="Buy Definya Coins">
66
66
  <FaShoppingCart />
67
- <BuyButtonLabel>Buy DC</BuyButtonLabel>
67
+ <BuyButtonLabel>Buy More DC</BuyButtonLabel>
68
68
  </BuyButton>
69
69
  )}
70
70
  </BalanceContent>
@@ -1,4 +1,4 @@
1
- import { IEquipmentSet, IMarketplaceItem } from '@rpg-engine/shared';
1
+ import { goldToDC, IEquipmentSet, IMarketplaceItem } from '@rpg-engine/shared';
2
2
  import React, { useEffect, useRef, useState } from 'react';
3
3
  import { AiFillCaretRight } from 'react-icons/ai';
4
4
  import styled from 'styled-components';
@@ -81,7 +81,7 @@ export const BuyPanel: React.FC<IBuyPanelProps> = ({
81
81
  const hasDCBalance = dcBalance > 0 && dcToGoldSwapRate > 0;
82
82
 
83
83
  const getDCEquivalentPrice = (goldPrice: number): number =>
84
- dcToGoldSwapRate > 0 ? Math.ceil(goldPrice / dcToGoldSwapRate) : 0;
84
+ dcToGoldSwapRate > 0 ? goldToDC(goldPrice) : 0;
85
85
 
86
86
  return (
87
87
  <>
@@ -106,7 +106,7 @@ export const BuyPanel: React.FC<IBuyPanelProps> = ({
106
106
  setBuyingItemId(null);
107
107
  enableHotkeys?.();
108
108
  }}
109
- message="Are you sure to buy this item?"
109
+ message="Are you sure you want to buy this item?"
110
110
  />
111
111
  )}
112
112
  <InputWrapper>
@@ -1,3 +1,4 @@
1
+ import { formatDCAmount } from '@rpg-engine/shared';
1
2
  import React, { useCallback, useState } from 'react';
2
3
  import { FaTimes } from 'react-icons/fa';
3
4
  import styled from 'styled-components';
@@ -72,10 +73,10 @@ export const MarketplaceBuyModal: React.FC<IMarketplaceBuyModalProps> = ({
72
73
  <OptionText>
73
74
  <OptionLabel $disabled={!hasSufficientDC}>Definya Coin</OptionLabel>
74
75
  <OptionSub>
75
- {dcEquivalentPrice.toLocaleString()} DC
76
+ {formatDCAmount(dcEquivalentPrice)} DC
76
77
  {' '}
77
78
  <BalanceHint $insufficient={!hasSufficientDC}>
78
- ({dcBalance.toLocaleString()} available)
79
+ ({formatDCAmount(dcBalance)} available)
79
80
  </BalanceHint>
80
81
  </OptionSub>
81
82
  </OptionText>
@@ -1,4 +1,5 @@
1
1
  import {
2
+ formatDCAmount,
2
3
  getItemTextureKeyPath,
3
4
  IEquipmentSet,
4
5
  IItem,
@@ -90,32 +91,26 @@ export const MarketplaceRows: React.FC<IMarketPlaceRowsPropos> = ({
90
91
  </ItemIconContainer>
91
92
 
92
93
  <Flex>
93
- <PriceContainer>
94
- <ItemIconContainer>
95
- <GoldContainer>
96
- <SpriteFromAtlas
97
- atlasIMG={atlasIMG}
98
- atlasJSON={atlasJSON}
99
- spriteKey="others/gold-coin-qty-5.png"
100
- imgScale={2}
101
- />
102
- </GoldContainer>
103
- <PriceValue>
104
- <p>
105
- <Ellipsis maxLines={1} maxWidth="120px" fontSize="10px">
106
- ${itemPrice}
107
- </Ellipsis>
108
- </p>
109
- </PriceValue>
110
- </ItemIconContainer>
111
- {dcEquivalentPrice !== undefined && (
112
- <DCPriceLabel>
113
- <Ellipsis maxLines={1} maxWidth="80px" fontSize="9px">
114
- {dcEquivalentPrice} DC
94
+ <ItemIconContainer>
95
+ <GoldContainer>
96
+ <SpriteFromAtlas
97
+ atlasIMG={atlasIMG}
98
+ atlasJSON={atlasJSON}
99
+ spriteKey="others/gold-coin-qty-5.png"
100
+ imgScale={2}
101
+ />
102
+ </GoldContainer>
103
+ <PriceValue>
104
+ <p>
105
+ <Ellipsis maxLines={1} maxWidth="120px" fontSize="10px">
106
+ ${itemPrice}
115
107
  </Ellipsis>
116
- </DCPriceLabel>
108
+ </p>
109
+ </PriceValue>
110
+ {dcEquivalentPrice !== undefined && (
111
+ <DCPriceLabel>{formatDCAmount(dcEquivalentPrice)} DC</DCPriceLabel>
117
112
  )}
118
- </PriceContainer>
113
+ </ItemIconContainer>
119
114
  <ButtonContainer>
120
115
  <Button
121
116
  buttonType={ButtonTypes.RPGUIButton}
@@ -187,18 +182,11 @@ const SpriteContainer = styled.div`
187
182
  left: 0.5rem;
188
183
  `;
189
184
 
190
- const PriceContainer = styled.div`
191
- display: flex;
192
- flex-direction: column;
193
- align-items: flex-start;
194
- gap: 2px;
195
- `;
196
-
197
- const DCPriceLabel = styled.p`
198
- margin: 0;
199
- margin-left: 40px;
185
+ const DCPriceLabel = styled.span`
186
+ margin-left: 8px;
200
187
  color: #fef08a;
201
- font-size: 0.7rem;
188
+ font-size: 0.65rem;
189
+ white-space: nowrap;
202
190
  `;
203
191
 
204
192
  const PriceValue = styled.div`
@@ -256,7 +256,6 @@ export const Store: React.FC<IStoreProps> = ({
256
256
  {onShowHistory && (
257
257
  <CTAButton
258
258
  icon={<FaHistory />}
259
- label="History"
260
259
  onClick={onShowHistory}
261
260
  />
262
261
  )}