#include "vg/vg.h"
#include "fishladder_resources.h"
+// #define STEAM_LEADERBOARDS
+
// CONSTANTS
// ===========================================================================================================
if( vg_get_button_up("secondary") && world.id_drag_from == world.selected )
{
- u32 link_id = local_x > 0.5f? 1: 0;
+ u32 link_id = cell_ptr->links[ 0 ]? 0: 1;
// break existing connection off
if( cell_ptr->links[ link_id ] )
world.id_drag_from = 0;
}
- if( world.id_drag_from && (cell_ptr->state & FLAG_CANAL) && (cell_ptr->config == k_cell_type_split) )
+ else if( world.id_drag_from && (cell_ptr->state & FLAG_CANAL) && (cell_ptr->config == k_cell_type_split) )
{
world.drag_to_co[0] = (float)world.tile_x + (local_x > 0.5f? 0.75f: 0.25f);
world.drag_to_co[1] = (float)world.tile_y + 0.25f;
int const empty_start = circle_base+32;
int const empty_count = circle_base+32*2;
+ if( !world.initialzed )
+ return;
+
// BACKGROUND
// ========================================================================================================
use_mesh( &world.shapes );
void leaderboard_dispatch_score(void)
{
+#if STEAM_LEADERBOARDS
sw_upload_leaderboard_score(
ui_data.upload_request.level->steam_leaderboard,
k_ELeaderboardUploadScoreMethodKeepBest,
ui_data.upload_request.is_waiting = 0;
vg_success( "Dispatched leaderboard score\n" );
+#endif
}
void leaderboard_found( LeaderboardFindResult_t *pCallback )
{
+#ifdef STEAM_LEADERBOARDS
if( !pCallback->m_bLeaderboardFound )
{
vg_error( "Leaderboard could not be found\n" );
}
}
}
+#endif
}
void leaderboard_downloaded( LeaderboardScoresDownloaded_t *pCallback )
{
+#ifdef STEAM_LEADERBOARDS
// Update UI if this leaderboard matches what we currently have in view
if( ui_data.level_selected->steam_leaderboard == pCallback->m_hSteamLeaderboard )
{
ui_data.leaderboard_show = 0;
}
else vg_warn( "Downloaded leaderboard does not match requested!\n" );
+#endif
}
void leaderboard_set_score( struct cmp_level *cmp_level, u32 score )
{
+#ifdef STEAM_LEADERBOARDS
if( ui_data.upload_request.is_waiting )
vg_warn( "You are uploading leaderboard entries too quickly!\n" );
leaderboard_dispatch_score();
else
sw_find_leaderboard( cmp_level->map_name );
+#endif
}
// CONSOLE COMMANDS
void vg_start(void)
{
// Steamworks callbacks
+ #ifdef STEAM_LEADERBOARDS
sw_leaderboard_found = &leaderboard_found;
sw_leaderboard_downloaded = &leaderboard_downloaded;
+ #endif
vg_function_push( (struct vg_cmd){
.name = "_map_write",