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

Commit

Permalink
Add Discord button
Browse files Browse the repository at this point in the history
  • Loading branch information
ShamblesSM committed Feb 13, 2023
1 parent 1fea209 commit bb43eef
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions games/ZumaBlitzRemake/sprites/main/button_discord.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"path": "images/main/button_discord.png",
"frame_size": {
"x": 268,
"y": 64
},
"states": [
{
"pos": {
"x": 0,
"y": 0
},
"frames": {
"x": 1,
"y": 1
}
},
{
"pos": {
"x": 0,
"y": 64
},
"frames": {
"x": 1,
"y": 1
}
},
{
"pos": {
"x": 0,
"y": 128
},
"frames": {
"x": 1,
"y": 1
}
},
{
"pos": {
"x": 0,
"y": 192
},
"frames": {
"x": 1,
"y": 1
}
}
],
"internal": false,
"batched": false
}
21 changes: 21 additions & 0 deletions games/ZumaBlitzRemake/ui/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,27 @@
"buttonClick": "mainFoodTemp"
}
},
"Button_Discord": {
"inheritShow": true,
"inheritHide": true,
"type": "spriteButton",
"pos": {
"x": 478,
"y": 488
},
"alpha": 1,
"children": {},
"animations": {},
"sounds": {},
"layer": "MenuControls",
"sprite": "sprites/main/button_discord.json",
"callbacks": {
"buttonClick": {
"name": "openURL",
"parameters": ["https://discord.gg/gJgy5x5"]
}
}
},
"Leaderboards": "ui/menu_leaderboard_table.json"
},
"sprite": "sprites/main/background.json",
Expand Down
8 changes: 8 additions & 0 deletions games/ZumaBlitzRemake/ui/script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,14 @@ end



-- URL OPEN
function c.openURL(f, params)
local url = params[1]
f.openURL(url)
end



-- WHEN CLICKED "FOOD" ON MAIN MENU
function c.mainFoodTemp(f)
c.foodUpdateButtons(f)
Expand Down
2 changes: 2 additions & 0 deletions src/UI/Manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ function UIManager:new()
-- BEGIN FORK-SPECIFIC FUNCTIONS --
-- TODO: Migrate these to UI2 once implemented

openURL = function(url) love.system.openURL(url) end,

getPower = function(power) return _Game.configManager:getPower(power) end,
getFoodItem = function(foodItem) return _Game.configManager:getFoodItem(foodItem) end,
getFoodItems = function() return _Game.configManager.foodItems end,
Expand Down

0 comments on commit bb43eef

Please sign in to comment.