protected void btnCreate_Click(object sender, EventArgs e) { try { string shelfCode = this.tbShelfCode.Text.Trim(); string itemCode = this.tbItem.Text.Trim(); if (!this.rfvItem.IsValid) { return; } ShelfItem shelfItem = new ShelfItem(); if (shelfItem != null) { shelfItem.Shelf = TheShelfMgr.LoadShelf(shelfCode); shelfItem.Item = TheItemMgr.LoadItem(itemCode); } TheShelfItemMgr.CreateShelfItem(shelfItem); ShowSuccessMessage("Mes.ShelfItem.Insert.Successfully"); if (CreateEvent != null) { CreateEvent(sender, e); } } catch (BusinessErrorException ex) { ShowErrorMessage(ex); } }
/// <summary> /// Makes the interactive shelf part in Byrnhilda's story appear. /// </summary> /// <param name="parameters"></param> private void DoShelfPuzzle(string[] parameters) { if (_shelfItemList.Count == 0) { if (_shownShelfItem != null) { Destroy(_shownShelfItem.gameObject); } _shownShelfItem = null; foreach (var shelfItemData in shelfItemDataList) { ShelfItem shelfItem = shelfItemData.CreateObject(); _shelfItemList.Add(shelfItem); shelfItem.Initialize(shelfItemData, this); } } foreach (var _shelfItem in _shelfItemList) { _shelfItem.gameObject.SetActive(false); // force reload _shelfItem.gameObject.SetActive(true); } if (parameters.Length == 2 && parameters[1].Equals("full", StringComparison.InvariantCultureIgnoreCase)) { _onComplete.Invoke(); } else { inputManager.SetInputState(InputState.Shelving); } }
/// <summary> /// Acts as an interface for shelf item to call when they are clicked. /// </summary> /// <param name="shelfItem"></param> public void InformShelfItemTouched(ShelfItem shelfItem) { _shownShelfItem = shelfItem; _saveClient.autoSave.shownItem = _shownShelfItem.ShelfItemName; inputManager.SetInputState(InputState.Normal); bool isDone = true; for (int i = _shelfItemList.Count - 1; i >= 0; i--) { isDone = isDone && _shelfItemList[i].IsDone(); if (shelfItem != _shelfItemList[i]) { _shelfItemList[i].gameObject.SetActive(false); } else { shelfItem.Display(); } } if (isDone) { memoryStorage.SetValue(PengiConstants.PuzzleDoneVariableName, true); } ShowElements(true); _onComplete.Invoke(); }
public ShelfItem CreateObject() { Debug.Assert(prefabShelfItem != null); ShelfItem o = Object.Instantiate(prefabShelfItem).GetComponent <ShelfItem>(); o.SetName(variableName); return(o); }
void PopulateView(string path) { ShelfContent.Children.Clear(); var items = ShelfItem.Find(path); foreach (var i in items) { ShelfContent.Children.Add(i); } }
public UIShelf() { InitializeComponent(); builder = new ShelfBuilder(); builder.OnBuildComplete += Builder_OnBuildComplete; ShelfItem.OnSelected += ShelfItem_OnSelected; root = new ShelfItem("Categories"); root.Toggle(); ShelfPaths.Content = root; builder.Build(); }
private void setComparisonData(ShelfItem current, ShelfItem prev) { currentItem = current; prevItem = prev; rectCurr.Fill = GetBrushFromColor(current.Color); txtCurrName.Text = current.Name; txtCurrScore.Text = current.Score.ToString("#,##0.##"); rectPrev.Fill = GetBrushFromColor(prev.Color); txtPrevName.Text = prev.Name; txtPrevScore.Text = prev.Score.ToString("#,##0.##"); }
public void SetItems(ShelfItem current, ShelfItem prev) { currentItem = current; prevItem = prev; rectCurr.Fill = new SolidColorBrush(current.Color); txtCurrName.Text = current.Name; txtCurrScore.Text = current.Score.ToString("#,###.##"); rectPrev.Fill = new SolidColorBrush(prev.Color); txtPrevName.Text = prev.Name; txtPrevScore.Text = prev.Score.ToString("#,###.##"); }
protected void ODS_ShelfItem_Updating(object sender, ObjectDataSourceMethodEventArgs e) { string shelfCode = ((TextBox)(this.FV_ShelfItem.FindControl("tbShelf"))).Text.Trim(); string itemCode = ((TextBox)(this.FV_ShelfItem.FindControl("tbItem"))).Text.Trim(); ShelfItem shelfItem = (ShelfItem)e.InputParameters[0]; if (shelfItem != null) { shelfItem.Shelf = TheShelfMgr.LoadShelf(shelfCode); shelfItem.Item = TheItemMgr.LoadItem(itemCode); } }
private ImageBrush GetImgBrushFromItem(ShelfItem item) { ImageBrush retVal = null; if (imageBrushesDict.ContainsKey(item.ItemID)) { retVal = imageBrushesDict[item.ItemID]; } else { imageBrushesDict.Add(item.ItemID, retVal = new ImageBrush { ImageSource = new BitmapImage(new Uri(item.ImageUri, UriKind.Absolute)) }); } return(retVal); }
private void PopulateView(string path) { var items = ShelfItem.Find(path); clones = new List <NodeResource>(); ResourcesList.Items.Clear(); foreach (var item in items) { clones.Add(item.Clone()); } foreach (var item in clones) { item.MouseDown += Item_MouseDown; ResourcesList.Items.Add(item); } }
private void Builder_OnBuildComplete(ShelfBuilder builder) { var r = builder.Root; Stack <ShelfBuilder.ShelfBuilderItem> stack = new Stack <ShelfBuilder.ShelfBuilderItem>(); stack.Push(r); while (stack.Count > 0) { var n = stack.Pop(); var c = root.FindChild(n.Path); foreach (var resource in n.Nodes) { NodeResource nr = new NodeResource(); nr.Title = resource.Title; nr.Path = resource.Path; nr.Type = resource.Type; nr.ToolTip = ShelfDescriptions.Get(nr); c.Add(nr); } List <ShelfBuilder.ShelfBuilderItem> children = n.Children; foreach (var child in children) { ShelfItem sh = new ShelfItem(child.BaseName); c.Add(sh); stack.Push(child); } } if (IsLoaded) { if (string.IsNullOrEmpty(selectedPath)) { PopulateView("Categories"); } else { PopulateView(selectedPath); } } }
public void AddItemToBasket(ShelfItem item, int quantity = 1) { var basketItem = _basketItems.SingleOrDefault(b => b.ShelfItemId == item.Id); if (basketItem == null) { basketItem = new BasketItem() { ShelfItemId = item.Id, Price = item.Price, Quantity = quantity, ShelfItem = item }; _basketItems.Add(basketItem); } else { basketItem.Quantity += quantity; } }
private void setComparisonData(ShelfItem current, ShelfItem prev) { compPanel.SetItems(current, prev); if (compPanel != null) { compPanel.Close(); } compPanel.Show(); compPanel.Top = this.Top; compPanel.Left = this.Left + this.Width; //currentItem = current; //prevItem = prev; //rectCurr.Fill = new ImageBrush { ImageSource = new BitmapImage(new Uri(current.ImageUri, UriKind.Absolute)) }; //txtCurrName.Text = current.Name; //txtCurrScore.Text = current.Score.ToString("#,##0.##"); //rectPrev.Fill = new ImageBrush { ImageSource = new BitmapImage(new Uri(prev.ImageUri, UriKind.Absolute)) }; //txtPrevName.Text = prev.Name; //txtPrevScore.Text = prev.Score.ToString("#,##0.##"); }
public void SetItems(ShelfItem current, ShelfItem prev) { currentItem = current; prevItem = prev; //rectCurr.Fill = new SolidColorBrush(current.Color); //txtCurrName.Text = current.Name; //txtCurrScore.Text = current.Score.ToString("#,###.##"); //rectPrev.Fill = new SolidColorBrush(prev.Color); //txtPrevName.Text = prev.Name; //txtPrevScore.Text = prev.Score.ToString("#,###.##"); rectCurr.Fill = new ImageBrush { ImageSource = new BitmapImage(new Uri(current.ImageUri, UriKind.Absolute)) }; txtCurrName.Text = current.Name; txtCurrScore.Text = current.Score.ToString("#,##0.##"); rectPrev.Fill = new ImageBrush { ImageSource = new BitmapImage(new Uri(prev.ImageUri, UriKind.Absolute)) }; txtPrevName.Text = prev.Name; txtPrevScore.Text = prev.Score.ToString("#,##0.##"); }
public virtual void CreateShelfItem(ShelfItem entity) { Create(entity); }
public virtual void UpdateShelfItem(ShelfItem entity) { entityDao.UpdateShelfItem(entity); }
public virtual void DeleteShelfItem(ShelfItem entity) { entityDao.DeleteShelfItem(entity); }
public virtual void CreateShelfItem(ShelfItem entity) { entityDao.CreateShelfItem(entity); }
public virtual void UpdateShelfItem(ShelfItem entity) { Update(entity); }
private void ProcessShelfItemIn(MesScmsTableIndex mesScmsTableIndex) { IList<MesScmsShelfPart> mesScmsShelfPartList = mesScmsShelfPartMgr.GetUpdateMesScmsShelfPart(); if (mesScmsShelfPartList != null && mesScmsShelfPartList.Count > 0) { foreach (MesScmsShelfPart mesScmsShelfPart in mesScmsShelfPartList) { if (mesScmsShelfPart.Flag == MesDssConstants.MES_SCMS_FLAG_FTPC_UPDATED) { ShelfItem shelfItem = shelfItemMgr.LoadShelfItem(mesScmsShelfPart.ShelfNo, mesScmsShelfPart.ItemCode); if (shelfItem == null) { shelfItem = new ShelfItem(); Shelf shelf = shelfMgr.LoadShelf(mesScmsShelfPart.ShelfNo); if (shelf == null) { log.Error(mesScmsShelfPart.ShelfNo + " not found "); continue; } Item item = itemMgr.LoadItem(mesScmsShelfPart.ItemCode); if (item == null) { log.Error(mesScmsShelfPart.ItemCode + " not found "); continue; } shelfItem.Shelf = shelf; shelfItem.Item = item; shelfItem.IsActive = true; shelfItemMgr.CreateShelfItem(shelfItem); } } else if (mesScmsShelfPart.Flag == MesDssConstants.MES_SCMS_FLAG_FTPC_DELETED) { try { ShelfItem shelfItem = shelfItemMgr.LoadShelfItem(mesScmsShelfPart.ShelfNo, mesScmsShelfPart.ItemCode); if (shelfItem != null) { shelfItem.IsActive = false; shelfItemMgr.UpdateShelfItem(shelfItem); } } catch (Exception e) { this.CleanSession(); log.Error(mesScmsShelfPart.ShelfNo + "-" + mesScmsShelfPart.ItemCode + " delete exception", e); continue; } } try { mesScmsShelfPartMgr.Complete(mesScmsShelfPart); } catch (Exception e) { this.CleanSession(); log.Error(mesScmsShelfPart.ShelfNo + " complete exception", e); continue; } } } mesScmsTableIndexMgr.Complete(mesScmsTableIndex); }
public void CreateShelfItem(ShelfItem shelfItem) { ShelfItemMgr.CreateShelfItem(shelfItem); }
public void DeleteShelfItem(ShelfItem shelfItem) { ShelfItemMgr.DeleteShelfItem(shelfItem); }
private void ShelfItem_OnSelected(ShelfItem shelf, string path) { selected = shelf; selectedPath = path; PopulateView(path); }
public void UpdateShelfItem(ShelfItem shelfItem) { ShelfItemMgr.UpdateShelfItem(shelfItem); }
public virtual void DeleteShelfItem(ShelfItem entity) { Delete(entity); }
private void ProcessShelfItemIn(MesScmsTableIndex mesScmsTableIndex) { IList <MesScmsShelfPart> mesScmsShelfPartList = mesScmsShelfPartMgr.GetUpdateMesScmsShelfPart(); if (mesScmsShelfPartList != null && mesScmsShelfPartList.Count > 0) { foreach (MesScmsShelfPart mesScmsShelfPart in mesScmsShelfPartList) { if (mesScmsShelfPart.Flag == MesDssConstants.MES_SCMS_FLAG_FTPC_UPDATED) { ShelfItem shelfItem = shelfItemMgr.LoadShelfItem(mesScmsShelfPart.ShelfNo, mesScmsShelfPart.ItemCode); if (shelfItem == null) { shelfItem = new ShelfItem(); Shelf shelf = shelfMgr.LoadShelf(mesScmsShelfPart.ShelfNo); if (shelf == null) { log.Error(mesScmsShelfPart.ShelfNo + " not found "); continue; } Item item = itemMgr.LoadItem(mesScmsShelfPart.ItemCode); if (item == null) { log.Error(mesScmsShelfPart.ItemCode + " not found "); continue; } shelfItem.Shelf = shelf; shelfItem.Item = item; shelfItem.IsActive = true; shelfItemMgr.CreateShelfItem(shelfItem); } } else if (mesScmsShelfPart.Flag == MesDssConstants.MES_SCMS_FLAG_FTPC_DELETED) { try { ShelfItem shelfItem = shelfItemMgr.LoadShelfItem(mesScmsShelfPart.ShelfNo, mesScmsShelfPart.ItemCode); if (shelfItem != null) { shelfItem.IsActive = false; shelfItemMgr.UpdateShelfItem(shelfItem); } } catch (Exception e) { this.CleanSession(); log.Error(mesScmsShelfPart.ShelfNo + "-" + mesScmsShelfPart.ItemCode + " delete exception", e); continue; } } try { mesScmsShelfPartMgr.Complete(mesScmsShelfPart); } catch (Exception e) { this.CleanSession(); log.Error(mesScmsShelfPart.ShelfNo + " complete exception", e); continue; } } } mesScmsTableIndexMgr.Complete(mesScmsTableIndex); }
private void Awake() { _impulseSignal = GetComponent <CinemachineImpulseSource>(); Debug.Assert(gameConfiguration != null); Debug.Assert(dialogueRunner != null); Debug.Assert(dialogueUiManager != null); Debug.Assert(prefabFadedAudio != null); Debug.Assert(memoryStorage != null); Debug.Assert(inputManager != null); Debug.Assert(iconManager != null); Debug.Assert(blackScreen != null); if (_saveClient == null) { _saveClient = gameConfiguration.RequestSaveAccess(this); } // initialize backgrounds _backgroundScriptList = new BackgroundScript[backgroundList.Length]; for (int i = 0; i < backgroundList.Length; i++) { var script = Instantiate(backgroundList[i].prefab) .GetComponent <BackgroundScript>(); Debug.Assert(script != null); script.SetData(backgroundList[i]); _backgroundScriptList[i] = script; } ChangeHeader(new[] { _saveClient.currentSave.lastHeader }); PlayAudio(new[] { _saveClient.currentSave.lastAudioName }); // special case: shelf item if (!_saveClient.currentSave.shownItem.Equals("")) { foreach (var shelfItem in shelfItemDataList) { if (shelfItem.variableName.Equals(_saveClient.currentSave.shownItem)) { Debug.Log($"Shown item: "); var o = shelfItem.CreateObject(); _shownShelfItem = o; o.Initialize(shelfItem, this); o.Display(); break; } } } // load all active characters EnterStage(_saveClient.currentSave.activeCharacterList); dialogueRunner.AddCommandHandler( "playAudio", // the name of the command PlayAudio // the method to run ); dialogueRunner.AddCommandHandler("doPuzzle", DoPuzzle); dialogueRunner.AddCommandHandler("changeHeader", ChangeHeader); dialogueRunner.AddCommandHandler("changeBackground", ChangeHeader); // alias dialogueRunner.AddCommandHandler("shake", Shake); dialogueRunner.AddCommandHandler("debugLog", DebugLog); dialogueRunner.AddCommandHandler("clearShelfItem", ClearShelfItem); dialogueRunner.AddCommandHandler("resetSpeaker", ResetSpeaker); dialogueRunner.AddCommandHandler("removeSpeaker", ResetSpeaker); dialogueRunner.AddCommandHandler("showItem", ShowItem); dialogueRunner.AddCommandHandler("hideItem", HideItem); dialogueRunner.AddCommandHandler("showDialogue", ShowDialogue); dialogueRunner.AddCommandHandler("hideDialogue", HideDialogue); dialogueRunner.AddCommandHandler("gameEnd", GameEnd); dialogueRunner.AddCommandHandler("enterStage", EnterStage); dialogueRunner.AddCommandHandler("exitStage", ExitStage); dialogueRunner.AddCommandHandler("fakeLastDialog", FakeLastDialog); dialogueRunner.AddCommandHandler("playSFX", PlaySfx); dialogueRunner.AddCommandHandler("playSfx", PlaySfx); dialogueRunner.AddCommandHandler("playsfx", PlaySfx); dialogueRunner.AddCommandHandler("fadePlainBackground", FadePlainBackground); }
private void OnCollisionEnter(Collision collision) { // Check for player collision if (collision.gameObject.tag == "Player") { player.GetComponent <PlayerController>().RemoveObserver(this); Collider[] colliders = gameObject.GetComponents <Collider>(); foreach (Collider collider in colliders) { colliderItems.Remove(collider.gameObject); collider.enabled = false; } foreach (Transform child in transform) { child.GetComponent <MeshRenderer>().enabled = false; } if (gameObject.GetComponent <MeshRenderer>() != null) { gameObject.GetComponent <MeshRenderer>().enabled = false; } ParticleBehavior pb = null; switch (itemType) { case ItemType.BREAD: pb = new BreadItem(); break; case ItemType.CAN: pb = new CanItem(); break; case ItemType.CHEESE: pb = new CheeseItem(); break; case ItemType.FRUIT: pb = new FruitItem(); break; case ItemType.LIQUID: pb = new LiquidItem(); break; case ItemType.MEAT: pb = new MeatItem(); break; case ItemType.SHELF: pb = new ShelfItem(); break; } if (gameObject.transform.parent == true) { pb.InstantiateParticles(collision.contacts[0].point, gameObject.transform.parent.gameObject); } else { pb.InstantiateParticles(collision.contacts[0].point, gameObject); } } }