From 74d3214f74612ca3237742f45af91d1c3851f5f4 Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Wed, 9 Jan 2013 20:32:04 -0600 Subject: [PATCH 1/5] Fix Ignore Module warning Ignore list label was destroyed when removed, giving a warning when closing the Ignore Window. --- modules/game_console/console.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 147c386e..1a75c26c 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -789,6 +789,7 @@ function onClickIgnoreButton() local selection = ignoreListPanel:getFocusedChild() if selection then ignoreListPanel:removeChild(selection) + selection:destroy() end if ignoreListPanel:getChildCount() == 0 then removeButton:disable() From b72c1d2921bb94b5314027b37442285f5a255563 Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Wed, 9 Jan 2013 20:35:05 -0600 Subject: [PATCH 2/5] Fix whitespace Forgot to replace tabs with spaces --- modules/game_console/console.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 1a75c26c..07280931 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -789,7 +789,7 @@ function onClickIgnoreButton() local selection = ignoreListPanel:getFocusedChild() if selection then ignoreListPanel:removeChild(selection) - selection:destroy() + selection:destroy() end if ignoreListPanel:getChildCount() == 0 then removeButton:disable() From 8de78736354a40d82a72c9a87b3683c941860a07 Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Wed, 9 Jan 2013 20:40:16 -0600 Subject: [PATCH 3/5] Fix spacing in NPC Trade Windows Adjusted Text offset of the NPCItemBox for the NPC Trade Window so that the text is no longer partially hidden behind the item. --- modules/game_npctrade/npctrade.otui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/game_npctrade/npctrade.otui b/modules/game_npctrade/npctrade.otui index 2529d6fc..2b1623bb 100644 --- a/modules/game_npctrade/npctrade.otui +++ b/modules/game_npctrade/npctrade.otui @@ -9,7 +9,7 @@ NPCItemBox < UICheckBox border-color: #000000 color: #aaaaaa text-align: center - text-offset: 0 20 + text-offset: 0 30 @onCheckChange: modules.game_npctrade.onItemBoxChecked(self) Item From c6ab6bc484a2fc4515346111da0cc38670c09e51 Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Wed, 9 Jan 2013 21:20:26 -0600 Subject: [PATCH 4/5] Ignore/Unignore options in right click menus Added both Ignore and Unignore options in the right click menu for the Game Window (which also added it for the Battle list), and in the right click menu for the console (chat window). --- modules/game_console/console.lua | 25 +++++++++++++++++++----- modules/game_interface/gameinterface.lua | 6 ++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 07280931..4ec82b7f 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -446,7 +446,11 @@ function processMessageMenu(mousePos, mouseButton, creatureName, text) if not g_game.getLocalPlayer():hasVip(creatureName) then menu:addOption(tr('Add to VIP list'), function () g_game.addVip(creatureName) end) end - -- TODO ignore creatureName + if isIgnored(creatureName) then + menu:addOption(tr('Unignore') .. ' ' .. creatureName, function() removeIgnoredPlayer(creatureName) end) + else + menu:addOption(tr('Ignore') .. ' ' .. creatureName, function() addIgnoredPlayer(creatureName) end) + end menu:addSeparator() end --TODO select all @@ -765,15 +769,25 @@ function saveIgnoreSettings() end function isIgnored(name) - return table.find(ignoreSettings.players, name) + return table.find(ignoreSettings.players, name) +end + +function addIgnoredPlayer(name) + if not isIgnored(name) then + table.insert(ignoreSettings.players, name) + end +end + +function removeIgnoredPlayer(name) + table.removevalue(ignoreSettings.players, name) end function isIgnoringPrivate() - return ignoreSettings.privateMessages + return ignoreSettings.privateMessages end function isIgnoringYelling() - return ignoreSettings.yelling + return ignoreSettings.yelling end function onClickIgnoreButton() @@ -821,7 +835,8 @@ function onClickIgnoreButton() saveButton.onClick = function() ignoreSettings.players = {} for i = 1, ignoreListPanel:getChildCount() do - table.insert(ignoreSettings.players, ignoreListPanel:getChildByIndex(i):getText()) + addIgnorePlayer(ignoreListPanel:getChildByIndex(i):getText()) + --table.insert(ignoreSettings.players, ignoreListPanel:getChildByIndex(i):getText()) end ignoreSettings.yelling = ignoreYellingBox:isChecked() diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index 2fe9cdb2..b9346af5 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -411,6 +411,12 @@ function createThingMenu(menuPosition, lookThing, useThing, creatureThing) if (not Player:hasVip(creatureName)) then menu:addOption(tr('Add to VIP list'), function() g_game.addVip(creatureName) end) end + + if modules.game_console.isIgnored(creatureName) then + menu:addOption(tr('Unignore') .. ' ' .. creatureName, function() modules.game_console.removeIgnoredPlayer(creatureName) end) + else + menu:addOption(tr('Ignore') .. ' ' .. creatureName, function() modules.game_console.addIgnoredPlayer(creatureName) end) + end local localPlayerShield = localPlayer:getShield() local creatureShield = creatureThing:getShield() From c43a97395aa94fb93533fbf246ae531e465049dc Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Wed, 9 Jan 2013 21:46:30 -0600 Subject: [PATCH 5/5] Fixed a Typo Function name was misspelled --- modules/game_console/console.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 4ec82b7f..8b2985cf 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -835,7 +835,7 @@ function onClickIgnoreButton() saveButton.onClick = function() ignoreSettings.players = {} for i = 1, ignoreListPanel:getChildCount() do - addIgnorePlayer(ignoreListPanel:getChildByIndex(i):getText()) + addIgnoredPlayer(ignoreListPanel:getChildByIndex(i):getText()) --table.insert(ignoreSettings.players, ignoreListPanel:getChildByIndex(i):getText()) end