mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-12 22:32:35 +00:00
Updated gems, fix issues caused by the removal of $window from cyberarm_engine
This commit is contained in:
28
Gemfile.lock
28
Gemfile.lock
@@ -1,10 +1,10 @@
|
||||
GIT
|
||||
remote: https://github.com/cyberarm/cyberarm_engine
|
||||
revision: 1b080f9fb99cc4ec696f32f00f28cbf89b40ed04
|
||||
revision: ab9f9e8e7a4e02df7fefbb9b5add248b7629a2f7
|
||||
specs:
|
||||
cyberarm_engine (0.18.0)
|
||||
clipboard (~> 1.3.5)
|
||||
excon (~> 0.78.0)
|
||||
cyberarm_engine (0.21.0)
|
||||
clipboard (~> 1.3)
|
||||
excon (~> 0.88)
|
||||
gosu (~> 1.1)
|
||||
gosu_more_drawables (~> 0.3)
|
||||
|
||||
@@ -21,25 +21,23 @@ GIT
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
clipboard (1.3.5)
|
||||
concurrent-ruby (1.1.8)
|
||||
clipboard (1.3.6)
|
||||
concurrent-ruby (1.1.10)
|
||||
cri (2.1.0)
|
||||
excon (0.78.1)
|
||||
gosu (1.2.0)
|
||||
excon (0.92.3)
|
||||
gosu (1.4.3)
|
||||
gosu_more_drawables (0.3.1)
|
||||
i18n (1.8.10)
|
||||
i18n (1.11.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
mini_portile2 (2.8.0)
|
||||
nokogiri (1.13.6)
|
||||
mini_portile2 (~> 2.8.0)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.13.6-x64-mingw32)
|
||||
racc (~> 1.4)
|
||||
ocra (1.3.11)
|
||||
opengl-bindings (1.6.11)
|
||||
opengl-bindings (1.6.12)
|
||||
racc (1.6.0)
|
||||
rake (13.0.3)
|
||||
rubyzip (2.3.0)
|
||||
rake (13.0.6)
|
||||
rubyzip (2.3.2)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
@@ -57,4 +55,4 @@ DEPENDENCIES
|
||||
rubyzip
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.3
|
||||
2.3.17
|
||||
|
||||
@@ -9,7 +9,7 @@ end
|
||||
class Window < Gosu::Window
|
||||
def initialize
|
||||
super(Gosu.screen_width, Gosu.screen_height, fullscreen: true)
|
||||
$window = self
|
||||
CyberarmEngine::Window.instance = self
|
||||
@size = 50
|
||||
@slope = 250
|
||||
@color_step = 10
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
component(:vehicle) # Generic, Weapon
|
||||
|
||||
on.button_down(:interact) do |event|
|
||||
$window.console.stdin("#{event.entity.name} handled button_down(:interact)")
|
||||
CyberarmEngine::Window.instance.console.stdin("#{event.entity.name} handled button_down(:interact)")
|
||||
# if event.player.touching?(event.entity)
|
||||
# event.player.enter_vehicle
|
||||
# elsif event.player.driving?(event.entity) or event.player.passenger?(event.entity)
|
||||
|
||||
@@ -7,7 +7,7 @@ class IMICFPS
|
||||
|
||||
module CommonMethods
|
||||
def window
|
||||
$window
|
||||
CyberarmEngine::Window.instance
|
||||
end
|
||||
|
||||
def delta_time
|
||||
|
||||
@@ -77,12 +77,12 @@ class IMICFPS
|
||||
when "up"
|
||||
input = InputMapper.get(data.last.to_sym)
|
||||
key = input.is_a?(Array) ? input.first : input
|
||||
$window.current_state.button_up(key) if key
|
||||
CyberarmEngine::Window.instance.current_state.button_up(key) if key
|
||||
|
||||
when "down"
|
||||
input = InputMapper.get(data.last.to_sym)
|
||||
key = input.is_a?(Array) ? input.first : input
|
||||
$window.current_state.button_down(key) if key
|
||||
CyberarmEngine::Window.instance.current_state.button_down(key) if key
|
||||
|
||||
when "mouse"
|
||||
@camera.orientation.z = data[1].to_f
|
||||
|
||||
@@ -65,11 +65,11 @@ class IMICFPS
|
||||
end
|
||||
|
||||
def hijack_input!
|
||||
$window.input_hijack = self
|
||||
CyberarmEngine::Window.instance.input_hijack = self
|
||||
end
|
||||
|
||||
def release_input!
|
||||
$window.input_hijack = nil
|
||||
CyberarmEngine::Window.instance.input_hijack = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -19,7 +19,7 @@ class IMICFPS
|
||||
return unless @text_input
|
||||
|
||||
Gosu.draw_rect(
|
||||
Widget.horizontal_margin, $window.height / 2 - (@text.height / 2 + Widget.horizontal_padding),
|
||||
Widget.horizontal_margin, CyberarmEngine::Window.instance.height / 2 - (@text.height / 2 + Widget.horizontal_padding),
|
||||
@width - Widget.horizontal_padding * 2, @text.height + Widget.vertical_padding * 2,
|
||||
@background
|
||||
)
|
||||
@@ -44,11 +44,11 @@ class IMICFPS
|
||||
def update
|
||||
@deliver_to_text.text = "#{@deliver_to}: "
|
||||
@deliver_to_text.x = Widget.horizontal_margin + Widget.horizontal_padding
|
||||
@deliver_to_text.y = $window.height / 2 - (@text.height / 2)
|
||||
@deliver_to_text.y = CyberarmEngine::Window.instance.height / 2 - (@text.height / 2)
|
||||
|
||||
@text.text = @text_input&.text.to_s
|
||||
@text.x = Widget.horizontal_margin + Widget.horizontal_padding + @deliver_to_text.width
|
||||
@text.y = $window.height / 2 - (@text.height / 2)
|
||||
@text.y = CyberarmEngine::Window.instance.height / 2 - (@text.height / 2)
|
||||
end
|
||||
|
||||
def button_down(id)
|
||||
|
||||
@@ -26,7 +26,7 @@ class IMICFPS
|
||||
def available_light
|
||||
raise "Using to many lights, #{light_count}/#{LightManager::MAX_LIGHTS}" if light_count > LightManager::MAX_LIGHTS
|
||||
|
||||
puts "OpenGL::GL_LIGHT#{light_count}" if $window.config.get(:debug_options, :stats)
|
||||
puts "OpenGL::GL_LIGHT#{light_count}" if CyberarmEngine::Window.instance.config.get(:debug_options, :stats)
|
||||
Object.const_get "OpenGL::GL_LIGHT#{light_count}"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@ class IMICFPS
|
||||
attr_reader :camera, :entities, :lights
|
||||
|
||||
def initialize
|
||||
@camera = PerspectiveCamera.new(position: Vector.new, aspect_ratio: $window.aspect_ratio)
|
||||
@camera = PerspectiveCamera.new(position: Vector.new, aspect_ratio: CyberarmEngine::Window.instance.aspect_ratio)
|
||||
@entities = []
|
||||
@lights = []
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class IMICFPS
|
||||
end
|
||||
|
||||
def map
|
||||
$window.director.map
|
||||
CyberarmEngine::Window.instance.director.map
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,20 +12,20 @@ class IMICFPS
|
||||
end
|
||||
|
||||
def set(key, value)
|
||||
$window.config[:debug_options, key] = value
|
||||
CyberarmEngine::Window.instance.config[:debug_options, key] = value
|
||||
end
|
||||
|
||||
def get(key)
|
||||
$window.config.get(:debug_options, key)
|
||||
CyberarmEngine::Window.instance.config.get(:debug_options, key)
|
||||
end
|
||||
|
||||
def setup
|
||||
set(:boundingboxes, false) if $window.config.get(:debug_options, :boundingboxes).nil?
|
||||
set(:wireframe, false) if $window.config.get(:debug_options, :wireframe).nil?
|
||||
set(:stats, false) if $window.config.get(:debug_options, :stats).nil?
|
||||
set(:skydome, true) if $window.config.get(:debug_options, :skydome).nil?
|
||||
set(:use_shaders, true) if $window.config.get(:debug_options, :use_shaders).nil?
|
||||
set(:opengl_error_panic, false) if $window.config.get(:debug_options, :opengl_error_panic).nil?
|
||||
set(:boundingboxes, false) if CyberarmEngine::Window.instance.config.get(:debug_options, :boundingboxes).nil?
|
||||
set(:wireframe, false) if CyberarmEngine::Window.instance.config.get(:debug_options, :wireframe).nil?
|
||||
set(:stats, false) if CyberarmEngine::Window.instance.config.get(:debug_options, :stats).nil?
|
||||
set(:skydome, true) if CyberarmEngine::Window.instance.config.get(:debug_options, :skydome).nil?
|
||||
set(:use_shaders, true) if CyberarmEngine::Window.instance.config.get(:debug_options, :use_shaders).nil?
|
||||
set(:opengl_error_panic, false) if CyberarmEngine::Window.instance.config.get(:debug_options, :opengl_error_panic).nil?
|
||||
|
||||
subcommand(:boundingboxes, :boolean)
|
||||
subcommand(:wireframe, :boolean)
|
||||
|
||||
@@ -19,12 +19,12 @@ class IMICFPS
|
||||
|
||||
case arguments.last
|
||||
when "", nil
|
||||
console.stdin("#{Console::Style.highlight('fps')}: #{$window.config.get(:options, :fps)}")
|
||||
console.stdin("#{Console::Style.highlight('fps')}: #{CyberarmEngine::Window.instance.config.get(:options, :fps)}")
|
||||
when "on"
|
||||
var = $window.config[:options, :fps] = true
|
||||
var = CyberarmEngine::Window.instance.config[:options, :fps] = true
|
||||
console.stdin("fps => #{Console::Style.highlight(var)}")
|
||||
when "off"
|
||||
var = $window.config[:options, :fps] = false
|
||||
var = CyberarmEngine::Window.instance.config[:options, :fps] = false
|
||||
console.stdin("fps => #{Console::Style.highlight(var)}")
|
||||
else
|
||||
console.stdin("Invalid argument for #{Console::Style.highlight(command.to_s)}, got #{Console::Style.error(arguments.last)} expected #{Console::Style.notice('on')}, or #{Console::Style.notice('off')}.")
|
||||
|
||||
@@ -12,7 +12,7 @@ class IMICFPS
|
||||
end
|
||||
|
||||
def setup
|
||||
$window.config[:options, :hud] = true if $window.config.get(:options, :hud).nil?
|
||||
CyberarmEngine::Window.instance.config[:options, :hud] = true if CyberarmEngine::Window.instance.config.get(:options, :hud).nil?
|
||||
end
|
||||
|
||||
def handle(arguments, console)
|
||||
@@ -23,12 +23,12 @@ class IMICFPS
|
||||
|
||||
case arguments.last
|
||||
when "", nil
|
||||
console.stdin("#{Console::Style.highlight(command.to_s)}: #{$window.config.get(:options, command)}")
|
||||
console.stdin("#{Console::Style.highlight(command.to_s)}: #{CyberarmEngine::Window.instance.config.get(:options, command)}")
|
||||
when "on"
|
||||
var = $window.config[:options, command] = true
|
||||
var = CyberarmEngine::Window.instance.config[:options, command] = true
|
||||
console.stdin("#{command} => #{Console::Style.highlight(var)}")
|
||||
when "off"
|
||||
var = $window.config[:options, command] = false
|
||||
var = CyberarmEngine::Window.instance.config[:options, command] = false
|
||||
console.stdin("#{command} => #{Console::Style.highlight(var)}")
|
||||
else
|
||||
console.stdin("Invalid argument for #{Console::Style.highlight(command.to_s)}, got #{Console::Style.error(arguments.last)} expected #{Console::Style.notice('on')}, or #{Console::Style.notice('off')}.")
|
||||
|
||||
@@ -5,20 +5,20 @@ class IMICFPS
|
||||
include CommonMethods
|
||||
|
||||
def self.set_defaults
|
||||
if $window.config.get(:options, :audio, :volume_master).nil?
|
||||
$window.config[:options, :audio, :volume_master] = 1.0
|
||||
if CyberarmEngine::Window.instance.config.get(:options, :audio, :volume_master).nil?
|
||||
CyberarmEngine::Window.instance.config[:options, :audio, :volume_master] = 1.0
|
||||
end
|
||||
|
||||
if $window.config.get(:options, :audio, :volume_sound_effects).nil?
|
||||
$window.config[:options, :audio, :volume_sound_effects] = 1.0
|
||||
if CyberarmEngine::Window.instance.config.get(:options, :audio, :volume_sound_effects).nil?
|
||||
CyberarmEngine::Window.instance.config[:options, :audio, :volume_sound_effects] = 1.0
|
||||
end
|
||||
|
||||
if $window.config.get(:options, :audio, :volume_music).nil?
|
||||
$window.config[:options, :audio, :volume_music] = 0.7
|
||||
if CyberarmEngine::Window.instance.config.get(:options, :audio, :volume_music).nil?
|
||||
CyberarmEngine::Window.instance.config[:options, :audio, :volume_music] = 0.7
|
||||
end
|
||||
|
||||
if $window.config.get(:options, :audio, :volume_dialogue).nil?
|
||||
$window.config[:options, :audio, :volume_dialogue] = 0.7
|
||||
if CyberarmEngine::Window.instance.config.get(:options, :audio, :volume_dialogue).nil?
|
||||
CyberarmEngine::Window.instance.config[:options, :audio, :volume_dialogue] = 0.7
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user