From bd61a896758845f5b09734dec881f2a0ba79246b Mon Sep 17 00:00:00 2001 From: BeniS Date: Tue, 7 Aug 2012 11:13:33 +1200 Subject: [PATCH] Some fixes with layouts, NPC trade window, and market. --- modules/client_options/options.otui | 2 +- .../skins/default/styles/checkboxes.otui | 4 +++ .../skins/default/styles/tabbars.otui | 7 +++- modules/game_console/console.otui | 6 ++-- modules/game_market/market.lua | 5 +-- .../game_market/ui/general/marketbuttons.otui | 3 +- .../ui/general/marketcombobox.otui | 33 ++----------------- .../game_market/ui/general/markettabs.otui | 20 ++--------- src/otclient/protocolgameparse.cpp | 2 +- 9 files changed, 25 insertions(+), 57 deletions(-) diff --git a/modules/client_options/options.otui b/modules/client_options/options.otui index 160a18db..ccf7b7cb 100644 --- a/modules/client_options/options.otui +++ b/modules/client_options/options.otui @@ -22,7 +22,7 @@ MainWindow @onEnter: Options.hide() @onEscape: Options.hide() - TabBar + TabBarRounded id: optionsTabBar anchors.top: parent.top anchors.left: parent.left diff --git a/modules/client_skins/skins/default/styles/checkboxes.otui b/modules/client_skins/skins/default/styles/checkboxes.otui index 509648e2..11d2241b 100644 --- a/modules/client_skins/skins/default/styles/checkboxes.otui +++ b/modules/client_skins/skins/default/styles/checkboxes.otui @@ -60,3 +60,7 @@ ButtonBox < UICheckBox $disabled: color: #666666ff image-color: #ffffff88 + +ButtonBoxRounded < ButtonBox + image-source: /images/tabbutton_rounded.png + image-border: 2 \ No newline at end of file diff --git a/modules/client_skins/skins/default/styles/tabbars.otui b/modules/client_skins/skins/default/styles/tabbars.otui index d968af98..8c59fc3f 100644 --- a/modules/client_skins/skins/default/styles/tabbars.otui +++ b/modules/client_skins/skins/default/styles/tabbars.otui @@ -3,7 +3,7 @@ TabBar < UITabBar TabBarPanel < Panel TabBarButton < UIButton size: 20 20 - image-source: /images/tabbutton_rounded.png + image-source: /images/tabbutton_square.png image-color: white image-clip: 0 0 20 20 image-border: 2 @@ -33,3 +33,8 @@ TabBarButton < UIButton $on !checked: color: #F55E5E + +TabBarRounded < TabBar +TabBarRoundedPanel < TabBarPanel +TabBarRoundedButton < TabBarButton + image-source: /images/tabbutton_rounded.png \ No newline at end of file diff --git a/modules/game_console/console.otui b/modules/game_console/console.otui index 4ab18ad7..023ad221 100644 --- a/modules/game_console/console.otui +++ b/modules/game_console/console.otui @@ -6,8 +6,8 @@ ConsoleLabel < UILabel text-wrap: true text-auto-resize: true -ConsoleTabBar < TabBar -ConsoleTabBarPanel < TabBarPanel +ConsoleTabBar < TabBarRounded +ConsoleTabBarPanel < TabBarRoundedPanel id: consoleTab ScrollablePanel @@ -32,7 +32,7 @@ ConsoleTabBarPanel < TabBarPanel step: 14 pixels-scroll: true -ConsoleTabBarButton < TabBarButton +ConsoleTabBarButton < TabBarRoundedButton Panel id: consolePanel diff --git a/modules/game_market/market.lua b/modules/game_market/market.lua index 12fdaa1a..4beb520c 100644 --- a/modules/game_market/market.lua +++ b/modules/game_market/market.lua @@ -8,6 +8,7 @@ List: * Add constraints for creating/buying offers: - Add max market offers or a new method for updating depot items + - Add timer before you can create another offer (1 minute?) - Add a check for buying offers (if you do not have enough balance) * Add offer management: @@ -394,7 +395,7 @@ local function updateBalance(balance) if balance < 0 then balance = 0 end information.balance = balance - balanceLabel:setText('Balance: '..balance..'gp') + balanceLabel:setText('Balance: '..balance..' gold') balanceLabel:resizeToText() end @@ -885,7 +886,7 @@ end function Market.refreshItemsWidget(selectItem) local selectItem = selectItem or 0 - itemsPanel = marketOffersPanel:recursiveGetChildById('itemsPanel') + itemsPanel = browsePanel:recursiveGetChildById('itemsPanel') local layout = itemsPanel:getLayout() layout:disableUpdates() diff --git a/modules/game_market/ui/general/marketbuttons.otui b/modules/game_market/ui/general/marketbuttons.otui index 8b04dbc9..042269bc 100644 --- a/modules/game_market/ui/general/marketbuttons.otui +++ b/modules/game_market/ui/general/marketbuttons.otui @@ -1,10 +1,9 @@ -MarketButtonBox < UICheckBox +MarketButtonBox < ButtonBoxRounded font: verdana-11px-rounded color: #f55e5ebb size: 106 22 text-offset: 0 2 text-align: center - image-source: /images/tabbutton_rounded.png image-clip: 0 0 20 20 image-border: 2 diff --git a/modules/game_market/ui/general/marketcombobox.otui b/modules/game_market/ui/general/marketcombobox.otui index 6dd84173..22f5a0c1 100644 --- a/modules/game_market/ui/general/marketcombobox.otui +++ b/modules/game_market/ui/general/marketcombobox.otui @@ -1,17 +1,7 @@ -MarketComboBoxPopupMenuButton < UIButton +MarketComboBoxPopupMenuButton < ComboBoxRoundedPopupMenuButton height: 18 font: verdana-11px-rounded - text-align: left text-offset: 2 2 - color: #aaaaaa - background-color: alpha - - $hover !disabled: - color: #ffffff - background-color: #ffffff44 - - $disabled: - color: #555555 MarketComboBoxPopupMenuSeparator < UIWidget image-source: /images/combobox_rounded.png @@ -20,26 +10,9 @@ MarketComboBoxPopupMenuSeparator < UIWidget height: 1 phantom: true -MarketComboBoxPopupMenu < UIPopupMenu - image-source: /images/combobox_rounded.png - image-clip: 0 60 89 20 - image-border: 1 - image-border-top: 0 - padding: 1 +MarketComboBoxPopupMenu < ComboBoxRoundedPopupMenu -MarketComboBox < UIComboBox +MarketComboBox < ComboBoxRounded font: verdana-11px-rounded - color: #aaaaaa size: 86 20 text-offset: 3 2 - text-align: left - image-source: /images/combobox_rounded.png - image-border: 1 - image-border-right: 17 - image-clip: 0 0 89 20 - - $hover !disabled: - image-clip: 0 20 89 20 - - $on: - image-clip: 0 40 89 20 diff --git a/modules/game_market/ui/general/markettabs.otui b/modules/game_market/ui/general/markettabs.otui index 56f112a7..ffa5ab76 100644 --- a/modules/game_market/ui/general/markettabs.otui +++ b/modules/game_market/ui/general/markettabs.otui @@ -1,23 +1,9 @@ -MarketTabBar < UITabBar - size: 80 20 -MarketTabBarPanel < Panel -MarketTabBarButton < UIButton +MarketTabBar < TabBar +MarketTabBarPanel < TabBarPanel +MarketTabBarButton < TabBarButton size: 20 25 - image-source: /images/tabbutton_square.png font: verdana-11px-rounded text-offset: 0 2 - image-clip: 0 0 20 20 - image-border: 2 - icon-color: white - color: #aaaaaa - anchors.top: parent.top - padding: 5 - - $first: - anchors.left: parent.left - - $!first: - anchors.left: prev.right $hover !checked: image-clip: 0 20 20 20 diff --git a/src/otclient/protocolgameparse.cpp b/src/otclient/protocolgameparse.cpp index f4877756..b7355911 100644 --- a/src/otclient/protocolgameparse.cpp +++ b/src/otclient/protocolgameparse.cpp @@ -581,7 +581,7 @@ void ProtocolGame::parseOpenNpcTrade(const InputMessagePtr& msg) int listCount; - if(g_game.getClientVersion() >= 960) + if(g_game.getClientVersion() >= 900) listCount = msg->getU16(); else listCount = msg->getU8();