Player12
An open source football management simulator
Loading...
Searching...
No Matches
transfer_terms_editor.h File Reference
#include <array>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <initializer_list>
#include <span>
#include <string>
#include "gui/widgets/widgets.h"
#include "model/transfer_negotiation.h"

Go to the source code of this file.

Namespaces

namespace  TransferTermsEditor
 Pieces shared by the transfer dialogs: the structured offer editor (fee, upfront share, instalments, add-ons, sell-on), captions, panels and right-aligned action rows.
 

Functions

template<typename T , typename V >
int TransferTermsEditor::optionIndex (std::span< const T > options, V value)
 
template<typename T , std::size_t N, typename V >
int TransferTermsEditor::optionIndex (const std::array< T, N > &options, V value)
 
void TransferTermsEditor::formLabel (const char *text)
 
void TransferTermsEditor::alignActions (std::initializer_list< const char * > labels)
 
bool TransferTermsEditor::beginPanel (const char *id, const char *title)
 
void TransferTermsEditor::endPanel ()
 
bool TransferTermsEditor::snapToOptions (TransferNegotiation::OfferTerms &terms)
 
bool TransferTermsEditor::edit (TransferNegotiation::OfferTerms &terms, std::span< const UI::MoneyChip > fee_chips)
 
std::string TransferTermsEditor::structureText (const TransferNegotiation::OfferTerms &terms)
 
bool TransferTermsEditor::snapLoanToOptions (TransferNegotiation::LoanTerms &terms)
 
bool TransferTermsEditor::editLoan (TransferNegotiation::LoanTerms &terms, std::uint32_t market_value)
 
std::string TransferTermsEditor::loanTermsLine (const TransferNegotiation::LoanTerms &terms)
 

Variables

constexpr std::array< std::uint8_t, 7 > TransferTermsEditor::UPFRONT_OPTIONS
 
constexpr std::array< const char *, 7 > TransferTermsEditor::UPFRONT_LABELS
 
constexpr std::array< const char *, 5 > TransferTermsEditor::YEAR_LABELS
 
constexpr std::array< std::uint16_t, 4 > TransferTermsEditor::APPEARANCE_TARGETS
 
constexpr std::array< std::uint16_t, 4 > TransferTermsEditor::GOAL_TARGETS = {5, 10, 15, 20}
 
constexpr std::array< std::uint8_t, 7 > TransferTermsEditor::SELL_ON_OPTIONS
 
constexpr std::array< const char *, 7 > TransferTermsEditor::SELL_ON_LABELS
 
constexpr std::uint8_t TransferTermsEditor::DEFAULT_INSTALMENT_YEARS = 2
 
constexpr std::int64_t TransferTermsEditor::FEE_STEP = 10'000
 
constexpr int TransferTermsEditor::LOAN_WAGE_SHARE_STEP = 5
 
constexpr std::array< std::uint8_t, 7 > TransferTermsEditor::MIN_APPEARANCE_OPTIONS