private void displayChoices(List <StoryData.StoryChoice> choices, Action postChoiceCallback = null) { choiceBox.Clear(); foreach (StoryData.StoryChoice choice in choices) { bool greyOut = visitedStories.Contains(choice.linkedStory.storyName); choiceBox.AddChoice(choice.choiceText, () => { askChoice(choice, postChoiceCallback); }, greyOut); } }
private void AddDetail(TitlePanel titlePanel) { var vPanel = titlePanel.EAdd(new VLayoutPanel()); if (CanSave) { var hPanel = new HLayoutPanel(); vPanel.Add(hPanel, new VLayoutOption(HorizontalAlign.Left)); hPanel.Add(new SimpleLabel("选择存货")); var selectGoods = new ChoiceBox(B3UnitedInfosConsts.DataSources.存货) { Width = Unit.Pixel(130), EnableInputArgument = true, AutoPostBack = true, EnableTopItem = true, EnableMultiSelection = true }; selectGoods.SelectedValueChanged += delegate { detailGrid.GetFromUI(); if (!selectGoods.IsEmpty) { var gids = selectGoods.GetValues().Distinct(); foreach (var g in gids) { if (Dmo.Details.Any(x => x.Goods_ID == long.Parse(g))) { continue; } var d = new Picking_Detail() { Goods_ID = long.Parse(g) }; DmoUtil.RefreshDependency(d, "Goods_ID"); Dmo.Details.Add(d); } } selectGoods.Clear(); detailGrid.DataBind(); }; hPanel.Add(selectGoods); } var editor = new DFCollectionEditor <Picking_Detail>(() => Dmo.Details); editor.AllowDeletionFunc = () => CanSave; editor.IsEditableFunc = (field, detail) => CanSave; editor.CanDeleteFunc = detail => CanSave; detailGrid = new DFEditGrid(editor) { Width = Unit.Percentage(100) }; detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code")); detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Name")); detailGrid.Columns.EAdd(new DFEditGridColumn <DFValueLabel>("Goods_Spec")); detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("Number")); detailGrid.Columns.EAdd(new DFEditGridColumn <DFValueLabel>("Goods_MainUnit")); detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("SecondNumber")); detailGrid.Columns.EAdd(new DFEditGridColumn <DFValueLabel>("Goods_SecondUnit")); detailGrid.Columns.EAdd(new DFEditGridColumn <DFTextBox>("Remark")); detailGrid.ValueColumns.Add("Goods_ID"); detailGrid.ValueColumns.Add("Goods_UnitConvertDirection"); detailGrid.ValueColumns.Add("Goods_MainUnitRatio"); detailGrid.ValueColumns.Add("Goods_SecondUnitRatio"); mDFContainer.AddNonDFControl(detailGrid, "$detailGrid"); var section = mPageLayoutManager.AddSection("DetaiColumns", "明细列"); section.SetRequired("Number", "SecondNumber"); section.ApplyLayout(detailGrid, mPageLayoutManager, DFInfo.Get(typeof(Picking_Detail))); new NumberSecondNumberConvertRowMangerWithMoneyChanged(detailGrid); vPanel.Add(detailGrid); }
public void Update() { if (StoryManager.isEnding) { suspendSecretChoice = true; } if (GameManager.DEBUG) { CharacterName characterToFake = (CharacterName)(-1); if (Input.GetKeyDown(KeyCode.Alpha1)) { characterToFake = CharacterName.arcane; } else if (Input.GetKey(KeyCode.Alpha2)) { characterToFake = CharacterName.errant; } else if (Input.GetKey(KeyCode.Alpha3)) { characterToFake = CharacterName.feral; } else if (Input.GetKey(KeyCode.Alpha4)) { characterToFake = CharacterName.pious; } if ((int)characterToFake != -1) { notesFound[characterToFake] = new HashSet <string>() { "a", "b", "c" }; } } float dist = Mathf.Abs(player.transform.position.x - notesPosition.position.x); if (dist < notesTriggerDist && !suspendSecretChoice) { notesUi.Open(); noteEffect.SetUnread(false); if (!secretChoiceBox.IsVisible) { List <StoryData.StoryChoice> choices = getSecretChoices(); if (choices.Count > 0) { secretChoiceBox.show(); secretChoiceBox.Clear(); foreach (StoryData.StoryChoice choice in choices) { string storyText = choice.choiceText; bool greyOut = storyManager.visitedStories.Contains(choice.linkedStory.storyName); secretChoiceBox.AddChoice(storyText, () => { suspendSecretChoice = true; // close the notes until we leave & return storyManager.Abort(); storyManager.askChoice(choice); }, greyOut); } } } } else { if (dist > UnsuspendSecretChoiceDist) { suspendSecretChoice = false; } notesUi.Close(); secretChoiceBox.hide(); secretChoiceBox.Clear(); } }
private void AddPayDetails(TitlePanel titlePanel) { var vPanel = titlePanel.EAdd(new VLayoutPanel()); if (CanSave) { var hPanel = vPanel.Add(new HLayoutPanel(), new VLayoutOption(HorizontalAlign.Left)); hPanel.Add(new SimpleLabel("选择存货")); var selectGoods = new ChoiceBox(B3UnitedInfosConsts.DataSources.存货) { Width = Unit.Pixel(130), EnableInputArgument = true, AutoPostBack = true, EnableTopItem = true, EnableMultiSelection = true }; selectGoods.SelectedValueChanged += delegate { _detailGrid.GetFromUI(); if (!selectGoods.IsEmpty) { var gids = selectGoods.GetValues().Distinct(); foreach (var g in gids) { var d = new ClientGoodsSet_Detail() { Goods_ID = long.Parse(g) }; DmoUtil.RefreshDependency(d, "Goods_ID"); Dmo.Details.Add(d); } } selectGoods.Clear(); _detailGrid.DataBind(); }; hPanel.Add(selectGoods); var addGoods = hPanel.Add(new DialogButton { Text = "选择存货", }); addGoods.Url = "SelectGoodsDialogs.aspx"; addGoods.Click += delegate { _detailGrid.GetFromUI(); foreach (var goodsID in DialogUtil.GetCachedObj <long>(this)) { if (Dmo.Details.Any(x => x.Goods_ID == goodsID)) { continue; } var detail = new ClientGoodsSet_Detail() { Goods_ID = goodsID }; DmoUtil.RefreshDependency(detail, "Goods_ID"); Dmo.Details.Add(detail); } _detailGrid.DataBind(); }; } ; var editor = new DFCollectionEditor <ClientGoodsSet_Detail>(() => Dmo.Details); editor.AllowDeletionFunc = () => CanSave; editor.CanDeleteFunc = detail => CanSave; editor.IsEditableFunc = (field, detail) => CanSave; _detailGrid = new DFEditGrid(editor); _detailGrid.DFGridSetEnabled = false; _detailGrid.Width = Unit.Percentage(100); _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("GoodsProperty_Name")); _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Code")); _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Name")); _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_Spec")); _detailGrid.Columns.Add(new DFEditGridColumn <DFValueLabel>("Goods_StandardSecondNumber")); _detailGrid.ValueColumns.Add("Goods_ID"); var section = mPageLayoutManager.AddSection("GoodsDetaiColumns", "存货明细"); titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name); section.ApplyLayout(_detailGrid, mPageLayoutManager, DFInfo.Get(typeof(ClientGoodsSet_Detail))); vPanel.Add(_detailGrid); }