Skip to content

Commit

Permalink
Merge branch 'dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
WhyIsEvery4thYearAlwaysBad authored and WhyIsEvery4thYearAlwaysBad committed Apr 11, 2021
2 parents 4f5e757 + a70338c commit 4d5948f
Show file tree
Hide file tree
Showing 13 changed files with 504 additions and 391 deletions.
2 changes: 1 addition & 1 deletion compile.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
pushd C:\Users\Owner\Documents\Projects\VoicemenuGenerator\src
pushd C:\Users\Owner\Documents\Projects\CmdMenuGenerator\src
g++ -m32 binds.cpp commandmenu.cpp launchoptions.cpp compiler.cpp tokens.cpp main.cpp -o ../cvm_generate_x32.exe -std=c++2a -Wall
if NOT %%ERRORLEVEL%% EQU 0 (
pause
Expand Down
6 changes: 3 additions & 3 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pushd src
g++ -m32 binds.cpp commandmenu.cpp launchoptions.cpp compiler.cpp tokens.cpp main.cpp -o ../cvm_generate_x32.exe -std=c++2a -Wall
pushd C:/Users/Owner/Documents/Projects/CmdMenuGenerator/src
g++ -g -m32 * -o ../cmg-x32.exe -std=c++2a -Wall
if [ ! $? -eq 0 ]
then
read -n1 -r -p "Error(s) have occurred here! Press a key to continue."
fi
g++ -m64 binds.cpp commandmenu.cpp launchoptions.cpp compiler.cpp tokens.cpp main.cpp -o ../cvm_generate_x64.exe -std=c++2a -Wall
g++ -g -m64 * -o ../cmg-x64.exe -std=c++2a -Wall
if [ ! $? -eq 0 ]
then
read -n1 -r -p "Error(s) have occurred here! Press a key to continue."
Expand Down
4 changes: 3 additions & 1 deletion src/binds.cpp → src/bind.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "binds.hpp"
#include "bind.hpp"
#include "compiler.hpp"
#include "lex.hpp"
#include <map>
extern std::map<std::string,std::string> KVMap;
Bind::Bind() {}
Expand Down Expand Up @@ -28,6 +29,7 @@ Bind::Bind(const unsigned char& p_cKey, const Parser::BindToken& p_Token)
if (p_Token.bNoExit==true) CmdStrContainer.push_back(p_Token.sCmdStr);
else CmdStrContainer.push_back("cmenu.exitmenu; cmenu.on_cmenu_exit; "+p_Token.sCmdStr);
}

Bind::Bind(const unsigned char& p_cKey, const Parser::ToggleBindToken& p_Token)
: bToggleBind(true), cKey(p_cKey) {
for (unsigned short i=0; i < p_Token.ToggleStates; i++) {
Expand Down
File renamed without changes.
17 changes: 15 additions & 2 deletions src/commandmenu.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
#include <map>
#include "commandmenu.hpp"
#include "compiler.hpp"
#include "lex.hpp"

extern std::map<std::string,std::string> KVMap;

CommandMenu::CommandMenu() {}

CommandMenu::CommandMenu(const std::string& p_sName)
: sRawName(formatRaw(p_sName)), sName(p_sName) {}
: sRawName(formatRaw(p_sName)), sName(p_sName) {
if (KVMap["display"]=="caption") Display=CMenuDisplayType::CAPTIONS;
else if (KVMap["display"]=="console") Display=CMenuDisplayType::CONSOLE;
else if (KVMap["display"]=="none") Display=CMenuDisplayType::NONE;
}

CommandMenu::CommandMenu(const std::string& p_sRawName, const std::string& p_sName)
: sRawName(p_sRawName), sName(p_sName) {}
: sRawName(p_sRawName), sName(p_sName) {
if (KVMap["display"]=="caption") Display=CMenuDisplayType::CAPTIONS;
else if (KVMap["display"]=="console") Display=CMenuDisplayType::CONSOLE;
else if (KVMap["display"]=="none") Display=CMenuDisplayType::NONE;
else Display=CMenuDisplayType::CAPTIONS;
}

CommandMenu::~CommandMenu() {}
14 changes: 10 additions & 4 deletions src/commandmenu.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
#ifndef PAGE_HPP
#define PAGE_HPP
#ifndef COMMANDMENU_HPP
#define COMMANDMENU_HPP
#include <string>
#include <vector>
#include <deque>
#include "binds.hpp"
#include "compiler.hpp"
#include "bind.hpp"

enum class CMenuDisplayType {
NONE=0,
CONSOLE,
CAPTIONS
};

struct CommandMenu {
std::string sRawName, sName;
std::vector<Bind> binds;

CMenuDisplayType Display;
CommandMenu();
CommandMenu(const std::string& p_sName);
CommandMenu(const std::string& p_sRawName, const std::string& p_sName);
Expand Down
Loading

0 comments on commit 4d5948f

Please sign in to comment.