Changes

no edit summary
Line 9: Line 9:  
_remodel_level = "'''Remodel Level'''",
 
_remodel_level = "'''Remodel Level'''",
 
_build_time = "'''Build Time'''",
 
_build_time = "'''Build Time'''",
 +
_default_slot_num = 4,
 
_id_1 = "%s",
 
_id_1 = "%s",
 
_id_2 = "%s (%s)",
 
_id_2 = "%s (%s)",
Line 168: Line 169:  
local slots = {}
 
local slots = {}
 
local num_of_slots = ship:slots()
 
local num_of_slots = ship:slots()
for i = 1, math.max(4, num_of_slots) do
+
local slots_to_show
 +
if num_of_slots then
 +
slots_to_show = math.max(self._default_slot_num, num_of_slots)
 +
else
 +
slots_to_show = self._default_slot_num
 +
end
 +
for i = 1, slots_to_show do
 
local equipment, size, icon, color
 
local equipment, size, icon, color
if i > num_of_slots then
+
if num_of_slots and i > num_of_slots then
 
equipment, size, icon, color = "- Locked -", "-", "", 0
 
equipment, size, icon, color = "- Locked -", "-", "", 0
 
else
 
else
Line 181: Line 188:  
icon = false
 
icon = false
 
color = 0
 
color = 0
equipment = "- Unequipped -"
+
equipment = equipment == false and "- Unequipped -" or Formatting:format_stat(equipment)
 
end
 
end
 
icon = Formatting:format_image(Formatting:format_equipment_icon(icon))
 
icon = Formatting:format_image(Formatting:format_equipment_icon(icon))
Anonymous user