s0 guys in my menu m0d i cant see the Xbutt0n but when i read the c0de there is the Xbutt0n c0de and here is my m0d menu and if u kn0w h0w t0 fix it help me u will be in my m0d credits
var GUI;
var menu;
var exitUI;
function dip2px(dips){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
return Math.ceil(dips * ctx.getResources().getDisplayMetrics().density);
}
function newLevel(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
try{
var layout = new android.widget.LinearLayout(ctx);
layout.setOrientation(1);
var menuBtn = new android.widget.Button(ctx);
menuBtn.setText("[WH]");
menuBtn.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
mainMenu();
}
}));
layout.addView(menuBtn);
GUI = new android.widget.PopupWindow(layout, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT);
GUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT));
GUI.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.RIGHT | android.view.Gravity.BOTTOM, 0, 0);
}catch(err){
print("An error occured: " + err);
}
}}));
}
function mainMenu(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
try{
var menuLayout = new android.widget.LinearLayout(ctx);
var menuScroll = new android.widget.ScrollView(ctx);
var menuLayout1 = new android.widget.LinearLayout(ctx);
menuLayout.setOrientation(1);
menuLayout1.setOrientation(1);
menuScroll.addView(menuLayout);
menuLayout1.addView(menuScroll);
var button = new android.widget.Button(ctx);
button.setText("Diamond Kit");
button.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
Player.addItemInventory(310, 1, 0) // Diamond Helmet //
Player.addItemInventory(311, 1, 0) // Diamond Chestplate //
Player.addItemInventory(312, 1, 0) // Diamond Leggings //
Player.addItemInventory(313, 1, 0) // Diamond Boots //
Player.addItemInventory(276, 1, 0) // Diamond Sword //
Player.addItemInventory(261, 1, 0) // Bow //
Player.addItemInventory(262, 64, 0) // Arrows //
Player.addItemInventory(322, 64, 0) // Golden Apples //
}
}));
menuLayout.addView(button);
var button = new android.widget.Button(ctx);
button.setText("Fly");
button.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
Player.setCanFly(1)
}
}));
menuLayout.addView(button);
var button = new android.widget.Button(ctx);
button.setText("Fly");
button.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
Level.setGameMode(1)
}
}));
menuLayout.addView(textview);
var textview = new android.widget.TextView(ctx);
textview.setTextSize(25);
textview.setText('HACK BY WAKANDA');
textview.setGravity(android.view.Gravity.TOP);
menuLayout.addView(textview);
//Add more buttons in this section
menu = new android.widget.PopupWindow(menuLayout1, ctx.getWindowManager().getDefaultDisplay().getWidth()/2, ctx.getWindowManager().getDefaultDisplay().getHeight());
menu.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.BLACK));
menu.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.RIGHT | android.view.Gravity.TOP, 0, 0);
}catch(error){
print("An error occured: " + error);
}
}}));
}
function exit(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
try{
var xLayout = new android.widget.LinearLayout(ctx);
var xButton = new android.widget.Button(ctx);
xButton.setText("x");
xButton.setTextColor(android.graphics.Color.WHITE);
xButton.setOnClickListener(new android.view.View.OnClickListener({
onClick: function(viewarg){
exitUI.dismiss();
menu.dismiss();
}
}));
xLayout.addView(xButton);
exitUI = new android.widget.PopupWindow(xLayout, dip2px(40), dip2px(40));
exitUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT));
exitUI.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.RIGHT | android.view.Gravity.TOP, 0, 0);
}catch(exception){
print(exception);
}
}}));
}
function leaveGame(){
var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
ctx.runOnUiThread(new java.lang.Runnable({ run: function(){
if(GUI != null){
GUI.dismiss();
GUI = null;
}
if(menu != null){
menu.dismiss();
menu = null;
}
if(exitUI != null){
exitUI.dismiss();
exitUI = null;
}
}}));
}
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
s0 guys in my menu m0d i cant see the Xbutt0n but when i read the c0de there is the Xbutt0n c0de and here is my m0d menu and if u kn0w h0w t0 fix it help me u will be in my m0d credits
var GUI; var menu; var exitUI; function dip2px(dips){ var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get(); return Math.ceil(dips * ctx.getResources().getDisplayMetrics().density); } function newLevel(){ var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get(); ctx.runOnUiThread(new java.lang.Runnable({ run: function(){ try{ var layout = new android.widget.LinearLayout(ctx); layout.setOrientation(1); var menuBtn = new android.widget.Button(ctx); menuBtn.setText("[WH]"); menuBtn.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ mainMenu(); } })); layout.addView(menuBtn); GUI = new android.widget.PopupWindow(layout, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT, android.widget.RelativeLayout.LayoutParams.WRAP_CONTENT); GUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT)); GUI.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.RIGHT | android.view.Gravity.BOTTOM, 0, 0); }catch(err){ print("An error occured: " + err); } }})); } function mainMenu(){ var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get(); ctx.runOnUiThread(new java.lang.Runnable({ run: function(){ try{ var menuLayout = new android.widget.LinearLayout(ctx); var menuScroll = new android.widget.ScrollView(ctx); var menuLayout1 = new android.widget.LinearLayout(ctx); menuLayout.setOrientation(1); menuLayout1.setOrientation(1); menuScroll.addView(menuLayout); menuLayout1.addView(menuScroll); var button = new android.widget.Button(ctx); button.setText("Diamond Kit"); button.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ Player.addItemInventory(310, 1, 0) // Diamond Helmet // Player.addItemInventory(311, 1, 0) // Diamond Chestplate // Player.addItemInventory(312, 1, 0) // Diamond Leggings // Player.addItemInventory(313, 1, 0) // Diamond Boots // Player.addItemInventory(276, 1, 0) // Diamond Sword // Player.addItemInventory(261, 1, 0) // Bow // Player.addItemInventory(262, 64, 0) // Arrows // Player.addItemInventory(322, 64, 0) // Golden Apples // } })); menuLayout.addView(button); var button = new android.widget.Button(ctx); button.setText("Fly"); button.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ Player.setCanFly(1) } })); menuLayout.addView(button); var button = new android.widget.Button(ctx); button.setText("Fly"); button.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ Level.setGameMode(1) } })); menuLayout.addView(textview); var textview = new android.widget.TextView(ctx); textview.setTextSize(25); textview.setText('HACK BY WAKANDA'); textview.setGravity(android.view.Gravity.TOP); menuLayout.addView(textview); //Add more buttons in this section menu = new android.widget.PopupWindow(menuLayout1, ctx.getWindowManager().getDefaultDisplay().getWidth()/2, ctx.getWindowManager().getDefaultDisplay().getHeight()); menu.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.BLACK)); menu.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.RIGHT | android.view.Gravity.TOP, 0, 0); }catch(error){ print("An error occured: " + error); } }})); } function exit(){ var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get(); ctx.runOnUiThread(new java.lang.Runnable({ run: function(){ try{ var xLayout = new android.widget.LinearLayout(ctx); var xButton = new android.widget.Button(ctx); xButton.setText("x"); xButton.setTextColor(android.graphics.Color.WHITE); xButton.setOnClickListener(new android.view.View.OnClickListener({ onClick: function(viewarg){ exitUI.dismiss(); menu.dismiss(); } })); xLayout.addView(xButton); exitUI = new android.widget.PopupWindow(xLayout, dip2px(40), dip2px(40)); exitUI.setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(android.graphics.Color.TRANSPARENT)); exitUI.showAtLocation(ctx.getWindow().getDecorView(), android.view.Gravity.RIGHT | android.view.Gravity.TOP, 0, 0); }catch(exception){ print(exception); } }})); } function leaveGame(){ var ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get(); ctx.runOnUiThread(new java.lang.Runnable({ run: function(){ if(GUI != null){ GUI.dismiss(); GUI = null; } if(menu != null){ menu.dismiss(); menu = null; } if(exitUI != null){ exitUI.dismiss(); exitUI = null; } }})); }