box.prop( data[0], 'flag_loop' )
box.prop( data[0], 'flag_auto' )
+ layout.prop( data[0], 'probability_curve' )
+
split = layout.split(factor=0.7)
c = split.column()
c.label( text='Filepath' )
c = split.column()
- c.label( text='Chance (0.1s)' )
-
- layout.prop( data[0], 'probability_curve' )
-
+ c.label( text='Chance' )
layout.template_list('SR_UL_AUDIO_LIST', 'Files', \
- data[0], 'files', data[0], 'file_index', rows=5)
+ data[0], 'files', data[0], 'files_index', rows=5)
row = layout.row()
row.operator( 'skaterift.al_new_entry', text='Add' )
#include "shaders/model_menu.h"
#include "audio.h"
#include "input.h"
+#include "workshop.h"
#define MENU_STACK_SIZE 8
struct {
- int active;
+ int active, credits_open;
f32 factive;
int disable_open;
menu.active = 0;
menu.page = 0xffffffff;
}
+ else if( MDL_CONST_PSTREQ( &menu.model, q, "credits" ) ){
+ menu.credits_open = 1;
+ }
+ else if( MDL_CONST_PSTREQ( &menu.model, q, "workshop" ) ){
+ workshop_submit_command(0,NULL);
+ }
}
else if( item->type == k_ent_menuitem_type_page_button ){
menu_open_page( mdl_pstr( &menu.model, item->button.pstr ) );
*/
static void menu_update(void)
{
+ if( workshop_form.page != k_workshop_form_hidden ){
+ return;
+ }
+
+ int escape = button_down( k_srbind_mback );
+ if( menu.credits_open ){
+ if( escape ){
+ menu.credits_open = 0;
+ }
+ return;
+ }
+
if( button_down( k_srbind_mopen ) ){
if( !menu.active && !menu.disable_open ){
menu.active = 1;
md = button_down( k_srbind_mdown ),
mh = ml-mr,
mv = mu-md,
- enter = button_down( k_srbind_maccept ),
- escape = button_down( k_srbind_mback );
+ enter = button_down( k_srbind_maccept );
if( mh||mv||enter ){
menu.input_mode = k_menu_input_mode_keys;
shader_blitcolour_uColour( colour );
render_fsquad();
+ if( workshop_form.page != k_workshop_form_hidden ){
+ return;
+ }
+
+ if( menu.credits_open ){
+ ui_rect panel = { 0,0, 460, 400 },
+ screen = { 0,0, vg.window_x,vg.window_y };
+ ui_rect_center( screen, panel );
+ ui_fill( panel, ui_colour(k_ui_bg) );
+ ui_outline( panel, 1, ui_colour(k_ui_fg) );
+ ui_rect_pad( panel, (ui_px[]){8,8} );
+
+ ui_rect title;
+ ui_split( panel, k_ui_axis_h, 28*2, 0, title, panel );
+ ui_text( title, "Skate Rift - Credits", 2, k_ui_align_middle_center, 0 );
+ ui_split( panel, k_ui_axis_h, 28, 0, title, panel );
+ ui_text( title, "Mt.Zero Software", 1, k_ui_align_middle_center, 0 );
+
+ ui_split( panel, k_ui_axis_h, 8, 0, title, panel );
+ ui_split( panel, k_ui_axis_h, 28, 0, title, panel );
+ ui_text( title, "A game by Harry Godden", 1,
+ k_ui_align_middle_center, 0 );
+
+ ui_split( panel, k_ui_axis_h, 8, 0, title, panel );
+ ui_split( panel, k_ui_axis_h, 28*2, 0, title, panel );
+ ui_text( title, "Free Software", 2, k_ui_align_middle_center, 0 );
+
+ ui_split( panel, k_ui_axis_h, 8, 0, title, panel );
+ ui_text( panel,
+ "Sam Lantinga - SDL2 - libsdl.org\n"
+ "Hunter WB - Anyascii\n"
+ "David Herberth - GLAD\n"
+ "Dominic Szablewski - QOI - qoiformat.org\n"
+ "Sean Barrett - stb_image,stb_vorbis,stb_include\n"
+ "Khronos Group - OpenGL\n"
+ , 1, k_ui_align_left, 0 );
+ return;
+ }
+
glEnable( GL_DEPTH_TEST );
glDisable( GL_BLEND );
#ifndef WORKSHOP_C
#define WORKSHOP_C
+#include "workshop.h"
+
#define VG_GAME
#include "vg/vg.h"
#include "vg/vg_tex.h"
#include "steam.h"
#include "highscores.h"
-#define WORKSHOP_VIEW_PER_PAGE 15
-
-struct workshop_form{
- struct {
- char title[80];
- char description[512];
- char author[32];
- struct ui_dropdown_value submission_type_selection;
- enum workshop_file_type type;
-
- PublishedFileId_t file_id; /* 0 if not published yet */
-
- struct ui_dropdown_value visibility;
- int submit_title, /* set if the respective controls are touched */
- submit_description,
- submit_file_and_image;
- }
- submission;
-
- enum workshop_form_page{
- k_workshop_form_hidden,
- k_workshop_form_open, /* open but not looking at anything */
- k_workshop_form_edit, /* editing a submission */
- k_workshop_form_cclosing,
- k_workshop_form_closing_good, /* post upload screen */
- k_workshop_form_closing_bad,
- }
- page;
-
- /* model viewer
- * -----------------------------
- */
-
- char addon_folder[128];
- struct player_board board_model;
-
- /* what does the user want to do with the image preview? */
- enum workshop_form_file_intent{
- k_workshop_form_file_intent_none, /* loading probably */
- k_workshop_form_file_intent_new, /* board_model is valid */
- k_workshop_form_file_intent_keep_old /* just browsing */
- }
- file_intent;
-
- world_instance *view_world;
- ent_swspreview *ptr_ent;
- v2f view_angles,
- view_angles_begin;
- v3f view_offset,
- view_offset_begin;
-
- float view_dist;
- int view_changed;
-
- /*
- * published UGC request
- * ------------------------------
- */
-
- struct {
- UGCQueryHandle_t handle;
- EResult result;
-
- int all_item_count,
- returned_item_count;
- }
- ugc_query;
-
- /*
- * UI information
- * ------------------------------------------
- */
-
- const char *failure_or_success_string;
-
- int img_w, img_h;
- u8 *img_buffer;
-
- int view_published_page_count,
- view_published_page_id;
-
- struct published_file{
- EResult result;
- int result_index;
- char title[80];
- }
- published_files_list[WORKSHOP_VIEW_PER_PAGE];
- int published_files_list_length;
-}
-static workshop_form;
-
static struct ui_dropdown_opt workshop_form_visibility_opts[] = {
{ "Public", k_ERemoteStoragePublishedFileVisibilityPublic },
{ "Unlisted", k_ERemoteStoragePublishedFileVisibilityUnlisted },
#include "vg/vg_steam_remote_storage.h"
#include "skaterift.h"
#include "pointcloud.h"
+#include "vg/vg_steam_auth.h"
+#include "vg/vg_steam_ugc.h"
+#include "vg/vg_steam_friends.h"
+#include "steam.h"
+#include "ent_skateshop.h"
struct async_workshop_filepath_info{
PublishedFileId_t id;
const char *path;
};
+
+#define WORKSHOP_VIEW_PER_PAGE 15
+
+struct workshop_form{
+ struct {
+ char title[80];
+ char description[512];
+ char author[32];
+ struct ui_dropdown_value submission_type_selection;
+ enum workshop_file_type type;
+
+ PublishedFileId_t file_id; /* 0 if not published yet */
+
+ struct ui_dropdown_value visibility;
+ int submit_title, /* set if the respective controls are touched */
+ submit_description,
+ submit_file_and_image;
+ }
+ submission;
+
+ enum workshop_form_page{
+ k_workshop_form_hidden,
+ k_workshop_form_open, /* open but not looking at anything */
+ k_workshop_form_edit, /* editing a submission */
+ k_workshop_form_cclosing,
+ k_workshop_form_closing_good, /* post upload screen */
+ k_workshop_form_closing_bad,
+ }
+ page;
+
+ /* model viewer
+ * -----------------------------
+ */
+
+ char addon_folder[128];
+ struct player_board board_model;
+
+ /* what does the user want to do with the image preview? */
+ enum workshop_form_file_intent{
+ k_workshop_form_file_intent_none, /* loading probably */
+ k_workshop_form_file_intent_new, /* board_model is valid */
+ k_workshop_form_file_intent_keep_old /* just browsing */
+ }
+ file_intent;
+
+ world_instance *view_world;
+ ent_swspreview *ptr_ent;
+ v2f view_angles,
+ view_angles_begin;
+ v3f view_offset,
+ view_offset_begin;
+
+ float view_dist;
+ int view_changed;
+
+ /*
+ * published UGC request
+ * ------------------------------
+ */
+
+ struct {
+ UGCQueryHandle_t handle;
+ EResult result;
+
+ int all_item_count,
+ returned_item_count;
+ }
+ ugc_query;
+
+ /*
+ * UI information
+ * ------------------------------------------
+ */
+
+ const char *failure_or_success_string;
+
+ int img_w, img_h;
+ u8 *img_buffer;
+
+ int view_published_page_count,
+ view_published_page_id;
+
+ struct published_file{
+ EResult result;
+ int result_index;
+ char title[80];
+ }
+ published_files_list[WORKSHOP_VIEW_PER_PAGE];
+ int published_files_list_length;
+}
+static workshop_form;
+
+
+
+VG_STATIC int workshop_submit_command( int argc, const char *argv[] );
VG_STATIC void async_workshop_get_filepath( void *data, u32 len );
VG_STATIC void async_workshop_get_installed_files( void *data, u32 len );
VG_STATIC void workshop_load_metadata( const char *path,
p = clip->probability * mod;
bar += p;
-
if( chance < bar ){
audio_lock();
glBindBuffer( GL_UNIFORM_BUFFER, world->ubo_lighting );
glBufferSubData( GL_UNIFORM_BUFFER, 0,
sizeof(struct ub_world_lighting), &world->ub_lighting );
+
+ /* yes we are using this as the entity begin thing. FIXME */
+ world->probabilities[ k_probability_curve_constant ] = 1.0f;
+ for( u32 i=0; i<mdl_arrcount(&world->ent_audio); i++ ){
+ ent_audio *audio = mdl_arritm(&world->ent_audio,i);
+ if( audio->flags & AUDIO_FLAG_AUTO_START ){
+ ent_call call;
+ call.data = NULL;
+ call.function = k_ent_function_trigger;
+ call.id = mdl_entity_id( k_ent_audio, i );
+ entity_call( world, &call );
+ }
+ }
}
/* Loads textures from the pack file */