Skip to content

Commit

Permalink
Merge branch 'development' into MUSHclient
Browse files Browse the repository at this point in the history
  • Loading branch information
fiendish committed Mar 24, 2018
2 parents 711ce62 + 18f1113 commit d7f1f40
Show file tree
Hide file tree
Showing 37 changed files with 3,446 additions and 2,434 deletions.
10 changes: 10 additions & 0 deletions MUSHclient/AardwolfPackageChanges.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
Aardwolf Client Package Major Changes List

r1975 snapshot
- new feature: The communication log miniwindow now supports multiple tabs.
- new feature: Prepackaged miniwindow plugins now support switchable color themes. Type 'aard theme change' to switch when the Theme Controller plugin is installed. Look for themes inside lua/mw_themes.
- new feature for developers: There are new reusable modules for scrolling text boxes (text_rect.lua) and vertical scrollbars (scrollbar.lua) in miniwindows.
- new feature for developers: Async socket requests can now send a request body.
- misc change: The soundpack has a few more sounds.
- bug fix: The soundpack directory structure has been adjusted.
- bug fix: Using the no-visuals installer and then using the with-visuals installer should no longer leave the mapper miniwindow hidden.
- bug fix: I guess the commas toggle in the stats miniwindow gold display wasn't working?

r1965 snapshot
- bug fix: Deleted an errant exit in the Underdark default map.

Expand Down
Binary file modified MUSHclient/MUSHclient.exe
Binary file not shown.
47 changes: 25 additions & 22 deletions MUSHclient/lua/aard_requirements.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,30 @@ require "checkplugin"
SetOption("omit_date_from_save_files", 1) -- slightly less clutter in settings files
SetAlphaOption("terminal_identification", "MUSHclient-Aard") -- helps Lasher count for the 'clients' in-game command

-- Edit the preferences db to stop opening the activity window at startup
local aard_req_prefs_db = sqlite3.open(GetInfo(82))
local aard_req_pref_activity_window = 1
for a in aard_req_prefs_db:nrows('SELECT value FROM prefs WHERE name = "OpenActivityWindow"') do
aard_req_pref_activity_window = a['value']
end
if tonumber(aard_req_pref_activity_window) ~= 0 then
aard_req_prefs_db:exec 'UPDATE prefs SET value = 0 WHERE name = "OpenActivityWindow"'
aard_req_prefs_db:close()
utils.reload_global_prefs()
end
if aard_req_prefs_db:isopen() then
aard_req_prefs_db:close()
end
if not GetVariable("just_reloading") then
-- Edit the preferences db to stop opening the activity window at startup
local aard_req_prefs_db = sqlite3.open(GetInfo(82))
local aard_req_pref_activity_window = 1
for a in aard_req_prefs_db:nrows('SELECT value FROM prefs WHERE name = "OpenActivityWindow"') do
aard_req_pref_activity_window = a['value']
end
if tonumber(aard_req_pref_activity_window) ~= 0 then
aard_req_prefs_db:exec 'UPDATE prefs SET value = 0 WHERE name = "OpenActivityWindow"'
aard_req_prefs_db:close()
utils.reload_global_prefs()
end
if aard_req_prefs_db:isopen() then
aard_req_prefs_db:close()
end

-- Load plugins which are either necessary for the package to function or unobjectionably utile.
do_plugin_check_now("162bba4a5ecef2bb32b5652f", "aard_package_update_checker") -- package update checker
do_plugin_check_now("abc1a0944ae4af7586ce88dc", "aard_repaint_buffer") -- repaint buffer
do_plugin_check_now("3e7dedbe37e44942dd46d264", "aard_GMCP_handler") -- GMCP handler
do_plugin_check_now("462b665ecb569efbf261422f", "aard_miniwindow_z_order_monitor") -- z order manager
do_plugin_check_now("55616ea13339bc68e963e1f8", "aard_chat_echo") -- gmcp channels in main display
do_plugin_check_now("520bc4f29806f7af0017985f", "Hyperlink_URL2") -- make hyperlinks from urls
do_plugin_check_now("04d9e64f835452b045b427a7", "aard_Copy_Colour_Codes") -- Ctrl+D to copy selected text with color codes
-- Load plugins which are either necessary for the package to function or unobjectionably utile.
do_plugin_check_now("162bba4a5ecef2bb32b5652f", "aard_package_update_checker") -- package update checker
do_plugin_check_now("abc1a0944ae4af7586ce88dc", "aard_repaint_buffer") -- repaint buffer
do_plugin_check_now("3e7dedbe37e44942dd46d264", "aard_GMCP_handler") -- GMCP handler
do_plugin_check_now("462b665ecb569efbf261422f", "aard_miniwindow_z_order_monitor") -- z order manager
do_plugin_check_now("55616ea13339bc68e963e1f8", "aard_chat_echo") -- gmcp channels in main display
do_plugin_check_now("520bc4f29806f7af0017985f", "Hyperlink_URL2") -- make hyperlinks from urls
do_plugin_check_now("04d9e64f835452b045b427a7", "aard_Copy_Colour_Codes") -- Ctrl+D to copy selected text with color codes
end

DeleteVariable("just_reloading")
139 changes: 42 additions & 97 deletions MUSHclient/lua/aardmapper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module (..., package.seeall)

VERSION = 2.5 -- for querying by plugins

require "mw_theme_base"
require "movewindow"
require "copytable"
require "gauge"
Expand Down Expand Up @@ -543,8 +544,8 @@ local function draw_room (uid, path, x, y)
local left, top, right, bottom = x - HALF_ROOM, y - HALF_ROOM, x + HALF_ROOM, y + HALF_ROOM

-- forget it if off screen
if x < HALF_ROOM or y < HALF_ROOM or
x > config.WINDOW.width - HALF_ROOM or y > config.WINDOW.height - HALF_ROOM then
if (x < HALF_ROOM) or (y < (title_bottom or font_height)+HALF_ROOM) or
(x > config.WINDOW.width - HALF_ROOM) or (y > config.WINDOW.height - HALF_ROOM) then
return
end -- if

Expand Down Expand Up @@ -806,7 +807,7 @@ function draw (uid)
config.WINDOW.height,
windowinfo.window_mode, -- top right
windowinfo.window_flags,
BACKGROUND_COLOUR.colour)
theme.PRIMARY_BODY)

-- Handle background texture.
if room.textimage ~= nil and config.USE_TEXTURES.enabled == true then
Expand All @@ -825,9 +826,6 @@ function draw (uid)
end
end

-- let them move it around
movewindow.add_drag_handler (win, 0, 0, 0, font_height)

-- for zooming
WindowAddHotspot(win,
"zzz_zoom",
Expand Down Expand Up @@ -877,38 +875,27 @@ function draw (uid)
room_name = room_name .. "..."
end -- if

-- room name
DrawBorder(win)

draw_text_box (win, FONT_ID,
(config.WINDOW.width - WindowTextWidth (win, FONT_ID, room_name)) / 2, -- left
2, -- top
room_name, false, -- what to draw, utf8
ROOM_NAME_TEXT.colour, -- text colour
ROOM_NAME_FILL.colour, -- fill colour
ROOM_NAME_BORDER.colour) -- border colour
-- room name
title_bottom = DrawTitleBar(win, FONT_ID, room_name)

if config.SHOW_ROOM_ID then
draw_text_box (win, FONT_ID,
DrawTextBox(win, FONT_ID,
(config.WINDOW.width - WindowTextWidth (win, FONT_ID, "ID: "..uid)) / 2, -- left
2+font_height+1, -- top
"ID: "..uid, false, -- what to draw, utf8
ROOM_NAME_TEXT.colour, -- text colour
ROOM_NAME_FILL.colour, -- fill colour
ROOM_NAME_BORDER.colour) -- border colour
title_bottom-1, -- top
"ID: "..uid, false, false)
end

-- area name

local areaname = room.area

if areaname then
draw_text_box (win, FONT_ID,
DrawTextBox(win, FONT_ID,
(config.WINDOW.width - WindowTextWidth (win, FONT_ID, areaname)) / 2, -- left
config.WINDOW.height - 3 - font_height, -- top
areaname:gsub("^%l", string.upper), false,
AREA_NAME_TEXT.colour, -- text colour
AREA_NAME_FILL.colour, -- fill colour
AREA_NAME_BORDER.colour) -- border colour
areaname:gsub("^%l", string.upper), false, false)
end -- if area known

-- configure?
Expand All @@ -918,51 +905,43 @@ function draw (uid)
else
WindowShow(config_win, false)
local x = 2
local y = 2
local text_width = draw_text_box (win, FONT_ID,
x+3, -- left
y, -- top
"*", false, -- what to draw, utf8
AREA_NAME_TEXT.colour, -- text colour
AREA_NAME_FILL.colour, -- fill colour
AREA_NAME_BORDER.colour) -- border colour

WindowAddHotspot(win, "<configure>",
x, y, x+text_width+6, y + font_height, -- rectangle
local y = math.max(2, (title_bottom-font_height)/2)
local text_width = DrawTextBox(win, FONT_ID,
x, -- left
y-2, -- top
"*", false, false)

WindowAddHotspot(win, "<configure>",
x-2, y-4, x+text_width, y + font_height, -- rectangle
"", -- mouseover
"", -- cancelmouseover
"", -- mousedown
"", -- cancelmousedown
"mapper.mouseup_configure", -- mouseup
"Click to configure map",
miniwin.cursor_hand, 0) -- hand cursor
miniwin.cursor_plus, 0)
end -- if

if type (show_help) == "function" then
local x = config.WINDOW.width - WindowTextWidth (win, FONT_ID, "?") - 5
local y = 2
local text_width = draw_text_box (win, FONT_ID,
x, -- left
y, -- top
"?", false, -- what to draw, utf8
AREA_NAME_TEXT.colour, -- text colour
AREA_NAME_FILL.colour, -- fill colour
AREA_NAME_BORDER.colour) -- border colour
local x = config.WINDOW.width - WindowTextWidth (win, FONT_ID, "?") - 6
local y = math.max(2, (title_bottom-font_height)/2)
local text_width = DrawTextBox(win, FONT_ID,
x-1, -- left
y-2, -- top
"?", false, false)

WindowAddHotspot(win, "<help>",
x-3, y, x+text_width+3, y + font_height, -- rectangle
x-3, y-4, x+text_width+3, y + font_height, -- rectangle
"", -- mouseover
"", -- cancelmouseover
"", -- mousedown
"", -- cancelmousedown
"mapper.show_help", -- mouseup
"Click for help",
miniwin.cursor_hand, 0) -- hand cursor
miniwin.cursor_help, 0)
end -- if

draw_edge()

add_resize_tag()
AddResizeTag(win, 1, nil, nil, "mapper.resize_mouse_down", "mapper.resize_move_callback", "mapper.resize_release_callback")

-- make sure window visible
WindowShow (win, not window_hidden)
Expand All @@ -986,6 +965,10 @@ function draw (uid)
total_times_drawn,
total_time_taken / total_times_drawn))
end -- if

-- let them move it around
movewindow.add_drag_handler (win, 0, 0, 0, title_bottom)

BroadcastPlugin (999, "repaint")
end -- draw

Expand Down Expand Up @@ -1050,7 +1033,7 @@ function init (t)
config.WINDOW.height,
windowinfo.window_mode, -- top right
windowinfo.window_flags,
BACKGROUND_COLOUR.colour)
theme.PRIMARY_BODY)

CallPlugin("462b665ecb569efbf261422f", "registerMiniwindow", win) -- fail silently

Expand All @@ -1062,12 +1045,12 @@ function init (t)
for _, v in ipairs (credits) do
local width = WindowTextWidth (win, FONT_ID, v)
local left = (config.WINDOW.width - width) / 2
WindowText (win, FONT_ID, v, left, top, 0, 0, ROOM_COLOUR.colour)
WindowText (win, FONT_ID, v, left, top, 0, 0, theme.BODY_TEXT)
top = top + font_height
end -- for

draw_edge()
add_resize_tag()
DrawBorder(win)
AddResizeTag(win, 1, nil, nil, "mapper.resize_mouse_down", "mapper.resize_move_callback", "mapper.resize_release_callback")

WindowShow (win, not window_hidden)
WindowShow (config_win, false)
Expand Down Expand Up @@ -1672,9 +1655,7 @@ function zoom_map (flags, hotspot_id)
end -- zoom_map

function resize_mouse_down(flags, hotspot_id)
if (hotspot_id == "resize") then
startx, starty = WindowInfo (win, 17), WindowInfo (win, 18)
end
startx, starty = WindowInfo (win, 17), WindowInfo (win, 18)
end

function resize_release_callback()
Expand Down Expand Up @@ -1710,44 +1691,8 @@ function resize_move_callback()
end

WindowResize(win, width, height, BACKGROUND_COLOUR.colour)
draw_edge()
add_resize_tag()

WindowShow(win,true)
end

DrawBorder(win)
AddResizeTag(win, 1, nil, nil, "mapper.resize_mouse_down", "mapper.resize_move_callback", "mapper.resize_release_callback")

function add_resize_tag()
-- draw the resize widget bottom right corner.
local width = WindowInfo(win, 3)
local height = WindowInfo(win, 4)

WindowLine(win, width-4, height-2, width-2, height-4, 0xffffff, 0, 2)
WindowLine(win, width-5, height-2, width-2, height-5, 0x696969, 0, 1)
WindowLine(win, width-7, height-2, width-2, height-7, 0xffffff, 0, 2)
WindowLine(win, width-8, height-2, width-2, height-8, 0x696969, 0, 1)
WindowLine(win, width-10, height-2, width-2, height-10, 0xffffff, 0, 2)
WindowLine(win, width-11, height-2, width-2, height-11, 0x696969, 0, 1)
WindowLine(win, width-13, height-2, width-2, height-13, 0xffffff, 0, 2)
WindowLine(win, width-14, height-2, width-2, height-14, 0x696969, 0, 1)

-- Hotspot for resizer.
local x = width - 14
local y = height - 14
if (WindowHotspotInfo(win, "resize", 1) == nil) then
WindowAddHotspot(win, "resize",
x, y, 0, 0, -- rectangle
"", "", "mapper.resize_mouse_down", "", "",
"Drag to resize",
6, 0) -- hand cursor
WindowDragHandler(win, "resize", "mapper.resize_move_callback", "mapper.resize_release_callback", 0)
else
WindowMoveHotspot(win, "resize", x, y, 0, 0)
end
end -- draw resize tag.

function draw_edge()
-- draw edge frame.
check (WindowRectOp (win, 1, 0, 0, 0, 0, 0xE8E8E8, 15))
check (WindowRectOp (win, 1, 1, 1, -1, -1, 0x777777, 15))
WindowShow(win, true)
end
2 changes: 1 addition & 1 deletion MUSHclient/lua/async.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ function __checkCompletionFor(thread_id)

callback_func(retval, page, status, headers, full_status, request_data['url'], request_data['body'])
end
end
end

0 comments on commit d7f1f40

Please sign in to comment.