From cb03fe437fe3797307a34315d94b5b41f69aeac9 Mon Sep 17 00:00:00 2001 From: fred-boy Date: Thu, 19 Apr 2018 21:41:32 +0700 Subject: [PATCH] Cut creative inventory --- android/assets/allitems.png | Bin 2055 -> 1267 bytes android/build.gradle | 31 ++++++++---------- build.gradle | 2 +- .../src/ru/deadsoftware/cavecraft/Assets.java | 4 +-- .../cavecraft/game/GameRenderer.java | 2 +- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/android/assets/allitems.png b/android/assets/allitems.png index e1e5d77973f1dc696ecc0df1b784613c90654e2c..58dfb47c48bc12170ae9205e25e4c21236b4c5a9 100644 GIT binary patch literal 1267 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5C#Tjh5(-sS0EP%%+1Y1Lqof} zyN?|^_W%EXh~OwW8Un*U1d^tF&INjsu_VYZn8D%MjWiG^$=lt9p@UV{1IXbl@Q5sC zVBk9l!i+m6X1@grvX^-Jy0SlF5#|$=|6=W14%Cz5>EaktaqI0JN4_Ql0f&oWx9mdKI;Vst01~X9QUCw| literal 2055 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911MRQ8&P5Fo{p?&#~tz_78O`%fY(0|PTd zfKP}kP~62^QA&dRf`N&DBm;)v@9e6; zXy+{Oh%9Dc;5!Jyj5{V~zXb|PmbgZg1m~xflqVLYG6W=M=9TFAxrQi|8S9zqS(sZl z!~#o{98VX=kczmscMq1WHsEm$WS{i^e@fiRs$8cN0o&Fb{WhU7dtGZy>62}_x1;86 zJlel)tNYxGRvZB@|H^-_V7;YxVDG7jX$7ohjH~wi`|HOb_&~VBj{OOP=LO9N5>J>< zX&m4%bm|GvS1$Q2ll^Y8t*&g?hIjr}&l+z3GL+ltKaXjT{>#b;;RW$RXYRiL>@Ut} z$7tywRKjJ!c3&IDSqh}e#ktK zn8FTG zeg=0rf3XB9?vPPnKfx&PHi!R$f@8-1yc?Xn1c7i0>fvS7HF(MoSQN5n&-VP12%UCKLQ@HJc|4DVa?TCK~xzpPJigTMWM1&94I2LIpvX8HB3!C#{$I=%XmB~zL;+kW{T*~tow ze!Q=4s(j=u@oQ2_Sa)rP%8##?dV&|s7oDg3{5MMt)BSh7CmD+lq|R8NqQS}M*R(nC z;pZx=@a7o_oUB&A8id~0|2%f$k}}h_Z;P|%3g)+LTYI(gZ-x4vw_V$;ly{i#+h6l% z%GR_$f)74QWv@NzzNSq4K`D!#VDPnBk2Mdhf4eU}v|+!%j#Ugw56oFy9M-akZH!vp z5Zu83fZ4*)?!hg)gj!}LLG|plmLD3Tev9sp5)@dUxmMEEVeQ|p__Z7z*SB2jQCe`V z?&$h3mLu6w*=~XX+4~=bYcoAEU2D3SW5w3^kE=x)KhC-~E0E>Nt@S^yb~RM^W}nqy z%6c3AC(G4g&$6v)B8*$VY1eI4Qi!`8W&Dr%)V3`-2c~$ofC_3)S3j3^P6 def outputDir = null - if(jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a") - if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a") - if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi") - if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64") - if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86") - if(outputDir != null) { + if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a") + if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a") + if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi") + if (jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64") + if (jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86") + if (outputDir != null) { copy { from zipTree(jar) into outputDir @@ -59,7 +57,6 @@ task copyAndroidNatives() { } } } - task run(type: Exec) { def path def localProperties = project.file("../local.properties") @@ -81,7 +78,6 @@ task run(type: Exec) { def adb = path + "/platform-tools/adb" commandLine "$adb", 'shell', 'am', 'start', '-n', 'ru.deadsoftware.cavecraft/ru.deadsoftware.cavecraft.AndroidLauncher' } - // sets up the Android Eclipse project, using the old Ant based build. eclipse { // need to specify Java source sets explicitly, SpringSource Gradle Eclipse plugin @@ -98,8 +94,8 @@ eclipse { } classpath { - plusConfigurations += [ project.configurations.compile ] - containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES' + plusConfigurations += [project.configurations.compile] + containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES' } project { @@ -112,12 +108,11 @@ eclipse { buildCommand "com.android.ide.eclipse.adt.ApkBuilder" } } - // sets up the Android Idea project, using the old Ant based build. idea { module { sourceDirs += file("src"); - scopes = [ COMPILE: [plus:[project.configurations.compile]]] + scopes = [COMPILE: [plus: [project.configurations.compile]]] iml { withXml { @@ -127,7 +122,7 @@ idea { builder.component(name: "FacetManager") { facet(type: "android", name: "Android") { configuration { - option(name: "UPDATE_PROPERTY_FILES", value:"true") + option(name: "UPDATE_PROPERTY_FILES", value: "true") } } } @@ -135,3 +130,5 @@ idea { } } } +dependencies { +} diff --git a/build.gradle b/build.gradle index a9fac5c..9d3557f 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ allprojects { apply plugin: "eclipse" apply plugin: "idea" - version = '1.0' + version = 'alpha0.1' ext { appName = "CaveCraft" gdxVersion = '1.9.7' diff --git a/core/src/ru/deadsoftware/cavecraft/Assets.java b/core/src/ru/deadsoftware/cavecraft/Assets.java index 593a2c0..7dedb4b 100644 --- a/core/src/ru/deadsoftware/cavecraft/Assets.java +++ b/core/src/ru/deadsoftware/cavecraft/Assets.java @@ -74,9 +74,9 @@ public class Assets { invBarCur = new TextureRegion(gui,0,38,24,24); creativeTexture = new Texture(Gdx.files.internal("allitems.png")); - creativeInv = new TextureRegion(creativeTexture, 0, 0, 176, 208); + creativeInv = new TextureRegion(creativeTexture, 0, 0, 176, 136); creativeInv.flip(false,true); - creativeScroll = new TextureRegion(creativeTexture, 2, 209, 12, 15); + creativeScroll = new TextureRegion(creativeTexture, 3, 137, 12, 15); creativeScroll.flip(false, true); touchGui = new Texture(Gdx.files.internal("touch_gui.png")); diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java index e119487..566f072 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java @@ -162,7 +162,7 @@ public class GameRenderer { for (int i=0; i<9; i++) { if (gameProc.player.inventory[i]>0) spriteBatch.draw(Items.BLOCKS.getValueAt(gameProc.player.inventory[i]).getTexture(), - x+8+i*18, y+184); + x+8+i*18, y+Assets.creativeInv.getRegionHeight()-24); } } -- 2.29.2