From f18e13f331a52b8666dc8f29326f70f6e7e0859f Mon Sep 17 00:00:00 2001 From: rob-bateman Date: Tue, 15 May 2012 14:27:34 +0100 Subject: [PATCH] disable second chapter button --- .../flash/src/com/away3d/gloop/level/ChapterData.as | 9 ++++++++- .../flash/src/com/away3d/gloop/level/LevelDatabase.as | 4 +--- .../gloop/screens/chapterselect/ChapterSelectScreen.as | 6 ++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/development/flash/src/com/away3d/gloop/level/ChapterData.as b/development/flash/src/com/away3d/gloop/level/ChapterData.as index aa2bc50..b18d7c5 100644 --- a/development/flash/src/com/away3d/gloop/level/ChapterData.as +++ b/development/flash/src/com/away3d/gloop/level/ChapterData.as @@ -14,18 +14,25 @@ package com.away3d.gloop.level public class ChapterData extends EventDispatcher { private var _title : String; + private var _idx:uint; private var _posterUrl : String; private var _posterBitmap : Bitmap; private var _levels : Vector.; - public function ChapterData() + public function ChapterData(idx:uint) { + _idx = idx; _levels = new Vector.(); } + public function get idx() : uint + { + return _idx; + } + public function get levels() : Vector. { return _levels; diff --git a/development/flash/src/com/away3d/gloop/level/LevelDatabase.as b/development/flash/src/com/away3d/gloop/level/LevelDatabase.as index 0380f3b..1e20053 100644 --- a/development/flash/src/com/away3d/gloop/level/LevelDatabase.as +++ b/development/flash/src/com/away3d/gloop/level/LevelDatabase.as @@ -171,9 +171,7 @@ package com.away3d.gloop.level for each (chapter_xml in xml.chapter) { var chapter : ChapterData; - _numChaptersLoading++; - - chapter = new ChapterData(); + chapter = new ChapterData(_numChaptersLoading++); chapter.parseXml(chapter_xml); chapter.addEventListener(Event.COMPLETE, onChapterComplete); chapter.loadPoster(); diff --git a/development/flash/src/com/away3d/gloop/screens/chapterselect/ChapterSelectScreen.as b/development/flash/src/com/away3d/gloop/screens/chapterselect/ChapterSelectScreen.as index a7d48ac..f5c39af 100644 --- a/development/flash/src/com/away3d/gloop/screens/chapterselect/ChapterSelectScreen.as +++ b/development/flash/src/com/away3d/gloop/screens/chapterselect/ChapterSelectScreen.as @@ -138,11 +138,13 @@ package com.away3d.gloop.screens.chapterselect dx = ev.stageX - _mouseDownX; if (dx < 10 && dx > -10) { - var poster : ChapterPoster; + var poster : ChapterPoster = ChapterPoster(ev.currentTarget); + + if (poster.chapterData.idx) + return; SoundManager.play(Sounds.MENU_BUTTON); - poster = ChapterPoster(ev.currentTarget); _db.selectChapter(poster.chapterData); } }