mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Simplified InputMapper#action
This commit is contained in:
@@ -84,17 +84,12 @@ class IMICFPS
|
|||||||
|
|
||||||
def self.action(key)
|
def self.action(key)
|
||||||
answer = nil
|
answer = nil
|
||||||
@@keymap.each do |action, value|
|
@@keymap.detect do |action, value|
|
||||||
if value.is_a?(Array)
|
if value.is_a?(Array)
|
||||||
if value.include?(key)
|
answer = action if value.include?(key)
|
||||||
answer = action
|
|
||||||
break
|
|
||||||
end
|
|
||||||
|
|
||||||
else
|
else
|
||||||
if value == key
|
if value == key
|
||||||
answer = action
|
answer = action
|
||||||
break
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ class IMICFPS
|
|||||||
def toggle_first_person_view
|
def toggle_first_person_view
|
||||||
@first_person_view = !@first_person_view
|
@first_person_view = !@first_person_view
|
||||||
@visible = !@first_person_view
|
@visible = !@first_person_view
|
||||||
puts "First Person? #{@first_person_view}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def turn_180
|
def turn_180
|
||||||
|
|||||||
Reference in New Issue
Block a user