Repository navigation
feat(personal-shop): prices in items and account coins - #710
Conversation
Builds against MUnique.OpenMU.Network.Packets 0.9.11, which adds the player shop currency packets (MUnique/OpenMU#1186), and regenerates the packet bindings from it. The castle siege tax type and guild command are enums in the new definitions, so their call sites pass the enum values now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y7XufeAZ22z7ocXAXUqUsE
When the server allows other prices than zen for personal shops (MUnique/OpenMU#1186), for example in jewels or account coins, the client: - remembers the allowed price types (C1 3F 0A), which the server sends on world entry and before a shop list; - offers a currency button in the price input box, which switches between zen and the allowed price types, and sends other prices than zen with the extended set-price packet (C3 3F 09), whose price fields are encoded like the ones of the shop item list; zen still uses the original packet; - reads the item and coin prices of the extended shop item list instead of refusing the whole shop when an item has no zen price; - shows the price with its currency (item name or coin) in the item and pet tooltips; - leaves the "not enough items/coins" message to the server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y7XufeAZ22z7ocXAXUqUsE
bfa8a4a to
8f364e3
Compare
Branch
|
- Drop the new "WCoin (P)" translation, which collides with the existing "W Coin(P)" key (both become I18N::Game::WCoinP) and made ResxGen abort. Reuse the existing key and name the new one "W Coin(C)" alike. - Qualify the return type of CPersonalShopPriceMsgBox::LButtonUp, which g++ doesn't find outside of the SEASON3B namespace. - Move GetCurrencyName to its own translation unit. It needs the item and text tables of the game, which pulled UI globals of Winmain.cpp into the tests of the protocol logic. The protocol constants are shared through the header now. - Format the changed lines with clang-format 21, as the CI checks them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y7XufeAZ22z7ocXAXUqUsE
|
Thanks for testing this against the original client too, @eduardosmaniotto! All three issues are fixed in 9ab1ad0:
I also formatted the PR's changed lines with clang-format 21.1.8, the version the CI quality job uses on changed lines, because several of them failed that check. Checked locally with g++ Generated by Claude Code |
Conflicts with the UI reorganization and the RmlUi migration of the message boxes: - The personal shop price input is now the GenericDialogConfig dialog of MyShopInventory.cpp, so CPersonalShopPriceMsgBox is gone. When the server allows other prices than zen, the dialog's secondary button names the currency and shows the dialog again with the next allowed one, keeping the typed amount. Zen prices below the item value still ask for a confirmation. - The castle siege guild command cast moved to UI/Combat/SiegeWarCommander.cpp. - The shop item lists keep the decoded prices with main's new UI::Shop::AddBrowsedShopItem and item list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y7XufeAZ22z7ocXAXUqUsE
A long currency name didn't fit the dialog's secondary button. The
dialog now names the currency in its own line ("Currency: Jewel of
Bless"), and its "Currency" button opens a menu of the allowed
currencies instead of switching to the next one:
- the common ones first: zen, the account coins and the jewels (Bless,
Soul, Chaos, Life, Creation, Guardian, Harmony);
- the other items the server allows behind an "Other items" button, in
the order of the server.
A long menu takes two columns, so it stays on the screen. Choosing a
currency or closing the menu returns to the price dialog and keeps the
typed amount.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7XufeAZ22z7ocXAXUqUsE




Summary
Client side of MUnique/OpenMU#1186. With it, a seller can price a personal-shop item in items (e.g. jewels) or account coins as well as zen, whenever the server allows it.
MUnique.OpenMU.Network.Packets0.9.11 is now published on NuGet (from MUnique/OpenMU#1190). Its packet XML is byte-identical to the local build the bindings were generated from. Regenerating from the published package gives no changes.Commit 1:
build(network): packet definitions 0.9.11OpenMuPacketsVersionandOPENMU_PACKETS_VERSIONto 0.9.11.CastleSiegeTaxTypeandCastleSiegeGuildCommandType, with the same values as before.ToggleCastleGateRequestonly renamed its parameter toisOpen; the client already sends 1 for "open".The feature commits (
feat(personal-shop): …, the review fixes, a merge ofmainand the currency menu)GameLogic::PersonalShop(PersonalShopCurrency.h/.cpp):PriceItemType;GetCurrencyName(PersonalShopCurrencyName.cpp) gives the currency name: the client's item name, or the coin name. It has its own file so the tests of the protocol logic don't need the game's item and text tables.WSclient):C1 3F 0A(the allowed price types) and resets them at the character list;MoneyPrice == 0, which is what an item price looks like;LackOfPriceCurrency(the server sends the message);CPersonalItemPriceTablestores the full price. Theintoverloads stay for zen.ShowPersonalShopItemValueDialoginMyShopInventory.cpp, aGenericDialogConfigdialog since the RmlUi migration.GenericMenuDialogwith the common currencies. The other items the server allows are in a second menu, behind an "Other items" button.3F 01packet, so it works with every server; other prices use3F 09.Selling Price: 12 Jewel of Bless. The "short of zen" warning appears only for zen prices.price_item_type.W Coin(C),Goblin Points,Currency,Currency: %ls,Other items;W Coin(P);tests/gamelogic/test_personal_shop_currency.cpp: decoding, an encode/decode round trip, and the order of the currency menu;docs/personal-shop.md(usage);docs/control-socket.md(the new field).Related issues
MUnique/OpenMU#1186. Server side: MUnique/OpenMU#1190 (packets, merged) and MUnique/OpenMU#1191 (feature).
Checklist
docs/CODING_RULES.md.docs/build/README.md).-Wall -Wextra) and pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y7XufeAZ22z7ocXAXUqUsE