diff options
author | ubq323 <ubq323@ubq323.website> | 2023-02-20 15:29:00 +0000 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2023-02-20 15:29:00 +0000 |
commit | 415ec81e72bbf85cc81a6d2ce0f8c19335c844ec (patch) | |
tree | 95f2841026fda04431748440727321e438f52f00 /client/main.lua | |
parent | a3af144dec34adf9e8ac047dd368bb102de40821 (diff) |
make window resizeable, remove big mode
Diffstat (limited to 'client/main.lua')
-rw-r--r-- | client/main.lua | 24 |
1 files changed, 5 insertions, 19 deletions
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) |