mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-04 17:47:14 +01:00
feat(launcher): -edit without a scenery opens the wizard of a new scenery: file name, title and centre, picked on the OpenStreetMap map of geoportal.gov.pl in PUWG 1992 or given in degrees; the scenery is written with the centre as its //$g reference and opened in the editor; a bare -edit no longer loads the scenery of eu07.ini
This commit is contained in:
70
launcher/scenery_wizard.h
Normal file
70
launcher/scenery_wizard.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
This Source Code Form is subject to the
|
||||
terms of the Mozilla Public License, v.
|
||||
2.0. If a copy of the MPL was not
|
||||
distributed with this file, You can
|
||||
obtain one at
|
||||
http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "application/uilayer.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <future>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace ui
|
||||
{
|
||||
|
||||
class scenerywizard_panel : public ui_panel
|
||||
{
|
||||
public:
|
||||
scenerywizard_panel();
|
||||
~scenerywizard_panel() override;
|
||||
|
||||
void render_contents() override;
|
||||
|
||||
private:
|
||||
struct map_result
|
||||
{
|
||||
glm::dvec2 low{0.0};
|
||||
glm::dvec2 high{0.0};
|
||||
int width{0};
|
||||
int height{0};
|
||||
std::vector<std::uint8_t> pixels;
|
||||
std::string error;
|
||||
};
|
||||
|
||||
void render_map(glm::vec2 const &Size);
|
||||
void render_form();
|
||||
void request_map(glm::vec2 const &Size);
|
||||
void upload_map();
|
||||
void pick(glm::dvec2 const &Point);
|
||||
bool create_scenery();
|
||||
|
||||
glm::dvec2 m_centre{515000.0, 460000.0};
|
||||
double m_scale{1000.0};
|
||||
bool m_fitted{false};
|
||||
double m_changed{0.0};
|
||||
bool m_dirty{true};
|
||||
glm::vec2 m_pressed{0.f};
|
||||
bool m_dragging{false};
|
||||
|
||||
std::future<map_result> m_request;
|
||||
unsigned int m_texture{0};
|
||||
glm::dvec2 m_image_low{0.0};
|
||||
glm::dvec2 m_image_high{0.0};
|
||||
std::string m_map_error;
|
||||
|
||||
bool m_picked{false};
|
||||
glm::dvec2 m_point{0.0};
|
||||
char m_name[64]{};
|
||||
char m_title[128]{};
|
||||
char m_latlon[64]{};
|
||||
std::string m_status;
|
||||
};
|
||||
|
||||
} // namespace ui
|
||||
Reference in New Issue
Block a user