diff --git a/atlantis_iraa.lua b/atlantis_iraa.lua --- a/atlantis_iraa.lua +++ b/atlantis_iraa.lua @@ -1313,14 +1313,10 @@ iraa_temple_button_ctr = function(nam, i nam = nam; seen_level = 1; dsc = function(s) - local im = "images/dyp_bg.png"; - for i = 1, #iraa_temple_hidden_hall.buttons[index] do - im = im .. ";images/dyp_" .. tostring(iraa_temple_hidden_hall.buttons[index][i]) .. ".png"; - end; if (iraa_temple_hidden_hall.pressed_buttons[index]) then - return "{Рычаг с символами " .. img(im) .."} включен.^"; + return "{Кнопка номер " .. tostring(index) .." включенa.}^"; else - return "{Рычаг с символами " .. img(im) .."} выключен.^"; + return "{Кнопка номер " .. tostring(index) .." выключена.}^"; end; end; act = function(s) @@ -1349,19 +1345,62 @@ iraa_temple_hidden_hall = room { {1, 3, 7, 8}; {3, 7, 9, 10, 11}; }; + buttons_coords = { + '25,188'; + '62,188'; + '99,188'; + '136,188'; + '175,188'; + '212,188'; + '249,188'; + '286,188'; + }; + buttons_click_coords = { + {10, 40, 173, 203}; + {47, 77, 173, 203}; + {84, 114, 173, 203}; + {121, 151, 173, 203}; + {160, 190, 173, 203}; + {197, 227, 173, 203}; + {234, 264, 173, 203}; + {271, 301, 173, 203}; + }; pic = function(s) - local pic = 'images/dyp_bg.png'; - local cnt = 0; - for i = 1, #s.active_parts do - if (s.active_parts[i]) then - cnt = cnt + 1; - pic = pic .. ";images/dyp_" .. tostring(i) .. ".png"; + local pic; + if s.solved then + pic = 'images/iraa_temple_unlocked_room.png'; + else + pic = 'images/iraa_temple_locked_room.png'; + end; + + for i = 1, #s.pressed_buttons do + if s.pressed_buttons[i] then + pic = pic .. ';images/iraa_temple_button_on.png@' .. s.buttons_coords[i]; + else + pic = pic .. ';images/iraa_temple_button_off.png@' .. s.buttons_coords[i]; end; end; - if (cnt > 0) then - return pic; - else - return nil; + + for i = 1, #s.active_parts do + if s.active_parts[i] then + pic = pic .. ";images/iraa_temple_lines_" .. tostring(i) .. ".png"; + end; + end; + + return pic; + end; + click = function(s, x, y) + if y >= 173 and y <= 203 then + for i = 1, #s.buttons_click_coords do + if s.buttons_click_coords[i][1] <= x and x <= s.buttons_click_coords[i][2] then + + if iraa_temple_hidden_hall:check(i) then + return [[Вы нажимаете кнопку и рисунок на полу комнаты меняется. Металлические плиты в стенах комнаты поднимаются, открывая проходы вниз и наверх. ]]; + else + return [[Вы переключаете кнопку и рисунок на полу комнаты меняется. ]]; + end; + end; + end; end; end; nam = "Храм Ираафаанотра, потайной зал";