diff --git a/.github/workflows/build_XSTools.yml b/.github/workflows/build_XSTools.yml_ similarity index 92% rename from .github/workflows/build_XSTools.yml rename to .github/workflows/build_XSTools.yml_ index a5742e8210..dc65f0b9b3 100644 --- a/.github/workflows/build_XSTools.yml +++ b/.github/workflows/build_XSTools.yml_ @@ -2,16 +2,18 @@ # runs-on https://github.com/actions/virtual-environments # setup-python https://github.com/actions/setup-python # actions-setup-perl https://github.com/marketplace/actions/setup-perl-environment -# strawberry Perl 5.12.3.0 https://strawberryperl.com/download/5.12.3.0/strawberry-perl-5.12.3.0-portable.zip +# strawberry Perl 5.22.3.1 https://strawberryperl.com/download/5.22.3.1/strawberry-perl-5.22.3.1-32bit-portable.zip # strawberry Perl 5.32.1.1 https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-32bit-portable.zip # actions-upload-artifact https://github.com/actions/upload-artifact # actions-download-artifact https://github.com/actions/download-artifact # actions-cache https://github.com/actions/cache + name: Build XSTools on: push: branches: - master + - compile_perl_5.22 tags-ignore: - '*' pull_request: @@ -28,8 +30,8 @@ jobs: - os: windows-2016 python: 2.7 architecture: x86 - perl: 5.12 - strawberry_distr: 'https://strawberryperl.com/download/5.12.3.0/strawberry-perl-5.12.3.0-portable.zip' + perl: 5.22 + strawberry_distr: 'https://strawberryperl.com/download/5.22.3.1/strawberry-perl-5.22.3.1-32bit-portable.zip' - os: windows-latest python: 3 @@ -40,7 +42,7 @@ jobs: - os: ubuntu-18.04 python: 2.7 architecture: x64 - perl: 5.12 + perl: 5.22 - os: ubuntu-latest python: 3 @@ -52,9 +54,9 @@ jobs: uses: actions/checkout@v2 # setup matrix: - # - windows-2016 + python 2.7 x86 + strawberry perl 5.12 x86 + strawberry g++ x86 + # - windows-2016 + python 2.7 x86 + strawberry perl 5.22 x86 + strawberry g++ x86 # - windows-2019 + python 3 x86 + strawberry perl 5.32 x86 + strawberry g++ x86 - # - ubuntu-18.04 + python 2.7 x64 + perl 5.12 x64 + # - ubuntu-18.04 + python 2.7 x64 + perl 5.22 x64 # - ubuntu-20.04 + python 3 x64 + perl 5.32 x64 - name: Setup python ${{ matrix.python }} ${{ matrix.architecture }} uses: actions/setup-python@v2 @@ -162,7 +164,6 @@ jobs: PERL: ${{ matrix.perl }} ARCHITECTURE: ${{ matrix.architecture }} run: | - sudo apt update sudo apt install -y libreadline6-dev libcurl4-openssl-dev make all echo "======================================================" @@ -209,7 +210,7 @@ jobs: include: - os: windows-2016 architecture: x86 - perl: 5.12 + perl: 5.22 - os: windows-latest architecture: x86 @@ -217,7 +218,7 @@ jobs: - os: ubuntu-18.04 architecture: x64 - perl: 5.12 + perl: 5.22 - os: ubuntu-latest architecture: x64 diff --git a/.github/workflows/build_XSTools_win.yml b/.github/workflows/build_XSTools_win.yml new file mode 100644 index 0000000000..3bc7a3f846 --- /dev/null +++ b/.github/workflows/build_XSTools_win.yml @@ -0,0 +1,108 @@ +# runs-on: https://github.com/actions/virtual-environments +# setup-python: https://github.com/actions/setup-python +# actions-setup-perl: https://github.com/marketplace/actions/setup-perl-environment +# Strawberry Perl 5.22.3.1: https://strawberryperl.com/download/5.22.3.1/strawberry-perl-5.22.3.1-32bit-portable.zip +# actions-upload-artifact: https://github.com/actions/upload-artifact + +name: Build Win +on: + push: + branches: + - master + tags-ignore: + - '*' + pull_request: + +jobs: + build_XSTools: + + name: XSTools ${{ matrix.os }} (python ${{ matrix.python }}) (perl ${{ matrix.perl }}) x${{ matrix.perl_arch }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: windows-2016 + python: 3 + architecture: x86 + perl: '5.22' + perl_arch: 64 + + - os: windows-2016 + python: 3 + architecture: x86 + perl: '5.22' + perl_arch: 32 + + steps: + - name: Checkout + uses: actions/checkout@v2 + + # setup Windows matrix: python 3_x86 and strawberry perl 5.32_x64, 5.32_x86 + - name: setup-python ${{ matrix.python }} ${{ matrix.architecture }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + architecture: ${{ matrix.architecture }} + + - name: Replace perl to 5.32.3.1 x${{ matrix.perl_arch }} + run: | + echo "=================================================================" + echo "== previous version of Perl:" + echo "=================================================================" + perl --version + echo "=================================================================" + echo "== remove the default perl" + echo "=================================================================" + rm -r C:/Strawberry/* + echo "=================================================================" + echo "== download strawberry perl ${{ matrix.perl }} ${{ matrix.perl_arch }}" + echo "=================================================================" + Invoke-WebRequest https://strawberryperl.com/download/5.22.3.1/strawberry-perl-5.22.3.1-${{ matrix.perl_arch }}bit-portable.zip -OutFile strawberry.zip + 7z.exe x strawberry.zip -o"C:/Strawberry" + echo "=================================================================" + echo "== a new version of Perl:" + echo "=================================================================" + perl --version + echo "=================================================================" + echo "== uninstall mingw x64" + echo "=================================================================" + choco uninstall mingw + + - name: Environment check + run: | + echo "=================================================================" + echo "== check g++ version:" + echo "=================================================================" + g++ --version + echo "=================================================================" + echo "== perl version:" + echo "=================================================================" + perl --version + echo "=================================================================" + echo "== Time::HiRes module:" + echo "=================================================================" + perl -e "use Time::HiRes;" + echo "=================================================================" + echo "== Compress::Zlib module:" + echo "=================================================================" + perl -e "use Compress::Zlib;" + echo "=================================================================" + echo "== python version:" + echo "=================================================================" + python -V + + - name: Run make XSTools.dll + run: | + gmake all + echo "=================================================================" + ls src\auto\XSTools\XSTools.dll + ls src\auto\XSTools\NetRedirect.dll + + - name: Making artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.os }}_perl${{ matrix.perl }}x${{ matrix.perl_arch }} + path: | + src\auto\XSTools\XSTools.dll + src\auto\XSTools\NetRedirect.dll \ No newline at end of file diff --git a/.github/workflows/test.yml_ b/.github/workflows/test.yml_ new file mode 100644 index 0000000000..425ecf2585 --- /dev/null +++ b/.github/workflows/test.yml_ @@ -0,0 +1,86 @@ +# runs-on: https://github.com/actions/virtual-environments +# setup-python: https://github.com/actions/setup-python +# actions-setup-perl: https://github.com/marketplace/actions/setup-perl-environment + +name: make test + +on: + push: + branches: + - master + tags-ignore: + - '*' + pull_request: + +jobs: + make_test: + + name: make test ${{ matrix.os }} (python ${{ matrix.python }}) (perl ${{ matrix.perl }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + #- os: windows-2016 + # python: 2.7 + # architecture: x86 + # perl: 5.12 + # distribution: default + + #- os: windows-latest + # python: 3 + # architecture: x86 + # perl: latest + # distribution: strawberry + + - os: ubuntu-18.04 + python: 2.7 + architecture: x64 + perl: 5.12 + distribution: default + + - os: ubuntu-latest + python: 3 + architecture: x64 + perl: latest + distribution: default + + steps: + - name: Checkout + uses: actions/checkout@v2 + + # setup Windows matrix: python 2.7_x86, 3_x86 and perl 5.12_x64, strawberry last_x64 + # setup Linux matrix: python 2.7_x64, 3_x64 and perl 5.12_x64, last_x64 + - name: setup-python ${{ matrix.python }} ${{ matrix.architecture }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + architecture: ${{ matrix.architecture }} + + - name: setup-perl ${{ matrix.perl }} (${{ matrix.distribution }}) + uses: shogo82148/actions-setup-perl@v1 + with: + perl-version: ${{ matrix.perl }} + distribution: ${{ matrix.distribution }} + + - name: Install Linux dependencies + if: runner.os == 'Linux' + run: | + sudo apt update + sudo apt install -y libreadline6-dev libcurl4-openssl-dev + + - name: Environment check + run: | + echo "------------- check g++ version -------------" + g++ --version + echo "------------- perl version -------------" + perl --version + echo "------------- Time::HiRes module -------------" + perl -e "use Time::HiRes;" + echo "------------- Compress::Zlib module -------------" + perl -e "use Compress::Zlib;" + echo "------------- python version -------------" + python -V + + - name: Run Tests + run: make test diff --git a/NetRedirect.dll b/NetRedirect.dll index 4139fedfab..788a720c0e 100644 Binary files a/NetRedirect.dll and b/NetRedirect.dll differ diff --git a/SConstruct b/SConstruct index c2c6d0007d..ced6a61bdb 100644 --- a/SConstruct +++ b/SConstruct @@ -215,7 +215,7 @@ env['LINKFLAGS'] = [] if win32: import platform # have to use -static-libgcc while compiling with mingw’s g++ to eliminate the dependency on LIBGCC_S_SJLJ-1.DLL - env['LINKFLAGS'] += ['-static-libgcc'] + env['LINKFLAGS'] += ['-static-libgcc', '-static'] if "64" in platform.machine(): env['CCFLAGS'] += ['-fpermissive', '-DWINx86_64'] @@ -235,7 +235,7 @@ libenv = env.Clone() if win32: if cygwin: libenv['CCFLAGS'] += ['-mdll'] - libenv['CPPDEFINES'] += ['WIN32'] + libenv['CPPDEFINES'] += ['WIN32', 'PERL_EUPXS_ALWAYS_EXPORT'] elif not darwin: libenv['CCFLAGS'] += ['-fPIC'] libenv['LINKFLAGS'] += ['-fPIC'] diff --git a/XSTools.dll b/XSTools.dll index 829f255532..5f20b5e80e 100644 Binary files a/XSTools.dll and b/XSTools.dll differ diff --git a/interfaces/tkstart.exe b/interfaces/tkstart.exe new file mode 100644 index 0000000000..79833eb880 Binary files /dev/null and b/interfaces/tkstart.exe differ diff --git a/interfaces/vxstart.exe b/interfaces/vxstart.exe new file mode 100644 index 0000000000..f9ac30f93e Binary files /dev/null and b/interfaces/vxstart.exe differ diff --git a/interfaces/winguistart.exe b/interfaces/winguistart.exe new file mode 100644 index 0000000000..99cbff0c73 Binary files /dev/null and b/interfaces/winguistart.exe differ diff --git a/src/Interface/Tk.pm b/src/Interface/Tk.pm index 819241772e..51077f2472 100644 --- a/src/Interface/Tk.pm +++ b/src/Interface/Tk.pm @@ -41,6 +41,7 @@ use Tk::NoteBook; #these should go in a config file at some point. our $line_limit = 1000; +our $buildType; ################################################################ # Public Method @@ -173,7 +174,7 @@ sub title { sub updatePos { my $self = shift; - return unless defined($config{'char'}) && defined($chars[$config{'char'}]) && defined($char->{'pos_to'}); + return unless defined($config{'char'}) && defined($chars[$config{'char'}]) && defined($char) && defined($char->{'pos_to'}); my ($x,$y) = @{$char->{'pos_to'}}{'x', 'y'}; $self->{status_posx}->configure( -text =>$x); $self->{status_posy}->configure( -text =>$y); diff --git a/src/Interface/Win32.pm b/src/Interface/Win32.pm index 7c484a9b09..622b04ca1b 100644 --- a/src/Interface/Win32.pm +++ b/src/Interface/Win32.pm @@ -17,7 +17,8 @@ use Globals; use Settings; use Misc; -use Win32::GUI(); +use Win32::GUI; +use Win32::GUI::Constants qw(WS_CHILD WS_VISIBLE WS_VSCROLL ES_LEFT ES_MULTILINE ES_READONLY ES_AUTOVSCROLL MB_OK MB_ICONERROR); use Interface::Win32::Map; #Map Viewer diff --git a/src/Interface/Wx.pm b/src/Interface/Wx.pm index 9e050acfa9..c998e09980 100644 --- a/src/Interface/Wx.pm +++ b/src/Interface/Wx.pm @@ -73,6 +73,7 @@ sub OnInit { my $self = shift; $CVS = ($Settings::SVN =~ /SVN/); + Wx::DisableAssertHandler(); $self->createInterface; $self->iterate; diff --git a/src/InventoryList.pm b/src/InventoryList.pm index e3aeb292b4..9cb8f197e0 100644 --- a/src/InventoryList.pm +++ b/src/InventoryList.pm @@ -81,7 +81,7 @@ sub new { sub DESTROY { my ($self) = @_; - Plugins::delHook($self->{hooks}) if $self->{hooks}; + Plugins::delHook($self->{hooks}) if exists $self->{hooks} && defined $self->{hooks}; $self->clear(); $self->SUPER::DESTROY(); } diff --git a/src/InventoryList/Cart.pm b/src/InventoryList/Cart.pm index 7366741eb9..bad4c33b0b 100644 --- a/src/InventoryList/Cart.pm +++ b/src/InventoryList/Cart.pm @@ -15,13 +15,6 @@ sub new { $self->{exists} = 0; $self->{type} = 0; - if($masterServer->{itemListType}) { - $self->{hooks} = Plugins::addHooks ( - ['packet/item_list_start', \&onitemListStart, $self], - ['packet/item_list_end', sub { $self->onitemListEnd; }], - ); - } - return $self; } @@ -86,21 +79,17 @@ sub item_max_stack { return $itemStackLimit{$nameID}->{2} || $itemStackLimit{-1}->{2} || 30000; } -sub onitemListStart { - my ($hook_name, $args, $self) = @_; - if($args->{type} == 0x1) { - $self->clear(); - if (!$self->{exists}) { - $self->{exists} = 1; - } +sub start { + my ($self) = @_; + $self->clear(); + if (!$self->{exists}) { + $self->{exists} = 1; } } -sub onitemListEnd { +sub ready { my ($self) = @_; - if($current_item_list == 0x1) { - Plugins::callHook('cart_ready'); - } + Plugins::callHook('cart_ready'); } 1; diff --git a/src/InventoryList/Inventory.pm b/src/InventoryList/Inventory.pm index 5819f1b338..84b8bab6ea 100644 --- a/src/InventoryList/Inventory.pm +++ b/src/InventoryList/Inventory.pm @@ -13,19 +13,8 @@ use constant { sub new { my ($class) = @_; my $self = $class->SUPER::new; - if($masterServer->{itemListType}) { - $self->{hooks} = Plugins::addHooks ( - ['packet/item_list_start', \&onitemListStart, $self], - ['packet/item_list_end', sub { $self->onitemListEnd; }], - ); - } else { - $self->{hooks} = Plugins::addHooks ( - ['packet/stat_info2', sub { $self->onStatInfo2; }] - ); - } - #Here we use packet/stat_info2 because it was the only safe hook I (henrybk) found for this function, both 'inventory_items_stackable' and 'inventory_items_nonstackable' are - #only sent by the server if we have at least 1 item of that category, while 'stat_info2' is always (at least in my tests) sent. $self->{state} = MAP_LOADED_OR_NEW; + return $self; } @@ -34,14 +23,6 @@ sub isReady { return $self->{state}; } -sub onStatInfo2 { - my ($self) = @_; - if ($self->{state} == MAP_LOADED_OR_NEW) { - $self->{state} = INVENTORT_READY; - Plugins::callHook('inventory_ready'); - } -} - sub onMapChange { my ($self) = @_; return if $masterServer->{itemListType}; @@ -55,21 +36,17 @@ sub item_max_stack { return $itemStackLimit{$nameID}->{1} || $itemStackLimit{-1}->{1} || 30000; } -sub onitemListStart { - my ($hook_name, $args, $self) = @_; - if($args->{type} == 0x0) { - $self->{state} = MAP_LOADED_OR_NEW; - $self->clear(); - } +sub start { + my ($self) = @_; + $self->{state} = MAP_LOADED_OR_NEW; + $self->clear(); } -sub onitemListEnd { +sub ready { my ($self) = @_; - if($current_item_list == 0x0) { - if ($self->{state} == MAP_LOADED_OR_NEW) { - $self->{state} = INVENTORT_READY; - Plugins::callHook('inventory_ready'); - } + if ($self->{state} == MAP_LOADED_OR_NEW) { + $self->{state} = INVENTORT_READY; + Plugins::callHook('inventory_ready'); } } diff --git a/src/InventoryList/Storage.pm b/src/InventoryList/Storage.pm index 15db26bd6e..2b4c5fcf76 100644 --- a/src/InventoryList/Storage.pm +++ b/src/InventoryList/Storage.pm @@ -13,13 +13,6 @@ sub new { $self->{items} = 0; $self->{items_max} = 0; - if($masterServer->{itemListType}) { - $self->{hooks} = Plugins::addHooks ( - ['packet/item_list_start', \&onitemListStart, $self], - ['packet/item_list_end', sub { $self->onitemListEnd; }], - ); - } - return $self; } @@ -76,18 +69,14 @@ sub item_max_stack { return $itemStackLimit{$nameID}->{4} || $itemStackLimit{-1}->{4} || 30000; } -sub onitemListStart { - my ($hook_name, $args, $self) = @_; - if($args->{type} == 0x2) { - $self->clear(); - } +sub start { + my ($self) = @_; + $self->clear(); } -sub onitemListEnd { +sub ready { my ($self) = @_; - if($current_item_list == 0x2) { - Plugins::callHook('storage_ready'); - } + Plugins::callHook('storage_ready'); } 1; diff --git a/src/Network/Receive.pm b/src/Network/Receive.pm index 3e5497189d..e9638c4035 100644 --- a/src/Network/Receive.pm +++ b/src/Network/Receive.pm @@ -1711,6 +1711,10 @@ sub stat_info2 { $char->{luk_bonus} = $val2; debug "Luck: $val + $val2\n", "parseMsg"; } + #Here we use packet/stat_info2 because it was the only safe hook I (henrybk) found for this function, both 'inventory_items_stackable' and 'inventory_items_nonstackable' are + #only sent by the server if we have at least 1 item of that category, while 'stat_info2' is always (at least in my tests) sent. + $char->inventory->ready() if !$masterServer->{itemListType}; + } # Notifies clients in an area, that an other visible object is walking (ZC_NOTIFY_PLAYERMOVE). # 0086 .L .6B .L @@ -5012,6 +5016,15 @@ sub item_list_start { debug "Starting Item List. ID: $args->{type}". ($args->{name} ? " ($args->{name})\n" : "\n"), "info"; $current_item_list = $args->{type}; + if ( $args->{type} == INVTYPE_INVENTORY ) { + $char->inventory->start(); + } elsif ( $args->{type} == INVTYPE_CART ) { + $char->cart->start(); + } elsif ( $args->{type} == INVTYPE_STORAGE ) { + $char->storage->start(); + } else { + error "Unknown item list type : " . $args->{type} . "\n"; + } } sub item_list_stackable { @@ -5105,6 +5118,15 @@ sub item_list_nonstackable { sub item_list_end { my ($self, $args) = @_; debug TF("Ending Item List. ID: %s\n", $args->{type}), "info"; + if ( $current_item_list == INVTYPE_INVENTORY ) { + $char->inventory->ready(); + } elsif ( $current_item_list == INVTYPE_CART ) { + $char->cart->ready(); + } elsif ( $current_item_list == INVTYPE_STORAGE ) { + $char->storage->ready(); + } else { + error "Unknown item list type : " . $args->{type} . "\n"; + } undef $current_item_list; } diff --git a/src/build/compile-tk.bat b/src/build/compile-tk.bat new file mode 100644 index 0000000000..39adf026d9 --- /dev/null +++ b/src/build/compile-tk.bat @@ -0,0 +1,4 @@ +cd ..\.. +set BUILDING_WX=2 +perlapp --clean --trim Pod::Usage;I18N::Langinfo;Wx;Wx::**;XSTools;Win32::GUI; --icon src\build\openkore.ico --lib src --nocompress --norunlib --nologo --force --exe tkstart.exe start.pl --add List::Util;File::Path;Text::Balanced;Digest::MD5;Math::BigInt;Math::BigInt::Calc;Math::BigInt::CalcEmu;Math::BigInt::FastCalc;Math::BigInt::Trace;Math::BigFloat;Math::BigFloat::Trace;Math::BigRat;Math::Complex;Math::Trig;Tk;Tk::**;Win32::API; +pause \ No newline at end of file diff --git a/src/build/compile-vx.bat b/src/build/compile-vx.bat new file mode 100644 index 0000000000..c2d92aab0e --- /dev/null +++ b/src/build/compile-vx.bat @@ -0,0 +1,4 @@ +cd ..\.. +set BUILDING_WX=2 +perlapp --clean --trim Pod::Usage;I18N::Langinfo;Wx;Wx::**;XSTools;Win32::GUI; --icon src\build\openkore.ico --lib src --nocompress --norunlib --gui --nologo --force --exe vxstart.exe start.pl --add List::Util;File::Path;Text::Balanced;Digest::MD5;Math::BigInt;Math::BigInt::Calc;Math::BigInt::CalcEmu;Math::BigInt::FastCalc;Math::BigInt::Trace;Math::BigFloat;Math::BigFloat::Trace;Math::BigRat;Math::Complex;Math::Trig;Tk;Tk::**; +pause \ No newline at end of file diff --git a/src/build/compile-wingui.bat b/src/build/compile-wingui.bat new file mode 100644 index 0000000000..fbad72f6e5 --- /dev/null +++ b/src/build/compile-wingui.bat @@ -0,0 +1,4 @@ +cd ..\.. +set BUILDING_WX=3 +perlapp --clean --trim Pod::Usage;I18N::Langinfo;Wx;Wx::**;XSTools;Tk; --icon src\build\openkore.ico --lib src --nocompress --norunlib --gui --nologo --force --exe winguistart.exe start.pl --add List::Util;File::Path;Text::Balanced;Digest::MD5;Math::BigInt;Math::BigInt::Calc;Math::BigInt::CalcEmu;Math::BigInt::FastCalc;Math::BigInt::Trace;Math::BigFloat;Math::BigFloat::Trace;Math::BigRat;Math::Complex;Math::Trig;Win32::GUI;Win32::GUI::Constants;Win32::GUI::**; +pause \ No newline at end of file diff --git a/src/build/compile-wx.bat b/src/build/compile-wx.bat index 9e91474965..213526b39b 100644 --- a/src/build/compile-wx.bat +++ b/src/build/compile-wx.bat @@ -1,4 +1,4 @@ cd ..\.. set BUILDING_WX=1 -perlapp --clean --trim Pod::Usage;I18N::Langinfo;Wx::build::**;XSTools --icon src\build\openkore.ico --lib src --norunlib --nologo --force --exe wxstart.exe start.pl --add List::Util;File::Path;Text::Balanced;Digest::MD5;Math::BigInt;Math::BigInt::Calc;Math::BigInt::CalcEmu;Math::BigInt::FastCalc;Math::BigInt::Trace;Math::BigFloat;Math::BigFloat::Trace;Math::BigRat;Math::Complex;Math::Trig;Wx::Perl::Packager;Wx;Wx::**; +perlapp --clean --trim Pod::Usage;I18N::Langinfo;Wx::build::**;XSTools;Tk;Win32::GUI; --icon src\build\openkore.ico --lib src --norunlib --nologo --force --exe wxstart.exe start.pl --add List::Util;File::Path;Text::Balanced;Digest::MD5;Math::BigInt;Math::BigInt::Calc;Math::BigInt::CalcEmu;Math::BigInt::FastCalc;Math::BigInt::Trace;Math::BigFloat;Math::BigFloat::Trace;Math::BigRat;Math::Complex;Math::Trig;Wx::Perl::Packager;Wx;Wx::**; pause diff --git a/src/build/compile.bat b/src/build/compile.bat index 22efe83869..e51333e675 100644 --- a/src/build/compile.bat +++ b/src/build/compile.bat @@ -1,3 +1,3 @@ cd ..\.. -perlapp --trim Pod::Usage;I18N::Langinfo;Wx;Wx::**;XSTools --icon src\build\openkore.ico --lib src --norunlib --nologo --force --exe start.exe start.pl --add List::Util;File::Path;Text::Balanced;Digest::MD5;Math::BigInt;Math::BigInt::Calc;Math::BigInt::CalcEmu;Math::BigInt::FastCalc;Math::BigInt::Trace;Math::BigFloat;Math::BigFloat::Trace;Math::BigRat;Math::Complex;Math::Trig; +perlapp --trim Pod::Usage;I18N::Langinfo;Wx;Wx::**;XSTools;Tk;Win32::GUI; --icon src\build\openkore.ico --lib src --nocompress --norunlib --nologo --force --exe start.exe start.pl --add List::Util;File::Path;Text::Balanced;Digest::MD5;Math::BigInt;Math::BigInt::Calc;Math::BigInt::CalcEmu;Math::BigInt::FastCalc;Math::BigInt::Trace;Math::BigFloat;Math::BigFloat::Trace;Math::BigRat;Math::Complex;Math::Trig; pause diff --git a/start.exe b/start.exe index e979e2690f..aef6eb54a0 100644 Binary files a/start.exe and b/start.exe differ diff --git a/start.pl b/start.pl index 5a6eca6915..e28ce8b314 100644 --- a/start.pl +++ b/start.pl @@ -26,8 +26,12 @@ package StarterScript; BEGIN { - if ($ENV{BUILDING_WX} && $^O eq 'MSWin32') { + if ($ENV{BUILDING_WX} == 1 && $^O eq 'MSWin32') { require Wx::Perl::Packager; + } elsif ($ENV{BUILDING_WX} == 2 && $^O eq 'MSWin32') { + require Tk; + } elsif ($ENV{BUILDING_WX} == 3 && $^O eq 'MSWin32') { + require Win32::GUI; } } @@ -85,12 +89,30 @@ BEGIN require encoding; require Storable; require Compress::Zlib; - # new Perl 5.12 and more + require List::Util; + require File::Path; + require Text::Balanced; + require Digest::MD5; + require Math::BigInt; + require Math::BigInt::Calc; + require Math::BigInt::CalcEmu; + require Math::BigInt::FastCalc; + require Math::BigInt::Trace; + require Math::BigFloat; + require Math::BigFloat::Trace; + require Math::BigRat; + require Math::Complex; + require Math::Trig; + # new Perl 5.22 and more require "unicore/lib/Perl/SpacePer.pl"; require "unicore/lib/Perl/Word.pl"; - require "unicore/lib/Nt/De.pl"; - require "unicore/lib/Gc/Cc.pl"; - require "unicore/lib/Blk/ASCII.pl"; + require "unicore/lib/Gc/Nd.pl"; + # Old Perl 5.12 and more + # require "unicore/lib/Perl/SpacePer.pl"; + # require "unicore/lib/Perl/Word.pl"; + # require "unicore/lib/Nt/De.pl"; + # require "unicore/lib/Gc/Cc.pl"; + # require "unicore/lib/Blk/ASCII.pl"; # Old Perl 5.10 and less # require "unicore/lib/gc_sc/SpacePer.pl"; # require "unicore/lib/gc_sc/Word.pl"; @@ -106,6 +128,18 @@ BEGIN if (PerlApp::exe() =~ /wxstart\.exe$/i) { $ENV{OPENKORE_DEFAULT_INTERFACE} = 'Wx'; } + + if (PerlApp::exe() =~ /vxstart\.exe$/i) { + $ENV{OPENKORE_DEFAULT_INTERFACE} = 'Vx'; + } + + if (PerlApp::exe() =~ /winguistart\.exe$/i) { + $ENV{OPENKORE_DEFAULT_INTERFACE} = 'Win32'; + } + + if (PerlApp::exe() =~ /tkstart\.exe$/i) { + $ENV{OPENKORE_DEFAULT_INTERFACE} = 'Tk'; + } } else { print "Do not run start.pl directly! If you're using Perl then run openkore.pl instead!\n"; ; diff --git a/wxstart.exe b/wxstart.exe index 00764c94e8..6de5858d24 100644 Binary files a/wxstart.exe and b/wxstart.exe differ