comparison Main.lua @ 51:9f23fb15adc5

Record amount of required Conquest Points for the season for merchant items.
author James D. Callahan III <jcallahan@curse.com>
date Thu, 28 Jun 2012 14:30:20 -0500
parents 66034def453b
children 2bfdce67c71e
comparison
equal deleted inserted replaced
50:66034def453b 51:9f23fb15adc5
908 local price_string = ActualCopperCost(copper_price, merchant_standing) 908 local price_string = ActualCopperCost(copper_price, merchant_standing)
909 909
910 if extended_cost then 910 if extended_cost then
911 local bg_points = 0 911 local bg_points = 0
912 local personal_points = 0 912 local personal_points = 0
913 local required_conquest
913 914
914 DatamineTT:ClearLines() 915 DatamineTT:ClearLines()
915 DatamineTT:SetMerchantItem(item_index) 916 DatamineTT:SetMerchantItem(item_index)
916 917
917 for line_index = 1, DatamineTT:NumLines() do 918 for line_index = 1, DatamineTT:NumLines() do
918 local current_line = _G["WDPDatamineTTTextLeft" .. line_index] 919 local current_line = _G["WDPDatamineTTTextLeft" .. line_index]
919 920
920 if not current_line then 921 if not current_line then
921 break 922 break
922 end 923 end
923 local breakout 924 required_conquest = current_line:GetText():match("Requires earning a total of (%d+)\nConquest Points for the season.")
924 925
925 for match_index = 1, #POINT_MATCH_PATTERNS do 926 for match_index = 1, #POINT_MATCH_PATTERNS do
926 local match1, match2 = current_line:GetText():match(POINT_MATCH_PATTERNS[match_index]) 927 local match1, match2 = current_line:GetText():match(POINT_MATCH_PATTERNS[match_index])
927 personal_points = personal_points + (match1 or 0) 928 personal_points = personal_points + (match1 or 0)
928 bg_points = bg_points + (match2 or 0) 929 bg_points = bg_points + (match2 or 0)
929 930
930 if match1 or match2 then 931 if match1 or match2 then
931 breakout = true
932 break 932 break
933 end 933 end
934 end
935
936 if breakout then
937 break
938 end 934 end
939 end 935 end
940 local currency_list = {} 936 local currency_list = {}
941 local item_count = _G.GetMerchantItemCostInfo(item_index) 937 local item_count = _G.GetMerchantItemCostInfo(item_index)
942 938
943 -- Keeping this around in case Blizzard makes the two points diverge at some point. 939 -- Keeping this around in case Blizzard makes the two points diverge at some point.
944 -- price_string = ("%s:%s:%s"):format(price_string, bg_points, personal_points) 940 -- price_string = ("%s:%s:%s:%s"):format(price_string, bg_points, personal_points, required_conquest or 0)
945 price_string = ("%s:%s"):format(price_string, personal_points) 941 price_string = ("%s:%s:%s"):format(price_string, personal_points, required_conquest or 0)
946 942
947 for cost_index = 1, item_count do 943 for cost_index = 1, item_count do
948 local icon_texture, amount_required, currency_link = _G.GetMerchantItemCostItem(item_index, cost_index) 944 local icon_texture, amount_required, currency_link = _G.GetMerchantItemCostItem(item_index, cost_index)
949 local currency_id = currency_link and ItemLinkToID(currency_link) or nil 945 local currency_id = currency_link and ItemLinkToID(currency_link) or nil
950 946