Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
fiendish committed May 4, 2017
2 parents 5118d23 + 3cd2003 commit 892d7bc
Show file tree
Hide file tree
Showing 43 changed files with 1,536 additions and 4,877 deletions.
12 changes: 12 additions & 0 deletions MUSHclient/AardwolfPackageChanges.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
Aardwolf Client Package Major Changes List

r1910 snapshot
- bug fix: The chat echo plugin will now show all channels in main output if it doesn't detect any chat capture miniwindows.
- bug fix: The chat echo plugin will wait for a safe char.status.state before checking your compact settings.
- bug fix: A few of the new client settings that are force-enabled will only be activated once instead of every launch.
- misc change: The GMCP mapper will default to not drawing underlines on its hyperlinks because it is unsightly to have so many in a dense list.
- bug fix: Color handling functions should now be responsive to ANSI color settings changes in your client.
- bug fix: Fixes an infinite loop when resizing the mapper miniwindow to its minimum size.
- bug fix: Fixes compatibility with old versions of some 3rd party plugins that were looking for a colors-related variable I had removed.
- new feature: Adds a new demonstration plugin for translating non-English languages on your ftalk channel. (aard_translate_foreign_friends.xml)
- new feature: Adds a new universal (hopefully) text to speech/braille plugin (and DLLs) using the Tolk speech and braille abstraction API. Also adds a SAPI-only plugin for when you definitely know you don't have a screen reader intalled. (universal_text_to_speech.xml and SAPI.xml)
- misc change: Removed a bunch of crufty plugins that are just sitting around in the installer, unrelated to the project. This will not remove them from pre-existing installations.

r1900 snapshot
- bug fix: Copying selected text in the communication log was not truncating the text properly.
- bug fix: The group window was erroring on send to back, and other related functions.
Expand Down
35 changes: 24 additions & 11 deletions MUSHclient/lua/aard_requirements.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,28 @@ require "gmcphelper"
require "checkplugin"

-- Load plugins which are either necessary for the package to function or unobjectionably utile.
do_plugin_check_now ("520bc4f29806f7af0017985f", "Hyperlink_URL2") -- make hyperlinks from urls
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("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

-- World file settings
SetOption ("omit_date_from_save_files", 1) -- slightly less clutter in settings files
SetOption ("show_underline", 1) -- needed for hyperlink underlining
SetOption ("underline_hyperlinks", 1) -- oddly enough also needed for hyperlink underlining
SetOption ("utf_8", 1) -- needed for alternate ascii maptypes in main output
-- Activate various useful world file settings

-- These get activated always
SetOption("omit_date_from_save_files", 1) -- slightly less clutter in settings files
SetOption("utf_8", 1) -- needed for alternate maptypes in main output

-- These get activated at least once, but not after that
aardclient_settings_to_activate_at_least_once = {
"show_underline", -- needed for hyperlink underlining
"underline_hyperlinks" -- oddly enough also needed for hyperlink underlining
}

for i,v in ipairs(aardclient_settings_to_activate_at_least_once) do
if GetVariable("aardclient_activated_"..v) ~= "done" then
SetOption (v, 1)
SetVariable("aardclient_activated_"..v, "done")
end
end
15 changes: 7 additions & 8 deletions MUSHclient/lua/aardmapper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -864,19 +864,18 @@ function draw (uid)
local add_dots = false

-- truncate name if too long
while name_width > (config.WINDOW.width - 20 - WindowTextWidth (win, FONT_ID, "*?")) do
-- get rid of last word
local s = string.match (" " .. room_name .. "...", "(%s%S*)$")
if not s or #s == 0 then
local available_width = (config.WINDOW.width - 20 - WindowTextWidth (win, FONT_ID, "*?"))
while name_width > available_width do
room_name = room_name:sub(1, -3)
name_width = WindowTextWidth (win, FONT_ID, room_name .. "...")
add_dots = true
if room_name == "" then
break
end
room_name = room_name:sub (1, - (#s - 2)) -- except the last 3 dots but add the space
name_width = WindowTextWidth (win, FONT_ID, room_name .. " ...")
add_dots = true
end -- while

if add_dots then
room_name = room_name .. " ..."
room_name = room_name .. "..."
end -- if

-- room name
Expand Down
99 changes: 99 additions & 0 deletions MUSHclient/lua/mw_theme_base.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
--[[
This file contains code that can be inherited by other plugins that allows
many different miniwindow plugins to follow the same UI theme, as long as they
follow certain guidelines. We can use this to maintain a base set of colors
and title fonts that get used everywhere in order to unify the visual style
and provide a way to customize that style easily.
Steps for use:
1) From inside your other plugins, call: require "mw_theme_base".
2) Use variable names as spelled out below (theme.WINDOW_BACKGROUND, theme.WINDOW_BORDER, etc.).
3) Link some action in your plugin with either the choose_theme or the list_themes and load_theme functions.
4) Make your own themes (copy lua/mw_themes/default.lua to a new *.lua file and customize the colors).
--]]

theme_dir = GetInfo(66).."lua\\mw_themes\\"
theme_file = "default.lua"

function list_themes ()
t, e = utils.readdir(theme_dir.."*.lua")
for k,v in pairs(t) do
t[k] = k:gsub("%.lua", "")
end
return t
end

function choose_theme ()
t = list_themes()
load_theme(
utils.listbox ("Which theme would you like to use?", "Choose Theme", t, theme_file)
or theme_file
)
end

function load_theme (file, no_broadcast)
status, theme = pcall(dofile, theme_dir..file)

-- fallback defaults if the file is missing or any necessary values are undefined
theme = status and theme or {}
theme.HIGHLIGHT = theme.HIGHLIGHT or ColourNameToRGB("white")
theme.FACE = theme.FACE or ColourNameToRGB("#D4D0C8")
theme.FACE_GRADIENT = theme.FACE_GRADIENT or theme.FACE
theme.INNERSHADOW = theme.INNERSHADOW or ColourNameToRGB("#808080")
theme.OUTERSHADOW = theme.OUTERSHADOW or ColourNameToRGB("#404040")
theme.WINDOW_BACKGROUND = theme.WINDOW_BACKGROUND or ColourNameToRGB("#000000")
theme.WINDOW_BORDER = theme.WINDOW_BORDER or ColourNameToRGB("#E8E8E8")
theme.BACK_FACE = theme.BACK_FACE or ColourNameToRGB("#E8E8E8")
theme.DETAIL = theme.DETAIL or ColourNameToRGB("#000000")
theme.TITLE_HEIGHT = theme.TITLE_HEIGHT or 17
theme.SUBTITLE_HEIGHT = theme.SUBTITLE_HEIGHT or 17
theme.TITLE_FONT_NAME = theme.TITLE_FONT_NAME or "Dina"
theme.TITLE_FONT_SIZE = theme.TITLE_FONT_SIZE or 8

if status then
theme_file = file
SetVariable("theme_file", theme_file)
if not no_broadcast then
BroadcastPlugin(1999, "new_theme:"..theme_file)
end
end
end

function OnPluginBroadcast (msg, id, name, text)
if (msg == 1999) and (text:sub(1,10) == "new_theme:") then
load_theme(text:sub(11), true)
end
end

load_theme(GetVariable("theme_file") or theme_file, true)

-- Replacement for WindowRectOp action 5, which allows for a 3D look while maintaining color theme.
-- Requires global theme.HIGHLIGHT, theme.FACE, theme.INNERSHADOW, and theme.OUTERSHADOW colors to be set.
function DrawThemed3DRect(Window, left, top, right, bottom)
if theme.FACE ~= theme.FACE_GRADIENT then
WindowGradient(Window, left, top, right, bottom, theme.FACE, theme.FACE_GRADIENT, 2)
else
WindowRectOp(Window, 2, left, top, right, bottom, theme.FACE)
end
WindowLine(Window, left, top, right, top, theme.HIGHLIGHT, 0 + 0x0200, 1)
WindowLine(Window, left, top, left, bottom, theme.HIGHLIGHT, 0 + 0x0200, 1)
WindowLine(Window, left, bottom-2, right, bottom-2, theme.INNERSHADOW, 0 + 0x0200, 1)
WindowLine(Window, right-2, top, right-2, bottom-2, theme.INNERSHADOW, 0 + 0x0200, 1)
WindowLine(Window, left, bottom-1, right, bottom-1, theme.OUTERSHADOW, 0 + 0x0200, 1)
WindowLine(Window, right-1, top, right-1, bottom-1, theme.OUTERSHADOW, 0 + 0x0200, 1)
end

-- the thing that goes in the bottom right corner for resizing miniwindows
function DrawThemedResizeTag(Window, x1, y1, size)
local x2, y2 = x1+size, y1+size
DrawThemed3DRect(Window, x1, y1, x2, y2)
local m = 2
local n = 2
while (x1+m+2 <= x2-3 and y1+n+1 <= y2-4) do
WindowLine(Window, x1+m+1, y2-4, x2-3, y1+n, theme.HIGHLIGHT, 0, 1)
WindowLine(Window, x1+m+2, y2-4, x2-3, y1+n+1, theme.INNERSHADOW, 0, 1)
m = m+3
n = n+3
end
end

Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
--[[
-- You can copy this file to create your own themes.

return {
WINDOW_BACKGROUND = ColourNameToRGB ("#000000"), -- for miniwindow body
WINDOW_BORDER = ColourNameToRGB("#E8E8E8"), -- for miniwindow body

HIGHLIGHT=ColourNameToRGB("#FFFFFF"), -- for 3D surfaces
FACE=ColourNameToRGB("#D4D0C8"), -- for 3D surfaces
FACE_GRADIENT=ColourNameToRGB("#D4D0C8"), -- add gradient to surfaces
INNERSHADOW=ColourNameToRGB("#808080"), -- for 3D surfaces
OUTERSHADOW = ColourNameToRGB("#404040"), -- for 3D surfaces

BACK_FACE = ColourNameToRGB ("#E8E8E8"), -- for contrasting details
DETAIL = ColourNameToRGB ("#000000"), -- for contrasting details

TITLE_HEIGHT = 17, -- for miniwindow title area
SUBTITLE_HEIGHT = 17, -- for miniwindow title area
TITLE_FONT_NAME = "Dina", -- for miniwindow title area
TITLE_FONT_SIZE = 8 -- for miniwindow title area
}

-- SEE EXAMPLES IN COMMENT BELOW

--[[
-- DEFAULT THEME
theme = {
return {
WINDOW_BACKGROUND = ColourNameToRGB ("#000000"), -- for miniwindow body
WINDOW_BORDER = ColourNameToRGB("#E8E8E8"), -- for miniwindow body
HIGHLIGHT=ColourNameToRGB("#FFFFFF"), -- for 3D surfaces
FACE=ColourNameToRGB("#D4D0C8"), -- for 3D surfaces
FACE_GRADIENT=ColourNameToRGB("#D4D0C8"), -- add gradient to surfaces
INNERSHADOW=ColourNameToRGB("#808080"), -- for 3D surfaces
OUTERSHADOW = ColourNameToRGB("#404040"), -- for 3D surfaces
BACK_FACE = ColourNameToRGB ("#E8E8E8"), -- for contrasting details
DETAIL = ColourNameToRGB ("#000000"), -- for contrasting details
Expand All @@ -21,7 +43,7 @@ theme = {
}
-- HOT PINK
theme = {
return {
WINDOW_BACKGROUND = ColourNameToRGB ("#000000"), -- for miniwindow body
WINDOW_BORDER = ColourNameToRGB("#F52887"), -- for miniwindow body
Expand All @@ -30,7 +52,7 @@ theme = {
FACE_GRADIENT=ColourNameToRGB("#661166"), -- add gradient to surfaces
INNERSHADOW=ColourNameToRGB("#000000"), -- for 3D surfaces
OUTERSHADOW = ColourNameToRGB("#F52887"), -- for 3D surfaces
BACK_FACE = ColourNameToRGB ("#773355"), -- for contrasting details
DETAIL = ColourNameToRGB ("#F52887"), -- for contrasting details
Expand All @@ -41,23 +63,3 @@ theme = {
}
--]]

theme = {
WINDOW_BACKGROUND = ColourNameToRGB ("#000000"), -- for miniwindow body
WINDOW_BORDER = ColourNameToRGB("#E8E8E8"), -- for miniwindow body

HIGHLIGHT=ColourNameToRGB("#FFFFFF"), -- for 3D surfaces
FACE=ColourNameToRGB("#D4D0C8"), -- for 3D surfaces
FACE_GRADIENT=ColourNameToRGB("#D4D0C8"), -- add gradient to surfaces
INNERSHADOW=ColourNameToRGB("#808080"), -- for 3D surfaces
OUTERSHADOW = ColourNameToRGB("#404040"), -- for 3D surfaces

BACK_FACE = ColourNameToRGB ("#E8E8E8"), -- for contrasting details
DETAIL = ColourNameToRGB ("#000000"), -- for contrasting details

TITLE_HEIGHT = 17, -- for miniwindow title area
SUBTITLE_HEIGHT = 17, -- for miniwindow title area
TITLE_FONT_NAME = "Dina", -- for miniwindow title area
TITLE_FONT_SIZE = 8 -- for miniwindow title area
}


0 comments on commit 892d7bc

Please sign in to comment.