Spawn Menu Mouse out of line (REALLY ANNOYING)

Okeeeyyy… So I have recently been updating Excl’s Jailbreak from the converted version recently released. But there is a issue with the spawnmenu. The converter had to remove the mouse display just so people don’t get confused about what button to press! MouseIsGood no longer works as I have figured out. So it had to be fixed but it was out-of-line with the mouse. Is there something that is wrong here?


local x,y = -1000,-1200

(Fonts here, blah blah blah)

-- entity -1585.3541 -359.9099 165.6040
-- cam -1581.458496 -396.353424 222.742065;setang 0.340060 89.003883 0.000000

JB.MainMenuEnabled = false;
JB.MainMenuCharacterScreen = false;

local function WorldToScreen(vWorldPos,vPos,aRot)
	local vWorldPos=vWorldPos-vPos;
	vWorldPos:Rotate(Angle(0,-aRot.y,0));
	vWorldPos:Rotate(Angle(-aRot.p,0,0));
	vWorldPos:Rotate(Angle(0,0,-aRot.r));
	return vWorldPos.x/0.1,(-vWorldPos.y)/0.1;
end
local selectedTeam = "prisoner";
local preview
local selection = 0;
local prisoner = 1;
local bg = surface.GetTextureID("vgui/background_texture")
local lenOne = 36;
local lenTwo = 36;
local full = surface.GetTextureID("excljailbreak/full");
local sel

local pnl = vgui.Create("DButton")
pnl:SetPos(0, 0);
pnl:SetSize(ScrW(), ScrH());
pnl:SetText("")
function pnl:Paint() end
pnl.DoClick = function()
	if selection == 1 then
		prisoner = prisoner-1;
		if prisoner < 1 then
			prisoner = #JB.Characters.Prisoner;	
		end
	elseif selection == 2 then
		prisoner = prisoner+1;
		if prisoner > #JB.Characters.Prisoner then
			prisoner = 1;
		end
	elseif selection == 4 then
		RunConsoleCommand("jb_menu_backtomain")		
		JB.MainMenuCharacterScreen = false;
		JB:ResetSkipMenuMoves()
	elseif selection == 3 then
		RunConsoleCommand("jb_menu_selectcharacter",selectedTeam,prisoner);
	elseif selection == 5 then
		JB.MainMenuCharacterScreen = true;
		RunConsoleCommand("jb_menu_gocharacterpos");
		JB:ResetSkipMenuMoves()
		selectedTeam = "prisoner"
	elseif selection == 6 then
		RunConsoleCommand("jb_menu_selectcharacter","guard");
	elseif selection == 8 then
		RunConsoleCommand("jb_spectate")
		JB.MainMenuEnabled = false
		gui.EnableScreenClicker(false)
	end
end

hook.Add("PostDrawTranslucentRenderables","123PostDrawLolMeowRgrg", function()
	if not JB.MainMenuEnabled then 
		pnl:SetCursor("normal")
		return
	end
	
	local mmp = MenuMain.pos+Vector(-113.3646, 45.0206, -93.8978);

	if not preview or not preview:IsValid() then
		preview = ents.FindByClass("jb_previewmodel")[1]
	end
	
	selection = 0;
	
	local pos = LocalPlayer():GetEyeTrace().HitPos;			
	local xMouse, yMouse = gui.MouseX(), gui.MouseY()
	
	render.SetToneMappingScaleLinear(Vector(0.8,1,3));
	cam.Start3D2D(mmp,Angle(0,0,90), .1);
		surface.SetDrawColor(Color(200,200,200))
		surface.DrawRect(x-500,y-500,512*7,512*4);
		
		surface.SetDrawColor(Color(255,255,255,200));
		surface.SetTexture(bg);
		for i=0,7 do
			for j=0,4 do
				surface.DrawTexturedRect(x-500+(i*512),y-500+(j*512),512,512);
			end
		end
		--####################
		--##   MAINMENU    ##
		--####################
		
		local MouseIsGood = (xMouse > x+1725 and xMouse < x+2275)
		draw.SimpleText("Welcome to Trizone Jailbreak,", "HUDNumber5",x+2000,y,Color(0,0,0,255),1,0);
		draw.SimpleText(LocalPlayer():Nick(), "JailBreakTitleFont",x+2000,y+48,Color(0,0,0,255),1,0);

		draw.SimpleText("Select a team below", "HUDNumber5",x+2000,y+180,Color(0,0,0,255),1,0);
		
		local cA , cB , cC = Color(255,255,255,255),Color(255,255,255,255),Color(255,255,255,255);
		
		if not JB:CanBeGuard() then
			cB = Color(100,100,100,255);
		end
		
		if yMouse < ScrH()/3 then
			cA = Color(200,145,23,255);
			selection = 5;
			sel = 5
		elseif yMouse > ScrH()/3 and yMouse < ScrH()*2/3 then
			if JB:CanBeGuard() then
				cB = Color(200,145,23,255);
				selection = 6;
				sel = 6
			end
		elseif yMouse > ScrH()*2/3 then
			cC = Color(200,145,23,255);
			selection = 7;
			sel = 7
		end	
		
		surface.SetDrawColor(Color(0,0,0))
		surface.DrawRect(x+1725,y+230,550,100);
		draw.SimpleText("Prisoners", "JailbreakMenuThingMainButton",x+2000,y+223,cA,1,0);
		
		surface.DrawRect(x+1725,y+340,550,100);
		draw.SimpleText("Guards", "JailbreakMenuThingMainButton",x+2000,y+333,cB,1,0);
		
		surface.DrawRect(x+1725,y+450,550,100);
		draw.SimpleText("Spectators", "JailbreakMenuThingMainButton",x+2000,y+443,cC,1,0);
		
		if not JB:CanBeGuard() then
		surface.SetDrawColor(Color(255,255,255,255));
		surface.SetTexture(full)
		surface.DrawTexturedRectRotated(x+2000,y+398,230,230,8)
		end
		--####################
		--##   CHARACTER    ##
		--####################

		for i=0,18 do
			local s = tostring(2.30-(i*0.10));
			
			while string.len(s) < 4 do
				if string.len(s) == 1 then
					s = s..".00";
					break
				else
					s = s.."0";
				end
			end
			draw.SimpleText(s.." m", "TargetID",x+100,y+82+(i*50),Color(255,255,255,255),0,0);
			surface.DrawRect(x+100,y+100+(i*50),760,3);
		end
		
		local t;
		if selectedTeam == "guard" then
			t = JB.Characters.Guard[prisoner];
			if preview and preview:IsValid() then
				preview.Prisoner = false;
			end
		else
			t = JB.Characters.Prisoner[prisoner];
			if preview and preview:IsValid() then
				preview.Prisoner = true;
			end
		end	
		if JB.MainMenuCharacterScreen then
			if xMouse < ((ScrW()/2)+200) and yMouse < ScrH()/3 then
				draw.SimpleText("< Previous", "HUDNumber5",x+435,y+252,Color(0,0,255,255),0,0);
				selection = 1;
			else
				draw.SimpleText("< Previous", "HUDNumber5",x+435,y+252,Color(0,0,0,255),0,0);
			end
			
			if xMouse > ((ScrW()/2)+200) and yMouse < ScrH()/3 then
				draw.SimpleText("Next >", "HUDNumber5",x+845,y+252,Color(0,0,255,255),2,0);
				selection = 2;
			else
				draw.SimpleText("Next >", "HUDNumber5",x+845,y+252,Color(0,0,0,255),2,0);
			end
		end
		
		surface.SetDrawColor(Color(0,0,0,255))
		surface.DrawRect(x+435,y+490,410,305);
		surface.DrawRect(x+435,y+445,410,40);
		draw.DrawText(t.name.." \""..t.nick.."\" "..t.surname, "JailBreakTitleFontSmallest",x+445,y+446,Color(255,255,255),0,0);
		surface.SetDrawColor(Color(0,0,0,255))
		draw.DrawText(JB.util.FormatLine(t.background,"TargetID",390), "TargetID",x+445,y+495,Color(255,255,255),0,0);
		
		if JB.MainMenuCharacterScreen then
			if yMouse > ScrH()/3 and yMouse < (ScrH() * 2/3+200) then
				lenOne = Lerp(0.20,lenOne,406);
				selection = 3;
			else
				lenOne = Lerp(0.20,lenOne,36);
			end
			if yMouse > (ScrH()*2/3)+200 then
				lenTwo = Lerp(0.20,lenTwo,406);
				selection = 4;
			else
				lenTwo = Lerp(0.20,lenTwo,36);
			end
		end
		surface.SetDrawColor(Color(0,0,0,255))
		surface.DrawRect(x+435,y+806,410,40);
		surface.DrawRect(x+435,y+856,410,40);
		
		surface.SetDrawColor(Color(200,145,23,255));
		
		surface.DrawRect(x+437,y+808,lenOne,36);
		surface.DrawRect(x+437,y+858,lenTwo,36);
		
		draw.DrawText(">", "HUDNumber3",x+441,y+803,Color(0,0,0,255),0,0);
		draw.DrawText("SELECT CHARACTER", "HUDNumber3",x+480,y+805,Color(255,255,255,255),0,0);
				
		draw.DrawText(">", "HUDNumber3",x+441,y+853,Color(0,0,0,255),0,0);
		draw.DrawText("BACK TO MAIN", "HUDNumber3",x+480,y+855,Color(255,255,255,255),0,0);
				
		surface.SetDrawColor(Color(0,0,0,255));
		if preview and preview:IsValid() then
			preview.TargetModel = t.model;
		end
		surface.SetDrawColor(Color(0,0,0,255))
		surface.DrawRect(x+435,y+315,120,120);
		surface.DrawRect(x+580,y+315,120,120);
		surface.DrawRect(x+725,y+315,120,120);
		
		surface.SetDrawColor(Color(255,255,255,255));
		surface.SetTexture(t.img1);
		surface.DrawTexturedRect(x+437,y+317,116,116);
		surface.SetTexture(t.img2);
		surface.DrawTexturedRect(x+582,y+317,116,116);
		surface.SetTexture(t.img3);
		surface.DrawTexturedRect(x+727,y+317,116,116);

	cam.End3D2D();
	render.TurnOnToneMapping();
end);

local nextPress = CurTime();
hook.Add( "GUIMouseReleased", "JB1232412fKeyPressedHook", function(mc)
	if mc~=MOUSE_LEFT or (not selection) or nextPress > CurTime() or (not JB.MainMenuEnabled) then return end
	nextPress = CurTime()+0.2;
	
	if selection == 1 then
		prisoner = prisoner-1;
		if prisoner < 1 then
			prisoner = #JB.Characters.Prisoner;	
		end
	elseif selection == 2 then
		prisoner = prisoner+1;
		if prisoner > #JB.Characters.Prisoner then
			prisoner = 1;
		end
	elseif selection == 4 then
		RunConsoleCommand("jb_menu_backtomain")		
		JB.MainMenuCharacterScreen = false;
		JB:ResetSkipMenuMoves()
	elseif selection == 3 then
		RunConsoleCommand("jb_menu_selectcharacter",selectedTeam,prisoner);
	elseif selection == 5 then
		JB.MainMenuCharacterScreen = true;
		RunConsoleCommand("jb_menu_gocharacterpos");
		JB:ResetSkipMenuMoves()
		selectedTeam = "prisoner"
	elseif selection == 6 then
		RunConsoleCommand("jb_menu_selectcharacter","guard");
	elseif selection == 7 then
		RunConsoleCommand("jb_spectate")
		JB.MainMenuEnabled = true
	end
end);

usermessage.Hook("JOMM", function()
	JB.MainMenuEnabled = true;
	gui.EnableScreenClicker(false);
end);

-- enabled by default.
JB.MainMenuEnabled = true;
gui.EnableScreenClicker(true);

usermessage.Hook("JCMM", function()
	JB.MainMenuEnabled = false;
	gui.EnableScreenClicker(false);
end);



Its that part of the cl_spawnmenu that I think has the issue. But I’m not sure which. If you can see the code for mouse in there please tell me and I will narrow down the code.

…Anyone.

It’s funny how you expect someone to fix this for you when it’s not even your code.

Hire someone to convert it here.

I can see you didn’t read the sticky either.

I wasnt expecting someone to fix it. I was expecting someone to know what was wrong with the yMouse and stuff and tell me along the lines what I had to do. I asked the question if there was something wrong with the mouse settings in it. I never asked for it to be fixed. Maybe you should read the message.

Well that’s why I’m asking. So I can learn. If you aren’t gonna help please stop wasting my time.

I guess nobody knows :frowning: