Exemple #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     Debug.Log("Use");
     Debug.Log(UseButton);
     UseButton.SetActive(true);
     CurrentItemToUse     = this.gameObject;
     transform.localScale = transform.localScale * 1.1f;
 }
 private void ItemsDisplay_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.D)
     {
         DropButton.Focus();
     }
     else if (e.Key == Key.U)
     {
         UseButton.Focus();
     }
     else if (e.Key == Key.I)
     {
         ItemDescriptionBlock.Focus();
     }
 }
Exemple #3
0
        public override void ViewDidLoad()
        {
            _settings    = Resolver.Resolve <ISettings>();
            _fingerprint = Resolver.Resolve <IFingerprint>();

            NavItem.Title        = AppResources.VerifyFingerprint;
            CancelButton.Title   = AppResources.Cancel;
            View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);

            UseButton.SetTitle(AppResources.UseFingerprintToUnlock, UIControlState.Normal);
            var descriptor = UIFontDescriptor.PreferredBody;

            UseButton.Font            = UIFont.FromDescriptor(descriptor, descriptor.PointSize);
            UseButton.BackgroundColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
            UseButton.TintColor       = UIColor.White;
            UseButton.TouchUpInside  += UseButton_TouchUpInside;

            base.ViewDidLoad();
        }
            static bool Prefix(UseButton __instance, [HarmonyArgument(0)] IUsable target)
            {
                PlayerControl pc = PlayerControl.LocalPlayer;

                __instance.enabled = true;

                if (IsBlocked(target, pc))
                {
                    __instance.currentTarget        = null;
                    __instance.buttonLabelText.text = ModTranslation.getString("buttonBlocked");
                    __instance.enabled       = false;
                    __instance.graphic.color = Palette.DisabledClear;
                    __instance.graphic.material.SetFloat("_Desat", 0f);
                    return(false);
                }

                __instance.currentTarget = target;
                return(true);
            }
        public override void ViewDidLoad()
        {
            _appSettingsService = Resolver.Resolve <IAppSettingsService>();
            _fingerprint        = Resolver.Resolve <IFingerprint>();
            _deviceInfo         = Resolver.Resolve <IDeviceInfoService>();

            NavItem.Title        = _deviceInfo.HasFaceIdSupport ? AppResources.VerifyFaceID : AppResources.VerifyFingerprint;
            CancelButton.Title   = AppResources.Cancel;
            View.BackgroundColor = new UIColor(red: 0.94f, green: 0.94f, blue: 0.96f, alpha: 1.0f);

            UseButton.SetTitle(_deviceInfo.HasFaceIdSupport ? AppResources.UseFaceIDToUnlock :
                               AppResources.UseFingerprintToUnlock, UIControlState.Normal);
            var descriptor = UIFontDescriptor.PreferredBody;

            UseButton.Font            = UIFont.FromDescriptor(descriptor, descriptor.PointSize);
            UseButton.BackgroundColor = new UIColor(red: 0.24f, green: 0.55f, blue: 0.74f, alpha: 1.0f);
            UseButton.TintColor       = UIColor.White;
            UseButton.TouchUpInside  += UseButton_TouchUpInside;

            FingerprintButton.SetImage(new UIImage(_deviceInfo.HasFaceIdSupport ? "smile.png" : "fingerprint.png"),
                                       UIControlState.Normal);

            base.ViewDidLoad();
        }
    void Start()
    {
        UseButton.instance = this;

        useButton = GetComponent <Image> ();
    }
Exemple #7
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     transform.localScale = transform.localScale / 1.1f;
     UseButton.SetActive(false);
 }