Skip to content

Commit

Permalink
feat: recipes, game chat, items, transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sceat committed Dec 14, 2024
1 parent 14f9ca7 commit be3fa54
Show file tree
Hide file tree
Showing 21 changed files with 247 additions and 321 deletions.
94 changes: 51 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
"publish:mainnet": "git tag mainnet-$(node -p -e \"require('./package.json').version\") && git push origin mainnet-$(node -p -e \"require('./package.json').version\")"
},
"dependencies": {
"@aresrpg/aresrpg-engine": "2.6.3",
"@aresrpg/aresrpg-protocol": "5.1.6",
"@aresrpg/aresrpg-sdk": "5.0.7",
"@aresrpg/aresrpg-engine": "2.6.4",
"@aresrpg/aresrpg-protocol": "5.1.7",
"@aresrpg/aresrpg-sdk": "5.0.11",
"@aresrpg/aresrpg-world": "1.7.0",
"@bufbuild/buf": "1.47.2",
"@bufbuild/protobuf": "2.2.3",
"@bufbuild/protoc-gen-es": "2.2.3",
"@imengyu/vue3-context-menu": "1.4.4",
"@intlify/unplugin-vue-i18n": "6.0.1",
"@mysten/enoki": "0.4.17",
"@mysten/kiosk": "0.9.32",
"@mysten/sui": "1.16.2",
"@mysten/wallet-standard": "0.13.18",
"@mysten/zksend": "0.12.8",
"@mysten/enoki": "0.4.18",
"@mysten/kiosk": "0.9.33",
"@mysten/sui": "1.17.0",
"@mysten/wallet-standard": "0.13.19",
"@mysten/zksend": "0.12.9",
"@vercel/analytics": "1.4.1",
"@vueuse/core": "12.0.0",
"bignumber.js": "9.1.2",
Expand Down Expand Up @@ -80,7 +80,7 @@
"@iconify-json/twemoji": "^1.2.1",
"@modyfi/vite-plugin-yaml": "^1.1.0",
"@types/dat.gui": "^0.7.13",
"@types/node": "^22.10.1",
"@types/node": "^22.10.2",
"@types/three": "^0.170.0",
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.18.0",
Expand Down
7 changes: 6 additions & 1 deletion src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import deep_equal from 'fast-deep-equal';
import { decrease_loading, increase_loading } from './core/utils/loading.js';
import { get_spells } from './core/game/spells_per_class.js';
import toast from './toast.js';
import { translate } from './i18n.js';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// @ts-ignore
Expand Down Expand Up @@ -93,6 +95,7 @@ const admin = reactive({
const owned_tokens = ref([]);
const finished_crafts = ref([]);
const currently_listed_items_names = ref({});
const recipes = ref([]);
provide('sidebar_reduced', sidebar_reduced);
provide('game_visible', game_visible);
Expand Down Expand Up @@ -123,7 +126,7 @@ provide('finished_crafts', finished_crafts);
provide('message_history', message_history);
provide('currently_listed_items_names', currently_listed_items_names);
provide('recipes', ref([]));
provide('recipes', recipes);
function update_all(
state,
Expand Down Expand Up @@ -173,6 +176,8 @@ function update_all(
if (sui.finished_crafts.length !== finished_crafts.value.length)
finished_crafts.value = sui.finished_crafts;
if (sui.recipes.length !== recipes.value.length) recipes.value = sui.recipes;
const all_ids = characters.map(c => c.id);
// @ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion src/assets/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ APP_MINT_CARD_VAPOREONTEXT: |
This Vaporeon is a pet which you can equip on AresRPG, he will follow you in your exploration and fights.
Feed him with some $HSUI daily, and he will increase your stats
APP_RECIPE_REQUIREMENTS: Requirements
APP_RECIPE_TAILOR: Tailor
APP_RECIPE_CRAFT: Craft
APP_RECIPE_REVEAL: Reveal
Expand All @@ -178,6 +177,7 @@ APP_RECIPE_REVEALING: Revealing item
APP_RECIPE_REVEALED: Item revealed
APP_RECIPE_FAILED_TO_REVEAL: Failed to reveal item
APP_RECIPE_CLOSE: Close
APP_RECIPE_LEARNED: New recipe learned! ({0})

APP_SERVER_ONLINE_PLAYERS: Online players
APP_SERVER_TOTAL_PLAYERS: Registered players
Expand Down
2 changes: 1 addition & 1 deletion src/assets/translations/fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ APP_MINT_CARD_VAPOREONTEXT: |
Ce Vaporeon est un familier que vous pouvez équiper sur AresRPG, il vous suivra dans vos explorations et combats.
Nourrissez-le quotidiennement avec du $HSUI, et il augmentera vos statistiques
APP_RECIPE_REQUIREMENTS: Requis
APP_RECIPE_TAILOR: Tailleur
APP_RECIPE_CRAFT: Fabriquer
APP_RECIPE_REVEAL: Révéler
Expand All @@ -179,6 +178,7 @@ APP_RECIPE_REVEALING: Révélation de l'item
APP_RECIPE_REVEALED: Item révélé
APP_RECIPE_FAILED_TO_REVEAL: Échec de la révélation de l'item
APP_RECIPE_CLOSE: Fermer
APP_RECIPE_LEARNED: Nouvelle recette apprise! ({0})

APP_SERVER_ONLINE_PLAYERS: Joueurs en ligne
APP_SERVER_TOTAL_PLAYERS: Joueurs enregistrés
Expand Down
2 changes: 1 addition & 1 deletion src/assets/translations/jp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ APP_MINT_CARD_VAPOREONTEXT: |
このシャワーズは、AresRPGで装備できるペットで、探索や戦闘であなたに同行します。
毎日$HSUIで餌を与えると、ステータスが上がります。
APP_RECIPE_REQUIREMENTS: 必要条件
APP_RECIPE_TAILOR: 裁縫師
APP_RECIPE_CRAFT: クラフト
APP_RECIPE_REVEAL: 明らかにする
Expand All @@ -177,6 +176,7 @@ APP_RECIPE_REVEALING: アイテムを明らかにしています
APP_RECIPE_REVEALED: アイテムが明らかになりました
APP_RECIPE_FAILED_TO_REVEAL: アイテムの明らかに失敗しました
APP_RECIPE_CLOSE: 閉じる
APP_RECIPE_LEARNED: 新しいレシピを学びました! ({0})

APP_SERVER_ONLINE_PLAYERS: オンラインプレイヤー
APP_SERVER_TOTAL_PLAYERS: 登録プレイヤー
Expand Down
4 changes: 2 additions & 2 deletions src/components/cards/item-inventory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ async function use_item() {
});
tx.update('success', t('APP_ITEM_USED'), { digest });
} catch (error) {
console.error(error);
tx.update('error', t('APP_ITEM_FAILED_TO_USE'));
if (error) tx.update('error', t('APP_ITEM_FAILED_TO_USE'));
else tx.remove();
}
}
Expand Down
14 changes: 12 additions & 2 deletions src/components/cards/market-listings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,28 @@ function on_listings_response(payload) {
select_item(items[0]);
}
function on_item_listed({ item, price }) {
listings.value = [
...listings.value,
{
...item,
list_price: price,
},
];
}
onMounted(async () => {
context.events.on('packet/marketItemListings', on_listings_response);
SUI_EMITTER.on('ItemPurchasedEvent', on_item_purchased);
SUI_EMITTER.on('ItemDelistedEvent', on_item_delisted);
SUI_EMITTER.on('ItemListedEvent', fetch_listings);
SUI_EMITTER.on('ItemListedEvent', on_item_listed);
});
onUnmounted(() => {
context.events.off('packet/marketItemListings', on_listings_response);
SUI_EMITTER.off('ItemPurchasedEvent', on_item_purchased);
SUI_EMITTER.off('ItemDelistedEvent', on_item_delisted);
SUI_EMITTER.off('ItemListedEvent', fetch_listings);
SUI_EMITTER.off('ItemListedEvent', on_item_listed);
});
</script>
Expand Down
13 changes: 6 additions & 7 deletions src/components/cards/recipe.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<template lang="pug">
.recipe.material-2
.top
img(:src="item_icon(recipe.template.item_type)")
img(:src="item_icon(recipe.item_type)")
.name
span {{ recipe.template.name }}
.job #[b {{ t('APP_RECIPE_REQUIREMENTS') }}]: {{ t('APP_RECIPE_TAILOR') }} {{ recipe.level }}
.lvl Lvl. {{ recipe.template.level }}
span {{ recipe.name }}
.lvl Lvl. {{ recipe.level }}
.bottom
.ingredients
vs-tooltip(v-for="ingredient in recipe.ingredients" :key="ingredient.item_type")
vs-tooltip(v-for="ingredient in recipe.ingredients" :key="ingredient.name")
template(#content) {{ ingredient.name }}
.ingredient
img(:src="item_icon(ingredient.item_type)" :alt="ingredient.item_type" :class="{ token: ingredient.item_type.length > 20 }")
img(:src="item_icon(ingredient.item || ingredient.token)" :alt="ingredient.name" :class="{ token: !!ingredient.token }")
span x{{ pretty_amount(ingredient) }}
.btns
vs-button(v-if="admin.admin_caps.length" type="gradient" size="small" color="#F4511E" @click="delete_recipe") Delete
Expand All @@ -23,7 +22,7 @@
vs-dialog(v-model="craft_dialog")
template(#header) {{ t('APP_RECIPE_CRAFT_TITLE') }}
i18n-t(keypath="APP_RECIPE_CRAFT_DESC")
b.itemname {{ recipe.template.name }} (Lvl. {{ recipe.template.level }})
b.itemname {{ recipe.name }} (Lvl. {{ recipe.level }})
template(#footer)
.dialog-footer
vs-button(type="transparent" color="#E74C3C" @click="craft_dialog = false") {{ t('APP_RECIPE_CANCEL') }}
Expand Down
Loading

0 comments on commit be3fa54

Please sign in to comment.