hello I am installing offline shops, but I am getting an error:
char_item.cpp
Bitte melden Sie sich an, um diesen Link zu sehen. Hide contents
Code
- #ifdef __ENABLE_OFFLINE_SHOP__
- case USE_OPEN_OFFLINE_SHOP:
- if (!UseItemOpenOfflineShop(item))
- {
- return false;
- }
- break;
- case USE_OFFLINE_SHOP_PREMIUM:
- {
- if (!IsLoadedAffect() || item->IsExchanging())
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot actually use it.", this));
- return false;
- }
- if (FindAffect(AFFECT_PREMIUM_OFFLINE_SHOP))
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Premium Offline Shops are actually active.", this));
- return false;
- }
- AddAffect(AFFECT_PREMIUM_OFFLINE_SHOP, POINT_NONE, 0, 0, INFINITE_AFFECT_DURATION, 0, false);
- item->SetCount(item->GetCount()-1);
- }
- break;
- #endif
- [...]
- #ifdef __ENABLE_OFFLINE_SHOP__
- bool CHARACTER::UseItemOpenOfflineShop(CItem* item)
- {
- if (!item)
- {
- return false;
- }
- if (IsOpeningOfflineShop())
- {
- ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You are already opening an offline shop.", this));
- return false;
- }
- item->Lock(true);
- SetOpeningOfflineShopState(true);
- SetOfflineShopOpeningItem(item);
- ChatPacket(CHAT_TYPE_COMMAND, "StartOpeningOfflineShop %d %d",
- item->GetValue(COfflineShop::ITEM_TIME_IDX), item->GetValue(COfflineShop::ITEM_GOLD_IDX));
- return true;
- }
- #endif
Game.py
Bitte melden Sie sich an, um diesen Link zu sehen. QuoteAlles anzeigenCode
- [...]
- if app.ENABLE_OFFLINE_SHOP:
- serverCommandList["OfflineShop"] = self.__OfflineShop
- serverCommandList["OfflineShopDestroy"] = self.__OfflineShopDestroy
- serverCommandList["StartOpeningOfflineShop"] = self.__StartOpeningOfflineShop
- serverCommandList["CancelOpeningOfflineShop"] = self.__CancelOpeningOfflineShop
- self.serverCommander=stringCommander.Analyzer()
- for serverCommandItem in serverCommandList.items():
- self.serverCommander.SAFE_RegisterCallBack(
- serverCommandItem[0], serverCommandItem[1]
- )
- [...]
- if app.ENABLE_OFFLINE_SHOP:
- def __OfflineShop(self, id, name, *nameArgs):
- for namePart in nameArgs:
- name += " " + namePart
- uiOfflineShop.Manager.GetInstance().UpdateMyShop(id, name)
- def __OfflineShopDestroy(self, id):
- uiOfflineShop.Manager.GetInstance().DestroyMyShop(id)
- def __StartOpeningOfflineShop(self, openingTime, openingGold):
- openingTime = int(openingTime)
- self.interface.OpenOfflineShopBuilder(openingTime, openingGold)
- def __CancelOpeningOfflineShop(self):
- self.interface.CloseOfflineShopBuilder()
Interfacemodule.py
Bitte melden Sie sich an, um diesen Link zu sehen. QuoteAlles anzeigenCode
- if app.ENABLE_OFFLINE_SHOP:
- def OpenOfflineShopBuilder(self, openingTime, openingGold):
- if not self.wndOfflineShopBuilder:
- self.wndOfflineShopBuilder = uiOfflineShop.BuilderWindow()
- self.wndOfflineShopBuilder.Open(openingTime, openingGold)
- def CloseOfflineShopBuilder(self):
- if not self.wndOfflineShopBuilder:
- return
- self.wndOfflineShopBuilder.Close()
- def IsBuildingOfflineShop(self):
- return self.wndOfflineShopBuilder and self.wndOfflineShopBuilder.IsShow()
- def OpenShopSearchWindow(self):
- return
Bitte melden Sie sich an, um diesen Link zu sehen.
uiofflineshop.Open
Bitte melden Sie sich an, um diesen Link zu sehen. QuoteCode
- def Open(self, openingTime, openingGold):
- self.__Reset()
- self.__openingTime.SetText("{}: {}".format(uiScriptLocale.PRIVATE_SHOP_LEFT_TIME, localeInfo.GetFormattedTimeString(openingTime)))
- self.__shopCost.SetText(localeInfo.NumberToMoneyStringOLD(openingGold))
- self.SetCenterPosition()
- self.Show()
- self.__SpawnPseudoShopKeeper()
Can anyone help me solve this problem?