Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move src/core to src/ff7tk #170

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/ff7tkMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ endmacro()
macro (MAKE_TEST NAME FILE)
get_filename_component(curDir ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(DEP_LIB ff7tk)
if( NOT ${curDir} MATCHES core)
if( NOT ${curDir} MATCHES ${CMAKE_PROJECT_NAME})
string(SUBSTRING ${curDir} 0 1 FIRST_LETTER)
string(TOUPPER ${FIRST_LETTER} FIRST_LETTER)
string(REGEX REPLACE "^.(.*)" "${FIRST_LETTER}\\1" curDir_UPPER "${curDir}")
Expand Down
2 changes: 1 addition & 1 deletion demos/ff7tkQmlGallery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS
)
set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src ${CMAKE_BINARY_DIR}/imports CACHE STRING "" FORCE)

find_library(ff7tk ${CMAKE_BINARY_DIR}/src/core)
find_library(ff7tk ${CMAKE_BINARY_DIR}/src/ff7tk)
find_library(ff7tkData ${CMAKE_BINARY_DIR}/src/data)
find_library(ff7tkFormats ${CMAKE_BINARY_DIR}/src/formats)
find_library(ff7tkQuickControls ${CMAKE_BINARY_DIR}/src/quick/data)
Expand Down
2 changes: 1 addition & 1 deletion demos/ff7tkWidgetGallery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS
Quick
)

find_library(ff7tk ${CMAKE_BINARY_DIR}/src/core)
find_library(ff7tk ${CMAKE_BINARY_DIR}/src/ff7tk)
find_library(ff7tkData ${CMAKE_BINARY_DIR}/src/data)
find_library(ff7tkFormats ${CMAKE_BINARY_DIR}/src/formats)
find_library(ff7tkUtils ${CMAKE_BINARY_DIR}/src/utils)
Expand Down
2 changes: 1 addition & 1 deletion docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To build ff7tk you will a minimum of:


A Default Build of ff7tk will build:
- A Required Core Library (libff7tk.so, libff7tk.dylib, or ff7tk.dll)
- A Required ff7tk Library (libff7tk.so, libff7tk.dylib, or ff7tk.dll)
- All Additional Libraries ff7tkQtWidgets, ff7tkWidgets, ff7tkUtils and ff7tkFormats.
- Headers for the libraries so you can link to them
- Required CMake parts to find it post install.
Expand Down
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ else()
set(BUILD_FRAMEWORKS FALSE)
endif()

add_subdirectory(core)
add_subdirectory(ff7tk)

if(DATA)
add_subdirectory(data)
endif()
Expand Down
26 changes: 13 additions & 13 deletions src/data/FF7Char.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,39 +72,39 @@ class FF7TKDATA_EXPORT FF7Char : public QObject
* \param who persons id (they are almost always the same in stock game)
* \return Chars[who].id
*/
static Q_INVOKABLE quint8 id(int who);
Q_INVOKABLE static quint8 id(int who);

static int totalCharacters() {return FF7Char::Chocobo;}
/**
* @brief validID
* @param id -ID to check
* @return True if ID is valid
*/
static Q_INVOKABLE bool validID(int id);
Q_INVOKABLE static bool validID(int id);

/*! \brief number of weapons for a Character
* \param who Characters id number
* \return Number of Weapons for the given character
*/
static Q_INVOKABLE int numberOfWeapons(int who);
Q_INVOKABLE static int numberOfWeapons(int who);

/*! \brief find what item id is the first weapon for a Character
* \param who Characters id number
* \return Item Id of characters first weapon
*/
static Q_INVOKABLE int weaponStartingId(int who);
Q_INVOKABLE static int weaponStartingId(int who);

/*! \brief find what weapon number is the first weapon for a Character
* \param who Characters id number
* \return Weapon number of characters first weapon
*/
static Q_INVOKABLE int weaponOffset(int who);
Q_INVOKABLE static int weaponOffset(int who);

/*! \brief default name for a character
* \param who Characters id number
* \return Translated default name for character
*/
static Q_INVOKABLE QString defaultName(int who);
Q_INVOKABLE static QString defaultName(int who);

/*! \brief Menu icon for a character
* \param who Characters id number
Expand All @@ -131,21 +131,21 @@ class FF7TKDATA_EXPORT FF7Char : public QObject
* \param who Characters id number
* \return QStringList of Translated names for each limit break
*/
static Q_INVOKABLE QStringList limits(int who);
Q_INVOKABLE static QStringList limits(int who);

/*! \brief Exp needed to reach a level
* \param who Characters id number
* \param level Level you want to reach
* \return Total amount of Exp needed to reach level (ex. to reach level 99 you need 20000000 xp)
*/
static Q_INVOKABLE quint32 totalExpForLevel(int who, int level);
Q_INVOKABLE static quint32 totalExpForLevel(int who, int level);

/*! \brief experance needed to level up
* \param who Characters id number
* \param level Level you are trying to reach
* \return Exp needed to reach the next level. (i.e from 9 to 10 you need 50 exp)
*/
static Q_INVOKABLE quint32 tnlForLevel(int who, int level);
Q_INVOKABLE static quint32 tnlForLevel(int who, int level);

/*! \brief how much to increase stat on level up
* \param who Characters id number
Expand All @@ -155,29 +155,29 @@ class FF7TKDATA_EXPORT FF7Char : public QObject
* \param next_lvl level the character is becoming
* \return how many points to be put in stat.
*/
static Q_INVOKABLE int statGain(int who, int stat, int stat_amount, int current_lvl, int next_lvl);
Q_INVOKABLE static int statGain(int who, int stat, int stat_amount, int current_lvl, int next_lvl);

/*! \brief convert bit to limit offset
* \param bit to convert
* \return limit offset to change
*/
static Q_INVOKABLE int limitBitConvert(int bit);
Q_INVOKABLE static int limitBitConvert(int bit);

/*!
* \brief Convert a FF7CHAR to QByteArray
* \param ff7char the FF7CHAR to convet
* \return QByteArray
* \sa fromByteArray()
*/
static Q_INVOKABLE QByteArray toByteArray (FF7CHAR ff7char);
Q_INVOKABLE static QByteArray toByteArray (FF7CHAR ff7char);

/*!
* \brief Convert a QByteArray to FF7CHAR
* \param ba the QByteArray to convet
* \return FF7Char
* \sa toByteArray()
*/
static Q_INVOKABLE FF7CHAR fromByteArray(const QByteArray &ba);
Q_INVOKABLE static FF7CHAR fromByteArray(const QByteArray &ba);
private:
/*! \brief characters grade in a stat
* \param who Characters id number
Expand Down
8 changes: 4 additions & 4 deletions src/data/FF7FieldItemList.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,24 @@ class FF7TKDATA_EXPORT FF7FieldItemList : public QObject
* \param index index in list
* \return List of Offsets where that control the item being shown
*/
static Q_INVOKABLE const QList<quint16> &offset(int index);
Q_INVOKABLE static const QList<quint16> &offset(int index);
/*! \brief bit list for an entry (one per offset)
* \param index index in list
* \return List of bits that control the item being shown
*/
static Q_INVOKABLE const QList<quint8> &bit(int index);
Q_INVOKABLE static const QList<quint8> &bit(int index);

/*! \brief map list for an entry.
* \param index index in list
* \return List of maps that item is shown on
*/
static Q_INVOKABLE const QStringList &maps(int index);
Q_INVOKABLE static const QStringList &maps(int index);

/*! \brief item or desc of item
* \param index index in list
* \return text for item
*/
static Q_INVOKABLE QString text(int index);
Q_INVOKABLE static QString text(int index);

/*! \brief total entries in FILIST
* \return number of entries in FILIST
Expand Down
Loading
Loading