public static string GetDetailedName(Entity marketItem) { GarageItem item = GarageItemsRegistry.GetItem <GarageItem>(marketItem); string savedLocaleCode = LocaleUtils.GetSavedLocaleCode(); return(!"ru".Equals(savedLocaleCode) ? (Instance.GetGarageItemName(item) + " " + Instance.GetCategoryName(marketItem)) : (Instance.GetCategoryName(marketItem) + " " + Instance.GetGarageItemName(item))); }
public void InitLocaleItem(ListItemSelectedEvent e, LocaleItemNode node, [JoinByScreen] SelectedLocaleNode selected, LocaleItemNode nodeA, [JoinByScreen] SingleNode <SelectLocaleScreenComponent> screen) { selected.selectedLocale.Code = node.locale.Code; if (node.locale.Code == LocaleUtils.GetSavedLocaleCode()) { screen.component.DisableButtons(); } else { screen.component.EnableButtons(); } }
public void OnAddCustomText(NodeAddedEvent e, SingleNode <CustomDiscountTextComponent> customDiscountText, SingleNode <CustomDiscountUIComponent> customDiscountUI, [JoinAll] Optional <SaleNode> sale, [JoinAll] Optional <SingleNode <SteamComponent> > steam) { if (sale.IsPresent() && sale.Get().activePaymentSale.Personal) { customDiscountUI.component.description.text = string.Empty; } else { string str = customDiscountText.component.Get(LocaleUtils.GetSavedLocaleCode(), steam.IsPresent()); customDiscountUI.component.description.text = str; } }
public void InitSelectedLocaleItem(NodeAddedEvent e, LocaleItemNode node, [Context, JoinByScreen] SelectedLocaleNode selected, [Context, JoinByScreen] LocaleListNode localesList) { LocaleComponent locale = node.locale; node.localeItem.SetText(locale.Caption, locale.LocalizedCaption); string savedLocaleCode = LocaleUtils.GetSavedLocaleCode(); if (locale.Code == savedLocaleCode) { this.SetLocaleText(selected, node.locale); localesList.simpleHorizontalList.Select(node.Entity); } }
public void SetLocale(NodeAddedEvent e, SingleNode <ClientSessionComponent> session) { string savedLocaleCode = LocaleUtils.GetSavedLocaleCode(); session.Entity.AddComponent(new ClientLocaleComponent(savedLocaleCode)); }
public void OnAddLabel(NodeAddedEvent e, SingleNode <GiftPromoUIDataComponent> giftPromo, SingleNode <CustomDiscountUIComponent> customDiscountUI) { customDiscountUI.component.description.text = giftPromo.component.Get(LocaleUtils.GetSavedLocaleCode()); }
public void OnRemoveSale(NodeRemoveEvent e, SaleNode sale, [JoinAll] SingleNode <CustomDiscountTextComponent> customDiscountText, [JoinAll] SingleNode <CustomDiscountUIComponent> customDiscountUI, [JoinAll] Optional <SingleNode <SteamComponent> > steam) { string str = customDiscountText.component.Get(LocaleUtils.GetSavedLocaleCode(), steam.IsPresent()); customDiscountUI.component.description.text = str; }