Mercurial > projects > mde
annotate mde/menus.d @ 137:9f035cd139c6
BIG commit. Major change: old Options class is gone, all content values are loaded and saved automatically. All options updated to reflect this, some changed.
Content restrutured a lot:
New IContent module, Content module includes more functionality.
New ContentLoader module to manage content loading/saving/translation.
Translation module moved to content dir and cut down to reflect current usage.
File format unchanged except renames: FontOptions -> Font, VideoOptions -> Screen.
Font render mode and LCD filter options are now enums.
GUI loading needs to create content (and set type for enums), but doesn't save/load value.
Some setup of mainSchedule moved to mde.mainLoop.
Content callbacks are called on content change now.
ContentLists are set up implicitly from content symbols. Not as fast but much easier!
Bug-fix in the new MTTagReader.
Renamed MT *Reader maker functions to avoid confusion in paths.d.
New mde.setup.logger module to allow logger setup before any other module's static this().
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Sat, 07 Feb 2009 12:46:03 +0000 |
parents | 9fd705793568 |
children | 6f69a9c111eb |
rev | line source |
---|---|
132
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
1 /* LICENSE BLOCK |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
2 Part of mde: a Modular D game-oriented Engine |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
3 Copyright © 2007-2008 Diggory Hardy |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
4 |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
5 This program is free software: you can redistribute it and/or modify it under |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
6 the terms of the GNU General Public License as published by the Free Software |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
7 Foundation, either version 2 of the License, or (at your option) any later version. |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
8 |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
9 This program is distributed in the hope that it will be useful, but WITHOUT ANY |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
11 PARTICULAR PURPOSE. See the GNU General Public License for more details. |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
12 |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
13 You should have received a copy of the GNU General Public License |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
15 |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
16 /****************************************************************************** |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
17 * Import this module to add some standard menus to imde.menus. |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
18 * |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
19 * Note that the widget manager also adds menu items in debug mode. |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
20 *****************************************************************************/ |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
21 module mde.menus; |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
22 |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
23 import mde.content.miscContent; |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
24 import mde.imde; |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
25 debug { |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
26 import tango.util.log.Log : Log, Logger; |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
27 private Logger logger; |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
28 static this () { |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
29 logger = Log.getLogger ("mde.menus"); |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
30 } |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
31 } |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
32 |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
33 static this () { |
137
9f035cd139c6
BIG commit. Major change: old Options class is gone, all content values are loaded and saved automatically. All options updated to reflect this, some changed.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
133
diff
changeset
|
34 auto quit = new EventContent("menus.main.quit"); |
132
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
35 quit.addCallback ((Content){ |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
36 debug logger.trace ("Quit (from menu)"); |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
37 run = false; |
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
38 }); |
133
9fd705793568
Fixed menu popup bug, improved recursion detection.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
132
diff
changeset
|
39 debug { |
137
9f035cd139c6
BIG commit. Major change: old Options class is gone, all content values are loaded and saved automatically. All options updated to reflect this, some changed.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
133
diff
changeset
|
40 new EventContent ("menus.main.a"); |
9f035cd139c6
BIG commit. Major change: old Options class is gone, all content values are loaded and saved automatically. All options updated to reflect this, some changed.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
133
diff
changeset
|
41 new EventContent ("menus.main.b"); |
9f035cd139c6
BIG commit. Major change: old Options class is gone, all content values are loaded and saved automatically. All options updated to reflect this, some changed.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
133
diff
changeset
|
42 new EventContent ("menus.main.submenu.c"); |
9f035cd139c6
BIG commit. Major change: old Options class is gone, all content values are loaded and saved automatically. All options updated to reflect this, some changed.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
133
diff
changeset
|
43 new EventContent ("menus.main.submenu.d"); |
133
9fd705793568
Fixed menu popup bug, improved recursion detection.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
132
diff
changeset
|
44 } |
132
264028f4115a
Cleaned up mde.imde and a couple of widget functions.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff
changeset
|
45 } |