From 43b1c03f15d9551cf060c1efac9d6d8d591727b4 Mon Sep 17 00:00:00 2001 From: MaxLHy0424 Date: Tue, 17 Dec 2024 00:20:16 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E9=A2=84?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E7=89=88=E6=9C=AC=E5=AE=8F=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- info.rc | 2 +- src/console_ui.hpp | 8 ++++---- src/core.hpp | 6 +++--- src/info.hpp | 4 ++-- src/main.cpp | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/info.rc b/info.rc index 4a9a6441..e7663ffc 100644 --- a/info.rc +++ b/info.rc @@ -1,5 +1,5 @@ #include "src/info.hpp" -#ifdef _THE_NEXT_MAJOR_UPDATE_ +#ifdef _NEXT_ 1 ICON "img/favicon_next.ico" #else 1 ICON "img/favicon.ico" diff --git a/src/console_ui.hpp b/src/console_ui.hpp index 79ecf619..a9fe5244 100644 --- a/src/console_ui.hpp +++ b/src/console_ui.hpp @@ -1,7 +1,7 @@ #pragma once #if __cplusplus >= 202302L # include -# ifdef _THE_NEXT_MAJOR_UPDATE_ +# ifdef _NEXT_ # include # else # include @@ -203,7 +203,7 @@ class console_ui final { { get_console_size_(); set_cursor_( { 0, 0 } ); -# ifdef _THE_NEXT_MAJOR_UPDATE_ +# ifdef _NEXT_ std::print( "{}", string_type( width_ * height_, ' ' ) ); # else std::printf( string_type( width_ * height_, ' ' ).c_str() ); @@ -212,7 +212,7 @@ class console_ui final { } auto write_( const string_type &_text, const bool _is_endl = false ) { -# ifdef _THE_NEXT_MAJOR_UPDATE_ +# ifdef _NEXT_ std::print( "{}{}", _text, _is_endl ? '\n' : '\0' ); # else std::printf( "%s%c", _text.c_str(), _is_endl ? '\n' : '\0' ); @@ -418,7 +418,7 @@ class console_ui final { SetConsoleOutputCP( _code_page ); SetConsoleCP( _code_page ); SetConsoleTitleA( _title.c_str() ); -# ifdef _THE_NEXT_MAJOR_UPDATE_ +# ifdef _NEXT_ system( std::format( "mode.com con cols={} lines={}", _width, _height ).c_str() ); # else using namespace std::string_literals; diff --git a/src/core.hpp b/src/core.hpp index 9b12e5ef..438b80d1 100644 --- a/src/core.hpp +++ b/src/core.hpp @@ -1,18 +1,18 @@ #pragma once -#ifdef _THE_NEXT_MAJOR_UPDATE_ +#ifdef _NEXT_ # include # include #endif #include "console_ui.hpp" #include "info.hpp" -#ifndef _THE_NEXT_MAJOR_UPDATE_ +#ifndef _NEXT_ inline struct { bool front_show_window, translucent_window, window_ctrls; } args_data{}; inline bool args_error{}; #endif namespace core { -#ifdef _THE_NEXT_MAJOR_UPDATE_ +#ifdef _NEXT_ using string_type = console_ui::string_type; using wstring_type = std::wstring; template < typename _type_ > diff --git a/src/info.hpp b/src/info.hpp index c43e71ef..26280f00 100644 --- a/src/info.hpp +++ b/src/info.hpp @@ -1,6 +1,6 @@ #pragma once #define INFO_NAME "Computer Room Control Software Nemesis" -#ifdef _THE_NEXT_MAJOR_UPDATE_ +#ifdef _NEXT_ # define INFO_VERSION "v6.0.0-preview.7" #else # define INFO_VERSION "v5.11.0" @@ -8,7 +8,7 @@ #define INFO_REPO_URL "https://github.com/MaxLHy0424/CRCSN" #define INFO_DEVELOPER "MaxLHy0424" #define INFO_LICENSE "MIT License" -#ifdef _THE_NEXT_MAJOR_UPDATE_ +#ifdef _NEXT_ # define CODE_PAGE 936 # define WINDOW_TITLE "CRCSN" # define WINDOW_WIDTH 50 diff --git a/src/main.cpp b/src/main.cpp index dfee6d07..9636088e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,7 @@ #ifdef _WIN32 # include "console_ui.hpp" # include "core.hpp" -# ifdef _THE_NEXT_MAJOR_UPDATE_ +# ifdef _NEXT_ auto main() -> int { console_ui ui;