질문과 답변

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 12393
플러그인 생성 RMMV 플러그인 관련해서 조언을 좀 얻어도 될까요? 무명시절 2022.02.19 164
RMMV 플러그인 ON / OFF를 명령어로 바꿀수있나요 ? 우월감 2016.05.12 114
RMMV 플러그인 "RS_ExitDialog.js" 에 관한 질문 2 최빛빛 2016.09.05 193
RMMV 플러그인 룰루기차 2017.12.29 71
기타 RMMV 플랫포머 낙사 구현)이거 어떻게 만들엇는지 아시는 분? 무명시절 2020.10.31 246
RMXP 플래시 삽입 스크립트 오류. 1 수프림 2014.06.19 717
기타 플래시 게임은 무슨 프로그램으로 만들져? 3 다컥스 2011.07.20 1205
사이트 이용 플래시 게임 플래시 다운 2 근희 2012.01.13 2634
RMXP 플래쉬파일 재생이 안돼요ㅠㅠㅠ file 호호홀 2011.08.17 1681
RMVX 프린세스 메이커 같은 육성 게임 스크립트 있나요? 2 승비 2012.04.01 4058
기타 프리서버 구축방법 2 곰테니 2011.01.28 3883
라이선스 기타 프리게임에 사용할 음악 저작권에 대해서 궁금한 점이 있습니다 3 큐브릭 2015.02.09 529
RMVX 프롤로그를 만들엇는데... 4 백버들 2011.01.11 683
이벤트 작성 RMMV 프롤로그를 만들려고 하는데 검은 화면만 뜹니다. 5 file 이나다 2019.03.03 285
RMVXA 프롤로그(맵스크롤 및) 6 혲이 2014.01.30 575
RMXP 프롤로그 응용? 3 비냉 2010.12.28 731
RMXP 프롤로그 어떻게 만들어요? 3 삐리빠빠 2012.06.16 1567
RMVX 프롤로그 병렬처리에 문제 5 file 지나가는떡꼬치 2012.02.24 1956
RMXP 프롤로그 만드는법좀 알려주세요..ㅜ 2 아뚱 2011.03.10 1568
RMXP 프롤로그 돋네 2 신케 2010.11.03 814
Board Pagination Prev 1 ... 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ... 516 Next
/ 516