질문과 답변

Extra Form

 /*:

 * RS_ExitDialog.js

 * @plugindesc RS_ExitDialog.js

 * @author biud436

 *

 * @param Dialog Name

 * @desc Information Dialog

 * @default Information Dialog

 *

 * @param Show Custom Dialog Name

 * @desc Show Custom Dialog Name

 * @default false

 *

 * @param Exit Message

 * @desc Exit Message

 * @default Do you want to exit the game?

 *

 * @param OK Button

 * @desc OK Button's Name

 * @default OK

 *

 * @param Cancel Button

 * @desc Cancel Button's Name

 * @default Cancel

 *

 * @help

 *

 * =============================================================================

 * Plugin Commands

 * =============================================================================

 * This plugin does not provide plugin commands

 *

 * =============================================================================

 * Setup

 * =============================================================================

 * 1. Add the Notification plugin(cordova-plugin-dialogs) on Intel XDK.

 * 2. Edit an index.html file in your Game Directory using Text Editor such as Notepad++

 * You have to contain Cordova Script into <body> statement, It looks like this.

 *       ...

 *     <body style="background-color: black">

 *       <script type="text/javascript" src="cordova.js"></script>

 *       <script type="text/javascript" src="js/libs/pixi.js"></script>

 *       ...

 *     </body>

 * =============================================================================

 * Change Log

 * =============================================================================

 * 2016.05.29 - The incorrect character fixed.

 */


(function() {


  var parameters = PluginManager.parameters('RS_ExitDialog');

  var message = String(parameters['Exit Message'] || "Do you want to exit the game?" );

  var okBtn = String(parameters['OK Button'] || "OK" );

  var cancelBtn = String(parameters['Cancel Button'] || "Cancel" );

  var dialogName = String(parameters['Dialog Name'] || "Information Dialog" );

  var isCustomDialog = Boolean(parameters['Show Custom Dialog Name'] === 'true')


  document.addEventListener("deviceready", onDeviceReady, false);


  function onDeviceReady() {

      document.addEventListener("backbutton", SceneManager.detectScene, false);

  }


  function onBackKeyDown() {

      if(!Utils.isMobileDevice) return false;

      if(!isCustomDialog) dialogName = $dataSystem.gameTitle || "Information Dialog";

      navigator.notification.confirm(message, function(index) {

          if(index === 1) {

              SceneManager.exit();

          }

      }, dialogName, [okBtn, cancelBtn]);

  }


  SceneManager.detectScene = function() {

      if(SceneManager._scene instanceof Scene_Map) {

        SceneManager.goto(Scene_Title);

      } else if(SceneManager._scene instanceof Scene_Title) {

        onBackKeyDown();

      } else {

        SceneManager._scene.popScene();

      }

  }


})();


----------------------------------------------------------------------------------

 

 현재 이 플러그인을 사용하고있는데 모바일 디바이스에서 취소키를 누르면 반드시 타이틀 화면을 거쳐서

 어플을 종료할거냐고 묻는데, 이 과정에서 타이틀 화면을 안 거치고 어디서든 취소키를 입력해서

 어플을 종료할거냐 물어보도록 수정하는 방법이 궁금합니다.

Who's 최빛빛

profile
Choi Bling-Bling
[Dream Project]
[2015 Project: Arena Dream Match]
[2016 Project: 포켓브리더]
Comment '2'

List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12452
RMVX 인터페이스(메뉴 스킨) 설명 7 file 뻘짓킹파야 2013.11.09 1233
RMVXA 인터페이스, 원도우 시스템을 바꿀순 없나요? 5 안안녕 2013.01.26 708
기타 인텔xdk 배포 문제 2 [team]ㅎㅅㅎ 2017.05.08 151
RMMV 인트로 영상을 넣고싶은데.... 4 file 히요리 2016.02.28 287
RMVXA 인트로가 있는 BGM을 특정부분 루프 시키려면? 3 봅쓸레이드 2013.09.19 1095
RMXP 일괄변수를 나타내는 스크립트 언어 질문!! 까멸 2012.03.29 2535
RMVXA 일괄적으로 이벤트의 이동처리는 안되나요? 9 Sonrxnu 2016.02.06 186
RMXP 일러스트 대화창 1 가츄 2010.11.28 825
RMVXA 일러스트 대화창 뒤로 가게 하는 방법이요. 10 file 은이하롄 2018.02.22 1395
기타 일러스트 모아둔 사이트 질문 inone98 2014.01.08 907
툴선택 일러스트 위주로 활동하시는 분들~ 알려주세요 15 한련 2014.01.02 1109
RMVX 일러스트 테두리 질문 드립니다 6 file 나미요 2011.09.21 2080
RMXP 일러스트그림을게임배경으로하고싶은데요 1 barojabnun 2015.03.07 315
기타 일러스트캐릭터칩하반신이잘려요 1 barojabnun 2015.02.07 292
RMMV 일반 Actor 이벤트가 공격하게 만드는 법이 있을까요 1 빠밀 2016.08.24 110
RMMV 일반 공격을 마법 피해식으로 바꿀 수 있을까요? 2 DogeMadness 2017.07.10 148
이벤트 작성 RMMZ 일반 이벤트가 두번 이상 확인해야 진행됩니다. 1 file blahdi 2024.02.11 33
RMXP 일반 초원맵칩에서요 1 인간아님 2010.12.20 666
RMVX 일반 필드에서 몬스터 사냥하는 방법 질문 4 흐므 2013.02.13 722
RMVXA 일반공격시 사용자의 체력을 소모하는 무기 옹지 2014.02.28 586
Board Pagination Prev 1 ... 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 ... 516 Next
/ 516