Skip to content

Commit

Permalink
Update to v0.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
quyykk committed Aug 25, 2023
1 parent ef34786 commit a24b8ee
Show file tree
Hide file tree
Showing 22 changed files with 502 additions and 238 deletions.
2 changes: 1 addition & 1 deletion endless-sky
Submodule endless-sky updated 1485 files
18 changes: 18 additions & 0 deletions overlays/rapidfuzz/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO maxbachmann/rapidfuzz-cpp
REF v${VERSION}
SHA512 02af141b123545303d634ffe84fbe83e635f06c9ffa3a6506661e53beb22fe7221942b3e46d33b2a49ef929c5de9acfb00c48cb5685c760506c5fcf37c716f9a
HEAD_REF master
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
17 changes: 17 additions & 0 deletions overlays/rapidfuzz/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "rapidfuzz",
"version": "2.0.0",
"description": "Rapid fuzzy string matching library for C++17 using the Levenshtein Distance.",
"homepage": "https://github.com/maxbachmann/rapidfuzz-cpp",
"license": "MIT",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 2 additions & 2 deletions source/ArenaPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ bool ArenaPanel::Click(int x, int y, int clicks)
SDL_Keymod mod = SDL_GetModState();
hasShift = (mod & KMOD_SHIFT);

engine.Click(dragSource, dragSource, hasShift);
engine.Click(dragSource, dragSource, hasShift, false);

return true;
}
Expand Down Expand Up @@ -267,7 +267,7 @@ bool ArenaPanel::Release(int x, int y)
{
dragPoint = Point(x, y);
if(dragPoint.Distance(dragSource) > 5.)
engine.Click(dragSource, dragPoint, hasShift);
engine.Click(dragSource, dragPoint, hasShift, false);

isDragging = false;
}
Expand Down
40 changes: 36 additions & 4 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ target_sources(Editor PRIVATE
../endless-sky/source/AI.h
../endless-sky/source/Account.cpp
../endless-sky/source/Account.h
../endless-sky/source/AlertLabel.cpp
../endless-sky/source/AlertLabel.h
../endless-sky/source/AmmoDisplay.cpp
../endless-sky/source/AmmoDisplay.h
../endless-sky/source/Angle.cpp
../endless-sky/source/Angle.h
../endless-sky/source/Armament.cpp
Expand All @@ -29,6 +33,8 @@ target_sources(Editor PRIVATE
../endless-sky/source/CaptureOdds.h
../endless-sky/source/CargoHold.cpp
../endless-sky/source/CargoHold.h
../endless-sky/source/CategoryList.cpp
../endless-sky/source/CategoryList.h
../endless-sky/source/CategoryTypes.h
../endless-sky/source/ClickZone.h
../endless-sky/source/CollisionSet.cpp
Expand Down Expand Up @@ -64,8 +70,12 @@ target_sources(Editor PRIVATE
../endless-sky/source/Dialog.h
../endless-sky/source/Dictionary.cpp
../endless-sky/source/Dictionary.h
../endless-sky/source/DistanceCalculationSettings.h
../endless-sky/source/DistanceCalculationSettings.cpp
../endless-sky/source/DistanceMap.cpp
../endless-sky/source/DistanceMap.h
../endless-sky/source/Distribution.cpp
../endless-sky/source/Distribution.h
../endless-sky/source/DrawList.cpp
../endless-sky/source/DrawList.h
../endless-sky/source/Effect.cpp
Expand All @@ -87,10 +97,14 @@ target_sources(Editor PRIVATE
../endless-sky/source/FireCommand.h
../endless-sky/source/Fleet.cpp
../endless-sky/source/Fleet.h
../endless-sky/source/FleetCargo.cpp
../endless-sky/source/FleetCargo.h
../endless-sky/source/Flotsam.cpp
../endless-sky/source/Flotsam.h
../endless-sky/source/FogShader.cpp
../endless-sky/source/FogShader.h
../endless-sky/source/FormationPattern.cpp
../endless-sky/source/FormationPattern.h
../endless-sky/source/FrameTimer.cpp
../endless-sky/source/FrameTimer.h
../endless-sky/source/Galaxy.cpp
Expand All @@ -105,6 +119,8 @@ target_sources(Editor PRIVATE
../endless-sky/source/GameEvent.h
../endless-sky/source/GameLoadingPanel.cpp
../endless-sky/source/GameLoadingPanel.h
../endless-sky/source/Gamerules.cpp
../endless-sky/source/Gamerules.h
../endless-sky/source/GameWindow.cpp
../endless-sky/source/GameWindow.h
../endless-sky/source/Government.cpp
Expand All @@ -129,6 +145,7 @@ target_sources(Editor PRIVATE
../endless-sky/source/Interface.h
../endless-sky/source/ItemInfoDisplay.cpp
../endless-sky/source/ItemInfoDisplay.h
../endless-sky/source/JumpTypes.h
../endless-sky/source/Logger.cpp
../endless-sky/source/Logger.h
../endless-sky/source/LineShader.cpp
Expand Down Expand Up @@ -177,6 +194,8 @@ target_sources(Editor PRIVATE
../endless-sky/source/Music.h
../endless-sky/source/NPC.cpp
../endless-sky/source/NPC.h
../endless-sky/source/NPCAction.cpp
../endless-sky/source/NPCAction.h
../endless-sky/source/News.cpp
../endless-sky/source/News.h
../endless-sky/source/Outfit.cpp
Expand Down Expand Up @@ -205,6 +224,8 @@ target_sources(Editor PRIVATE
../endless-sky/source/PlayerInfo.h
../endless-sky/source/PlayerInfoPanel.cpp
../endless-sky/source/PlayerInfoPanel.h
../endless-sky/source/Plugins.cpp
../endless-sky/source/Plugins.h
../endless-sky/source/Point.cpp
../endless-sky/source/Point.h
../endless-sky/source/PointerShader.cpp
Expand All @@ -215,6 +236,8 @@ target_sources(Editor PRIVATE
../endless-sky/source/Preferences.h
../endless-sky/source/PreferencesPanel.cpp
../endless-sky/source/PreferencesPanel.h
../endless-sky/source/PrintData.cpp
../endless-sky/source/PrintData.h
../endless-sky/source/Projectile.cpp
../endless-sky/source/Projectile.h
../endless-sky/source/Radar.cpp
Expand Down Expand Up @@ -242,6 +265,8 @@ target_sources(Editor PRIVATE
../endless-sky/source/ShipInfoDisplay.h
../endless-sky/source/ShipInfoPanel.cpp
../endless-sky/source/ShipInfoPanel.h
../endless-sky/source/ShipJumpNavigation.cpp
../endless-sky/source/ShipJumpNavigation.h
../endless-sky/source/ShipyardPanel.cpp
../endless-sky/source/ShipyardPanel.h
../endless-sky/source/ShopPanel.cpp
Expand All @@ -268,6 +293,7 @@ target_sources(Editor PRIVATE
../endless-sky/source/StellarObject.h
../endless-sky/source/System.cpp
../endless-sky/source/System.h
../endless-sky/source/SystemEntry.h
../endless-sky/source/TaskQueue.cpp
../endless-sky/source/TaskQueue.h
../endless-sky/source/Test.cpp
Expand Down Expand Up @@ -295,10 +321,16 @@ target_sources(Editor PRIVATE
../endless-sky/source/Weather.cpp
../endless-sky/source/Weather.h
../endless-sky/source/WeightedList.h
../endless-sky/source/comparators/ByGivenOrder.h
../endless-sky/source/comparators/ByName.h
../endless-sky/source/Wormhole.cpp
../endless-sky/source/Wormhole.h
../endless-sky/source/WormholeStrategy.h
../endless-sky/source/pi.h
../endless-sky/source/shift.h
../endless-sky/source/comparators/ByGivenOrder.h
../endless-sky/source/comparators/ByName.h
../endless-sky/source/comparators/BySeriesAndIndex.h
../endless-sky/source/ship/ShipAICache.cpp
../endless-sky/source/ship/ShipAICache.h
../endless-sky/source/text/DisplayText.cpp
../endless-sky/source/text/DisplayText.h
../endless-sky/source/text/Font.cpp
Expand Down Expand Up @@ -347,8 +379,8 @@ target_sources(Editor PRIVATE
OutfitterEditorPanel.h
PlanetEditor.cpp
PlanetEditor.h
Plugin.cpp
Plugin.h
EditorPlugin.cpp
EditorPlugin.h
ShipEditor.cpp
ShipEditor.h
ShipyardEditor.cpp
Expand Down
2 changes: 1 addition & 1 deletion source/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const SpriteSet &Editor::Spriteset() const



Plugin &Editor::GetPlugin()
EditorPlugin &Editor::GetPlugin()
{
return plugin;
}
Expand Down
6 changes: 3 additions & 3 deletions source/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "ShipyardEditor.h"
#include "SystemEditor.h"

#include "Plugin.h"
#include "EditorPlugin.h"
#include "UniverseObjects.h"

#include <cstdint>
Expand Down Expand Up @@ -72,7 +72,7 @@ class Editor {
const Set<Sprite> &Sprites() const;
const Set<Sound> &Sounds() const;
const SpriteSet &Spriteset() const;
Plugin &GetPlugin();
EditorPlugin &GetPlugin();

const std::shared_ptr<MapEditorPanel> &MapPanel() const;
const std::shared_ptr<MainEditorPanel> &SystemViewPanel() const;
Expand Down Expand Up @@ -121,7 +121,7 @@ class Editor {
std::shared_ptr<ArenaPanel> arenaPanel;
ArenaControl arenaControl;

Plugin plugin;
EditorPlugin plugin;
std::string currentPluginPath;
bool isGameData = false;

Expand Down
14 changes: 7 additions & 7 deletions source/Plugin.cpp → source/EditorPlugin.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0

#include "Plugin.h"
#include "EditorPlugin.h"

#include "DataFile.h"
#include "DataWriter.h"
Expand Down Expand Up @@ -44,7 +44,7 @@ auto &GetEditorForNodeElement(const Editor &editor)
}


void Plugin::Load(const Editor &editor, string_view path)
void EditorPlugin::Load(const Editor &editor, string_view path)
{
data.clear();
unknownNodes.clear();
Expand Down Expand Up @@ -96,7 +96,7 @@ void Plugin::Load(const Editor &editor, string_view path)



void Plugin::Save(const Editor &editor, string_view path)
void EditorPlugin::Save(const Editor &editor, string_view path)
{
for(const auto &[file, objects] : data)
{
Expand Down Expand Up @@ -127,14 +127,14 @@ void Plugin::Save(const Editor &editor, string_view path)



bool Plugin::HasChanges() const
bool EditorPlugin::HasChanges() const
{
return hasModifications;
}



void Plugin::Add(Node node)
void EditorPlugin::Add(Node node)
{
hasModifications = true;

Expand Down Expand Up @@ -177,7 +177,7 @@ void Plugin::Add(Node node)



bool Plugin::Has(const Node &node) const
bool EditorPlugin::Has(const Node &node) const
{
return std::visit([this](const auto *ptr)
{
Expand All @@ -187,7 +187,7 @@ bool Plugin::Has(const Node &node) const



void Plugin::Remove(const Node &node)
void EditorPlugin::Remove(const Node &node)
{
hasModifications = true;
std::visit([this](const auto *ptr)
Expand Down
10 changes: 5 additions & 5 deletions source/Plugin.h → source/EditorPlugin.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-3.0

#ifndef PLUGIN_H_
#define PLUGIN_H_
#ifndef EDITOR_PLUGIN_H_
#define EDITOR_PLUGIN_H_

#include "Sale.h"

Expand Down Expand Up @@ -29,7 +29,7 @@ class System;


// This class stores a list of objects that the plugin contains.
class Plugin {
class EditorPlugin {
public:
using Node = std::variant<const Effect *, const Fleet *, const Galaxy *, const Hazard *,
const Government *, const Outfit *, const Sale<Outfit> *, const Planet *, const Ship *,
Expand Down Expand Up @@ -91,7 +91,7 @@ class Plugin {


template <typename T>
std::map<T, std::string> &Plugin::GetMapForNodeElement()
std::map<T, std::string> &EditorPlugin::GetMapForNodeElement()
{
const auto &This = *this;
return const_cast<std::map<T, std::string> &>(This.GetMapForNodeElement<T>());
Expand All @@ -100,7 +100,7 @@ std::map<T, std::string> &Plugin::GetMapForNodeElement()


template <typename T>
const std::map<T, std::string> &Plugin::GetMapForNodeElement() const
const std::map<T, std::string> &EditorPlugin::GetMapForNodeElement() const
{
if constexpr(std::is_same_v<T, const Effect *>)
return effects;
Expand Down
Loading

0 comments on commit a24b8ee

Please sign in to comment.