aboutsummaryrefslogtreecommitdiff
path: root/build/android/src/main/java/net.minetest.minetest/MinetestTextEntry.java
blob: 68dc732740edbe4be230b4296c598ef21139f81f (plain)
1
2
3
4
5
6
local scriptpath = core.get_builtin_path()
local commonpath = scriptpath .. "common" .. DIR_DELIM
local gamepath   = scriptpath .. "game".. DIR_DELIM

-- Shared between builtin files, but
-- not exposed to outer context
local builtin_shared = {}

dofile(gamepath .. "constants.lua")
dofile(gamepath .. "item_s.lua")
assert(loadfile(gamepath .. "item.lua"))(builtin_shared)
dofile(gamepath .. "register.lua")

if core.settings:get_bool("profiler.load") then
	profiler = dofile(scriptpath .. "profiler" .. DIR_DELIM .. "init.lua")
end

dofile(commonpath .. "after.lua")
dofile(gamepath .. "item_entity.lua")
dofile(gamepath .. "deprecated.lua")
dofile(gamepath .. "misc_s.lua")
dofile(gamepath .. "misc.lua")
dofile(gamepath .. "privileges.lua")
dofile(gamepath .. "auth.lua")
dofile(commonpath .. "chatcommands.lua")
dofile(gamepath .. "chat.lua")
dofile(commonpath .. "information_formspecs.lua")
dofile(gamepath .. "static_spawn.lua")
dofile(gamepath .. "detached_inventory.lua")
assert(loadfile(gamepath .. "falling.lua"))(builtin_shared)
dofile(gamepath .. "features.lua")
dofile(gamepath .. "voxelarea.lua")
dofile(gamepath .. "forceloading.lua")
dofile(gamepath .. "statbars.lua")
dofile(gamepath .. "knockback.lua")
dofile(gamepath .. "async.lua")

profiler = nil
ss="hl opt">.getString("current"); int editType = b.getInt("editType"); AlertDialog.Builder builder = new AlertDialog.Builder(this); mTextInputWidget = new EditText(this); mTextInputWidget.setHint(hint); mTextInputWidget.setText(current); mTextInputWidget.setMinWidth(300); if (editType == SingleLinePasswordInput) { mTextInputWidget.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); } else { mTextInputWidget.setInputType(InputType.TYPE_CLASS_TEXT); } builder.setView(mTextInputWidget); if (editType == MultiLineTextInput) { builder.setPositiveButton(acceptButton, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { pushResult(mTextInputWidget.getText().toString()); } }); } builder.setOnCancelListener(new DialogInterface.OnCancelListener() { public void onCancel(DialogInterface dialog) { cancelDialog(); } }); mTextInputWidget.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View view, int KeyCode, KeyEvent event) { if ( KeyCode == KeyEvent.KEYCODE_ENTER){ pushResult(mTextInputWidget.getText().toString()); return true; } return false; } }); mTextInputDialog = builder.create(); mTextInputDialog.show(); } public void pushResult(String text) { Intent resultData = new Intent(); resultData.putExtra("text", text); setResult(Activity.RESULT_OK,resultData); mTextInputDialog.dismiss(); finish(); } public void cancelDialog() { setResult(Activity.RESULT_CANCELED); mTextInputDialog.dismiss(); finish(); } }