Ejemplo n.º 1
0
        private void OnQuestTurnInIndicated(DialogueLine dialogueLine)
        {
            var model = dialogueLine.GetAssociatedQuestModel();

            if (Quest.IsQuestEventReadyForCompletion(model))
            {
                var evt = model as QuestEventModel;
                GameEventDispatcher.DispatchItemTurnedInEvent(evt.Id, evt.ItemId, evt.Required);
                _closeAfterLinesShown = true;
                AdvanceLine();
            }
        }
Ejemplo n.º 2
0
        private void ShowTurnIn(DialogueLine dialogueLine)
        {
            ClearContainer();
            var container = _resourcePreloader.InstanceScene <DialogueLineContainer>();

            _dialogueContent.AddChild(container);
            container.DisplayTurnIn((QuestEventModel)dialogueLine.GetAssociatedQuestModel());
            container.Connect(nameof(DialogueLineContainer.QuestTurnInIndicated), this, nameof(OnQuestTurnInIndicated), new Godot.Collections.Array()
            {
                dialogueLine
            });
            container.Connect(nameof(DialogueLineContainer.NotYetButtonPressed), this, nameof(OnNotYetButtonPressed));
        }
Ejemplo n.º 3
0
        private void SetupInventoryCell(DialogueLine dialogueLine)
        {
            var model = dialogueLine.GetAssociatedQuestModel();

            if (model == null)
            {
                Logger.Error("Could not find associated quest model");
                return;
            }
            if (model is QuestEventModel qem)
            {
                var metadata = MetadataLoader.LootItemIdToMetadata[qem.ItemId];
                var item     = InventoryItem.FromMetadata(metadata);
                item.Amount = qem.Required;
                _inventoryCell.SetInventoryItem(item);
            }
            else
            {
                Logger.Error("Could not parse model as an event model " + model.Id);
            }
        }