Can I click on 2 different pawns and have them print different things while having the same interact event? - onclick

So I have created a system where as the player, I can left click which will call a function called Interact which is located in my player event graph.
The Interact events works just fine, it prints out the name of any pawn when I left click on them. But I would like to have specific interactions when I click on different pawns. If I have 2 different pawns, I would like to click on them and have it print different messages.
I tried going into the pawn/characters event graph and make an on-click event or hit result but I haven't found any luck or any tutorials on youtube. Preferably I would like the events to be located in the npc's I want to click on, not my own character.
If you didn't understand what I'm trying to ask, think of it like this, I want it to be like if I clicked on a snail, it will say "I'm a snail!". If I clicked on a horse he will say "I'm a horse!". But I want to keep the same interaction event for both characters.
Basically in the NPC event graph I want a (if I'm clicked on, do x event).
Any help?

Well, it turned out in my capsule component, the collision preset was not on OverlapOnlyPawn. So I was not able to click on him.

Related

Click button on element popup

Okay so I am trying to create an automation to click on a button once it appears. I was able to find the code within a javascript source file in the website's code files that creates the element that contains the button in question, however it is not always there. It is generated once a trigger on a different UI is enabled, then it shows up on my end. I want it to automate clicking the button as soon as it appears.
Is there a way to do this? I am super new to code.
An example of what I am trying to do:
Someone in one UI creates an account that needs to be approved, it pops up an element on my end with an approve or deny button. I want to automatically and basically instantaneously click one of those two buttons any time it appears.
This is not exactly what I am trying to do, but it is similar. I do not own the website I'm trying to go this on*
I have no clue what I'm doing at all....

Fully programmatic hiding / showing of SignPosts

I'm trying to display some extra contextual help as a result of a button click elsewhere (in this case it cant be the trigger)
I'd like to be able to have users dismiss via clicking the close x, or clicking the trigger, but continue to show if users click in places other than the ACTUAL trigger.
I've tried setting *clrIfOpen="false" or to about just about any other way I can think of blocking it, but it seems like some place the click listener is just telling isopen service that its open... meaning the clrIfOpen is really only good for an initial state.
Any hacks around this?

How to signalize a customer to click at one button twice?

First I want to make clear that my problem is not a technical question. I want to talk about usability.
In my company we have a function to check if a scale works properly. We have the button you see bellow (1) to start a function named scaleCheck(). During the scale check the weight of the scale is set to 0 and then a specified weight is put on the scale automatically and when the weight matches the number set in a config file the scale is OK. So when you click on the button, it gets the white border (2) and when the check is finished the button turns normal again (3).
This is the automatic process, but not every customer has a scale which can put automatically a weight on it. So in this case the customer has to go to the scale an put a weight on it by his own. In our application the customer can configure, if he wants the process to be manual or automatic and the button will adjust to this. So when the configuration is set on manual we have to interrupt our function an wait for the customer until he is ready. Because we don't know how many time he will need, he has to click on the button again to tell the application that the process can continue. Therefore we changed the button a bit when we are in manual mode. As you can see below the button (1) changes the image, when the customer clicks the first time on it (2), to show that the weight has to be put on the scale. When he clicks the second time the process proceeds (3).
So this is the current state. The automatic mode works how the customers imagine it to be, but in the manual mode many people have problems with it and need a lot of time the recognize that they have to click on the same button again they clicked before.
And here is my question, is there a better way to show the customers that this button should be clicked again. Are there some people who have experiences with a similar kind of functionality? Or is there a better way to do it? I'm open for every idea which comes in.
We ended up with the opinion that it is not a intuitive solution to click twice on the button. We solved it by showing the user a message after the first click on the button, and accepting that message is count as the second click. With usability in mind this i by far a better solution and the customers can handle this situation much better.

find key presses from layout controls (not entry field) in xamarin.forms

I need to find what key the user pressed on a keyboard using xamarin.forms, ideally inside an AbsoluteLayout. I've come up with a few ways myself, but can't get any of them working.
As there isn't an event for this on the AbsoluteLayout control, i tried a little cheat, which was putting an entry field (textbox) on the screen, but hiding it above, so it can't be seen and using the result from that, but it loses focus when someone presses the screen or a button on the screen. so i tried adding an event to each button which refocuses the textbox once i've handled the press and this seemed ok at first, however, if they press anywhere else on the screen, it also loses focus.
I also tried adding a TapGestureRecognizer to the screen, and focusing the button when they press anywhere on the screen, however, there were 2 issues with this, the first being that it appears to only fire when something inside it is touched, and secondly, when i call the focus method for the second time (if they click the screen twice) it un-focuses the entry field, even if i check "isfocused" first (think this is a bug).
I'm only concerned about windows 8 and android apps so far. iOS may come later, but for now im just trying to get it working for these OS's. so maybe i could code it in the windows and android projects (inside my shared project solution), however, i have absolutely no idea where to even begin doing that. I mean, if this is the best way, how can i pass my AbsoluteLayout to the windows project and get it to know what it is, and convert it into a control which i can then add the event to.
Any help or advice, or ideas would be much appreciated. I cant find anything in NuGet which will help me with this. Any ideas?
Many thanks
James

iOS Advanced Gestures: Getting Swipe Direction Vector

Looking through the documentation, it seems that the new advanced gestures API doesn't determine the direction of a swipe beyond the basic { left, right, up, down }.
I need the start point of the swipe and the direction.
Is there anyway to retrieve this other than coding my own advanced gesture library from scratch out the basic gestures?
And if this is my only option, could anyone point me to some open source code that does this?
Got it! Documentation is here, under 'Creating Custom Gesture Recognizers' at the bottom.
Basically the six gestures Apple provides all derive from UIGestureRecognizer, and you can make your own gesture recogniser in the same way.
then, inside your view's init, you hook up your recogniser. and just the act of hooking it up automatically reroutes incoming touch events.
Actually, the default behaviour is to make your recogniser an Observer of these events. Which means your view gets them as it used to, and in addition if your recogniser spots a gesture it will trigger your myCustomEventHandler method inside your view (you passed its selector when you hooked up your recogniser).
But sometimes you want to prevent the original touch events from reaching the view, and you can fiddle around in your recogniser to do that. so it's a bit misleading to think of it as an ' observer '.
There is one other scenario, where one gesture needs to eat another. Like you can't just send back a single click if your view is also primed to receive double clicks. You have to wait for the double-click recogniser to report failure. and if it is successful, you need to fail the single click -- obviously you don't want to send both back!

Resources