Added graphical backgrounds to all Unified Inventory pages
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Wed, 27 Feb 2013 02:54:13 +0000 (21:54 -0500)
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Wed, 27 Feb 2013 03:01:17 +0000 (22:01 -0500)
unified_inventory/api.lua
unified_inventory/textures/ui_bags_lg_form.png [new file with mode: 0644]
unified_inventory/textures/ui_bags_main_form.png [new file with mode: 0644]
unified_inventory/textures/ui_bags_med_form.png [new file with mode: 0644]
unified_inventory/textures/ui_bags_sm_form.png [new file with mode: 0644]
unified_inventory/textures/ui_craftguide_form.png [new file with mode: 0644]
unified_inventory/textures/ui_crafting_form.png [new file with mode: 0644]
unified_inventory/textures/ui_form_bg.png [new file with mode: 0644]
unified_inventory/textures/ui_misc_form.png [new file with mode: 0644]

index 2eb0b3e89cc6c2a42dc8d5c3450dafe7016c4f99..845451b514d9805ae86895ce3f4f0113c67a71e0 100644 (file)
@@ -123,6 +123,34 @@ unified_inventory.get_formspec = function(player,page)
        -- player inventory
        formspec = formspec .. "list[current_player;main;0,4.5;8,4;]"
 
+       -- backgrounds
+               formspec = formspec .. "background[-0.19,-0.2,;14.38,10.55;ui_form_bg.png]"
+       if page=="craft" then
+               formspec = formspec .. "background[0.12,1.05,;7.8,7.4;ui_crafting_form.png]"
+               end
+       if page=="craftguide" then
+               formspec = formspec .. "background[0.12,1.05,;7.8,7.4;ui_craftguide_form.png]"
+               end
+       if page=="misc" then
+               formspec = formspec .. "background[0.12,1.05,;7.8,7.4;ui_misc_form.png]"
+               end
+       if page=="bags" then
+               formspec = formspec .. "background[0.12,1.05,;7.8,7.4;ui_bags_main_form.png]"
+               end
+
+       for i=1,4 do
+               if page=="bag"..i then
+                       local slots = player:get_inventory():get_stack(page, 1):get_definition().groups.bagslots
+                       if slots == 8 then
+                               formspec = formspec .. "background[0.12,1.05,;7.8,7.4;ui_bags_sm_form.png]"
+                       elseif slots == 16 then
+                               formspec = formspec .. "background[0.12,1.05,;7.8,7.4;ui_bags_med_form.png]"
+                       elseif slots == 24 then
+                               formspec = formspec .. "background[0.12,1.05,;7.8,7.4;ui_bags_lg_form.png]"
+                       end
+               end
+       end
+
        -- main buttons
                formspec = formspec .. "button[0,9;1.8,.5;craft;Craft]"
                formspec = formspec .. "button[1.6,9;1.8,.5;craftguide;Craft Guide]"
diff --git a/unified_inventory/textures/ui_bags_lg_form.png b/unified_inventory/textures/ui_bags_lg_form.png
new file mode 100644 (file)
index 0000000..de62e21
Binary files /dev/null and b/unified_inventory/textures/ui_bags_lg_form.png differ
diff --git a/unified_inventory/textures/ui_bags_main_form.png b/unified_inventory/textures/ui_bags_main_form.png
new file mode 100644 (file)
index 0000000..11cb05d
Binary files /dev/null and b/unified_inventory/textures/ui_bags_main_form.png differ
diff --git a/unified_inventory/textures/ui_bags_med_form.png b/unified_inventory/textures/ui_bags_med_form.png
new file mode 100644 (file)
index 0000000..77b89df
Binary files /dev/null and b/unified_inventory/textures/ui_bags_med_form.png differ
diff --git a/unified_inventory/textures/ui_bags_sm_form.png b/unified_inventory/textures/ui_bags_sm_form.png
new file mode 100644 (file)
index 0000000..f0af238
Binary files /dev/null and b/unified_inventory/textures/ui_bags_sm_form.png differ
diff --git a/unified_inventory/textures/ui_craftguide_form.png b/unified_inventory/textures/ui_craftguide_form.png
new file mode 100644 (file)
index 0000000..7dbfa61
Binary files /dev/null and b/unified_inventory/textures/ui_craftguide_form.png differ
diff --git a/unified_inventory/textures/ui_crafting_form.png b/unified_inventory/textures/ui_crafting_form.png
new file mode 100644 (file)
index 0000000..1eaea56
Binary files /dev/null and b/unified_inventory/textures/ui_crafting_form.png differ
diff --git a/unified_inventory/textures/ui_form_bg.png b/unified_inventory/textures/ui_form_bg.png
new file mode 100644 (file)
index 0000000..37683f0
Binary files /dev/null and b/unified_inventory/textures/ui_form_bg.png differ
diff --git a/unified_inventory/textures/ui_misc_form.png b/unified_inventory/textures/ui_misc_form.png
new file mode 100644 (file)
index 0000000..103900c
Binary files /dev/null and b/unified_inventory/textures/ui_misc_form.png differ