summaryrefslogtreecommitdiff
path: root/src/content_nodemeta.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2014-10-09 14:02:02 +0200
committersfan5 <sfan5@live.de>2014-11-19 15:11:23 +0100
commit9d69436052c32bc218352fc991be157a4f135b9d (patch)
tree8c6ebf508615dde855b6331a7f8c0d7afd786a60 /src/content_nodemeta.cpp
parent0ee5a2197d228122412598f6b87000df10006911 (diff)
downloadminetest-9d69436052c32bc218352fc991be157a4f135b9d.tar.gz
minetest-9d69436052c32bc218352fc991be157a4f135b9d.tar.bz2
minetest-9d69436052c32bc218352fc991be157a4f135b9d.zip
Add (optional) client-side saving of server map to disk
Diffstat (limited to 'src/content_nodemeta.cpp')
0 files changed, 0 insertions, 0 deletions
id='n89' href='#n89'>89 90 91 92 93 94 95 96 97 98 99
package net.minetest.minetest;

import android.app.NativeActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.WindowManager;

public class MtNativeActivity extends NativeActivity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		m_MessagReturnCode = -1;
		m_MessageReturnValue = "";
		
	}

	@Override
	public void onDestroy() {
		super.onDestroy();
	}
	
	
	public void copyAssets() {
		Intent intent = new Intent(this, MinetestAssetCopy.class);
		startActivity(intent);
	}
	
	public void showDialog(String acceptButton, String hint, String current,
			int editType) {
		
		Intent intent = new Intent(this, MinetestTextEntry.class);
		Bundle params = new Bundle();
		params.putString("acceptButton", acceptButton);
		params.putString("hint", hint);
		params.putString("current", current);
		params.putInt("editType", editType);
		intent.putExtras(params);
		startActivityForResult(intent, 101);
		m_MessageReturnValue = "";
		m_MessagReturnCode   = -1;
	}
	
	public static native void putMessageBoxResult(String text);
	
	/* ugly code to workaround putMessageBoxResult not beeing found */
	public int getDialogState() {
		return m_MessagReturnCode;
	}
	
	public String getDialogValue() {
		m_MessagReturnCode = -1;
		return m_MessageReturnValue;
	}
	
	public float getDensity() {
		return getResources().getDisplayMetrics().density;
	}
	
	public int getDisplayWidth() {
		return getResources().getDisplayMetrics().widthPixels;
	}
	
	public int getDisplayHeight() {
		return getResources().getDisplayMetrics().heightPixels;