public void OnSetSelection()
 {
     NoSkillOverlay.enabled = false;
     if (Tabs.SelectedTab == "Catalogue")
     {
         Debug.Log("OnSetSelection in book browser and tab is Catalogue");
         //just let the catalogue do its thing
         WorldItems.ReturnDoppleganger(BookOrderDoppleganger);
         PushEditObjectToNGUIObject();
     }
     else
     {
         Debug.Log("OnSetSelection in book browser and tab is Order");
         WorldItems.ReturnDoppleganger(BookDoppleganger);
         CurrentOrder = null;
         if (Books.Get.HasPlacedOrder(library.Name, out CurrentOrder))
         {
             //update the order doppleganger and stuff
             BookOrderShadow.enabled        = true;
             OrderStatusLabelBottom.enabled = true;
             DopplegangerProps.CopyFrom(CurrentOrder.BookObject);
             BookOrderDoppleganger = WorldItems.GetDoppleganger(DopplegangerProps, BookOrderDopplegangerParent, BookOrderDoppleganger, WIMode.Stacked);
             Vector3 doppleGangerPosition = BookOrderDoppleganger.transform.localPosition;
             doppleGangerPosition.z = 0f;
             BookOrderDoppleganger.transform.localPosition = doppleGangerPosition;
             OrderStatusProgressBarParent.gameObject.SetActive(true);
             if (Books.Get.DeliverBookOrder(LibraryName))
             {
                 ReceivedOrder                      = true;
                 OrderStatusLabelTop.text           = CurrentOrder.BookObject.DisplayName + " has been added to your log";
                 OrderStatusLabelBottom.text        = "Delivered";
                 OrderStatusProgressBarGlow.alpha   = 0f;                                                                      //Colors.Alpha(Colors.Get.MessageSuccessColor, 0.35f);
                 OrderStatusProgressBar.sliderValue = 1f;
             }
             else
             {
                 OrderStatusLabelTop.text           = CurrentOrder.BookObject.DisplayName + " has been ordered";
                 OrderStatusProgressBar.sliderValue = CurrentOrder.NormalizedTimeUntilDelivery;
                 OrderStatusProgressBarGlow.enabled = true;
                 OrderStatusLabelBottom.text        = "In Transit:";
             }
         }
         else
         {
             //get rid of the doppleganger, hide everything
             WorldItems.ReturnDoppleganger(BookOrderDoppleganger);
             OrderStatusProgressBarParent.SetActive(false);
             OrderStatusLabelBottom.enabled = false;
             OrderStatusLabelTop.enabled    = true;
             BookOrderShadow.enabled        = false;
             OrderStatusLabelTop.text       = "You have no outstanding orders";
         }
     }
 }
Exemplo n.º 2
0
 public void DisplayDetail(FrontiersInterface user, string name, string detailText, string iconName, UIAtlas iconAtlas, Color iconColor, Color iconBackgroundColor, GenericWorldItem dopplegangerProps)
 {
     ScrollBar.scrollValue = 0f;
     Show();
     NameLabel.text        = name;
     DetailTextLabel.color = Colors.Get.MenuButtonTextColorDefault;
     DetailTextLabel.text  = detailText;
     if (string.IsNullOrEmpty(iconName) || iconAtlas == null)
     {
         Icon.enabled           = false;
         IconBackground.enabled = false;
     }
     else
     {
         Icon.enabled           = true;
         IconBackground.enabled = true;
         Icon.atlas             = iconAtlas;
         Icon.spriteName        = iconName;
         Icon.color             = iconColor;
         IconBackground.color   = iconBackgroundColor;
     }
     if (dopplegangerProps != null)
     {
         ShowDoppleganger = true;
         DopplegangerProps.CopyFrom(dopplegangerProps);
     }
     else
     {
         ShowDoppleganger = false;
     }
     RefreshDoppleganger();
     LastUser = user;
 }
Exemplo n.º 3
0
 public void EnableForBlueprint(GenericWorldItem requiredItemTemplate, BlueprintStrictness strictness)
 {
     mEnabledForBlueprint = true;
     Strictness           = strictness;
     RequiredItemTemplate.CopyFrom(requiredItemTemplate);
 }