// Token: 0x060038E5 RID: 14565 RVA: 0x001A16FC File Offset: 0x0019FAFC private static void onClickedBuyingButton(SleekButton button) { byte index = (byte)PlayerNPCVendorUI.buyingBox.search(button); VendorBuying vendorBuying = PlayerNPCVendorUI.buying[(int)index]; if (!vendorBuying.canSell(Player.player)) { return; } Player.player.quests.sendSellToVendor(PlayerNPCVendorUI.vendor.id, vendorBuying.index); }
// Token: 0x060038E3 RID: 14563 RVA: 0x001A1398 File Offset: 0x0019F798 private static void updateVendor(VendorAsset newVendor, DialogueResponse newResponse, DialogueAsset newDialogue, DialogueAsset newPrevDialogue) { PlayerNPCVendorUI.vendor = newVendor; PlayerNPCVendorUI.response = newResponse; PlayerNPCVendorUI.dialogue = newDialogue; PlayerNPCVendorUI.prevDialogue = newPrevDialogue; if (PlayerNPCVendorUI.vendor == null) { return; } PlayerNPCVendorUI.nameLabel.text = PlayerNPCVendorUI.vendor.vendorName; string text = PlayerNPCVendorUI.vendor.vendorDescription; text = text.Replace("<br>", "\n"); PlayerNPCVendorUI.descriptionLabel.text = text; PlayerNPCVendorUI.buttons.Clear(); PlayerNPCVendorUI.buying.Clear(); byte b = 0; while ((int)b < PlayerNPCVendorUI.vendor.buying.Length) { VendorBuying vendorBuying = PlayerNPCVendorUI.vendor.buying[(int)b]; if (vendorBuying.areConditionsMet(Player.player)) { PlayerNPCVendorUI.buying.Add(vendorBuying); } b += 1; } PlayerNPCVendorUI.buying.Sort(PlayerNPCVendorUI.buyingComparator); PlayerNPCVendorUI.buyingBox.isVisible = (PlayerNPCVendorUI.buying.Count > 0); PlayerNPCVendorUI.buyingBox.remove(); int num = 0; byte b2 = 0; while ((int)b2 < PlayerNPCVendorUI.buying.Count) { VendorBuying newElement = PlayerNPCVendorUI.buying[(int)b2]; SleekVendor sleekVendor = new SleekVendor(newElement); sleekVendor.positionOffset_Y = num; sleekVendor.sizeOffset_X = -30; sleekVendor.sizeScale_X = 1f; SleekButton sleekButton = sleekVendor; if (PlayerNPCVendorUI.< > f__mg$cache0 == null) { PlayerNPCVendorUI.< > f__mg$cache0 = new ClickedButton(PlayerNPCVendorUI.onClickedBuyingButton); } sleekButton.onClickedButton = PlayerNPCVendorUI.< > f__mg$cache0; PlayerNPCVendorUI.buyingBox.add(sleekVendor); num += sleekVendor.sizeOffset_Y; PlayerNPCVendorUI.buttons.Add(sleekVendor); b2 += 1; } PlayerNPCVendorUI.buyingBox.area = new Rect(0f, 0f, 5f, (float)num); PlayerNPCVendorUI.selling.Clear(); byte b3 = 0; while ((int)b3 < PlayerNPCVendorUI.vendor.selling.Length) { VendorSelling vendorSelling = PlayerNPCVendorUI.vendor.selling[(int)b3]; if (vendorSelling.areConditionsMet(Player.player)) { PlayerNPCVendorUI.selling.Add(vendorSelling); } b3 += 1; } PlayerNPCVendorUI.selling.Sort(PlayerNPCVendorUI.sellingComparator); PlayerNPCVendorUI.sellingBox.isVisible = (PlayerNPCVendorUI.selling.Count > 0); PlayerNPCVendorUI.sellingBox.remove(); int num2 = 0; byte b4 = 0; while ((int)b4 < PlayerNPCVendorUI.selling.Count) { VendorSelling newElement2 = PlayerNPCVendorUI.selling[(int)b4]; SleekVendor sleekVendor2 = new SleekVendor(newElement2); sleekVendor2.positionOffset_Y = num2; sleekVendor2.sizeOffset_X = -30; sleekVendor2.sizeScale_X = 1f; SleekButton sleekButton2 = sleekVendor2; if (PlayerNPCVendorUI.< > f__mg$cache1 == null) { PlayerNPCVendorUI.< > f__mg$cache1 = new ClickedButton(PlayerNPCVendorUI.onClickedSellingButton); } sleekButton2.onClickedButton = PlayerNPCVendorUI.< > f__mg$cache1; PlayerNPCVendorUI.sellingBox.add(sleekVendor2); num2 += sleekVendor2.sizeOffset_Y; PlayerNPCVendorUI.buttons.Add(sleekVendor2); b4 += 1; } PlayerNPCVendorUI.sellingBox.area = new Rect(0f, 0f, 5f, (float)num2); }