summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-08-26 15:52:25 +0200
committerAki <nthirtyone@gmail.com>2016-08-26 15:52:25 +0200
commitab82b9f8ee76ef8327765ed59639c3f3c65fce8f (patch)
tree8b216350d1d721355282e04be0487995e7114ce5
parent7c41ef664be97b2de097c16df8b7d84379be920b (diff)
downloadroflnauts-ab82b9f8ee76ef8327765ed59639c3f3c65fce8f.zip
roflnauts-ab82b9f8ee76ef8327765ed59639c3f3c65fce8f.tar.gz
roflnauts-ab82b9f8ee76ef8327765ed59639c3f3c65fce8f.tar.bz2
allow first
-rw-r--r--assets/placeholder-map-icon.pngbin5322 -> 6850 bytes
-rw-r--r--config/menuhost.lua3
-rw-r--r--selector.lua5
3 files changed, 5 insertions, 3 deletions
diff --git a/assets/placeholder-map-icon.png b/assets/placeholder-map-icon.png
index eccb551..3d54e18 100644
--- a/assets/placeholder-map-icon.png
+++ b/assets/placeholder-map-icon.png
Binary files differ
diff --git a/config/menuhost.lua b/config/menuhost.lua
index 878ec71..6e52482 100644
--- a/config/menuhost.lua
+++ b/config/menuhost.lua
@@ -10,10 +10,11 @@ local map_selector = selector:new(menu)
return {
map_selector
- :setPosition(width/2, 10)
+ :setPosition(width/2, 40)
:setSize(80, 42)
:setMargin(0)
:set("global", true)
+ :set("first", true)
:set("list", require "maplist")
:set("icons_i", love.graphics.newImage("assets/placeholder-map-icon.png"))
:set("icons_q", require "mapicons")
diff --git a/selector.lua b/selector.lua
index a4f9c03..f382bbb 100644
--- a/selector.lua
+++ b/selector.lua
@@ -23,6 +23,7 @@ Selector = {
focused = false,
global = false,
delay = 2,
+ first = false,
list,
sets,
locks,
@@ -204,7 +205,7 @@ function Selector:drawBlock(n, x, y, scale)
love.graphics.draw(sprite, quad.arrow_l, (x+0-2-math.floor(self.delay))* scale, (y+dy)*scale, 0, scale, scale)
love.graphics.draw(sprite, quad.arrow_r, (x+w-4+math.floor(self.delay))*scale, (y+dy)*scale, 0, scale, scale)
end
- if self:getSelection(n) ~= 1 then
+ if (self:getSelection(n) ~= 1 or self.first) then
love.graphics.setFont(Font)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.printf(string.upper(name), (x-w)*scale, (y+h+1)*scale, w*3, "center", 0, scale, scale)
@@ -245,7 +246,7 @@ function Selector:controlpressed(set, action, key)
if action == "left" and not locked then self:previous(n) end
if action == "right" and not locked then self:next(n) end
if action == "attack" then
- if self:getSelection(n) ~= 1 and self:isUnique(n) then
+ if (self:getSelection(n) ~= 1 or self.first) and self:isUnique(n) then
self.locks[n] = true
end
end