about summary refs log tree commit diff stats
path: root/src/connection_dialog.cpp
blob: 9dd998470deec8e3cfe18e65e38414709a08f48f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "connection_dialog.h"

#include "tracker_config.h"

ConnectionDialog::ConnectionDialog()
    : wxDialog(nullptr, wxID_ANY, "Connect to Archipelago") {
  server_box_ = new wxTextCtrl(this, -1, GetTrackerConfig().ap_server, wxDefaultPosition,
                               {300, -1});
  player_box_ = new wxTextCtrl(this, -1, GetTrackerConfig().ap_player, wxDefaultPosition,
                               {300, -1});
  password_box_ = new wxTextCtrl(this, -1, GetTrackerConfig().ap_password,
                                 wxDefaultPosition, {300, -1});

  wxFlexGridSizer* form_sizer = new wxFlexGridSizer(2, 10, 10);

  form_sizer->Add(
      new wxStaticText(this, -1, "Server:"),
      wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT));
  form_sizer->Add(server_box_, wxSizerFlags().Expand());
  form_sizer->Add(
      new wxStaticText(this, -1, "Player:"),
      wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT));
  form_sizer->Add(player_box_, wxSizerFlags().Expand());
  form_sizer->Add(
      new wxStaticText(this, -1, "Password:"),
      wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT));
  form_sizer->Add(password_box_, wxSizerFlags().Expand());

  wxBoxSizer* top_sizer = new wxBoxSizer(wxVERTICAL);
  top_sizer->Add(new wxStaticText(
                     this, -1, "Enter the details to connect to Archipelago."),
                 wxSizerFlags().Align(wxALIGN_LEFT).DoubleBorder());
  top_sizer->Add(form_sizer, wxSizerFlags().DoubleBorder().Expand());
  top_sizer->Add(CreateButtonSizer(wxOK | wxCANCEL), wxSizerFlags().Center());

  SetSizerAndFit(top_sizer);

  Center();
  server_box_->SetFocus();
}
span> ^
46f46b4 ^








a3d5e37 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68


                                    




                                                 


                                       
                                  
                          


                    



                          
                             
                       
                          
                         
                 
                     
        

 


                                          

                                         
                               






                             

                          
                             
                           
                  
                      
                       
                  
                         
                     
                      
                              
 
                                                              
                                                                       
                                                                                                                                                           








                                                                    
                                              
cmake_minimum_required (VERSION 3.1)
project (lingo_ap_tracker)

if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
set(CMAKE_WIN32_EXECUTABLE true)
endif(MSVC)

find_package(wxWidgets CONFIG REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(websocketpp REQUIRED)
find_package(fmt REQUIRED)

include_directories(
  vendor/hkutil
  vendor/apclientpp
  vendor/asio/asio/include
  vendor/nlohmann
  vendor/valijson/include
  ${websocketpp_INCLUDE_DIRS}
  vendor/wswrap/include
  ${yaml-cpp_INCLUDE_DIRS}
  ${OpenSSL_INCLUDE_DIRS}
  vendor/whereami
  ${fmt_INCLUDE_DIRS}
  vendor
)

find_path(SYSTEM_INCLUDE_DIR zlib.h)
include_directories(${SYSTEM_INCLUDE_DIR})

link_directories(${openssl_LIBRARY_DIRS})

add_executable(lingo_ap_tracker
  "src/main.cpp"
  "src/tracker_frame.cpp"
  "src/tracker_panel.cpp"
  "src/game_data.cpp"
  "src/area_popup.cpp"
  "src/ap_state.cpp"
  "src/connection_dialog.cpp"
  "src/tracker_state.cpp"
  "src/tracker_config.cpp"
  "src/achievements_pane.cpp"
  "src/settings_dialog.cpp"
  "src/global.cpp"
  "src/subway_map.cpp"
  "src/network_set.cpp"
  "src/logger.cpp"
  "src/godot_variant.cpp"
  "src/ipc_state.cpp"
  "src/ipc_dialog.cpp"
  "vendor/whereami/whereami.c"
)
set_property(TARGET lingo_ap_tracker PROPERTY CXX_STANDARD 20)
set_property(TARGET lingo_ap_tracker PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(lingo_ap_tracker PRIVATE fmt::fmt OpenSSL::SSL OpenSSL::Crypto websocketpp::websocketpp wx::core wx::base wx::net yaml-cpp::yaml-cpp)

set(SRC_DIR "${CMAKE_SOURCE_DIR}/assets")
set(DST_DIR "${CMAKE_BINARY_DIR}/$<CONFIG>/assets")

add_custom_target(copy_assets ALL
    COMMAND ${CMAKE_COMMAND} -E copy_directory ${SRC_DIR} ${DST_DIR}
    COMMENT "Copying folder from ${SRC_DIR} to ${DST_DIR}"
)

add_dependencies(lingo_ap_tracker copy_assets)