commit 74e0680841e0d235caf1d2b1a4ac6da64c50a40c Author: Anuken Date: Sat Apr 29 21:25:59 2017 -0400 Initial upload diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..5814594b60 --- /dev/null +++ b/.gitignore @@ -0,0 +1,114 @@ +## Java + +*.class +*.war +*.ear +hs_err_pid* + +## Robovm +/ios/robovm-build/ + +## GWT +/html/war/ +/html/gwt-unitCache/ +.apt_generated/ +.gwt/ +gwt-unitCache/ +www-test/ +.gwt-tmp/ + +## Android Studio and Intellij and Android in general +/android/libs/armeabi/ +/android/libs/armeabi-v7a/ +/android/libs/arm64-v8a/ +/android/libs/x86/ +/android/libs/x86_64/ +/android/gen/ +.idea/ +*.ipr +*.iws +*.iml +/android/out/ +com_crashlytics_export_strings.xml + +## Eclipse + +.classpath +.project +.metadata/ +/android/bin/ +/core/bin/ +/desktop/bin/ +/html/bin/ +/ios/bin/ +/ios-moe/bin/ +*.tmp +*.bak +*.swp +*~.nib +.settings/ +.loadpath +.externalToolBuilders/ +*.launch + +## NetBeans + +/nbproject/private/ +/android/nbproject/private/ +/core/nbproject/private/ +/desktop/nbproject/private/ +/html/nbproject/private/ +/ios/nbproject/private/ +/ios-moe/nbproject/private/ + +/build/ +/android/build/ +/core/build/ +/desktop/build/ +/html/build/ +/ios/build/ +/ios-moe/build/ + +/nbbuild/ +/android/nbbuild/ +/core/nbbuild/ +/desktop/nbbuild/ +/html/nbbuild/ +/ios/nbbuild/ +/ios-moe/nbbuild/ + +/dist/ +/android/dist/ +/core/dist/ +/desktop/dist/ +/html/dist/ +/ios/dist/ +/ios-moe/dist/ + +/nbdist/ +/android/nbdist/ +/core/nbdist/ +/desktop/nbdist/ +/html/nbdist/ +/ios/nbdist/ +/ios-moe/nbdist/ + +nbactions.xml +nb-configuration.xml + +## Gradle + +/local.properties +.gradle/ +gradle-app.setting +/build/ +/android/build/ +/core/build/ +/desktop/build/ +/html/build/ +/ios/build/ +/ios-moe/build/ + +## OS Specific +.DS_Store +Thumbs.db diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000000..2668d79314 --- /dev/null +++ b/build.gradle @@ -0,0 +1,68 @@ +buildscript { + repositories { + mavenLocal() + mavenCentral() + maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } + jcenter() + } + dependencies { + classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6' + } +} + +allprojects { + apply plugin: "eclipse" + apply plugin: "idea" + + version = '1.0' + ext { + appName = "Moment" + gdxVersion = '1.9.6' + } + + repositories { + mavenLocal() + mavenCentral() + maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } + maven { url "https://oss.sonatype.org/content/repositories/releases/" } + } +} + +project(":desktop") { + apply plugin: "java" + + + dependencies { + compile project(":core") + compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" + compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" + + } +} + +project(":html") { + apply plugin: "gwt" + apply plugin: "war" + + + dependencies { + compile project(":core") + compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion" + compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources" + compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources" + } +} + +project(":core") { + apply plugin: "java" + + + dependencies { + compile "com.badlogicgames.gdx:gdx:$gdxVersion" + compile "com.badlogicgames.gdx:gdx-ai:1.8.1" + } +} + +tasks.eclipse.doLast { + delete ".project" +} diff --git a/core/assets/maps/map.png b/core/assets/maps/map.png new file mode 100644 index 0000000000..80ec87b523 Binary files /dev/null and b/core/assets/maps/map.png differ diff --git a/core/assets/sprites/moment.atlas b/core/assets/sprites/moment.atlas new file mode 100644 index 0000000000..68e612280f --- /dev/null +++ b/core/assets/sprites/moment.atlas @@ -0,0 +1,328 @@ + +moment.png +size: 256,32 +format: RGBA8888 +filter: Nearest,Nearest +repeat: none +block + rotate: false + xy: 57, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +bullet + rotate: false + xy: 67, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +coal1 + rotate: false + xy: 77, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +coal2 + rotate: false + xy: 87, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +coal3 + rotate: false + xy: 97, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +coaldrill + rotate: false + xy: 107, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +conveyor + rotate: false + xy: 117, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +conveyormove + rotate: false + xy: 127, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +core + rotate: false + xy: 137, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +dirt1 + rotate: false + xy: 147, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +dirt2 + rotate: false + xy: 157, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +dirt3 + rotate: false + xy: 167, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +dirtblock + rotate: false + xy: 177, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +doubleturret + rotate: false + xy: 1, 1 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +drill + rotate: false + xy: 187, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +furnace + rotate: false + xy: 197, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +smelter + rotate: false + xy: 197, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +grass + rotate: false + xy: 207, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +healturret + rotate: false + xy: 13, 1 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-coal + rotate: false + xy: 217, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +icon-iron + rotate: false + xy: 227, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +icon-steel + rotate: false + xy: 237, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +icon-stone + rotate: false + xy: 247, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +iron1 + rotate: false + xy: 25, 11 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +iron2 + rotate: false + xy: 25, 1 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +iron3 + rotate: false + xy: 35, 11 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +irondrill + rotate: false + xy: 35, 1 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +ironwall + rotate: false + xy: 45, 11 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +laser + rotate: false + xy: 55, 7 + size: 1, 12 + orig: 1, 12 + offset: 0, 0 + index: -1 +laserend + rotate: false + xy: 1, 13 + size: 18, 18 + orig: 18, 18 + offset: 0, 0 + index: -1 +machineturret + rotate: false + xy: 21, 21 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +mech1 + rotate: false + xy: 45, 1 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +player + rotate: false + xy: 58, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +router + rotate: false + xy: 68, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +shadow + rotate: false + xy: 33, 21 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +steelconveyor + rotate: false + xy: 78, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +steelconveyormove + rotate: false + xy: 88, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +stone + rotate: false + xy: 98, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +stone1 + rotate: false + xy: 108, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +stone2 + rotate: false + xy: 118, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +stone3 + rotate: false + xy: 128, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +stoneblock + rotate: false + xy: 138, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +stonedrill + rotate: false + xy: 148, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +stonedrillhead + rotate: false + xy: 148, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +stonewall + rotate: false + xy: 158, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +turret + rotate: false + xy: 45, 21 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 diff --git a/core/assets/sprites/moment.png b/core/assets/sprites/moment.png new file mode 100644 index 0000000000..4de7a74884 Binary files /dev/null and b/core/assets/sprites/moment.png differ diff --git a/core/assets/ui/backup/uiskin.atlas b/core/assets/ui/backup/uiskin.atlas new file mode 100644 index 0000000000..df299190ff --- /dev/null +++ b/core/assets/ui/backup/uiskin.atlas @@ -0,0 +1,745 @@ + +uiskin.png +size: 512,512 +format: RGBA8888 +filter: Nearest,Nearest +repeat: none +border + rotate: false + xy: 90, 65 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +border-circle + rotate: false + xy: 256, 85 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +border-circle-error + rotate: false + xy: 285, 85 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +border-dark-blue + rotate: false + xy: 407, 85 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +border-error + rotate: false + xy: 130, 3 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +button + rotate: false + xy: 372, 41 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-blue + rotate: false + xy: 272, 14 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-down + rotate: false + xy: 272, 14 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-blue-down + rotate: false + xy: 222, 14 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-blue-over + rotate: false + xy: 247, 14 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-over + rotate: false + xy: 297, 15 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-red + rotate: false + xy: 322, 15 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-window-bg + rotate: false + xy: 347, 15 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +check-off + rotate: false + xy: 314, 85 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +textfield + rotate: false + xy: 314, 85 + size: 28, 28 + split: 2, 2, 2, 2 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-check + rotate: false + xy: 314, 85 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +check-on + rotate: false + xy: 343, 85 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +color-picker-bar-selector + rotate: false + xy: 496, 85 + size: 14, 28 + orig: 14, 28 + offset: 0, 0 + index: -1 +color-picker-cross + rotate: false + xy: 411, 47 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +color-picker-selector-horizontal + rotate: false + xy: 22, 27 + size: 6, 1 + orig: 6, 1 + offset: 0, 0 + index: -1 +color-picker-selector-vertical + rotate: false + xy: 1, 1 + size: 1, 6 + orig: 1, 6 + offset: 0, 0 + index: -1 +cursor + rotate: false + xy: 97, 30 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +default + rotate: false + xy: 1, 279 + size: 510, 232 + orig: 512, 256 + offset: 0, 24 + index: -1 +default-pane + rotate: false + xy: 84, 65 + size: 5, 3 + split: 1, 1, 1, 1 + orig: 5, 3 + offset: 0, 0 + index: -1 +default-pane-no-border + rotate: false + xy: 397, 45 + size: 1, 1 + split: 0, 0, 0, 0 + orig: 1, 1 + offset: 0, 0 + index: -1 +default-select + rotate: false + xy: 29, 65 + size: 54, 48 + split: 8, 32, 0, 48 + orig: 54, 48 + offset: 0, 0 + index: -1 +default-select-selection + rotate: false + xy: 134, 3 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +font-small + rotate: false + xy: 1, 114 + size: 509, 164 + orig: 512, 256 + offset: 0, 91 + index: -1 +grey + rotate: false + xy: 196, 52 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +menu-bg + rotate: false + xy: 196, 52 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +icon-arrow-left + rotate: false + xy: 29, 1 + size: 36, 28 + orig: 44, 44 + offset: 4, 8 + index: -1 +icon-arrow-right + rotate: false + xy: 66, 1 + size: 36, 28 + orig: 44, 44 + offset: 4, 8 + index: -1 +icon-close + rotate: false + xy: 1, 8 + size: 20, 20 + orig: 44, 44 + offset: 12, 12 + index: -1 +icon-drive + rotate: false + xy: 222, 3 + size: 36, 10 + orig: 44, 44 + offset: 4, 18 + index: -1 +icon-file-audio + rotate: false + xy: 97, 32 + size: 28, 36 + orig: 44, 44 + offset: 8, 4 + index: -1 +icon-file-image + rotate: false + xy: 103, 1 + size: 26, 30 + orig: 44, 44 + offset: 9, 7 + index: -1 +icon-file-pdf + rotate: false + xy: 68, 30 + size: 28, 34 + orig: 44, 44 + offset: 8, 5 + index: -1 +icon-file-text + rotate: false + xy: 372, 10 + size: 26, 30 + orig: 44, 44 + offset: 9, 7 + index: -1 +icon-folder + rotate: false + xy: 372, 89 + size: 32, 24 + orig: 44, 44 + offset: 6, 12 + index: -1 +icon-folder-new + rotate: false + xy: 220, 84 + size: 35, 29 + orig: 44, 44 + offset: 5, 7 + index: -1 +icon-folder-parent + rotate: false + xy: 405, 89 + size: 32, 24 + orig: 44, 44 + offset: 6, 12 + index: -1 +icon-folder-star + rotate: false + xy: 185, 54 + size: 34, 26 + orig: 44, 44 + offset: 5, 9 + index: -1 +icon-list-settings + rotate: false + xy: 29, 30 + size: 38, 34 + orig: 44, 44 + offset: 5, 3 + index: -1 +icon-refresh + rotate: false + xy: 411, 58 + size: 26, 30 + orig: 44, 44 + offset: 9, 7 + index: -1 +icon-star + rotate: false + xy: 220, 55 + size: 30, 28 + orig: 44, 44 + offset: 7, 8 + index: -1 +icon-star-outline + rotate: false + xy: 185, 81 + size: 34, 32 + orig: 44, 44 + offset: 5, 6 + index: -1 +icon-trash + rotate: false + xy: 438, 54 + size: 24, 30 + orig: 44, 44 + offset: 10, 7 + index: -1 +list-selection + rotate: false + xy: 126, 34 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +vis-blue + rotate: false + xy: 126, 34 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +padded-list-selection + rotate: false + xy: 185, 52 + size: 10, 1 + split: 4, 4, 0, 1 + orig: 10, 1 + offset: 0, 0 + index: -1 +progressbar + rotate: false + xy: 126, 36 + size: 1, 32 + orig: 1, 32 + offset: 0, 0 + index: -1 +progressbar-filled + rotate: false + xy: 399, 14 + size: 1, 32 + orig: 1, 32 + offset: 0, 0 + index: -1 +progressbar-filled-vertical + rotate: false + xy: 130, 1 + size: 32, 1 + orig: 32, 1 + offset: 0, 0 + index: -1 +progressbar-vertical + rotate: false + xy: 259, 5 + size: 32, 1 + orig: 32, 1 + offset: 0, 0 + index: -1 +radio-off + rotate: false + xy: 438, 85 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-radio + rotate: false + xy: 438, 85 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +radio-on + rotate: false + xy: 467, 85 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +scroll + rotate: false + xy: 372, 82 + size: 34, 6 + split: 4, 4, 2, 2 + orig: 34, 6 + offset: 0, 0 + index: -1 +scroll-horizontal + rotate: false + xy: 397, 47 + size: 6, 34 + split: 2, 2, 0, 34 + pad: -1, -1, 5, 4 + orig: 6, 34 + offset: 0, 0 + index: -1 +scroll-knob-horizontal + rotate: false + xy: 404, 47 + size: 6, 34 + split: 2, 2, 0, 34 + pad: -1, -1, 13, 12 + orig: 6, 34 + offset: 0, 0 + index: -1 +scroll-knob-vertical + rotate: false + xy: 259, 7 + size: 34, 6 + split: 12, 12, 2, 2 + orig: 34, 6 + offset: 0, 0 + index: -1 +select-box-list-bg + rotate: false + xy: 126, 32 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +window-bg + rotate: false + xy: 126, 32 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +select-down + rotate: false + xy: 478, 56 + size: 14, 8 + orig: 14, 8 + offset: 0, 0 + index: -1 +select-up + rotate: false + xy: 422, 49 + size: 14, 8 + orig: 14, 8 + offset: 0, 0 + index: -1 +selection + rotate: false + xy: 128, 32 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +separator + rotate: false + xy: 99, 30 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +tree-over + rotate: false + xy: 99, 30 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +separator-menu + rotate: false + xy: 101, 30 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +slider + rotate: false + xy: 128, 43 + size: 1, 8 + orig: 1, 8 + offset: 0, 0 + index: -1 +slider-knob + rotate: false + xy: 130, 7 + size: 22, 44 + orig: 22, 44 + offset: 0, 0 + index: -1 +slider-knob-disabled + rotate: false + xy: 153, 7 + size: 22, 44 + orig: 22, 44 + offset: 0, 0 + index: -1 +slider-knob-down + rotate: false + xy: 176, 7 + size: 22, 44 + orig: 22, 44 + offset: 0, 0 + index: -1 +slider-knob-over + rotate: false + xy: 199, 9 + size: 22, 44 + orig: 22, 44 + offset: 0, 0 + index: -1 +slider-vertical + rotate: false + xy: 422, 47 + size: 8, 1 + orig: 8, 1 + offset: 0, 0 + index: -1 +splitpane + rotate: false + xy: 503, 68 + size: 8, 1 + orig: 8, 1 + offset: 0, 0 + index: -1 +splitpane-over + rotate: false + xy: 503, 66 + size: 8, 1 + orig: 8, 1 + offset: 0, 0 + index: -1 +splitpane-vertical + rotate: false + xy: 128, 34 + size: 1, 8 + orig: 1, 8 + offset: 0, 0 + index: -1 +splitpane-vertical-over + rotate: false + xy: 367, 76 + size: 1, 8 + orig: 1, 8 + offset: 0, 0 + index: -1 +sub-menu + rotate: false + xy: 503, 70 + size: 8, 14 + orig: 8, 14 + offset: 0, 0 + index: -1 +textfield-over + rotate: false + xy: 251, 55 + size: 28, 28 + split: 2, 2, 2, 2 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-check-over + rotate: false + xy: 251, 55 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +tooltip-bg + rotate: false + xy: 138, 3 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +touchpad-knob + rotate: false + xy: 84, 69 + size: 44, 44 + orig: 44, 44 + offset: 0, 0 + index: -1 +tree-minus + rotate: false + xy: 414, 36 + size: 10, 10 + orig: 16, 16 + offset: 2, 4 + index: -1 +tree-plus + rotate: false + xy: 401, 30 + size: 12, 16 + orig: 16, 16 + offset: 2, 0 + index: -1 +tree-selection + rotate: false + xy: 142, 3 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +vis-check-down + rotate: false + xy: 280, 56 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-check-tick + rotate: false + xy: 463, 65 + size: 19, 19 + orig: 28, 28 + offset: 5, 4 + index: -1 +vis-check-tick-disabled + rotate: false + xy: 483, 65 + size: 19, 19 + orig: 28, 28 + offset: 5, 4 + index: -1 +vis-radio-down + rotate: false + xy: 309, 56 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-radio-over + rotate: false + xy: 338, 56 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-radio-tick + rotate: false + xy: 401, 15 + size: 14, 14 + orig: 28, 28 + offset: 7, 7 + index: -1 +vis-radio-tick-disabled + rotate: false + xy: 463, 50 + size: 14, 14 + orig: 28, 28 + offset: 7, 7 + index: -1 +vis-red + rotate: false + xy: 397, 43 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +white + rotate: false + xy: 146, 3 + size: 3, 3 + orig: 3, 3 + offset: 0, 0 + index: -1 +window + rotate: false + xy: 157, 52 + size: 27, 61 + split: 5, 4, 53, 3 + orig: 27, 61 + offset: 0, 0 + index: -1 +window-border-bg + rotate: false + xy: 150, 3 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +window-noborder + rotate: false + xy: 129, 52 + size: 27, 61 + split: 5, 4, 53, 3 + orig: 27, 61 + offset: 0, 0 + index: -1 +window-resizable + rotate: false + xy: 1, 29 + size: 27, 84 + split: 3, 19, 2, 20 + pad: 5, 5, 50, 7 + orig: 27, 84 + offset: 0, 0 + index: -1 diff --git a/core/assets/ui/backup/uiskin.png b/core/assets/ui/backup/uiskin.png new file mode 100644 index 0000000000..37b09447cd Binary files /dev/null and b/core/assets/ui/backup/uiskin.png differ diff --git a/core/assets/ui/out/blank.png b/core/assets/ui/out/blank.png new file mode 100644 index 0000000000..b2f9501f47 Binary files /dev/null and b/core/assets/ui/out/blank.png differ diff --git a/core/assets/ui/out/border-circle-error.png b/core/assets/ui/out/border-circle-error.png new file mode 100644 index 0000000000..6aaeb4ecba Binary files /dev/null and b/core/assets/ui/out/border-circle-error.png differ diff --git a/core/assets/ui/out/border-circle.png b/core/assets/ui/out/border-circle.png new file mode 100644 index 0000000000..1d9c9bb057 Binary files /dev/null and b/core/assets/ui/out/border-circle.png differ diff --git a/core/assets/ui/out/border-dark-blue.9.png b/core/assets/ui/out/border-dark-blue.9.png new file mode 100644 index 0000000000..59a7443282 Binary files /dev/null and b/core/assets/ui/out/border-dark-blue.9.png differ diff --git a/core/assets/ui/out/border-error.9.png b/core/assets/ui/out/border-error.9.png new file mode 100644 index 0000000000..996a663927 Binary files /dev/null and b/core/assets/ui/out/border-error.9.png differ diff --git a/core/assets/ui/out/border-white.9.png b/core/assets/ui/out/border-white.9.png new file mode 100644 index 0000000000..e5d219eef9 Binary files /dev/null and b/core/assets/ui/out/border-white.9.png differ diff --git a/core/assets/ui/out/border.9.png b/core/assets/ui/out/border.9.png new file mode 100644 index 0000000000..6e0dea69e0 Binary files /dev/null and b/core/assets/ui/out/border.9.png differ diff --git a/core/assets/ui/out/bump.9.png b/core/assets/ui/out/bump.9.png new file mode 100644 index 0000000000..12a1b3d66b Binary files /dev/null and b/core/assets/ui/out/bump.9.png differ diff --git a/core/assets/ui/out/button-blue-down.9.png b/core/assets/ui/out/button-blue-down.9.png new file mode 100644 index 0000000000..bd14b14179 Binary files /dev/null and b/core/assets/ui/out/button-blue-down.9.png differ diff --git a/core/assets/ui/out/button-blue-over.9.png b/core/assets/ui/out/button-blue-over.9.png new file mode 100644 index 0000000000..071dc99259 Binary files /dev/null and b/core/assets/ui/out/button-blue-over.9.png differ diff --git a/core/assets/ui/out/button-blue.9.png b/core/assets/ui/out/button-blue.9.png new file mode 100644 index 0000000000..7364829a7a Binary files /dev/null and b/core/assets/ui/out/button-blue.9.png differ diff --git a/core/assets/ui/out/button-down.9.png b/core/assets/ui/out/button-down.9.png new file mode 100644 index 0000000000..a60a4eddbf Binary files /dev/null and b/core/assets/ui/out/button-down.9.png differ diff --git a/core/assets/ui/out/button-gray-over.9.png b/core/assets/ui/out/button-gray-over.9.png new file mode 100644 index 0000000000..31a904acba Binary files /dev/null and b/core/assets/ui/out/button-gray-over.9.png differ diff --git a/core/assets/ui/out/button-gray.9.png b/core/assets/ui/out/button-gray.9.png new file mode 100644 index 0000000000..d47e70b84f Binary files /dev/null and b/core/assets/ui/out/button-gray.9.png differ diff --git a/core/assets/ui/out/button-over.9.png b/core/assets/ui/out/button-over.9.png new file mode 100644 index 0000000000..e9a6e1bfbd Binary files /dev/null and b/core/assets/ui/out/button-over.9.png differ diff --git a/core/assets/ui/out/button-red.9.png b/core/assets/ui/out/button-red.9.png new file mode 100644 index 0000000000..1bebf700e4 Binary files /dev/null and b/core/assets/ui/out/button-red.9.png differ diff --git a/core/assets/ui/out/button-window-bg.9.png b/core/assets/ui/out/button-window-bg.9.png new file mode 100644 index 0000000000..564a70a904 Binary files /dev/null and b/core/assets/ui/out/button-window-bg.9.png differ diff --git a/core/assets/ui/out/button-window-over.9.png b/core/assets/ui/out/button-window-over.9.png new file mode 100644 index 0000000000..2e45f28378 Binary files /dev/null and b/core/assets/ui/out/button-window-over.9.png differ diff --git a/core/assets/ui/out/button.9.png b/core/assets/ui/out/button.9.png new file mode 100644 index 0000000000..3894b3c76b Binary files /dev/null and b/core/assets/ui/out/button.9.png differ diff --git a/core/assets/ui/out/check-off.png b/core/assets/ui/out/check-off.png new file mode 100644 index 0000000000..fb891f7921 Binary files /dev/null and b/core/assets/ui/out/check-off.png differ diff --git a/core/assets/ui/out/check-on.png b/core/assets/ui/out/check-on.png new file mode 100644 index 0000000000..cbe240e4a6 Binary files /dev/null and b/core/assets/ui/out/check-on.png differ diff --git a/core/assets/ui/out/color-picker-bar-selector.png b/core/assets/ui/out/color-picker-bar-selector.png new file mode 100644 index 0000000000..84e626e0e2 Binary files /dev/null and b/core/assets/ui/out/color-picker-bar-selector.png differ diff --git a/core/assets/ui/out/color-picker-cross.png b/core/assets/ui/out/color-picker-cross.png new file mode 100644 index 0000000000..70489c4919 Binary files /dev/null and b/core/assets/ui/out/color-picker-cross.png differ diff --git a/core/assets/ui/out/color-picker-selector-horizontal.png b/core/assets/ui/out/color-picker-selector-horizontal.png new file mode 100644 index 0000000000..8b6025462f Binary files /dev/null and b/core/assets/ui/out/color-picker-selector-horizontal.png differ diff --git a/core/assets/ui/out/color-picker-selector-vertical.png b/core/assets/ui/out/color-picker-selector-vertical.png new file mode 100644 index 0000000000..c36d51297c Binary files /dev/null and b/core/assets/ui/out/color-picker-selector-vertical.png differ diff --git a/core/assets/ui/out/cursor-normal.png b/core/assets/ui/out/cursor-normal.png new file mode 100644 index 0000000000..7724fe99db Binary files /dev/null and b/core/assets/ui/out/cursor-normal.png differ diff --git a/core/assets/ui/out/cursor.png b/core/assets/ui/out/cursor.png new file mode 100644 index 0000000000..67ff25cb9a Binary files /dev/null and b/core/assets/ui/out/cursor.png differ diff --git a/core/assets/ui/out/default-pane-no-border.9.png b/core/assets/ui/out/default-pane-no-border.9.png new file mode 100644 index 0000000000..d2c3e66a49 Binary files /dev/null and b/core/assets/ui/out/default-pane-no-border.9.png differ diff --git a/core/assets/ui/out/default-pane.9.png b/core/assets/ui/out/default-pane.9.png new file mode 100644 index 0000000000..6ff8c37650 Binary files /dev/null and b/core/assets/ui/out/default-pane.9.png differ diff --git a/core/assets/ui/out/default-select-selection.9.png b/core/assets/ui/out/default-select-selection.9.png new file mode 100644 index 0000000000..faa20b6bb8 Binary files /dev/null and b/core/assets/ui/out/default-select-selection.9.png differ diff --git a/core/assets/ui/out/default-select.9.png b/core/assets/ui/out/default-select.9.png new file mode 100644 index 0000000000..c837c8313e Binary files /dev/null and b/core/assets/ui/out/default-select.9.png differ diff --git a/core/assets/ui/out/grey.png b/core/assets/ui/out/grey.png new file mode 100644 index 0000000000..d57b4a1bb5 Binary files /dev/null and b/core/assets/ui/out/grey.png differ diff --git a/core/assets/ui/out/icon-arrow-down.png b/core/assets/ui/out/icon-arrow-down.png new file mode 100644 index 0000000000..f2d8a31be4 Binary files /dev/null and b/core/assets/ui/out/icon-arrow-down.png differ diff --git a/core/assets/ui/out/icon-arrow-left.png b/core/assets/ui/out/icon-arrow-left.png new file mode 100644 index 0000000000..6b09154e22 Binary files /dev/null and b/core/assets/ui/out/icon-arrow-left.png differ diff --git a/core/assets/ui/out/icon-arrow-right.png b/core/assets/ui/out/icon-arrow-right.png new file mode 100644 index 0000000000..cd82e8422f Binary files /dev/null and b/core/assets/ui/out/icon-arrow-right.png differ diff --git a/core/assets/ui/out/icon-arrow-up.png b/core/assets/ui/out/icon-arrow-up.png new file mode 100644 index 0000000000..a87cf43249 Binary files /dev/null and b/core/assets/ui/out/icon-arrow-up.png differ diff --git a/core/assets/ui/out/icon-close-down.png b/core/assets/ui/out/icon-close-down.png new file mode 100644 index 0000000000..58a206c3c2 Binary files /dev/null and b/core/assets/ui/out/icon-close-down.png differ diff --git a/core/assets/ui/out/icon-close-over.png b/core/assets/ui/out/icon-close-over.png new file mode 100644 index 0000000000..81065299f4 Binary files /dev/null and b/core/assets/ui/out/icon-close-over.png differ diff --git a/core/assets/ui/out/icon-close.png b/core/assets/ui/out/icon-close.png new file mode 100644 index 0000000000..02b26e0a25 Binary files /dev/null and b/core/assets/ui/out/icon-close.png differ diff --git a/core/assets/ui/out/icon-copy.png b/core/assets/ui/out/icon-copy.png new file mode 100644 index 0000000000..a3fa5cdeb3 Binary files /dev/null and b/core/assets/ui/out/icon-copy.png differ diff --git a/core/assets/ui/out/icon-cursor.png b/core/assets/ui/out/icon-cursor.png new file mode 100644 index 0000000000..19d494f22e Binary files /dev/null and b/core/assets/ui/out/icon-cursor.png differ diff --git a/core/assets/ui/out/icon-dots-down.png b/core/assets/ui/out/icon-dots-down.png new file mode 100644 index 0000000000..3aeebb694a Binary files /dev/null and b/core/assets/ui/out/icon-dots-down.png differ diff --git a/core/assets/ui/out/icon-dots.png b/core/assets/ui/out/icon-dots.png new file mode 100644 index 0000000000..84c19e8d40 Binary files /dev/null and b/core/assets/ui/out/icon-dots.png differ diff --git a/core/assets/ui/out/icon-down.png b/core/assets/ui/out/icon-down.png new file mode 100644 index 0000000000..fffbf7e3a1 Binary files /dev/null and b/core/assets/ui/out/icon-down.png differ diff --git a/core/assets/ui/out/icon-drive.png b/core/assets/ui/out/icon-drive.png new file mode 100644 index 0000000000..06ad6dd8cf Binary files /dev/null and b/core/assets/ui/out/icon-drive.png differ diff --git a/core/assets/ui/out/icon-eraser.png b/core/assets/ui/out/icon-eraser.png new file mode 100644 index 0000000000..6e3fec3e95 Binary files /dev/null and b/core/assets/ui/out/icon-eraser.png differ diff --git a/core/assets/ui/out/icon-file-audio.png b/core/assets/ui/out/icon-file-audio.png new file mode 100644 index 0000000000..8abc2e6c5a Binary files /dev/null and b/core/assets/ui/out/icon-file-audio.png differ diff --git a/core/assets/ui/out/icon-file-image.png b/core/assets/ui/out/icon-file-image.png new file mode 100644 index 0000000000..f543b4b093 Binary files /dev/null and b/core/assets/ui/out/icon-file-image.png differ diff --git a/core/assets/ui/out/icon-file-pdf.png b/core/assets/ui/out/icon-file-pdf.png new file mode 100644 index 0000000000..428b09acaa Binary files /dev/null and b/core/assets/ui/out/icon-file-pdf.png differ diff --git a/core/assets/ui/out/icon-file-text.png b/core/assets/ui/out/icon-file-text.png new file mode 100644 index 0000000000..d4730f545e Binary files /dev/null and b/core/assets/ui/out/icon-file-text.png differ diff --git a/core/assets/ui/out/icon-fill.png b/core/assets/ui/out/icon-fill.png new file mode 100644 index 0000000000..7a9152b19f Binary files /dev/null and b/core/assets/ui/out/icon-fill.png differ diff --git a/core/assets/ui/out/icon-folder-new.png b/core/assets/ui/out/icon-folder-new.png new file mode 100644 index 0000000000..eac3222a98 Binary files /dev/null and b/core/assets/ui/out/icon-folder-new.png differ diff --git a/core/assets/ui/out/icon-folder-parent.png b/core/assets/ui/out/icon-folder-parent.png new file mode 100644 index 0000000000..36aa4ca1d6 Binary files /dev/null and b/core/assets/ui/out/icon-folder-parent.png differ diff --git a/core/assets/ui/out/icon-folder-star.png b/core/assets/ui/out/icon-folder-star.png new file mode 100644 index 0000000000..23673b8397 Binary files /dev/null and b/core/assets/ui/out/icon-folder-star.png differ diff --git a/core/assets/ui/out/icon-folder.png b/core/assets/ui/out/icon-folder.png new file mode 100644 index 0000000000..1aa5459864 Binary files /dev/null and b/core/assets/ui/out/icon-folder.png differ diff --git a/core/assets/ui/out/icon-grid.png b/core/assets/ui/out/icon-grid.png new file mode 100644 index 0000000000..fb9cc50508 Binary files /dev/null and b/core/assets/ui/out/icon-grid.png differ diff --git a/core/assets/ui/out/icon-home.png b/core/assets/ui/out/icon-home.png new file mode 100644 index 0000000000..d3d41816b2 Binary files /dev/null and b/core/assets/ui/out/icon-home.png differ diff --git a/core/assets/ui/out/icon-list-settings.png b/core/assets/ui/out/icon-list-settings.png new file mode 100644 index 0000000000..7265428155 Binary files /dev/null and b/core/assets/ui/out/icon-list-settings.png differ diff --git a/core/assets/ui/out/icon-load-1.png b/core/assets/ui/out/icon-load-1.png new file mode 100644 index 0000000000..13ca6f50c8 Binary files /dev/null and b/core/assets/ui/out/icon-load-1.png differ diff --git a/core/assets/ui/out/icon-load-2.png b/core/assets/ui/out/icon-load-2.png new file mode 100644 index 0000000000..22896d7007 Binary files /dev/null and b/core/assets/ui/out/icon-load-2.png differ diff --git a/core/assets/ui/out/icon-load-3.png b/core/assets/ui/out/icon-load-3.png new file mode 100644 index 0000000000..fe5ec601a8 Binary files /dev/null and b/core/assets/ui/out/icon-load-3.png differ diff --git a/core/assets/ui/out/icon-lock-open.png b/core/assets/ui/out/icon-lock-open.png new file mode 100644 index 0000000000..144858d4d8 Binary files /dev/null and b/core/assets/ui/out/icon-lock-open.png differ diff --git a/core/assets/ui/out/icon-lock.png b/core/assets/ui/out/icon-lock.png new file mode 100644 index 0000000000..1fdda4f864 Binary files /dev/null and b/core/assets/ui/out/icon-lock.png differ diff --git a/core/assets/ui/out/icon-minus.png b/core/assets/ui/out/icon-minus.png new file mode 100644 index 0000000000..1c705fe896 Binary files /dev/null and b/core/assets/ui/out/icon-minus.png differ diff --git a/core/assets/ui/out/icon-open-gray.png b/core/assets/ui/out/icon-open-gray.png new file mode 100644 index 0000000000..d2d1df62d6 Binary files /dev/null and b/core/assets/ui/out/icon-open-gray.png differ diff --git a/core/assets/ui/out/icon-open.png b/core/assets/ui/out/icon-open.png new file mode 100644 index 0000000000..4215ba24fd Binary files /dev/null and b/core/assets/ui/out/icon-open.png differ diff --git a/core/assets/ui/out/icon-pencil.png b/core/assets/ui/out/icon-pencil.png new file mode 100644 index 0000000000..90b393ea97 Binary files /dev/null and b/core/assets/ui/out/icon-pencil.png differ diff --git a/core/assets/ui/out/icon-pick.png b/core/assets/ui/out/icon-pick.png new file mode 100644 index 0000000000..32c35af2f2 Binary files /dev/null and b/core/assets/ui/out/icon-pick.png differ diff --git a/core/assets/ui/out/icon-plus.png b/core/assets/ui/out/icon-plus.png new file mode 100644 index 0000000000..381dd1ae4f Binary files /dev/null and b/core/assets/ui/out/icon-plus.png differ diff --git a/core/assets/ui/out/icon-redo.png b/core/assets/ui/out/icon-redo.png new file mode 100644 index 0000000000..dbe1a32276 Binary files /dev/null and b/core/assets/ui/out/icon-redo.png differ diff --git a/core/assets/ui/out/icon-refresh.png b/core/assets/ui/out/icon-refresh.png new file mode 100644 index 0000000000..eac6745c4e Binary files /dev/null and b/core/assets/ui/out/icon-refresh.png differ diff --git a/core/assets/ui/out/icon-rename.png b/core/assets/ui/out/icon-rename.png new file mode 100644 index 0000000000..5c5cce3777 Binary files /dev/null and b/core/assets/ui/out/icon-rename.png differ diff --git a/core/assets/ui/out/icon-star-outline.png b/core/assets/ui/out/icon-star-outline.png new file mode 100644 index 0000000000..5ac6d6670e Binary files /dev/null and b/core/assets/ui/out/icon-star-outline.png differ diff --git a/core/assets/ui/out/icon-star.png b/core/assets/ui/out/icon-star.png new file mode 100644 index 0000000000..882eeaa5eb Binary files /dev/null and b/core/assets/ui/out/icon-star.png differ diff --git a/core/assets/ui/out/icon-tap.png b/core/assets/ui/out/icon-tap.png new file mode 100644 index 0000000000..da623aa393 Binary files /dev/null and b/core/assets/ui/out/icon-tap.png differ diff --git a/core/assets/ui/out/icon-trash.png b/core/assets/ui/out/icon-trash.png new file mode 100644 index 0000000000..cdf603b8ce Binary files /dev/null and b/core/assets/ui/out/icon-trash.png differ diff --git a/core/assets/ui/out/icon-undo.png b/core/assets/ui/out/icon-undo.png new file mode 100644 index 0000000000..dc056917f4 Binary files /dev/null and b/core/assets/ui/out/icon-undo.png differ diff --git a/core/assets/ui/out/icon-up.png b/core/assets/ui/out/icon-up.png new file mode 100644 index 0000000000..8f8d40ac06 Binary files /dev/null and b/core/assets/ui/out/icon-up.png differ diff --git a/core/assets/ui/out/icon-zoom.png b/core/assets/ui/out/icon-zoom.png new file mode 100644 index 0000000000..538b0b08f4 Binary files /dev/null and b/core/assets/ui/out/icon-zoom.png differ diff --git a/core/assets/ui/out/list-selection.png b/core/assets/ui/out/list-selection.png new file mode 100644 index 0000000000..c31c5175b0 Binary files /dev/null and b/core/assets/ui/out/list-selection.png differ diff --git a/core/assets/ui/out/menu-bg.png b/core/assets/ui/out/menu-bg.png new file mode 100644 index 0000000000..d57b4a1bb5 Binary files /dev/null and b/core/assets/ui/out/menu-bg.png differ diff --git a/core/assets/ui/out/padded-list-selection.9.png b/core/assets/ui/out/padded-list-selection.9.png new file mode 100644 index 0000000000..9e6045b908 Binary files /dev/null and b/core/assets/ui/out/padded-list-selection.9.png differ diff --git a/core/assets/ui/out/progressbar-filled-vertical.png b/core/assets/ui/out/progressbar-filled-vertical.png new file mode 100644 index 0000000000..6713cc9ea9 Binary files /dev/null and b/core/assets/ui/out/progressbar-filled-vertical.png differ diff --git a/core/assets/ui/out/progressbar-filled.png b/core/assets/ui/out/progressbar-filled.png new file mode 100644 index 0000000000..50f58e3535 Binary files /dev/null and b/core/assets/ui/out/progressbar-filled.png differ diff --git a/core/assets/ui/out/progressbar-vertical.png b/core/assets/ui/out/progressbar-vertical.png new file mode 100644 index 0000000000..adeec047fe Binary files /dev/null and b/core/assets/ui/out/progressbar-vertical.png differ diff --git a/core/assets/ui/out/progressbar.png b/core/assets/ui/out/progressbar.png new file mode 100644 index 0000000000..439795f5d5 Binary files /dev/null and b/core/assets/ui/out/progressbar.png differ diff --git a/core/assets/ui/out/radio-off.png b/core/assets/ui/out/radio-off.png new file mode 100644 index 0000000000..6b418cf4ea Binary files /dev/null and b/core/assets/ui/out/radio-off.png differ diff --git a/core/assets/ui/out/radio-on.png b/core/assets/ui/out/radio-on.png new file mode 100644 index 0000000000..8192c2d22f Binary files /dev/null and b/core/assets/ui/out/radio-on.png differ diff --git a/core/assets/ui/out/scroll-horizontal.9.png b/core/assets/ui/out/scroll-horizontal.9.png new file mode 100644 index 0000000000..6569566c4b Binary files /dev/null and b/core/assets/ui/out/scroll-horizontal.9.png differ diff --git a/core/assets/ui/out/scroll-knob-horizontal.9.png b/core/assets/ui/out/scroll-knob-horizontal.9.png new file mode 100644 index 0000000000..2b898da798 Binary files /dev/null and b/core/assets/ui/out/scroll-knob-horizontal.9.png differ diff --git a/core/assets/ui/out/scroll-knob-vertical.9.png b/core/assets/ui/out/scroll-knob-vertical.9.png new file mode 100644 index 0000000000..36f994e9c9 Binary files /dev/null and b/core/assets/ui/out/scroll-knob-vertical.9.png differ diff --git a/core/assets/ui/out/scroll.9.png b/core/assets/ui/out/scroll.9.png new file mode 100644 index 0000000000..efbaeea0e3 Binary files /dev/null and b/core/assets/ui/out/scroll.9.png differ diff --git a/core/assets/ui/out/select-box-list-bg.png b/core/assets/ui/out/select-box-list-bg.png new file mode 100644 index 0000000000..640981b220 Binary files /dev/null and b/core/assets/ui/out/select-box-list-bg.png differ diff --git a/core/assets/ui/out/select-down.png b/core/assets/ui/out/select-down.png new file mode 100644 index 0000000000..4390d83447 Binary files /dev/null and b/core/assets/ui/out/select-down.png differ diff --git a/core/assets/ui/out/select-up.png b/core/assets/ui/out/select-up.png new file mode 100644 index 0000000000..67fcb85d76 Binary files /dev/null and b/core/assets/ui/out/select-up.png differ diff --git a/core/assets/ui/out/selection.png b/core/assets/ui/out/selection.png new file mode 100644 index 0000000000..e779aea9b1 Binary files /dev/null and b/core/assets/ui/out/selection.png differ diff --git a/core/assets/ui/out/separator-menu.png b/core/assets/ui/out/separator-menu.png new file mode 100644 index 0000000000..5c633eb1c7 Binary files /dev/null and b/core/assets/ui/out/separator-menu.png differ diff --git a/core/assets/ui/out/separator.png b/core/assets/ui/out/separator.png new file mode 100644 index 0000000000..114704cbce Binary files /dev/null and b/core/assets/ui/out/separator.png differ diff --git a/core/assets/ui/out/slider-knob-disabled.png b/core/assets/ui/out/slider-knob-disabled.png new file mode 100644 index 0000000000..7bbf8cabc5 Binary files /dev/null and b/core/assets/ui/out/slider-knob-disabled.png differ diff --git a/core/assets/ui/out/slider-knob-down.png b/core/assets/ui/out/slider-knob-down.png new file mode 100644 index 0000000000..3ef86d44d2 Binary files /dev/null and b/core/assets/ui/out/slider-knob-down.png differ diff --git a/core/assets/ui/out/slider-knob-over.png b/core/assets/ui/out/slider-knob-over.png new file mode 100644 index 0000000000..8b584c9d3c Binary files /dev/null and b/core/assets/ui/out/slider-knob-over.png differ diff --git a/core/assets/ui/out/slider-knob.png b/core/assets/ui/out/slider-knob.png new file mode 100644 index 0000000000..3defe45dab Binary files /dev/null and b/core/assets/ui/out/slider-knob.png differ diff --git a/core/assets/ui/out/slider-vertical.png b/core/assets/ui/out/slider-vertical.png new file mode 100644 index 0000000000..e4139783a0 Binary files /dev/null and b/core/assets/ui/out/slider-vertical.png differ diff --git a/core/assets/ui/out/slider.png b/core/assets/ui/out/slider.png new file mode 100644 index 0000000000..cb57d188b8 Binary files /dev/null and b/core/assets/ui/out/slider.png differ diff --git a/core/assets/ui/out/slot.9.png b/core/assets/ui/out/slot.9.png new file mode 100644 index 0000000000..66d175ec16 Binary files /dev/null and b/core/assets/ui/out/slot.9.png differ diff --git a/core/assets/ui/out/splitpane-over.png b/core/assets/ui/out/splitpane-over.png new file mode 100644 index 0000000000..feaf4d9010 Binary files /dev/null and b/core/assets/ui/out/splitpane-over.png differ diff --git a/core/assets/ui/out/splitpane-vertical-over.png b/core/assets/ui/out/splitpane-vertical-over.png new file mode 100644 index 0000000000..211cba34aa Binary files /dev/null and b/core/assets/ui/out/splitpane-vertical-over.png differ diff --git a/core/assets/ui/out/splitpane-vertical.png b/core/assets/ui/out/splitpane-vertical.png new file mode 100644 index 0000000000..4328d75f8d Binary files /dev/null and b/core/assets/ui/out/splitpane-vertical.png differ diff --git a/core/assets/ui/out/splitpane.png b/core/assets/ui/out/splitpane.png new file mode 100644 index 0000000000..ff4820d685 Binary files /dev/null and b/core/assets/ui/out/splitpane.png differ diff --git a/core/assets/ui/out/sub-menu.png b/core/assets/ui/out/sub-menu.png new file mode 100644 index 0000000000..43fe36b6b3 Binary files /dev/null and b/core/assets/ui/out/sub-menu.png differ diff --git a/core/assets/ui/out/textfield-over.9.png b/core/assets/ui/out/textfield-over.9.png new file mode 100644 index 0000000000..3fe1f1ec4f Binary files /dev/null and b/core/assets/ui/out/textfield-over.9.png differ diff --git a/core/assets/ui/out/textfield.9.png b/core/assets/ui/out/textfield.9.png new file mode 100644 index 0000000000..fda1b6679a Binary files /dev/null and b/core/assets/ui/out/textfield.9.png differ diff --git a/core/assets/ui/out/tooltip-bg.9.png b/core/assets/ui/out/tooltip-bg.9.png new file mode 100644 index 0000000000..00ddecbbb2 Binary files /dev/null and b/core/assets/ui/out/tooltip-bg.9.png differ diff --git a/core/assets/ui/out/touchpad-knob.png b/core/assets/ui/out/touchpad-knob.png new file mode 100644 index 0000000000..48b9c26339 Binary files /dev/null and b/core/assets/ui/out/touchpad-knob.png differ diff --git a/core/assets/ui/out/tree-minus.png b/core/assets/ui/out/tree-minus.png new file mode 100644 index 0000000000..cbfe2436a5 Binary files /dev/null and b/core/assets/ui/out/tree-minus.png differ diff --git a/core/assets/ui/out/tree-over.png b/core/assets/ui/out/tree-over.png new file mode 100644 index 0000000000..114704cbce Binary files /dev/null and b/core/assets/ui/out/tree-over.png differ diff --git a/core/assets/ui/out/tree-plus.png b/core/assets/ui/out/tree-plus.png new file mode 100644 index 0000000000..9aafc6b9c7 Binary files /dev/null and b/core/assets/ui/out/tree-plus.png differ diff --git a/core/assets/ui/out/tree-selection.9.png b/core/assets/ui/out/tree-selection.9.png new file mode 100644 index 0000000000..9721e9ed9e Binary files /dev/null and b/core/assets/ui/out/tree-selection.9.png differ diff --git a/core/assets/ui/out/vis-blue.png b/core/assets/ui/out/vis-blue.png new file mode 100644 index 0000000000..c31c5175b0 Binary files /dev/null and b/core/assets/ui/out/vis-blue.png differ diff --git a/core/assets/ui/out/vis-check-down.png b/core/assets/ui/out/vis-check-down.png new file mode 100644 index 0000000000..71abb29dbd Binary files /dev/null and b/core/assets/ui/out/vis-check-down.png differ diff --git a/core/assets/ui/out/vis-check-over.png b/core/assets/ui/out/vis-check-over.png new file mode 100644 index 0000000000..dbc4767a63 Binary files /dev/null and b/core/assets/ui/out/vis-check-over.png differ diff --git a/core/assets/ui/out/vis-check-tick-disabled.png b/core/assets/ui/out/vis-check-tick-disabled.png new file mode 100644 index 0000000000..834d4cb602 Binary files /dev/null and b/core/assets/ui/out/vis-check-tick-disabled.png differ diff --git a/core/assets/ui/out/vis-check-tick.png b/core/assets/ui/out/vis-check-tick.png new file mode 100644 index 0000000000..0507b398e3 Binary files /dev/null and b/core/assets/ui/out/vis-check-tick.png differ diff --git a/core/assets/ui/out/vis-check.png b/core/assets/ui/out/vis-check.png new file mode 100644 index 0000000000..fb891f7921 Binary files /dev/null and b/core/assets/ui/out/vis-check.png differ diff --git a/core/assets/ui/out/vis-radio-down.png b/core/assets/ui/out/vis-radio-down.png new file mode 100644 index 0000000000..68c658e568 Binary files /dev/null and b/core/assets/ui/out/vis-radio-down.png differ diff --git a/core/assets/ui/out/vis-radio-over.png b/core/assets/ui/out/vis-radio-over.png new file mode 100644 index 0000000000..8213edaa1d Binary files /dev/null and b/core/assets/ui/out/vis-radio-over.png differ diff --git a/core/assets/ui/out/vis-radio-tick-disabled.png b/core/assets/ui/out/vis-radio-tick-disabled.png new file mode 100644 index 0000000000..d158662473 Binary files /dev/null and b/core/assets/ui/out/vis-radio-tick-disabled.png differ diff --git a/core/assets/ui/out/vis-radio-tick.png b/core/assets/ui/out/vis-radio-tick.png new file mode 100644 index 0000000000..de52864eb1 Binary files /dev/null and b/core/assets/ui/out/vis-radio-tick.png differ diff --git a/core/assets/ui/out/vis-radio.png b/core/assets/ui/out/vis-radio.png new file mode 100644 index 0000000000..6b418cf4ea Binary files /dev/null and b/core/assets/ui/out/vis-radio.png differ diff --git a/core/assets/ui/out/vis-red.png b/core/assets/ui/out/vis-red.png new file mode 100644 index 0000000000..7ed23eef0a Binary files /dev/null and b/core/assets/ui/out/vis-red.png differ diff --git a/core/assets/ui/out/white.png b/core/assets/ui/out/white.png new file mode 100644 index 0000000000..ba9bf827c1 Binary files /dev/null and b/core/assets/ui/out/white.png differ diff --git a/core/assets/ui/out/window-bg.png b/core/assets/ui/out/window-bg.png new file mode 100644 index 0000000000..640981b220 Binary files /dev/null and b/core/assets/ui/out/window-bg.png differ diff --git a/core/assets/ui/out/window-border-bg.9.png b/core/assets/ui/out/window-border-bg.9.png new file mode 100644 index 0000000000..aba4bf1526 Binary files /dev/null and b/core/assets/ui/out/window-border-bg.9.png differ diff --git a/core/assets/ui/out/window-gray.9.png b/core/assets/ui/out/window-gray.9.png new file mode 100644 index 0000000000..36c4fc6ca5 Binary files /dev/null and b/core/assets/ui/out/window-gray.9.png differ diff --git a/core/assets/ui/out/window-noborder.9.png b/core/assets/ui/out/window-noborder.9.png new file mode 100644 index 0000000000..e73c7cab58 Binary files /dev/null and b/core/assets/ui/out/window-noborder.9.png differ diff --git a/core/assets/ui/out/window-resizable.9.png b/core/assets/ui/out/window-resizable.9.png new file mode 100644 index 0000000000..59839b9515 Binary files /dev/null and b/core/assets/ui/out/window-resizable.9.png differ diff --git a/core/assets/ui/out/window.9.png b/core/assets/ui/out/window.9.png new file mode 100644 index 0000000000..68444a860d Binary files /dev/null and b/core/assets/ui/out/window.9.png differ diff --git a/core/assets/ui/prose.fnt b/core/assets/ui/prose.fnt new file mode 100644 index 0000000000..51de7c354c --- /dev/null +++ b/core/assets/ui/prose.fnt @@ -0,0 +1,97 @@ +info face="5squared pixel Regular" size=32 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2 +common lineHeight=44 base=36 scaleW=512 scaleH=512 pages=1 packed=0 +page id=0 file="prose.png" +chars count=92 +char id=10 x=0 y=0 width=0 height=0 xoffset=0 yoffset=0 xadvance=0 page=0 chnl=0 +char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=35 xadvance=8 page=0 chnl=0 +char id=33 x=504 y=0 width=6 height=22 xoffset=-1 yoffset=15 xadvance=8 page=0 chnl=0 +char id=34 x=110 y=52 width=14 height=10 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0 +char id=35 x=22 y=52 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=36 x=6 y=0 width=22 height=30 xoffset=-1 yoffset=11 xadvance=24 page=0 chnl=0 +char id=37 x=468 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=38 x=44 y=52 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=39 x=502 y=30 width=6 height=10 xoffset=-1 yoffset=15 xadvance=8 page=0 chnl=0 +char id=40 x=322 y=30 width=10 height=22 xoffset=-1 yoffset=15 xadvance=12 page=0 chnl=0 +char id=41 x=332 y=30 width=10 height=22 xoffset=-1 yoffset=15 xadvance=12 page=0 chnl=0 +char id=42 x=66 y=52 width=22 height=22 xoffset=-1 yoffset=11 xadvance=24 page=0 chnl=0 +char id=43 x=0 y=52 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=44 x=502 y=30 width=6 height=10 xoffset=-1 yoffset=31 xadvance=8 page=0 chnl=0 +char id=45 x=130 y=52 width=22 height=6 xoffset=-1 yoffset=23 xadvance=24 page=0 chnl=0 +char id=46 x=124 y=52 width=6 height=6 xoffset=-1 yoffset=31 xadvance=8 page=0 chnl=0 +char id=47 x=418 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0 +char id=48 x=278 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=49 x=88 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0 +char id=50 x=102 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=51 x=124 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=52 x=146 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=53 x=168 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=54 x=190 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=55 x=212 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=56 x=234 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=57 x=256 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=58 x=496 y=30 width=6 height=14 xoffset=-1 yoffset=23 xadvance=8 page=0 chnl=0 +char id=59 x=490 y=30 width=6 height=18 xoffset=-1 yoffset=23 xadvance=8 page=0 chnl=0 +char id=60 x=390 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0 +char id=61 x=88 y=52 width=22 height=14 xoffset=-1 yoffset=19 xadvance=24 page=0 chnl=0 +char id=62 x=404 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0 +char id=63 x=300 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=64 x=432 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=65 x=50 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=66 x=72 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=67 x=94 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=68 x=116 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=69 x=138 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=70 x=160 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=71 x=182 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=72 x=204 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=73 x=226 y=0 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0 +char id=74 x=240 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=75 x=262 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=76 x=284 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=77 x=306 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=78 x=328 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=79 x=350 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=80 x=372 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=81 x=28 y=0 width=22 height=26 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=82 x=394 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=83 x=416 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=84 x=438 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=85 x=460 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=86 x=482 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=87 x=0 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=88 x=22 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=89 x=44 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=90 x=66 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=91 x=342 y=30 width=10 height=22 xoffset=-1 yoffset=15 xadvance=12 page=0 chnl=0 +char id=92 x=454 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0 +char id=93 x=352 y=30 width=10 height=22 xoffset=-1 yoffset=15 xadvance=12 page=0 chnl=0 +char id=97 x=50 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=98 x=72 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=99 x=94 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=100 x=116 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=101 x=138 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=102 x=160 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=103 x=182 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=104 x=204 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=105 x=226 y=0 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0 +char id=106 x=240 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=107 x=262 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=108 x=284 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=109 x=306 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=110 x=328 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=111 x=350 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=112 x=372 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=113 x=28 y=0 width=22 height=26 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=114 x=394 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=115 x=416 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=116 x=438 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=117 x=460 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=118 x=482 y=0 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=119 x=0 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=120 x=22 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=121 x=44 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=122 x=66 y=30 width=22 height=22 xoffset=-1 yoffset=15 xadvance=24 page=0 chnl=0 +char id=123 x=362 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0 +char id=124 x=0 y=0 width=6 height=30 xoffset=-1 yoffset=11 xadvance=8 page=0 chnl=0 +char id=125 x=376 y=30 width=14 height=22 xoffset=-1 yoffset=15 xadvance=16 page=0 chnl=0 +kernings count=0 diff --git a/core/assets/ui/prose.png b/core/assets/ui/prose.png new file mode 100644 index 0000000000..59f9eb8140 Binary files /dev/null and b/core/assets/ui/prose.png differ diff --git a/core/assets/ui/uiskin.atlas b/core/assets/ui/uiskin.atlas new file mode 100644 index 0000000000..4eb3f1084e --- /dev/null +++ b/core/assets/ui/uiskin.atlas @@ -0,0 +1,1014 @@ + +uiskin.png +size: 1024,128 +format: RGBA8888 +filter: Nearest,Nearest +repeat: none +blank + rotate: false + xy: 164, 2 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +border + rotate: false + xy: 651, 72 + size: 12, 12 + split: 4, 4, 4, 4 + orig: 12, 12 + offset: 0, 0 + index: -1 +border-circle + rotate: false + xy: 849, 98 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +border-circle-error + rotate: false + xy: 879, 98 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +border-dark-blue + rotate: false + xy: 498, 92 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +border-error + rotate: false + xy: 528, 85 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +border-white + rotate: false + xy: 118, 2 + size: 12, 12 + split: 4, 4, 4, 4 + orig: 12, 12 + offset: 0, 0 + index: -1 +bump + rotate: false + xy: 2, 54 + size: 72, 72 + split: 8, 12, 12, 8 + orig: 72, 72 + offset: 0, 0 + index: -1 +button + rotate: false + xy: 823, 86 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-blue + rotate: false + xy: 615, 86 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-blue-down + rotate: false + xy: 563, 86 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-blue-over + rotate: false + xy: 589, 86 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-down + rotate: false + xy: 641, 86 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-gray + rotate: false + xy: 693, 86 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-gray-over + rotate: false + xy: 667, 86 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-over + rotate: false + xy: 719, 86 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-red + rotate: false + xy: 745, 86 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-window-bg + rotate: false + xy: 771, 86 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +button-window-over + rotate: false + xy: 797, 86 + size: 24, 40 + split: 10, 10, 10, 8 + pad: 8, 8, 2, 2 + orig: 24, 40 + offset: 0, 0 + index: -1 +check-off + rotate: false + xy: 909, 98 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +textfield + rotate: false + xy: 909, 98 + size: 28, 28 + split: 6, 6, 6, 6 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-check + rotate: false + xy: 909, 98 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +check-on + rotate: false + xy: 939, 98 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +color-picker-bar-selector + rotate: false + xy: 999, 98 + size: 14, 28 + orig: 14, 28 + offset: 0, 0 + index: -1 +color-picker-cross + rotate: false + xy: 665, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +color-picker-selector-horizontal + rotate: false + xy: 92, 5 + size: 6, 1 + orig: 6, 1 + offset: 0, 0 + index: -1 +color-picker-selector-vertical + rotate: false + xy: 1021, 90 + size: 1, 6 + orig: 1, 6 + offset: 0, 0 + index: -1 +cursor + rotate: false + xy: 76, 56 + size: 4, 4 + orig: 4, 4 + offset: 0, 0 + index: -1 +cursor-normal + rotate: false + xy: 677, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +default-pane + rotate: false + xy: 130, 21 + size: 5, 3 + split: 1, 1, 1, 1 + orig: 5, 3 + offset: 0, 0 + index: -1 +default-pane-no-border + rotate: false + xy: 138, 59 + size: 1, 1 + split: 0, 0, 0, 0 + orig: 1, 1 + offset: 0, 0 + index: -1 +default-select + rotate: false + xy: 2, 4 + size: 54, 48 + split: 8, 32, 0, 48 + orig: 54, 48 + offset: 0, 0 + index: -1 +default-select-selection + rotate: false + xy: 528, 80 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +grey + rotate: false + xy: 563, 62 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +menu-bg + rotate: false + xy: 563, 62 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +icon-arrow-down + rotate: false + xy: 689, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-arrow-left + rotate: false + xy: 701, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-arrow-right + rotate: false + xy: 713, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-arrow-up + rotate: false + xy: 725, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-close + rotate: false + xy: 217, 86 + size: 40, 40 + orig: 40, 40 + offset: 0, 0 + index: -1 +icon-close-down + rotate: false + xy: 259, 86 + size: 40, 40 + orig: 40, 40 + offset: 0, 0 + index: -1 +icon-close-over + rotate: false + xy: 301, 86 + size: 40, 40 + orig: 40, 40 + offset: 0, 0 + index: -1 +icon-copy + rotate: false + xy: 737, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-cursor + rotate: false + xy: 749, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-dots + rotate: false + xy: 761, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-dots-down + rotate: false + xy: 773, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-down + rotate: false + xy: 785, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-drive + rotate: false + xy: 849, 86 + size: 36, 10 + orig: 36, 10 + offset: 0, 0 + index: -1 +icon-eraser + rotate: false + xy: 797, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-file-audio + rotate: false + xy: 503, 90 + size: 28, 36 + orig: 28, 36 + offset: 0, 0 + index: -1 +icon-file-image + rotate: false + xy: 219, 54 + size: 26, 30 + orig: 26, 30 + offset: 0, 0 + index: -1 +icon-file-pdf + rotate: false + xy: 533, 92 + size: 28, 34 + orig: 28, 34 + offset: 0, 0 + index: -1 +icon-file-text + rotate: false + xy: 809, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-fill + rotate: false + xy: 821, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-folder + rotate: false + xy: 833, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-folder-new + rotate: false + xy: 466, 97 + size: 35, 29 + orig: 35, 29 + offset: 0, 0 + index: -1 +icon-folder-parent + rotate: false + xy: 845, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-folder-star + rotate: false + xy: 430, 66 + size: 34, 26 + orig: 34, 26 + offset: 0, 0 + index: -1 +icon-grid + rotate: false + xy: 857, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-home + rotate: false + xy: 869, 74 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-list-settings + rotate: false + xy: 171, 46 + size: 38, 34 + orig: 38, 34 + offset: 0, 0 + index: -1 +icon-load-1 + rotate: false + xy: 219, 42 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-load-2 + rotate: false + xy: 231, 42 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-load-3 + rotate: false + xy: 243, 42 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-lock + rotate: false + xy: 255, 42 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-lock-open + rotate: false + xy: 923, 86 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-minus + rotate: false + xy: 935, 86 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-open + rotate: false + xy: 947, 86 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-open-gray + rotate: false + xy: 959, 86 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-pencil + rotate: false + xy: 971, 86 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-pick + rotate: false + xy: 983, 86 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-plus + rotate: false + xy: 995, 86 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-redo + rotate: false + xy: 267, 42 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-refresh + rotate: false + xy: 247, 54 + size: 26, 30 + orig: 26, 30 + offset: 0, 0 + index: -1 +icon-rename + rotate: false + xy: 279, 44 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-star + rotate: false + xy: 466, 67 + size: 30, 28 + orig: 30, 28 + offset: 0, 0 + index: -1 +icon-star-outline + rotate: false + xy: 430, 94 + size: 34, 32 + orig: 34, 32 + offset: 0, 0 + index: -1 +icon-tap + rotate: false + xy: 291, 44 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-trash + rotate: false + xy: 303, 44 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-undo + rotate: false + xy: 315, 44 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-up + rotate: false + xy: 327, 44 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-zoom + rotate: false + xy: 178, 31 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +list-selection + rotate: false + xy: 605, 65 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +vis-blue + rotate: false + xy: 605, 65 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +padded-list-selection + rotate: false + xy: 58, 2 + size: 10, 1 + split: 4, 4, 0, 1 + orig: 10, 1 + offset: 0, 0 + index: -1 +progressbar + rotate: false + xy: 1015, 94 + size: 1, 32 + orig: 1, 32 + offset: 0, 0 + index: -1 +progressbar-filled + rotate: false + xy: 1018, 94 + size: 1, 32 + orig: 1, 32 + offset: 0, 0 + index: -1 +progressbar-filled-vertical + rotate: false + xy: 171, 43 + size: 32, 1 + orig: 32, 1 + offset: 0, 0 + index: -1 +progressbar-vertical + rotate: false + xy: 58, 5 + size: 32, 1 + orig: 32, 1 + offset: 0, 0 + index: -1 +radio-off + rotate: false + xy: 969, 98 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-radio + rotate: false + xy: 969, 98 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +radio-on + rotate: false + xy: 498, 60 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +scroll + rotate: false + xy: 887, 90 + size: 34, 6 + split: 4, 4, 2, 2 + orig: 34, 6 + offset: 0, 0 + index: -1 +scroll-horizontal + rotate: false + xy: 130, 26 + size: 6, 34 + split: 2, 2, 0, 34 + pad: 0, 5, 5, 4 + orig: 6, 34 + offset: 0, 0 + index: -1 +scroll-knob-horizontal + rotate: false + xy: 211, 46 + size: 6, 34 + split: 2, 2, 0, 34 + pad: 0, 5, 13, 12 + orig: 6, 34 + offset: 0, 0 + index: -1 +scroll-knob-vertical + rotate: false + xy: 82, 8 + size: 34, 6 + split: 12, 12, 2, 2 + orig: 34, 6 + offset: 0, 0 + index: -1 +select-box-list-bg + rotate: false + xy: 881, 83 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +window-bg + rotate: false + xy: 881, 83 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +select-down + rotate: false + xy: 132, 2 + size: 14, 8 + orig: 14, 8 + offset: 0, 0 + index: -1 +select-up + rotate: false + xy: 148, 2 + size: 14, 8 + orig: 14, 8 + offset: 0, 0 + index: -1 +selection + rotate: false + xy: 205, 43 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +separator + rotate: false + xy: 887, 87 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +tree-over + rotate: false + xy: 887, 87 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +separator-menu + rotate: false + xy: 1007, 95 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +slider + rotate: false + xy: 1021, 118 + size: 1, 8 + orig: 1, 8 + offset: 0, 0 + index: -1 +slider-knob + rotate: false + xy: 58, 8 + size: 22, 44 + orig: 22, 44 + offset: 0, 0 + index: -1 +slider-knob-over + rotate: false + xy: 58, 8 + size: 22, 44 + orig: 22, 44 + offset: 0, 0 + index: -1 +slider-knob-disabled + rotate: false + xy: 82, 16 + size: 22, 44 + orig: 22, 44 + offset: 0, 0 + index: -1 +slider-knob-down + rotate: false + xy: 106, 16 + size: 22, 44 + orig: 22, 44 + offset: 0, 0 + index: -1 +slider-vertical + rotate: false + xy: 70, 2 + size: 8, 1 + orig: 8, 1 + offset: 0, 0 + index: -1 +slot + rotate: false + xy: 76, 62 + size: 64, 64 + split: 4, 8, 8, 4 + orig: 64, 64 + offset: 0, 0 + index: -1 +splitpane + rotate: false + xy: 80, 2 + size: 8, 1 + orig: 8, 1 + offset: 0, 0 + index: -1 +splitpane-over + rotate: false + xy: 90, 2 + size: 8, 1 + orig: 8, 1 + offset: 0, 0 + index: -1 +splitpane-vertical + rotate: false + xy: 1021, 108 + size: 1, 8 + orig: 1, 8 + offset: 0, 0 + index: -1 +splitpane-vertical-over + rotate: false + xy: 1021, 98 + size: 1, 8 + orig: 1, 8 + offset: 0, 0 + index: -1 +sub-menu + rotate: false + xy: 168, 26 + size: 8, 14 + orig: 8, 14 + offset: 0, 0 + index: -1 +textfield-over + rotate: false + xy: 275, 56 + size: 28, 28 + split: 2, 2, 2, 2 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-check-over + rotate: false + xy: 275, 56 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +tooltip-bg + rotate: false + xy: 528, 75 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +touchpad-knob + rotate: false + xy: 171, 82 + size: 44, 44 + orig: 44, 44 + offset: 0, 0 + index: -1 +tree-minus + rotate: false + xy: 190, 31 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +tree-plus + rotate: false + xy: 605, 68 + size: 12, 16 + orig: 12, 16 + offset: 0, 0 + index: -1 +tree-selection + rotate: false + xy: 528, 70 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +vis-check-down + rotate: false + xy: 305, 56 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-check-tick + rotate: false + xy: 563, 65 + size: 19, 19 + orig: 19, 19 + offset: 0, 0 + index: -1 +vis-check-tick-disabled + rotate: false + xy: 584, 65 + size: 19, 19 + orig: 19, 19 + offset: 0, 0 + index: -1 +vis-radio-down + rotate: false + xy: 138, 12 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-radio-over + rotate: false + xy: 533, 62 + size: 28, 28 + orig: 28, 28 + offset: 0, 0 + index: -1 +vis-radio-tick + rotate: false + xy: 619, 70 + size: 14, 14 + orig: 14, 14 + offset: 0, 0 + index: -1 +vis-radio-tick-disabled + rotate: false + xy: 635, 70 + size: 14, 14 + orig: 14, 14 + offset: 0, 0 + index: -1 +vis-red + rotate: false + xy: 335, 83 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 +white + rotate: false + xy: 528, 65 + size: 3, 3 + orig: 3, 3 + offset: 0, 0 + index: -1 +window + rotate: false + xy: 401, 65 + size: 27, 61 + split: 8, 8, 51, 4 + orig: 27, 61 + offset: 0, 0 + index: -1 +window-border-bg + rotate: false + xy: 528, 60 + size: 3, 3 + split: 1, 1, 1, 1 + orig: 3, 3 + offset: 0, 0 + index: -1 +window-gray + rotate: false + xy: 343, 65 + size: 27, 61 + split: 5, 4, 52, 4 + orig: 27, 61 + offset: 0, 0 + index: -1 +window-noborder + rotate: false + xy: 372, 65 + size: 27, 61 + split: 5, 4, 53, 3 + orig: 27, 61 + offset: 0, 0 + index: -1 +window-resizable + rotate: false + xy: 142, 42 + size: 27, 84 + split: 3, 19, 2, 20 + pad: 5, 5, 50, 7 + orig: 27, 84 + offset: 0, 0 + index: -1 diff --git a/core/assets/ui/uiskin.json b/core/assets/ui/uiskin.json new file mode 100644 index 0000000000..dd8468330b --- /dev/null +++ b/core/assets/ui/uiskin.json @@ -0,0 +1,101 @@ +{ +com.badlogic.gdx.graphics.g2d.BitmapFont: { + default-font: { + file: prose.fnt, + markupEnabled: true, + scale: 0.5 + } +}, +com.badlogic.gdx.graphics.Color: { + black: {a: 1, b: 0, g: 0, r: 0 }, + white: {a: 1, b: 1, g: 1, r: 1 }, + green: {a: 1, b: 0, g: 1, r: 0 }, + red: {a: 1, b: 0, g: 0, r: 1 }, + blue: {a: 1, b: 1, g: 0, r: 0 }, + grey: {a: 1, b: 0.32, g: 0.32, r: 0.32 }, + orange: {hex: "#FFA500"}, + vis-blue: {a: 1, b: 0.886, g: 0.631, r: 0.105 }, + vis-red: {a: 1, b: 0.047, g: 0, r: 0.862 }, + menuitem: {a: 1, b: 0.65, g: 0.65, r: 0.65 }, + link-label: {a: 1, b: 0.886, g: 0.631, r: 0.105 } +}, +io.anuke.ucore.scene.style.Styles$TintedDrawable: { + dialogDim: {name: white, color: {r: 0, g: 0, b: 0, a: 0.45} } +}, +io.anuke.ucore.scene.ui.Button$ButtonStyle: { + default: {down: button-down, up: button }, + blue: {down: button-blue-down, up: button-blue }, + toggle: {checked: button-down, down: button-down, up: button } +}, +io.anuke.ucore.scene.ui.TextButton$TextButtonStyle: { + default: {over: button-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: grey, down: button-down, up: button, transition: 0 }, + blue: {over: button-blue-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: grey, down: button-blue-down, up: button-blue }, + toggle: {font: default-font, fontColor: white, checked: button-down, down: button-down, up: button, over: button-over, disabled: button, disabledFontColor: grey } +}, +io.anuke.ucore.scene.ui.ImageButton$ImageButtonStyle: { + default: {down: button-down, up: button }, + blue: {down: button-blue-down, up: button-blue }, + toggle: {checked: button-down, down: button-down, up: button } + gray: {down: button-down, up: button-gray, over: button-gray-over, disabled: button}, + close-window: {up: button, imageUp: icon-close, imageOver: icon-close-over, imageDown: icon-close-down, disabled: button } +}, +io.anuke.ucore.scene.ui.ImageTextButton$ImageTextButtonStyle: { + default: {down: button-down, up: button, over: button-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: grey }, + blue: {down: button-blue-down, up: button-blue, over: button-blue-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: grey }, + toggle: {checked: button-down, down: button-down, up: button, font: default-font, fontColor: white, over: button-over, disabled: button, disabledFontColor: grey } +}, +io.anuke.ucore.scene.ui.ScrollPane$ScrollPaneStyle: { + list: {vScroll: scroll, vScrollKnob: scroll-knob-vertical, hScroll: scroll-horizontal, hScrollKnob: scroll-knob-horizontal }, + default: {background: border, vScroll: scroll, vScrollKnob: scroll-knob-vertical, hScroll: scroll-horizontal, hScrollKnob: scroll-knob-horizontal } +}, +io.anuke.ucore.scene.ui.SelectBox$SelectBoxStyle: { + default: {background: default-select, scrollStyle: default, listStyle: {font: default-font, selection: padded-list-selection, background: select-box-list-bg}, font: default-font, fontColor: white, disabledFontColor: grey } +}, +io.anuke.ucore.scene.ui.SplitPane$SplitPaneStyle: { + default-vertical: {handle: splitpane-vertical }, + default-horizontal: {handle: splitpane } +}, +io.anuke.ucore.scene.ui.Window$WindowStyle: { + default: {titleFont: default-font, background: window, titleFontColor: orange }, + resizable: {background: window-resizable, titleFont: default-font, titleFontColor: white }, + noborder: {background: window-noborder, titleFont: default-font, titleFontColor: white }, + dialog: {stageBackground: dialogDim, titleFont: default-font, background: window, titleFontColor: white } +}, +io.anuke.ucore.scene.ui.KeybindDialog$KeybindDialogStyle: { + default: {keyColor: red, keyNameColor: grey}, +}, +io.anuke.ucore.scene.ui.ProgressBar$ProgressBarStyle: { + default-horizontal: {background: progressbar, knob: progressbar-filled, knobBefore: progressbar-filled }, + default-vertical: {background: progressbar-vertical, knob: progressbar-filled-vertical, knobBefore: progressbar-filled-vertical } +}, +io.anuke.ucore.scene.ui.Slider$SliderStyle: { + default-horizontal: {background: slider, knob: slider-knob, knobOver: slider-knob-over, knobDown: slider-knob-down, disabledKnob: slider-knob-disabled }, + default-vertical: {background: slider-vertical, knob: slider-knob, knobOver: slider-knob-over, knobDown: slider-knob-down, disabledKnob: slider-knob-disabled } +}, +io.anuke.ucore.scene.ui.Label$LabelStyle: { + default: {font: default-font, fontColor: white }, + link-label: {fontColor: link-label, font: default-font }, + small: {font: default-font, fontColor: white }, + menuitem-shortcut: {font: default-font, fontColor: menuitem } +}, +io.anuke.ucore.scene.ui.TextField$TextFieldStyle: { + default: {font: default-font, fontColor: white, disabledFontColor: grey, selection: selection, background: textfield, cursor: cursor, messageFont: default-font, messageFontColor: grey }, + small: {font: default-font, fontColor: white, disabledFontColor: grey, selection: selection, background: textfield, cursor: cursor, messageFont: default-font, messageFontColor: grey } +}, +io.anuke.ucore.scene.ui.CheckBox$CheckBoxStyle: { + default: {checkboxOn: check-on, checkboxOff: check-off, font: default-font, fontColor: white, disabledFontColor: grey }, + radio: {checkboxOn: radio-on, checkboxOff: radio-off, font: default-font, fontColor: white, disabledFontColor: grey } +}, +io.anuke.ucore.scene.ui.List$ListStyle: { + default: {fontColorUnselected: white, selection: padded-list-selection, fontColorSelected: white, font: default-font } +}, +io.anuke.ucore.scene.ui.Touchpad$TouchpadStyle: { + default: {background: default-pane, knob: touchpad-knob } +}, +io.anuke.ucore.scene.ui.Tree$TreeStyle: { + default: {minus: tree-minus, plus: tree-plus, selection: tree-selection, over: tree-over } +}, +io.anuke.ucore.scene.ui.TextTooltip$TextTooltipStyle: { + default: {background: default-pane, label: {font: default-font, fontColor: white} } +} +} diff --git a/core/assets/ui/uiskin.png b/core/assets/ui/uiskin.png new file mode 100644 index 0000000000..f1219509fa Binary files /dev/null and b/core/assets/ui/uiskin.png differ diff --git a/core/build.gradle b/core/build.gradle new file mode 100644 index 0000000000..13c049ad61 --- /dev/null +++ b/core/build.gradle @@ -0,0 +1,11 @@ +apply plugin: "java" + +sourceCompatibility = 1.8 +[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' + +sourceSets.main.java.srcDirs = [ "src/" ] + + +eclipse.project { + name = appName + "-core" +} diff --git a/core/src/Moment.gwt.xml b/core/src/Moment.gwt.xml new file mode 100644 index 0000000000..bf796234bc --- /dev/null +++ b/core/src/Moment.gwt.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/core/src/io/anuke/moment/Control.java b/core/src/io/anuke/moment/Control.java new file mode 100644 index 0000000000..e9b3083128 --- /dev/null +++ b/core/src/io/anuke/moment/Control.java @@ -0,0 +1,381 @@ +package io.anuke.moment; + +import static io.anuke.moment.world.TileType.tilesize; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.Input.Buttons; +import com.badlogic.gdx.Input.Keys; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.GL20; +import com.badlogic.gdx.math.MathUtils; +import com.badlogic.gdx.math.Rectangle; +import com.badlogic.gdx.math.Vector2; + +import io.anuke.gif.GifRecorder; +import io.anuke.moment.ai.Pathfind; +import io.anuke.moment.entities.Enemy; +import io.anuke.moment.entities.TileEntity; +import io.anuke.moment.resource.ItemStack; +import io.anuke.moment.world.Tile; +import io.anuke.moment.world.TileType; +import io.anuke.ucore.core.*; +import io.anuke.ucore.entities.*; +import io.anuke.ucore.graphics.Atlas; +import io.anuke.ucore.graphics.Hue; +import io.anuke.ucore.modules.RendererModule; +import io.anuke.ucore.scene.style.Styles; +import io.anuke.ucore.scene.utils.Cursors; +import io.anuke.ucore.util.Mathf; +import io.anuke.ucore.util.Timers; + +public class Control extends RendererModule{ + GifRecorder recorder = new GifRecorder(batch); + int rangex = 10, rangey = 10; + float breaktime = 0; + float breakdur = 50; + + public Control() { + atlas = new Atlas("moment.atlas"); + cameraScale = 4f; + setPixelation(); + buffers.add("shadow", (int) (Gdx.graphics.getWidth() / cameraScale), (int) (Gdx.graphics.getHeight() / cameraScale)); + } + + @Override + public void init(){ + DrawContext.font = Styles.styles.font(); + + Entities.initPhysics(0, 0, main.pixsize, main.pixsize); + + Effect.addDraw("place", 16, e -> { + Draw.thickness(3f - e.ifract() * 2f); + Draw.square(e.x, e.y, TileType.tilesize / 2 + e.ifract() * 3f); + Draw.clear(); + }); + + Effect.addDraw("spark", 10, e -> { + Draw.thickness(1f); + Draw.color(Hue.mix(Color.WHITE, Color.GRAY, e.ifract())); + Draw.spikes(e.x, e.y, e.ifract() * 5f, 2, 8); + Draw.clear(); + }); + + Effect.addDraw("smelt", 10, e -> { + Draw.thickness(1f); + Draw.color(Hue.mix(Color.YELLOW, Color.RED, e.ifract())); + Draw.spikes(e.x, e.y, e.ifract() * 5f, 2, 8); + Draw.clear(); + }); + + Effect.addDraw("break", 12, e -> { + Draw.thickness(2f); + Draw.color(Color.WHITE, Color.GRAY, e.ifract()); + Draw.spikes(e.x, e.y, e.ifract() * 5f, 2, 5); + Draw.clear(); + }); + + Effect.addDraw("hit", 10, e -> { + Draw.thickness(1f); + Draw.color(Hue.mix(Color.WHITE, Color.ORANGE, e.ifract())); + Draw.spikes(e.x, e.y, e.ifract() * 3f, 2, 8); + Draw.clear(); + }); + + Effect.addDraw("explosion", 15, e -> { + Draw.thickness(2f); + Draw.color(Hue.mix(Color.ORANGE, Color.GRAY, e.ifract())); + Draw.spikes(e.x, e.y, 2f + e.ifract() * 3f, 4, 6); + Draw.circle(e.x, e.y, 3f + e.ifract() * 3f); + Draw.clear(); + }); + + Effect.addDraw("ind", 100, e -> { + Draw.thickness(3f); + Draw.color("royal"); + Draw.circle(e.x, e.y, 3); + Draw.clear(); + }); + + Pathfind.updatePath(); + } + + public void tryMove(SolidEntity e, float x, float y){ + e.getBoundingBox(Rectangle.tmp); + Rectangle.tmp.setSize(Rectangle.tmp.width * 0.5f); + + if(!overlaps(Rectangle.tmp, e.x + x, e.y)){ + e.x += x; + } + + if(!overlaps(Rectangle.tmp, e.x, e.y + y)){ + e.y += y; + } + } + + boolean overlaps(Rectangle rect, float x, float y){ + int r = 1; + rect.setCenter(x, y); + int tilex = Mathf.scl2(x, tilesize); + int tiley = Mathf.scl2(y, tilesize); + + for(int dx = -r; dx <= r; dx++){ + for(int dy = -r; dy <= r; dy++){ + Tile tile = main.tile(tilex + dx, tiley + dy); + if(tile != null && tile.block().solid && Rectangle.tmp2.setSize(tilesize).setCenter(tile.worldx(), tile.worldy()).overlaps(rect)){ + return true; + } + } + } + return false; + } + + Rectangle getRect(int x, int y){ + return Rectangle.tmp2.setSize(tilesize).setCenter(x * tilesize, y * tilesize); + } + + void input(){ + + if(UInput.keyUp("rotate")) + main.rotation++; + + main.rotation %= 4; + + if(main.recipe != null && !main.hasItems(main.recipe.requirements)){ + main.recipe = null; + Cursors.restoreCursor(); + } + + if(UInput.keyUp(Keys.G)) + new Enemy(0).set(main.player.x, main.player.y).add(); + + if(UInput.buttonUp(Buttons.LEFT) && main.recipe != null && validPlace(tilex(), tiley(), main.recipe.result) && !get(UI.class).hasMouse()){ + Tile tile = main.tile(tilex(), tiley()); + if(tile == null) + return; //just in ase + + tile.setBlock(main.recipe.result); + tile.rotation = main.rotation; + + Pathfind.updatePath(); + + Effects.effect("place", roundx(), roundy()); + Effects.shake(2f, 2f); + + for(ItemStack stack : main.recipe.requirements){ + main.removeItem(stack); + } + + if(!main.hasItems(main.recipe.requirements)){ + main.recipe = null; + Cursors.restoreCursor(); + } + } + + if(main.recipe != null && UInput.buttonUp(Buttons.RIGHT)){ + main.recipe = null; + Cursors.restoreCursor(); + } + + //block breaking + if(UInput.buttonDown(Buttons.RIGHT) && cursorNear() && main.tile(tilex(), tiley()).artifical() + && main.tile(tilex(), tiley()).block() != TileType.core){ + Tile tile = main.tile(tilex(), tiley()); + breaktime += delta(); + if(breaktime >= breakdur){ + Effects.effect("break", tile.entity); + Effects.shake(3f, 1f); + tile.setBlock(TileType.air); + Pathfind.updatePath(); + breaktime = 0f; + } + }else{ + breaktime = 0f; + } + + } + + float roundx(){ + return Mathf.round2(UGraphics.mouseWorldPos().x, TileType.tilesize); + } + + float roundy(){ + return Mathf.round2(UGraphics.mouseWorldPos().y, TileType.tilesize); + } + + int tilex(){ + return Mathf.scl2(UGraphics.mouseWorldPos().x, TileType.tilesize); + } + + int tiley(){ + return Mathf.scl2(UGraphics.mouseWorldPos().y, TileType.tilesize); + } + + boolean validPlace(int x, int y, TileType tile){ + + if(!cursorNear()) + return false; + + for(SolidEntity e : Entities.getNearby(x * tilesize, y * tilesize, tilesize * 2f)){ + Rectangle.tmp.setSize(e.hitsize); + Rectangle.tmp.setCenter(e.x, e.y); + + if(getRect(x, y).overlaps(Rectangle.tmp)){ + return false; + } + } + return main.tiles[x][y].block() == TileType.air; + } + + boolean cursorNear(){ + return Vector2.dst(main.player.x, main.player.y, tilex() * tilesize, tiley() * tilesize) <= main.placerange; + } + + @Override + public void update(){ + if(Gdx.input.isKeyJustPressed(Keys.ESCAPE)) + Gdx.app.exit(); + + Entities.update(); + + input(); + camera.position.set(main.player.x, main.player.y, 0f); + clampCamera(-tilesize / 2f, -tilesize / 2f, main.pixsize - tilesize / 2f, main.pixsize - tilesize / 2f); + + drawDefault(); + + recorder.update(); + } + + @Override + public void draw(){ + Draw.clear(); + + for(int l = 0; l < 4; l++){ + if(l == 1){ + batch.end(); + buffers.end("pixel"); + + buffers.begin("shadow"); + + batch.begin(); + Gdx.gl.glClearColor(0, 0, 0, 0); + Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); + } + for(int x = -rangex; x <= rangex; x++){ + for(int y = -rangey; y <= rangey; y++){ + int worldx = Mathf.scl(camera.position.x, tilesize) + x; + int worldy = Mathf.scl(camera.position.y, tilesize) + y; + + if(Mathf.inBounds(worldx, worldy, main.tiles)){ + Tile tile = main.tiles[worldx][worldy]; + if(l == 1){ + if(tile.block() != TileType.air) + Draw.rect("shadow", worldx * tilesize, worldy * tilesize); + }else if(l == 0 || l == 2){ + (l == 0 ? tile.floor() : tile.block()).draw(tile); + }else{ + tile.block().drawOver(tile); + } + } + } + } + + if(l == 1){ + batch.end(); + buffers.end("shadow"); + batch.setColor(0, 0, 0, 0.15f); + + buffers.begin("pixel"); + + drawFull("shadow"); + batch.setColor(Color.WHITE); + batch.setProjectionMatrix(camera.combined); + + batch.begin(); + } + } + + Entities.draw(); + + if(main.recipe != null && !get(UI.class).hasMouse()){ + float x = Mathf.round2(UGraphics.mouseWorldPos().x, tilesize); + float y = Mathf.round2(UGraphics.mouseWorldPos().y, tilesize); + + boolean valid = validPlace(tilex(), tiley(), main.recipe.result); + + Draw.color(valid ? Color.PURPLE : Color.SCARLET); + Draw.thickness(2f); + Draw.square(x, y, TileType.tilesize / 2 + MathUtils.sin(Timers.time() / 6f) + 1); + + if(main.recipe.result.rotate){ + Draw.color("orange"); + vector.set(7, 0).rotate(main.rotation * 90); + Draw.line(x, y, x + vector.x, y + vector.y); + } + + if(valid) + Cursors.setHand(); + else + Cursors.restoreCursor(); + } + + //block breaking + if(UInput.buttonDown(Buttons.RIGHT) && cursorNear()){ + Tile tile = main.tile(tilex(), tiley()); + if(tile.artifical() && tile.block() != TileType.core){ + Draw.color(Color.YELLOW, Color.SCARLET, breaktime / breakdur); + Draw.square(tile.worldx(), tile.worldy(), 4); + Draw.clear(); + } + } + + if(main.recipe == null && !get(UI.class).hasMouse()){ + Tile tile = main.tiles[tilex()][tiley()]; + + if(tile.block() != TileType.air){ + if(tile.block().name().contains("turret")){ + Draw.color("green"); + Draw.dashcircle(tile.worldx(), tile.worldy(), tile.block().range); + Draw.clear(); + } + if(tile.entity != null) + drawHealth(tile.entity); + } + } + + for(Entity entity : Entities.all()){ + if(entity instanceof DestructibleEntity && !(entity instanceof TileEntity)){ + DestructibleEntity dest = ((DestructibleEntity) entity); + + drawHealth(dest); + } + } + + //Draw.text(Gdx.graphics.getFramesPerSecond() + " FPS", main.player.x, main.player.y); + } + + void drawHealth(DestructibleEntity dest){ + float len = 3; + float offset = 7; + Draw.thickness(3f); + Draw.color(Color.GRAY); + Draw.line(dest.x - len + 1, dest.y - offset, dest.x + len + 1, dest.y - offset); + Draw.thickness(1f); + Draw.color(Color.BLACK); + Draw.line(dest.x - len + 1, dest.y - offset, dest.x + len, dest.y - offset); + Draw.color(Color.RED); + Draw.line(dest.x - len + 1, dest.y - offset, dest.x - len + len * 2 * ((float) dest.health / dest.maxhealth), dest.y - offset); + Draw.clear(); + } + + @Override + public void resize(int width, int height){ + super.resize(width, height); + + buffers.remove("shadow"); + buffers.add("shadow", (int) (Gdx.graphics.getWidth() / cameraScale), (int) (Gdx.graphics.getHeight() / cameraScale)); + + rangex = (int) (width / tilesize / cameraScale); + rangey = (int) (height / tilesize / cameraScale); + } +} diff --git a/core/src/io/anuke/moment/Moment.java b/core/src/io/anuke/moment/Moment.java new file mode 100644 index 0000000000..cc5d713ef1 --- /dev/null +++ b/core/src/io/anuke/moment/Moment.java @@ -0,0 +1,169 @@ +package io.anuke.moment; + +import com.badlogic.gdx.Input.Keys; +import com.badlogic.gdx.utils.Array; +import com.badlogic.gdx.utils.ObjectMap; + +import io.anuke.aabb.Collider; +import io.anuke.moment.entities.Enemy; +import io.anuke.moment.entities.Player; +import io.anuke.moment.resource.Item; +import io.anuke.moment.resource.ItemStack; +import io.anuke.moment.resource.Recipe; +import io.anuke.moment.world.Generator; +import io.anuke.moment.world.Tile; +import io.anuke.moment.world.TileType; +import io.anuke.ucore.core.KeyBinds; +import io.anuke.ucore.core.Settings; +import io.anuke.ucore.core.UInput; +import io.anuke.ucore.modules.ModuleController; +import io.anuke.ucore.util.Mathf; +import io.anuke.ucore.util.Timers; + +public class Moment extends ModuleController{ + public static Moment i; + public Player player; + public int size = 128; + public int pixsize = size*TileType.tilesize; + public Tile[][] tiles = new Tile[size][size]; + public ObjectMap items = new ObjectMap<>(); + public Recipe recipe; + public int rotation; + public float placerange = 60; + + public int wave = 1; + public float wavespace = 2000/100; + public float wavetime = wavespace; + public Tile core; + public Array spawnpoints = new Array(); + + @Override + public void init(){ + i = this; + + addModule(new Control()); + addModule(new UI()); + } + + @Override + public void setup(){ + KeyBinds.defaults( + "up", Keys.W, + "left", Keys.A, + "down", Keys.S, + "right", Keys.D, + "rotate", Keys.R + ); + + Settings.loadAll("io.anuke.moment"); + + for(int x = 0; x < size; x ++){ + for(int y = 0; y < size; y ++){ + tiles[x][y] = new Tile(x, y, TileType.grass); + } + } + + generate(); + + items.put(Item.stone, 200); + items.put(Item.iron, 200); + + Collider.defaultDrag = 0.2f; + + player = new Player().add(); + + player.x = core.worldx(); + player.y = core.worldy()+10; + } + + @Override + public void update(){ + super.update(); + + if(Enemy.amount == 0) + wavetime -= delta(); + + if(wavetime < 0 || UInput.keyUp(Keys.F)){ + runWave(); + } + } + + public void coreDestroyed(){ + //TODO "you lose" message or something + } + + void generate(){ + Generator.generate(tiles, "map"); + core.setBlock(TileType.core); + int x = core.x, y = core.y; + + set(x, y-1, TileType.conveyor, 1); + set(x, y-2, TileType.router, 0); + set(x, y-3, TileType.conveyor, 1); + set(x, y-4, TileType.stonedrill, 0); + //just in case + tiles[x][y-4].setFloor(TileType.stone); + + set(x+1, y-2, TileType.conveyor, 0); + set(x+2, y-2, TileType.conveyor, 1); + set(x+2, y-1, TileType.conveyor, 1); + set(x+2, y, TileType.turret, 0); + + set(x-1, y-2, TileType.conveyor, 2); + set(x-2, y-2, TileType.conveyor, 1); + set(x-2, y-1, TileType.conveyor, 1); + set(x-2, y, TileType.turret, 0); + } + + void set(int x, int y, TileType type, int rot){ + tiles[x][y].setBlock(type); + tiles[x][y].rotation = rot; + } + + public void runWave(){ + int amount = 3*wave; + + for(int i = 0; i < amount; i ++){ + int point = i%spawnpoints.size; + Tile tile = spawnpoints.get(point); + + Timers.run((int)(i/spawnpoints.size)*40f, ()->{ + new Enemy(point).set(tile.worldx(), tile.worldy()).add(); + }); + + } + + wave ++; + wavetime = wavespace; + } + + public Tile tile(int x, int y){ + if(!Mathf.inBounds(x, y, tiles)) return null; + return tiles[x][y]; + } + + public Tile spawn(){ + return tiles[size/2][size-1]; + } + + public void addItem(Item item, int amount){ + items.put(item, items.get(item, 0)+amount); + get(UI.class).updateItems(); + } + + public boolean hasItems(ItemStack[] items){ + for(ItemStack stack : items) + if(!hasItem(stack)) + return false; + return true; + } + + public boolean hasItem(ItemStack req){ + return items.get(req.item, 0) >= req.amount; + } + + public void removeItem(ItemStack req){ + items.put(req.item, items.get(req.item, 0)-req.amount); + get(UI.class).updateItems(); + } +} diff --git a/core/src/io/anuke/moment/UI.java b/core/src/io/anuke/moment/UI.java new file mode 100644 index 0000000000..7d065e223e --- /dev/null +++ b/core/src/io/anuke/moment/UI.java @@ -0,0 +1,194 @@ +package io.anuke.moment; + +import static io.anuke.moment.world.TileType.tilesize; + +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.utils.Align; + +import io.anuke.moment.entities.Enemy; +import io.anuke.moment.resource.Item; +import io.anuke.moment.resource.ItemStack; +import io.anuke.moment.resource.Recipe; +import io.anuke.moment.world.Tile; +import io.anuke.moment.world.TileType; +import io.anuke.ucore.core.Draw; +import io.anuke.ucore.core.UGraphics; +import io.anuke.ucore.modules.SceneModule; +import io.anuke.ucore.scene.builders.*; +import io.anuke.ucore.scene.style.Styles; +import io.anuke.ucore.scene.ui.*; +import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.ucore.util.Mathf; + +public class UI extends SceneModule{ + Table itemtable; + + public UI(){ + Styles.styles.font().setUseIntegerPositions(false); + TooltipManager.getInstance().animations = false; + } + + @Override + public void update(){ + scene.getBatch().setProjectionMatrix(get(Control.class).camera.combined); + scene.getBatch().begin(); + Tile tile = main.tiles[tilex()][tiley()]; + if(tile.block() != TileType.air){ + String error = tile.block().error(tile); + if(error != null){ + Draw.tcolor(Color.SCARLET); + Draw.tscl(1/8f); + Draw.text(error, tile.worldx(), tile.worldy()+tilesize); + + }else if(tile.block().name().contains("turret")){ + Draw.tscl(1/8f); + Draw.tcolor(Color.GREEN); + Draw.text("Ammo: " + tile.entity.shots, tile.worldx(), tile.worldy()-tilesize); + } + + Draw.tscl(0.5f); + Draw.clear(); + } + scene.getBatch().end(); + + super.update(); + } + + @Override + public void init(){ + + build.begin(scene); + + new table(){{ + abottom(); + aright(); + + new table(){{ + + get().background("button"); + + for(Recipe r : Recipe.values()){ + Image image = new Image(Draw.region(r.result.name())); + + new button(r.result.name(), ()->{ + main.recipe = r; + }){{ + get().clearChildren(); + get().pad(10f); + get().add(image).size(42).padRight(4f); + Table table = new Table(); + table.add(get().getLabel()).left(); + get().add(table); + get().left(); + + ItemStack[] req = r.requirements; + for(ItemStack stack : req){ + table.row(); + table.add("[YELLOW]"+stack.amount +"x " +stack.item.name()).left(); + } + get().getLabel().setAlignment(Align.left); + + String description = r.result.description(); + if(r.result.ammo != null){ + description += "\n[SALMON]Ammo: " + r.result.ammo.name(); + } + + Table tiptable = new Table(); + tiptable.background("button"); + tiptable.add("[PURPLE]"+r.result.name(), 0.5f).left().padBottom(2f); + tiptable.row(); + tiptable.add("[ORANGE]"+description).left(); + tiptable.pad(8f); + + Tooltip tip = new Tooltip(tiptable); + tip.setInstant(true); + + get().addListener(tip); + + Recipe current = r; + get().update(()->{ + get().setDisabled(!main.hasItems(current.requirements)); + //get().setTouchable(!main.hasItems(current.requirements) ? Touchable.disabled : Touchable.enabled); + }); + + }}.width(220f); + + row(); + } + + get().pad(20f); + + }}.right().bottom(); + + }}.end(); + + new table(){{ + atop(); + aleft(); + itemtable = new table().top().left().get(); + itemtable.background("button"); + }}.end(); + + //wave table... + new table(){{ + atop(); + aright(); + + new table(){{ + get().background("button"); + + new label("Wave 1"){{ + get().setFontScale(1f); + get().update(()->{ + get().setText("[YELLOW]Wave " + Moment.i.wave); + }); + }}.left(); + + row(); + + new label("Time"){{ + get().update(()->{ + get().setText(Enemy.amount > 0 ? + Enemy.amount+" Enemies remaining" : "New wave in " + (int)(main.wavetime/60f)); + }); + }}.minWidth(150); + + get().pad(8); + }}; + }}.end(); + + + updateItems(); + + build.end(); + } + + public void updateItems(){ + itemtable.clear(); + + for(Item stack : main.items.keys()){ + Image image = new Image(Draw.region("icon-" + stack.name())); + Label label = new Label(""+ main.items.get(stack)); + label.setFontScale(1f); + itemtable.add(image).size(32); + itemtable.add(label); + itemtable.row(); + } + } + + float roundx(){ + return Mathf.round2(UGraphics.mouseWorldPos().x, TileType.tilesize); + } + + float roundy(){ + return Mathf.round2(UGraphics.mouseWorldPos().y, TileType.tilesize); + } + + int tilex(){ + return Mathf.scl2(UGraphics.mouseWorldPos().x, TileType.tilesize); + } + + int tiley(){ + return Mathf.scl2(UGraphics.mouseWorldPos().y, TileType.tilesize); + } +} diff --git a/core/src/io/anuke/moment/ai/MHueristic.java b/core/src/io/anuke/moment/ai/MHueristic.java new file mode 100644 index 0000000000..cdab21f3fb --- /dev/null +++ b/core/src/io/anuke/moment/ai/MHueristic.java @@ -0,0 +1,22 @@ +package io.anuke.moment.ai; + +import com.badlogic.gdx.ai.pfa.Heuristic; + +import io.anuke.moment.world.Tile; +import io.anuke.moment.world.TileType; + +public class MHueristic implements Heuristic{ + //so this means that the cost of going through solids is 10x going through non solids + float multiplier = 10f; + + @Override + public float estimate(Tile node, Tile other){ + float cost = Math.abs(node.worldx() - other.worldx()) + Math.abs(node.worldy() - other.worldy()); + + //TODO balance multiplier + if(node.artifical() && node.block().solid) cost += TileType.tilesize*multiplier; + if(other.artifical() && other.block().solid) cost += TileType.tilesize*multiplier; + return cost; + } + +} diff --git a/core/src/io/anuke/moment/ai/PassTileGraph.java b/core/src/io/anuke/moment/ai/PassTileGraph.java new file mode 100644 index 0000000000..b3958095bb --- /dev/null +++ b/core/src/io/anuke/moment/ai/PassTileGraph.java @@ -0,0 +1,38 @@ +package io.anuke.moment.ai; + +import com.badlogic.gdx.ai.pfa.Connection; +import com.badlogic.gdx.ai.pfa.indexed.IndexedGraph; +import com.badlogic.gdx.utils.Array; + +import io.anuke.moment.Moment; +import io.anuke.moment.world.Tile; + +/**Tilegraph that ignores player-made tiles.*/ +public class PassTileGraph implements IndexedGraph{ + private Array> tempConnections = new Array>(); + + @Override + public Array> getConnections(Tile fromNode){ + tempConnections.clear(); + + if(fromNode.block().solid && !fromNode.block().update) + return tempConnections; + + for(Tile tile : fromNode.getNearby()){ + if(tile != null && (!tile.block().solid || tile.block().update)) + tempConnections.add(new TileConnection(fromNode, tile)); + } + + return tempConnections; + } + + @Override + public int getIndex(Tile node){ + return node.x+node.y*Moment.i.size; + } + + @Override + public int getNodeCount(){ + return Moment.i.size*Moment.i.size; + } +} diff --git a/core/src/io/anuke/moment/ai/Pathfind.java b/core/src/io/anuke/moment/ai/Pathfind.java new file mode 100644 index 0000000000..d9953cafa9 --- /dev/null +++ b/core/src/io/anuke/moment/ai/Pathfind.java @@ -0,0 +1,96 @@ +package io.anuke.moment.ai; + +import com.badlogic.gdx.ai.pfa.DefaultGraphPath; +import com.badlogic.gdx.ai.pfa.indexed.IndexedAStarPathFinder; +import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.utils.Array; + +import io.anuke.moment.Moment; +import io.anuke.moment.entities.Enemy; +import io.anuke.moment.world.Tile; +import io.anuke.ucore.entities.Entities; +import io.anuke.ucore.entities.Entity; + +public class Pathfind{ + static MHueristic heuristic = new MHueristic(); + static TileGraph graph = new TileGraph(); + static PassTileGraph passgraph = new PassTileGraph(); + static IndexedAStarPathFinder pathfinder = new IndexedAStarPathFinder(graph); + static IndexedAStarPathFinder passpathfinder = new IndexedAStarPathFinder(passgraph); + static Array> paths = new Array<>(); + static Vector2 vector = new Vector2(); + + static public Vector2 find(Enemy enemy){ + if(enemy.node == -1){ + findNode(enemy); + } + + //-1 is only possible here if both pathfindings failed, which should NOT happen + //check graph code + + DefaultGraphPath path = paths.get(enemy.spawn); + + Tile target = path.get(enemy.node); + + float dst = Vector2.dst(enemy.x, enemy.y, target.worldx(), target.worldy()); + + if(dst < 2){ + if(enemy.node <= path.getCount()-2) + enemy.node ++; + + target = path.get(enemy.node); + } + + + return vector.set(target.worldx(), target.worldy()); + + } + + static public void updatePath(){ + if(paths.size == 0){ + for(int i = 0; i < Moment.i.spawnpoints.size; i ++){ + DefaultGraphPath path = new DefaultGraphPath<>(); + paths.add(path); + } + } + + int i = 0; + for(DefaultGraphPath path : paths){ + path.clear(); + passpathfinder.searchNodePath( + Moment.i.spawnpoints.get(i), + Moment.i.core, heuristic, path); + + //for(Tile tile : path){ + // Effects.effect("ind", tile.worldx(), tile.worldy()); + ///} + i++; + } + + for(Entity e : Entities.all()){ + if(e instanceof Enemy){ + findNode((Enemy)e); + } + } + } + + static void findNode(Enemy enemy){ + DefaultGraphPath path = paths.get(enemy.spawn); + + Tile closest = null; + float ldst = 0f; + int cindex = -1; + + for(int i = 0; i < path.getCount(); i ++){ + Tile tile = path.get(i); + float dst = Vector2.dst(tile.worldx(), tile.worldy(), enemy.x, enemy.y); + + if(closest == null || dst < ldst){ + ldst = dst; + closest = tile; + cindex = i; + } + } + enemy.node = cindex; + } +} diff --git a/core/src/io/anuke/moment/ai/TileConnection.java b/core/src/io/anuke/moment/ai/TileConnection.java new file mode 100644 index 0000000000..7f446eddfd --- /dev/null +++ b/core/src/io/anuke/moment/ai/TileConnection.java @@ -0,0 +1,30 @@ +package io.anuke.moment.ai; + +import com.badlogic.gdx.ai.pfa.Connection; + +import io.anuke.moment.world.Tile; + +public class TileConnection implements Connection{ + Tile a, b; + + public TileConnection(Tile a, Tile b){ + this.a = a; + this.b = b; + } + + @Override + public float getCost(){ + return Math.abs(a.worldx() - b.worldx()) + Math.abs(a.worldy() - b.worldy()); + } + + @Override + public Object getFromNode(){ + return a; + } + + @Override + public Object getToNode(){ + return b; + } + +} diff --git a/core/src/io/anuke/moment/ai/TileGraph.java b/core/src/io/anuke/moment/ai/TileGraph.java new file mode 100644 index 0000000000..9f404388e6 --- /dev/null +++ b/core/src/io/anuke/moment/ai/TileGraph.java @@ -0,0 +1,36 @@ +package io.anuke.moment.ai; + +import com.badlogic.gdx.ai.pfa.Connection; +import com.badlogic.gdx.ai.pfa.indexed.IndexedGraph; +import com.badlogic.gdx.utils.Array; + +import io.anuke.moment.Moment; +import io.anuke.moment.world.Tile; + +public class TileGraph implements IndexedGraph{ + private Array> tempConnections = new Array>(); + + @Override + public Array> getConnections(Tile fromNode){ + tempConnections.clear(); + + if(fromNode.block().solid && fromNode != Moment.i.core) + return tempConnections; + + for(Tile tile : fromNode.getNearby()){ + if(tile != null && (!tile.block().solid || tile == Moment.i.core)) + tempConnections.add(new TileConnection(fromNode, tile)); + } + return tempConnections; + } + + @Override + public int getIndex(Tile node){ + return node.x+node.y*Moment.i.size; + } + + @Override + public int getNodeCount(){ + return Moment.i.size*Moment.i.size; + } +} diff --git a/core/src/io/anuke/moment/entities/Bullet.java b/core/src/io/anuke/moment/entities/Bullet.java new file mode 100644 index 0000000000..37d88ae300 --- /dev/null +++ b/core/src/io/anuke/moment/entities/Bullet.java @@ -0,0 +1,32 @@ +package io.anuke.moment.entities; + +import io.anuke.ucore.entities.BulletEntity; +import io.anuke.ucore.entities.Entity; +import io.anuke.ucore.entities.SolidEntity; + +public class Bullet extends BulletEntity{ + BulletType type; + + public Bullet(BulletType type, Entity owner, float x, float y, float angle){ + super(owner, type.speed, angle); + set(x, y); + this.lifetime = type.lifetime; + this.type = type; + } + + public void draw(){ + type.draw(this); + } + + @Override + public void collision(SolidEntity other){ + super.collision(other); + type.collide(this); + } + + @Override + public int getDamage(){ + return type.damage; + } + +} diff --git a/core/src/io/anuke/moment/entities/BulletType.java b/core/src/io/anuke/moment/entities/BulletType.java new file mode 100644 index 0000000000..44cc28d155 --- /dev/null +++ b/core/src/io/anuke/moment/entities/BulletType.java @@ -0,0 +1,51 @@ +package io.anuke.moment.entities; + +import com.badlogic.gdx.graphics.Color; + +import io.anuke.ucore.core.Draw; +import io.anuke.ucore.entities.Effects; + +public enum BulletType{ + stone(1.5f, 2){ + public void draw(Bullet b){ + Draw.color("gray"); + Draw.square(b.x, b.y, 1f); + Draw.clear(); + } + }, + iron(1.7f, 2){ + public void draw(Bullet b){ + Draw.color("gray"); + Draw.rect("bullet", b.x, b.y, b.angle()); + Draw.clear(); + } + }, + small(1.5f, 1){ + public void draw(Bullet b){ + Draw.color("orange"); + Draw.rect("bullet", b.x, b.y, b.angle()); + Draw.clear(); + } + }, + shot(2.4f, 2){ + {lifetime=40;} + public void draw(Bullet b){ + Draw.color(Color.GOLD); + Draw.rect("bullet", b.x, b.y, b.angle()); + Draw.clear(); + } + };; + public float speed; + public int damage; + public float lifetime = 60; + + private BulletType(float speed, int damage){ + this.speed = speed; + this.damage = damage; + } + + public void collide(Bullet b){ + Effects.effect("hit", b); + } + public void draw(Bullet b){} +} diff --git a/core/src/io/anuke/moment/entities/Enemy.java b/core/src/io/anuke/moment/entities/Enemy.java new file mode 100644 index 0000000000..d5dcec3d35 --- /dev/null +++ b/core/src/io/anuke/moment/entities/Enemy.java @@ -0,0 +1,89 @@ +package io.anuke.moment.entities; + +import com.badlogic.gdx.math.Vector2; + +import io.anuke.moment.Control; +import io.anuke.moment.Moment; +import io.anuke.moment.ai.Pathfind; +import io.anuke.ucore.core.Draw; +import io.anuke.ucore.entities.*; +import io.anuke.ucore.util.Timers; + +public class Enemy extends DestructibleEntity{ + public static int amount = 0; + + public Vector2 direction = new Vector2(); + public float xvelocity, yvelocity; + public float speed = 0.3f; + public int node = -1; + public Entity target; + public int spawn; + public float reload = 40; + + public Enemy(int spawn){ + this.spawn = spawn; + + hitsize = 5; + + maxhealth = 30; + heal(); + + amount ++; + } + + void move(){ + Vector2 vec = Pathfind.find(this); + vec.sub(x, y).setLength(speed); + + Moment.module(Control.class).tryMove(this, vec.x*delta, vec.y*delta); + + target = Entities.getClosest(x, y, 60, e->{ + return (e instanceof TileEntity || e instanceof Player); + }); + + if(target != null){ + if(Timers.get(this, reload)) + new Bullet(BulletType.small, this, x, y, direction.angle()).add(); + } + } + + @Override + public boolean collides(SolidEntity other){ + return (other instanceof Bullet) && !(((Bullet)other).owner instanceof Enemy); + } + + @Override + public void onDeath(){ + Effects.effect("explosion", this); + Effects.shake(3f, 4f); + remove(); + } + + @Override + public void removed(){ + amount --; + } + + @Override + public void update(){ + float lastx = x, lasty = y; + + move(); + + xvelocity = x - lastx; + yvelocity = y-lasty; + + if(target == null){ + direction.add(xvelocity, yvelocity); + direction.limit(speed*8); + }else{ + float angle = angleTo(target); + direction.lerp(vector.set(0, 1).setAngle(angle), 0.25f); + } + } + + @Override + public void draw(){ + Draw.rect("mech1", x, y, direction.angle()-90); + } +} diff --git a/core/src/io/anuke/moment/entities/Player.java b/core/src/io/anuke/moment/entities/Player.java new file mode 100644 index 0000000000..e6dc45f804 --- /dev/null +++ b/core/src/io/anuke/moment/entities/Player.java @@ -0,0 +1,74 @@ +package io.anuke.moment.entities; + +import com.badlogic.gdx.Input.Buttons; +import com.badlogic.gdx.math.Vector2; + +import io.anuke.moment.Control; +import io.anuke.moment.Moment; +import io.anuke.moment.UI; +import io.anuke.ucore.core.Draw; +import io.anuke.ucore.core.UInput; +import io.anuke.ucore.entities.DestructibleEntity; +import io.anuke.ucore.util.Angles; + +public class Player extends DestructibleEntity{ + Vector2 direction = new Vector2(); + float speed = 2f; + float rotation; + float reload; + Weapon weapon = Weapon.blaster; + + public Player(){ + hitsize = 5; + + maxhealth = 100; + heal(); + } + + @Override + public void removed(){ + } + + @Override + public void draw(){ + Draw.rect("player", x, y, direction.angle()-90); + } + + @Override + public void update(){ + vector.set(0, 0); + + if(UInput.keyDown("up")) + vector.y += speed; + if(UInput.keyDown("down")) + vector.y -= speed; + if(UInput.keyDown("left")) + vector.x -= speed; + if(UInput.keyDown("right")) + vector.x += speed; + + reload -= delta; + + boolean shooting = UInput.buttonDown(Buttons.LEFT) && Moment.i.recipe == null && !Moment.module(UI.class).hasMouse(); + + if(shooting && reload <= 0){ + weapon.shoot(this); + reload = weapon.reload; + } + + vector.limit(speed); + + //x += vector.x*delta; + //y += vector.y*delta; + + Moment.module(Control.class).tryMove(this, vector.x*delta, vector.y*delta); + + if(!shooting){ + direction.add(vector.scl(delta)); + direction.limit(speed*6); + }else{ + float angle = Angles.mouseAngle(x, y); + direction.lerp(vector.set(0, 1).setAngle(angle), 0.26f); + } + } +} diff --git a/core/src/io/anuke/moment/entities/TileEntity.java b/core/src/io/anuke/moment/entities/TileEntity.java new file mode 100644 index 0000000000..3fe5c73d77 --- /dev/null +++ b/core/src/io/anuke/moment/entities/TileEntity.java @@ -0,0 +1,96 @@ +package io.anuke.moment.entities; + +import com.badlogic.gdx.utils.DelayedRemovalArray; +import com.badlogic.gdx.utils.ObjectMap; + +import io.anuke.moment.Moment; +import io.anuke.moment.ai.Pathfind; +import io.anuke.moment.resource.Item; +import io.anuke.moment.world.Tile; +import io.anuke.moment.world.TileType; +import io.anuke.ucore.entities.DestructibleEntity; +import io.anuke.ucore.entities.Effects; +import io.anuke.ucore.entities.SolidEntity; + +public class TileEntity extends DestructibleEntity{ + public final Tile tile; + public DelayedRemovalArray convey = new DelayedRemovalArray<>(); + public ObjectMap items = new ObjectMap<>(); + public int shots; + public TileEntity link; + public float rotation; + + public TileEntity(Tile tile){ + this.tile = tile; + x = tile.worldx(); + y = tile.worldy(); + hitsize = TileType.tilesize; + + maxhealth = tile.block().health; + heal(); + } + + @Override + public boolean collides(SolidEntity other){ + return (other instanceof Bullet) && ((Bullet)other).owner instanceof Enemy; + } + + @Override + public void onDeath(){ + if(tile.block() == TileType.core){ + Moment.i.coreDestroyed(); + } + tile.setBlock(TileType.air); + Pathfind.updatePath(); + Effects.shake(4f, 4f); + Effects.effect("explosion", this); + } + + @Override + public void update(){ + tile.block().update(tile); + } + + public int totalItems(){ + int sum = 0; + for(Item item : Item.values()){ + sum += items.get(item, 0); + } + return sum; + } + + public boolean hasItem(Item item){ + return items.get(item, 0) > 0; + } + + public void addItem(Item item, int amount){ + items.put(item, items.get(item, 0) + amount); + } + + public void removeItem(Item item, int amount){ + items.put(item, items.get(item, 0) - amount); + } + + public void addConvey(Item item){ + addConvey(item, 0); + } + + public void addConvey(Item item, float pos){ + ItemPos posa = new ItemPos(item); + posa.pos = pos; + convey.add(posa); + } + + public void removeConvey(ItemPos pos){ + convey.removeValue(pos, true); + } + + static public class ItemPos{ + public Item item; + public float pos; + + public ItemPos(Item item){ + this.item = item; + } + } +} diff --git a/core/src/io/anuke/moment/entities/Weapon.java b/core/src/io/anuke/moment/entities/Weapon.java new file mode 100644 index 0000000000..02ade49ab7 --- /dev/null +++ b/core/src/io/anuke/moment/entities/Weapon.java @@ -0,0 +1,28 @@ +package io.anuke.moment.entities; + +import io.anuke.ucore.entities.Entity; +import io.anuke.ucore.util.Angles; + +public enum Weapon{ + blaster(15, BulletType.shot){ + { + unlocked = true; + } + }; + public float reload; + public BulletType type; + public boolean unlocked; + + private Weapon(float reload, BulletType type){ + this.reload = reload; + this.type = type; + } + + public void shoot(Player p){ + bullet(p, p.x, p.y); + } + + void bullet(Entity owner, float x, float y){ + new Bullet(type, owner, x, y, Angles.mouseAngle(owner.x, owner.y)).add(); + } +} diff --git a/core/src/io/anuke/moment/resource/Item.java b/core/src/io/anuke/moment/resource/Item.java new file mode 100644 index 0000000000..8154dd9cc0 --- /dev/null +++ b/core/src/io/anuke/moment/resource/Item.java @@ -0,0 +1,5 @@ +package io.anuke.moment.resource; + +public enum Item{ + stone, iron, coal, steel; +} diff --git a/core/src/io/anuke/moment/resource/ItemStack.java b/core/src/io/anuke/moment/resource/ItemStack.java new file mode 100644 index 0000000000..c38b28c0c1 --- /dev/null +++ b/core/src/io/anuke/moment/resource/ItemStack.java @@ -0,0 +1,12 @@ +package io.anuke.moment.resource; + +public class ItemStack{ + public Item item; + public int amount; + public float pos; + + public ItemStack(Item item, int amount){ + this.item = item; + this.amount = amount; + } +} diff --git a/core/src/io/anuke/moment/resource/Recipe.java b/core/src/io/anuke/moment/resource/Recipe.java new file mode 100644 index 0000000000..6e482fca38 --- /dev/null +++ b/core/src/io/anuke/moment/resource/Recipe.java @@ -0,0 +1,30 @@ +package io.anuke.moment.resource; + +import io.anuke.moment.world.TileType; + +public enum Recipe{ + stonewall(TileType.stonewall, stack(Item.stone, 4)), + ironwall(TileType.ironwall, stack(Item.iron, 4)), + drill(TileType.stonedrill, stack(Item.stone, 5)), + irondrill(TileType.irondrill, stack(Item.stone, 30)), + coaldrill(TileType.coaldrill, stack(Item.stone, 30), stack(Item.iron, 30)), + conveyor(TileType.conveyor, stack(Item.stone, 1)), + router(TileType.router, stack(Item.stone, 3)), + smelter(TileType.smelter, stack(Item.stone, 40), stack(Item.iron, 40)), + healturret(TileType.healturret, stack(Item.iron, 20)), + turret(TileType.turret, stack(Item.stone, 4)), + dturret(TileType.doubleturret, stack(Item.stone, 6)), + machineturret(TileType.machineturret, stack(Item.iron, 8), stack(Item.stone, 6)); + + public TileType result; + public ItemStack[] requirements; + + private Recipe(TileType result, ItemStack... requirements){ + this.result = result; + this.requirements = requirements; + } + + private static ItemStack stack(Item item, int amount){ + return new ItemStack(item, amount); + } +} diff --git a/core/src/io/anuke/moment/world/Generator.java b/core/src/io/anuke/moment/world/Generator.java new file mode 100644 index 0000000000..527f8e50b0 --- /dev/null +++ b/core/src/io/anuke/moment/world/Generator.java @@ -0,0 +1,52 @@ +package io.anuke.moment.world; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.Pixmap; +import com.badlogic.gdx.math.MathUtils; + +import io.anuke.moment.Moment; +import io.anuke.ucore.noise.Noise; + +public class Generator{ + static final int black = Color.rgba8888(Color.BLACK); + static final int white = Color.rgba8888(Color.WHITE); + static final int red = Color.rgba8888(Color.RED); + static final int blue = Color.rgba8888(Color.BLUE); + + public static void generate(Tile[][] tiles, String mapname){ + Pixmap pix = new Pixmap(Gdx.files.internal("maps/"+mapname+".png")); + Noise.setSeed(MathUtils.random(0, 99999)); + for(int x = 0; x < tiles.length; x ++){ + for(int y = 0; y < tiles.length; y ++){ + TileType floor = TileType.stone; + TileType block = TileType.air; + + int color = pix.getPixel(x, pix.getHeight()-1-y); + + if(Noise.nnoise(x, y, 8, 1) > 0.22){ + floor = TileType.iron; + } + + if(Noise.nnoise(x, y, 6, 1) > 0.245){ + floor = TileType.coal; + } + + if(color == white){ + block = TileType.dirtblock; + + + }else if(color == blue){ + Moment.i.core = tiles[x][y]; + }else if(color == red){ + Moment.i.spawnpoints.add(tiles[x][y]); + } + + tiles[x][y].setBlock(block); + tiles[x][y].setFloor(floor); + } + } + + pix.dispose(); + } +} diff --git a/core/src/io/anuke/moment/world/Tile.java b/core/src/io/anuke/moment/world/Tile.java new file mode 100644 index 0000000000..415efad04c --- /dev/null +++ b/core/src/io/anuke/moment/world/Tile.java @@ -0,0 +1,74 @@ +package io.anuke.moment.world; + +import io.anuke.moment.Moment; +import io.anuke.moment.entities.TileEntity; + +public class Tile{ + private static Tile[] tiles = new Tile[4]; + private TileType floor = TileType.air; + private TileType block = TileType.air; + public TileEntity entity; + public int x, y, rotation; + + public Tile(int x, int y){ + this.x = x; + this.y = y; + } + + public Tile(int x, int y, TileType floor){ + this(x, y); + this.floor = floor; + } + + public int id(){ + return x + y * Moment.i.size; + } + + public float worldx(){ + return x * TileType.tilesize; + } + + public float worldy(){ + return y * TileType.tilesize; + } + + public TileType floor(){ + return floor; + } + + public TileType block(){ + return block; + } + + public void setBlock(TileType type){ + this.block = type; + changed(); + } + + public void setFloor(TileType type){ + this.floor = type; + } + + public boolean artifical(){ + return block.update; + } + + public Tile[] getNearby(){ + tiles[0] = Moment.i.tile(x+1, y); + tiles[1] = Moment.i.tile(x, y+1); + tiles[2] = Moment.i.tile(x-1, y); + tiles[3] = Moment.i.tile(x, y-1); + + return tiles; + } + + + public void changed(){ + //TODO where do the items go? + if(entity != null) + entity.remove(); + + if(block.update) + entity = new TileEntity(this).add(); + } +} diff --git a/core/src/io/anuke/moment/world/TileType.java b/core/src/io/anuke/moment/world/TileType.java new file mode 100644 index 0000000000..128d04bb0b --- /dev/null +++ b/core/src/io/anuke/moment/world/TileType.java @@ -0,0 +1,571 @@ +package io.anuke.moment.world; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.math.MathUtils; +import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.utils.Array; + +import io.anuke.moment.Moment; +import io.anuke.moment.entities.*; +import io.anuke.moment.entities.TileEntity.ItemPos; +import io.anuke.moment.resource.Item; +import io.anuke.ucore.core.Draw; +import io.anuke.ucore.entities.*; +import io.anuke.ucore.graphics.Hue; +import io.anuke.ucore.util.Angles; +import io.anuke.ucore.util.Mathf; +import io.anuke.ucore.util.Timers; + +public enum TileType{ + air{ + //nothing gets drawn + public void draw(Tile tile){ + } + }, + grass, stone, dirt, iron, coal, dirtblock(true), stoneblock(true), stonewall(true, true){ + { + health = 50; + } + }, + ironwall(true, true){ + { + health = 80; + } + }, + stonedrill(true, true){ + public void update(Tile tile){ + + if(tile.floor() == TileType.stone && Timers.get(tile, 60 * 6)){ + offloadNear(tile, Item.stone); + Effects.effect("spark", tile.x * tilesize, tile.y * tilesize); + } + + if(Timers.get(tile.hashCode() + "dump", 30)){ + tryDump(tile); + } + } + + public String description(){ + return "Mines 1 stone every 6 seconds."; + } + + public String error(Tile tile){ + if(tile.floor() != TileType.stone) + return "Not on stone block!"; + return null; + } + }, + irondrill(true, true){ + public void update(Tile tile){ + + if(tile.floor() == TileType.iron && Timers.get(tile, 60 * 6)){ + offloadNear(tile, Item.iron); + Effects.effect("spark", tile.x * tilesize, tile.y * tilesize); + } + + if(Timers.get(tile.hashCode() + "dump", 30)){ + tryDump(tile); + } + } + + public String description(){ + return "Mines 1 iron every 6 seconds."; + } + + public String error(Tile tile){ + if(tile.floor() != TileType.iron) + return "Not on iron ore block!"; + return null; + } + }, + coaldrill(true, true){ + public void update(Tile tile){ + + if(tile.floor() == TileType.coal && Timers.get(tile, 60 * 6)){ + offloadNear(tile, Item.coal); + Effects.effect("spark", tile.x * tilesize, tile.y * tilesize); + } + + if(Timers.get(tile.hashCode() + "dump", 30)){ + tryDump(tile); + } + } + + public String description(){ + return "Mines 1 coal every 6 seconds."; + } + + public String error(Tile tile){ + if(tile.floor() != TileType.coal) + return "Not on coal block!"; + return null; + } + }, + conveyor(false, true, true){ + float speed = 0.02f; + + public void draw(Tile tile){ + Draw.rect(name() + (Timers.time() % ((20 / 100f) / speed) < (10 / 100f) / speed ? "" : "move"), tile.worldx(), tile.worldy(), tile.rotation * 90); + + vector.set(tilesize, 0).rotate(tile.rotation * 90); + vector2.set(-tilesize / 2, 0).rotate(tile.rotation * 90); + + for(ItemPos pos : tile.entity.convey){ + Draw.rect("icon-" + pos.item.name(), tile.x * tilesize + vector.x * pos.pos + vector2.x, tile.y * tilesize + vector.y * pos.pos + vector2.y, 4, 4); + } + } + + public void update(Tile tile){ + tile.entity.convey.begin(); + + for(ItemPos pos : tile.entity.convey){ + pos.pos += speed * Gdx.graphics.getDeltaTime() * 60f; + if(pos.pos >= 1f && offloadDir(tile, pos.item)){ + tile.entity.removeConvey(pos); + continue; + } + pos.pos = Mathf.clamp(pos.pos); + } + + tile.entity.convey.end(); + } + + @Override + public boolean accepts(Item item){ + return true; + } + + public String description(){ + return "Moves Items"; + } + + @Override + void handleItem(Tile tile, Item item, float f){ + tile.entity.addConvey(item, f); + } + }, + steelconveyor(false, true, true){ + float speed = 0.03f; + + public void draw(Tile tile){ + Draw.rect(name() + (Timers.time() % ((20 / 100f) / speed) < (10 / 100f) / speed ? "" : "move"), tile.worldx(), tile.worldy(), tile.rotation * 90); + + vector.set(tilesize, 0).rotate(tile.rotation * 90); + vector2.set(-tilesize / 2, 0).rotate(tile.rotation * 90); + + for(ItemPos pos : tile.entity.convey){ + Draw.rect("icon-" + pos.item.name(), tile.x * tilesize + vector.x * pos.pos + vector2.x, tile.y * tilesize + vector.y * pos.pos + vector2.y, 4, 4); + } + } + + public void update(Tile tile){ + tile.entity.convey.begin(); + + for(ItemPos pos : tile.entity.convey){ + pos.pos += speed * Gdx.graphics.getDeltaTime() * 60f; + if(pos.pos >= 1f && offloadDir(tile, pos.item)){ + tile.entity.removeConvey(pos); + continue; + } + pos.pos = Mathf.clamp(pos.pos); + } + + tile.entity.convey.end(); + } + + @Override + public boolean accepts(Item item){ + return true; + } + + public String description(){ + return "Moves Items (faster than a normal conveyor!)"; + } + + @Override + void handleItem(Tile tile, Item item, float f){ + tile.entity.addConvey(item, f); + } + }, + router(true, true, false){ + + public void update(Tile tile){ + if(Timers.get(tile, 20) && tile.entity.totalItems() > 0){ + tryDump(tile, tile.rotation++); + tile.rotation %= 4; + } + } + + @Override + public boolean accepts(Item item){ + return true; + } + + public String description(){ + return "Splits conveyor belt input"; + } + }, + smelter(true, true, false){ + {health=70;} + + public void update(Tile tile){ + + if(tile.entity.hasItem(Item.coal) && tile.entity.hasItem(Item.iron)){ + tile.entity.removeItem(Item.coal, 1); + tile.entity.removeItem(Item.iron, 1); + offloadNear(tile, Item.steel); + Effects.effect("smelt", tile.entity); + } + + if(Timers.get(tile, 20) && tile.entity.hasItem(Item.steel)){ + tryDump(tile); + } + } + + @Override + public boolean accepts(Item item){ + return item == Item.iron || item == Item.coal; + } + + public String description(){ + return "Smelts iron and coal into steel"; + } + }, + core(true, true, false){ + { + health = 300; + } + + @Override + void handleItem(Tile tile, Item item, float f){ + Moment.i.addItem(item, 1); + } + + @Override + public boolean accepts(Item item){ + return true; + } + }, + turret(true, true, false){ + { + range = 40; + reload = 10f; + bullet = BulletType.stone; + ammo = Item.stone; + } + + public void update(Tile tile){ + updateTurret(tile); + } + + public void draw(Tile tile){ + Draw.rect("block", tile.worldx(), tile.worldy()); + } + + public void drawOver(Tile tile){ + Draw.rect(name(), tile.worldx(), tile.worldy(), tile.entity.rotation - 90); + } + + public String description(){ + return "Shoots things."; + } + }, + doubleturret(true, true, false){ + { + range = 40; + reload = 10f; + bullet = BulletType.stone; + ammo = Item.stone; + health = 50; + } + + public void update(Tile tile){ + updateTurret(tile); + } + + public void draw(Tile tile){ + Draw.rect("block", tile.worldx(), tile.worldy()); + } + + public void drawOver(Tile tile){ + Draw.rect(name(), tile.worldx(), tile.worldy(), tile.entity.rotation - 90); + } + + public String description(){ + return "Shoots things."; + } + }, + machineturret(true, true, false){ + { + range = 65; + reload = 5f; + bullet = BulletType.iron; + ammo = Item.iron; + health = 65; + } + + public void update(Tile tile){ + updateTurret(tile); + } + + public void draw(Tile tile){ + Draw.rect("block", tile.worldx(), tile.worldy()); + } + + public void drawOver(Tile tile){ + Draw.rect(name(), tile.worldx(), tile.worldy(), tile.entity.rotation - 90); + } + + public String description(){ + return "Shoots things."; + } + }, + healturret(true, true, false){ + { + range = 30; + reload = 30f; + health = 50; + } + + public void update(Tile tile){ + /* + * if(tile.entity.hasItem(ammo)){ tile.entity.shots += 20; + * tile.entity.removeItem(ammo, 1); } + */ + //if(tile.entity.shots > 0){ + tile.entity.link = findTileTarget(tile, range); + + if(tile.entity.link != null){ + tile.entity.rotation = tile.entity.angleTo(tile.entity.link); + + if(Timers.get(tile, reload)){ + tile.entity.link.health++; + } + } + //} + } + + public void draw(Tile tile){ + Draw.rect("block", tile.worldx(), tile.worldy()); + } + + public void drawOver(Tile tile){ + if(tile.entity.link != null){ + float x = tile.worldx(), y = tile.worldy(); + float x2 = tile.entity.link.x, y2 = tile.entity.link.y; + + Draw.color(Hue.rgb(138, 244, 138, (MathUtils.sin(Timers.time() / 2f) + 1f) / 15f)); + Draw.alpha(0.3f); + Draw.thickness(4f); + Draw.line(x, y, x2, y2); + Draw.thickness(2f); + Draw.circle(x2, y2, 2f); + Draw.alpha(1f); + Draw.thickness(2f); + Draw.line(x, y, x2, y2); + Draw.thickness(1f); + Draw.circle(x2, y2, 1f); + Draw.clear(); + } + Draw.rect(name(), tile.worldx(), tile.worldy(), tile.entity.rotation - 90); + } + + public String description(){ + return "Heals nearby tiles."; + } + }; + static Vector2 vector = new Vector2(); + static Vector2 vector2 = new Vector2(); + + public boolean solid, update, rotate; + public static final int tilesize = 8; + public int health = 40; + + //turrets + public float range = 50f; + public float reload = 10f; + public BulletType bullet; + public Item ammo; + + private TileType() { + solid = false; + } + + private TileType(boolean solid) { + this.solid = solid; + } + + private TileType(boolean solid, boolean update) { + this.solid = solid; + this.update = update; + } + + private TileType(boolean solid, boolean update, boolean rotate) { + this.solid = solid; + this.update = update; + this.rotate = rotate; + } + + public void init(TileEntity entity){ + + } + + void updateTurret(Tile tile){ + if(tile.entity.hasItem(ammo)){ + tile.entity.shots += 20; + tile.entity.removeItem(ammo, 1); + } + + if(tile.entity.shots > 0){ + Enemy enemy = findTarget(tile, range); + if(enemy != null){ + tile.entity.rotation = MathUtils.lerpAngleDeg(tile.entity.rotation, Angles.predictAngle(tile.worldx(), tile.worldy(), enemy.x, enemy.y, enemy.xvelocity, enemy.yvelocity, bullet.speed - 0.1f), 0.2f); + if(Timers.get(tile, reload)){ + new Bullet(bullet, tile.entity, tile.worldx(), tile.worldy(), tile.entity.rotation).add(); + tile.entity.shots--; + } + } + } + } + + Enemy findTarget(Tile tile, float range){ + Entity closest = null; + float dst = 0; + + Array array = Entities.getNearby(tile.worldx(), tile.worldy(), 100); + + for(Entity e : array){ + + if(e instanceof Enemy){ + float ndst = Vector2.dst(tile.worldx(), tile.worldy(), e.x, e.y); + if(ndst < range && (closest == null || ndst < dst)){ + dst = ndst; + closest = e; + } + } + } + + return (Enemy) closest; + } + + TileEntity findTileTarget(Tile tile, float range){ + Entity closest = null; + float dst = 0; + + Array array = Entities.getNearby(tile.worldx(), tile.worldy(), 100); + + for(Entity e : array){ + + if(e instanceof TileEntity && ((TileEntity) e).health < ((TileEntity) e).tile.block().health){ + float ndst = Vector2.dst(tile.worldx(), tile.worldy(), e.x, e.y); + if(ndst < range && (closest == null || ndst < dst)){ + dst = ndst; + closest = e; + } + } + } + + return (TileEntity) closest; + } + + void handleItem(Tile tile, Item item, float f){ + tile.entity.addItem(item, 1); + } + + /** + * Tries to put this item into a nearby container, if there are no available + * containers, it gets added to the block's inventory. + */ + void offloadNear(Tile tile, Item item){ + int i = 0; + for(Tile other : tile.getNearby()){ + if(other != null && other.block().accepts(item) + //don't output to things facing this thing + && !(other.block().rotate && (other.rotation + 2) % 4 == i)){ + + other.block().handleItem(other, item, 0); + return; + } + i++; + } + handleItem(tile, item, 0); + } + + /** Try dumping any item near the tile. */ + boolean tryDump(Tile tile){ + return tryDump(tile, -1); + } + + /** + * Try dumping any item near the tile. -1 = any direction + */ + boolean tryDump(Tile tile, int direction){ + int i = 0; + + for(Tile other : tile.getNearby()){ + if(i == direction || direction == -1) + for(Item item : Item.values()){ + + if(tile.entity.hasItem(item) && other != null && other.block().accepts(item) && + //don't output to things facing this thing + !(other.block().rotate && (other.rotation + 2) % 4 == i)){ + other.block().handleItem(other, item, 0); + tile.entity.removeItem(item, 1); + return true; + } + } + i++; + } + + return false; + } + + /** + * Try offloading an item to a nearby container. Returns true if success. + */ + boolean offloadDir(Tile tile, Item item){ + Tile other = tile.getNearby()[tile.rotation]; + if(other != null && other.block().accepts(item)){ + int ch = Math.abs(other.rotation - tile.rotation); + other.block().handleItem(other, item, ch == 1 ? 0.5f : ch == 2 ? 1f : 0f); + //other.entity.addCovey(item, ch == 1 ? 0.5f : ch ==2 ? 1f : 0f); + return true; + } + return false; + } + + public boolean accepts(Item item){ + return item == ammo; + } + + public String description(){ + return "[no description]"; + } + + public void draw(Tile tile){ + if(tile.floor() == this){ + MathUtils.random.setSeed(tile.id()); + Draw.rect(name() + MathUtils.random(1, 3), tile.worldx(), tile.worldy(), rotate ? tile.rotation * 90 : 0); + }else{ + Draw.rect(name(), tile.worldx(), tile.worldy(), rotate ? tile.rotation * 90 : 0); + } + } + + public String error(Tile tile){ + if(ammo != null && !tile.entity.hasItem(ammo) && tile.entity.shots <= 0) + return "No ammo!"; + + return null; + } + + public void drawOver(Tile tile){ + /* + * String error = error(tile); if(error != null){ Draw.color("scarlet"); + * Draw.square(tile.worldx(), tile.worldy(), 6); Draw.clear(); } + */ + } + + public void update(Tile tile){ + + } +} diff --git a/core/src/uCore.gwt.xml b/core/src/uCore.gwt.xml new file mode 100644 index 0000000000..2388a04522 --- /dev/null +++ b/core/src/uCore.gwt.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/desktop/build.gradle b/desktop/build.gradle new file mode 100644 index 0000000000..a7ee24d25f --- /dev/null +++ b/desktop/build.gradle @@ -0,0 +1,55 @@ +apply plugin: "java" + +sourceCompatibility = 1.8 +sourceSets.main.java.srcDirs = [ "src/" ] + +project.ext.mainClassName = "io.anuke.moment.desktop.DesktopLauncher" +project.ext.assetsDir = new File("../core/assets"); + +task run(dependsOn: classes, type: JavaExec) { + main = project.mainClassName + classpath = sourceSets.main.runtimeClasspath + standardInput = System.in + workingDir = project.assetsDir + ignoreExitValue = true +} + +task debug(dependsOn: classes, type: JavaExec) { + main = project.mainClassName + classpath = sourceSets.main.runtimeClasspath + standardInput = System.in + workingDir = project.assetsDir + ignoreExitValue = true + debug = true +} + +task dist(type: Jar) { + from files(sourceSets.main.output.classesDir) + from files(sourceSets.main.output.resourcesDir) + from {configurations.compile.collect {zipTree(it)}} + from files(project.assetsDir); + + manifest { + attributes 'Main-Class': project.mainClassName + } +} + +dist.dependsOn classes + +eclipse { + project { + name = appName + "-desktop" + linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/core/assets' + } +} + +task afterEclipseImport(description: "Post processing after project generation", group: "IDE") { + doLast { + def classpath = new XmlParser().parse(file(".classpath")) + new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]); + def writer = new FileWriter(file(".classpath")) + def printer = new XmlNodePrinter(new PrintWriter(writer)) + printer.setPreserveWhitespace(true) + printer.print(classpath) + } +} diff --git a/desktop/gifexport/recording1493405733.gif b/desktop/gifexport/recording1493405733.gif new file mode 100644 index 0000000000..d81746e163 Binary files /dev/null and b/desktop/gifexport/recording1493405733.gif differ diff --git a/desktop/gifexport/recording1493414200.gif b/desktop/gifexport/recording1493414200.gif new file mode 100644 index 0000000000..7f6e089906 Binary files /dev/null and b/desktop/gifexport/recording1493414200.gif differ diff --git a/desktop/gifexport/recording1493430358.gif b/desktop/gifexport/recording1493430358.gif new file mode 100644 index 0000000000..86b42a8f36 Binary files /dev/null and b/desktop/gifexport/recording1493430358.gif differ diff --git a/desktop/gifexport/recording1493487125.gif b/desktop/gifexport/recording1493487125.gif new file mode 100644 index 0000000000..f1eeb19e11 Binary files /dev/null and b/desktop/gifexport/recording1493487125.gif differ diff --git a/desktop/gifexport/recording1493487193.gif b/desktop/gifexport/recording1493487193.gif new file mode 100644 index 0000000000..904a035869 Binary files /dev/null and b/desktop/gifexport/recording1493487193.gif differ diff --git a/desktop/gifexport/recording1493487299.gif b/desktop/gifexport/recording1493487299.gif new file mode 100644 index 0000000000..e74c337c44 Binary files /dev/null and b/desktop/gifexport/recording1493487299.gif differ diff --git a/desktop/gifexport/recording1493501568.gif b/desktop/gifexport/recording1493501568.gif new file mode 100644 index 0000000000..abfd2ee12b Binary files /dev/null and b/desktop/gifexport/recording1493501568.gif differ diff --git a/desktop/gifexport/recording1493501578.gif b/desktop/gifexport/recording1493501578.gif new file mode 100644 index 0000000000..e1621bd251 Binary files /dev/null and b/desktop/gifexport/recording1493501578.gif differ diff --git a/desktop/gifexport/recording1493505179.gif b/desktop/gifexport/recording1493505179.gif new file mode 100644 index 0000000000..df85374d3b Binary files /dev/null and b/desktop/gifexport/recording1493505179.gif differ diff --git a/desktop/gifexport/recording1493505267.gif b/desktop/gifexport/recording1493505267.gif new file mode 100644 index 0000000000..455c12c3b5 Binary files /dev/null and b/desktop/gifexport/recording1493505267.gif differ diff --git a/desktop/gifexport/recording1493513803.gif b/desktop/gifexport/recording1493513803.gif new file mode 100644 index 0000000000..892b5fdcb0 Binary files /dev/null and b/desktop/gifexport/recording1493513803.gif differ diff --git a/desktop/src/io/anuke/moment/desktop/DesktopLauncher.java b/desktop/src/io/anuke/moment/desktop/DesktopLauncher.java new file mode 100644 index 0000000000..3947b1f622 --- /dev/null +++ b/desktop/src/io/anuke/moment/desktop/DesktopLauncher.java @@ -0,0 +1,16 @@ +package io.anuke.moment.desktop; + +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; +import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; + +import io.anuke.moment.Moment; + +public class DesktopLauncher { + public static void main (String[] arg) { + Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration(); + config.setTitle("Moment"); + config.setMaximized(true); + config.useVsync(false); + new Lwjgl3Application(new Moment(), config); + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000000..339fa1508b --- /dev/null +++ b/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.daemon=true +org.gradle.jvmargs=-Xms128m -Xmx1500m +org.gradle.configureondemand=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000..b979729db0 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..b902acb8dd --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Sat Sep 21 13:08:26 CEST 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip diff --git a/gradlew b/gradlew new file mode 100755 index 0000000000..91a7e269e1 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000000..aec99730b4 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/html/build.gradle b/html/build.gradle new file mode 100644 index 0000000000..d04d6d63e6 --- /dev/null +++ b/html/build.gradle @@ -0,0 +1,69 @@ +apply plugin: "java" +apply plugin: "jetty" + +gwt { + gwtVersion='2.8.0' // Should match the gwt version used for building the gwt backend + maxHeapSize="1G" // Default 256m is not enough for gwt compiler. GWT is HUNGRY + minHeapSize="1G" + + src = files(file("src/")) // Needs to be in front of "modules" below. + modules 'io.anuke.moment.GdxDefinition' + devModules 'io.anuke.moment.GdxDefinitionSuperdev' + project.webAppDirName = 'webapp' + + compiler { + strict = true; + disableCastChecking = true; + } +} + +task draftRun(type: JettyRunWar) { + dependsOn draftWar + dependsOn.remove('war') + webApp=draftWar.archivePath + daemon=true +} + +task superDev(type: de.richsource.gradle.plugins.gwt.GwtSuperDev) { + dependsOn draftRun + doFirst { + gwt.modules = gwt.devModules + } +} + +task dist(dependsOn: [clean, compileGwt]) { + doLast { + file("build/dist").mkdirs() + copy { + from "build/gwt/out" + into "build/dist" + } + copy { + from "webapp" + into "build/dist" + } + copy { + from "war" + into "build/dist" + } + } +} + +draftWar { + from "war" +} + +task addSource << { + sourceSets.main.compileClasspath += files(project(':core').sourceSets.main.allJava.srcDirs) +} + +tasks.compileGwt.dependsOn(addSource) +tasks.draftCompileGwt.dependsOn(addSource) + +sourceCompatibility = 1.8 +sourceSets.main.java.srcDirs = [ "src/" ] + + +eclipse.project { + name = appName + "-html" +} diff --git a/html/src/io/anuke/moment/GdxDefinition.gwt.xml b/html/src/io/anuke/moment/GdxDefinition.gwt.xml new file mode 100644 index 0000000000..fe40c25be3 --- /dev/null +++ b/html/src/io/anuke/moment/GdxDefinition.gwt.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/html/src/io/anuke/moment/GdxDefinitionSuperdev.gwt.xml b/html/src/io/anuke/moment/GdxDefinitionSuperdev.gwt.xml new file mode 100644 index 0000000000..a93917b545 --- /dev/null +++ b/html/src/io/anuke/moment/GdxDefinitionSuperdev.gwt.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/html/src/io/anuke/moment/client/HtmlLauncher.java b/html/src/io/anuke/moment/client/HtmlLauncher.java new file mode 100644 index 0000000000..a4c53f2e01 --- /dev/null +++ b/html/src/io/anuke/moment/client/HtmlLauncher.java @@ -0,0 +1,100 @@ +package io.anuke.moment.client; + +import com.badlogic.gdx.ApplicationListener; +import com.badlogic.gdx.backends.gwt.GwtApplication; +import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration; +import com.google.gwt.dom.client.*; +import com.google.gwt.user.client.ui.HasHorizontalAlignment; +import com.google.gwt.user.client.ui.HasVerticalAlignment; +import com.google.gwt.user.client.ui.VerticalPanel; + +import io.anuke.moment.Moment; + +public class HtmlLauncher extends GwtApplication { + static final int WIDTH = 800; + static final int HEIGHT = 600; + static HtmlLauncher instance; + + @Override + public GwtApplicationConfiguration getConfig() { + GwtApplicationConfiguration config = new GwtApplicationConfiguration(WIDTH, HEIGHT); + + Element element = Document.get().getElementById("embed-html"); + VerticalPanel panel = new VerticalPanel(); + panel.setWidth("100%"); + panel.setHeight("100%"); + panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); + panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); + element.appendChild(panel.getElement()); + config.rootPanel = panel; + config.width = 2000; + config.height = 2000; + + return config; + } + + @Override + public ApplicationListener createApplicationListener() { + instance = this; + setLogLevel(LOG_NONE); + setLoadingListener(new LoadingListener() { + @Override + public void beforeSetup() { + + } + + @Override + public void afterSetup() { + scaleCanvas(); + setupResizeHook(); + } + }); + return new Moment(); + } + + void scaleCanvas() { + Element element = Document.get().getElementById("embed-html"); + int innerWidth = getWindowInnerWidth(); + int innerHeight = getWindowInnerHeight(); + int newWidth = innerWidth; + int newHeight = innerHeight; + float ratio = innerWidth / (float) innerHeight; + float viewRatio = WIDTH / (float) HEIGHT; + + if (ratio > viewRatio) { + newWidth = (int) (innerHeight * viewRatio); + } else { + newHeight = (int) (innerWidth / viewRatio); + } + + NodeList nl = element.getElementsByTagName("canvas"); + + if (nl != null && nl.getLength() > 0) { + Element canvas = nl.getItem(0); + canvas.setAttribute("width", "" + newWidth + "px"); + canvas.setAttribute("height", "" + newHeight + "px"); + canvas.getStyle().setWidth(newWidth, Style.Unit.PX); + canvas.getStyle().setHeight(newHeight, Style.Unit.PX); + canvas.getStyle().setTop((int) ((innerHeight - newHeight) * 0.5f), Style.Unit.PX); + canvas.getStyle().setLeft((int) ((innerWidth - newWidth) * 0.5f), Style.Unit.PX); + canvas.getStyle().setPosition(Style.Position.ABSOLUTE); + } + } + + native int getWindowInnerWidth() /*-{ + return $wnd.innerWidth; + }-*/; + + native int getWindowInnerHeight() /*-{ + return $wnd.innerHeight; + }-*/; + + native void setupResizeHook() /*-{ + var htmlLauncher_onWindowResize = $entry(@io.anuke.moment.client.HtmlLauncher::handleResize()); + $wnd.addEventListener('resize', htmlLauncher_onWindowResize, false); + }-*/; + + public static void handleResize() { + instance.scaleCanvas(); + } +} \ No newline at end of file diff --git a/html/webapp/WEB-INF/web.xml b/html/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..4301df2483 --- /dev/null +++ b/html/webapp/WEB-INF/web.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/html/webapp/index.html b/html/webapp/index.html new file mode 100644 index 0000000000..d07b022db3 --- /dev/null +++ b/html/webapp/index.html @@ -0,0 +1,40 @@ + + + + Moment + + + + + + + +
+ + + + + diff --git a/html/webapp/soundmanager2-jsmin.js b/html/webapp/soundmanager2-jsmin.js new file mode 100644 index 0000000000..2077360f86 --- /dev/null +++ b/html/webapp/soundmanager2-jsmin.js @@ -0,0 +1,113 @@ +/** @license + + + SoundManager 2: JavaScript Sound for the Web + ---------------------------------------------- + http://schillmania.com/projects/soundmanager2/ + + Copyright (c) 2007, Scott Schiller. All rights reserved. + Code provided under the BSD License: + http://schillmania.com/projects/soundmanager2/license.txt + + V2.97a.20150601 +*/ +(function(h,g){function K(sb,K){function ha(b){return c.preferFlash&&H&&!c.ignoreFlash&&c.flash[b]!==g&&c.flash[b]}function r(b){return function(d){var e=this._s;e&&e._a?d=b.call(this,d):(e&&e.id?c._wD(e.id+": Ignoring "+d.type):c._wD("HTML5::Ignoring "+d.type),d=null);return d}}this.setupOptions={url:sb||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:"#ffffff",useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1E3, +wmode:null,allowScriptAccess:"always",useFlashBlock:!1,useHTML5Audio:!0,forceUseGlobalHTML5Audio:!1,ignoreMobileRestrictions:!1,html5Test:/^(probably|maybe)$/i,preferFlash:!1,noSWFCache:!1,idPrefix:"sound"};this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfailure:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,stream:!0,to:null,type:null, +usePolicyFile:!1,volume:100};this.flash9Options={isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null};this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a","m4b"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!1}, +ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},opus:{type:["audio/ogg; codecs=opus","audio/opus"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1}};this.movieID="sm2-container";this.id=K||"sm2movie";this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.versionNumber="V2.97a.20150601";this.altURL=this.movieURL=this.version=null;this.enabled=this.swfLoaded=!1;this.oMC=null;this.sounds={};this.soundIDs=[];this.didFlashBlock= +this.muted=!1;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null};this.html5= +{usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only=!1;var W,c=this,Ya=null,l=null,F,v=navigator.userAgent,ia=h.location.href.toString(),m=document,ya,Za,za,n,I=[],Aa=!0,D,X=!1,Y=!1,q=!1,y=!1,ja=!1,p,tb=0,Z,A,Ba,R,Ca,P,S,T,$a,Da,Ea,ka,z,la,Q,Fa,aa,ma,na,U,ab,Ga,bb=["log","info","warn","error"],cb,Ha,db,ba=null,Ia=null,t,Ja,V,eb,oa,pa,L,w,ca=!1,Ka=!1,fb,gb,hb,qa=0,da=null,ra,M=[],ea,u=null,ib,sa,fa,N,ta,La,jb,x,kb=Array.prototype.slice,C=!1,Ma,H,Na,lb,J,mb,Oa,ua,nb=0,Pa,Qa=v.match(/(ipad|iphone|ipod)/i), +Ra=v.match(/android/i),O=v.match(/msie/i),ub=v.match(/webkit/i),va=v.match(/safari/i)&&!v.match(/chrome/i),Sa=v.match(/opera/i),wa=v.match(/(mobile|pre\/|xoom)/i)||Qa||Ra,Ta=!ia.match(/usehtml5audio/i)&&!ia.match(/sm2\-ignorebadua/i)&&va&&!v.match(/silk/i)&&v.match(/OS X 10_6_([3-7])/i),Ua=h.console!==g&&console.log!==g,Va=m.hasFocus!==g?m.hasFocus():null,xa=va&&(m.hasFocus===g||!m.hasFocus()),ob=!xa,pb=/(mp3|mp4|mpa|m4a|m4b)/i,ga=m.location?m.location.protocol.match(/http/i):null,vb=ga?"":"http://", +qb=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,rb="mpeg4 aac flv mov mp4 m4v f4v m4a m4b mp4v 3gp 3g2".split(" "),wb=new RegExp("\\.("+rb.join("|")+")(\\?.*)?$","i");this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.useAltURL=!ga;var Wa;try{Wa=Audio!==g&&(Sa&&opera!==g&&10>opera.version()?new Audio(null):new Audio).canPlayType!==g}catch(xb){Wa=!1}this.hasHTML5=Wa;this.setup=function(b){var d=!c.url;b!==g&&q&&u&&c.ok()&&(b.flashVersion!==g|| +b.url!==g||b.html5Test!==g)&&L(t("setupLate"));Ba(b);if(!C)if(wa){if(!c.setupOptions.ignoreMobileRestrictions||c.setupOptions.forceUseGlobalHTML5Audio)M.push(z.globalHTML5),C=!0}else c.setupOptions.forceUseGlobalHTML5Audio&&(M.push(z.globalHTML5),C=!0);if(!Pa&&wa)if(c.setupOptions.ignoreMobileRestrictions)M.push(z.ignoreMobile);else if(c.setupOptions.useHTML5Audio&&!c.setupOptions.preferFlash||c._wD(z.mobileUA),c.setupOptions.useHTML5Audio=!0,c.setupOptions.preferFlash=!1,Qa)c.ignoreFlash=!0;else if(Ra&& +!v.match(/android\s2\.3/i)||!Ra)c._wD(z.globalHTML5),C=!0;b&&(d&&aa&&b.url!==g&&c.beginDelayedInit(),aa||b.url===g||"complete"!==m.readyState||setTimeout(Q,1));Pa=!0;return c};this.supported=this.ok=function(){return u?q&&!y:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(c){return F(c)||m[c]||h[c]};this.createSound=function(b,d){function e(){f=oa(f);c.sounds[f.id]=new W(f);c.soundIDs.push(f.id);return c.sounds[f.id]}var a,f;a=null;a="soundManager.createSound(): "+t(q?"notOK":"notReady");if(!q|| +!c.ok())return L(a),!1;d!==g&&(b={id:b,url:d});f=A(b);f.url=ra(f.url);f.id===g&&(f.id=c.setupOptions.idPrefix+nb++);f.id.toString().charAt(0).match(/^[0-9]$/)&&c._wD("soundManager.createSound(): "+t("badID",f.id),2);c._wD("soundManager.createSound(): "+f.id+(f.url?" ("+f.url+")":""),1);if(w(f.id,!0))return c._wD("soundManager.createSound(): "+f.id+" exists",1),c.sounds[f.id];if(sa(f))a=e(),c.html5Only||c._wD(f.id+": Using HTML5"),a._setup_html5(f);else{if(c.html5Only)return c._wD(f.id+": No HTML5 support for this sound, and no Flash. Exiting."), +e();if(c.html5.usingFlash&&f.url&&f.url.match(/data\:/i))return c._wD(f.id+": data: URIs not supported via Flash. Exiting."),e();8a.instanceCount?(m(),e=a._setup_html5(),a.setPosition(a._iO.position),e.play()):(c._wD(a.id+": Cloning Audio() for instance #"+ +a.instanceCount+"..."),k=new Audio(a._iO.url),G=function(){x.remove(k,"ended",G);a._onfinish(a);ta(k);k=null},h=function(){x.remove(k,"canplay",h);try{k.currentTime=a._iO.position/1E3}catch(c){L(a.id+": multiShot play() failed to apply position of "+a._iO.position/1E3)}k.play()},x.add(k,"ended",G),a._iO.volume!==g&&(k.volume=Math.max(0,Math.min(1,a._iO.volume/100))),a.muted&&(k.muted=!0),a._iO.position?x.add(k,"canplay",h):k.play()):(B=l._start(a.id,a._iO.loops||1,9===n?a.position:a.position/1E3, +a._iO.multiShot||!1),9!==n||B||(c._wD(e+"No sound hardware, or 32-sound ceiling hit",2),a._iO.onplayerror&&a._iO.onplayerror.apply(a)))}return a};this.stop=function(b){var d=a._iO;1===a.playState&&(c._wD(a.id+": stop()"),a._onbufferchange(0),a._resetOnPosition(0),a.paused=!1,a.isHTML5||(a.playState=0),Xa(),d.to&&a.clearOnPosition(d.to),a.isHTML5?a._a&&(b=a.position,a.setPosition(0),a.position=b,a._a.pause(),a.playState=0,a._onTimer(),G()):(l._stop(a.id,b),d.serverURL&&a.unload()),a.instanceCount= +0,a._iO={},d.onstop&&d.onstop.apply(a));return a};this.setAutoPlay=function(b){c._wD(a.id+": Autoplay turned "+(b?"on":"off"));a._iO.autoPlay=b;a.isHTML5||(l._setAutoPlay(a.id,b),b&&!a.instanceCount&&1===a.readyState&&(a.instanceCount++,c._wD(a.id+": Incremented instance count to "+a.instanceCount)))};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=function(b){b===g&&(b=0);var d=a.isHTML5?Math.max(b,0):Math.min(a.duration||a._iO.duration,Math.max(b,0));a.position=d;b=a.position/ +1E3;a._resetOnPosition(a.position);a._iO.position=d;if(!a.isHTML5)b=9===n?a.position:b,a.readyState&&2!==a.readyState&&l._setPosition(a.id,b,a.paused||!a.playState,a._iO.multiShot);else if(a._a){if(a._html5_canplay){if(a._a.currentTime!==b){c._wD(a.id+": setPosition("+b+")");try{a._a.currentTime=b,(0===a.playState||a.paused)&&a._a.pause()}catch(e){c._wD(a.id+": setPosition("+b+") failed: "+e.message,2)}}}else if(b)return c._wD(a.id+": setPosition("+b+"): Cannot seek yet, sound not ready",2),a;a.paused&& +a._onTimer(!0)}return a};this.pause=function(b){if(a.paused||0===a.playState&&1!==a.readyState)return a;c._wD(a.id+": pause()");a.paused=!0;a.isHTML5?(a._setup_html5().pause(),G()):(b||b===g)&&l._pause(a.id,a._iO.multiShot);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){var b=a._iO;if(!a.paused)return a;c._wD(a.id+": resume()");a.paused=!1;a.playState=1;a.isHTML5?(a._setup_html5().play(),m()):(b.isMovieStar&&!b.serverURL&&a.setPosition(a.position),l._pause(a.id,b.multiShot)); +!r&&b.onplay?(b.onplay.apply(a),r=!0):b.onresume&&b.onresume.apply(a);return a};this.togglePause=function(){c._wD(a.id+": togglePause()");if(0===a.playState)return a.play({position:9!==n||a.isHTML5?a.position/1E3:a.position}),a;a.paused?a.resume():a.pause();return a};this.setPan=function(c,b){c===g&&(c=0);b===g&&(b=!1);a.isHTML5||l._setPan(a.id,c);a._iO.pan=c;b||(a.pan=c,a.options.pan=c);return a};this.setVolume=function(b,d){b===g&&(b=100);d===g&&(d=!1);a.isHTML5?a._a&&(c.muted&&!a.muted&&(a.muted= +!0,a._a.muted=!0),a._a.volume=Math.max(0,Math.min(1,b/100))):l._setVolume(a.id,c.muted&&!a.muted||a.muted?0:b);a._iO.volume=b;d||(a.volume=b,a.options.volume=b);return a};this.mute=function(){a.muted=!0;a.isHTML5?a._a&&(a._a.muted=!0):l._setVolume(a.id,0);return a};this.unmute=function(){a.muted=!1;var b=a._iO.volume!==g;a.isHTML5?a._a&&(a._a.muted=!1):l._setVolume(a.id,b?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=this.onPosition= +function(b,c,d){E.push({position:parseInt(b,10),method:c,scope:d!==g?d:a,fired:!1});return a};this.clearOnPosition=function(a,b){var c;a=parseInt(a,10);if(isNaN(a))return!1;for(c=0;c=b)return!1;for(--b;0<=b;b--)c=E[b],!c.fired&&a.position>=c.position&&(c.fired=!0,v++,c.method.apply(c.scope,[c.position]));return!0};this._resetOnPosition= +function(a){var b,c;b=E.length;if(!b)return!1;for(--b;0<=b;b--)c=E[b],c.fired&&a<=c.position&&(c.fired=!1,v--);return!0};y=function(){var b=a._iO,d=b.from,e=b.to,f,g;g=function(){c._wD(a.id+': "To" time of '+e+" reached.");a.clearOnPosition(e,g);a.stop()};f=function(){c._wD(a.id+': Playing "from" '+d);if(null!==e&&!isNaN(e))a.onPosition(e,g)};null===d||isNaN(d)||(b.position=d,b.multiShot=!1,f());return b};q=function(){var b,c=a._iO.onposition;if(c)for(b in c)if(c.hasOwnProperty(b))a.onPosition(parseInt(b, +10),c[b])};Xa=function(){var b,c=a._iO.onposition;if(c)for(b in c)c.hasOwnProperty(b)&&a.clearOnPosition(parseInt(b,10))};m=function(){a.isHTML5&&fb(a)};G=function(){a.isHTML5&&gb(a)};f=function(b){b||(E=[],v=0);r=!1;a._hasTimer=null;a._a=null;a._html5_canplay=!1;a.bytesLoaded=null;a.bytesTotal=null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.buffered=[];a.eqData=[];a.eqData.left=[];a.eqData.right=[];a.failures=0;a.isBuffering=!1;a.instanceOptions={};a.instanceCount= +0;a.loaded=!1;a.metadata={};a.readyState=0;a.muted=!1;a.paused=!1;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.playState=0;a.position=null;a.id3={}};f();this._onTimer=function(b){var c,f=!1,g={};if(a._hasTimer||b)return a._a&&(b||(0opera.version()?new Audio(null):new Audio,c=a._a,c._called_load=!1,C&&(Ya=c);a.isHTML5=!0;a._a=c;c._s=a;h();a._apply_loop(c,b.loops);b.autoLoad||b.autoPlay?a.load():(c.autobuffer=!1,c.preload="auto");return c};h=function(){if(a._a._added_events)return!1;var b;a._a._added_events=!0;for(b in J)J.hasOwnProperty(b)&&a._a&&a._a.addEventListener(b,J[b],!1);return!0};k=function(){var b; +c._wD(a.id+": Removing event listeners");a._a._added_events=!1;for(b in J)J.hasOwnProperty(b)&&a._a&&a._a.removeEventListener(b,J[b],!1)};this._onload=function(b){var d=!!b||!a.isHTML5&&8===n&&a.duration;b=a.id+": ";c._wD(b+(d?"onload()":"Failed to load / invalid sound?"+(a.duration?" -":" Zero-length duration reported.")+" ("+a.url+")"),d?1:2);d||a.isHTML5||(!0===c.sandbox.noRemote&&c._wD(b+t("noNet"),1),!0===c.sandbox.noLocal&&c._wD(b+t("noLocal"),1));a.loaded=d;a.readyState=d?3:2;a._onbufferchange(0); +a._iO.onload&&ua(a,function(){a._iO.onload.apply(a,[d])});return!0};this._onbufferchange=function(b){if(0===a.playState||b&&a.isBuffering||!b&&!a.isBuffering)return!1;a.isBuffering=1===b;a._iO.onbufferchange&&(c._wD(a.id+": Buffer state change: "+b),a._iO.onbufferchange.apply(a,[b]));return!0};this._onsuspend=function(){a._iO.onsuspend&&(c._wD(a.id+": Playback suspended"),a._iO.onsuspend.apply(a));return!0};this._onfailure=function(b,d,e){a.failures++;c._wD(a.id+": Failure ("+a.failures+"): "+b); +if(a._iO.onfailure&&1===a.failures)a._iO.onfailure(b,d,e);else c._wD(a.id+": Ignoring failure")};this._onwarning=function(b,c,d){if(a._iO.onwarning)a._iO.onwarning(b,c,d)};this._onfinish=function(){var b=a._iO.onfinish;a._onbufferchange(0);a._resetOnPosition(0);a.instanceCount&&(a.instanceCount--,a.instanceCount||(Xa(),a.playState=0,a.paused=!1,a.instanceCount=0,a.instanceOptions={},a._iO={},G(),a.isHTML5&&(a.position=0)),a.instanceCount&&!a._iO.multiShotEvents||!b||(c._wD(a.id+": onfinish()"),ua(a, +function(){b.apply(a)})))};this._whileloading=function(b,c,d,e){var f=a._iO;a.bytesLoaded=b;a.bytesTotal=c;a.duration=Math.floor(d);a.bufferLength=e;a.durationEstimate=a.isHTML5||f.isMovieStar?a.duration:f.duration?a.duration>f.duration?a.duration:f.duration:parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10);a.isHTML5||(a.buffered=[{start:0,end:a.duration}]);(3!==a.readyState||a.isHTML5)&&f.whileloading&&f.whileloading.apply(a)};this._whileplaying=function(b,c,d,e,f){var k=a._iO;if(isNaN(b)||null=== +b)return!1;a.position=Math.max(0,b);a._processOnPosition();!a.isHTML5&&8opera.version()?new Audio(null):new Audio:null,e,a,f={},h,k;h=c.audioFormats;for(e in h)if(h.hasOwnProperty(e)&&(a="audio/"+e,f[e]=b(h[e].type),f[a]=f[e],e.match(pb)?(c.flash[e]=!0,c.flash[a]=!0):(c.flash[e]=!1,c.flash[a]=!1),h[e]&&h[e].related))for(k=h[e].related.length-1;0<=k;k--)f["audio/"+h[e].related[k]]= +f[e],c.html5[h[e].related[k]]=f[e],c.flash[h[e].related[k]]=f[e];f.canPlayType=d?b:null;c.html5=A(c.html5,f);c.html5.usingFlash=ib();u=c.html5.usingFlash;return!0};z={notReady:"Unavailable - wait until onready() has fired.",notOK:"Audio support is not available.",domError:"soundManagerexception caught while appending SWF to DOM.",spcWmode:"Removing wmode, preventing known SWF loading issue(s)",swf404:"soundManager: Verify that %s is a valid path.",tryDebug:"Try soundManager.debugFlash = true for more security details (output goes to SWF.)", +checkSWF:"See SWF output for more debug info.",localFail:"soundManager: Non-HTTP page ("+m.location.protocol+" URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/",waitFocus:"soundManager: Special case: Waiting for SWF to load with window focus...",waitForever:"soundManager: Waiting indefinitely for Flash (will recover if unblocked)...", +waitSWF:"soundManager: Waiting for 100% SWF load...",needFunction:"soundManager: Function object expected for %s",badID:'Sound ID "%s" should be a string, starting with a non-numeric character',currentObj:"soundManager: _debug(): Current sound objects",waitOnload:"soundManager: Waiting for window.onload()",docLoaded:"soundManager: Document already loaded",onload:"soundManager: initComplete(): calling soundManager.onload()",onloadOK:"soundManager.onload() complete",didInit:"soundManager: init(): Already called?", +secNote:"Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html",badRemove:"soundManager: Failed to remove Flash node.",shutdown:"soundManager.disable(): Shutting down",queue:"soundManager: Queueing %s handler",smError:"SMSound.load(): Exception: JS-Flash communication failed, or JS error.",fbTimeout:"No flash response, applying .swf_timedout CSS...", +fbLoaded:"Flash loaded",fbHandler:"soundManager: flashBlockHandler()",manURL:"SMSound.load(): Using manually-assigned URL",onURL:"soundManager.load(): current URL already assigned.",badFV:'soundManager.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.',as2loop:"Note: Setting stream:false so looping can work (flash 8 limitation)",noNSLoop:"Note: Looping not implemented for MovieStar formats",needfl9:"Note: Switching to flash 9, required for MP4 formats.",mfTimeout:"Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case", +needFlash:"soundManager: Fatal error: Flash is needed to play some required formats, but is not available.",gotFocus:"soundManager: Got window focus.",policy:"Enabling usePolicyFile for data access",setup:"soundManager.setup(): allowed parameters: %s",setupError:'soundManager.setup(): "%s" cannot be assigned with this method.',setupUndef:'soundManager.setup(): Could not find option "%s"',setupLate:"soundManager.setup(): url, flashVersion and html5Test property changes will not take effect until reboot().", +noURL:"soundManager: Flash URL required. Call soundManager.setup({url:...}) to get started.",sm2Loaded:"SoundManager 2: Ready. "+String.fromCharCode(10003),reset:"soundManager.reset(): Removing event callbacks",mobileUA:"Mobile UA detected, preferring HTML5 by default.",globalHTML5:"Using singleton HTML5 Audio() pattern for this device.",ignoreMobile:"Ignoring mobile restrictions for this device."};t=function(){var b,c,e,a;b=kb.call(arguments);c=b.shift();if((a=z&&z[c]?z[c]:"")&&b&&b.length)for(c= +0,e=b.length;cn&&(c._wD(t("needfl9")),c.flashVersion=n=9);c.version=c.versionNumber+(c.html5Only?" (HTML5-only mode)":9===n?" (AS3/Flash 9)":" (AS2/Flash 8)");8'}if(X&&Y)return!1;if(c.html5Only)return Ea(),e(),c.oMC=F(c.movieID),za(),Y=X=!0,!1;var f=d||c.url,h=c.altURL||f,k=ma(),l=V(), +n=null,n=m.getElementsByTagName("html")[0],p,r,q,n=n&&n.dir&&n.dir.match(/rtl/i);b=b===g?c.id:b;Ea();c.url=db(ga?f:h);d=c.url;c.wmode=!c.wmode&&c.useHighPerformance?"transparent":c.wmode;null!==c.wmode&&(v.match(/msie 8/i)||!O&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i)&&(M.push(z.spcWmode),c.wmode=null);k={name:b,id:b,src:d,quality:"high",allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:vb+"www.macromedia.com/go/getflashplayer",title:"JS/Flash audio component (SoundManager 2)", +type:"application/x-shockwave-flash",wmode:c.wmode,hasPriority:"true"};c.debugFlash&&(k.FlashVars="debug=1");c.wmode||delete k.wmode;if(O)f=m.createElement("div"),r=['',a("movie",d),a("AllowScriptAccess",c.allowScriptAccess),a("quality",k.quality),c.wmode?a("wmode",c.wmode):"",a("bgcolor", +c.bgColor),a("hasPriority","true"),c.debugFlash?a("FlashVars",k.FlashVars):"",""].join("");else for(p in f=m.createElement("embed"),k)k.hasOwnProperty(p)&&f.setAttribute(p,k[p]);Ga();l=V();if(k=ma())if(c.oMC=F(c.movieID)||m.createElement("div"),c.oMC.id)q=c.oMC.className,c.oMC.className=(q?q+" ":"movieContainer")+(l?" "+l:""),c.oMC.appendChild(f),O&&(p=c.oMC.appendChild(m.createElement("div")),p.className="sm2-object-box",p.innerHTML=r),Y=!0;else{c.oMC.id=c.movieID;c.oMC.className="movieContainer "+ +l;p=l=null;c.useFlashBlock||(c.useHighPerformance?l={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"}:(l={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},n&&(l.left=Math.abs(parseInt(l.left,10))+"px")));ub&&(c.oMC.style.zIndex=1E4);if(!c.debugFlash)for(q in l)l.hasOwnProperty(q)&&(c.oMC.style[q]=l[q]);try{O||c.oMC.appendChild(f),k.appendChild(c.oMC),O&&(p=c.oMC.appendChild(m.createElement("div")),p.className="sm2-object-box",p.innerHTML= +r),Y=!0}catch(u){throw Error(t("domError")+" \n"+u.toString());}}X=!0;e();return!0};la=function(){if(c.html5Only)return na(),!1;if(l)return!1;if(!c.url)return p("noURL"),!1;l=c.getMovie(c.id);l||(ba?(O?c.oMC.innerHTML=Ia:c.oMC.appendChild(ba),ba=null,X=!0):na(c.id,c.url),l=c.getMovie(c.id));"function"===typeof c.oninitmovie&&setTimeout(c.oninitmovie,1);Oa();return!0};T=function(){setTimeout($a,1E3)};Da=function(){h.setTimeout(function(){L("soundManager: useFlashBlock is false, 100% HTML5 mode is possible. Rebooting with preferFlash: false..."); +c.setup({preferFlash:!1}).reboot();c.didFlashBlock=!0;c.beginDelayedInit()},1)};$a=function(){var b,d=!1;if(!c.url||ca)return!1;ca=!0;x.remove(h,"load",T);if(H&&xa&&!Va)return p("waitFocus"),!1;q||(b=c.getMoviePercent(),0b&&(d=!0));setTimeout(function(){b=c.getMoviePercent();if(d)return ca=!1,c._wD(t("waitSWF")),h.setTimeout(T,1),!1;q||(c._wD("soundManager: No Flash response within expected time. Likely causes: "+(0===b?"SWF load failed, ":"")+"Flash blocked or JS-Flash security error."+(c.debugFlash? +" "+t("checkSWF"):""),2),!ga&&b&&(p("localFail",2),c.debugFlash||p("tryDebug",2)),0===b&&c._wD(t("swf404",c.url),1),D("flashtojs",!1,": Timed out"+(ga?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)")));!q&&ob&&(null===b?c.useFlashBlock||0===c.flashLoadTimeout?(c.useFlashBlock&&Ja(),p("waitForever")):!c.useFlashBlock&&ea?Da():(p("waitForever"),P({type:"ontimeout",ignoreInit:!0,error:{type:"INIT_FLASHBLOCK"}})):0===c.flashLoadTimeout?p("waitForever"):!c.useFlashBlock&&ea?Da(): +Ha(!0))},c.flashLoadTimeout)};ka=function(){if(Va||!xa)return x.remove(h,"focus",ka),!0;Va=ob=!0;p("gotFocus");ca=!1;T();x.remove(h,"focus",ka);return!0};Oa=function(){M.length&&(c._wD("SoundManager 2: "+M.join(" "),1),M=[])};mb=function(){Oa();var b,d=[];if(c.useHTML5Audio&&c.hasHTML5){for(b in c.audioFormats)c.audioFormats.hasOwnProperty(b)&&d.push(b+" = "+c.html5[b]+(!c.html5[b]&&u&&c.flash[b]?" (using flash)":c.preferFlash&&c.flash[b]&&u?" (preferring flash)":c.html5[b]?"":" ("+(c.audioFormats[b].required? +"required, ":"")+"and no flash support)"));c._wD("SoundManager 2 HTML5 support: "+d.join(", "),1)}};Z=function(b){if(q)return!1;if(c.html5Only)return p("sm2Loaded",1),q=!0,S(),D("onload",!0),!0;var d=!0,e;c.useFlashBlock&&c.flashLoadTimeout&&!c.getMoviePercent()||(q=!0);e={type:!H&&u?"NO_FLASH":"INIT_TIMEOUT"};c._wD("SoundManager 2 "+(y?"failed to load":"loaded")+" ("+(y?"Flash security/load error":"OK")+") "+String.fromCharCode(y?10006:10003),y?2:1);y||b?(c.useFlashBlock&&c.oMC&&(c.oMC.className= +V()+" "+(null===c.getMoviePercent()?"swf_timedout":"swf_error")),P({type:"ontimeout",error:e,ignoreInit:!0}),D("onload",!1),U(e),d=!1):D("onload",!0);y||(c.waitForWindowLoad&&!ja?(p("waitOnload"),x.add(h,"load",S)):(c.waitForWindowLoad&&ja&&p("docLoaded"),S()));return d};Za=function(){var b,d=c.setupOptions;for(b in d)d.hasOwnProperty(b)&&(c[b]===g?c[b]=d[b]:c[b]!==d[b]&&(c.setupOptions[b]=c[b]))};za=function(){if(q)return p("didInit"),!1;if(c.html5Only)return q||(x.remove(h,"load",c.beginDelayedInit), +c.enabled=!0,Z()),!0;la();try{l._externalInterfaceTest(!1),ab(!0,c.flashPollingInterval||(c.useHighPerformance?10:50)),c.debugMode||l._disableDebug(),c.enabled=!0,D("jstoflash",!0),c.html5Only||x.add(h,"unload",ya)}catch(b){return c._wD("js/flash exception: "+b.toString()),D("jstoflash",!1),U({type:"JS_TO_FLASH_EXCEPTION",fatal:!0}),Ha(!0),Z(),!1}Z();x.remove(h,"load",c.beginDelayedInit);return!0};Q=function(){if(aa)return!1;aa=!0;Za();Ga();!H&&c.hasHTML5&&(c._wD("SoundManager 2: No Flash detected"+ +(c.useHTML5Audio?". Trying HTML5-only mode.":", enabling HTML5."),1),c.setup({useHTML5Audio:!0,preferFlash:!1}));jb();!H&&u&&(M.push(z.needFlash),c.setup({flashLoadTimeout:1}));m.removeEventListener&&m.removeEventListener("DOMContentLoaded",Q,!1);la();return!0};La=function(){"complete"===m.readyState&&(Q(),m.detachEvent("onreadystatechange",La));return!0};Fa=function(){ja=!0;Q();x.remove(h,"load",Fa)};Na();x.add(h,"focus",ka);x.add(h,"load",T);x.add(h,"load",Fa);m.addEventListener?m.addEventListener("DOMContentLoaded", +Q,!1):m.attachEvent?m.attachEvent("onreadystatechange",La):(D("onload",!1),U({type:"NO_DOM2_EVENTS",fatal:!0}))}if(!h||!h.document)throw Error("SoundManager requires a browser with window and document objects.");var W=null;h.SM2_DEFER!==g&&SM2_DEFER||(W=new K);"object"===typeof module&&module&&"object"===typeof module.exports?(module.exports.SoundManager=K,module.exports.soundManager=W):"function"===typeof define&&define.amd&&define(function(){return{constructor:K,getInstance:function(g){!h.soundManager&& +g instanceof Function&&(g=g(K),g instanceof K&&(h.soundManager=g));return h.soundManager}}});h.SoundManager=K;h.soundManager=W})(window); \ No newline at end of file diff --git a/html/webapp/soundmanager2-setup.js b/html/webapp/soundmanager2-setup.js new file mode 100644 index 0000000000..4d0ac6630d --- /dev/null +++ b/html/webapp/soundmanager2-setup.js @@ -0,0 +1 @@ +window.SM2_DEFER = true; \ No newline at end of file diff --git a/html/webapp/styles.css b/html/webapp/styles.css new file mode 100644 index 0000000000..edaf3900b7 --- /dev/null +++ b/html/webapp/styles.css @@ -0,0 +1,12 @@ +canvas { + cursor: default; + outline: none; + padding: 0px; + margin: 0px; +} + +body { + background-color: black; + margin: 0px; + padding: 0px; +} diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000000..7c74fc5e7c --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include 'desktop', 'html', 'core' \ No newline at end of file