|
| 1 | +#pragma once |
| 2 | + |
| 3 | +#include "game/game_engine_variant.hpp" |
| 4 | +#include "interface/c_gui_screen_widget.hpp" |
| 5 | +#include "interface/user_interface_data.hpp" |
| 6 | +#include "interface/user_interface_messages.hpp" |
| 7 | +#include "main/global_preferences.hpp" |
| 8 | +#include "multithreading/synchronized_value.hpp" |
| 9 | +#include "networking/online/online_guide_pc.hpp" |
| 10 | +#include "networking/tools/network_blf.hpp" |
| 11 | + |
| 12 | +class c_virtual_keyboard_task; |
| 13 | + |
| 14 | +struct s_game_options_history_stack_node |
| 15 | +{ |
| 16 | + e_game_engine_category template_category; |
| 17 | + e_game_engine_category interface_category; |
| 18 | + int32 focused_element_handle; |
| 19 | +}; |
| 20 | +static_assert(sizeof(s_game_options_history_stack_node) == 0xC); |
| 21 | + |
| 22 | +class c_game_options_category_datasource : |
| 23 | + public c_gui_ordered_data |
| 24 | +{ |
| 25 | +public: |
| 26 | + //virtual ~c_game_options_category_datasource(); |
| 27 | + //virtual void get_column_names(int32*, int32); |
| 28 | + //virtual bool get_element(int32, void*, int32); |
| 29 | + //virtual bool get_string_id_value(int32, int32, int32*); |
| 30 | + |
| 31 | +protected: |
| 32 | + //virtual int32 get_current_item_count_internal(); |
| 33 | + |
| 34 | +public: |
| 35 | + //c_game_options_category_datasource(const c_game_options_category_datasource&); |
| 36 | + //c_game_options_category_datasource(e_game_engine_category, e_game_engine_category, const c_game_variant*); |
| 37 | + //c_game_options_category_datasource& operator=(const c_game_options_category_datasource&); |
| 38 | + |
| 39 | +private: |
| 40 | + const c_game_variant* m_edit_variant; |
| 41 | + e_game_engine_category m_template_category; |
| 42 | + e_game_engine_category m_interface_category; |
| 43 | +}; |
| 44 | + |
| 45 | +class c_game_options_parameter_datasource : |
| 46 | + public c_gui_ordered_data |
| 47 | +{ |
| 48 | +public: |
| 49 | + //virtual ~c_game_options_parameter_datasource(); |
| 50 | + //virtual void get_column_names(int32* const column_names, int32* column_count) override; |
| 51 | + //virtual bool get_integer_value(int32 element_handle, int32 value_name, int32* value) override; |
| 52 | + //virtual bool get_string_id_value(int32 element_handle, int32 value_name, int32* value) override; |
| 53 | + //virtual int32 get_current_item_count_internal() override; |
| 54 | + |
| 55 | +private: |
| 56 | + e_game_variant_parameter m_parameter; |
| 57 | +}; |
| 58 | +static_assert(sizeof(s_game_options_history_stack_node) == 0xC); |
| 59 | + |
| 60 | +class c_load_game_options_screen_message : |
| 61 | + public c_load_screen_message |
| 62 | +{ |
| 63 | +public: |
| 64 | + //virtual ~c_load_game_options_screen_message(); |
| 65 | + //virtual void apply_initial_state(c_gui_screen_widget* screen) const override; |
| 66 | + |
| 67 | +private: |
| 68 | + c_game_variant m_edit_game_variant; |
| 69 | + c_game_variant m_revert_game_variant; |
| 70 | + e_game_engine_category m_template_category; |
| 71 | + e_game_engine_category m_interface_category; |
| 72 | + int32 m_focused_element_handle; |
| 73 | + s_game_options_history_stack_node m_settings_history_stack[16]; |
| 74 | + int32 m_history_stack_depth; |
| 75 | + int32 m_layered_position; |
| 76 | +}; |
| 77 | + |
| 78 | +class c_gui_screen_game_options : |
| 79 | + public c_gui_screen_widget |
| 80 | +{ |
| 81 | +public: |
| 82 | + enum e_asynchronous_operation |
| 83 | + { |
| 84 | + _operation_none = 0, |
| 85 | + _operation_save, |
| 86 | + _operation_save_as_new, |
| 87 | + _operation_rename, |
| 88 | + _operation_revert_changes, |
| 89 | + |
| 90 | + k_number_of_variant_desired_operations, |
| 91 | + }; |
| 92 | + |
| 93 | + enum e_destructive_action_confirmation_result |
| 94 | + { |
| 95 | + _result_indeterminate = 0, |
| 96 | + _result_confirmation, |
| 97 | + _result_cancellation, |
| 98 | + }; |
| 99 | + |
| 100 | + enum e_variant_save_options_dialog_result |
| 101 | + { |
| 102 | + _save = 0, |
| 103 | + _save_as_new, |
| 104 | + _revert, |
| 105 | + _cancel, |
| 106 | + |
| 107 | + k_number_of_variant_save_options_dialog_results, |
| 108 | + |
| 109 | + _invalid_result = NONE, |
| 110 | + }; |
| 111 | + |
| 112 | +public: |
| 113 | + //virtual ~c_gui_screen_game_options(); |
| 114 | + //virtual void initialize() override; |
| 115 | + //virtual void post_initialize() override; |
| 116 | + //virtual void update(uns32 current_milliseconds) override; |
| 117 | + //virtual bool handle_controller_input_message(const c_controller_input_message* message) override; |
| 118 | + //virtual void initialize_datasource(); |
| 119 | + //virtual bool handle_list_item_chosen(const c_controller_input_message* message, int32 list_name, c_gui_list_item_widget* list_item_widget, c_gui_data* datasource); |
| 120 | + //virtual bool handle_dialog_result(const c_dialog_result_message* message); |
| 121 | + |
| 122 | +private: |
| 123 | + c_game_variant m_edit_game_variant; |
| 124 | + c_game_variant m_revert_game_variant; |
| 125 | + e_game_variant_parameter m_editing_parameter; |
| 126 | + s_game_options_history_stack_node m_settings_history_stack[16]; |
| 127 | + int32 m_setting_stack_depth; |
| 128 | + int32 m_layered_position; |
| 129 | + e_asynchronous_operation m_asynchronous_operation; |
| 130 | + e_variant_save_options_dialog_result m_confirmation_action; |
| 131 | + e_destructive_action_confirmation_result m_confirmation_result; |
| 132 | + s_blffile_game_variant m_variant_on_disk; |
| 133 | + e_controller_index m_asynchronous_operation_controller; |
| 134 | + c_virtual_keyboard_task* m_keyboard_task; |
| 135 | + wchar_t m_virtual_keyboard_results_buffer[256]; |
| 136 | + c_string_verify_task m_string_verify_task; |
| 137 | + wchar_t m_saved_game_name_buffer[128]; |
| 138 | + wchar_t m_saved_game_description_buffer[128]; |
| 139 | + s_gui_game_setup_storage::s_multiplayer_settings m_multiplayer_setup; |
| 140 | + int32 m_create_new_variant_task; |
| 141 | + int32 m_write_new_variant_task; |
| 142 | + int32 m_delete_edit_variant_task; |
| 143 | + int32 m_write_variant_task; |
| 144 | + c_synchronized_long m_async_success; |
| 145 | + c_synchronized_long m_async_complete; |
| 146 | + c_synchronized_long m_content_item_index; |
| 147 | + uns32 m_progress_dialog_start_time_milliseconds; |
| 148 | +}; |
| 149 | +static_assert(sizeof(c_gui_screen_game_options) == 0x11758); |
| 150 | +static_assert(sizeof(c_gui_screen_game_options) == sizeof(c_gui_screen_widget) + 0xFCB8); |
| 151 | + |
0 commit comments