diff options
author | cheapie <no-email-for-you@example.com> | 2022-01-01 22:37:29 -0600 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2022-01-01 22:37:29 -0600 |
commit | f6f8e8aac5cadb16199aad2489c8bc37be03a8ca (patch) | |
tree | 37f563991275e1c11aff72879ad1d69ae6c0475b | |
parent | 31d6b050873091b4958fb9aeb3081e0cc7bb8848 (diff) | |
download | mesecons-f6f8e8aac5cadb16199aad2489c8bc37be03a8ca.tar mesecons-f6f8e8aac5cadb16199aad2489c8bc37be03a8ca.tar.gz mesecons-f6f8e8aac5cadb16199aad2489c8bc37be03a8ca.tar.bz2 mesecons-f6f8e8aac5cadb16199aad2489c8bc37be03a8ca.tar.xz mesecons-f6f8e8aac5cadb16199aad2489c8bc37be03a8ca.zip |
Detect dreambuilder and use its theme settings for the Luacontroller
-rw-r--r-- | mesecons/mod.conf | 1 | ||||
-rw-r--r-- | mesecons_luacontroller/init.lua | 26 |
2 files changed, 20 insertions, 7 deletions
diff --git a/mesecons/mod.conf b/mesecons/mod.conf index 61b628e..9bf18d5 100644 --- a/mesecons/mod.conf +++ b/mesecons/mod.conf @@ -1,2 +1,3 @@ name = mesecons depends = default +optional_depends = dreambuilder_theme_settings diff --git a/mesecons_luacontroller/init.lua b/mesecons_luacontroller/init.lua index 121e7b9..0d9753f 100644 --- a/mesecons_luacontroller/init.lua +++ b/mesecons_luacontroller/init.lua @@ -722,14 +722,26 @@ local function reset_formspec(meta, code, errmsg) meta:mark_as_private("code") code = minetest.formspec_escape(code or "") errmsg = minetest.formspec_escape(tostring(errmsg or "")) - meta:set_string("formspec", "size[12,10]" - .."style_type[label,textarea;font=mono]" - .."background[-0.2,-0.25;12.4,10.75;jeija_luac_background.png]" - .."label[0.1,8.3;"..errmsg.."]" - .."textarea[0.2,0.2;12.2,9.5;code;;"..code.."]" - .."image_button[4.75,8.75;2.5,1;jeija_luac_runbutton.png;program;]" - .."image_button_exit[11.72,-0.25;0.425,0.4;jeija_close_window.png;exit;]" + if minetest.get_modpath("dreambuilder_theme_settings") then + meta:set_string("formspec", "size[12,10]" + .."style_type[label,textarea;font=mono]" + .."style_type[textarea;textcolor="..dreambuilder_theme.editor_text_color..";border=false]" + .."background[-0.2,-0.25;12.4,10.75;"..dreambuilder_theme.name.."_jeija_luac_background.png]" + .."label[0.1,8.3;"..errmsg.."]" + .."textarea[0.2,0.2;12.2,9.5;code;;"..code.."]" + .."image_button[4.75,8.75;2.5,1;"..dreambuilder_theme.name.."_jeija_luac_runbutton.png;program;]" + .."image_button_exit[11.72,-0.25;0.425,0.4;"..dreambuilder_theme.name.."_jeija_close_window.png;exit;]" ) + else + meta:set_string("formspec", "size[12,10]" + .."style_type[label,textarea;font=mono]" + .."background[-0.2,-0.25;12.4,10.75;jeija_luac_background.png]" + .."label[0.1,8.3;"..errmsg.."]" + .."textarea[0.2,0.2;12.2,9.5;code;;"..code.."]" + .."image_button[4.75,8.75;2.5,1;jeija_luac_runbutton.png;program;]" + .."image_button_exit[11.72,-0.25;0.425,0.4;jeija_close_window.png;exit;]" + ) + end end local function reset_meta(pos, code, errmsg) |