Skip to content

Commit

Permalink
Added twitter and donate buttons
Browse files Browse the repository at this point in the history
Added twitter, donate, and donate bitcoin buttons.
  • Loading branch information
lufinkey authored and lufinkey committed Jul 20, 2014
1 parent 34ac495 commit 983aebe
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 16 deletions.
73 changes: 57 additions & 16 deletions Source/SmashBros/Menus/MenuClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1349,40 +1349,48 @@ namespace SmashBros
Menus::button_back->Draw(g, gameTime);
}

OtherOptions::FacebookButton::FacebookButton(float x1, float y1, const String&label) : MenuBarSmallButton(x1,y1,label)
OtherOptions::FacebookButton::FacebookButton(float x1, float y1, const String&label) : MenuBarSmallButton(x1,y1,label) {}
OtherOptions::FacebookButton::~FacebookButton() {}
void OtherOptions::FacebookButton::onRelease()
{
//
openURL("https://www.facebook.com/BrokenPhysicsStudios/");
}

OtherOptions::FacebookButton::~FacebookButton()
OtherOptions::TwitterButton::TwitterButton(float x1, float y1, const String&label) : MenuBarSmallButton(x1,y1,label) {}
OtherOptions::TwitterButton::~TwitterButton() {}
void OtherOptions::TwitterButton::onRelease()
{
//
openURL("https://www.twitter.com/lufinkey/");
}

void OtherOptions::FacebookButton::onRelease()
OtherOptions::ContactDeveloperButton::ContactDeveloperButton(float x1, float y1, const String&label) : MenuBarSmallButton(x1,y1,label) {}
OtherOptions::ContactDeveloperButton::~ContactDeveloperButton() {}
void OtherOptions::ContactDeveloperButton::onRelease()
{
openURL("https://www.facebook.com/BrokenPhysicsStudios/");
writeEmail(Game::getWindow(), "luisfinke@gmail.com", "iSSB", "");
}

OtherOptions::ContactDeveloperButton::ContactDeveloperButton(float x1, float y1, const String&label) : MenuBarSmallButton(x1,y1,label)
OtherOptions::DonateButton::DonateButton(float x1, float y1, const String&label) : MenuBarSmallButton(x1,y1,label) {}
OtherOptions::DonateButton::~DonateButton() {}
void OtherOptions::DonateButton::onRelease()
{
//
openURL("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=M43B9W76GWWBS&lc=US&item_name=Broken%20Physics&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted");
}

OtherOptions::ContactDeveloperButton::~ContactDeveloperButton()
OtherOptions::DonateBitcoinButton::DonateBitcoinButton(float x1, float y1, const String&label) : MenuBarSmallButton(x1,y1,label) {}
OtherOptions::DonateBitcoinButton::~DonateBitcoinButton() {}
void OtherOptions::DonateBitcoinButton::onRelease()
{
//
}

void OtherOptions::ContactDeveloperButton::onRelease()
{
writeEmail(Game::getWindow(), "[email protected]", "iSSB", "");
openURL("https://coinbase.com/checkouts/a1672e1864707bc7467e9a3572987ab9");
}

OtherOptions::OtherOptions(const String&name) : Screen(name)
{
facebook = NULL;
twitter = NULL;
contactDev = NULL;
donate = NULL;
donateBitcoin = NULL;
}

OtherOptions::~OtherOptions()
Expand All @@ -1391,21 +1399,48 @@ namespace SmashBros
{
delete facebook;
}
if(twitter!=NULL)
{
delete twitter;
}
if(contactDev!=NULL)
{
delete contactDev;
}
if(donate!=NULL)
{
delete donate;
}
if(donateBitcoin!=NULL)
{
delete donateBitcoin;
}
}

void OtherOptions::Initialize()
{
facebook = new FacebookButton(200,140, "Our Facebook");
facebook->Scale = 2.0f;
facebook->setLabelSize(14);
contactDev = new ContactDeveloperButton(200,200, "Email Developer");

twitter = new TwitterButton(200,200, "Follow on Twitter");
twitter->Scale = 2.0f;
twitter->setLabelSize(14);
twitter->setTextOffsetX(10);

contactDev = new ContactDeveloperButton(200,260, "Email Developer");
contactDev->Scale = 2.0f;
contactDev->setLabelSize(14);
contactDev->setTextOffsetX(8);

donate = new DonateButton(200,320, "Donate");
donate->Scale = 2.0f;
donate->setLabelSize(14);
donate->setTextOffsetX(-26);

donateBitcoin = new DonateBitcoinButton(200,380, "Donate Bitcoin");
donateBitcoin->Scale = 2.0f;
donateBitcoin->setLabelSize(14);
}

void OtherOptions::LoadContent()
Expand All @@ -1417,14 +1452,20 @@ namespace SmashBros
{
Menus::button_back->Update(gameTime);
facebook->Update(gameTime);
twitter->Update(gameTime);
contactDev->Update(gameTime);
donate->Update(gameTime);
donateBitcoin->Update(gameTime);
}

void OtherOptions::Draw(Graphics2D&g, long gameTime)
{
Menus::button_back->Draw(g, gameTime);
facebook->Draw(g, gameTime);
twitter->Draw(g, gameTime);
contactDev->Draw(g, gameTime);
donate->Draw(g, gameTime);
donateBitcoin->Draw(g, gameTime);
}

TrainingCharSelect::ReadyToFightBar::ReadyToFightBar(float x1, float y1) : Actor(x1,y1)
Expand Down
30 changes: 30 additions & 0 deletions Source/SmashBros/Menus/MenuClasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,15 @@ namespace SmashBros
virtual void onRelease();
};

class TwitterButton : public MenuBarSmallButton
{
public:
TwitterButton(float x1, float y1, const String&label);
virtual ~TwitterButton();

virtual void onRelease();
};

class ContactDeveloperButton : public MenuBarSmallButton
{
public:
Expand All @@ -279,8 +288,29 @@ namespace SmashBros
virtual void onRelease();
};

class DonateButton : public MenuBarSmallButton
{
public:
DonateButton(float x1, float y1, const String&label);
virtual ~DonateButton();

virtual void onRelease();
};

class DonateBitcoinButton : public MenuBarSmallButton
{
public:
DonateBitcoinButton(float x1, float y1, const String&label);
virtual ~DonateBitcoinButton();

virtual void onRelease();
};

FacebookButton*facebook;
TwitterButton*twitter;
ContactDeveloperButton*contactDev;
DonateButton*donate;
DonateBitcoinButton*donateBitcoin;
public:
OtherOptions(const String&name);
virtual ~OtherOptions();
Expand Down

0 comments on commit 983aebe

Please sign in to comment.