Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Closes #2626 Pico controller updates and quit confirm dialog (#3111)
Browse files Browse the repository at this point in the history
* Pico controllers update

* Pico confirm quit dialog

* Fix keys and added L/R
  • Loading branch information
keianhzo authored Apr 9, 2020
1 parent cd7e648 commit 0e24c19
Show file tree
Hide file tree
Showing 22 changed files with 10,646 additions and 78,955 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,22 @@ public void onBackPressed() {
return;
}
if (!mWindows.handleBack()) {
super.onBackPressed();
if (DeviceType.isPicoVR()) {
mWindows.getFocusedWindow().showConfirmPrompt(
getString(R.string.app_name),
getString(R.string.exit_confirm_dialog_body, getString(R.string.app_name)),
new String[]{
getString(R.string.exit_confirm_dialog_button_cancel),
getString(R.string.exit_confirm_dialog_button_quit),
}, index -> {
if (index == PromptDialogWidget.POSITIVE) {
VRBrowserActivity.super.onBackPressed();
}
});

} else {
super.onBackPressed();
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion app/src/main/cpp/BrowserWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ struct BrowserWorld::State {
rootOpaqueParent->AddNode(rootOpaque);
//rootOpaque->AddLight(light);
//rootTransparent->AddLight(light);
rootController->AddLight(light);
cullVisitor = CullVisitor::Create(create);
drawList = DrawableList::Create(create);
controllers = ControllerContainer::Create(create, rootTransparent);
Expand Down Expand Up @@ -804,6 +803,9 @@ BrowserWorld::InitializeJava(JNIEnv* aEnv, jobject& aActivity, jobject& aAssetMa
m.controllers->SetPointerColor(vrb::Color(VRBrowser::GetPointerColor()));
m.loadingAnimation->LoadModels(m.loader);
m.rootController->AddNode(m.controllers->GetRoot());
if (m.device->IsControllerLightEnabled()) {
m.rootController->AddLight(m.light);
}
#if !defined(SNAPDRAGONVR)
UpdateEnvironment();
// Don't load the env model, we are going for skyboxes in v1.0
Expand Down
1 change: 1 addition & 0 deletions app/src/main/cpp/DeviceDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class DeviceDelegate {
virtual VRLayerCubePtr CreateLayerCube(int32_t aWidth, int32_t aHeight, GLint aInternalFormat) { return nullptr; }
virtual VRLayerEquirectPtr CreateLayerEquirect(const VRLayerPtr &aSource) { return nullptr; }
virtual void DeleteLayer(const VRLayerPtr& aLayer) {};
virtual bool IsControllerLightEnabled() const { return true; }
protected:
DeviceDelegate() {}

Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1463,4 +1463,13 @@ the Select` button. When clicked it closes all the previously selected tabs -->

<!-- This string is displayed in the disable button of the quick Tracking Protection dialog, accessed from the Tracking Protection icon in the URL bar. -->
<string name="tracking_dialog_button_disable">Disable</string>

<!-- This string is displayed in the body of the confirm dialog shown in some platforms when the back button is pressed to quit the app. -->
<string name="exit_confirm_dialog_body">Are you sure you want to exit %1$s?</string>

<!-- This string is displayed in the Cancel button of the confirm dialog shown in some platforms when the back button is pressed to quit the app. -->
<string name="exit_confirm_dialog_button_cancel">Cancel</string>

<!-- This string is displayed in the Quit button of the confirm dialog shown in some platforms when the back button is pressed to quit the app. -->
<string name="exit_confirm_dialog_button_quit">Quit</string>
</resources>
12 changes: 0 additions & 12 deletions app/src/picovr/assets/g2-Controller.mtl

This file was deleted.

Loading

0 comments on commit 0e24c19

Please sign in to comment.