// UnitColorView
//---------------------------------------------------------------------------
UnitColorView::UnitColorView() : View()
{
    setSearchName("UnitColorView");
    setTitle("Selects Your Unit Color");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);

    Surface unitSurface;

    moveTo(400, 200);

    packedBody.load("units/pics/pak/TitaHNSD.pak");
    packedBody.setFPS(12);

    packedTurret.load("units/pics/pak/TitaTNSD.pak");
    packedTurret.setFPS(8);

    grassSurface.loadBMP("pics/grass.bmp");

    fuckingSurface.create(packedTurret.getWidth(), packedTurret.getHeight(), 1);
    fuckingSurface.fill(0);

    resizeClientArea(packedTurret.getWidth(), packedTurret.getHeight());

    int size = packedTurret.getWidth() / 2;
    addButtonCenterText(iXY(0, 0), size, "Up", "", bIncreaseBrightness);
    addButtonCenterText(iXY(size, 0), size, "Down", "", bDecreaseBrightness);

    setGrayColorTable();
    rebuildGrayColorTable();

} // end UnitColorView::UnitColorView
示例#2
0
// RankView
//---------------------------------------------------------------------------
RankView::RankView() : GameTemplateView()
{
    setSearchName("RankView");
    setTitle("Rankings");
    setSubTitle(" - TAB");

    setAllowResize(false);
    moveTo(GameConfig::interface_rankposition_x, GameConfig::interface_rankposition_y);
    resize(iXY(WINDOW_WIDTH, 200));
    checkArea(iXY(screen->getWidth(),screen->getHeight()));

    // Define the scrollBar fot this view.
    scrollBar = new ScrollBar(ScrollBar::VERTICAL, 0, 1, 0, 100);
    if (scrollBar == 0) {
        throw Exception("ERROR: Unable to allocate the scrollBar.");
    }

    allyImage.loadBMP("pics/default/ally.bmp");
    allyRequestImage.loadBMP("pics/default/allyRequest.bmp");
    allyOtherImage.loadBMP("pics/default/allyOther.bmp");
    noAllyImage.loadBMP("pics/default/noAlly.bmp");
    colorImage.loadBMP("pics/default/playerColor.bmp");

    selected_line = -1;

} // end RankView::RankView
示例#3
0
// reset
//---------------------------------------------------------------------------
// Purpose: Reset all the settings for this window.
//---------------------------------------------------------------------------
void View::reset()
{
    min.zero();
    max.zero();
    status                =  0;
    searchName            = 0;
    title                 = 0;
    subTitle              = 0;
    statusText            = 0;
    focusComponent        = 0;

    setSearchName("donut");
    setTitle("donut");
    setSubTitle("donut");

    removeComponents();

    moveAreaHeight  = DEFAULT_MOVE_AREA_HEIGHT;
    borderSize      = DEFAULT_BORDER_SIZE;
    snapToTolerance = DEFAULT_SNAP_TOLERANCE;

    setAllowResize(true);
    setAllowMove(true);
    setBordered(true);
    setVisible(false);
    setDisplayStatusBar(false);
    setAlwaysOnBottom(false);

    //setScrollBar(false);
} // end reset
// UnitSelectionView
//---------------------------------------------------------------------------
UnitSelectionView::UnitSelectionView() : View()
{
    setSearchName("UnitSelectionView");
    setTitle("Selects Your Units");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setDisplayStatusBar(true);
    setVisible(false);

    moveTo(bodyTextRect.min);

    resize(bodyTextRect.getSize());

    //setScrollBar(true);

    maxYOffset =  0;

    // Define the scrollBar fot this view.
    scrollBar = new ScrollBar(HORIZONTAL, 0, 1, 0, 100);

    add(scrollBar);

} // end UnitSelectionView::UnitSelectionView
EndRoundView::EndRoundView() : SpecialButtonView()
{
    setSearchName("EndRoundView");
    setTitle("Round stats");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);
    setBordered(false);

    int x = (screen->getWidth() / 2) - 250;
    int y = (screen->getHeight() / 2) - 250;
    moveTo(iXY(x, y));
    resize(iXY(500, 500));
    checkArea(iXY(screen->getWidth(),screen->getHeight()));

    allyImage.loadBMP("pics/default/ally.bmp");
    allyRequestImage.loadBMP("pics/default/allyRequest.bmp");
    allyOtherImage.loadBMP("pics/default/allyOther.bmp");
    noAllyImage.loadBMP("pics/default/noAlly.bmp");
    colorImage.loadBMP("pics/default/playerColor.bmp");

    selected_line = -1;
    RectWinner = getClientRect();
    RectWinner.min.x = RectWinner.min.y = 0;
    RectStates = RectWinner;
    RectWinner.max.y = HEADER_HEIGHT-10;
    RectStates.min.y = HEADER_HEIGHT;

} // end EndRoundView::EndRoundView
示例#6
0
RunningScriptsWidget::RunningScriptsWidget(QWidget* parent) :
    FramelessDialog(parent, 0, POSITION_LEFT),
    ui(new Ui::RunningScriptsWidget) {
    ui->setupUi(this);

    setAllowResize(false);

    ui->hideWidgetButton->setIcon(QIcon(Application::resourcesPath() + "images/close.svg"));
    ui->reloadAllButton->setIcon(QIcon(Application::resourcesPath() + "images/reload.svg"));
    ui->stopAllButton->setIcon(QIcon(Application::resourcesPath() + "images/stop.svg"));
    ui->loadScriptButton->setIcon(QIcon(Application::resourcesPath() + "images/plus-white.svg"));

    _runningScriptsTable = new ScriptsTableWidget(ui->runningScriptsTableWidget);
    _runningScriptsTable->setColumnCount(2);
    _runningScriptsTable->setColumnWidth(0, 245);
    _runningScriptsTable->setColumnWidth(1, 22);
    connect(_runningScriptsTable, &QTableWidget::cellClicked, this, &RunningScriptsWidget::stopScript);

    _recentlyLoadedScriptsTable = new ScriptsTableWidget(ui->recentlyLoadedScriptsTableWidget);
    _recentlyLoadedScriptsTable->setColumnCount(1);
    _recentlyLoadedScriptsTable->setColumnWidth(0, 265);
    connect(_recentlyLoadedScriptsTable, &QTableWidget::cellClicked,
            this, &RunningScriptsWidget::loadScript);

    connect(ui->hideWidgetButton, &QPushButton::clicked,
            Application::getInstance(), &Application::toggleRunningScriptsWidget);
    connect(ui->reloadAllButton, &QPushButton::clicked,
            Application::getInstance(), &Application::reloadAllScripts);
    connect(ui->stopAllButton, &QPushButton::clicked,
            this, &RunningScriptsWidget::allScriptsStopped);
    connect(ui->loadScriptButton, &QPushButton::clicked,
            Application::getInstance(), &Application::loadDialog);
}
// LibView
//---------------------------------------------------------------------------
LibView::LibView() : GameTemplateView()
{
    setSearchName("LibView");
    setTitle("Lib Stats");
    setSubTitle(" - F5");

    setAllowResize(false);
    setAllowMove(true);
    setDisplayStatusBar(false);
    setVisible(false);

    moveTo(0, 0);
    resize(325, 375);

    addButtonCenterText(iXY((getClientRect().getSize().x / 3) * 0, 0), getClientRect().getSize().x / 3, "Surface", "", bSurfaceInfo);
    addButtonCenterText(iXY((getClientRect().getSize().x / 3) * 1, 0), getClientRect().getSize().x / 3, "Particles", "", bParticleInfo);
    addButtonCenterText(iXY((getClientRect().getSize().x / 3) * 2, 0), getClientRect().getSize().x / 3, "Environment", "", bEnvironmentInfo);

    checkBoxAllowParticleGeneration.setLabel("Allow Particle Generation");
    checkBoxAllowParticleGeneration.setLocation(0, 15);
    checkBoxAllowParticleGeneration.setState(Particle2D::getCreateParticles());
    add(&checkBoxAllowParticleGeneration);

    checkBoxAllowTimeSlice.setLabel("Allow Time Slice");
    checkBoxAllowTimeSlice.setLocation(0, 30);
    checkBoxAllowTimeSlice.setState(gTimeSliceFlag);
    add(&checkBoxAllowTimeSlice);

    checkBoxAllowSpanBlitting.setLabel("Allow Blended Span Blitting");
    checkBoxAllowSpanBlitting.setLocation(0, 45);
    checkBoxAllowSpanBlitting.setState(allowSpanBlitting);
    add(&checkBoxAllowSpanBlitting);

    checkBoxParticlesCanHaveSmoke.setLabel("Allow Explosion Particle Smoke");
    checkBoxParticlesCanHaveSmoke.setLocation(0, 60);
    checkBoxParticlesCanHaveSmoke.setState(ParticleInterface::gParticlesCanHaveSmoke);
    add(&checkBoxParticlesCanHaveSmoke);

    checkBoxSolidColorExplosionParticles.setLabel("Solid Color Explosion Particles");
    checkBoxSolidColorExplosionParticles.setLocation(0, 75);
    checkBoxSolidColorExplosionParticles.setState(ParticleInterface::gSolidColorExplosionParticles);
    add(&checkBoxSolidColorExplosionParticles);

    checkBoxParticleInterfaceSim.setLabel("Particle Interface Sim");
    checkBoxParticleInterfaceSim.setLocation(0, 90);
    checkBoxParticleInterfaceSim.setState(ParticleInterface::gTestSim);
    add(&checkBoxParticleInterfaceSim);

    checkBoxSolidBackground.setLabel("Solid Background");
    checkBoxSolidBackground.setLocation(0, 105);
    checkBoxSolidBackground.setState(GameView::gDrawSolidBackground);
    add(&checkBoxSolidBackground);

    checkBoxDrawExplosionParticleCount.setLabel("Draw Explosion Particle Count");
    checkBoxDrawExplosionParticleCount.setLocation(0, 120);
    checkBoxDrawExplosionParticleCount.setState(ParticleInterface::gDrawExplosionParticleCount);
    add(&checkBoxDrawExplosionParticleCount);

} // end LibView::LibView
IRCLobbyView::IRCLobbyView() 
    : View()
{
    lobby_connection=0;
    change_name=0;
    skipChatLines=0;
    lobby_view_height=184;
    total_displayed_servers=0;
    setSearchName("IRCLobbyView");
    setTitle("Lobby");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);
    topViewableItem=0;

    moveTo(iXY(bodyTextRect.max.x-440, bodyTextRect.min.y + 170));

    iXY  area_size = iXY(440, lobby_view_height);
    resizeClientArea(area_size);

    int chat_y=lobby_view_height-(Surface::getFontHeight()*2);
    addButtonCenterText(iXY(getClientRect().getSizeX()-80, chat_y), 80,  "Refresh", "", buttonRefresh);
    szChat.init("  ", 255,39);
    cInputField* input = addInputField(iXY(4, chat_y), &szChat, "", true);
    input->setReturnAction(chatReturnPressed);

    server_list_end_y=(Surface::getFontHeight()*6);
    chat_list_end_y=getClientRect().getSizeY()-(Surface::getFontHeight()*2);
    server_list_end_x=(getClientRect().getSizeX()-12);

    iXY size(12, 12);
    iXY pos(getClientRect().getSizeX() - size.x, 0);
    serverUpButton.setLabel("-");
    serverUpButton.setBounds(iRect(pos, pos + size));
    add(&serverUpButton);

    pos.y= server_list_end_y-size.y;
    serverDownButton.setLabel("+");
    serverDownButton.setBounds(iRect(pos, pos + size));
    add(&serverDownButton);

    pos.y+=size.y;
    chatUpButton.setLabel("-");
    chatUpButton.setBounds(iRect(pos, pos + size));
    add(&chatUpButton);

    pos.y = chat_list_end_y-size.y;
    chatDownButton.setLabel("+");
    chatDownButton.setBounds(iRect(pos, pos + size));
    add(&chatDownButton);

    // XXX ugly ugly ugly
    if(!lobby_view)
        lobby_view = this;
} 
// ImageSelectorView
//---------------------------------------------------------------------------
ImageSelectorView::ImageSelectorView() : cView()
{
    setTitle("Image Selector View");
    setAllowResize(false);
    setDisplayStatusBar(false);
    setVisible(false);
    setAllowMove(false);
    setBordered(false);

    reset();

} // end ImageSelectorView::ImageSelectorView
ParticleTweakView::ParticleTweakView() : View()
{
    setTitle("ParticleTweakView");
    setAllowResize(false);
    setAllowMove(true);
    setDisplayStatusBar(true);
    setVisible(false);

    moveTo(0, 0);
    resizeClientArea(640, 480);

} // end ParticleTweakView::ParticleTweakView
GFlagSelectionView::GFlagSelectionView() : View()
{
    setSearchName("GFlagSelectionView");
    setTitle("GFlag Selection");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);
    setBordered(false);

    loaded = false;
}
CodeStatsView::CodeStatsView() : GameTemplateView()
{
    setSearchName("CodeStatsView");
    setTitle("CodeStatsView");
    setSubTitle(" - F4");

    setAllowResize(false);
    setAllowMove(true);
    setDisplayStatusBar(true);
    setVisible(false);

    moveTo(iXY(0, 0));

    iXY  area_size = iXY(280, 280) ;
    long bXOffset;
    INFO_AREA_Y_OFFSET = 2;

    resizeClientArea(area_size);

    bXOffset = area_size.x / 3;
    addButtonCenterText(iXY(0, INFO_AREA_Y_OFFSET), bXOffset,  "Net", "", buttonNetwork);
    addButtonCenterText(iXY(bXOffset, INFO_AREA_Y_OFFSET), bXOffset, "Sprite", "", buttonSorter);
    addButtonCenterText(iXY(bXOffset*2, INFO_AREA_Y_OFFSET), bXOffset, "Unit", "", buttonUnit);

    INFO_AREA_Y_OFFSET += 18;
    addButtonCenterText(iXY(0, INFO_AREA_Y_OFFSET), area_size.x, "Path", "", buttonPathing);

    INFO_AREA_Y_OFFSET += 18;
    bXOffset = area_size.x / 3;
    addButtonCenterText(iXY(0, INFO_AREA_Y_OFFSET), bXOffset,  "Debug", "", buttonDebug);
    addButtonCenterText(iXY(bXOffset, INFO_AREA_Y_OFFSET), bXOffset, "Sample", "", buttonSample);
    addButtonCenterText(iXY(bXOffset*2, INFO_AREA_Y_OFFSET), bXOffset, "NetLog", "", bNetLog );

    INFO_AREA_Y_OFFSET += 18;
    /*
       addButtonCenterText(iXY(0, INFO_AREA_Y_OFFSET), 20, "+", "", bPlusPacketSize );
    addButtonCenterText(iXY(25, INFO_AREA_Y_OFFSET), 20, "-", "", bMinusPacketSize );
    addButtonCenterText(iXY(50, INFO_AREA_Y_OFFSET), 20, "0", "", bMinusPacketSize );
    addButtonCenterText(iXY(65, INFO_AREA_Y_OFFSET), 20, "1", "", bMinusPacketSize );

    addButtonCenterText(iXY(45, INFO_AREA_Y_OFFSET), 40, "Send", "", bSend );

       INFO_AREA_Y_OFFSET += 18;
       INFO_AREA_Y_OFFSET += 18;
       */

    display_mode = _display_mode_network_stats;

} // end CodeStatsView::CodeStatsView
示例#13
0
// RankView
//---------------------------------------------------------------------------
RankView::RankView() : GameTemplateView()
{
	setSearchName("RankView");
	setTitle("Rankings");
	setSubTitle(" - F6");

	setAllowResize(false);
	moveTo(iXY(0, 0));
	resize(iXY(450, 200));
	centerAbsolute();

	const unsigned MAX_NAME_CHARS      = 20;
	const unsigned MAX_FLAG_CHARS      =  5;
	const unsigned MAX_KILLS_CHARS     =  6;
	const unsigned MAX_LOSSES_CHARS    =  7;
	const unsigned MAX_POINTS_CHARS    =  7;
	const unsigned MAX_OBJECTIVE_CHARS = 10;

	//addLabel(iXY nPos, char *nLabel, BYTE color);
	unsigned xOffset = 0;
	unsigned yOffset = 16;
	addLabel(iXY(xOffset, yOffset), "Name", Color::red);
	xOffset += MAX_NAME_CHARS*CHAR_XPIX;
	addLabel(iXY(xOffset, yOffset), "Flag", Color::red);
	xOffset += MAX_FLAG_CHARS*CHAR_XPIX;
	addLabel(iXY(xOffset, yOffset), "Kills", Color::red);
	xOffset += MAX_KILLS_CHARS*CHAR_XPIX;
	addLabel(iXY(xOffset, yOffset), "Losses", Color::red);
	xOffset += MAX_LOSSES_CHARS*CHAR_XPIX;
	addLabel(iXY(xOffset, yOffset), "Points", Color::red);
	xOffset += MAX_POINTS_CHARS*CHAR_XPIX;
	addLabel(iXY(xOffset, yOffset), "Objective", Color::red);
	xOffset += MAX_POINTS_CHARS*CHAR_XPIX;

	// Define the scrollBar fot this view.
	scrollBar = new ScrollBar(VERTICAL, 0, 1, 0, 100);
	if (scrollBar == 0)
	{
		throw Exception("ERROR: Unable to allocate the scrollBar.");
	}

	//iRect clientRect(getClientRect());
	//scrollBar->setViewableAmount(clientRect.getSizeY() / (TEXT_GAP_SPACE + CHAR_YPIX) - 1);
	//scrollBar->setBlockIncrement(1);

	//add(scrollBar);

} // end RankView::RankView
示例#14
0
// init
//---------------------------------------------------------------------------
void GameView::init()
{
    setSearchName("GameView");
    setTitle("Game");
    setSubTitle("");

    setBordered(false);
    setAlwaysOnBottom(true);
    setAllowResize(false);
    setDisplayStatusBar(false);
    setVisible(false);

    moveTo(iXY(0, 0));
    resize(iXY(screen->getPixX(), screen->getPixY()));

} // end GameView::init
// init
//---------------------------------------------------------------------------
void AreYouSureResignView::init()
{
    setBordered(false);
    setAllowResize(false);
    setDisplayStatusBar(false);

    moveTo(iXY(0, 0));
    resize(iXY(800, 600));

    int x = (getClientRect().getSize().x - (141 * 2 + 20)) / 2;
    int y = getClientRect().getSize().y/2 + 30;
    add( Button::createTextButton( _("YES"), iXY(x, y), 137, ActionManager::getAction("disconnect")));
    x += 141 + 10;
    add( Button::createTextButton( _("NO"), iXY(x, y), 137, ActionManager::getAction("hide_confirmdisconnect")));
    loaded = true;
} // end AreYouSureResignView::init
// HostOptionsView
//---------------------------------------------------------------------------
HostOptionsView::HostOptionsView() : RMouseHackView()
{
    setSearchName("HostOptionsView");
    setTitle("Host Options");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);

    moveTo(bodyTextRect.min.x, bodyTextRect.min.y + 205);
    resizeClientArea(bodyTextRect.getSizeX()-5, 168);

    addMeterButtons(iXY(BORDER_SPACE, BORDER_SPACE));

} // end HostOptionsView::HostOptionsView
void
DisconectedView::init()
{
    removeAllButtons();

    setBordered(true);
    setAllowResize(false);

    resize(screen->getWidth(),screen->getHeight());
    moveTo(0,0);

    int bsize = Surface::getTextLength(" ") * 8;
    addButtonCenterText(iXY((getClientRect().getSizeX()/2)-(bsize/2),
                (getClientRect().getSizeY()/2)+(Surface::getFontHeight() * 2)),
                bsize, "Ok", "", buttonOk);
}
示例#18
0
// init
//---------------------------------------------------------------------------
void GameView::init()
{
    setSearchName("GameView");
    setTitle("Game");
    setSubTitle("");

    setBordered(false);
    setAlwaysOnBottom(true);
    setAllowResize(false);
    setDisplayStatusBar(false);
    setVisible(false);

    moveTo(iXY(0, 0));
    resize(iXY(SCREEN_XPIX, SCREEN_YPIX));

} // end GameView::init
// MiniMapView
//---------------------------------------------------------------------------
MiniMapView::MiniMapView() : GameTemplateView()
{
    assert(this != 0);

    setSearchName("MiniMapView");
    setTitle("MiniMapView");
    setSubTitle("");
    setAllowResize(false);
    setDisplayStatusBar(false);
    setVisible(false);
    setAllowMove(true);

    setBordered(false);
    
    resize(160, 160);
    add(new MiniMap(1,1,158,158));
} // end MiniMapView::MiniMapView
// MiniMapView
//---------------------------------------------------------------------------
MiniMapView::MiniMapView() : GameTemplateView()
{
    assert(this != 0);

    setSearchName("MiniMapView");
    setTitle("MiniMapView");
    setSubTitle("");
    setAllowResize(false);
    setDisplayStatusBar(false);
    setVisible(false);

    setBordered(false);

    add(CLOSE_VIEW_BUTTON);
    add(MINMAX_VIEW_BUTTON);

} // end MiniMapView::MiniMapView
示例#21
0
RunningScriptsWidget::RunningScriptsWidget(QWidget* parent) :
    FramelessDialog(parent, 0, POSITION_LEFT),
    ui(new Ui::RunningScriptsWidget),
    _signalMapper(this),
    _proxyModel(this),
    _scriptsModel(this) {
    ui->setupUi(this);

    setAttribute(Qt::WA_DeleteOnClose, false);

    setAllowResize(false);

    ui->hideWidgetButton->setIcon(QIcon(Application::resourcesPath() + "images/close.svg"));
    ui->reloadAllButton->setIcon(QIcon(Application::resourcesPath() + "images/reload.svg"));
    ui->stopAllButton->setIcon(QIcon(Application::resourcesPath() + "images/stop.svg"));
    ui->loadScriptButton->setIcon(QIcon(Application::resourcesPath() + "images/plus-white.svg"));

    ui->recentlyLoadedScriptsArea->hide();

    ui->filterLineEdit->installEventFilter(this);

    connect(&_proxyModel, &QSortFilterProxyModel::modelReset,
            this, &RunningScriptsWidget::selectFirstInList);

    _proxyModel.setSourceModel(&_scriptsModel);
    _proxyModel.sort(0, Qt::AscendingOrder);
    _proxyModel.setDynamicSortFilter(true);
    ui->scriptListView->setModel(&_proxyModel);

    connect(ui->filterLineEdit, &QLineEdit::textChanged, this, &RunningScriptsWidget::updateFileFilter);
    connect(ui->scriptListView, &QListView::doubleClicked, this, &RunningScriptsWidget::loadScriptFromList);

    _recentlyLoadedScriptsTable = new ScriptsTableWidget(ui->recentlyLoadedScriptsTableWidget);
    _recentlyLoadedScriptsTable->setColumnCount(1);
    _recentlyLoadedScriptsTable->setColumnWidth(0, 265);

    connect(ui->hideWidgetButton, &QPushButton::clicked,
            Application::getInstance(), &Application::toggleRunningScriptsWidget);
    connect(ui->reloadAllButton, &QPushButton::clicked,
            Application::getInstance(), &Application::reloadAllScripts);
    connect(ui->stopAllButton, &QPushButton::clicked,
            this, &RunningScriptsWidget::allScriptsStopped);
    connect(ui->loadScriptButton, &QPushButton::clicked,
            Application::getInstance(), &Application::loadDialog);
    connect(&_signalMapper, SIGNAL(mapped(QString)), Application::getInstance(), SLOT(stopScript(const QString&)));
}
// GetSessionHostView
//---------------------------------------------------------------------------
GetSessionHostView::GetSessionHostView() : View()
{
	setSearchName("GetSessionHostView");
	setTitle("Select Session Host");
	setSubTitle("");

	setAllowResize(false);
	setAllowMove(false);
	//setDisplayStatusBar(true);
	setVisible(false);

	moveTo(bodyTextRect.min.x, bodyTextRect.min.y + 190);
	resizeClientArea(bodyTextRect.getSizeX(), 158);
	//moveTo(68, 204);
	//resize(610 - 68, 161);

	//setScrollBar(true);

	viewableItemCount =  0;
	highlightedItem   = -1;
	selectedItem      = -1;

	maxYOffset = 0;

	// Define the scrollBar fot this view.
	//scrollBar = new ScrollBar(VERTICAL, 0, 1, 0, 100);

	//add(scrollBar);

	maxViewableItems = getClientRect().getSizeY() / (TEXT_GAP_SPACE + CHAR_YPIX) - 1;
	topViewableItem  = 0;

	iXY size(20, 20);
	iXY pos(getClientRect().getSizeX() - size.x, 0);

	//upButton.setLabel("+");
	//upButton.setBounds(iRect(pos, pos + size));
	//add(&upButton);
	//
	//pos = iXY(getClientRect().getSizeX() - size.x, getClientRect().getSizeY() - size.y);
	//downButton.setLabel("-");
	//downButton.setBounds(iRect(pos, pos + size));
	//add(&downButton);

} // end GetSessionHostView constructor
void
LoadingView::init()
{
    setSearchName("LoadingView");
    setTitle("Loading Progress");
    setSubTitle("");
    
    setAllowResize(false);
    setAllowMove(false);
    setDisplayStatusBar(false);
    setVisible(false);
    setBordered(false);

    resize(640, 480);
    
    addButtonCenterText(iXY(628 - 60, 302 - 15), 60, "Abort", "Cancel the joining of this game.", bAbort);
    
}
// IPAddressView
//---------------------------------------------------------------------------
IPAddressView::IPAddressView() : View()
{
    setSearchName("IPAddressView");
    setTitle("Server IP Address");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);

    moveTo(iXY(bodyTextRect.min.x, bodyTextRect.min.y + 50));

    iXY  area_size = iXY(
            30 * 8 + 16,
            Surface::getFontHeight() + 4 + 8);
    resizeClientArea(area_size);

    Init();
} // end IPAddressView constructor
示例#25
0
// MapSelectionView
//---------------------------------------------------------------------------
MapSelectionView::MapSelectionView() : RMouseHackView()
{
    setSearchName("MapSelectionView");
    setTitle(_("Map Selection"));
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);

    moveTo(bodyTextRect.min.x, bodyTextRect.min.y + 50);

    resizeClientArea(bodyTextRect.getSizeX() / 2 - 10 + 30, MAP_SIZE + BORDER_SPACE * 2);

    curMap = -1;
    
    init();

} // end MapSelectionView::MapSelectionView
// PlayerNameView
//---------------------------------------------------------------------------
PlayerNameView::PlayerNameView() : View()
{
    setSearchName("PlayerNameView");
    setTitle("Player Name");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);

    moveTo(bodyTextRect.min);

    // The plus 8 for x and 4 for y are what I put in input field.  Add function to find out,
    // inpit field dimension.
    int CHAR_XPIX = 8; // XXX hardcoded :-/
    resizeClientArea((INPUT_FIELD_CHARACTERS+1) * CHAR_XPIX + 8 + BORDER_SPACE * 2, Surface::getFontHeight() + 4 + BORDER_SPACE * 2);

    init();
} // end PlayerNameView::PlayerNameView
// PlayerNameView
//---------------------------------------------------------------------------
PlayerNameView::PlayerNameView() : View()
{
    setSearchName("PlayerNameView");
    setTitle("Player Name");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);

    moveTo(bodyTextRect.min);

    // The plus 8 for x and 4 for y are what I put in input field.  Add function to find out,
    // inpit field dimension.
    resizeClientArea(INPUT_FIELD_CHARACTERS * CHAR_XPIX + 8 + BORDER_SPACE * 2, CHAR_YPIX + 4 + BORDER_SPACE * 2);

    init();

} // end PlayerNameView::PlayerNameView
示例#28
0
// RankView
//---------------------------------------------------------------------------
RankView::RankView() : GameTemplateView()
{
    setSearchName("RankView");
    setTitle("Rankings");
    setSubTitle(" - TAB");

    setAllowResize(false);
    moveTo(gameconfig->rankposition);
    resize(iXY(450, 200));
    checkArea(iXY(screen->getWidth(),screen->getHeight()));

    const unsigned MAX_NAME_CHARS      = 20;
    const unsigned MAX_FLAG_CHARS      =  5;
    const unsigned MAX_KILLS_CHARS     =  6;
    const unsigned MAX_LOSSES_CHARS    =  7;
    const unsigned MAX_POINTS_CHARS    =  7;

    // hardcoded for now
    int CHAR_XPIX = 8;

    //addLabel(iXY nPos, char *nLabel, Uint8 color);
    unsigned xOffset = 0;
    unsigned yOffset = 16;
    addLabel(iXY(xOffset, yOffset), "Name", Color::red);
    xOffset += MAX_NAME_CHARS*CHAR_XPIX;
    addLabel(iXY(xOffset, yOffset), "Flag", Color::red);
    xOffset += MAX_FLAG_CHARS*CHAR_XPIX;
    addLabel(iXY(xOffset, yOffset), "Kills", Color::red);
    xOffset += MAX_KILLS_CHARS*CHAR_XPIX;
    addLabel(iXY(xOffset, yOffset), "Losses", Color::red);
    xOffset += MAX_LOSSES_CHARS*CHAR_XPIX;
    addLabel(iXY(xOffset, yOffset), "Points", Color::red);
    xOffset += MAX_POINTS_CHARS*CHAR_XPIX;
    addLabel(iXY(xOffset, yOffset), "Objective", Color::red);
    xOffset += MAX_POINTS_CHARS*CHAR_XPIX;

    // Define the scrollBar fot this view.
    scrollBar = new ScrollBar(ScrollBar::VERTICAL, 0, 1, 0, 100);
    if (scrollBar == 0) {
        throw Exception("ERROR: Unable to allocate the scrollBar.");
    }
} // end RankView::RankView
示例#29
0
// GameView
//---------------------------------------------------------------------------
GameView::GameView() : View()
{
    setSearchName("GameView");
    setTitle("Game");
    setSubTitle("");

    setBordered(false);
    setAlwaysOnBottom(true);
    setAllowResize(false);
    setDisplayStatusBar(false);
    setVisible(false);

    resize(640,480);
    moveTo(iXY(0, 0));

    add(new InfoBar(0,0));
    // will add after input handling is done
    //add(new MiniMap(100,100));

} // end GameView::GameView
// GameInfoView
//--------------------------------------------------------------------------
GameInfoView::GameInfoView() : GameTemplateView()
{
    setSearchName("GameInfoView");
    setTitle("Information");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setDisplayStatusBar(false);
    setVisible(false);
    setBordered(true);

    moveTo(iXY(0, 0));
    //resizeClientArea(iXY(100, 2 * 2 + 12 * 3 + 8));
    resizeClientArea(iXY(140, 2 * 2 + 12 * 5 + 8));

    // Start it in the top-left corner.
    moveTo(iXY(10000, 0));

} // end GameInfoView::GameInfoView