#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 },