질문과 답변

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 플러그인 "RS_ExitDialog.js" 에 관한 질문 2 최빛빛 2016.09.05 193
RMMV 필요할때 아이템 창을 호출하는 스크립트나 플러그인 1 겜제작광 2016.09.05 139
RMMV mv에서 무기에 전투 시 방어무시 효과를 줄 수 없을까요 5 갈릭포테이토 2016.09.06 258
RMMV 스킬에서 크리 100%는 불가능한가요? 7 잠행인 2016.09.06 243
RMMV RPG MV 전투중 오류문구.. 자바스크립트관련 1 로브남 2016.09.06 235
RMMV MV는 몇 프레임까지 지원하나요? 2 ㅇㅂㄱㄹㅇ 2016.09.06 294
RMMV 자동 대화장 어떻게 설정하나요? 1 file 벌레군 2016.09.11 488
RMMV dlc적용방법 1 file 무랭 2016.09.12 1330
RMMV 이건 어떻게 해결해야 하나요? 4 file 잠행인 2016.09.13 164
RMMV 이벤트 대기 스크립트 게임잘날아가는닝겐 2016.09.15 92
RMMV 텍스트창 투명도 3 RainLN 2016.09.16 194
RMMV VX ace용으로 만들어진 이펙트를 MV에서 사용하는법 1 잠행인 2016.09.17 129
RMMV 상태부가 "기본공격"의 효과는 뭐죠? 잠행인 2016.09.17 86
RMMV 파판14 같은 콤보스킬 7 환장 2016.09.19 233
RMMV 체험판의 흰화면에 대한 질문 입니다 2 rude 2016.09.19 237
RMMV 메인메뉴하고 게임내 메뉴 수정 못하나요? 2 대마왕vV 2016.09.24 266
RMMV MV로 2회행동 구현해보신분 있나요? 잠행인 2016.09.25 103
RMMV 파라셀러 맵핑에 관한 몇 가지 의문점들 9 잠행인 2016.09.27 291
RMMV 인앱결제 플러그인 2 잠행인 2016.09.27 194
RMMV (수정) yanfly row formation 플러그인 질문 있습니다 잠행인 2016.09.28 103
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 82 Next
/ 82