package com.badlogic.gdx.ingenuity.screen;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.ingenuity.Asset;
import com.badlogic.gdx.ingenuity.GdxData;
import com.badlogic.gdx.ingenuity.screen.LoadingScreen.ILoadingComplete;
import com.badlogic.gdx.ingenuity.utils.helper.PixmapHelper;
import com.badlogic.gdx.ingenuity.utils.scene2d.SimpleScreen;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.ui.ButtonGroup;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
import com.badlogic.gdx.utils.Align;

import net.mwplay.nativefont.NativeButton;

/**
 * @作者 mitkey
 * @时间 2017年5月20日 下午12:14:45
 * @类说明 BaseTestScreen.java <br/>
 * @版本 0.0.1
 */
public abstract class BaseTestScreen extends SimpleScreen {

	public static final List<Class<? extends SimpleScreen>> tests = new ArrayList<Class<? extends SimpleScreen>>(
			Arrays.asList(LoginScreen.class, HallScreen.class, RoomScreen.class));

	@Override
	public void show() {
		super.show();

		// 纹理
		Drawable up = changeSpace(PixmapHelper.getInstance().newRectangleDrawable(Color.DARK_GRAY, 20, 20));
		Drawable down = changeSpace(PixmapHelper.getInstance().newRectangleDrawable(Color.GRAY, 20, 20));
		Drawable checked = changeSpace(PixmapHelper.getInstance().newRectangleDrawable(Color.LIGHT_GRAY, 20, 20));

		// 按钮组
		ButtonGroup<NativeButton> buttonGroup = new ButtonGroup<NativeButton>();
		// 垂直容器
		Table table = new Table();
		table.pad(5).center().defaults().align(Align.center).top().space(10);
		for (final Class<? extends SimpleScreen> clazz : tests) {
			NativeButton button = newNativeButton(clazz.getSimpleName(), up, down, checked, 20);
			table.add(button).size(130, 35).row();
			buttonGroup.add(button);
			button.addListener(new ClickListener() {
				@Override
				public void clicked(InputEvent event, float x, float y) {
					super.clicked(event, x, y);
					game().updateScreen(new LoadingScreen(new ILoadingComplete() {
						@Override
						public boolean complete() {
							try {
								game().updateScreen(clazz.newInstance());
							} catch (InstantiationException | IllegalAccessException e) {
								e.printStackTrace();
							}
							return true;
						}
					}, Asset.none));
				}
			});
		}
		table.pack();
		table.setPosition(0, GdxData.HEIGHT - table.getHeight());
		stage().addActor(table);

		// 选中当前的
		buttonGroup.uncheckAll();
		for (NativeButton temp : buttonGroup.getButtons()) {
			if (getCurScreenClazz().getSimpleName().equals(temp.getText().toString())) {
				temp.setChecked(true);
			}
		}
	}

	@Override
	public void dispose() {
		super.dispose();
	}

	public Class<? extends SimpleScreen> getCurScreenClazz() {
		return getClass();
	}

	private Drawable changeSpace(Drawable drawable) {
		drawable.setTopHeight(20);
		drawable.setRightWidth(20);
		drawable.setBottomHeight(20);
		drawable.setLeftWidth(20);
		return drawable;
	}

}

@@ -485,16 +485,66 @@
 tEvent;%0A
+import com.badlogic.gdx.scenes.scene2d.Touchable;%0A
 import c
@@ -1563,16 +1563,22 @@
 / %E6%8C%89%E9%92%AE%E7%BB%84%0A%09%09
+final 
 ButtonGr
@@ -1693,17 +1693,18 @@
 ble.pad(
-5
+10
 ).center
@@ -1933,14 +1933,14 @@
 ze(1
-3
+5
 0, 
-3
 5
+0
 ).ro
@@ -1944,16 +1944,176 @@
 .row();%0A
+%09%09%09boolean checkCurChecked = checkCurChecked(button);%0A%09%09%09if (checkCurChecked) %7B%0A%09%09%09%09button.setDisabled(true);%0A%09%09%09%09button.setTouchable(Touchable.disabled);%0A%09%09%09%7D%0A
 %09%09%09butto
@@ -2849,76 +2849,28 @@
 if (
-getCurScreenClazz().getSimpleName().equals(temp.getText().toString()
+checkCurChecked(temp
 )) %7B
@@ -3054,16 +3054,154 @@
 ();%0A%09%7D%0A%0A
+%09private boolean checkCurChecked(NativeButton temp) %7B%0A%09%09return getCurScreenClazz().getSimpleName().equals(temp.getText().toString());%0A%09%7D%0A%0A
 %09private

modify BaseTestScreen.java