mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Removed old stand in files from when this project was intended to show UI/UX improvements for the official launcher
This commit is contained in:
76
lib/game.rb
76
lib/game.rb
@@ -1,76 +0,0 @@
|
||||
class W3DHub
|
||||
class Game
|
||||
include CyberarmEngine::Common
|
||||
|
||||
MenuItem = Struct.new(:image, :label, :block)
|
||||
PlayItem = Struct.new(:label, :block)
|
||||
|
||||
@@games = []
|
||||
@@subclasses = []
|
||||
|
||||
attr_reader :slot, :name, :icon, :news_feed, :background_color, :menu_items, :play_items
|
||||
|
||||
def self.inherited(klass)
|
||||
super
|
||||
|
||||
@@subclasses << klass
|
||||
end
|
||||
|
||||
def self.load_games
|
||||
@@subclasses.each do |klass|
|
||||
i = klass.new
|
||||
i.setup
|
||||
|
||||
@@games << i
|
||||
end
|
||||
|
||||
@@games.sort_by! { |g| g.slot }
|
||||
end
|
||||
|
||||
def self.games
|
||||
@@games
|
||||
end
|
||||
|
||||
def initialize
|
||||
@slot = -1
|
||||
|
||||
@name = "???"
|
||||
@icon = EMPTY_IMAGE
|
||||
@news_feed = "???"
|
||||
@background_color = 0xff_ffffff
|
||||
|
||||
@menu_items = []
|
||||
@play_items = []
|
||||
end
|
||||
|
||||
def set_slot(index)
|
||||
@slot = index
|
||||
end
|
||||
|
||||
def set_name(name)
|
||||
@name = name
|
||||
end
|
||||
|
||||
def set_icon(path_or_image)
|
||||
@icon = path_or_image.is_a?(Gosu::Image) ? path_or_image : path_or_image.nil? ? EMPTY_IMAGE : get_image(path_or_image)
|
||||
end
|
||||
|
||||
def set_news_feed(uri)
|
||||
@news_feed = uri
|
||||
end
|
||||
|
||||
def set_background_color(color)
|
||||
@background_color = color
|
||||
end
|
||||
|
||||
def menu_item(path_or_image, label, &block)
|
||||
image = path_or_image.is_a?(Gosu::Image) ? path_or_image : path_or_image.nil? ? EMPTY_IMAGE : get_image(path_or_image)
|
||||
|
||||
@menu_items << MenuItem.new(image, label, block)
|
||||
end
|
||||
|
||||
def play_item(label, &block)
|
||||
@play_items << PlayItem.new(label, block)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,26 +0,0 @@
|
||||
class W3DHub
|
||||
class Games
|
||||
class ExpansiveCivilianWarfare < Game
|
||||
def setup
|
||||
set_name "Expansive Civilian Warfare"
|
||||
set_icon "#{GAME_ROOT_PATH}/media/icons/ecw.png"
|
||||
set_news_feed "https://w3dhub.com/forum/forum/208-expansive-civilian-warfare.xml"
|
||||
set_background_color 0xff_3e5c87
|
||||
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/gear.png", "Game Settings")
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/wrench.png", "Repair Installation")
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/trashCan.png", "Uninstall")
|
||||
|
||||
menu_item(nil, "Install Folder")
|
||||
menu_item(nil, "User Data Folder")
|
||||
menu_item(nil, "View Screenshots")
|
||||
menu_item(nil, "Player Statistics")
|
||||
|
||||
play_item("Play Game")
|
||||
play_item("Single Player")
|
||||
|
||||
set_slot(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,25 +0,0 @@
|
||||
class W3DHub
|
||||
class Games
|
||||
class InterimApex < Game
|
||||
def setup
|
||||
set_name "Interim Apex"
|
||||
set_icon "#{GAME_ROOT_PATH}/media/icons/ia.png"
|
||||
set_news_feed "https://w3dhub.com/forum/forum/209-interim-apex.xml"
|
||||
set_background_color 0xff_034866
|
||||
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/gear.png", "Game Settings")
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/wrench.png", "Repair Installation")
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/trashCan.png", "Uninstall")
|
||||
|
||||
menu_item(nil, "Install Folder")
|
||||
menu_item(nil, "User Data Folder")
|
||||
menu_item(nil, "View Screenshots")
|
||||
|
||||
play_item("Play Game")
|
||||
play_item("Single Player")
|
||||
|
||||
set_slot(2)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,28 +0,0 @@
|
||||
class W3DHub
|
||||
class Games
|
||||
class APathBeyond < Game
|
||||
def setup
|
||||
set_name "Red Alert: A Path Beyond"
|
||||
set_icon "#{GAME_ROOT_PATH}/media/icons/apb.png"
|
||||
set_news_feed "https://w3dhub.com/forum/forum/201-red-alert-a-path-beyond.xml"
|
||||
set_background_color 0xff_353535
|
||||
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/gear.png", "Game Settings")
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/wrench.png", "Repair Installation")
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/trashCan.png", "Uninstall")
|
||||
|
||||
menu_item(nil, "Install Folder")
|
||||
menu_item(nil, "User Data Folder")
|
||||
menu_item(nil, "View Screenshots")
|
||||
menu_item(nil, "Modifications")
|
||||
menu_item(nil, "Bug Tracker")
|
||||
menu_item(nil, "Player Statistics")
|
||||
|
||||
play_item("Play Game")
|
||||
play_item("Single Player")
|
||||
|
||||
set_slot(3)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,24 +0,0 @@
|
||||
class W3DHub
|
||||
class Games
|
||||
class CNCRenegade < Game
|
||||
def setup
|
||||
set_name "C&C Renegade"
|
||||
set_icon "#{GAME_ROOT_PATH}/media/icons/ren.png"
|
||||
set_news_feed "https://w3dhub.com/forum/forum/231-command-and-conquer-renegade.xml"
|
||||
set_background_color 0xff_b03f25
|
||||
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/gear.png", "Game Settings")
|
||||
|
||||
menu_item(nil, "Install Folder")
|
||||
menu_item(nil, "View Screenshots")
|
||||
menu_item(nil, "> GET SCRIPTS 4.7 <")
|
||||
menu_item(nil, "Renegade News")
|
||||
|
||||
play_item("Play Game")
|
||||
play_item("Single Player")
|
||||
|
||||
set_slot(0)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,27 +0,0 @@
|
||||
class W3DHub
|
||||
class Games
|
||||
class TSReborn < Game
|
||||
def setup
|
||||
set_name "Tiberian Sun: Reborn"
|
||||
set_icon "#{GAME_ROOT_PATH}/media/icons/tsr.png"
|
||||
set_news_feed "https://w3dhub.com/forum/forum/97-tiberian-sun-reborn.xml"
|
||||
set_background_color 0xff_497331
|
||||
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/gear.png", "Game Settings")
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/wrench.png", "Repair Installation")
|
||||
menu_item("#{GAME_ROOT_PATH}/media/ui_icons/trashCan.png", "Uninstall")
|
||||
|
||||
menu_item(nil, "Install Folder")
|
||||
menu_item(nil, "User Data Folder")
|
||||
menu_item(nil, "View Screenshots")
|
||||
menu_item(nil, "Discord")
|
||||
menu_item(nil, "Modifications")
|
||||
|
||||
play_item("Play Game")
|
||||
play_item("Single Player")
|
||||
|
||||
set_slot(4)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,14 +0,0 @@
|
||||
class W3DHub
|
||||
class RenegadePlayer
|
||||
attr_accessor :name, :team, :score, :kills, :deaths, :ping
|
||||
|
||||
def initialize(name, team, score, kills, deaths, ping)
|
||||
@name = name
|
||||
@team = team
|
||||
@score = score
|
||||
@kills = kills
|
||||
@deaths = deaths
|
||||
@ping = ping
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,23 +0,0 @@
|
||||
class W3DHub
|
||||
class RenegadeServer
|
||||
attr_accessor :country, :country_code, :time_left, :ip, :host_port, :hostname, :map_name,
|
||||
:website, :player_count, :max_players, :password, :players
|
||||
|
||||
def initialize(country, country_code, time_left, ip, host_port, hostname, map_name,
|
||||
website, player_count, max_players, password, players)
|
||||
@country = country
|
||||
@country_code = country_code
|
||||
@time_left = time_left
|
||||
@ip = ip
|
||||
@host_port = host_port
|
||||
@hostname = hostname
|
||||
@map_name = map_name
|
||||
@website = website
|
||||
@player_count = player_count
|
||||
@max_players = max_players
|
||||
@password = password
|
||||
|
||||
@players = players
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user