diff --git a/exec/showavatar.js b/exec/showavatar.js index 6d2ccf7d14a617a103d0583b98c79df0171543df..3ae3a96d5ee18b7069d20e3222a13addda4365c8 100644 --- a/exec/showavatar.js +++ b/exec/showavatar.js @@ -28,10 +28,12 @@ for(var i in argv) { } } -var Avatar = load({}, 'avatar_lib.js'); +if(!bbs.mods.avatar_lib) + bbs.mods.avatar_lib = load({}, 'avatar_lib.js'); + if(draw) { - Avatar.draw(usernum, /* name: */null, /* netaddr: */null, above, right, top); + bbs.mods.avatar_lib.draw(usernum, /* name: */null, /* netaddr: */null, above, right, top); console.attributes = 7; // Clear the background attribute as the next line might scroll, filling with BG attribute } else { - Avatar.show(usernum); + bbs.mods.avatar_lib.show(usernum); } diff --git a/exec/showfileavatar.js b/exec/showfileavatar.js index 2a9949bd830df2b8e9b276042ae171bc3d4ff68a..d1d3ac11993a6279a3eb6c9101763d2d92b4826b 100644 --- a/exec/showfileavatar.js +++ b/exec/showfileavatar.js @@ -5,7 +5,8 @@ require("userdefs.js", 'USER_ANSI'); // Avatar support here: if(!(bbs.file_attr&FM_ANON) && console.term_supports(USER_ANSI)) { - var Avatar = load({}, 'avatar_lib.js'); - Avatar.draw(null, bbs.file_uploader, null, /* above: */true, /* right-justified: */true); + if(!bbs.mods.avatar_lib) + bbs.mods.avatar_lib = load({}, 'avatar_lib.js'); + bbs.mods.avatar_lib.draw(null, bbs.file_uploader, null, /* above: */true, /* right-justified: */true); console.attributes = 7; // Clear the background attribute as the next line might scroll, filling with BG attribute } \ No newline at end of file diff --git a/exec/showmsgavatar.js b/exec/showmsgavatar.js index 1ca7ee1b95d60b86e6aa40b1d25602a591b14332..f4db7b96ab50c49927283b2dab4e1a65f42e9f17 100644 --- a/exec/showmsgavatar.js +++ b/exec/showmsgavatar.js @@ -28,14 +28,15 @@ function draw_default_avatar(sub) if(!avatar) avatar = options.msg_default; if(avatar) - Avatar.draw_bin(avatar, /* above: */true, /* right-justified: */true, bbs.msghdr_top_of_screen); + bbs.mods.avatar_lib.draw_bin(avatar, /* above: */true, /* right-justified: */true, bbs.msghdr_top_of_screen); } // Avatar support here: if(!(bbs.msg_attr&MSG_ANONYMOUS) && (console.term_supports()&(USER_ANSI|USER_NO_EXASCII)) == USER_ANSI) { - var Avatar = load({}, 'avatar_lib.js'); - var success = Avatar.draw(bbs.msg_from_ext, bbs.msg_from, bbs.msg_from_net, /* above: */true, /* right-justified: */true + if(!bbs.mods.avatar_lib) + bbs.mods.avatar_lib = load({}, 'avatar_lib.js'); + var success = bbs.mods.avatar_lib.draw(bbs.msg_from_ext, bbs.msg_from, bbs.msg_from_net, /* above: */true, /* right-justified: */true ,bbs.msghdr_top_of_screen); if(!success && bbs.smb_sub_code) { draw_default_avatar(bbs.smb_sub_code);