Exemple #1
0
        public KeyIcon SetIcon(KeyModel model, KeyIcon icon)
        {
            string hash = CreateMD5(JsonSerializer.Serialize(model));

            _cache[hash] = icon;
            return(icon);
        }
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            this._modifiersPresenter = this.GetTemplateChild(PART_Modifiers) as ItemsControl;
            this._keyPresenter = this.GetTemplateChild(PART_KeyIcon) as KeyIcon;
            this._prompt = this.GetTemplateChild(PART_Prompt) as TextBlock;

            this.UpdateVisual();
        }
Exemple #3
0
    IEnumerator keyPicked()
    {
        KeyMod.SetActive(false);
        LockMod.SetActive(false);
        KeyIcon.SetActive(true);
        LockIcon.SetActive(true);
        ObjectText.SetActive(false);
        talkText.GetComponent <Text>().text = "A key and a lockpick !\n Now i can open that door";
        yield return(new WaitForSeconds(5));

        talkText.GetComponent <Text>().text = "";
        ObjectText.transform.GetChild(0).GetComponent <Text>().text = "Open the house door with the key";
        ObjectText.SetActive(true);
    }
Exemple #4
0
        public KeyIcon GenerateIcon(KeyModel keyModel)
        {
            Document = _templateDocumentProvider.ProvideTemplateDocument();
            DrawIcon(keyModel);

            Bitmap   export   = new Bitmap(244, 244);
            Graphics graphics = Graphics.FromImage(export);

            Document.Draw(graphics);

            KeyIcon newIcon = new KeyIcon(export);

            return(newIcon);
        }
Exemple #5
0
    IEnumerator key_2Picked()
    {
        ghostDisabler.SetActive(true);
        key2Mod.SetActive(false);
        KeyIcon.SetActive(true);
        ObjectText.SetActive(false);
        talkText.GetComponent <Text>().text = "Another key,\nlets open the door with this one";
        yield return(new WaitForSeconds(1));

        Flight.GetComponent <LightFlicker>().enabled = true;
        yield return(new WaitForSeconds(4));

        talkText.GetComponent <Text>().text = "";
        ObjectText.transform.GetChild(0).GetComponent <Text>().text = "Open the house door with the key";
        ObjectText.SetActive(true);
    }
Exemple #6
0
        public static bool Use <T>()
        {
            if (StarlightWorld.KeyInventory.Any(n => n is T))
            {
                Key key = StarlightWorld.KeyInventory.FirstOrDefault(n => n is T);
                StarlightWorld.KeyInventory.Remove(key);
                KeyIcon icon = KeyInventory.keys.FirstOrDefault(n => n.parent == key);
                KeyInventory.keys.Remove(icon);

                Main.PlaySound(ModLoader.GetMod("StarlightRiver").GetLegacySoundSlot(SoundType.Custom, "Sounds/KeyUse"));
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #7
0
        public void LoadMap(MapDictionary.MapType type)
        {
            gameObjectManager.Initialize();
            particleManager.Initialize();
            uiManager.Initialize();
            mapType = type;
            var reader = GameDevice.Instance().GetCSVReader();

            reader.Read(MapDictionary.MapNames[(int)mapType]);
            var map = new Map(reader.GetData());

            gameObjectManager.Add(map);
            keyIcon     = new KeyIcon(Vector2.Zero);
            fade        = new Fade(Vector2.Zero, Fade.FadeOption.Out);
            clock       = new Clock(Vector2.Zero);
            backGrounds = new BackGround[] {
                new BackGround1(Vector2.Zero, mapType),
                new BackGroundStar(Vector2.Zero, mapType),
                new BackGround2(Vector2.Zero, mapType),
                new BackGround3(Vector2.Zero, mapType),
            };
        }