After adding the { 'debug_mode': true } in my gtag, debugger view is not working. Actually, I have two properties under one account. The setup is working well for old property but not for second one. What should I do
Related
I am making a game where you must open or activate the UI with the space bar. Now, this works perfectly fine, but it is pretty annoying that every time you open the UI you must click on the inputfield to write in it. Is there any way around this? So is there a way to open or activate the UI without having to click on the field to be able to write in it?
I looked for YouTube videos and tried to find similar problems in other forums, but wasn't able to find a script, nor was I able to find some Unity settings to do so.
You could use e.g.
private class SelectOnEnable : MonoBehaviour
{
private void OnEnable()
{
EventSystem.current.SetSelectedGameObject(null);
EventSystem.current.SetSelectedGameObject(gameObject);
}
}
and attach it to whatever object that should become the selected one everytime it is enabled. See EventSystem.SetSelectedGameObject
Can't test it right now but it might still require the User to hit Enter in order to also actually set the Input field into edit mode. The upper line only sets it as selected UI element (similar to using TAB in a browser).
Otherwise I think you would go through
yourInputField.DeactivateInputField()
yourInputField.ActivateInputField();
to directly set it active. See InputField.ActivateInputField. Might have to do both in combination - again can't test right now ;)
Thank you very much, derHugo! Everything works like a charm now! You saved me a lot of time. Referring to your last comment, I used both of them, and it seems to work very well for me. Here is the code I used:
`private void OnEnable()
{
EventSystem.current.SetSelectedGameObject(gameObject);
GameManager.GetComponent().inputFieldInMainUi.ActivateInputField();
EventSystem.current.SetSelectedGameObject(null);
GameManager.GetComponent<InputFieldComparision>().inputFieldInMainUi.DeactivateInputField();
}`
I have a smart home action with Thermostats. The available modes are 'on' 'off' 'heat' 'cool'. Heat and cool work fine. It's just the on/off modes that aren't working properly.
When I select the "Off" mode, it continues to show the UI as if its still in heat/cool mode as shown in the following screen shot:
https://photos.app.goo.gl/snG1hGR4y9Jb7uTi8
However if I were to look at other thermostats available from other manufacturers like Zen, it properly shows the off mode UI:
https://photos.app.goo.gl/VfeY75Bf12FLuTiaA
I can confirm Nest thermostats also display correctly. I'm just wondering what I'm doing wrong. I have verified that my home graph has updated correctly with the mode as shown in the following:
https://photos.app.goo.gl/FNvcftibihxL8uFM8
I've even tried setting a hidden field called activethermostatmode that isn't documented. Addtionally what is the 'on' mode for if you can't select it in the drop down for selecting thermostat modes in the google home app.
The UI behavior on Google Home App and the display devices are dependent on the information which comes from Report State as well as the QUERY responses. The UI will not work properly if either of the two hasn’t been implemented correctly.
You can confirm if you have implemented both correctly using Test Suite: https://smarthome-test-suite.withgoogle.com/
Let's assume that my UWP app gets suspended and it is not used for a long time. When a user opens the app again (previous ApplicationExecutionState is Suspended or Terminated), I don't want the user to be navigated to the page he/she was viewing last (it became irrelevant since then), but instead do a fresh navigation to the main page. How can I do this using Template10?
It seems that when the user returns to the app, Template10 always returns the user to the page which was being viewed last. I tried overriding the OnResuming method in App.xaml.cs, however it had no effect.
I had this problem.
I solved saving a bool property like ItWasSuspended in the LocalSettings of my app.
When the OnResumming is activated I set to True this property or when the launched event was raised I set this property false.
Finally in my pages in the OnNavigatedTo I get the value of this property if this property is true I navigate to the main page and I clear the back stack.
Here is how to use the local settings
https://msdn.microsoft.com/library/windows/apps/windows.storage.applicationdata.localsettings.aspx
you can clear the back stack doing something like this
this.Frame.BackStack.Clear();
please mark this answer if it's useful for you!
Best regards
What is the proper way to use the SDK to make a dialog (which is not anchored to the add-on bar, etc. but shows centered on screen)? It doesn't seem like there is any API for this important capability. I do see windows/utils has open but I have two problems with that:
The dialog opening seems to require "chrome" privs to get it to be centered on the screen (and I'd be expectant of add-on reviewers complaining of chrome privs, and even if not, I'd like to try to stick to the SDK way).
While I can get the DOM window reference of the new window/utils' open() dialog, I'm not sure how to attach a content script so I can respond to user interaction in a way that prompts (and can respond to) privileged behavior ala postMessage or port.emit (without again, directly working with chrome privs).
Ok, this answer should have been pretty obvious for anyone with a little experience with the SDK. I realized I can just use a panel. In my defense, the name "panel" is not as clear as "dialog" in conjuring up this idea, and I am so used to using panels with widgets, that it hadn't occurred to me that I could use it independently!
Edit
Unfortunately, as per Bug 595040, these dialogs are not persistent, meaning if the panel loses focus, the "dialog" is gone... So panel looks like it is not a suitable candidate after all... :(
Edit 2
I've since moved on and have gotten things working mostly to my satisfaction with sdk/window/utils and openDialog on whose returned window I add a load listener and then call tabs.activeTab.on('ready', and then set tabs.activeTab.url to my add-on local HTML file so the ready event will get a tab to which I can attach a worker. There is still the problem with chrome privs I suppose, but at least the main communications are using SDK processes.
Update to Edit 2:
Code sample provided by request:
var data = require('sdk/self').data,
tabs = require('sdk/tabs');
var win = require('sdk/window/utils').openDialog({
// No "url" supplied here in this case as we add it below (in order to have a ready listener in place before load which can give us access to the tab worker)
// For more, see https://developer.mozilla.org/en-US/docs/Web/API/window.open#Position_and_size_features
features: Object.keys({
chrome: true, // Needed for centerscreen per docs
centerscreen: true, // Doesn't seem to be working for some reason (even though it does work when calling via XPCOM)
resizable: true,
scrollbars: true
}).join() + ',width=850,height=650',
name: "My window name"
// parent:
// args:
});
win.addEventListener('load', function () {
tabs.activeTab.on('ready', function (tab) {
var worker = tab.attach({
contentScriptFile: ....
// ...
});
// Use worker.port.on, worker.port.emit, etc...
});
tabs.activeTab.url = data.url('myHTMLFile.html');
});
if the panel loses focus, the "dialog" is gone...
It doesn't get destroyed, just hides, right? If so, depending on why it's getting hidden, you can just call show() on it again.
You'd want to make sure it's not being hidden for a good reason before calling show again. If there's a specific situation in which it's losing focus where you don't want it to, create a listener for that situation, then call if (!panel.isShown) panel.show();
For example, if it's losing focus because a user clicks outside the box, then that's probably the expected behaviour and nothing should be done. If it's losing focus when the browser/tab loses focus, just register a tab.on('activate', aboveFunction)
Simply adding ",screenX=0,screenY=0" (or any values, the zeroes seem to be meaningless) to the features screen seems to fix centerscreen.
Working in FiddlerScript, I've got some changes being made in the OnBeforeResponse method that used to work on a different machine (now long gone) but aren't working for me now. I've boiled it down to the following basic example.
On the fiddler sandbox page, I'm trying to replace the word per item with the words per item URL: http://webdbg.com/sandbox/shop/
Fiddler script file modified from the original to have two new lines. 1 to decode the session and 1 to replace in the response as per all examples I've seen and what used to work for me.
static function OnBeforeResponse(oSession: Session) {
oSession.utilDecodeResponse(); //Added this.
oSession.utilReplaceInResponse("per item", "per item"); //Added this
if (m_Hide304s && oSession.responseCode == 304) {
oSession["ui-hide"] = "true";
}
}
After saving the above fiddlerscript file and refreshing the page, I'm not seeing the replaces show in the browser. If I look in the Fiddler inspector, I am seeing the replaces. This means that the OnBeforeResponse is indeed being called at some point and the utilReplaceInResponse is also executing.
Additional oddity, if I put breakpoints after all responses (Fiddler -> Rules -> Automatic Breakpoints -> After Responses) and refresh the page, the response hits the breakpoint as expected and I click Run to Completion and the browser does show the replacement. So: No breakpoint, page doesn't show replacements in the rendered page. With breakpoint and simply running to completion, the page does show the replacements.
Why isn't the page showing the changes in the browser even though it shows them in the Fiddler inspector, or if I have a breakpoint set?
.
SOLUTION Had the Stream option selected in the main toolbar - deselected that and it works as expected.
.
Environment: Fiddler v2.4.5.3 - 64-bit AMD64, VM: 114.00mb, WS: 132.00mb .NET 2.0.50727.5472 WinNT 6.1.7601 SP1
Seen on both IE9 and Chrome31
Solved myself.
I had the Stream option enabled in the toolbar. (Doh!) De-select that and the replacement in the OnBeforeResponse works as expected.
It may be a new Fiddler version feature, but I had to add the following line to get my find/replace to work:
oSession.utilDecodeResponse();