diff --git a/TODO b/TODO index 560ee8aa..232457d5 100644 --- a/TODO +++ b/TODO @@ -21,6 +21,7 @@ [bart] port to MacOs and iphone == UI +[bart] fix massive hotkeys when holding down a key [bart] tab widgets [bart] add anchors API [bart] scrollbar @@ -46,6 +47,8 @@ [bart] reapply anchor styles when adding new childs [bart] ui text selection +break window anchors when moving + == Client modules [bart] modules managment interface [bart] console history, text selection, scrolling diff --git a/modules/client_options/options.lua b/modules/client_options/options.lua index 37b5d30c..7a7ecde8 100644 --- a/modules/client_options/options.lua +++ b/modules/client_options/options.lua @@ -9,7 +9,13 @@ function Options.init() showfps = true, fullscreen = false, classicControl = false, - showLevelInConsole = false} + showStatusMessagesInConsole = true, + showEventMessagesInConsole = true, + showInfoMessagesInConsole = true, + showTimestampsInConsole = true, + showLevelsInConsole = true, + showPrivateMessagesInConsole = true, + } for k,v in pairs(booleanOptions) do Settings.setDefault(k, v) diff --git a/modules/client_options/options.otui b/modules/client_options/options.otui index e1308578..f9f4d6b3 100644 --- a/modules/client_options/options.otui +++ b/modules/client_options/options.otui @@ -19,7 +19,7 @@ OptionCheckBox < CheckBox MainWindow id: optionsWindow title: Options - size: 286 160 + size: 286 280 @onEnter: Options.hide() @onEscape: Options.hide() @@ -41,8 +41,27 @@ MainWindow text: Classic control OptionCheckBox - id: showLevelInConsole - text: Show players level in console + id: showInfoMessagesInConsole + text: Show info messages in console + + OptionCheckBox + id: showEventMessagesInConsole + text: Show event messages in console + + OptionCheckBox + id: showStatusMessagesInConsole + text: Show status messages in console + + OptionCheckBox + id: showTimestampsInConsole + text: Show timestamps in console + + OptionCheckBox + id: showLevelsInConsole + text: Show levels in console + //OptionCheckBox + // id: showPrivateMessagesInConsole + // text: Show private messages in console Button text: Ok diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 8b69bb71..3f7ab859 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -5,7 +5,7 @@ local SpeakTypes = { say = { color = '#FFFF00' }, whisper = { color = '#FFFF00' }, yell = { color = '#FFFF00' }, - monsterSay = { color = '#FE6500' }, + monsterSay = { color = '#FE6500', hideInConsole = false}, npcToPlayer = { color = '#5FF7F7' }, channelYellow = { color = '#FFFF00' }, channelWhite = { color = '#FFFFFF' }, @@ -34,18 +34,22 @@ end function Console.addText(text, color) color = color or 'white' + if Options.showTimestampsInConsole then + text = os.date('%H:%M') .. ' ' .. text + end + local label = createWidget('ConsoleLabel', consoleBuffer) label:setText(text) label:setForegroundColor(color) end -- hooked events -local function onCreatureSpeak(name, level, speaktypedesc, message) +local function onCreatureSpeak(name, level, speaktypedesc, message, channelId, creaturePos) speaktype = SpeakTypes[speaktypedesc] - if speaktype == nil then return end + if speaktype == SpeakTypes.monsterSay then return end if name then - if Options.showLevelInConsole and level > 0 then + if Options.showLevelsInConsole and level > 0 then message = name .. ' [' .. level .. ']: ' .. message else message = name .. ': ' .. message diff --git a/modules/game_textmessage/textmessage.lua b/modules/game_textmessage/textmessage.lua index 259bcb72..21319c3d 100644 --- a/modules/game_textmessage/textmessage.lua +++ b/modules/game_textmessage/textmessage.lua @@ -5,12 +5,12 @@ importStyle 'textmessage.otui' -- private variables local MessageTypes = { - warning = { color = '#F55E5E', showOnConsole = true, windowLocation = 'center' }, - eventAdvance = { color = '#FFFFFF', showOnConsole = true, windowLocation = 'center' }, - eventDefault = { color = '#FFFFFF', showOnConsole = true, windowLocation = 'bottom' }, - eventOrange = { color = '#FE6500', showOnConsole = true, windowLocation = 'bottom' }, - statusDefault = { color = '#FFFFFF', showOnConsole = true, windowLocation = 'bottom' }, - infoDescription = { color = '#00EB00', showOnConsole = true, windowLocation = 'center' }, + warning = { color = '#F55E5E', showOnConsole = true, windowLocation = 'center', consoleOption = 'showInfoMessagesInConsole' }, + eventAdvance = { color = '#FFFFFF', showOnConsole = true, windowLocation = 'center', consoleOption = 'showEventMessagesInConsole' }, + eventDefault = { color = '#FFFFFF', showOnConsole = true, windowLocation = 'bottom', consoleOption = 'showEventMessagesInConsole' }, + eventOrange = { color = '#FE6500', showOnConsole = true, windowLocation = 'bottom', consoleOption = 'showEventMessagesInConsole' }, + statusDefault = { color = '#FFFFFF', showOnConsole = true, windowLocation = 'bottom', consoleOption = 'showStatusMessagesInConsole' }, + infoDescription = { color = '#00EB00', showOnConsole = true, windowLocation = 'center', consoleOption = 'showInfoMessagesInConsole' }, statusSmall = { color = '#FFFFFF', showOnConsole = false, windowLocation = 'bottom' }, consoleOrange = { color = '#FE6500', showOnConsole = true }, consoleBlue = { color = '#9F9DFD', showOnConsole = true }, @@ -27,7 +27,9 @@ local function displayMessage(msgtype, msg, time) if not Game.isOnline() then return end if msgtype.showOnConsole then - -- TODO + if msgtype.consoleOption == nil or Options[msgtype.consoleOption] then + Console.addText(msg, msgtype.color) + end end if msgtype.windowLocation then diff --git a/src/framework/math/rect.h b/src/framework/math/rect.h index abc0ace6..ac3debe7 100644 --- a/src/framework/math/rect.h +++ b/src/framework/math/rect.h @@ -257,7 +257,7 @@ public: return tmp; } - void bound(const TRect &r, bool resize = false) { + void bound(const TRect &r) { if(isNull() || r.isNull()) return;