Skip to content

Commit

Permalink
Merge branch 'master' into issue/54
Browse files Browse the repository at this point in the history
Conflicts:
	ios/robovm.properties
  • Loading branch information
Arcnor committed Nov 12, 2014
2 parents e84cd49 + 7e583ea commit 12c84dc
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 16 deletions.
17 changes: 17 additions & 0 deletions PD-classes/src/com/watabou/noosa/SkinnedBlock.java
Expand Up @@ -29,6 +29,8 @@ public class SkinnedBlock extends Image {

protected float offsetX;
protected float offsetY;

public boolean autoAdjust = false;

public SkinnedBlock( float width, float height, Object tx ) {
super( tx );
Expand All @@ -51,6 +53,21 @@ public void frame( RectF frame ) {

@Override
protected void updateFrame() {

if (autoAdjust) {
while (offsetX > texture.width) {
offsetX -= texture.width;
}
while (offsetX < -texture.width) {
offsetX += texture.width;
}
while (offsetY > texture.height) {
offsetY -= texture.height;
}
while (offsetY < -texture.height) {
offsetY += texture.height;
}
}

float tw = 1f / texture.width;
float th = 1f / texture.height;
Expand Down
2 changes: 2 additions & 0 deletions core/src/com/watabou/pixeldungeon/ui/Archs.java
Expand Up @@ -37,10 +37,12 @@ public class Archs extends Component {
@Override
protected void createChildren() {
arcsBg = new SkinnedBlock( 1, 1, Assets.ARCS_BG );
arcsBg.autoAdjust = true;
arcsBg.offsetTo( 0, offsB );
add( arcsBg );

arcsFg = new SkinnedBlock( 1, 1, Assets.ARCS_FG );
arcsFg.autoAdjust = true;
arcsFg.offsetTo( 0, offsF );
add( arcsFg );
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/com/watabou/pixeldungeon/windows/WndKeymap.java
Expand Up @@ -39,8 +39,8 @@ private static class KeyPair {

public WndKeymap() {

int ww = Math.min( 160, Camera.main.width - 16 );
int wh = Camera.main.height - 24;
int ww = Math.min( 160, PixelScene.uiCamera.width - 16 );
int wh = PixelScene.uiCamera.height - 24;

resize( ww, wh );

Expand Down
33 changes: 20 additions & 13 deletions core/src/com/watabou/pixeldungeon/windows/WndSettings.java
Expand Up @@ -128,10 +128,11 @@ protected void onClick() {
btnSound.checked( PixelDungeon.soundFx() );
add( btnSound );

Application.ApplicationType type = Gdx.app.getType();

Button lastBtn = btnSound;
if (!inGame) {
Application.ApplicationType type = Gdx.app.getType();
if (type == Application.ApplicationType.Android || type == Application.ApplicationType.iOS) {
/* if (type == Application.ApplicationType.Android || type == Application.ApplicationType.iOS) {
RedButton btnOrientation = new RedButton(orientationText()) {
@Override
protected void onClick() {
Expand All @@ -142,16 +143,7 @@ protected void onClick() {
add(btnOrientation);
lastBtn = btnOrientation;
} else if (type == Application.ApplicationType.Desktop) {

RedButton btnKeymap = new RedButton( TXT_BINDINGS ) {
@Override
protected void onClick() {
parent.add(new WndKeymap());
}
};
btnKeymap.setRect(0, btnSound.bottom() + GAP, WIDTH, BTN_HEIGHT);
add(btnKeymap);
} else*/ if (type == Application.ApplicationType.Desktop) {

RedButton btnResolution = new RedButton(resolutionText()) {
@Override
Expand All @@ -160,7 +152,7 @@ protected void onClick() {
}
};
btnResolution.enable( PixelDungeon.instance.getPlatformSupport().isFullscreenEnabled() );
btnResolution.setRect(0, btnKeymap.bottom() + GAP, WIDTH, BTN_HEIGHT);
btnResolution.setRect(0, btnSound.bottom() + GAP, WIDTH, BTN_HEIGHT);
add(btnResolution);

lastBtn = btnResolution;
Expand All @@ -181,6 +173,21 @@ protected void onClick() {
lastBtn = btnBrightness;

}

if (type == Application.ApplicationType.Desktop) {

RedButton btnKeymap = new RedButton(TXT_BINDINGS) {
@Override
protected void onClick() {
parent.add(new WndKeymap());
}
};
btnKeymap.setRect(0, lastBtn.bottom() + GAP, WIDTH, BTN_HEIGHT);
add(btnKeymap);

lastBtn = btnKeymap;
}

resize(WIDTH, (int) lastBtn.bottom());
}

Expand Down
2 changes: 1 addition & 1 deletion ios/robovm.properties
@@ -1,4 +1,4 @@
#Tue, 11 Nov 2014 13:44:49 +0400
#Thu, 13 Nov 2014 01:28:24 +0400

app.version=1.7.2a-1
app.build=59
Expand Down

0 comments on commit 12c84dc

Please sign in to comment.