# HG changeset patch # User Silverwing # Date 2022-08-06 10:00:51 # Node ID 6a1418ea15ae159232c059e21ca0093e0c81e702 # Parent 236573553e4bca2d1087f6a38427631e4b20d288 Technical improvements diff --git a/decor.lua b/decor.lua --- a/decor.lua +++ b/decor.lua @@ -1018,34 +1018,33 @@ function decor:load() end std.mod_cmd( function(cmd) - if cmd[1] ~= '@decor_click' then - return - end - local nam = cmd[2] - local e = decor.objects[nam] - local t = e[2] - local press, x, y, btn = cmd[3], cmd[4], cmd[5], cmd[6] - local r, v - local a - if type(decor[t].click) == 'function' then - a = decor[t]:click(e, press, x, y, btn) - else - a = { } - end - table.insert(a, 1, nam) - table.insert(a, 2, press) - table.insert(a, 3, x - e.xc) - table.insert(a, 4, y - e.yc) - table.insert(a, 5, btn) + if cmd[1] == '@decor_click' then + local nam = cmd[2] + local e = decor.objects[nam] + local t = e[2] + local press, x, y, btn = cmd[3], cmd[4], cmd[5], cmd[6] + local r, v + local a + if type(decor[t].click) == 'function' then + a = decor[t]:click(e, press, x, y, btn) + else + a = { } + end + table.insert(a, 1, nam) + table.insert(a, 2, press) + table.insert(a, 3, x - e.xc) + table.insert(a, 4, y - e.yc) + table.insert(a, 5, btn) - local r, v = std.call(std.here(), 'ondecor', std.unpack(a)) - if not r and not v then - r, v = std.call(std.game, 'ondecor', std.unpack(a)) - end - if not r and not v then - return nil, false - end - return r, v + local r, v = std.call(std.here(), 'ondecor', std.unpack(a)) + if not r and not v then + r, v = std.call(std.game, 'ondecor', std.unpack(a)) + end + if not r and not v then + return nil, false + end + return r, v + end; end) std.mod_start( function(load) @@ -1068,7 +1067,7 @@ std.mod_step( end return end - if not iface:raw_mode() then -- debugger? + if not iface:raw_mode() then -- debugger decor:cache_clear() decor:process() decor:render() diff --git a/images/characters/solarscale.png b/images/characters/solarscale.png new file mode 100644 index 0000000000000000000000000000000000000000..7b5f4404dff7d9eb4e9add1506a0682fe2f1ae19 GIT binary patch literal 21942 zc$}oWhdW#EA2)uI*t=@9sGwGDE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3L9krYTTSbY~BmiJEIe}KKA%^<2GqlP8hl*U`GXawTeoeF(w2Z^ff%7D5 z=QfFr-$(+NopwIxd|=S|0APxMqiNL|7`*v4&=;hWKs)7M&Z$kJYr-V<^&$xCT--o- zZDl(v!}UC@(-{qiB`fm?_|+y#U;R%{4#+eNfBmZX2G3TC^I?P3L;wH)07*qoM6N<$ Ef`', here().nam); + dprint(from().nam, '->', here().nam); if from().themeDispose then from():themeDispose(); @@ -217,6 +233,7 @@ game.afterwalk = function() end; if here().theme ~= nil and here().theme ~= current_theme then + dprint('Switch theme', current_theme, '->', here().theme); set_theme(std.call(here(), 'theme')); end; end; @@ -346,12 +363,16 @@ end; room { nam = 'main'; + notitle = true; nosave = true; noautosave = true; noinv = true; nofading = true; disp = ''; theme = 'menu'; + onenter = function(s) + in_game = false; + end; themeInit = function(s) init_menu(false, {'start', 'load', 'about', 'settings', 'quit'}); end; @@ -364,7 +385,7 @@ room { timer:stop(); end; ondecor = function(s, name, press, x, y, btn) - if not press then + if press then if name == 'start' then walk('intro_start'); return true; @@ -391,6 +412,7 @@ room { room { nam = 'intro_start'; + notitle = true; nosave = true; noautosave = true; noinv = true; @@ -408,12 +430,14 @@ room { timer:stop(); end; ondecor = function(s, name, press, x, y, btn) - if not press then + if press then if name == 'start' then walk('above_forest'); + in_game = true; return true; elseif name == 'tutorial' then walk('tutorial_start'); + in_game = true; return true; elseif name == 'back' then walk('main'); @@ -427,6 +451,7 @@ room { room { nam = 'intro_info'; + notitle = true; nosave = true; noautosave = true; noinv = true; @@ -444,15 +469,13 @@ room { timer:stop(); end; ondecor = function(s, name, press, x, y, btn) - if not press then - if name == 'start' then - walk('intro_start'); - return true; - elseif name == 'back' then - walk('main'); - return true; - elseif name == 'settings' then - walk('intro_settings'); + if press then + if name == 'back' then + if in_game then + walk('menu'); + else + walk('main'); + end; return true; end; end; @@ -477,6 +500,7 @@ end; room { nam = 'intro_settings'; + notitle = true; nosave = true; noautosave = true; noinv = true; @@ -494,15 +518,13 @@ room { timer:stop(); end; ondecor = function(s, name, press, x, y, btn) - if not press then - if name == 'start' then - walk('intro_start'); - return true; - elseif name == 'back' then - walk('main'); - return true; - elseif name == 'about' then - walk('intro_info'); + if press then + if name == 'back' then + if in_game then + walk(from()); + else + walk('main'); + end; return true; end; end; @@ -1007,6 +1029,7 @@ function set_theme(t) -- 640x480 is the base size -- For lesser sizes -- enable downscaling -- Integer upscaling if effective resolution is no less than 640x480 + D {'settings_open'}; local width = tonumber(theme.get('scr.w')); local height = tonumber(theme.get('scr.h')); @@ -1030,7 +1053,7 @@ function set_theme(t) prefs.graphic_scale = false; end; end; - print(font_scale); + if font_scale > 200 * scale then font_scale = scale; prefs.font_scale = font_scale * 100 @@ -1081,9 +1104,9 @@ function set_theme(t) if height < 520 * scale then diretheme.set_text_area({ rect = { - ty = -110 + vpadding, + ty = -95 + vpadding, wmax = 538 - hpadding * 2, - hmax = 342 - vpadding * 2, + hmax = 322 - vpadding * 2, ay = 0 }, text = { @@ -1102,9 +1125,9 @@ function set_theme(t) else diretheme.set_text_area({ rect = { - ty = -35 + vpadding, + ty = -10 + vpadding, wmax = 538 - hpadding * 2, - hmax = 342 - vpadding * 2, + hmax = 322 - vpadding * 2, ay = 0 }, text = { @@ -1302,6 +1325,16 @@ function set_theme(t) height = interval, scaleui = 3 }, true); + D { + 'settings_open', + 'img', + get_sprite('images/main_theme/settings.png'), + x=width - 32 * scale, + y=height - 32 * scale, + frames=1, + click=true, + z=-1 + }; elseif t == 'tower' then theme.reset('snd.click'); diretheme.set_background('#181E37', 255, 'images/tower_theme/background.png', {mode=2, scale=true}); @@ -1452,6 +1485,17 @@ function set_theme(t) height = interval, scaleui = 3 }); + + D { + 'settings_open', + 'img', + get_sprite('images/tower_theme/settings.png'), + x=width - 32 * scale, + y=height - 32 * scale, + frames=1, + click=true, + z=-1 + }; elseif t == 'terminal' then theme.set('snd.click', ''); diretheme.set_background('#181E37', 255, 'images/tower_theme/background.png', {mode=2}); @@ -1602,9 +1646,9 @@ function set_theme(t) end; function start(load) + dprint('start', load); local w, h = diretheme.get_screen(); local name = theme.name(); - if here() ~= _'theme_warning' and here() ~= _'resolution_warning' then if name ~= '.' then walkin('theme_warning'); @@ -1678,7 +1722,8 @@ function start(load) end; end; -function init() +function init() + print('init'); if not prefs.graphic_scale then prefs.graphic_scale = false; end; diff --git a/terminal.lua b/terminal.lua --- a/terminal.lua +++ b/terminal.lua @@ -152,14 +152,14 @@ local release_handled_keys = Set { 'left shift' } -function keys:filter(press, key) +--[[function keys:filter(press, key) if handled_keys[key] then return press; -- ловим все нажатия end; if release_handled_keys[key] then return true; end; -end +end]] local mapping_decor_key = { btn_backquote = '`'; @@ -315,6 +315,15 @@ room { mx = false; my = false; + keysfilter = function(s, press, key) + if handled_keys[key] then + return press; -- ловим все нажатия + end; + if release_handled_keys[key] then + return true; + end; + end; + query_formatter = function(s, path, entry) if s.status == 'command' then return s.path .. '>' .. s.entry .. '_'; diff --git a/theme.ini b/theme.ini --- a/theme.ini +++ b/theme.ini @@ -58,3 +58,4 @@ menu.button.y = 573 scr.gfx.cursor.normal = images/cursor.png scr.gfx.cursor.use = images/cursor_active.png scr.gfx.icon = icon.ico + diff --git a/utils.lua b/utils.lua --- a/utils.lua +++ b/utils.lua @@ -1,3 +1,17 @@ +declare { + keysfilter = false; +} + +function keys:filter(press, key) + local rval; + if here().keysfilter then + rval = here():keysfilter(press, key); + end; + if keysfilter then + return keysfilter(press, key); + end; +end + --[[ Walk from links ]] @@ -70,7 +84,7 @@ end local __ds = false; -std.mod_step(function(state) +--[[std.mod_step(function(state) if (player_moved()) and std.cmd[1] ~= 'load' then if here().nofading then __ds = true; @@ -85,7 +99,7 @@ std.mod_cmd(function(cmd) sprite.direct(false); return std.nop(); end; -end, -1); +end, -1);]] function has_object (tab, val) @@ -173,4 +187,4 @@ function robj(t) table.insert(t.way, pathout {'Назад'}); end; return room(t); -end; \ No newline at end of file +end;