public void UpdateDisplayName( string newName, VendingMachine.SellOrderContainer sellOrderContainer) { this.displayName = newName; this.toolTip.Text = this.displayName; if (this.isInStock && sellOrderContainer != null && (sellOrderContainer.sellOrders != null && ((List <VendingMachine.SellOrder>)sellOrderContainer.sellOrders).Count > 0)) { this.toolTip.Text += "\n"; using (List <VendingMachine.SellOrder> .Enumerator enumerator = ((List <VendingMachine.SellOrder>)sellOrderContainer.sellOrders).GetEnumerator()) { while (enumerator.MoveNext()) { VendingMachine.SellOrder current = enumerator.Current; if (current.inStock > 0) { string str1 = ItemManager.FindItemDefinition((int)current.itemToSellID).displayName.translated + (current.itemToSellIsBP != null ? " (BP)" : ""); string str2 = ItemManager.FindItemDefinition((int)current.currencyID).displayName.translated + (current.currencyIsBP != null ? " (BP)" : ""); Tooltip toolTip1 = this.toolTip; toolTip1.Text = toolTip1.Text + "\n" + (object)(int)current.itemToSellAmount + " " + str1 + " | " + (object)(int)current.currencyAmountPerItem + " " + str2; Tooltip toolTip2 = this.toolTip; toolTip2.Text = toolTip2.Text + " (" + (object)(int)current.inStock + " Left)"; } } } } ((Behaviour)this.toolTip).set_enabled(this.toolTip.Text != ""); }
public override void Load(BaseNetworkable.LoadInfo info) { base.Load(info); if (info.msg.vendingMachine == null) { return; } this.shopName = (string)((VendingMachine)info.msg.vendingMachine).shopName; if (((VendingMachine)info.msg.vendingMachine).sellOrderContainer != null) { this.sellOrders = (VendingMachine.SellOrderContainer)((VendingMachine)info.msg.vendingMachine).sellOrderContainer; this.sellOrders.ShouldPool = (__Null)0; } if (!info.fromDisk || !this.isServer) { return; } this.RefreshSellOrderStockLevel((ItemDefinition)null); }
public virtual void InstallDefaultSellOrders() { this.sellOrders = new VendingMachine.SellOrderContainer(); this.sellOrders.ShouldPool = (__Null)0; this.sellOrders.sellOrders = (__Null) new List <VendingMachine.SellOrder>(); }