<commit_before>ui = {
	show = true,
	showcargoindex = 1,
	base = {
		items = {'Mission', 'Trade', 'Buy a ship', 'Talk', 'Visit'},
		posses = {x = 20, y = 80, dx = 140, w = 120, h = 120, r = 20},
		vector = {'arrow', 'trade', 'beginner', 'transmission', 'planet'},
		states = {'mission', 'trade', 'buyship', 'talk', 'visit'},
		rot = {0, 0, 0, 0, 0},
		usedmouse = true,
	}
}
registerstate'paused'
registerstate'base'

function ui.load()
end

local function zoomout(n)
	graphics.zoom = graphics.zoom/(1 + .01*n)
end
local function zoomin(n)
	graphics.zoom = graphics.zoom*(1 + .01*n)
end

function ui.update(dt)
	local D = love.keyboard.isDown
	if D'pageup' then
		if settings.revzoom then
			zoomout(1)
		else
			zoomin(1)
		end
	elseif D'pagedown' then
		if settings.revzoom then
			zoomin(1)
		else
			zoomout(1)
		end
	end
	local x = love.mouse.getX()
	if x > 750-20 and x < 800-20 then
		local y, z = love.mouse.getY(), graphics.zoom
		if y > 470-20 then
			if y < 570-20 then
				z = 1/1.05^((570-love.mouse.getY()-20)*1.3)
			else
				z = 1
			end
		elseif y > 450-20 then
			z = 1/1.05^130
		end
		if x > 740 and x < 790 then
			graphics.zoom = (graphics.zoom*3 + z)*.25
		else
			graphics.zoom = (graphics.zoom*19 + z)*.05
		end
	end
	if D's' then
		ui.autopilot = true
		if love.mouse.isDown'l' then
			player.autopilot = true
			player.hyperspeed = false
			player.targetx = (love.mouse.getX()-400)/graphics.zoom + graphics.viewx
			player.targety = (love.mouse.getY()-300)/-graphics.zoom + graphics.viewy
		end
	elseif D'k' then
		ui.autopilot = true
		if love.mouse.isDown'l' then
			player.autopilot = true
			player.hyperspeed = true
			player.targetx = (love.mouse.getX()-400)/graphics.zoom + graphics.viewx
			player.targety = (love.mouse.getY()-300)/-graphics.zoom + graphics.viewy
		end
	else
		ui.autopilot = false
	end
	if D'b' then
		player.braking = true
	end
	if player.landed and not ui.showlanded then
		ui.showlanded = 1
		ui._landed = player.landed<commit_msg>Autopilot handling improved<commit_after>ui = {
	show = true,
	showcargoindex = 1,
	base = {
		items = {'Mission', 'Trade', 'Buy a ship', 'Talk', 'Visit'},
		posses = {x = 20, y = 80, dx = 140, w = 120, h = 120, r = 20},
		vector = {'arrow', 'trade', 'beginner', 'transmission', 'planet'},
		states = {'mission', 'trade', 'buyship', 'talk', 'visit'},
		rot = {0, 0, 0, 0, 0},
		usedmouse = true,
	}
}
registerstate'paused'
registerstate'base'

function ui.load()
end

local function zoomout(n)
	graphics.zoom = graphics.zoom/(1 + .01*n)
end
local function zoomin(n)
	graphics.zoom = graphics.zoom*(1 + .01*n)
end

function ui.update(dt)
	local D = love.keyboard.isDown
	if D'pageup' then
		if settings.revzoom then
			zoomout(1)
		else
			zoomin(1)
		end
	elseif D'pagedown' then
		if settings.revzoom then
			zoomin(1)
		else
			zoomout(1)
		end
	end
	local x = love.mouse.getX()
	if x > 750-20 and x < 800-20 then
		local y, z = love.mouse.getY(), graphics.zoom
		if y > 470-20 then
			if y < 570-20 then
				z = 1/1.05^((570-love.mouse.getY()-20)*1.3)
			else
				z = 1
			end
		elseif y > 450-20 then
			z = 1/1.05^130
		end
		if x > 740 and x < 790 then
			graphics.zoom = (graphics.zoom*3 + z)*.25
		else
			graphics.zoom = (graphics.zoom*19 + z)*.05
		end
	end
	if D's' then
		ui.autopilot = true
		if love.mouse.isDown'l' then
			player.autopilot = true
			player.targetx = (love.mouse.getX()-400)/graphics.zoom + graphics.viewx
			player.targety = (love.mouse.getY()-300)/-graphics.zoom + graphics.viewy
			player.hyperspeed = D'lshift' or D'rshift'
		end
	else
		ui.autopilot = false
	end
	if D'b' then
		player.braking = true
	end
	if player.landed and not ui.showlanded then
		ui.showlanded = 1
		ui._landed = player.landed
{'fraction_non_alphanumeric': 0.14965072541644278, 'fraction_numerical': 0.052659860290166574, 'mean_word_length': 3.064410480349345, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3323376', 'n_tokens_mistral': 1770, 'n_tokens_neox': 1488, 'n_words': 388}