From 415ec81e72bbf85cc81a6d2ce0f8c19335c844ec Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 20 Feb 2023 15:29:00 +0000 Subject: make window resizeable, remove big mode --- client/main.lua | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'client/main.lua') diff --git a/client/main.lua b/client/main.lua index 9de4290..a6cc4b6 100644 --- a/client/main.lua +++ b/client/main.lua @@ -34,7 +34,6 @@ mousewheel: zoom in/out F1: show/hide this help F3: show/hide debug -F11: toggle "big mode" (bad) enter: toggle chat]] @@ -62,18 +61,8 @@ local show_controls = false local this_chatmsg = "" local chatmsg_text = love.graphics.newText(love.graphics.getFont()) -local big_mode = false -local orig_w,orig_h = love.graphics.getDimensions() function love.keypressed(key,scancode,isrepeat) - if key == "f11" then - big_mode = not big_mode - if big_mode then - love.window.setMode(orig_w*2,orig_h*2) - else - love.window.setMode(orig_w,orig_h) - end - end if ui_mode == "normal" then if key == "f3" then _G.debugmode = not _G.debugmode end if key == "f1" then show_controls = not show_controls end @@ -174,7 +163,6 @@ function love.update(dt) -- mouse input local msx,msy = love.mouse.getPosition() - if big_mode then msx,msy = msx/2,msy/2 end local mh = camera:screen_to_world(Pos:make(msx,msy)):to_hex():round() if map:at(mh) == 0 and love.mouse.isDown(1) then map:set_at(mh,selected_tile) @@ -251,7 +239,6 @@ end function love.draw() love.graphics.clear(1,1,1) love.graphics.origin() - if big_mode then love.graphics.scale(2) end if local_player then camera.pos = local_player.pos end @@ -274,23 +261,22 @@ function love.draw() local hm = wm:to_hex() love.graphics.origin() - if big_mode then love.graphics.scale(2) end util.print_good(tostring(selected_tile), 400,10) if _G.debugmode and local_player then - util.print_good({ + util.print_good(table.concat({ "ms "..tostring(sm), "mw "..tostring(wm), "mh "..tostring(hm).." "..tostring(hm:round()), - "-", + "", "pw "..tostring(local_player.pos), "ph "..tostring(local_player.pos:to_hex()).." "..tostring(local_player.pos:to_hex():round()), - "-", + "", "voob "..tostring(camera.zoom), - "-", + "", "fps "..tostring(love.timer.getFPS()), "ping "..tostring(peer:round_trip_time()), - },10,10) + },"\n"),10,10) end if show_controls then util.print_good(help_text,300,200) -- cgit v1.2.3