Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

Commit

Permalink
Added Webpage Link Button
Browse files Browse the repository at this point in the history
No animation
  • Loading branch information
ch0m5 committed Dec 16, 2018
1 parent 50bec04 commit 9483c00
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
Binary file modified Get Hooked/Game/Get Hooked.exe
Binary file not shown.
1 change: 1 addition & 0 deletions Get Hooked/Game/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
<shutDown x1="258" y1="556" w1="32" h1="32" x2="258" y2="556" w2="32" h2="32" x3="258" y3="590" w3="32" h3="32" x4="258" y4="590" w4="32" h4="32"/>
<settings x1="258" y1="692" w1="32" h1="32" x2="258" y2="692" w2="32" h2="32" x3="258" y3="725" w3="32" h3="32" x4="258" y4="725" w4="32" h4="32"/>
<back x1="258" y1="759" w1="32" h1="32" x2="258" y2="759" w2="32" h2="32" x3="258" y3="792" w3="32" h3="32" x4="258" y4="792" w4="32" h4="32"/>
<webpage x1="324" y1="305" w1="32" h1="32" x2="324" y2="305" w2="32" h2="32" x3="324" y3="305" w3="32" h3="32" x4="324" y4="305" w4="32" h4="32" />
<healthBar x="490" y="585" w="230" h="54" />
<healthChunck x="533" y="649" w="48" h="16" />
</ui>
Expand Down
9 changes: 9 additions & 0 deletions Get Hooked/Motor2D/j1Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ void CloseSettings()
App->scene->settingsWindow->Deactivate();
}

void OpenWebpage()
{
ShellExecuteA(NULL, "open", "https://scotland-fury.github.io/Hook_Platformer/", NULL , NULL , SW_SHOWNORMAL);
}

// ------------------------------------------------------------------------------

//Constructor
Expand All @@ -99,6 +104,7 @@ j1Scene::j1Scene() : j1Module()
shutDown = new SDL_Rect[4];
settings = new SDL_Rect[4];
back = new SDL_Rect[4];
webpage = new SDL_Rect[4];
}

// Destructor
Expand All @@ -110,6 +116,7 @@ j1Scene::~j1Scene()
RELEASE_ARRAY(shutDown);
RELEASE_ARRAY(settings);
RELEASE_ARRAY(back);
RELEASE_ARRAY(webpage);
}

// Called before render is available
Expand Down Expand Up @@ -149,6 +156,7 @@ bool j1Scene::Awake(pugi::xml_node& config)
RegisterButtonData(config.child("ui").child("shutDown"), shutDown);
RegisterButtonData(config.child("ui").child("settings"), settings);
RegisterButtonData(config.child("ui").child("back"), back);
RegisterButtonData(config.child("ui").child("webpage"), webpage);

item = config.child("ui").child("healthBar");
healthBar = { item.attribute("x").as_int(), item.attribute("y").as_int(), item.attribute("w").as_int(), item.attribute("h").as_int() };
Expand Down Expand Up @@ -202,6 +210,7 @@ bool j1Scene::Start()
parent = App->ui->CreateActionBox(&GoToCredits, { 1024 / 4, 315 }, button, NULL, false);
App->ui->CreateText(DEFAULT_POINT, "Credits", DEFAULT_COLOR, gameText, false, parent);
App->ui->CreateActionBox(&CloseGame, { 20, 20 }, shutDown, NULL, false);
App->ui->CreateActionBox(&OpenWebpage, { 55, 20 }, webpage, NULL, false);

if (result == NULL) {
loadButton->Disable();
Expand Down
1 change: 1 addition & 0 deletions Get Hooked/Motor2D/j1Scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class j1Scene : public j1Module //CHANGE/FIX: Remake maps 1 and 2, implement cor
SDL_Rect* shutDown;
SDL_Rect* settings;
SDL_Rect* back;
SDL_Rect* webpage;
SDL_Rect healthBar;
SDL_Rect healthChunck;
};
Expand Down

0 comments on commit 9483c00

Please sign in to comment.