public CheckableItemsAdapter(Activity context, Library.ItemInfoList list) : base(context, Resource.Layout.item_row_checkable, list) { this.context = context; _itemInfoList = list; }
/// <summary> /// アイテムを装備する /// </summary> /// <param name="itemId"></param> public void EquipItem(string itemId) { var itemInfo = ItemInfoList.Where(x => x.Id == itemId).FirstOrDefault(); var equipImage = _searchController.SearchEquipItemImage.GetComponent <Image>(); equipImage.sprite = itemInfo.SpThm; UtageUtil.ChangeNazotokiAdvUiStatus(UiStatus.Default); }
void ReloadItems() { currentPage = 0; int cbCateg1Id = ((SpinnerAdapter <int, string>)cbCateg1.Adapter).GetSelectedValue(cbCateg1.SelectedItemPosition); int cbCateg2Id = ((SpinnerAdapter <int, string>)cbCateg2.Adapter).GetSelectedValue(cbCateg2.SelectedItemPosition); decimal retVal = 0; decimal.TryParse(tbRetVal.Text.Trim(), out retVal); if (cbCateg1Id == 0 & cbCateg2Id == 0 && retVal == 0 && tbSearch.Text == "") { lvItems.Adapter = new CheckableItemsAdapter(activity, new Library.ItemInfoList()); return; } ItemInfoList.Criteria crit = new ItemInfoList.Criteria() { ItemDesc = tbSearch.Text, Category1 = cbCateg1Id, Category2 = cbCateg2Id, RetVal = retVal, CstId = transHed.CstId }; if (itemInfoList != null && itemInfoList.CurrentCriteria.Category1 == crit.Category1 && itemInfoList.CurrentCriteria.Category2 == crit.Category2 && itemInfoList.CurrentCriteria.CstId == crit.CstId && itemInfoList.CurrentCriteria.ItemDesc == crit.ItemDesc && itemInfoList.CurrentCriteria.RetVal == crit.RetVal) { return; } //itemInfoList = ItemInfoList.GetItemInfoList(activity,crit); itemInfoList = new ItemInfoList(); itemInfoList.CurrentCriteria = crit; adapterItems = new CheckableItemsAdapter(activity, itemInfoList); adapterItems.ItemImageSelected += new CheckableItemsAdapter.ItemImageSelectedDelegate(ItemImageSelected); adapterItems.LoadData(0); /*ItemInfoList.LoadAdapterItems(currentContext,0,adapterItems,new ItemInfoList.Criteria() * { * ItemDesc = tbSearch.Text, * Category1 = cbCateg1Id, * Category2 = cbCateg2Id, * RetVal = retVal, * CstId = transHed.CstId * });*/ lvItems.Adapter = adapterItems; currentPage = 1;// lvItems.LastVisiblePosition adapterItems.SingleItemSelectedEvent += () => { _checkedItems = adapterItems.CheckedItemIds; Dismiss(); }; adapterItems.SingleItemFocusedEvent += (item) => { TextView lblItemSelectedInfo = FindViewById <TextView>(Resource.Id.lblItemSelectedInfo); ImageView imgItemSelected = FindViewById <ImageView>(Resource.Id.imgItemSelected); lblItemSelectedInfo.Text = item.ItemDesc; //tincho da go vidi //ItemInfo itemInfo = ItemInfo.GetItem(currentContext, item.ItemId, false); //imgItemSelected.SetImageBitmap(itemInfo.ItemImage); }; GC.Collect(); }
/// <summary> /// Start /// </summary> void Start() { // よく使用するため、コントローラの参照をあらかじめ取得しておく _nazotokiAdvEngineController = UtageUtil.GetNazotokiAdvEngineController(); _searchController = SearchGroup.GetComponent <SearchController>(); _mapController = _mapGroup.GetComponent <MapController>(); _quizController = _quizGroup.GetComponent <QuizController>(); // 初期化 _currentGetItemList = new List <string>(); _completeHouseCount = 1; // TODO: 外部ファイルから読み込み _itemInfoList = new List <ItemInfo>(); _quizInfoList = new List <QuizInfo>(); _stageInfoList = new List <StageInfo>(); _houseInfoList = new List <HouseInfo>(); // アイテム情報を読み込む var item1 = new ItemInfo(); item1.Id = "item_sample_1"; item1.Type = ItemType.Equipment; item1.Name = "ほげ"; item1.Description = "アイテム説明1"; item1.ThmFilePath = "Utage/Dialog/Inventory/ItemThumbnail/thm_sample_001"; item1.OrgFilePath = "Utage/Dialog/ItemDetail/ItemOrg/org_sample_001"; item1.SpThm = Resources.Load <Sprite>(item1.ThmFilePath); item1.SpOrg = Resources.Load <Sprite>(item1.OrgFilePath); ItemInfoList.Add(item1); var item2 = new ItemInfo(); item2.Id = "item_sample_2"; item2.Type = ItemType.Equipment; item2.Name = "ふが"; item2.Description = "アイテム説明2"; item2.ThmFilePath = "Utage/Dialog/Inventory/ItemThumbnail/thm_sample_002"; item2.OrgFilePath = "Utage/Dialog/ItemDetail/ItemOrg/org_sample_002"; item2.SpThm = Resources.Load <Sprite>(item2.ThmFilePath); item2.SpOrg = Resources.Load <Sprite>(item2.OrgFilePath); ItemInfoList.Add(item2); var item3 = new ItemInfo(); item3.Id = "item_sample_3"; item3.Type = ItemType.UseRooms; item3.Name = "ハゲ"; item3.Description = "アイテム説明3"; item3.ThmFilePath = "Utage/Dialog/Inventory/ItemThumbnail/thm_sample_003"; item3.OrgFilePath = "Utage/Dialog/ItemDetail/ItemOrg/org_sample_003"; item3.SpThm = Resources.Load <Sprite>(item3.ThmFilePath); item3.SpOrg = Resources.Load <Sprite>(item3.OrgFilePath); ItemInfoList.Add(item3); var item4 = new ItemInfo(); item4.Id = "item_sample_4"; item4.Type = ItemType.UseBossRoom; item4.Name = "手紙"; item4.Description = "直接届けられない想いを伝えるために……"; item4.ThmFilePath = "Utage/Dialog/Inventory/ItemThumbnail/thm_sample_004"; item4.OrgFilePath = "Utage/Dialog/ItemDetail/ItemOrg/org_sample_004"; item4.SpThm = Resources.Load <Sprite>(item4.ThmFilePath); item4.SpOrg = Resources.Load <Sprite>(item4.OrgFilePath); ItemInfoList.Add(item4); CurrentGetItemList.Add(item1.Id); CurrentGetItemList.Add(item2.Id); var quizInfo1 = new QuizInfo() { Id = "quiz_sample_1", CorrectAnswer = "興味", GetItemId = "item_sample_4", BeforeScenarioLabel = "Test1", EndScenarioLabel = "Test2", HintScenarioLabelList = new List <string>(), QuestionObjectFilePath = "Game/Prefab/Quiz/Question/SampleQuestion" }; _quizInfoList.Add(quizInfo1); var quizInfo2 = new QuizInfo() { Id = "quiz_sample_2", CorrectAnswer = "兵", GetItemId = "item_sample_4", BeforeScenarioLabel = "Test3", EndScenarioLabel = "Test4", HintScenarioLabelList = new List <string>(), QuestionObjectFilePath = "Game/Prefab/Quiz/Question/Sample2Question" }; _quizInfoList.Add(quizInfo2); var houseInfo1 = new HouseInfo() { Id = "house_sample_1", BeforeScenarioLabel = "Test1", EndScenarioLabel = "Test2", QuizId = "quiz_sample_1", HouseObjectFilePath = "Game/Prefab/Search/House/SampleHouse" }; _houseInfoList.Add(houseInfo1); var houseInfo2 = new HouseInfo() { Id = "house_sample_2", BeforeScenarioLabel = "Test4", EndScenarioLabel = "Test3", QuizId = "quiz_sample_2", HouseObjectFilePath = "Game/Prefab/Search/House/Sample2House" }; _houseInfoList.Add(houseInfo2); var stageInfo1 = new StageInfo() { Id = "stage_sample_1", StageObjectFilePath = "Game/Prefab/Map/Stage/SampleStage", EpilogueScenarioLabel = "Test1", PrologueScenarioLabel = "プロローグ" }; _stageInfoList.Add(stageInfo1); _currentStageInfo = stageInfo1; // 最初はシナリオシーン _currentScenarioLabel = stageInfo1.PrologueScenarioLabel; ChangeGameMode(GameMode.Senario); }
public void LoadData(int page) { ItemInfoList.LoadAdapterItems(context, page, this, _itemInfoList.CurrentCriteria); this.NotifyDataSetChanged(); }