/// Konstruktor von @p iwBuildingProductivities.
iwBuildingProductivities::iwBuildingProductivities()
    : IngameWindow(CGI_BUILDINGSPRODUCTIVITY, 0xFFFE, 0xFFFE,
                   left_x + 2 * percent_width + 2 * image_percent_x + percent_image_x + right_x,
                   top_y + (BUILDINGS_COUNT / 2 + 1) * (distance_y + 1), _("Productivity"), LOADER.GetImageN("resource", 41)),
    percents(40, 0)
{
    for(unsigned y = 0; y < BUILDINGS_COUNT / 2 + BUILDINGS_COUNT % 2; ++y)
    {
        for(unsigned x = 0; x < 2; ++x)
        {
            if(y * 2 + x < BUILDINGS_COUNT)
            {
				if(bts[y*2+x]!=BLD_CHARBURNER)
					AddImage((y * 2 + x) * 2, left_x + x * (percent_image_x + percent_width + image_percent_x), top_y + distance_y * y + percent_height / 2,LOADER.GetImageN(NATION_ICON_IDS[GameClient::inst().GetLocalPlayer()->nation], bts[y * 2 + x]), _(BUILDING_NAMES[bts[y * 2 + x]]));
				else
					AddImage((y * 2 + x) * 2, left_x + x * (percent_image_x + percent_width + image_percent_x), top_y + distance_y * y + percent_height / 2,LOADER.GetImageN("charburner", GameClient::inst().GetLocalPlayer()->nation * 8 + 8), _(BUILDING_NAMES[bts[y * 2 + x]]));

                AddPercent((y * 2 + x) * 2 + 1, left_x + image_percent_x + x * (percent_image_x + percent_width + image_percent_x), top_y + distance_y * y,
                           percent_width, percent_height, TC_GREY, COLOR_YELLOW, SmallFont, &percents[bts[y * 2 + x]]);
            }
        }
    }

    UpdatePercents();

    // Hilfe-Button
    AddImageButton(500, width - 14 - 30, height - 20 - 32, 30, 32, TC_GREY, LOADER.GetImageN("io", 21), _("Help"));
}
Ejemplo n.º 2
0
/**
 *  Konstruktor von @p iwMilitaryBuilding.
 *
 *  @author OLiver
 */
iwMilitaryBuilding::iwMilitaryBuilding(GameWorldViewer* const gwv, dskGameInterface* const gi, nobMilitary* const building)
    : IngameWindow(building->CreateGUIID(), (unsigned short) - 2, (unsigned short) - 2, 226, 194, _(BUILDING_NAMES[building->GetBuildingType()]), LOADER.GetImageN("resource", 41)),
      building(building),gi(gi), gwv(gwv)
{
    // Schwert
    AddImage(0, 28, 39, LOADER.GetMapImageN(2298));
    AddImage(1, 28, 39, LOADER.GetMapImageN(2250 + GD_SWORD));

    // Schild
    AddImage(2, 196, 39, LOADER.GetMapImageN(2298));
    AddImage(3, 196, 39, LOADER.GetMapImageN(2250 + GD_SHIELDROMANS));

    // Hilfe
    AddImageButton(4,  16, 147, 30, 32, TC_GREY, LOADER.GetImageN("io",  21));
    // Abreißen
    AddImageButton(5,  50, 147, 34, 32, TC_GREY, LOADER.GetImageN("io",  23));
    // Gold an/aus (227,226)
    AddImageButton(6,  90, 147, 32, 32, TC_GREY, LOADER.GetImageN("io", ((building->IsGoldDisabledVirtual()) ? 226 : 227)));
    // "Gehe Zu Ort"
    AddImageButton(7, 179, 147, 30, 32, TC_GREY, LOADER.GetImageN("io", 107), _("Go to place"));

    // Gebäudebild
    AddImage(8, 117, 114, LOADER.GetNationImageN(building->GetNation(), 250 + 5 * building->GetBuildingType()));
	// "Go to next" (building of same type)
    AddImageButton( 9, 179, 115, 30, 32, TC_GREY, LOADER.GetImageN("io", 107), _("Go to next military building"));
	//addon military control active? -> show button
	if(GAMECLIENT.GetGGS().isEnabled(ADDON_MILITARY_CONTROL))
		AddImageButton( 10, 124, 147, 30, 32, TC_GREY, LOADER.GetImageN("io_new", 4), _("Send max rank soldiers to a warehouse"));
}
Ejemplo n.º 3
0
void CPDF_StreamContentParser::Handle_ExecuteXObject() {
  CFX_ByteString name = GetString(0);
  if (name == m_LastImageName && m_pLastImage && m_pLastImage->GetStream() &&
      m_pLastImage->GetStream()->GetObjNum()) {
    AddImage(nullptr, m_pLastImage, FALSE);
    return;
  }

  if (m_Options.m_bTextOnly) {
    if (!m_pResources)
      return;

    CPDF_Dictionary* pList = m_pResources->GetDict("XObject");
    if (!pList && m_pPageResources && m_pResources != m_pPageResources)
      pList = m_pPageResources->GetDict("XObject");
    if (!pList)
      return;
    CPDF_Reference* pRes = ToReference(pList->GetElement(name));
    if (!pRes)
      return;

    FX_BOOL bForm;
    if (m_pDocument->IsFormStream(pRes->GetRefObjNum(), bForm) && !bForm)
      return;
  }

  CPDF_Stream* pXObject = ToStream(FindResourceObj("XObject", name));
  if (!pXObject) {
    m_bResourceMissing = TRUE;
    return;
  }

  CFX_ByteStringC type = pXObject->GetDict()
                             ? pXObject->GetDict()->GetConstString("Subtype")
                             : CFX_ByteStringC();
  if (type == "Image") {
    if (m_Options.m_bTextOnly) {
      return;
    }
    CPDF_ImageObject* pObj = AddImage(pXObject, NULL, FALSE);
    m_LastImageName = name;
    m_pLastImage = pObj->m_pImage;
    if (!m_pObjectList->m_bHasImageMask)
      m_pObjectList->m_bHasImageMask = m_pLastImage->IsMask();
  } else if (type == "Form") {
    AddForm(pXObject);
  } else {
    return;
  }
}
Ejemplo n.º 4
0
iwPostWindow::iwPostWindow(GameWorldViewer& gwv)
    : IngameWindow(CGI_POSTOFFICE, 0xFFFF, 0xFFFF, 254, 295, _("Post office"), LOADER.GetImageN("resource", 41)), gwv(gwv)
{
    AddImageButton( 0, 18, 25, 35, 35, TC_GREY, LOADER.GetImageN("io", 190));   // Viewer: 191 - Papier
    AddImageButton( 1, 56, 25, 35, 35, TC_GREY, LOADER.GetImageN("io", 30));    // Viewer:  31 - Soldat
    AddImageButton( 2, 91, 25, 35, 35, TC_GREY, LOADER.GetImageN("io", 20));    // Viewer:  21 - Geologe
    AddImageButton( 3, 126, 25, 35, 35, TC_GREY, LOADER.GetImageN("io", 28));   // Viewer:  29 - Wage
    AddImageButton( 4, 161, 25, 35, 35, TC_GREY, LOADER.GetImageN("io", 189));  // Viewer: 190 - Neue Nachricht
    AddImageButton( 5, 199, 25, 35, 35, TC_GREY, LOADER.GetImageN("io", 79));   // Viewer:  80 - Notiz
    AddImage(  6, 126, 151, LOADER.GetImageN("io", 228));
    AddImageButton( 7, 18, 242, 30, 35, TC_GREY, LOADER.GetImageN("io", 225));  // Viewer: 226 - Hilfe
    AddImageButton( 8, 51, 246, 30, 26, TC_GREY, LOADER.GetImageN("io", 102));  // Viewer: 103 - Schnell zurück
    AddImageButton( 9, 81, 246, 30, 26, TC_GREY, LOADER.GetImageN("io", 103));  // Viewer: 104 - Zurück
    AddImageButton(10, 111, 246, 30, 26, TC_GREY, LOADER.GetImageN("io", 104)); // Viewer: 105 - Vor
    AddImageButton(11, 141, 246, 30, 26, TC_GREY, LOADER.GetImageN("io", 105)); // Viewer: 106 - Schnell vor


    gotoButton = AddImageButton(14, 181, 246, 30, 26, TC_GREY, LOADER.GetImageN("io", 107)); // Goto, nur sichtbar wenn Nachricht mit Koordinaten da
    gotoButton->SetVisible(false);
    deleteButton = AddImageButton(15, 211, 246, 30, 26, TC_GREY, LOADER.GetImageN("io", 106)); // Mülleimer, nur sichtbar, wenn Nachricht da
    deleteButton->SetVisible(false);



    postMsgInfos = AddText(18, 127, 228, "", MakeColor(255, 188, 100, 88), glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, SmallFont);
    postMsgInfos->SetVisible(false);

    postImage = AddImage(13, 127, 155, LOADER.GetImageN("io", 225));

    // Multiline-Teil mit drei leeren Zeilen erzeugen
    ctrlMultiline* text = AddMultiline(12, 126, 141, 200, 50, TC_INVISIBLE, NormalFont, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM | glArchivItem_Font::DF_NO_OUTLINE);
    text->EnableBox(false);
    text->AddString("", COLOR_WINDOWBROWN, false);
    text->AddString("", COLOR_WINDOWBROWN, false);
    text->AddString("", COLOR_WINDOWBROWN, false);

    SetMessageText(_("No letters!"));

    acceptButton = AddImageButton(16, 87, 185, 30, 26, TC_GREEN1, LOADER.GetImageN("io", 32)); // Button mit Haken, zum Annehmen von Verträgen
    acceptButton->SetVisible(false);
    declineButton = AddImageButton(17, 137, 185, 30, 26, TC_RED1, LOADER.GetImageN("io", 40)); // Button mit Kreuz, zum Ablehnen von Verträgen
    declineButton->SetVisible(false);

    currentMessage = 0;
    DisplayPostMessage();

    lastSize = GameClient::inst().GetPostMessages().size();
}
Ejemplo n.º 5
0
iwTrade::iwTrade(const nobBaseWarehouse& wh, const GameWorldViewer& gwv, GameCommandFactory& gcFactory)
    : IngameWindow(wh.CreateGUIID(), (unsigned short) - 2, (unsigned short) - 2, 400, 194, _("Trade"), LOADER.GetImageN("resource", 41)),
      wh(wh), gwv(gwv), gcFactory(gcFactory), possibleSrcWarehouses(gwv.GetPlayer().GetWarehousesForTrading(wh))
{
    // Get title of the player
    SetTitle(_("Trade with %s") + gwv.GetWorld().GetPlayer(wh.GetPlayer()).name);
    // Gebäudebild und dessen Schatten
    AddImage( 0, 100, 144, LOADER.GetNationImage(wh.GetNation(), 250 + 5 * wh.GetBuildingType()));

    const unsigned left_column = 200;

    this->AddComboBox(4, left_column, 84, 160, 18, TC_GREY, NormalFont, 90); // Ware/Figure names
    this->AddText(1, left_column, 30, "Deal in:", COLOR_YELLOW, glArchivItem_Font::DF_LEFT, NormalFont);
    ctrlComboBox* box = this->AddComboBox(2, left_column, 44, 160, 18, TC_GREY, NormalFont, 200); // Ware or figure?
    box->AddString(_("Wares"));
    box->AddString(_("Settlers"));
    this->AddText(3, left_column, 70, "Type:", COLOR_YELLOW, glArchivItem_Font::DF_LEFT, NormalFont);


    // Create possible wares, figures
    for(unsigned i = 0; i < WARE_TYPES_COUNT; ++i)
    {
        // Only add one shield type
        if(GoodType(i) != ConvertShields(GoodType(i)))
            continue;
        // Don't add nothing or empty water
        if(i == GD_NOTHING || i == GD_WATEREMPTY)
            continue;
        wares.push_back(GoodType(i));
    }
    for(unsigned i = 0; i < JOB_TYPES_COUNT; ++i)
    {
        // Can't trade boat carriers
        if(i == JOB_BOATCARRIER)
            continue;
        jobs.push_back(Job(i));
    }

    AddImage(5, left_column + 20, 130, NULL, _("Ware you like to trade"));
    AddEdit(6, left_column + 34, 120, 39 , 20, TC_GREY, NormalFont)->SetNumberOnly(true);
    AddText(7, left_column + 75, 125, "/ 20", COLOR_YELLOW, glArchivItem_Font::DF_LEFT, NormalFont);

    AddTextButton(8, left_column, 150, 150, 22, TC_GREEN2, _("Send"), NormalFont);

    // Choose wares at first
    box->SetSelection(0);
    Msg_ComboSelectItem(2, 0);
}
Ejemplo n.º 6
0
void
ImageLoader::MaybeRegisterCSSImage(ImageLoader::Image* aImage)
{
  NS_ASSERTION(aImage, "This should never be null!");

  bool found = false;
  aImage->mRequests.GetWeak(mDocument, &found);
  if (found) {
    // This document already has a request.
    return;
  }

  imgRequestProxy* canonicalRequest = aImage->mRequests.GetWeak(nullptr);
  if (!canonicalRequest) {
    // The image was blocked or something.
    return;
  }

  nsRefPtr<imgRequestProxy> request;

  // Ignore errors here.  If cloning fails for some reason we'll put a null
  // entry in the hash and we won't keep trying to clone.
  mInClone = true;
  canonicalRequest->Clone(this, getter_AddRefs(request));
  mInClone = false;

  aImage->mRequests.Put(mDocument, request);

  AddImage(aImage);
}
Ejemplo n.º 7
0
/**
 *  Konstruktor von @p iwShip.
 *
 *  @todo überprüfen und die restlichen Steuerelemente zur Funktion bringen
 *
 *  @author OLiver
 */
iwShip::iwShip(GameWorldViewer* const gwv, dskGameInterface* const gi, noShip* const ship)
    : IngameWindow(CGI_SHIP, (unsigned short) - 2, (unsigned short) - 2, 252, 238, _("Ship register"), LOADER.GetImageN("resource", 41)),
      gwv(gwv), gi(gi), ship_id(ship ? GameClient::inst().GetPlayer(ship->GetPlayer())->GetShipID(ship) : 0), player(ship ? ship->GetPlayer() : GameClient::inst().GetPlayerID())
{
    AddImage(  0, 126, 101, LOADER.GetImageN("io", 228));
    AddImageButton( 2, 18, 192, 30, 35, TC_GREY, LOADER.GetImageN("io", 225));  // Viewer: 226 - Hilfe
    AddImageButton( 3, 51, 196, 30, 26, TC_GREY, LOADER.GetImageN("io", 102));  // Viewer: 103 - Schnell zurück
    AddImageButton( 4, 81, 196, 30, 26, TC_GREY, LOADER.GetImageN("io", 103));  // Viewer: 104 - Zurück
    AddImageButton( 5, 111, 196, 30, 26, TC_GREY, LOADER.GetImageN("io", 104)); // Viewer: 105 - Vor
    AddImageButton( 6, 141, 196, 30, 26, TC_GREY, LOADER.GetImageN("io", 105)); // Viewer: 106 - Schnell vor
    AddImageButton( 7, 181, 196, 30, 26, TC_GREY, LOADER.GetImageN("io", 107), _("Go to place")); // "Gehe Zu Ort"

    // Die Expeditionsweiterfahrbuttons
    AddImageButton(10, 60, 81, 18, 18, TC_GREY, LOADER.GetImageN("io", 187), _("Found colony"))->SetVisible(false);

    const int BUTTON_POS[6][2] =
    {
        {60, 61}, {80, 70}, {80, 90}, {60, 101}, {40, 90}, {40, 70}
    };

    // Expedition abbrechen
    AddImageButton(11, 200, 143, 18, 18, TC_RED1, LOADER.GetImageN("io", 40), _("Return to harbor"))->SetVisible(false);

    // Die 6 Richtungen
    for(unsigned i = 0; i < 6; ++i)
        AddImageButton(12 + i, BUTTON_POS[i][0], BUTTON_POS[i][1], 18, 18, TC_GREY, LOADER.GetImageN("io", 181 + (i + 4) % 6))->SetVisible(false);

}
Ejemplo n.º 8
0
bool CECardDialog::InitListBox()
{	
	if (m_ImageList)
		m_ImageList.Destroy();

	if (!m_ImageList.Create(16,16, ILC_COLOR24 | ILC_MASK, LB_ITEM_COUNT, LB_ITEM_COUNT))
		return false;

	// Add LISTBOX images to image list
	int nIndex=0;
	for (int i=0; i<LB_ITEM_COUNT; i++)
	{
		nIndex = AddImage(LB_ITEM[i].BitmapID);
		if (nIndex < 0)
			return false;
	}
	
	// Give Image list to list ctrl.
	m_ECardList.SetImageList(m_ImageList.m_hImageList, LVSIL_SMALL);

	// Add LISTBOX items
	m_ECardList.InsertColumn( 0, _T("ECARDS"), LVCFMT_LEFT, 100, -1 );
	CString szText;
	for (int i=0; i<LB_ITEM_COUNT; i++)
	{
		szText.LoadString(LB_ITEM[i].TextID);
		m_ECardList.InsertItem(i,szText, i);
	}

	m_ECardList.SetColumnWidth (0, LVSCW_AUTOSIZE);
	m_ECardList.SetHoverTime(10);

	return true;
}
Ejemplo n.º 9
0
/**
 *  Konstruktor von @p dskIntro.
 *
 *  @author FloSoft
 */
dskIntro::dskIntro() : Desktop(LOADER.GetImageN("menu", 0))
{
    // "Zurück"
    AddTextButton(0, 300, 550, 200, 22, TC_RED1, _("Back"), NormalFont);

    AddImage(11, 20, 20, LOADER.GetImageN("logo", 0));
}
Ejemplo n.º 10
0
int ResourceManager::GetLinkImageIndex(const wxString& sFileType, bool bHidden)
  {
	// Prepend 'Link'
  wxString sFullFileType = wxString::Format
    (
	  wxT("Link%s%s"),
    (bHidden)? wxT("Hidden") : wxT(""),
    sFileType.c_str()
    );
 	if(hImageIndex.find(sFullFileType) == hImageIndex.end())
		{
		int nIndex = hImageIndex[sFullFileType];
		return nIndex;
		}

	// Overlay the link image on the image
	wxBitmap bmp = GetImageForFileType(sFileType);
	if(!bmp.Ok())
		return resLink;

/*
FIXME
// 	// Default to 'text'
// 	if(!img.Ok())
// 		img = GetImageForFileType(wxT("text/plain"));

	// TBI: Overlay link symbol
	unsigned char * puc = ico.GetIconData();
	for(int i = 0; i < 60; i += 3)
		puc[i] = 255;
*/

	return AddImage(sFullFileType, bmp);
	}
Ejemplo n.º 11
0
int ResourceManager::GetImageIndex(const wxString& sFileType, bool bHidden)
  {
	ResourceId resDefault = (bHidden)? resFileHidden : resFileNormal;
	if(sFileType.IsEmpty())
		return resDefault;

	// Manage different images for hidden and non-
	// Add 'Hidden' to the start of hidden images
  wxString sFullFileType = wxString::Format
    (
	  wxT("%s%s"),
    (bHidden)? wxT("Hidden") : wxT(""),
    sFileType.c_str()
    );
	TypeIndexMap::iterator it = hImageIndex.find(sFullFileType);
 	if(it != hImageIndex.end())
		{
		// We have already cached the image, return it
		int nIndex = it->second;
		return nIndex;
		}

	// We load the image ourselves to allow user to resize if necessary
	wxBitmap bmp = GetImageForFileType(sFileType);
	if(!bmp.Ok())
		{
		wxLogDebug(wxT("GetImageForFileType('%s') failed, using 'resDefault'"), sFileType.c_str());
		hImageIndex[sFullFileType] = resDefault;
		return resDefault;
		}

	int nNewIndex = AddImage(sFullFileType, bmp);

	return nNewIndex;
	}
Ejemplo n.º 12
0
int main( int argc, char **argv )
{
   int i;
	SetSystemLog( SYSLOG_FILE, stdout );
	g.pdi = GetDisplayInterface();
	g.pii = GetImageInterface();
	g.x = 10;
	g.y = 10;
   for( i = 1; i < argc; i++ )
	{
      AddImage( argv[i] );
	}

	while( !g.flags.exit )
		Relinquish(); // hmm what do we have to do here?
	{
		PIMAGE_DISPLAY pdi;
		pdi = g.images;
		while( pdi )
		{
			CloseDisplay( pdi->display );
			UnmakeImageFile( pdi->Loaded );
         pdi = pdi->next;
		}
	}
   return 0;
}
Ejemplo n.º 13
0
iwTrade::iwTrade(const nobBaseWarehouse& wh, const GameWorldViewer& gwv, GameCommandFactory& gcFactory)
    : IngameWindow(wh.CreateGUIID(), IngameWindow::posAtMouse, Extent(400, 194), _("Trade"), LOADER.GetImageN("resource", 41)), wh(wh),
      gwv(gwv), gcFactory(gcFactory), possibleSrcWarehouses(gwv.GetPlayer().GetWarehousesForTrading(wh))
{
    // Get title of the player
    SetTitle((boost::format(_("Trade with %s")) % gwv.GetWorld().GetPlayer(wh.GetPlayer()).name).str());
    // Gebäudebild und dessen Schatten
    AddImage(0, DrawPoint(100, 144), LOADER.GetNationImage(wh.GetNation(), 250 + 5 * wh.GetBuildingType()));

    const unsigned left_column = 200;

    AddComboBox(4, DrawPoint(left_column, 84), Extent(160, 18), TC_GREY, NormalFont, 90); // Ware/Figure names
    AddText(1, DrawPoint(left_column, 30), "Deal in:", COLOR_YELLOW, FontStyle::LEFT, NormalFont);
    ctrlComboBox* box = this->AddComboBox(2, DrawPoint(left_column, 44), Extent(160, 18), TC_GREY, NormalFont, 200); // Ware or figure?
    box->AddString(_("Wares"));
    box->AddString(_("Settlers"));
    AddText(3, DrawPoint(left_column, 70), "Type:", COLOR_YELLOW, FontStyle::LEFT, NormalFont);

    // Create possible wares, figures
    for(unsigned i = 0; i < NUM_WARE_TYPES; ++i)
    {
        // Only add one shield type
        if(GoodType(i) != ConvertShields(GoodType(i)))
            continue;
        // Don't add empty water
        if(i == GD_WATEREMPTY)
            continue;
        wares.push_back(GoodType(i));
    }
    for(unsigned i = 0; i < NUM_JOB_TYPES; ++i)
    {
        // Can't trade boat carriers
        if(i == JOB_BOATCARRIER)
            continue;
        jobs.push_back(Job(i));
    }

    AddImage(5, DrawPoint(left_column + 20, 130), static_cast<ITexture*>(nullptr), _("Ware you like to trade"));
    AddEdit(6, DrawPoint(left_column + 34, 120), Extent(39, 20), TC_GREY, NormalFont)->SetNumberOnly(true);
    AddText(7, DrawPoint(left_column + 75, 125), "/ 20", COLOR_YELLOW, FontStyle::LEFT, NormalFont);

    AddTextButton(8, DrawPoint(left_column, 150), Extent(150, 22), TC_GREEN2, _("Send"), NormalFont);

    // Choose wares at first
    box->SetSelection(0);
    Msg_ComboSelectItem(2, 0);
}
Ejemplo n.º 14
0
void csBlob::StopAnimations ()
{
  curanim = 0;
  curanim_index = 0;
  curanim_timeleft = anim_delay;
  if (!curanim_remain)
    AddImage ("__main__", curanim_origimg);
}
Ejemplo n.º 15
0
ImageView* const ImageGrid::AddBlankImage( const QSize& imageSize, int id )
{
    QImage newBlankImage( imageSize, QImage::Format_RGB888 );
    newBlankImage.fill( 0xFFFFFF );

    ImageView* const addedImageView = AddImage( newBlankImage, QString(), id );
    return addedImageView;
}
Ejemplo n.º 16
0
iwBuilding::iwBuilding(GameWorldView& gwv, GameCommandFactory& gcFactory, nobUsual* const building)
    : IngameWindow(building->CreateGUIID(), (unsigned short) - 2, (unsigned short) - 2, 226, 194, _(BUILDING_NAMES[building->GetBuildingType()]), LOADER.GetImageN("resource", 41)),
      gwv(gwv), gcFactory(gcFactory), building(building)
{
    // Arbeitersymbol
    AddImage(0, 28, 39, LOADER.GetMapImageN(2298));

    // Exception: charburner
    if (building->GetBuildingType() != BLD_CHARBURNER)
    {
        AddImage(13, 28, 39, LOADER.GetMapImageN(2300 + USUAL_BUILDING_CONSTS[building->GetBuildingType() - 10].job));
    }
    else
    {
        AddImage(13, 28, 39, LOADER.GetImageN("io_new", 5));	
    }

    // Gebäudesymbol
    AddImage(1, 117, 114, building->GetBuildingImage());

    // Symbol der produzierten Ware (falls hier was produziert wird)
    if(USUAL_BUILDING_CONSTS[building->GetBuildingType() - 10].produced_ware != GD_NOTHING)
    {
        AddImage(2, 196, 39, LOADER.GetMapImageN(2298));
        AddImage(3, 196, 39, LOADER.GetMapImageN(2250 + USUAL_BUILDING_CONSTS[building->GetBuildingType() - 10].produced_ware));
    }

    // Info
    AddImageButton( 4,  16, 147, 30, 32, TC_GREY, LOADER.GetImageN("io",  225), _("Help"));
    // Abreißen
    AddImageButton( 5,  50, 147, 34, 32, TC_GREY, LOADER.GetImageN("io",  23), _("Demolish house"));
    // Produktivität einstellen (196,197) (bei Spähturm ausblenden)
    Window* enable_productivity = AddImageButton( 6,  90, 147, 34, 32, TC_GREY, LOADER.GetImageN("io", ((building->IsProductionDisabledVirtual()) ? 197 : 196)));
    if(building->GetBuildingType() == BLD_LOOKOUTTOWER)
        enable_productivity->SetVisible(false);
    // Bei Bootsbauer Button zum Umwählen von Booten und Schiffen
    if(building->GetBuildingType() == BLD_SHIPYARD)
    {
        // Jenachdem Boot oder Schiff anzeigen
        unsigned io_dat_id = (static_cast<nobShipYard*>(building)->GetMode() == nobShipYard::BOATS)
                             ? IODAT_BOAT_ID : IODAT_SHIP_ID;
        AddImageButton(11, 130, 147, 43, 32, TC_GREY, LOADER.GetImageN("io", io_dat_id));
    }

    // "Gehe Zum Ort"
    AddImageButton( 7, 179, 147, 30, 32, TC_GREY, LOADER.GetImageN("io", 107), _("Go to place"));	

    // Gebäudebild und dessen Schatten
    AddImage( 8, 117, 114, LOADER.GetNationImage(building->GetNation(), 250 + 5 * building->GetBuildingType()));

    // Produktivitätsanzeige (bei Katapulten und Spähtürmen ausblenden)
    Window* productivity = AddPercent(9, 59, 31, 106, 16, TC_GREY, 0xFFFFFF00, SmallFont, building->GetProductivityPointer());
    if(building->GetBuildingType() == BLD_CATAPULT || building->GetBuildingType() == BLD_LOOKOUTTOWER)
        productivity->SetVisible(false);

    AddText(10, 113, 50, _("(House unoccupied)"), COLOR_RED, glArchivItem_Font::DF_CENTER, NormalFont);

	// "Go to next" (building of same type)
    AddImageButton( 12, 179, 115, 30, 32, TC_GREY, LOADER.GetImageN("io_new", 11), _("Go to next building of same type"));
}
Ejemplo n.º 17
0
void IdePngDes::Load(const char *_filename)
{
	Clear();
	filename = _filename;
	filetime = FileGetTime(filename);
	Image m = StreamRaster::LoadFileAny(filename);	
	AddImage(filename, m, false);
	SingleMode();
}
Ejemplo n.º 18
0
/**
 *  Konstruktor von @p iwOptionsWindow.
 *
 *  @author OLiver
 */
iwOptionsWindow::iwOptionsWindow(dskGameInterface* gameDesktop)
    : IngameWindow(CGI_OPTIONSWINDOW, 0xFFFF, 0xFFFF, 300, 515, _("Game menu"), LOADER.GetImageN("resource", 41))
{
    this->gameDesktop = gameDesktop;

    // Der Soldat oben
    AddImage(1, 150, 36, LOADER.GetImageN("io", 30));

    // Versionszeile
    AddVarText(2, 150, 76, _("Return To The Roots v%s-%s"), COLOR_YELLOW, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, NormalFont, 2, GetWindowVersion(), GetWindowRevisionShort());
    // Copyright
    AddVarText(3, 150, 96, _("© 2005 - %s Settlers Freaks"), COLOR_YELLOW, glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_BOTTOM, NormalFont, 1, GetCurrentYear());

    // "Tastaturbelegung"
    AddImageButton(4, 35, 120, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 79));
    AddText(5, 85, 140, _("Keyboard layout"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont);

    // "'Lies mich'-Datei laden"
    AddImageButton(6, 35, 160, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 79));
    AddText(7, 85, 180, _("Load 'ReadMe' file"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont);

    // "Spiel laden!"
    // TODO: Implement
    //AddImageButton( 8, 35, 210, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 48));
    //AddText(9, 85, 230, _("Load game!"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont);

    // "Spiel speichern!"
    // TODO: Move back down to y=250 (Button) 270 (Text) after Load button is implemented
    AddImageButton(10, 35, 230, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 47));
    AddText(11, 85, 255, _("Save game!"), COLOR_YELLOW, 0 | glArchivItem_Font::DF_BOTTOM, NormalFont);

    // Geräusche an/aus
    AddImageButton(12, 35, 300, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 114 + !SETTINGS.sound.effekte)); //-V807

    // Musik an/aus
    AddImageButton(13, 35, 340, 35, 35, TC_GREEN2, LOADER.GetImageN("io", 116 + !SETTINGS.sound.musik));

    // Geräuschlautstärke
    AddProgress(14, 100, 306, 160, 22, TC_GREEN2, 139, 138, 10)
    ->SetPosition(SETTINGS.sound.effekte_volume * 10 / 255);

    // Musiklautstärke
    AddProgress(15, 100, 346, 160, 22, TC_GREEN2, 139, 138, 10)
    ->SetPosition(SETTINGS.sound.musik_volume * 10 / 255);

    //// Music Player
    AddTextButton(16, 100, 380, 160, 22, TC_GREEN2, _("Music player"), NormalFont);

    // Advanced Options
    AddTextButton(18, 67, 412, 168, 24, TC_GREEN2, _("Advanced"), NormalFont);

    // "Spiel aufgeben"
    AddTextButton(17, 67, 443, 168, 24, TC_RED1, _("Surrender"), NormalFont);
    // "Spiel beenden"
    AddTextButton(0, 67, 474, 168, 24, TC_RED1, _("End game"), NormalFont);

}
Ejemplo n.º 19
0
void IdePngDes::Create(const char *_filename)
{
	Clear();
	filename = _filename;
	filetime = GetSysTime();
	Image m = CreateImage(Size(16, 16), Null);
	AddImage(filename, m, false);
	SingleMode();
}
Ejemplo n.º 20
0
BOOL CDConsoleDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  Add extra initialization here
	//设置列表框为单选模式
	m_DcUsers.ModifyStyle(0, LVS_SINGLESEL);
	m_DcUsers.InsertColumn(DCUSERS_RESID, _T("ResourceID"), LVCFMT_LEFT, 70);
	m_DcUsers.InsertColumn(DCUSERS_STATUS, _T("UserStatus"), LVCFMT_LEFT, 100);
	m_DcUsers.InsertColumn(DCUSERS_NAME, _T("UserName"), LVCFMT_LEFT, 70);
	m_DcUsers.InsertColumn(DCUSERS_CATEGORY, _T("UserCategory"), LVCFMT_LEFT, 85);
	m_DcUsers.InsertColumn(DCUSERS_PRIORITY, _T("UserPriority"), LVCFMT_LEFT, 85);

	//图片列表
	m_ImageList.Create(30, 30, ILC_COLORDDB, 8, 1);
 	AddImage(m_ImageList, IDB_BITMAP_CAMERA_OFFLINE);
	AddImage(m_ImageList, IDB_BITMAP_CAMERA_ONLINE);
	AddImage(m_ImageList, IDB_BITMAP_DISPATCHER_OFFLINE);
	AddImage(m_ImageList, IDB_BITMAP_DISPATCHER_ONLINE);
	AddImage(m_ImageList, IDB_BITMAP_GWUSER_OFFLINE);
	AddImage(m_ImageList, IDB_BITMAP_GWUSER_ONLINE);
	AddImage(m_ImageList, IDB_BITMAP_PTTUSER_OFFLINE);
	AddImage(m_ImageList, IDB_BITMAP_PTTUSER_ONLINE);
	m_DcUsers.SetImageList(&m_ImageList, LVSIL_SMALL);
	m_DcGroups.SetImageList(&m_ImageList, LVSIL_SMALL);
	m_ImageList.Detach();

	//设置List风格:全选、子列支持图片
	m_DcUsers.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP | LVS_EX_SUBITEMIMAGES | LVS_EX_INFOTIP);

	//设置坐标
	CRect rect;
	GetDlgItem(IDC_STATIC_DC)->GetWindowRect(&rect);
	ScreenToClient(&rect);
	CRect rt(rect);
	rt.left = 10;
	rt.top = 50;
	rt.right -= 10;
	m_DcUsers.MoveWindow(rt);
	m_DcGroups.MoveWindow(rt);
	m_PatchGroups.MoveWindow(rt);
	m_DcUsers.ShowWindow(SW_SHOW);
	m_DcGroups.ShowWindow(SW_HIDE);
	m_PatchGroups.ShowWindow(SW_HIDE);

	//initial User Type comboBox
	m_cmbObjSel.InsertString(0, _T("DcUsers"));
	m_cmbObjSel.InsertString(1, _T("DcGroups"));
	m_cmbObjSel.InsertString(2, _T("PatchGroups"));
	m_cmbObjSel.SetCurSel(0);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
Ejemplo n.º 21
0
void csBlob::Update (csTicks elapsed)
{
  if (mover)
  {
    if (mover->Update (elapsed, this))
    {
      delete mover;
      mover = 0;
    }
  }

  if (destalpha_ticks > 0)
  {
    destalpha_ticks -= elapsed;
    if (destalpha_ticks <= 0)
    {
      destalpha_ticks = 0;
      alpha = destalpha;
    }
    else
    {
      alpha = destalpha + float (destalpha_ticks)
        * destalpha_factor * (srcalpha - destalpha);
    }
    int a = int (alpha * 255.0);
    if (a > 255) a = 255;
    ualpha = uint8 (a);
  }

  if (curanim)
  {
    bool changed = false;
    curanim_timeleft -= elapsed;
    while (curanim_index == -1 || curanim_timeleft <= 0)
    {
      changed = true;
      curanim_index++;
      if (curanim_index >= int (curanim->images.GetSize ()))
      {
	if (curanim_loop)
	  curanim_index = 0;
        else
	{
	  StopAnimations ();
	  return;
	}
      }
      curanim_timeleft += anim_delay;
    }
    if (changed)
    {
      AddImage ("__main__", curanim->images[curanim_index]);
    }
  }
}
//LoadImage-----------------------------------------------------------------
bool TextureManager::LoadImage( const String& imageFileName, GLuint minFilter, GLuint maxFilter, bool forceMipmap, bool resizeIfNeeded )
{
    // Make sure the image is in the map:
    AddImage( imageFileName );

    // Load the image:
    TextureIter iter = mTextureMap.find( imageFileName );
    if ( iter != mTextureMap.end() )
        return iter->second->Load( minFilter, maxFilter, forceMipmap, resizeIfNeeded );
    return false;
}
Ejemplo n.º 23
0
iwPostWindow::iwPostWindow(GameWorldView& gwv, PostBox& postBox)
    : IngameWindow(CGI_POSTOFFICE, IngameWindow::posLastOrCenter, Extent(254, 295), _("Post office"), LOADER.GetImageN("resource", 41)),
      gwv(gwv), postBox(postBox), showAll(true), curCategory(PostCategory::General), curMsg(nullptr), lastHasMissionGoal(true)
{
    AddImageButton(ID_SHOW_ALL, DrawPoint(18, 25), Extent(35, 35), TC_GREY, LOADER.GetImageN("io", 190));  // Viewer: 191 - Papier
    AddImageButton(ID_SHOW_MIL, DrawPoint(56, 25), Extent(35, 35), TC_GREY, LOADER.GetImageN("io", 30));   // Viewer:  31 - Soldat
    AddImageButton(ID_SHOW_GEO, DrawPoint(91, 25), Extent(35, 35), TC_GREY, LOADER.GetImageN("io", 20));   // Viewer:  21 - Geologe
    AddImageButton(ID_SHOW_ECO, DrawPoint(126, 25), Extent(35, 35), TC_GREY, LOADER.GetImageN("io", 28));  // Viewer:  29 - Wage
    AddImageButton(ID_SHOW_GEN, DrawPoint(161, 25), Extent(35, 35), TC_GREY, LOADER.GetImageN("io", 189)); // Viewer: 190 - Neue Nachricht
    AddImageButton(ID_SHOW_GOAL, DrawPoint(199, 25), Extent(35, 35), TC_GREY, LOADER.GetImageN("io", 79)); // Viewer:  80 - Notiz
    AddImage(0, DrawPoint(126, 151), LOADER.GetImageN("io", 228));
    AddImageButton(ID_HELP, DrawPoint(18, 242), Extent(30, 35), TC_GREY, LOADER.GetImageN("io", 225));     // Viewer: 226 - Hilfe
    AddImageButton(ID_GO_START, DrawPoint(51, 246), Extent(30, 26), TC_GREY, LOADER.GetImageN("io", 102)); // Viewer: 103 - Schnell zurück
    AddImageButton(ID_GO_BACK, DrawPoint(81, 246), Extent(30, 26), TC_GREY, LOADER.GetImageN("io", 103));  // Viewer: 104 - Zurück
    AddImageButton(ID_GO_FWD, DrawPoint(111, 246), Extent(30, 26), TC_GREY, LOADER.GetImageN("io", 104));  // Viewer: 105 - Vor
    AddImageButton(ID_GO_END, DrawPoint(141, 246), Extent(30, 26), TC_GREY, LOADER.GetImageN("io", 105));  // Viewer: 106 - Schnell vor

    // Goto, nur sichtbar wenn Nachricht mit Koordinaten da
    AddImageButton(ID_GOTO, DrawPoint(181, 246), Extent(30, 26), TC_GREY, LOADER.GetImageN("io", 107))->SetVisible(false);
    // Mülleimer, nur sichtbar, wenn Nachricht da
    AddImageButton(ID_DELETE, DrawPoint(211, 246), Extent(30, 26), TC_GREY, LOADER.GetImageN("io", 106))->SetVisible(false);

    AddText(ID_INFO, DrawPoint(127, 228), "", MakeColor(255, 188, 100, 88), FontStyle::CENTER | FontStyle::BOTTOM, SmallFont)
      ->SetVisible(false);

    AddImage(ID_IMG, DrawPoint(127, 155), LOADER.GetImageN("io", 225));

    // Multiline-Teil mit drei leeren Zeilen erzeugen
    ctrlMultiline* text = AddMultiline(ID_TEXT, DrawPoint(126, 141), Extent(200, 0), TC_INVISIBLE, NormalFont,
                                       FontStyle::CENTER | FontStyle::BOTTOM | FontStyle::NO_OUTLINE);
    text->SetNumVisibleLines(4);
    text->ShowBackground(false);

    // Button with OK and deny sign (tick and cross) for contracts
    AddImageButton(ID_ACCEPT, DrawPoint(87, 185), Extent(30, 26), TC_GREEN1, LOADER.GetImageN("io", 32))->SetVisible(false);
    AddImageButton(ID_DENY, DrawPoint(137, 185), Extent(30, 26), TC_RED1, LOADER.GetImageN("io", 40))->SetVisible(false);

    FilterMessages();
    curMsgId = curMsgIdxs.size();
    DisplayPostMessage();
}
Ejemplo n.º 24
0
/**
 *  Konstruktor von @p iwMerchandiseStatistics.
 *
 *  @author jh
 */
iwMerchandiseStatistics::iwMerchandiseStatistics()
    : IngameWindow(CGI_MERCHANDISE_STATISTICS, 0xFFFE, 0xFFFE, 252, 310, _("Merchandise"), LOADER.GetImageN("resource", 41)), currentTime(STAT_1H)
{
    // Statistikfeld
    AddImage(0, 10 + 115, 23 + 81, LOADER.GetImageN("io", 228));

    // Waren-Buttons
    // obere Reihe
    ctrlMultiSelectGroup* types = AddMultiSelectGroup(22, ctrlOptionGroup::ILLUMINATE);
    types->AddImageButton(1, 17, 192, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_WOOD), _("Wood"));
    types->AddImageButton(2, 48, 192, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_BOARDS), _("Boards"));
    types->AddImageButton(3, 79, 192, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_STONES), _("Stones"));
    types->AddImageButton(4, 110, 192, 30, 30, TC_GREY, LOADER.GetImageN("io", 80), _("Food"));
    types->AddImageButton(5, 141, 192, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_WATER), _("Water"));
    types->AddImageButton(6, 172, 192, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_BEER), _("Beer"));
    types->AddImageButton(7, 203, 192, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_COAL), _("Coal"));

    // untere Reihe
    types->AddImageButton(8, 17, 227, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_IRONORE), _("Ironore"));
    types->AddImageButton(9, 48, 227, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_GOLD), _("Gold"));
    types->AddImageButton(10, 79, 227, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_IRON), _("Iron"));
    types->AddImageButton(11, 110, 227, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_COINS), _("Coins"));
    types->AddImageButton(12, 141, 227, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_HAMMER), _("Tools"));
    types->AddImageButton(13, 172, 227, 30, 30, TC_GREY, LOADER.GetImageN("io", 111), _("Weapons"));
    types->AddImageButton(14, 203, 227, 30, 30, TC_GREY, LOADER.GetMapImageN(2250 + GD_BOAT), _("Boats"));

    // Hilfe
    AddImageButton(16, 17, 261, 30, 32, TC_GREY, LOADER.GetImageN("io", 21), _("Help"));

    // Mülleimer
    AddImageButton(17, 49, 263, 30, 28, TC_GREY, LOADER.GetImageN("io", 106), _("Delete all"));

    // Zeiten
    ctrlOptionGroup* times = AddOptionGroup(23, ctrlOptionGroup::ILLUMINATE);
    times->AddTextButton(18, 81, 263, 36, 28, TC_GREY, _("15 m"), NormalFont);
    times->AddTextButton(19, 119, 263, 36, 28, TC_GREY, _("1 h"), NormalFont);
    times->AddTextButton(20, 155, 263, 36, 28, TC_GREY, _("4 h"), NormalFont);
    times->AddTextButton(21, 191, 263, 36, 28, TC_GREY, _("16 h"), NormalFont);
    times->SetSelection(19);


    // Zeit-Werte an der x-Achse
    timeAnnotations = std::vector<ctrlText*>(7);
    for (unsigned i = 0; i < 7; ++i)
    {
        timeAnnotations[i] = AddText(32 + i, 211 + i, 125 + i, "", MakeColor(255, 136, 96, 52),
                                     glArchivItem_Font::DF_CENTER | glArchivItem_Font::DF_TOP, LOADER.GetFontN("resource", 0));
    }

    // Aktueller Maximalwert an der y-Achse
    maxValue = AddText(31, 211, 55, "1", MakeColor(255, 136, 96, 52),
                       glArchivItem_Font::DF_RIGHT | glArchivItem_Font::DF_VCENTER, LOADER.GetFontN("resource", 0));
}
Ejemplo n.º 25
0
sf::Uint16 ResourceManager::LoadNextImage() {
	if(mImagesToLoad.size() <= 0)
		return mMaxImageQueueSize;

	ImageProperties p = mImagesToLoad.front();
	mImagesToLoad.pop();
	Logger::Debug(LogOrigin::RESOURCEMANAGER, "Loading image " + p.Key + " from queue.");
	if(!AddImage(p.Path, p.Name, p.Width, p.Height, p.Key)) {
		Logger::Critical(LogOrigin::RESOURCEMANAGER, "Could not load image " + p.Key);
	}

	return int(mImagesToLoad.size());
}
Ejemplo n.º 26
0
void ImageView::SetImageBitmap(const std::string& filename, float min, float max)
{
  int minLevel = ceilf(logf(min) / logf(2.0f));
  int maxLevel = ceilf(logf(max) / logf(2.0f));

  ImageAttributes attributes;
  const Vector3 size = Self().GetCurrentSize();

  if(minLevel==maxLevel)
  { // Single image detail level, no need for any notifications.
    const float detail = powf(2.0f, maxLevel);
    attributes.SetSize( size.x * detail, size.y * detail );
    Image image = Image::New( filename, attributes);
    mImageActor.SetImage( image );
  }
  else
  { // Multi image detail level...
    for( int level = minLevel; level <= maxLevel; level++)
    {
      const float minDetail = powf(2.0f, level - 1);
      const float maxDetail = powf(2.0f, level);
      ImageRequest req(filename, size.x * maxDetail, size.y * maxDetail );

      if(level==minLevel)
      {
        AddImage(req, LessThanCondition(maxDetail) );
      }
      else if(level==maxLevel)
      {
        AddImage(req, GreaterThanCondition(minDetail) );
      }
      else
      {
        AddImage(req, InsideCondition(minDetail, maxDetail) );
      }
    }
  }
}
Ejemplo n.º 27
0
bool IdeIconDes::Load(const char *_filename)
{
	Clear();
	filename = _filename;
	filetime = FileGetTime(filename);
	Array<ImlImage> m;
	int f;
	if(!LoadIml(LoadFile(filename), m, f))
		return false;
	format = f;
	for(int i = 0; i < m.GetCount(); i++)
		AddImage(m[i].name, m[i].image, m[i].exp);
	return true;
}
Ejemplo n.º 28
0
iwDemolishBuilding::iwDemolishBuilding(GameWorldViewer* const gwv, const noBaseBuilding* building, const bool flag)
    : IngameWindow(building->CreateGUIID(), 0xFFFE, 0xFFFE, 200, 200, _("Demolish?"), LOADER.GetImageN("resource", 41)), gwv(gwv), building(building), flag(flag)
{
    // Ja
    AddImageButton(0, 14, 140, 66, 40, TC_RED1, LOADER.GetImageN("io", 32)); //-V525
    // Nein
    AddImageButton(1, 82, 140, 66, 40, TC_GREY, LOADER.GetImageN("io", 40));
    // Gehe zum Standort
    AddImageButton(2, 150, 140, 36, 40, TC_GREY, LOADER.GetImageN("io", 107));
    // Gebäudebild
    AddImage(3, 104, 109, building->GetBuildingImage());
    // Gebäudename
    AddText(4, 100, 125, _(BUILDING_NAMES[building->GetBuildingType()]), 0xFFFFFF00, glArchivItem_Font::DF_CENTER, NormalFont);
}
Ejemplo n.º 29
0
csTicks csBlob::PlayAnimation (const char* animname, bool loop,
      bool remain, csTicks delay)
{
  StopAnimations ();
  anim_delay = delay;
  curanim = animations.Get (animname, 0);
  if (!curanim) return 0;
  curanim_loop = loop;
  curanim_remain = remain;
  curanim_index = -1;
  curanim_timeleft = 0;
  AddImage ("__main__", curanim->images[0]);
  return delay * curanim->images.GetSize ();
}
Ejemplo n.º 30
0
//================================================================================================================
void HUDEditorSystem::OnMouseDown(WPARAM btnState, int x, int y)
{
	// Start a left button drag of an item
	if ((btnState & MK_LBUTTON) != 0)
	{
		stampPressed = true;
		
		CalculateSelectedMousePosition(x, y);
		
		// Adds a new image to the hud from the selected image image in the image cache if in image
		// place mode
		AddImage();
		
		// Selects a image so it can be moved, if it is moving then this will be skipped
		// so that the image can be placed back on the hud with a left click
		bool goingToMove = MoveImageStart();
		// If a image is being moved place the image at the clicked position if in image move mode
		if (!goingToMove) MoveImageEnd();
		
		// Selects a image so it can be cloned, if it is moving then this will be skipped
		// so that the image clone can be added to the hud with a left click
		bool goingToClone = CloneImageStart();
		// If a image is being moved place the image at the clicked position if in image clone mode
		if (!goingToClone) CloneImageEnd();
		
		// Selects a image on the hud and deletes it if in image delete mode
		DeleteImage();
		
		// Selects the button to be resized if in button resize mode
		ResizeImageStart();
		
		// If applicable, Add a text if in text mode
		AddText();
		
		// Selects a text so it can be moved, if it is moving then this will be skipped
		// so that the text can be placed back on the hud with a left click
		goingToMove = MoveTextStart();
		// If a text is being moved place the text at the clicked position if in text move mode
		if (!goingToMove) MoveTextEnd();
		
		// Selects a text so it can be cloned, if it is moving then this will be skipped
		// so that the text clone can be added to the hud with a left click
		goingToClone = CloneTextStart();
		// If a text is being moved place the text at the clicked position if in text clone mode
		if (!goingToClone) CloneTextEnd();
		
		// Selects a text on the hud and deletes it if in text delete mode
		DeleteText();
	}
}