-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moves CommandMapConfig and SignalMapConfig
Adds an AppConfig for storing application-level configuration data
- Loading branch information
Alec McEachran
committed
Mar 26, 2013
1 parent
bbfc10f
commit d9e8fc1
Showing
27 changed files
with
187 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package dust.app; | ||
|
||
import nme.Vector; | ||
import nme.ui.Multitouch; | ||
import dust.app.data.AppData; | ||
import minject.Injector; | ||
import dust.context.Config; | ||
|
||
class AppConfig implements Config | ||
{ | ||
@inject public var injector:Injector; | ||
|
||
public function configure() | ||
injector.mapValue(AppData, makeApp()) | ||
|
||
function makeApp():AppData | ||
{ | ||
var app = new AppData(); | ||
app.deviceWidth = Std.int(nme.system.Capabilities.screenResolutionX); | ||
app.deviceHeight = Std.int(nme.system.Capabilities.screenResolutionY); | ||
app.isMultiTouch = nme.ui.Multitouch.supportsTouchEvents; | ||
app.hasGestures = nme.ui.Multitouch.supportsGestureEvents; | ||
app.supportedGestures = toArray(nme.ui.Multitouch.supportedGestures); | ||
return app; | ||
} | ||
|
||
function toArray(list:Vector<String>):Array<String> | ||
{ | ||
var output = new Array<String>(); | ||
if (list == null) | ||
return output; | ||
|
||
for (item in list) | ||
output.push(item); | ||
return output; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package dust.app.data; | ||
|
||
class AppData | ||
{ | ||
public var deviceWidth:Int; | ||
public var deviceHeight:Int; | ||
public var isMultiTouch:Bool; | ||
public var hasGestures:Bool; | ||
public var supportedGestures:Array<String>; | ||
|
||
public function new() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/dust/app/CommandMapConfig.hx → src/dust/commands/CommandMapConfig.hx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.