fnugz's idea
[carveJwlIkooP6JGAAIwe30JlM.git] / steam.h
diff --git a/steam.h b/steam.h
index f6eadcd1ba81390c1c2aec756482b1f5440ce2f4..969f632aadeb0500de27fe474f72ee63efb03794 100644 (file)
--- a/steam.h
+++ b/steam.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2021-2022 Mt.ZERO Software, Harry Godden - All Rights Reserved
+ * Copyright (C) 2021-2023 Mt.ZERO Software, Harry Godden - All Rights Reserved
  * All trademarks are property of their respective owners
  */
 
 #include "vg/vg_steam_http.h"
 #include "vg/vg_steam_friends.h"
 #include "vg/vg_steam_user_stats.h"
+#include "submodules/anyascii/impl/c/anyascii.c"
+
+enum steam_controller_type{
+   k_steam_controller_type_keyboard,
+   k_steam_controller_type_xbox,
+   k_steam_controller_type_playstation,
+   k_steam_controller_type_steam,
+   k_steam_controller_type_steam_deck
+};
+
+VG_STATIC enum steam_controller_type steam_display_controller;
 
 /*
  * We only want to use steamworks if building for the networked version,
@@ -257,23 +268,9 @@ VG_STATIC int steam_init(void)
       vg_warn( "No Steam Logon: Cannot request stats\n" );
 
 
-       vg_function_push( (struct vg_cmd)
-   {
-               .name = "ach_list",
-               .function = steam_list_achievements
-       });
-
-       vg_function_push( (struct vg_cmd)
-   {
-               .name = "ach_clear_all",
-               .function = steam_clear_all_achievements
-       });
-
-       vg_function_push( (struct vg_cmd)
-   {
-               .name = "ach_set",
-               .function = steam_set_achievemnt_test
-       });
+   vg_console_reg_cmd( "ach_list", steam_list_achievements, NULL );
+   vg_console_reg_cmd( "ach_clear_all", steam_clear_all_achievements, NULL );
+   vg_console_reg_cmd( "ach_set", steam_set_achievemnt_test, NULL );
 
    steam_hInput = SteamAPI_SteamInput();
    SteamAPI_ISteamInput_Init( steam_hInput, 0 );
@@ -309,29 +306,29 @@ VG_STATIC void steam_update(void)
 
             if( type == k_ESteamInputType_SteamController ){
                vg_input.controller_should_use_trackpad_look = 1;
-               menu_display_controller = k_menu_controller_type_steam;
+               steam_display_controller = k_steam_controller_type_steam;
             }
             else if( type == k_ESteamInputType_SteamDeckController ){
-               menu_display_controller = k_menu_controller_type_steam_deck;
+               steam_display_controller = k_steam_controller_type_steam_deck;
             }
             else if( type == k_ESteamInputType_PS3Controller ||
                      type == k_ESteamInputType_PS4Controller ||
                      type == k_ESteamInputType_PS5Controller )
             {
-               menu_display_controller = k_menu_controller_type_playstation;
+               steam_display_controller = k_steam_controller_type_playstation;
             }
             else if( type == k_ESteamInputType_XBox360Controller ||
                      type == k_ESteamInputType_XBoxOneController )
             {
-               menu_display_controller = k_menu_controller_type_xbox;
+               steam_display_controller = k_steam_controller_type_xbox;
             }
             else{
                /* currently unsupported controller */
-               menu_display_controller = k_menu_controller_type_xbox;
+               steam_display_controller = k_steam_controller_type_xbox;
             }
          }
          else
-            menu_display_controller = k_menu_controller_type_keyboard;
+            steam_display_controller = k_steam_controller_type_keyboard;
       }
    }
 }