Added code files for initial commit.

HASHTAG YOLO SWAG
This commit is contained in:
8bitprodigy 2013-12-01 19:25:01 -05:00
parent 75ae71dd1a
commit dcf19c69e1
11 changed files with 712 additions and 3 deletions

View file

@ -1,4 +1,45 @@
launch
======
THE AS OF YET NOT OFFICIALLY NAMED LAUNCHER FOR IOQ3
====================================================
The launcher for ioquake3.
The launcher for ioquake3. Built with QT, written in C++
ROADMAP
=======
Required features to reach:
---------------------------
Version 1.0(alpha)
launch the ioquake3 program - DONE
launch quake3 at different resolutions - DONE
download/install patches for quake3 - not yet implemented
display EULA before downloading q3 patches - not yet implemented
2.0(beta)
be able to download/install ioquake3
be able to copy quake3 data from retail CD
be able to update ioquake3
be able to update self
initial support for other operating systems - STARTED(Linux)
3.0(Gold)
config launch options
config player options
WYSIWYG name config
work with steam installation of quake3
backup/save/swap configs
support for Linux, Windows, and OSX
4.0(PLATINUM)
support for other games (Tremulous/SmokinGuns/TurtleArena/etc.)
automated mod switcher
builtin server browser
integrated newsfeed
LAN support
preload mods/maps/content via internet protocols
uri integration (q3://, trem://, ioq3://, etc.)

7
imgs.qrc Normal file
View file

@ -0,0 +1,7 @@
<RCC>
<qresource prefix="/imgs">
<file>ioquaktree.png</file>
<file>iol.png</file>
<file>iolICO.png</file>
</qresource>
</RCC>

BIN
iol.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
iolICO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
ioq3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
ioq3ICO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
ioquaktree.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

11
main.cpp Normal file
View file

@ -0,0 +1,11 @@
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
ioLaunch w;
w.show();
return a.exec();
}

218
mainwindow.cpp Normal file
View file

@ -0,0 +1,218 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
ioLaunch::ioLaunch(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::ioLaunch)
{
ui->setupUi(this);
resOption = "";
screenOption = "";
}
ioLaunch::~ioLaunch()
{
delete ui;
}
void ioLaunch::on_btnLaunch_clicked()
{
#ifdef Q_OS_WIN32
if(ioq3 == NULL)
{
msg.setText("Please select your Quake3 directory");
msg.exec();
QString path = QFileDialog::getExistingDirectory (this, tr("Directory"), directory.path());
path.replace(" ", "\" \"");
ioq3 = path + "\\ioquake3.x86.exe +set r_mode -1";
}
#elif Q_OS_X11
ioq3 = "ioquake3 +set r_mode -1";
#elif Q_OS_MAC
ioq3 = "open -a ioquake3 +set r_mode -1";
#endif
if(ioWedited == true && ioHedited == true)
{
resOption = " +set r_customwidth " + QString::number(ioWidth) + " +set r_customheight " + QString::number(ioHeight);
}
if(resOption == NULL)
{
resOption = "";
}
if(screenOption == NULL)
{
screenOption = "";
}
myProcess.start(ioq3+resOption+screenOption);
if(!myProcess.waitForStarted())
{
ioq3Failed.setText("ioquake3 failed to start!\nIs it installed?\n");
ioq3Failed.exec();
}
}
void ioLaunch::on_cbResolution_highlighted(int index)
{
ioWedited = false;
ioHedited = false;
}
void ioLaunch::on_cbResolution_currentIndexChanged(int index)
{
ioWedited = false;
ioHedited = false;
switch(index)
{
case 0:
{
resOption = "";
break;
}
case 1:
{
ioWidth = QApplication::desktop()->screenGeometry().width();
ioHeight = QApplication::desktop()->screenGeometry().height();
resOption = " +set r_customwidth " + QString::number(ioWidth) + " +set r_customheight " + QString::number(ioHeight);
break;
}
case 2:
{
resOption = " +set r_customwidth 320 +set r_customheight 240";
break;
}
case 3:
{
resOption = " +set r_customwidth 400 +set r_customheight 300";
break;
}
case 4:
{
resOption = " +set r_customwidth 512 +set r_customheight 384";
break;
}
case 5:
{
resOption = " +set r_customwidth 640 +set r_customheight 480";
break;
}
case 6:
{
resOption = " +set r_customwidth 800 +set r_customheight 600";
break;
}
case 7:
{
resOption = " +set r_customwidth 960 +set r_customheight 720";
break;
}
case 8:
{
resOption = " +set r_customwidth 1024 +set r_customheight 3768";
break;
}
case 9:
{
resOption = " +set r_customwidth 1152 +set r_customheight 864";
break;
}
case 10:
{
resOption = " +set r_customwidth 1280 +set r_customheight 1024";
break;
}
case 11:
{
resOption = " +set r_customwidth 1600 +set r_customheight 1200";
break;
}
case 12:
{
resOption = " +set r_customwidth 2048 +set r_customheight 1536";
break;
}
case 13:
{
resOption = " +set r_customwidth 856 +set r_customheight 480";
break;
}
case 14:
{
resOption = " +set r_customwidth 1280 +set r_customheight 720";
break;
}
case 15:
{
resOption = " +set r_customwidth 1920 +set r_customheight 1080";
break;
}
case 16:
{
resOption = " +set r_customwidth 1280 +set r_customheight 800";
break;
}
default:
{
resOption = "";
break;
}
}
}
void ioLaunch::on_rbFull_toggled(bool checked)
{
if(checked)
{
screenOption = " +set r_fullscreen 1";
}
}
void ioLaunch::on_rbWin_toggled(bool checked)
{
if(checked)
{
screenOption = " +set r_fullscreen 0";
}
}
void ioLaunch::on_rbDefault_toggled(bool checked)
{
if(checked)
{
screenOption = "";
}
}
void ioLaunch::on_sbWidth_valueChanged(int arg1)
{
ioWidth = 0;
if(arg1 >= 0)
{
ioWidth = arg1;
ioWedited = true;
}
else{
ioWedited = false;
}
}
void ioLaunch::on_sbHeight_valueChanged(int arg1)
{
ioHeight = 0;
if(arg1 >= 0)
{
ioHeight = arg1;
ioHedited = true;
}
else{
ioHedited = false;
}
}

59
mainwindow.h Normal file
View file

@ -0,0 +1,59 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QDesktopWidget>
#include <QMessageBox>
#include <QProcess>
#include <QString>
#include <QtGlobal>
#include <QFileDialog>
#include <QDir>
namespace Ui {
class ioLaunch;
}
class ioLaunch : public QMainWindow
{
Q_OBJECT
public:
explicit ioLaunch(QWidget *parent = 0);
~ioLaunch();
private slots:
void on_btnLaunch_clicked();
void on_cbResolution_highlighted(int index);
void on_cbResolution_currentIndexChanged(int index);
void on_rbFull_toggled(bool checked);
void on_rbWin_toggled(bool checked);
void on_rbDefault_toggled(bool checked);
void on_sbWidth_valueChanged(int arg1);
void on_sbHeight_valueChanged(int arg1);
private:
Ui::ioLaunch *ui;
QProcess myProcess;
QString ioq3;
QString resOption;
QString screenOption;
QMessageBox msg;
QMessageBox ioq3Failed;
QDir directory;
int ioWidth;
int ioHeight;
bool ioWedited;
bool ioHedited;
};
#endif // MAINWINDOW_H

373
mainwindow.ui Normal file
View file

@ -0,0 +1,373 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ioLaunch</class>
<widget class="QMainWindow" name="ioLaunch">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>450</width>
<height>360</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>4</horstretch>
<verstretch>2</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>450</width>
<height>360</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>450</width>
<height>360</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
<property name="baseSize">
<size>
<width>450</width>
<height>360</height>
</size>
</property>
<property name="font">
<font>
<family>Courier New</family>
</font>
</property>
<property name="windowTitle">
<string>ioLaunch 0.2</string>
</property>
<property name="windowIcon">
<iconset resource="imgs.qrc">
<normaloff>:/imgs/iolICO.png</normaloff>:/imgs/iolICO.png</iconset>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<widget class="QWidget" name="centralWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeIncrement">
<size>
<width>1</width>
<height>1</height>
</size>
</property>
<widget class="QPushButton" name="btnLaunch">
<property name="geometry">
<rect>
<x>0</x>
<y>279</y>
<width>451</width>
<height>61</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">font: 24pt &quot;Arial Black&quot;;
color: #7fa0d3;</string>
</property>
<property name="text">
<string>Launch</string>
</property>
</widget>
<widget class="QTabWidget" name="tabWidget">
<property name="geometry">
<rect>
<x>-10</x>
<y>0</y>
<width>471</width>
<height>281</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>451</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">#tabMain{
background-image: url(:/imgs/iol.png);
background-repeat: no-repeat;
background-position:center center;
}
QTabBar::tab{
width: 150px;
}
QTabWidget::tab-bar{
alignment: center;
}</string>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tabMain">
<property name="minimumSize">
<size>
<width>445</width>
<height>0</height>
</size>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<attribute name="title">
<string>Launch</string>
</attribute>
</widget>
<widget class="QWidget" name="tabSettings">
<attribute name="title">
<string>Settings</string>
</attribute>
<widget class="QRadioButton" name="rbDefault">
<property name="geometry">
<rect>
<x>110</x>
<y>40</y>
<width>91</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Default</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="QComboBox" name="cbResolution">
<property name="geometry">
<rect>
<x>90</x>
<y>10</y>
<width>141</width>
<height>24</height>
</rect>
</property>
<item>
<property name="text">
<string>Default</string>
</property>
</item>
<item>
<property name="text">
<string>Native</string>
</property>
</item>
<item>
<property name="text">
<string>320x240</string>
</property>
</item>
<item>
<property name="text">
<string>400x300</string>
</property>
</item>
<item>
<property name="text">
<string>512x384</string>
</property>
</item>
<item>
<property name="text">
<string>640x480</string>
</property>
</item>
<item>
<property name="text">
<string>800x600</string>
</property>
</item>
<item>
<property name="text">
<string>960x720</string>
</property>
</item>
<item>
<property name="text">
<string>1024x768</string>
</property>
</item>
<item>
<property name="text">
<string>1152x864</string>
</property>
</item>
<item>
<property name="text">
<string>1280x1024</string>
</property>
</item>
<item>
<property name="text">
<string>1600x1200</string>
</property>
</item>
<item>
<property name="text">
<string>2048x1536</string>
</property>
</item>
<item>
<property name="text">
<string>856x480(16:9)</string>
</property>
</item>
<item>
<property name="text">
<string>1280x720(16:9)</string>
</property>
</item>
<item>
<property name="text">
<string>1920x1080(16:9)</string>
</property>
</item>
<item>
<property name="text">
<string>1280x800(16:10)</string>
</property>
</item>
</widget>
<widget class="QSpinBox" name="sbHeight">
<property name="geometry">
<rect>
<x>350</x>
<y>10</y>
<width>61</width>
<height>25</height>
</rect>
</property>
<property name="maximum">
<number>100000</number>
</property>
</widget>
<widget class="QRadioButton" name="rbWin">
<property name="geometry">
<rect>
<x>310</x>
<y>40</y>
<width>121</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Windowed</string>
</property>
</widget>
<widget class="QSpinBox" name="sbWidth">
<property name="geometry">
<rect>
<x>260</x>
<y>10</y>
<width>61</width>
<height>25</height>
</rect>
</property>
<property name="maximum">
<number>100000</number>
</property>
</widget>
<widget class="QLabel" name="label_6">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>81</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Resolution</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>10</x>
<y>34</y>
<width>111</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Screen Mode</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>240</x>
<y>10</y>
<width>16</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>W</string>
</property>
</widget>
<widget class="QRadioButton" name="rbFull">
<property name="geometry">
<rect>
<x>200</x>
<y>40</y>
<width>111</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>FullScreen</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>330</x>
<y>10</y>
<width>16</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>H</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="tabRend2">
<attribute name="title">
<string>Rend2</string>
</attribute>
</widget>
</widget>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>
<include location="imgs.qrc"/>
</resources>
<connections/>
</ui>