mirror of
https://gitlab.com/Oreolek/cloak-salet.git
synced 2024-06-30 22:05:05 +03:00
systemjs wip
This commit is contained in:
parent
9cc73f6c33
commit
a1e070ad99
|
@ -25,7 +25,8 @@ html = (target, debug) ->
|
||||||
sources.push('html/test.html')
|
sources.push('html/test.html')
|
||||||
gulp.src(sources)
|
gulp.src(sources)
|
||||||
.pipe(gulp.dest(target))
|
.pipe(gulp.dest(target))
|
||||||
gulp.src(['node_modules/salet/lib/index.min.js'])
|
#gulp.src(['node_modules/salet/lib/index.min.js'])
|
||||||
|
gulp.src(['/www/games/salet-module/lib/index.js'])
|
||||||
.pipe(rename('salet.min.js'))
|
.pipe(rename('salet.min.js'))
|
||||||
.pipe(gulp.dest(target+"/game"))
|
.pipe(gulp.dest(target+"/game"))
|
||||||
gulp.src(['node_modules/systemjs/dist/system-production.js'])
|
gulp.src(['node_modules/systemjs/dist/system-production.js'])
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
$.holdReady( true )
|
salet = SystemJS.import("./game/salet.min.js")
|
||||||
SystemJS.register("./game/salet.min.js")
|
|
||||||
SystemJS.import("./game/salet.min.js").then(() ->
|
salet.game_id = "8b0c371c-57f4-49b3-ae3c-cba07d1a9733"
|
||||||
salet.game_id = "8b0c371c-57f4-49b3-ae3c-cba07d1a9733"
|
salet.game_version = "1.0"
|
||||||
salet.game_version = "1.0"
|
salet.verbRe = /^verb\_(\w+)\_(\w+)$/
|
||||||
salet.verbRe = /^verb\_(\w+)\_(\w+)$/
|
salet.start = "menu"
|
||||||
salet.start = "menu"
|
salet.beforeAction = (room, actionId) ->
|
||||||
salet.beforeAction = (room, actionId) ->
|
|
||||||
match = salet.verbRe.exec(actionId)
|
match = salet.verbRe.exec(actionId)
|
||||||
if match? and match[1] and match[2]
|
if match? and match[1] and match[2]
|
||||||
verb = match[1]
|
verb = match[1]
|
||||||
|
@ -18,15 +17,14 @@ SystemJS.import("./game/salet.min.js").then(() ->
|
||||||
salet.view.write(i[verb].fcall(salet.rooms[room.name]))
|
salet.view.write(i[verb].fcall(salet.rooms[room.name]))
|
||||||
return true # consume the action
|
return true # consume the action
|
||||||
return false
|
return false
|
||||||
salet.afterAction = () ->
|
salet.afterAction = () ->
|
||||||
salet.character.update_sidebar()
|
salet.character.update_sidebar()
|
||||||
|
|
||||||
$.holdReady( true )
|
$.holdReady( true )
|
||||||
$.getJSON('game/translations/'+i18n.lang+'.json', (data) ->
|
$.getJSON('game/translations/'+i18n.lang+'.json', (data) ->
|
||||||
i18n.push(i18n.lang, data)
|
i18n.push(i18n.lang, data)
|
||||||
|
|
||||||
$.holdReady( false )
|
$.holdReady( false )
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
switchTab = (tabid) ->
|
switchTab = (tabid) ->
|
||||||
|
|
|
@ -1 +1,4 @@
|
||||||
|
SystemJS.register("./game/salet.min.js")
|
||||||
|
#`import {salet} from './game/salet.min.js'`
|
||||||
|
SystemJS.register("./game/main.js")
|
||||||
SystemJS.import("./game/main.js")
|
SystemJS.import("./game/main.js")
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- End of div.page -->
|
</div> <!-- End of div.page -->
|
||||||
|
|
||||||
|
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
|
||||||
<script src="game/system.js"></script>
|
<script src="game/system.js"></script>
|
||||||
<script src="game/loader.js"></script>
|
<script src="game/loader.js"></script>
|
||||||
<link rel='prefetch' href="https://togetherjs.com/togetherjs-min.js" />
|
<link rel='prefetch' href="https://togetherjs.com/togetherjs-min.js" />
|
||||||
|
|
Loading…
Reference in a new issue