# HG changeset patch
# User sheepluva
# Date 1447184593 -3600
# Node ID ed5a6478e71019ab54dc67d9c003ce0d263d4ffd
# Parent 31570b766315e7b4658f384ec374ff02b8495fbf# Parent 852bf1e052f4b243f049f0169d441c99c709cd64
merge default
diff -r 31570b766315 -r ed5a6478e710 .hgignore
--- a/.hgignore Tue Nov 10 18:16:35 2015 +0100
+++ b/.hgignore Tue Nov 10 20:43:13 2015 +0100
@@ -26,7 +26,7 @@
glob:*.diff
glob:vittorio.*
glob:project_files/HedgewarsMobile/Data/
-glob:project_files/HedgewarsMobile/build/
+glob:project_files/HedgewarsMobile/Build/
glob:gameServer/dist/
glob:misc/liblua/Xcode/build/
glob:misc/libphysfs/Xcode/build/
@@ -40,6 +40,8 @@
glob:*.orig
glob:*.bak
glob:*.rej
+glob:project_files/hwc/*.c
+glob:project_files/hwc/*.h
glob:project_files/Android-build/SDL-android-project/jni/**
glob:project_files/Android-build/SDL-android-project/obj
glob:project_files/Android-build/SDL-android-project/libs/armeabi*
@@ -63,3 +65,18 @@
glob:*.tar.*
glob:*.or
glob:*.res
+glob:Hedgewars.app/*
+glob:tools/CreateMacBundle.cmake
+glob:share/Info.plist
+glob:CTestTestfile.cmake
+glob:arch.c
+glob:*.swp
+glob:*~.nib
+glob:*.pbxuser
+glob:*.perspective
+glob:*.perspectivev3
+glob:*.project.xcworkspace
+glob:*.xcuserdata
+glob:xcuserdata
+glob:*.mode1v3
+glob:*.mode2v3
diff -r 31570b766315 -r ed5a6478e710 .hgtags
--- a/.hgtags Tue Nov 10 18:16:35 2015 +0100
+++ b/.hgtags Tue Nov 10 20:43:13 2015 +0100
@@ -60,3 +60,13 @@
0000000000000000000000000000000000000000 0.9.18-release
2fc02902c7cbf3c29bfe08a50e5f37983582b251 0.9.18-release
1617149e01a4fa25637e2ab655d0287ef9c21b7c 0.9.19-release
+af0520a6bf0061b27f8321514d35fcd2b1ef5f9c 0.9.20-release
+7e55468ffe384a3065524c483eb5e3cdb1658fd5 0.9.21-release
+7e55468ffe384a3065524c483eb5e3cdb1658fd5 fab746a3597e
+0f5961910e2712582b162abd08ae3eed330cc978 Nice one
+d9622394ec9c2974a84b9b4d9e6c0ac26c4060ff 0.9.22-RC
+0f5961910e2712582b162abd08ae3eed330cc978 Nice one
+0000000000000000000000000000000000000000 Nice one
+4c4f22cc3fa4e6c1e5cd6cce35350dd93478415f 0.9.22-release
+4c4f22cc3fa4e6c1e5cd6cce35350dd93478415f 0.9.22-release
+9621fdcad96589b3fd78713a0f31e72f26f068bb 0.9.22-release
diff -r 31570b766315 -r ed5a6478e710 .travis.yml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.travis.yml Tue Nov 10 20:43:13 2015 +0100
@@ -0,0 +1,31 @@
+language: c
+branches:
+ except:
+ gh-pages
+compiler:
+ - gcc
+ - clang
+env:
+ - BUILD_ARGS="-DCMAKE_BUILD_TYPE=Release"
+ - BUILD_ARGS="-DCMAKE_BUILD_TYPE=Debug"
+ - BUILD_ARGS="-DNOSERVER=1 -DBUILD_ENGINE_C=1"
+ - BUILD_ARGS="-DNOSERVER=1 -DNOVIDEOREC=1 -DNOPNG=1"
+ - BUILD_ARGS="-DNOSERVER=1 -DLUA_SYSTEM=0 -DPHYSFS_SYSTEM=0"
+matrix:
+ allow_failures:
+ # Failures we expect here
+before_install:
+ - sudo apt-get update -qq
+ - sudo apt-get install debhelper cmake dpkg-dev libqt4-dev qt4-qmake libphysfs-dev libsdl1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libsdl-net1.2-dev bzip2 ghc libghc-mtl-dev libghc-parsec3-dev libghc-bytestring-show-dev libghc-vector-dev libghc-zlib-dev libghc-random-dev libghc-stm-dev libghc-network-dev libghc-dataenc-dev libghc-hslogger-dev libghc-utf8-string-dev libghc-sha-dev libghc-entropy-dev liblua5.1-0-dev imagemagick fpc fp-compiler fp-units-misc libpng-dev fp-units-gfx libavcodec-dev libavformat-dev freeglut3-dev libglew1.6-dev
+script:
+ - mkdir build && cd build && cmake $BUILD_ARGS .. && make VERBOSE=1 && make test_verbose
+notifications:
+ email: false
+ irc:
+ channels:
+ - "chat.freenode.net#hedgewars"
+ template:
+ - "hw-build #%{build_number} (%{commit} by %{author}): %{message}"
+ - "See details at %{build_url}"
+ on_success: change
+ on_failure: always
diff -r 31570b766315 -r ed5a6478e710 CMakeLists.txt
--- a/CMakeLists.txt Tue Nov 10 18:16:35 2015 +0100
+++ b/CMakeLists.txt Tue Nov 10 20:43:13 2015 +0100
@@ -12,18 +12,18 @@
include(${CMAKE_MODULE_PATH}/utils.cmake)
#possible cmake configuration
-option(NOSERVER "Disable gameServer build (off)]" OFF)
+option(NOSERVER "Disable gameServer build (off)" OFF)
option(NOPNG "Disable screenshoot compression (off)" OFF)
option(NOVIDEOREC "Disable video recording (off)" OFF)
#libraries are built shared unless explicitly added as a static
option(BUILD_SHARED_LIBS "Build libraries as shared modules (on)" ON)
-#set this to ON when 2.1.0 becomes more widespread (and only for linux)
-option(PHYSFS_SYSTEM "Use system physfs (off)" OFF)
if(WIN32 OR APPLE)
+ option(PHYSFS_SYSTEM "Use system physfs (off)" OFF)
option(LUA_SYSTEM "Use system lua (off)" OFF)
else()
+ option(PHYSFS_SYSTEM "Use system physfs (on)" ON)
option(LUA_SYSTEM "Use system lua (on)" ON)
endif()
@@ -32,18 +32,28 @@
option(MINIMAL_FLAGS "Respect system flags as much as possible (off)" OFF)
option(NOAUTOUPDATE "Disable OS X Sparkle update checking (off)" OFF)
+option(SKIPBUNDLE "Do not create relocate bundle (off)" OFF)
+
+option(BUILD_ENGINE_C "Compile hwengine as native C (off)" OFF)
+option(GL2 "Enable OpenGL 2 rendering !!!EXPERIMENTAL - DO NOT USE!!! [default: off)" OFF)
set(GHFLAGS "" CACHE STRING "Additional Haskell flags")
if(UNIX AND NOT APPLE)
set(DATA_INSTALL_DIR "share/hedgewars" CACHE STRING "Resource folder path")
endif()
+option(NOVERSIONINFOUPDATE "Disable update of version_info.txt. To be used if source is in a git/repo that is NOT the hedgewars repo" OFF)
+
+#system paths for finding required fonts (see share/hedgewars/Data/fonts)
+#subdirectories will NOT be searched.
+#all fonts that can't be found will be bundled with hedgewars
+set(FONTS_DIRS "" CACHE STRING "Additional paths to folders where required fonts can be found ( ; is separator)")
#versioning
set(CPACK_PACKAGE_VERSION_MAJOR 0)
set(CPACK_PACKAGE_VERSION_MINOR 9)
-set(CPACK_PACKAGE_VERSION_PATCH 20)
-set(HEDGEWARS_PROTO_VER 46)
+set(CPACK_PACKAGE_VERSION_PATCH 23)
+set(HEDGEWARS_PROTO_VER 52)
set(HEDGEWARS_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
include(${CMAKE_MODULE_PATH}/revinfo.cmake)
@@ -53,20 +63,24 @@
include(${CMAKE_MODULE_PATH}/paths.cmake)
#general utilities
include(${CMAKE_MODULE_PATH}/utils.cmake)
+#paths initialization
+include(${CMAKE_MODULE_PATH}/paths.cmake)
#platform specific init code
include(${CMAKE_MODULE_PATH}/platform.cmake)
#when build type is not specified, assume Debug/Release according to build version information
-if (CMAKE_BUILD_TYPE)
- string (TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
- if ( NOT( (CMAKE_BUILD_TYPE MATCHES "RELEASE") OR (CMAKE_BUILD_TYPE MATCHES "DEBUG") ) )
- set (CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release)" FORCE)
- message (STATUS "Unknown build type, using default (${default_build_type})")
- endif ()
-else (CMAKE_BUILD_TYPE)
- set (CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release)" FORCE)
-endif (CMAKE_BUILD_TYPE)
+if(CMAKE_BUILD_TYPE)
+ string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
+ if(NOT((CMAKE_BUILD_TYPE MATCHES "RELEASE") OR
+ (CMAKE_BUILD_TYPE MATCHES "DEBUG") OR
+ (CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO")))
+ set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+ message(STATUS "Unknown build type ${CMAKE_BUILD_TYPE}, using default (${default_build_type})")
+ endif()
+else(CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE ${default_build_type} CACHE STRING "Build type (Debug/Release/RelWithDebInfo)" FORCE)
+endif(CMAKE_BUILD_TYPE)
#perform safe check that enable/disable compilation features
@@ -74,17 +88,14 @@
#set default compiler flags
add_flag_append(CMAKE_C_FLAGS "-Wall -pipe")
-add_flag_append(CMAKE_C_FLAGS_RELEASE "-Os")
+add_flag_append(CMAKE_C_FLAGS_RELEASE "-O2")
add_flag_append(CMAKE_C_FLAGS_DEBUG "-Wextra -O0")
add_flag_append(CMAKE_CXX_FLAGS "-Wall -pipe")
-add_flag_append(CMAKE_CXX_FLAGS_RELEASE "-Os")
+add_flag_append(CMAKE_CXX_FLAGS_RELEASE "-O2")
add_flag_append(CMAKE_CXX_FLAGS_DEBUG "-Wextra -O0")
-add_flag_append(CMAKE_Pascal_FLAGS "-Cs2000000")
-add_flag_append(CMAKE_Pascal_FLAGS_DEBUG "-O- -gv")
-add_flag_append(CMAKE_Pascal_FLAGS_RELEASE "-Os -Xs")
#CMake adds a lot of additional configuration flags, so let's clear them up
-if(${MINIMAL_FLAGS})
+if(MINIMAL_FLAGS)
unset(CMAKE_C_FLAGS_RELEASE)
unset(CMAKE_C_FLAGS_DEBUG)
unset(CMAKE_CXX_FLAGS_RELEASE)
@@ -97,7 +108,7 @@
if(${CMAKE_VERSION} VERSION_GREATER 2.6)
separate_arguments(ghflags_parsed UNIX_COMMAND ${GHFLAGS})
else()
- message(${WARNING} "GHFLAGS are available only when using CMake >= 2.8")
+ message("*** GHFLAGS are available only when using CMake >= 2.8 ***")
endif()
endif()
@@ -109,6 +120,7 @@
list(APPEND haskell_flags "-Wall" # all warnings
"-debug" # debug mode
"-dcore-lint" # internal sanity check
+ "-fno-warn-unused-do-bind"
)
else()
list(APPEND haskell_flags "-w" # no warnings
@@ -116,14 +128,32 @@
endif()
+#build engine without freepascal
+if(BUILD_ENGINE_C)
+ find_package(Clang REQUIRED)
+
+ if(${CLANG_VERSION} VERSION_LESS "3.0")
+ message(FATAL_ERROR "LLVM/Clang compiler required version is 3.0 but version ${CLANG_VERSION} was found!")
+ endif()
+
+ set(CMAKE_C_COMPILER ${CLANG_EXECUTABLE})
+ set(CMAKE_CXX_COMPILER ${CLANG_EXECUTABLE})
+endif()
+
+
+#server
+if(NOT NOSERVER)
+ add_subdirectory(gameServer)
+endif()
+
+
#lua discovery
-if (${LUA_SYSTEM})
- if (NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR)
+if(LUA_SYSTEM)
+ if(NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR)
find_package(Lua)
endif()
- if (LUA_LIBRARY AND LUA_INCLUDE_DIR)
- set(LUA_FOUND TRUE)
+ if(LUA_LIBRARY AND LUA_INCLUDE_DIR)
#use an IMPORTED tharget so that we can just use 'lua' to link
add_library(lua UNKNOWN IMPORTED)
set_target_properties(lua PROPERTIES IMPORTED_LOCATION ${LUA_LIBRARY})
@@ -131,7 +161,7 @@
message(FATAL_ERROR "Missing Lua! Rerun cmake with -DLUA_SYSTEM=off to build the internal version")
endif()
else()
- if (NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR)
+ if(NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR)
message(STATUS "LUA will be provided by the bundled sources")
endif()
set(lua_output_name "hwlua")
@@ -140,8 +170,8 @@
#physfs discovery
-if (${PHYSFS_SYSTEM})
- if (NOT PHYSFS_LIBRARY OR NOT PHYSFS_INCLUDE_DIR)
+if(PHYSFS_SYSTEM)
+ if(NOT PHYSFS_LIBRARY OR NOT PHYSFS_INCLUDE_DIR)
find_package(PhysFS)
endif()
@@ -155,54 +185,71 @@
string(REGEX MATCH "([0-9]+)" physfs_patchversion "${physfs_patchversion}")
set(physfs_detected_ver "${physfs_majorversion}.${physfs_minorversion}.${physfs_patchversion}")
- if (physfs_detected_ver VERSION_LESS "2.1.0")
- message(FATAL_ERROR "PhysFS version is too old (dected ${physfs_detected_ver}, required 2.1.0)")
- set(physfs_too_old true)
+ if(${physfs_detected_ver} VERSION_LESS 2.0.0)
+ message(FATAL_ERROR "PhysFS version is too old (detected ${physfs_detected_ver}, required 2.0.0)\n"
+ "Perform an update or rerun cmake with -DPHYSFS_SYSTEM=off to build the internal version")
endif()
endif()
- if (NOT PHYSFS_LIBRARY OR NOT PHYSFS_INCLUDE_DIR)
- message(FATAL_ERROR "Missing PhysFS! Rerun cmake with -DPHYSFS_SYSTEM=off to build the internal version")
- else()
+ if(PHYSFS_LIBRARY AND PHYSFS_INCLUDE_DIR)
#use an IMPORTED tharget so that we can just use 'physfs' to link
add_library(physfs UNKNOWN IMPORTED)
set_target_properties(physfs PROPERTIES IMPORTED_LOCATION ${PHYSFS_LIBRARY})
+ else()
+ message(FATAL_ERROR "Missing PhysFS! Rerun cmake with -DPHYSFS_SYSTEM=off to build the internal version")
endif()
else()
- if (NOT PHYSFS_LIBRARY OR NOT PHYSFS_INCLUDE_DIR)
+ if(NOT PHYSFS_LIBRARY OR NOT PHYSFS_INCLUDE_DIR)
message(STATUS "PhysFS will be provided by the bundled sources")
endif()
set(physfs_output_name "hwphysfs")
add_subdirectory(misc/libphysfs)
endif()
-find_package_or_disable_msg(FFMPEG NOVIDEOREC "Video recording will not be built")
+find_package_or_disable_msg(LIBAV NOVIDEOREC "Video recording will not be built")
#physfs helper library
add_subdirectory(misc/libphyslayer)
-#server
-if(NOT NOSERVER)
- add_subdirectory(gameServer)
+#maybe this could be merged inside hedgewars/CMakeLists.txt
+if(BUILD_ENGINE_C)
+ #pascal to c converter
+ add_subdirectory(tools/pas2c)
+ add_subdirectory(project_files/hwc)
+else()
+ #main pascal engine
+ add_subdirectory(hedgewars)
endif()
-#main engine
-add_subdirectory(hedgewars)
-
#Android related build scripts
+#TODO: when ANDROID, BUILD_ENGINE_LIBRARY should be set
if(ANDROID)
- #run cmake -DANDROID=1 to enable this
add_subdirectory(project_files/Android-build)
-endif()
-
-#TODO: when ANDROID, BUILD_ENGINE_LIBRARY should be set
-if(NOT ANDROID)
+else(ANDROID)
add_subdirectory(bin)
add_subdirectory(QTfrontend)
add_subdirectory(share)
add_subdirectory(tools)
-endif()
-
+endif(ANDROID)
include(${CMAKE_MODULE_PATH}/cpackvars.cmake)
+enable_testing()
+
+add_custom_target(test_normal COMMAND ${CMAKE_CTEST_COMMAND} -E '^todo/' --timeout 300 --schedule-random)
+add_custom_target(test_verbose COMMAND ${CMAKE_CTEST_COMMAND} -E '^todo/' --timeout 300 --schedule-random -V)
+
+set(LUATESTS_DIR "${CMAKE_SOURCE_DIR}/tests/lua")
+set(TESTSDATA_DIR "${CMAKE_SOURCE_DIR}/share/hedgewars/Data")
+
+# set set this to "" if you want to see what's going on
+# TODO: engine should do this implicitly when running tests,
+# unless some env var like HWENGINE_SHOWTESTS is set or something
+set(STATSONLYFLAG "--stats-only")
+
+# add all lua tests
+file(GLOB_RECURSE luatests RELATIVE "${LUATESTS_DIR}" "${LUATESTS_DIR}/*.lua")
+foreach(luatest ${luatests})
+ add_test("${luatest}" "bin/hwengine" "--prefix" "${TESTSDATA_DIR}" "--nosound" "--nomusic" "${STATSONLYFLAG}" "--lua-test" "${LUATESTS_DIR}/${luatest}")
+endforeach(luatest)
+
diff -r 31570b766315 -r ed5a6478e710 COPYING
--- a/COPYING Tue Nov 10 18:16:35 2015 +0100
+++ b/COPYING Tue Nov 10 20:43:13 2015 +0100
@@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -305,7 +305,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
diff -r 31570b766315 -r ed5a6478e710 CREDITS
--- a/CREDITS Tue Nov 10 18:16:35 2015 +0100
+++ b/CREDITS Tue Nov 10 20:43:13 2015 +0100
@@ -25,6 +25,7 @@
- Lortinak -> OldMan (2010), ShortHair (2010)
- chujoii -> BrainSlug (2010), Dragon (2010), Ladle (2010), Laminaria (2010), Pantsu (2010), Pig (2010), Plunger (2010), SauceBoat (2010), ShaggyYeti (2010), SleepWalker (2010), SunWukong (2010), Teapot (2010), Teacup (2010), Zombi (2010)
- Randy Broda -> Cyclops (2011), Soldier (2011)
+- Wohlstand -> PoliceGirl [based on policecap and sm_daisy] (2014)
==========
= GRAVESTONES
@@ -45,6 +46,8 @@
==========
- John Dum -> Nature theme
- Jonatan Nilsson -> Pirate theme, City theme, Oriental theme, Snow theme
+- yd - http://opengameart.org/users/yd -> "oriented", used as Olympics SD theme
+- Kevin MacLeod - http://incompetech.com/ -> "hitman", used as basis for preliminary default SD theme
==========
= THEMES
diff -r 31570b766315 -r ed5a6478e710 ChangeLog.txt
--- a/ChangeLog.txt Tue Nov 10 18:16:35 2015 +0100
+++ b/ChangeLog.txt Tue Nov 10 20:43:13 2015 +0100
@@ -1,9 +1,131 @@
+ features
* bugfixes
-0.9.19 -> ???:
- * increase precision in damage calcs; extra damage affects fire properly now
- * visual enhancements for whip
+0.9.22 -> 0.9.23
+ * Hammer damage is now rounded down. This means it will cause NO DAMAGE to a hedgehog with less than 3 hp.
+ * Fixed bee not being affected by wrap world edge while still being thrown
+ * Fixed turn not ending when sticky mine was trapped on rubberband
+ * Various other fixes
+
+0.9.21 -> 0.9.22
+ + New Weapon / Map object: AirMine (floating mine that will follow nearby hedgehogs)
+ + Extensive changes to TechRacer: Variable terrain types, enhanced parameters, hwmap interpreter, fuel limiter, etc.
+ + HedgeEditor - create missions/etc. in-game! see http://hedgewars.org/HedgeEditor
+ + Map previews can now take script parameters into account and preview waypoints in TechRacer
+ + Added a couple new flags
+ + Various tweaks to the interface and in-game chat
+ + Divided teams options will now just be ignored when more/less than 2 teams/clans, instead of displaying a fatal error
+ + Added 6 TechRacer maps to TechMaps
+ + Added 3 SpeedShoppa Challenges: Shoppa Love, Ropes and Crates, The Customer is King
+ + Hammer damage is now rounded up. This means it can be used to execute hedgehogs with only 1 hp.
+ + Improved "Art" theme.
+ * Generated bridges/girders are now connected better to the land mass
+ * Fixed rubberband sprite
+ * Fixed Wind-Indicator being wrong in certain situations
+ * Melon Bomb Pieces now bounce on Rubberband
+ * Reduced menu music volume
+ * The game will now fallback to default voicepack if a team's voicepack is not locally installed. (Instead of rendering team voiceless)
+ * Hammer now does more damage when the Extra-Damage utility is used
+ * Many other bug fixes
+
+Lua-API:
+ + New map parameter: MapFeatureSize -- numeric representation of detail slider below map preview; use within onGameInit()/onPreviewInit()
+ + New function: SetMaxBuildDistance([ distInPx ]) -- specify how many pixels away a hedgehog can still place girders/etc. set to 0 for no limit; call with no param to reset to default
+ + New hook: onSuddenDeath() -- called by engine when sudden death begins
+ * Previously missing gear states are now available (gstSubmersible, gstFrozen and gstNoGravity)
+ * Fixed OnHogAttack giving the incorrect AmmoType (amNothing) under certain conditions
+
+0.9.20 -> 0.9.21:
+ + New type of randomly generated maps: Perlin Maps.
+ + Old Random generated maps are more diverse now.
+ + Slider for adjusting land generation detail.
+ + Highlander gamemode can now be used with custom weapon schemes (1-8=How probable to get this weapon. 9=All hogs get it)
+ + New playable themes: "Hoggywood" and "Cake"
+ + New gameplay mode "Construction Mode"
+ + New gameplay mode "TechRacer"
+ + New game play mode "DiagonalMaze" (generates a simple diagonal maze)
+ + Add 7 target practice missions, now with simple scoring
+ + Update RC Plane Challenge: Stats screen reworked and shows now several facts, simple ranking system based on used planes, some taunts in the game
+ + New training/multiplayer mission: "Climb Home"
+ + Game scheme screen has a "Script parameter" field now. This allows to make more customizable scripts/modes.
+ + Network game rejoining. Note: Your team(s) will vanish after 3 turns.
+ + Visual and gameplay changes to "sea" - world edge, visual change to wrap world edge to allow seeing through the wrap, visual change to bounce worldedge
+ + The map of the Basketball Mission can be selected for regular games again ("BasketballField")
+ + New engine command: /togglechat will disable/enable chat display (does not affect chat history display)
+ + Change to Racer: first weapon/utility available will be automatically selected on start
+ + Added some visual feedback to failed girder placement.
+ + Various performance tweaks, especially for very large maps.
+ + Allow switching through hogs in reverse order with PRECISE+HOGSWITCH (left shift + tab, by default)
+ + Added support for custom Sudden Death music to theme.cfg (e.g. sd-music=hell.ogg ).
+ + New Hats: policegirl, fr_tomato, cratehider
+ * Fixed drill rockets sometimes exploding on impact.
+ * Fixed trainings broken due to indestructable targets/crates.
+ * Fixes and tweaks for low qualily rendering.
+ * Sinegun won't shoot through -solid- land anymore
+ * Many bug fixes and tweaks.
+
+Frontend / Netgame:
+ + High resolution previews!
+ + Preview for dynamic maps generated by game style scripts (e.g. "ShoppaMap))!
+ + Moved room status filter to top left of rooms list.
+
+Lua API:
+ + New library: Params, makes parsing of script parameters easier
+ + New library: TargetPractice, used to generate target practice missions (the newly added missions use it)
+ + More helpful syntax error messages.
+ + New hooks:
+ onParameters(paramString) -- called when script parameters are configured. the parameter contains the parameter(s) as text string
+ onPreviewInit() -- called during map preview initialization
+ onGearWaterSkip(gearUid) -- called when a gear skims the water without drowning (when hitting it with high speed at low angle). By checking gearUid you can figure out which gear that was.
+ + New functions:
+ DismissTeam(teamname) -- removes a team from the game (note: if you used loc() on teamnames, don't forget to the translated teamname here too)
+ GetGameFlag(gameflag) -- returns true/false
+ PlaceSprite(x, y, sprite, frameIdx [, landFlag, ... ]) -- sprite refers to an id from the TSprite list
+ SetWaterLine(waterline) -- moves water level to the specified y. the current value is in read-only global waterline
+ SetNextWeapon() -- make current hedgehog switch to next weapon. e.g. use in trainings to preselect weapon
+ SetWeapon(ammoType) -- decide which weapon the current hedgehog should equip
+ + Map Drawing:
+ -- to be used in onGameInit() -- first set MapGen to mgDrawn and then use the commands below
+ AddPoint(x, y [, width [, erase] ]) -- takes x,y location, a width (means start of a new line) and erase (if line should erase, not draw)
+ FlushPoints() -- makes sure that all the points/lines specified using the command above are actually applied to the map
+ + New global enumerations:
+ Mapgens: mgRandom, mgMaze, mgPerlin, mgDrawn
+ TSprite values
+ LandFlags: lfIndestructible, lfIce, lfBouncy
+ + Changed functions:
+ HogSay(gearUid, text, manner [, vgState]) -- now also allows you to make NON-Hedgehog gears speak, e.g. barrels... wait what?!
+ + Changed hooks:
+ onHogAttack() can now be hooked with new parameter: onHogAttack(ammoType) - to conveniently find out which ammo/weapon is being used
+ * Fixes:
+ gfResetHealth is now a available like the other GameFlags
+0.9.19 -> 0.9.20:
+ + New campaign, A Space Adventure!
+ + Password protected rooms
+ + Shapes on drawn maps (ellipses, rectangles) - constrain dimensions with ctrl, as with straight line tool.
+ + New rubber utility, lfBouncy mask (green) for maps. lfBouncy is also anti-portal.
+ + Lazy loading of many aspects of frontend to improve startup time under Windows
+ + Set hog/team/health label defaults in config, toggle team health display using delete (left shift + delete for labels now)
+ + Usernames next to teams when playing online.
+ + Can now filter rooms by game style (such as Highlander). Filtering simplified since it is mostly unused.
+ + AFK mode. Press p when not your turn online to trigger autoskip of your turn.
+ + Russian localisation of Default voice.
+ + Map edges can wrap or bounce. Also a silly "connect to the sea" mode
+ + Sticky fire kicks you a bit less, fire interacts with frozen land/ice
+ + Generated map stays same if the template is the same between groups (all/large for example)
+ + Visual enhancements for whip and crosshair
+ + Option to draw maps with a "shoppa" border - used by ShoppaMap lua at present
+ + New hats
+ + Translation updates
+ + New lua script to control gravity. May have unpredictable effects. Try zero g shoppa. Changes to allow lua to spawn poison clouds without interrupting turn.
+ + Speech bubbles are now echoed to chat for logging purposes with the hog's name.
+ * You should now thaw on your turn, not enemy's. AI frozen/unfrozen crate movement fix. Blowtorch can thaw frozen hogs.
+ * Prevent target crosshair moving around unpredictably when doing multiple airstrikes
+ * Rope should kick along surfaces more reliably, fix rope aim speed if you miss a shot, firing rope does not freeze timer, fix aiming on last rope
+ * Remember bounce/timer in reset wep modes like Highlander
+ * Increase precision in damage calcs; extra damage affects fire properly now
+ * Fixed video recording resolution
+ * Fixed context menu/cursor in text areas
+ * Many bugfixes. Keypad enter in chat, hog sliding freezing game, team name flaws in Windows, localisation of tips, crasher in slots with no weapons, frontend holiday css.
0.9.18 -> 0.9.19:
+ New Freezer weapon - freezes terrain, water, hedgehogs, mines, cases, explosives
diff -r 31570b766315 -r ed5a6478e710 INSTALL
--- a/INSTALL Tue Nov 10 18:16:35 2015 +0100
+++ b/INSTALL Tue Nov 10 20:43:13 2015 +0100
@@ -1,14 +1,14 @@
To compile and install you need:
- CMake >= 2.6.0
- - FreePascal >= 2.2.0
- - Qt >= 4.5.0
+ - FreePascal >= 2.2.4
+ - Qt >= 4.7.0
- SDL >= 2.0
- SDL_net >= 2.0
- SDL_mixer >= 2.0
- SDL_image >= 2.0
- SDL_ttf >= 2.0
- - Lua >= 5.1.0
- - Physfs >= 2.1.0
+ - Lua = 5.1.0
+ - Physfs >= 2.0.0
For server:
- Glasgow Haskell Compiler >= 6.10
- bytestring-show package
@@ -16,7 +16,6 @@
- hslogger package
For videorecording:
- FFmpeg or LibAV
- - GLUT (when SDL < 2)
For compressed screenshots:
- libpng
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/CMakeLists.txt
--- a/QTfrontend/CMakeLists.txt Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/CMakeLists.txt Tue Nov 10 20:43:13 2015 +0100
@@ -1,5 +1,5 @@
# Configure for Qt4
-set(QT_MIN_VERSION "4.5.0")
+set(QT_MIN_VERSION "4.7.0")
include(CheckLibraryExists)
set(QT_USE_QTCORE TRUE)
@@ -13,10 +13,11 @@
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
+# https://bugreports.qt-project.org/browse/QTBUG-17333
if(APPLE AND
${QTVERSION} VERSION_GREATER "4.7.0" AND
${QTVERSION} VERSION_LESS "4.7.4")
- message(FATAL_ERROR "This version of QT is known *not* to work, please update or use a lower version")
+ message(FATAL_ERROR "This version of Qt is known *not* to work, please update or use a lower version")
endif()
find_package(SDL2 REQUIRED)
@@ -24,10 +25,10 @@
include_directories(${SDL2_INCLUDE_DIR})
include_directories(${SDL2MIXER_INCLUDE_DIR})
-if(${FFMPEG_FOUND})
+if(LIBAV_FOUND)
add_definitions(-DVIDEOREC -D__STDC_CONSTANT_MACROS)
- include_directories(${FFMPEG_INCLUDE_DIR})
- list(APPEND HW_LINK_LIBS ${FFMPEG_LIBRARIES})
+ include_directories(${LIBAV_INCLUDE_DIR})
+ list(APPEND HW_LINK_LIBS ${LIBAV_LIBRARIES})
endif()
# server messages localization
@@ -61,9 +62,9 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/ui/widget)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util/platform)
-include_directories(${PHYSFS_INCLUDE_DIR})
-include_directories(${PHYSLAYER_INCLUDE_DIR})
-
+include_directories(BEFORE ${PHYSFS_INCLUDE_DIR})
+include_directories(BEFORE ${PHYSLAYER_INCLUDE_DIR})
+include_directories(${LUA_INCLUDE_DIR}) #brought by physlayer hwpacksmounter.h
if(UNIX)
# HACK: in freebsd cannot find iconv.h included via SDL.h
@@ -152,10 +153,15 @@
set(hwfr_rez hedgewars.qrc)
-if(${BUILD_ENGINE_LIBRARY})
+if(BUILD_ENGINE_LIBRARY)
add_definitions(-DHWLIBRARY=1)
set(hwlibname "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}")
list(APPEND HW_LINK_LIBS ${hwlibname})
+
+ if(LIBAV_FOUND)
+# add_subdirectory(avwrapper)
+ list(APPEND HW_LINK_LIBS avwrapper)
+ endif()
endif()
qt4_add_resources(hwfr_rez_src ${hwfr_rez})
@@ -184,9 +190,9 @@
#when debugging, always prompt a console to see fronted messages
#TODO: check it doesn't interfere on UNIX
-if(CMAKE_BUILD_TYPE MATCHES "RELEASE")
+if(CMAKE_BUILD_TYPE MATCHES "RELEASE" OR CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO")
set(console_access "WIN32")
-endif(CMAKE_BUILD_TYPE MATCHES "RELEASE")
+endif(CMAKE_BUILD_TYPE MATCHES "RELEASE" OR CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO")
add_executable(hedgewars ${console_access}
${hwfr_src}
@@ -204,7 +210,7 @@
${SDL2_LIBRARY}
${SDL2MIXER_LIBRARY}
)
-
+
if(WIN32 AND NOT UNIX)
if(NOT SDL_LIBRARY)
list(APPEND HW_LINK_LIBS SDL)
@@ -218,6 +224,10 @@
)
endif()
+if(CMAKE_CXX_COMPILER MATCHES "clang*")
+ list(APPEND HW_LINK_LIBS stdc++ m)
+endif()
+
target_link_libraries(hedgewars ${HW_LINK_LIBS})
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/HWApplication.cpp
--- a/QTfrontend/HWApplication.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/HWApplication.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -13,14 +13,13 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "HWApplication.h"
#include
#include
-#include "hwform.h"
#include "MessageDialog.h"
#if !defined(Q_OS_WIN)
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/HWApplication.h
--- a/QTfrontend/HWApplication.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/HWApplication.h Tue Nov 10 20:43:13 2015 +0100
@@ -13,13 +13,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef HWAPP_H
#define HWAPP_H
#include
+#include "hwform.h"
class HWForm;
class QEvent;
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/achievements.cpp
--- a/QTfrontend/achievements.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/achievements.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/achievements.h
--- a/QTfrontend/achievements.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/achievements.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ACHIEVEMENTS_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/binds.cpp
--- a/QTfrontend/binds.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/binds.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "binds.h"
@@ -46,7 +46,7 @@
{"timer 5", "5", QT_TRANSLATE_NOOP("binds", "timer 5 sec"), NULL, NULL},
{"+attack", "space", QT_TRANSLATE_NOOP("binds", "attack"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Fire your selected weapon or trigger an utility item:")},
{"put", "mousel", QT_TRANSLATE_NOOP("binds", "put"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Pick a weapon or a target location under the cursor:")},
- {"findhh", "h", QT_TRANSLATE_NOOP("binds", "find hedgehog"), QT_TRANSLATE_NOOP("binds (categories)", "Camera"), QT_TRANSLATE_NOOP("binds (descriptions)", "Move the camera to the active hog:")},
+ {"findhh", "h", QT_TRANSLATE_NOOP("binds", "autocam / find hedgehog"),QT_TRANSLATE_NOOP("binds (categories)", "Camera"), QT_TRANSLATE_NOOP("binds (descriptions)", "Toggle automatic camera / refocus on active hedgehog:")},
{"+cur_u", "[8]", QT_TRANSLATE_NOOP("binds", "up"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Move the cursor or camera without using the mouse:")},
{"+cur_l", "[4]", QT_TRANSLATE_NOOP("binds", "left"), NULL, NULL},
{"+cur_r", "[6]", QT_TRANSLATE_NOOP("binds", "right"), NULL, NULL},
@@ -65,6 +65,7 @@
{"mute", "8", QT_TRANSLATE_NOOP("binds", "mute audio"), NULL, NULL},
{"fullscr", "f12", QT_TRANSLATE_NOOP("binds", "change mode"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Toggle fullscreen mode:")},
{"capture", "c", QT_TRANSLATE_NOOP("binds", "capture"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Take a screenshot:")},
+ {"+speedup", "s", QT_TRANSLATE_NOOP("binds", "speed up replay"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Demo replay:")},
{"rotmask", "delete", QT_TRANSLATE_NOOP("binds", "hedgehog info"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Toggle labels above hedgehogs:")},
#ifdef VIDEOREC
{"record", "r", QT_TRANSLATE_NOOP("binds", "record"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Record video:")}
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/binds.h
--- a/QTfrontend/binds.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/binds.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef BINDS_H
@@ -22,9 +22,9 @@
#include
#ifdef VIDEOREC
-#define BINDS_NUMBER 46
+#define BINDS_NUMBER 47
#else
-#define BINDS_NUMBER 45
+#define BINDS_NUMBER 46
#endif
struct BindAction
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/campaign.cpp
--- a/QTfrontend/campaign.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/campaign.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "campaign.h"
@@ -26,14 +26,31 @@
QList getCampMissionList(QString & campaignName, QString & teamName)
{
QList missionInfoList;
- QSettings teamfile(cfgdir->absolutePath() + "/Teams/" + teamName + ".hwt", QSettings::IniFormat, 0);
+ QSettings teamfile(cfgdir->absolutePath() + "/Teams/" + teamName + ".hwt", QSettings::IniFormat, 0);
teamfile.setIniCodec("UTF-8");
+
+ // if entry not found check if there is written without _
+ // if then is found rename it to use _
+ QString spaceCampName = campaignName;
+ spaceCampName = spaceCampName.replace(QString("_"),QString(" "));
+ if (!teamfile.childGroups().contains("Campaign " + campaignName) and
+ teamfile.childGroups().contains("Campaign " + spaceCampName)){
+ teamfile.beginGroup("Campaign " + spaceCampName);
+ QStringList keys = teamfile.childKeys();
+ teamfile.endGroup();
+ for (int i=0;i=0 and unlockedMissions==0)
{
- for(unsigned int i=progress+1;i>0;i--)
- {
- MissionInfo missionInfo;
- missionInfo.name = campfile.value(QString("Mission %1/Name").arg(i)).toString();
- QString script = campfile.value(QString("Mission %1/Script").arg(i)).toString();
+ for(unsigned int i=progress+1;i>0;i--)
+ {
+ MissionInfo missionInfo;
+ missionInfo.name = campfile.value(QString("Mission %1/Name").arg(i)).toString();
+ QString script = campfile.value(QString("Mission %1/Script").arg(i)).toString();
missionInfo.script = script;
- missionInfo.description = m_info.value(campaignName+"-"+ script.replace(QString(".lua"),QString("")) + ".desc",
+ missionInfo.description = m_info.value(campaignName+"-"+ script.replace(QString(".lua"),QString("")) + ".desc",
QObject::tr("No description available")).toString();
QString image = campfile.value(QString("Mission %1/Script").arg(i)).toString().replace(QString(".lua"),QString(".png"));
missionInfo.image = ":/res/campaign/"+campaignName+"/"+image;
if (!QFile::exists(missionInfo.image))
- missionInfo.image = ":/res/CampaignDefault.png";
- missionInfoList.append(missionInfo);
- }
- }
- else if(unlockedMissions>0)
- {
- for(int i=1;i<=unlockedMissions;i++)
- {
- QString missionNum = QString("%1").arg(i);
- int missionNumber = teamfile.value("Campaign " + campaignName + "/Mission"+missionNum, -1).toInt();
- MissionInfo missionInfo;
- missionInfo.name = campfile.value(QString("Mission %1/Name").arg(missionNumber)).toString();
- QString script = campfile.value(QString("Mission %1/Script").arg(missionNumber)).toString();
+ missionInfo.image = ":/res/CampaignDefault.png";
+ missionInfoList.append(missionInfo);
+ }
+ }
+ else if(unlockedMissions>0)
+ {
+ for(int i=1;i<=unlockedMissions;i++)
+ {
+ QString missionNum = QString("%1").arg(i);
+ int missionNumber = teamfile.value("Campaign " + campaignName + "/Mission"+missionNum, -1).toInt();
+ MissionInfo missionInfo;
+ missionInfo.name = campfile.value(QString("Mission %1/Name").arg(missionNumber)).toString();
+ QString script = campfile.value(QString("Mission %1/Script").arg(missionNumber)).toString();
missionInfo.script = script;
- missionInfo.description = m_info.value(campaignName+"-"+ script.replace(QString(".lua"),QString("")) + ".desc",
+ missionInfo.description = m_info.value(campaignName+"-"+ script.replace(QString(".lua"),QString("")) + ".desc",
QObject::tr("No description available")).toString();
QString image = campfile.value(QString("Mission %1/Script").arg(missionNumber)).toString().replace(QString(".lua"),QString(".png"));
missionInfo.image = ":/res/campaign/"+campaignName+"/"+image;
if (!QFile::exists(missionInfo.image))
- missionInfo.image = ":/res/CampaignDefault.png";
- missionInfoList.append(missionInfo);
- }
- }
- return missionInfoList;
+ missionInfo.image = ":/res/CampaignDefault.png";
+ missionInfoList.append(missionInfo);
+ }
+ }
+ return missionInfoList;
}
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/campaign.h
--- a/QTfrontend/campaign.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/campaign.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef CAMPAIGN_H
@@ -23,11 +23,11 @@
class MissionInfo
{
- public:
- QString name;
- QString description;
- QString script;
- QString image;
+ public:
+ QString name;
+ QString description;
+ QString script;
+ QString image;
};
QList getCampMissionList(QString & campaignName, QString & teamName);
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/drawmapscene.cpp
--- a/QTfrontend/drawmapscene.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/drawmapscene.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -304,6 +304,8 @@
void DrawMapScene::decode(QByteArray data)
{
+ hideCursor();
+
bool erasing = m_isErasing;
oldItems.clear();
@@ -324,7 +326,7 @@
data.remove(0, 2);
quint8 flags = *(quint8 *)data.data();
data.remove(0, 1);
- qDebug() << px << py;
+ //qDebug() << px << py;
if(flags & 0x80)
{
isSpecial = false;
@@ -386,7 +388,7 @@
int i = 1;
while(i < points.size())
{
- if( (i != points.size() - 1)
+ if( ((i != points.size() - 1) || (prevPoint == points[i]))
&& (sqr(prevPoint.x() - points[i].x()) + sqr(prevPoint.y() - points[i].y()) < 1000)
)
points.removeAt(i);
@@ -459,7 +461,7 @@
l.append(center);
} else
{
- qreal angleDelta = qMax(0.1, qMin(0.7, 120 / r));
+ qreal angleDelta = qMax(static_cast (0.1), qMin(static_cast (0.7), 120 / r));
for(qreal angle = 0.0; angle < 2*M_PI; angle += angleDelta)
l.append(center + QPointF(rx * cos(angle), ry * sin(angle)));
l.append(l.first());
@@ -485,3 +487,51 @@
return point;
}
+
+void DrawMapScene::optimize()
+{
+ if(!paths.size()) return;
+
+ // break paths into segments
+ Paths pth;
+
+ foreach(const PathParams & pp, paths)
+ {
+ int l = pp.points.size();
+
+ if(l == 1)
+ {
+ pth.prepend(pp);
+ } else
+ {
+ for(int i = l - 2; i >= 0; --i)
+ {
+ PathParams p = pp;
+ p.points = QList() << p.points[i] << p.points[i + 1];
+ pth.prepend(pp);
+ }
+ }
+ }
+
+ // clear the scene
+ oldItems.clear();
+ oldPaths.clear();
+ clear();
+ paths.clear();
+ m_specialPoints.clear();
+
+ // render the result
+ foreach(const PathParams & p, pth)
+ {
+ if(p.erasing)
+ m_pen.setBrush(m_eraser);
+ else
+ m_pen.setBrush(m_brush);
+
+ m_pen.setWidth(deserializePenWidth(p.width));
+
+ addPath(pointsToPath(p.points), m_pen);
+ }
+
+ emit pathChanged();
+}
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/drawmapscene.h
--- a/QTfrontend/drawmapscene.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/drawmapscene.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DRAWMAPSCENE_H
@@ -58,6 +58,7 @@
void undo();
void clearMap();
void simplifyLast();
+ void optimize();
void setErasing(bool erasing);
void showCursor();
void hideCursor();
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/game.cpp
--- a/QTfrontend/game.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/game.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,9 +13,12 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include
+#include
+
#include
#include
#include
@@ -60,6 +63,9 @@
lastGameCfg = gamecfg;
lastGameAmmo = ammo;
lastGameTeamSel = pTeamSelWidget;
+
+ gameState = gsNotStarted;
+ gameType = gtNone;
}
HWGame::~HWGame()
@@ -142,6 +148,7 @@
HWProto::addStringToBuffer(teamscfg, "eseed " + QUuid::createUuid().toString());
HWProto::addStringToBuffer(teamscfg, "e$template_filter 2");
+ HWProto::addStringToBuffer(teamscfg, "e$feature_size "+QString::number(rand()%18+4));
HWTeam team1;
team1.setDifficulty(0);
@@ -245,9 +252,27 @@
case 'E':
{
int size = msg.size();
- emit ErrorMessage(QString("Last two engine messages:\n") + QString().append(msg.mid(2)).left(size - 4));
+ emit ErrorMessage(
+ tr("A Fatal ERROR occured! - The game engine had to stop.\n\n"
+ "We are very sorry for the inconvenience :(\n\n"
+ "If this keeps happening, please click the '%1' button in the main menu!\n\n"
+ "Last two engine messages:\n%2")
+ .arg("Feedback")
+ .arg(QString::fromUtf8(msg.mid(2).left(size - 4))));
return;
}
+ case 'y':
+ {
+ // copy string to clipboard
+ QApplication::clipboard()->setText(QString::fromUtf8(msg.mid(2)));
+ break;
+ }
+ case 'Y':
+ {
+ // paste clipboard to game
+ SendIPC(QString("Y").toAscii() + QApplication::clipboard()->text().toUtf8().left(250).replace('\n', ' '));
+ break;
+ }
case 'i':
{
emit GameStats(msg.at(2), QString::fromUtf8(msg.mid(3)));
@@ -303,6 +328,13 @@
config->Form->ui.pageOptions->windowHeightEdit->setValue(wh[1].toInt());
break;
}
+ case '~':
+ {
+ int size = msg.size();
+ QString msgbody = QString::fromUtf8(msg.mid(2).left(size - 4));
+ emit SendConsoleCommand(msgbody);
+ break;
+ }
default:
{
if (gameType == gtNet && !netSuspend)
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/game.h
--- a/QTfrontend/game.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/game.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GAME_H
@@ -99,6 +99,7 @@
void HaveRecord(RecordType type, const QByteArray & record);
void ErrorMessage(const QString &);
void CampStateChanged(int);
+ void SendConsoleCommand(const QString & command);
public slots:
void FromNet(const QByteArray & msg);
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/gameuiconfig.cpp
--- a/QTfrontend/gameuiconfig.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/gameuiconfig.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/gameuiconfig.h
--- a/QTfrontend/gameuiconfig.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/gameuiconfig.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GAMECONFIG_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/hedgewars.qrc
--- a/QTfrontend/hedgewars.qrc Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/hedgewars.qrc Tue Nov 10 20:43:13 2015 +0100
@@ -124,7 +124,11 @@
res/iconHealth.pngres/iconSuddenDeath.pngres/iconDamage.png
+ res/iconDamageLockG.png
+ res/iconDamageLockR.pngres/iconTime.png
+ res/iconTimeLockG.png
+ res/iconTimeLockR.pngres/iconMine.pngres/iconDud.pngres/iconRope.png
@@ -179,7 +183,6 @@
res/chat/ingame.pngres/splash.pngres/html/about.html
- res/xml/tips.xmlres/chat/hedgehogcontributor.pngres/chat/hedgehogcontributor_gray.pngres/chat/roomadmincontributor.png
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/hwconsts.cpp.in
--- a/QTfrontend/hwconsts.cpp.in Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/hwconsts.cpp.in Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -37,7 +37,7 @@
bool custom_data = false;
int cMaxTeams = 8;
-int cMinServerVersion = 1;
+int cMinServerVersion = 3;
QString * cDefaultAmmoStore = new QString( AMMOLINE_DEFAULT_QT AMMOLINE_DEFAULT_PROB
AMMOLINE_DEFAULT_DELAY AMMOLINE_DEFAULT_CRATE );
@@ -67,6 +67,15 @@
<< qMakePair(QString("One of Everything"), QString(
AMMOLINE_ONEEVERY_QT AMMOLINE_ONEEVERY_PROB
AMMOLINE_ONEEVERY_DELAY AMMOLINE_ONEEVERY_CRATE ))
+ << qMakePair(QString("Highlander"), QString(
+ AMMOLINE_HIGHLANDER_QT AMMOLINE_HIGHLANDER_PROB
+ AMMOLINE_HIGHLANDER_DELAY AMMOLINE_HIGHLANDER_CRATE ))
+ << qMakePair(QString("Construction Mode"), QString(
+ AMMOLINE_CONSTRUCTION_QT AMMOLINE_CONSTRUCTION_PROB
+ AMMOLINE_CONSTRUCTION_DELAY AMMOLINE_CONSTRUCTION_CRATE ))
+ << qMakePair(QString("Shoppa Pro"), QString(
+ AMMOLINE_SHOPPAPRO_QT AMMOLINE_SHOPPAPRO_PROB
+ AMMOLINE_SHOPPAPRO_DELAY AMMOLINE_SHOPPAPRO_CRATE ))
;
unsigned int colors[] = HW_TEAMCOLOR_ARRAY;
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/hwconsts.h
--- a/QTfrontend/hwconsts.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/hwconsts.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#if !defined(TARGET_OS_IPHONE)
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/hwform.cpp
--- a/QTfrontend/hwform.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/hwform.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -164,14 +164,12 @@
ui.pageVideos->init(config);
#endif
-#ifdef __APPLE__
+#if defined(__APPLE__) && defined(SPARKLE_ENABLED)
if (config->isAutoUpdateEnabled())
{
AutoUpdater* updater = NULL;
-#ifdef SPARKLE_ENABLED
updater = new SparkleAutoUpdater();
-#endif
if (updater)
{
updater->checkForUpdates();
@@ -1675,7 +1673,7 @@
connect(game, SIGNAL(CampStateChanged(int)), this, SLOT(UpdateCampaignPageProgress(int)));
connect(game, SIGNAL(GameStateChanged(GameState)), this, SLOT(GameStateChanged(GameState)));
connect(game, SIGNAL(GameStats(char, const QString &)), ui.pageGameStats, SLOT(GameStats(char, const QString &)));
- connect(game, SIGNAL(ErrorMessage(const QString &)), this, SLOT(ShowErrorMessage(const QString &)), Qt::QueuedConnection);
+ connect(game, SIGNAL(ErrorMessage(const QString &)), this, SLOT(ShowFatalErrorMessage(const QString &)), Qt::QueuedConnection);
connect(game, SIGNAL(HaveRecord(RecordType, const QByteArray &)), this, SLOT(GetRecord(RecordType, const QByteArray &)));
m_lastDemo = QByteArray();
}
@@ -1753,6 +1751,7 @@
connect(game, SIGNAL(SendNet(const QByteArray &)), hwnet, SLOT(SendNet(const QByteArray &)));
connect(game, SIGNAL(SendChat(const QString &)), hwnet, SLOT(chatLineToNet(const QString &)));
+ connect(game, SIGNAL(SendConsoleCommand(const QString&)), hwnet, SLOT(consoleCommand(const QString&)));
connect(game, SIGNAL(SendTeamMessage(const QString &)), hwnet, SLOT(SendTeamMessage(const QString &)));
connect(hwnet, SIGNAL(chatStringFromNet(const QString &)), game, SLOT(FromNetChat(const QString &)), Qt::QueuedConnection);
@@ -1831,14 +1830,14 @@
if (hwnet)
{
NetAmmoSchemeModel * netAmmo = new NetAmmoSchemeModel(hwnet);
- connect(hwnet, SIGNAL(netSchemeConfig(QStringList &)), netAmmo, SLOT(setNetSchemeConfig(QStringList &)));
+ connect(hwnet, SIGNAL(netSchemeConfig(QStringList)), netAmmo, SLOT(setNetSchemeConfig(QStringList)));
ui.pageNetGame->pGameCFG->GameSchemes->setModel(netAmmo);
ui.pageNetGame->setRoomName(hwnet->getRoom());
ui.pageNetGame->pGameCFG->GameSchemes->view()->disconnect(hwnet);
- connect(hwnet, SIGNAL(netSchemeConfig(QStringList &)),
+ connect(hwnet, SIGNAL(netSchemeConfig(QStringList)),
this, SLOT(selectFirstNetScheme()));
}
@@ -1903,15 +1902,15 @@
Q_UNUSED(index);
HWTeam team(ui.pageCampaign->CBTeam->currentText());
QString campaignName = ui.pageCampaign->CBCampaign->currentText().replace(QString(" "),QString("_"));
- QString tName = team.name();
-
- campaignMissionInfo = getCampMissionList(campaignName,tName);
- ui.pageCampaign->CBMission->clear();
-
+ QString tName = team.name();
+
+ campaignMissionInfo = getCampMissionList(campaignName,tName);
+ ui.pageCampaign->CBMission->clear();
+
for(int i=0;iCBMission->addItem(QString(campaignMissionInfo[i].name), QString(campaignMissionInfo[i].name));
- }
+ }
}
void HWForm::UpdateCampaignPageMission(int index)
@@ -1923,7 +1922,7 @@
if(index > -1 && index < campaignMissionInfo.count()) {
ui.pageCampaign->lbltitle->setText("
"+ui.pageCampaign->CBMission->currentText()+"
");
ui.pageCampaign->lbldescription->setText(campaignMissionInfo[index].description);
- ui.pageCampaign->btnPreview->setIcon(QIcon(campaignMissionInfo[index].image));
+ ui.pageCampaign->btnPreview->setIcon(QIcon(campaignMissionInfo[index].image));
}
}
@@ -1935,12 +1934,12 @@
UpdateCampaignPage(0);
for(int i=0;iCBMission->count();i++)
{
- if (ui.pageCampaign->CBMission->itemText(i)==missionTitle)
- {
- ui.pageCampaign->CBMission->setCurrentIndex(i);
- break;
- }
- }
+ if (ui.pageCampaign->CBMission->itemText(i)==missionTitle)
+ {
+ ui.pageCampaign->CBMission->setCurrentIndex(i);
+ break;
+ }
+ }
}
// used for --set-everything [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]
@@ -2094,9 +2093,9 @@
}
}
-void HWForm::ShowErrorMessage(const QString & msg)
+void HWForm::ShowFatalErrorMessage(const QString & msg)
{
- MessageDialog::ShowErrorMessage(msg, this);
+ MessageDialog::ShowFatalMessage(msg, this);
}
void HWForm::showFeedbackDialog()
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/hwform.h
--- a/QTfrontend/hwform.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/hwform.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef HWFORM_H
@@ -120,7 +120,7 @@
void StartMPGame();
void GameStateChanged(GameState gameState);
void ForcedDisconnect(const QString & reason);
- void ShowErrorMessage(const QString &);
+ void ShowFatalErrorMessage(const QString &);
void GetRecord(RecordType type, const QByteArray & record);
void CreateNetGame();
void UpdateWeapons();
@@ -196,7 +196,7 @@
AmmoSchemeModel * ammoSchemeModel;
QStack PagesStack;
QString previousCampaignName;
- QString previousTeamName;
+ QString previousTeamName;
QList campaignMissionInfo;
QTime eggTimer;
BGWidget * wBackground;
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/main.cpp
--- a/QTfrontend/main.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/main.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "HWApplication.h"
@@ -125,6 +125,28 @@
}
}
+QString getUsage()
+{
+ return QString(
+"%1: hedgewars [%2...] [%3]\n"
+"\n"
+"%4:\n"
+" --help %5\n"
+" --config-dir=PATH %6\n"
+" --data-dir=PATH %7\n"
+"\n"
+"%8"
+"\n"
+).arg(HWApplication::tr("Usage", "command-line"))
+.arg(HWApplication::tr("OPTION", "command-line"))
+.arg(HWApplication::tr("CONNECTSTRING", "command-line"))
+.arg(HWApplication::tr("Options", "command-line"))
+.arg(HWApplication::tr("Display this help", "command-line"))
+.arg(HWApplication::tr("Custom path for configuration data and user data", "command-line"))
+.arg(HWApplication::tr("Custom path to the game data folder", "command-line"))
+.arg(HWApplication::tr("Hedgewars can use a %1 (e.g. \"%2\") to connect on start.", "command-line").arg(HWApplication::tr("CONNECTSTRING", "command-line")).arg(QString("hwplay://") + NETGAME_DEFAULT_SERVER));
+}
+
int main(int argc, char *argv[])
{
// Since we're calling this first, closeResources() will be the last thing called after main() returns.
@@ -137,8 +159,87 @@
SDLInteraction::instance();
HWApplication app(argc, argv);
+ app.setAttribute(Qt::AA_DontShowIconsInMenus,false);
+ // file engine and splash. to be initialized later
+ engine = NULL;
QLabel *splash = NULL;
+
+ // parse arguments
+
+ QStringList arguments = app.arguments();
+ QMap parsedArgs;
+ {
+ QList::iterator i = arguments.begin();
+ while(i != arguments.end())
+ {
+ QString arg = *i;
+
+
+ QRegExp opt("--(\\S+)=(.+)");
+ if(opt.exactMatch(arg))
+ {
+ parsedArgs[opt.cap(1)] = opt.cap(2);
+ i = arguments.erase(i);
+ }
+ else
+ {
+ if(arg.startsWith("--")) {
+ if(arg == "--help")
+ {
+ printf("%s", getUsage().toUtf8().constData());
+ return 0;
+ }
+ // argument is something wrong
+ fprintf(stderr, "%s\n\n%s",
+ HWApplication::tr("Malformed option argument: %1", "command-line").arg(arg).toUtf8().constData(),
+ getUsage().toUtf8().constData());
+ return 1;
+ }
+
+ // if not starting with --, then always skip
+ // (because we can't determine if executable path/call or not - on windows)
+ ++i;
+ }
+ }
+ }
+
+ if(parsedArgs.contains("data-dir"))
+ {
+ QFileInfo f(parsedArgs["data-dir"]);
+ parsedArgs.remove("data-dir");
+ if(!f.exists())
+ {
+ qWarning() << "WARNING: Cannot open DATA_PATH=" << f.absoluteFilePath();
+ }
+ *cDataDir = f.absoluteFilePath();
+ custom_data = true;
+ }
+
+ if(parsedArgs.contains("config-dir"))
+ {
+ QFileInfo f(parsedArgs["config-dir"]);
+ parsedArgs.remove("config-dir");
+ cfgdir->setPath(f.absoluteFilePath());
+ custom_config = true;
+ }
+ else
+ {
+ cfgdir->setPath(QDir::homePath());
+ custom_config = false;
+ }
+
+ if (!parsedArgs.isEmpty()) {
+ foreach (const QString & key, parsedArgs.keys())
+ {
+ fprintf(stderr, "%s\n", HWApplication::tr("Unknown option argument: %1", "command-line").arg(QString("--") + key).toUtf8().constData());
+ }
+ fprintf(stderr, "\n%s", getUsage().toUtf8().constData());
+ return 1;
+ }
+
+ // end of parameter parsing
+
#if defined Q_OS_WIN
QPixmap pixmap(":res/splash.png");
splash = new QLabel(0, Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
@@ -150,55 +251,6 @@
splash->setPixmap(pixmap);
splash->show();
#endif
-
- engine = new FileEngineHandler(argv[0]);
-
- app.setAttribute(Qt::AA_DontShowIconsInMenus,false);
-
- QStringList arguments = app.arguments();
- QMap parsedArgs;
- {
- QList::iterator i = arguments.begin();
- while(i != arguments.end())
- {
- QString arg = *i;
-
- QRegExp opt("--(\\S+)=(.+)");
- if(opt.exactMatch(arg))
- {
- parsedArgs[opt.cap(1)] = opt.cap(2);
- i = arguments.erase(i);
- }
- else
- {
- ++i;
- }
- }
- }
-
- if(parsedArgs.contains("data-dir"))
- {
- QFileInfo f(parsedArgs["data-dir"]);
- if(!f.exists())
- {
- qWarning() << "WARNING: Cannot open DATA_PATH=" << f.absoluteFilePath();
- }
- *cDataDir = f.absoluteFilePath();
- custom_data = true;
- }
-
- if(parsedArgs.contains("config-dir"))
- {
- QFileInfo f(parsedArgs["config-dir"]);
- cfgdir->setPath(f.absoluteFilePath());
- custom_config = true;
- }
- else
- {
- cfgdir->setPath(QDir::homePath());
- custom_config = false;
- }
-
app.setStyle(new QPlastiqueStyle());
QDateTime now = QDateTime::currentDateTime();
@@ -259,6 +311,7 @@
}
// setup PhysFS
+ engine = new FileEngineHandler(argv[0]);
engine->mount(datadir->absolutePath());
engine->mount(cfgdir->absolutePath() + "/Data");
engine->mount(cfgdir->absolutePath());
@@ -284,6 +337,7 @@
if (!Translator.load(QString("physfs://Locale/hedgewars_%1").arg(cc)))
qWarning("Failed to install translation (%s)", qPrintable(cc));
app.installTranslator(&Translator);
+ app.setLayoutDirection(QLocale(cc).textDirection());
}
#ifdef _WIN32
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/GameStyleModel.cpp
--- a/QTfrontend/model/GameStyleModel.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/GameStyleModel.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/GameStyleModel.h
--- a/QTfrontend/model/GameStyleModel.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/GameStyleModel.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/HatModel.cpp
--- a/QTfrontend/model/HatModel.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/HatModel.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/HatModel.h
--- a/QTfrontend/model/HatModel.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/HatModel.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/MapModel.cpp
--- a/QTfrontend/model/MapModel.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/MapModel.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
@@ -30,6 +30,7 @@
MapModel::MapInfo MapModel::MapInfoRandom = {MapModel::GeneratedMap, "+rnd+", "", 0, "", "", "", false};
MapModel::MapInfo MapModel::MapInfoMaze = {MapModel::GeneratedMaze, "+maze+", "", 0, "", "", "", false};
+MapModel::MapInfo MapModel::MapInfoPerlin = {MapModel::GeneratedMaze, "+perlin+", "", 0, "", "", "", false};
MapModel::MapInfo MapModel::MapInfoDrawn = {MapModel::HandDrawnMap, "+drawn+", "", 0, "", "", "", false};
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/MapModel.h
--- a/QTfrontend/model/MapModel.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/MapModel.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
@@ -49,6 +49,7 @@
Invalid,
GeneratedMap,
GeneratedMaze,
+ GeneratedPerlin,
HandDrawnMap,
MissionMap,
StaticMap
@@ -98,7 +99,7 @@
QStandardItem * getMap(const QString & map);
// Static MapInfos for drawn and generated maps
- static MapInfo MapInfoRandom, MapInfoMaze, MapInfoDrawn;
+ static MapInfo MapInfoRandom, MapInfoMaze, MapInfoPerlin, MapInfoDrawn;
/// Loads the maps
bool loadMaps();
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/ThemeModel.cpp
--- a/QTfrontend/model/ThemeModel.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/ThemeModel.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
@@ -62,7 +62,7 @@
void ThemeModel::loadThemes() const
{
- qDebug("[LAZINESS ThemeModel::loadThemes()]");
+ qDebug("[LAZINESS] ThemeModel::loadThemes()");
m_themesLoaded = true;
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/ThemeModel.h
--- a/QTfrontend/model/ThemeModel.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/ThemeModel.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/ammoSchemeModel.cpp
--- a/QTfrontend/model/ammoSchemeModel.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/ammoSchemeModel.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -58,13 +58,15 @@
<< QVariant(4) // mines number 32
<< QVariant(0) // mine dud pct 33
<< QVariant(2) // explosives 34
- << QVariant(35) // health case pct 35
- << QVariant(25) // health case amt 36
- << QVariant(47) // water rise amt 37
- << QVariant(5) // health dec amt 38
- << QVariant(100) // rope modfier 39
- << QVariant(100) // get away time 40
- << QVariant(0) // world edge 41
+ << QVariant(0) // air mines 35
+ << QVariant(35) // health case pct 36
+ << QVariant(25) // health case amt 37
+ << QVariant(47) // water rise amt 38
+ << QVariant(5) // health dec amt 39
+ << QVariant(100) // rope modfier 40
+ << QVariant(100) // get away time 41
+ << QVariant(0) // world edge 42
+ << QVariant() // scriptparam 43
;
AmmoSchemeModel::AmmoSchemeModel(QObject* parent, const QString & fileName) :
@@ -83,6 +85,7 @@
<< "Timeless"
<< "Thinking with Portals"
<< "King Mode"
+ << "Construction Mode"
;
numberOfDefaultSchemes = predefSchemesNames.size();
@@ -123,13 +126,15 @@
<< "minesnum" // 32
<< "minedudpct" // 33
<< "explosives" // 34
- << "healthprobability" // 35
- << "healthcaseamount" // 36
- << "waterrise" // 37
- << "healthdecrease" // 38
- << "ropepct" // 39
- << "getawaytime" // 40
- << "worldedge" // 41
+ << "airmines" // 35
+ << "healthprobability" // 36
+ << "healthcaseamount" // 37
+ << "waterrise" // 38
+ << "healthdecrease" // 39
+ << "ropepct" // 40
+ << "getawaytime" // 41
+ << "worldedge" // 42
+ << "scriptparam" // scriptparam 43
;
QList proMode;
@@ -169,13 +174,15 @@
<< QVariant(0) // mines number 32
<< QVariant(0) // mine dud pct 33
<< QVariant(2) // explosives 34
- << QVariant(35) // health case pct 35
- << QVariant(25) // health case amt 36
- << QVariant(47) // water rise amt 37
- << QVariant(5) // health dec amt 38
- << QVariant(100) // rope modfier 39
- << QVariant(100) // get away time 40
- << QVariant(0) // world edge 41
+ << QVariant(0) // air mines 35
+ << QVariant(35) // health case pct 36
+ << QVariant(25) // health case amt 37
+ << QVariant(47) // water rise amt 38
+ << QVariant(5) // health dec amt 39
+ << QVariant(100) // rope modfier 40
+ << QVariant(100) // get away time 41
+ << QVariant(0) // world edge 42
+ << QVariant() // scriptparam 43
;
QList shoppa;
@@ -211,17 +218,19 @@
<< QVariant(100) // init health 28
<< QVariant(50) // sudden death 29
<< QVariant(1) // case prob 30
- << QVariant(3) // mines time 31
+ << QVariant(0) // mines time 31
<< QVariant(0) // mines number 32
<< QVariant(0) // mine dud pct 33
<< QVariant(0) // explosives 34
- << QVariant(0) // health case pct 35
- << QVariant(25) // health case amt 36
- << QVariant(47) // water rise amt 37
- << QVariant(5) // health dec amt 38
- << QVariant(100) // rope modfier 39
- << QVariant(100) // get away time 40
- << QVariant(0) // world edge 41
+ << QVariant(8) // air mines 35
+ << QVariant(0) // health case pct 36
+ << QVariant(25) // health case amt 37
+ << QVariant(47) // water rise amt 38
+ << QVariant(5) // health dec amt 39
+ << QVariant(100) // rope modfier 40
+ << QVariant(100) // get away time 41
+ << QVariant(0) // world edge 42
+ << QVariant() // scriptparam 43
;
QList cleanslate;
@@ -261,13 +270,15 @@
<< QVariant(4) // mines number 32
<< QVariant(0) // mine dud pct 33
<< QVariant(2) // explosives 34
- << QVariant(35) // health case pct 35
- << QVariant(25) // health case amt 36
- << QVariant(47) // water rise amt 37
- << QVariant(5) // health dec amt 38
- << QVariant(100) // rope modfier 39
- << QVariant(100) // get away time 40
- << QVariant(0) // world edge 41
+ << QVariant(0) // air mines 35
+ << QVariant(35) // health case pct 36
+ << QVariant(25) // health case amt 37
+ << QVariant(47) // water rise amt 38
+ << QVariant(5) // health dec amt 39
+ << QVariant(100) // rope modfier 40
+ << QVariant(100) // get away time 41
+ << QVariant(0) // world edge 42
+ << QVariant() // scriptparam 43
;
QList minefield;
@@ -304,16 +315,18 @@
<< QVariant(15) // sudden death 29
<< QVariant(0) // case prob 30
<< QVariant(0) // mines time 31
- << QVariant(80) // mines number 32
+ << QVariant(200) // mines number 32
<< QVariant(0) // mine dud pct 33
<< QVariant(0) // explosives 34
- << QVariant(35) // health case pct 35
- << QVariant(25) // health case amt 36
- << QVariant(47) // water rise amt 37
- << QVariant(5) // health dec amt 38
- << QVariant(100) // rope modfier 39
- << QVariant(100) // get away time 40
- << QVariant(0) // world edge 41
+ << QVariant(0) // air mines 35
+ << QVariant(35) // health case pct 36
+ << QVariant(25) // health case amt 37
+ << QVariant(47) // water rise amt 38
+ << QVariant(5) // health dec amt 39
+ << QVariant(100) // rope modfier 40
+ << QVariant(100) // get away time 41
+ << QVariant(0) // world edge 42
+ << QVariant() // scriptparam 43
;
QList barrelmayhem;
@@ -352,14 +365,16 @@
<< QVariant(0) // mines time 31
<< QVariant(0) // mines number 32
<< QVariant(0) // mine dud pct 33
- << QVariant(80) // explosives 34
- << QVariant(35) // health case pct 35
- << QVariant(25) // health case amt 36
- << QVariant(47) // water rise amt 37
- << QVariant(5) // health dec amt 38
- << QVariant(100) // rope modfier 39
- << QVariant(100) // get away time 40
- << QVariant(0) // world edge 41
+ << QVariant(200) // explosives 34
+ << QVariant(0) // air mines 35
+ << QVariant(35) // health case pct 36
+ << QVariant(25) // health case amt 37
+ << QVariant(47) // water rise amt 38
+ << QVariant(5) // health dec amt 39
+ << QVariant(100) // rope modfier 40
+ << QVariant(100) // get away time 41
+ << QVariant(0) // world edge 42
+ << QVariant() // scriptparam 43
;
QList tunnelhogs;
@@ -399,13 +414,15 @@
<< QVariant(10) // mines number 32
<< QVariant(10) // mine dud pct 33
<< QVariant(10) // explosives 34
- << QVariant(35) // health case pct 35
- << QVariant(25) // health case amt 36
- << QVariant(47) // water rise amt 37
- << QVariant(5) // health dec amt 38
- << QVariant(100) // rope modfier 39
- << QVariant(100) // get away time 40
- << QVariant(0) // world edge 41
+ << QVariant(4) // air mines 35
+ << QVariant(35) // health case pct 36
+ << QVariant(25) // health case amt 37
+ << QVariant(47) // water rise amt 38
+ << QVariant(5) // health dec amt 39
+ << QVariant(100) // rope modfier 40
+ << QVariant(100) // get away time 41
+ << QVariant(0) // world edge 42
+ << QVariant() // scriptparam 43
;
QList forts;
@@ -445,13 +462,15 @@
<< QVariant(0) // mines number 32
<< QVariant(0) // mine dud pct 33
<< QVariant(0) // explosives 34
- << QVariant(35) // health case pct 35
- << QVariant(25) // health case amt 36
- << QVariant(47) // water rise amt 37
- << QVariant(5) // health dec amt 38
- << QVariant(100) // rope modfier 39
- << QVariant(100) // get away time 40
- << QVariant(0) // world edge 41
+ << QVariant(0) // air mines 35
+ << QVariant(35) // health case pct 36
+ << QVariant(25) // health case amt 37
+ << QVariant(47) // water rise amt 38
+ << QVariant(5) // health dec amt 39
+ << QVariant(100) // rope modfier 40
+ << QVariant(100) // get away time 41
+ << QVariant(0) // world edge 42
+ << QVariant() // scriptparam 43
;
QList timeless;
@@ -491,13 +510,15 @@
<< QVariant(5) // mines number 32
<< QVariant(10) // mine dud pct 33
<< QVariant(2) // explosives 34
- << QVariant(35) // health case pct 35
- << QVariant(30) // health case amt 36
- << QVariant(0) // water rise amt 37
- << QVariant(0) // health dec amt 38
- << QVariant(100) // rope modfier 39
- << QVariant(100) // get away time 40
- << QVariant(0) // world edge 41
+ << QVariant(0) // air mines 35
+ << QVariant(35) // health case pct 36
+ << QVariant(30) // health case amt 37
+ << QVariant(0) // water rise amt 38
+ << QVariant(0) // health dec amt 39
+ << QVariant(100) // rope modfier 40
+ << QVariant(100) // get away time 41
+ << QVariant(0) // world edge 42
+ << QVariant() // scriptparam 43
;
QList thinkingportals;
@@ -537,13 +558,15 @@
<< QVariant(5) // mines number 32
<< QVariant(0) // mine dud pct 33
<< QVariant(5) // explosives 34
- << QVariant(25) // health case pct 35
- << QVariant(25) // health case amt 36
- << QVariant(47) // water rise amt 37
- << QVariant(5) // health dec amt 38
- << QVariant(100) // rope modfier 39
- << QVariant(100) // get away time 40
- << QVariant(0) // world edge 41
+ << QVariant(4) // air mines 35
+ << QVariant(25) // health case pct 36
+ << QVariant(25) // health case amt 37
+ << QVariant(47) // water rise amt 38
+ << QVariant(5) // health dec amt 39
+ << QVariant(100) // rope modfier 40
+ << QVariant(100) // get away time 41
+ << QVariant(0) // world edge 42
+ << QVariant() // scriptparam 43
;
QList kingmode;
@@ -583,16 +606,65 @@
<< QVariant(4) // mines number 32
<< QVariant(0) // mine dud pct 33
<< QVariant(2) // explosives 34
- << QVariant(35) // health case pct 35
- << QVariant(25) // health case amt 36
- << QVariant(47) // water rise amt 37
- << QVariant(5) // health dec amt 38
- << QVariant(100) // rope modfier 39
- << QVariant(100) // get away time 40
- << QVariant(0) // world edge 41
+ << QVariant(0) // air mines 35
+ << QVariant(35) // health case pct 36
+ << QVariant(25) // health case amt 37
+ << QVariant(47) // water rise amt 38
+ << QVariant(5) // health dec amt 39
+ << QVariant(100) // rope modfier 40
+ << QVariant(100) // get away time 41
+ << QVariant(0) // world edge 42
+ << QVariant() // scriptparam 43
;
-
+ QList construction;
+ construction
+ << predefSchemesNames[11] // name 0
+ << QVariant(false) // fortsmode 1
+ << QVariant(false) // team divide 2
+ << QVariant(false) // solid land 3
+ << QVariant(false) // border 4
+ << QVariant(false) // low gravity 5
+ << QVariant(false) // laser sight 6
+ << QVariant(false) // invulnerable 7
+ << QVariant(false) // reset health 8
+ << QVariant(false) // vampiric 9
+ << QVariant(false) // karma 10
+ << QVariant(false) // artillery 11
+ << QVariant(true) // random order 12
+ << QVariant(false) // king 13
+ << QVariant(false) // place hog 14
+ << QVariant(false) // shared ammo 15
+ << QVariant(true) // disable girders 16
+ << QVariant(true) // disable land objects 17
+ << QVariant(false) // AI survival 18
+ << QVariant(true) // inf. attack 19
+ << QVariant(false) // reset weps 20
+ << QVariant(true) // per hog ammo 21
+ << QVariant(false) // no wind 22
+ << QVariant(false) // more wind 23
+ << QVariant(false) // tag team 24
+ << QVariant(false) // bottom border 25
+ << QVariant(100) // damage modfier 26
+ << QVariant(45) // turn time 27
+ << QVariant(100) // init health 28
+ << QVariant(15) // sudden death 29
+ << QVariant(5) // case prob 30
+ << QVariant(3) // mines time 31
+ << QVariant(0) // mines number 32
+ << QVariant(0) // mine dud pct 33
+ << QVariant(0) // explosives 34
+ << QVariant(0) // air mines 35
+ << QVariant(35) // health case pct 36
+ << QVariant(25) // health case amt 37
+ << QVariant(47) // water rise amt 38
+ << QVariant(5) // health dec amt 39
+ << QVariant(100) // rope modfier 40
+ << QVariant(100) // get away time 41
+ << QVariant(0) // world edge 42
+ << QVariant() // scriptparam 43
+ ;
+
schemes.append(defaultScheme);
schemes.append(proMode);
schemes.append(shoppa);
@@ -604,6 +676,7 @@
schemes.append(timeless);
schemes.append(thinkingportals);
schemes.append(kingmode);
+ schemes.append(construction);
int size = fileConfig.beginReadArray("schemes");
@@ -688,7 +761,7 @@
else
{
QList newScheme = schemes[row];
- newScheme[0] = QVariant(tr("copy of") + " " + newScheme[0].toString());
+ newScheme[0] = QVariant(tr("copy of %1").arg(newScheme[0].toString()));
schemes.insert(schemes.size(), newScheme);
}
@@ -785,7 +858,7 @@
return netScheme[index.column()];
}
-void NetAmmoSchemeModel::setNetSchemeConfig(QStringList & cfg)
+void NetAmmoSchemeModel::setNetSchemeConfig(QStringList cfg)
{
if(cfg.size() != netScheme.size())
{
@@ -793,6 +866,8 @@
return;
}
+ cfg[cfg.size()-1] = cfg[cfg.size()-1].mid(1);
+
for(int i = 0; i < cfg.size(); ++i)
netScheme[i] = QVariant(cfg[i]);
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/ammoSchemeModel.h
--- a/QTfrontend/model/ammoSchemeModel.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/ammoSchemeModel.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _AMMO_SCHEME_MODEL_INCLUDED
@@ -70,7 +70,7 @@
QVariant data(const QModelIndex &index, int role) const;
public slots:
- void setNetSchemeConfig(QStringList & cfg);
+ void setNetSchemeConfig(QStringList cfg);
private:
QList netScheme;
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/netserverslist.cpp
--- a/QTfrontend/model/netserverslist.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/netserverslist.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/netserverslist.h
--- a/QTfrontend/model/netserverslist.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/netserverslist.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _NET_SERVERSLIST_INCLUDED
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/playerslistmodel.cpp
--- a/QTfrontend/model/playerslistmodel.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/playerslistmodel.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -237,6 +237,7 @@
<< index.data(InGame).toBool()
<< index.data(RoomFilterRole).toBool()
<< index.data(InRoom).toBool()
+ << index.data(Contributor).toBool()
;
for(int i = flags.size() - 1; i >= 0; --i)
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/playerslistmodel.h
--- a/QTfrontend/model/playerslistmodel.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/playerslistmodel.h Tue Nov 10 20:43:13 2015 +0100
@@ -23,6 +23,8 @@
InGame = Qt::UserRole + 6,
InRoom = Qt::UserRole + 7,
Contributor = Qt::UserRole + 8
+ // if you add a role that will affect the player icon,
+ // then also add it to the flags Qlist in updateIcon()!
};
enum SpecialRoles {
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/roomslistmodel.cpp
--- a/QTfrontend/model/roomslistmodel.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/roomslistmodel.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
@@ -108,22 +108,38 @@
if (role == Qt::DecorationRole)
{
const QIcon roomBusyIcon(":/res/iconDamage.png");
+ const QIcon roomBusyIconGreen(":/res/iconDamageLockG.png");
+ const QIcon roomBusyIconRed(":/res/iconDamageLockR.png");
const QIcon roomWaitingIcon(":/res/iconTime.png");
+ const QIcon roomWaitingIconGreen(":/res/iconTimeLockG.png");
+ const QIcon roomWaitingIconRed(":/res/iconTimeLockR.png");
+
+ QString flags = m_data.at(row).at(StateColumn);
- if (m_data.at(row).at(0).isEmpty())
- return QVariant(roomWaitingIcon);
+ if (flags.contains("g"))
+ {
+ if (flags.contains("j"))
+ return QVariant(roomBusyIconRed);
+ else if (flags.contains("p"))
+ return QVariant(roomBusyIconGreen);
+ else
+ return QVariant(roomBusyIcon);
+ }
else
- return QVariant(roomBusyIcon);
+ {
+ if (flags.contains("j"))
+ return QVariant(roomWaitingIconRed);
+ else if (flags.contains("p"))
+ return QVariant(roomWaitingIconGreen);
+ else
+ return QVariant(roomWaitingIcon);
+ }
}
QString content = m_data.at(row).at(column);
if (role == Qt::DisplayRole)
{
- // supply in progress flag as bool
- if (column == 0)
- return QVariant(QString(!content.isEmpty()));
-
// display room names
if (column == 5)
{
@@ -132,6 +148,7 @@
{
if (content == "+rnd+") return tr("Random Map");
if (content == "+maze+") return tr("Random Maze");
+ if (content == "+perlin+") return tr("Random Perlin");
if (content == "+drawn+") return tr("Hand-drawn");
}
@@ -149,6 +166,7 @@
{
if (content == "+rnd+" ||
content == "+maze+" ||
+ content == "+perlin+" ||
content == "+drawn+" ||
m_staticMapModel->mapExists(content) ||
m_missionMapModel->mapExists(content))
@@ -188,7 +206,7 @@
l.append(rooms[i + t]);
}
- m_data.append(roomInfo2RoomRecord(l));
+ m_data.append(l);
}
endResetModel();
@@ -199,7 +217,7 @@
{
beginInsertRows(QModelIndex(), 0, 0);
- m_data.prepend(roomInfo2RoomRecord(info));
+ m_data.prepend(info);
endInsertRows();
}
@@ -248,24 +266,7 @@
if (i < 0)
return;
- m_data[i] = roomInfo2RoomRecord(info);
+ m_data[i] = info;
emit dataChanged(index(i, 0), index(i, columnCount(QModelIndex()) - 1));
}
-
-
-QStringList RoomsListModel::roomInfo2RoomRecord(const QStringList & info)
-{
- QStringList result;
-
- result = info;
-
- // for matters of less memory usage and quicker access store
- // the boolean string as either "t" or empty
- if (info[StateColumn].toLower() == "true")
- result[StateColumn] = "t";
- else
- result[StateColumn] = QString();
-
- return result;
-}
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/model/roomslistmodel.h
--- a/QTfrontend/model/roomslistmodel.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/model/roomslistmodel.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
@@ -66,8 +66,6 @@
QStringList m_headerData;
MapModel * m_staticMapModel;
MapModel * m_missionMapModel;
-
- QStringList roomInfo2RoomRecord(const QStringList & info);
};
#endif // HEDGEWARS_ROOMSLISTMODEL_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/hwmap.cpp
--- a/QTfrontend/net/hwmap.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/hwmap.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Ulyanov Igor
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,15 +14,23 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include
+#include
+#include
+
#include "hwconsts.h"
#include "hwmap.h"
HWMap::HWMap(QObject * parent) :
TCPBase(false, parent)
{
+ templateFilter = 0;
+ m_mapgen = MAPGEN_REGULAR;
+ m_maze_size = 0;
+ m_feature_size = 50;
}
HWMap::~HWMap()
@@ -34,12 +42,15 @@
return !m_hasStarted;
}
-void HWMap::getImage(const QString & seed, int filter, MapGenerator mapgen, int maze_size, const QByteArray & drawMapData)
+void HWMap::getImage(const QString & seed, int filter, MapGenerator mapgen, int maze_size, const QByteArray & drawMapData, QString & script, QString & scriptparam, int feature_size)
{
m_seed = seed;
+ m_script = script;
+ m_scriptparam = scriptparam;
templateFilter = filter;
m_mapgen = mapgen;
m_maze_size = maze_size;
+ m_feature_size = feature_size;
if(mapgen == MAPGEN_DRAWN) m_drawMapData = drawMapData;
Start(true);
}
@@ -52,19 +63,57 @@
arguments << QString("%1").arg(ipc_port);
arguments << "--user-prefix";
arguments << cfgdir->absolutePath();
+ arguments << "--prefix";
+ arguments << datadir->absolutePath();
arguments << "--landpreview";
return arguments;
}
void HWMap::onClientDisconnect()
-{
+{
+ QLinearGradient linearGrad(QPoint(128, 0), QPoint(128, 128));
+ linearGrad.setColorAt(1, QColor(0, 0, 192));
+ linearGrad.setColorAt(0, QColor(66, 115, 225));
+
if (readbuffer.size() == 128 * 32 + 1)
{
quint8 *buf = (quint8*) readbuffer.constData();
QImage im(buf, 256, 128, QImage::Format_Mono);
im.setNumColors(2);
+
+ QPixmap px(QSize(256, 128));
+ QPixmap pxres(px.size());
+ QPainter p(&pxres);
+
+ px.fill(Qt::yellow);
+ QBitmap bm = QBitmap::fromImage(im);
+ px.setMask(bm);
+
+ p.fillRect(pxres.rect(), linearGrad);
+ p.drawPixmap(0, 0, px);
+
emit HHLimitReceived(buf[128 * 32]);
- emit ImageReceived(im);
+ emit ImageReceived(px);
+ } else if (readbuffer.size() == 128 * 256 + 1)
+ {
+ QVector colorTable;
+ colorTable.resize(256);
+ for(int i = 0; i < 256; ++i)
+ colorTable[i] = qRgba(255, 255, 0, i);
+
+ const quint8 *buf = (const quint8*) readbuffer.constData();
+ QImage im(buf, 256, 128, QImage::Format_Indexed8);
+ im.setColorTable(colorTable);
+
+ QPixmap px = QPixmap::fromImage(im, Qt::ColorOnly);
+ QPixmap pxres(px.size());
+ QPainter p(&pxres);
+
+ p.fillRect(pxres.rect(), linearGrad);
+ p.drawPixmap(0, 0, px);
+
+ emit HHLimitReceived(buf[128 * 256]);
+ emit ImageReceived(px);
}
}
@@ -73,10 +122,17 @@
SendIPC(QString("eseed %1").arg(m_seed).toUtf8());
SendIPC(QString("e$template_filter %1").arg(templateFilter).toUtf8());
SendIPC(QString("e$mapgen %1").arg(m_mapgen).toUtf8());
+ SendIPC(QString("e$feature_size %1").arg(m_feature_size).toUtf8());
+ if (!m_script.isEmpty())
+ {
+ SendIPC(QString("escript Scripts/Multiplayer/%1.lua").arg(m_script).toUtf8());
+ SendIPC(QString("e$scriptparam %1").arg(m_scriptparam).toUtf8());
+ }
switch (m_mapgen)
{
case MAPGEN_MAZE:
+ case MAPGEN_PERLIN:
SendIPC(QString("e$maze_size %1").arg(m_maze_size).toUtf8());
break;
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/hwmap.h
--- a/QTfrontend/net/hwmap.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/hwmap.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _HWMAP_INCLUDED
@@ -22,16 +22,17 @@
#include
#include
-#include
+#include
#include "tcpBase.h"
enum MapGenerator
{
- MAPGEN_REGULAR,
- MAPGEN_MAZE,
- MAPGEN_DRAWN,
- MAPGEN_MAP
+ MAPGEN_REGULAR = 0,
+ MAPGEN_MAZE = 1,
+ MAPGEN_PERLIN = 2,
+ MAPGEN_DRAWN = 3,
+ MAPGEN_MAP = 4
};
class HWMap : public TCPBase
@@ -41,7 +42,7 @@
public:
HWMap(QObject *parent = 0);
virtual ~HWMap();
- void getImage(const QString & seed, int templateFilter, MapGenerator mapgen, int maze_size, const QByteArray & drawMapData);
+ void getImage(const QString & seed, int templateFilter, MapGenerator mapgen, int maze_size, const QByteArray & drawMapData, QString & script, QString & scriptparam, int feature_size);
bool couldBeRemoved();
protected:
@@ -50,14 +51,17 @@
virtual void SendToClientFirst();
signals:
- void ImageReceived(const QImage newImage);
+ void ImageReceived(const QPixmap & newImage);
void HHLimitReceived(int hhLimit);
private:
QString m_seed;
+ QString m_script;
+ QString m_scriptparam;
int templateFilter;
MapGenerator m_mapgen;
- int m_maze_size;
+ int m_maze_size; // going to try and deprecate this one
+ int m_feature_size;
QByteArray m_drawMapData;
private slots:
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/hwmapoptimizer.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/net/hwmapoptimizer.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -0,0 +1,54 @@
+#include "hwmapoptimizer.h"
+#include "hwconsts.h"
+
+HWMapOptimizer::HWMapOptimizer(QObject *parent) :
+ TCPBase(parent)
+{
+}
+
+bool HWMapOptimizer::couldBeRemoved()
+{
+ return !m_hasStarted;
+}
+
+void HWMapOptimizer::optimizeMap(const Paths &paths)
+{
+ m_paths = paths;
+
+ Start(true);
+}
+
+QStringList HWMapOptimizer::getArguments()
+{
+ QStringList arguments;
+ arguments << "--internal";
+ arguments << "--port";
+ arguments << QString("%1").arg(ipc_port);
+ arguments << "--user-prefix";
+ arguments << cfgdir->absolutePath();
+ arguments << "--prefix";
+ arguments << datadir->absolutePath();
+ arguments << "--landpreview";
+ return arguments;
+}
+
+void HWMapOptimizer::onClientDisconnect()
+{
+
+}
+
+void HWMapOptimizer::SendToClientFirst()
+{
+ SendIPC("e$mapgen 4");
+
+ /*QByteArray data = m_drawMapData;
+ while(data.size() > 0)
+ {
+ QByteArray tmp = data;
+ tmp.truncate(200);
+ SendIPC("edraw " + tmp);
+ data.remove(0, 200);
+ }
+
+ SendIPC("!");*/
+}
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/hwmapoptimizer.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/net/hwmapoptimizer.h Tue Nov 10 20:43:13 2015 +0100
@@ -0,0 +1,30 @@
+#ifndef HWMAPOPTIMIZER_H
+#define HWMAPOPTIMIZER_H
+
+#include "tcpBase.h"
+#include "drawmapscene.h"
+
+class HWMapOptimizer : public TCPBase
+{
+ Q_OBJECT
+public:
+ explicit HWMapOptimizer(QObject *parent = 0);
+
+ void optimizeMap(const Paths & paths);
+ bool couldBeRemoved();
+
+signals:
+ void optimizedMap(const Paths & paths);
+
+public slots:
+
+protected:
+ QStringList getArguments();
+ void onClientDisconnect();
+ void SendToClientFirst();
+
+private:
+ Paths m_paths;
+};
+
+#endif // HWMAPOPTIMIZER_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/netregister.cpp
--- a/QTfrontend/net/netregister.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/netregister.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "netregister.h"
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/netregister.h
--- a/QTfrontend/net/netregister.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/netregister.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _NET_REGISTER_INCLUDED
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/netserver.cpp
--- a/QTfrontend/net/netserver.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/netserver.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2008 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "hwconsts.h"
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/netserver.h
--- a/QTfrontend/net/netserver.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/netserver.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2008 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _NETSERVER_INCLUDED
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/netudpserver.cpp
--- a/QTfrontend/net/netudpserver.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/netudpserver.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2007-2008 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/netudpserver.h
--- a/QTfrontend/net/netudpserver.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/netudpserver.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2007-2008 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _NET_UDPSERVER_INCLUDED
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/netudpwidget.cpp
--- a/QTfrontend/net/netudpwidget.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/netudpwidget.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2007 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/netudpwidget.h
--- a/QTfrontend/net/netudpwidget.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/netudpwidget.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2007 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _NET_UDPWIDGET_INCLUDED
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/newnetclient.cpp
--- a/QTfrontend/net/newnetclient.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/newnetclient.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2008 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,13 +14,14 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
#include
#include
#include
+#include
#include "hwconsts.h"
#include "newnetclient.h"
@@ -31,14 +32,16 @@
#include "servermessages.h"
#include "HWApplication.h"
-char delimeter='\n';
+char delimiter='\n';
HWNewNet::HWNewNet() :
isChief(false),
m_game_connected(false),
- loginStep(0),
netClientState(Disconnected)
{
+ m_private_game = false;
+ m_nick_registered = false;
+
m_roomsListModel = new RoomsListModel(this);
m_playersModel = new PlayersListModel(this);
@@ -71,7 +74,7 @@
{
if (m_game_connected)
{
- RawSendNet(QString("QUIT%1%2").arg(delimeter).arg("User quit"));
+ RawSendNet(QString("QUIT%1%2").arg(delimiter).arg("User quit"));
emit disconnected(tr("User quit"));
}
NetSocket.flush();
@@ -88,7 +91,7 @@
void HWNewNet::Disconnect()
{
if (m_game_connected)
- RawSendNet(QString("QUIT%1%2").arg(delimeter).arg("User quit"));
+ RawSendNet(QString("QUIT%1%2").arg(delimiter).arg("User quit"));
m_game_connected = false;
NetSocket.disconnectFromHost();
@@ -105,9 +108,9 @@
myroom = room;
if(password.isEmpty())
- RawSendNet(QString("CREATE_ROOM%1%2").arg(delimeter).arg(room));
+ RawSendNet(QString("CREATE_ROOM%1%2").arg(delimiter).arg(room));
else
- RawSendNet(QString("CREATE_ROOM%1%2%1%3").arg(delimeter).arg(room).arg(password));
+ RawSendNet(QString("CREATE_ROOM%1%2%1%3").arg(delimiter).arg(room).arg(password));
isChief = true;
}
@@ -123,29 +126,29 @@
myroom = room;
if(password.isEmpty())
- RawSendNet(QString("JOIN_ROOM%1%2").arg(delimeter).arg(room));
+ RawSendNet(QString("JOIN_ROOM%1%2").arg(delimiter).arg(room));
else
- RawSendNet(QString("JOIN_ROOM%1%2%1%3").arg(delimeter).arg(room).arg(password));
+ RawSendNet(QString("JOIN_ROOM%1%2%1%3").arg(delimiter).arg(room).arg(password));
isChief = false;
}
void HWNewNet::AddTeam(const HWTeam & team)
{
- QString cmd = QString("ADD_TEAM") + delimeter +
- team.name() + delimeter +
- QString::number(team.color()) + delimeter +
- team.grave() + delimeter +
- team.fort() + delimeter +
- team.voicepack() + delimeter +
- team.flag() + delimeter +
+ QString cmd = QString("ADD_TEAM") + delimiter +
+ team.name() + delimiter +
+ QString::number(team.color()) + delimiter +
+ team.grave() + delimiter +
+ team.fort() + delimiter +
+ team.voicepack() + delimiter +
+ team.flag() + delimiter +
QString::number(team.difficulty());
for(int i = 0; i < HEDGEHOGS_PER_TEAM; ++i)
{
- cmd.append(delimeter);
+ cmd.append(delimiter);
cmd.append(team.hedgehog(i).Name);
- cmd.append(delimeter);
+ cmd.append(delimiter);
cmd.append(team.hedgehog(i).Hat);
}
RawSendNet(cmd);
@@ -153,12 +156,12 @@
void HWNewNet::RemoveTeam(const HWTeam & team)
{
- RawSendNet(QString("REMOVE_TEAM") + delimeter + team.name());
+ RawSendNet(QString("REMOVE_TEAM") + delimiter + team.name());
}
void HWNewNet::NewNick(const QString & nick)
{
- RawSendNet(QString("NICK%1%2").arg(delimeter).arg(nick));
+ RawSendNet(QString("NICK%1%2").arg(delimiter).arg(nick));
}
void HWNewNet::ToggleReady()
@@ -170,7 +173,7 @@
{
QString msg = QString(buf.toBase64());
- RawSendNet(QString("EM%1%2").arg(delimeter).arg(msg));
+ RawSendNet(QString("EM%1%2").arg(delimiter).arg(msg));
}
void HWNewNet::RawSendNet(const QString & str)
@@ -238,7 +241,10 @@
void HWNewNet::SendPasswordHash(const QString & hash)
{
- RawSendNet(QString("PASSWORD%1%2").arg(delimeter).arg(hash));
+ // don't send it immediately, only store and check if server asked us for a password
+ m_passwordHash = hash.toAscii();
+
+ maybeSendPassword();
}
void HWNewNet::ParseCmd(const QStringList & lst)
@@ -286,24 +292,46 @@
{
// TODO: Warn user, disconnect
qWarning() << "Server too old";
- RawSendNet(QString("QUIT%1%2").arg(delimeter).arg("Server too old"));
+ RawSendNet(QString("QUIT%1%2").arg(delimiter).arg("Server too old"));
Disconnect();
emit disconnected(tr("The server is too old. Disconnecting now."));
return;
}
- RawSendNet(QString("NICK%1%2").arg(delimeter).arg(mynick));
- RawSendNet(QString("PROTO%1%2").arg(delimeter).arg(*cProtoVer));
+ RawSendNet(QString("NICK%1%2").arg(delimiter).arg(mynick));
+ RawSendNet(QString("PROTO%1%2").arg(delimiter).arg(*cProtoVer));
netClientState = Connected;
m_game_connected = true;
emit adminAccess(false);
return;
}
+ if (lst[0] == "SERVER_AUTH")
+ {
+ if(lst.size() < 2)
+ {
+ qWarning("Net: Malformed SERVER_AUTH message");
+ return;
+ }
+
+ if(lst[1] != m_serverHash)
+ {
+ Error("Server authentication error");
+ Disconnect();
+ } else
+ {
+ // empty m_serverHash variable means no authentication was performed
+ // or server passed authentication
+ m_serverHash.clear();
+ }
+
+ return;
+ }
+
if (lst[0] == "PING")
{
if (lst.size() > 1)
- RawSendNet(QString("PONG%1%2").arg(delimeter).arg(lst[1]));
+ RawSendNet(QString("PONG%1%2").arg(delimiter).arg(lst[1]));
else
RawSendNet(QString("PONG"));
return;
@@ -450,7 +478,7 @@
// flag indicating if a player is contributor
case 'c':
foreach(const QString & nick, nicks)
- m_playersModel->setFlag(nick, PlayersListModel::InRoom, setFlag);
+ m_playersModel->setFlag(nick, PlayersListModel::Contributor, setFlag);
break;
// flag indicating if a player has engine running
case 'g':
@@ -515,6 +543,14 @@
{
if (lst[i] == mynick)
{
+ // check if server is authenticated or no authentication was performed at all
+ if(!m_serverHash.isEmpty())
+ {
+ Error(tr("Server authentication error"));
+
+ Disconnect();
+ }
+
netClientState = InLobby;
RawSendNet(QString("LIST"));
emit connected();
@@ -545,7 +581,7 @@
m_roomsListModel->updateRoom(roomName, tmp);
// keep track of room name so correct name is displayed
- if(myroom == roomName)
+ if(myroom == roomName && myroom != tmp[1])
{
myroom = tmp[1];
emit roomNameUpdated(myroom);
@@ -578,8 +614,24 @@
if (lst[0] == "ASKPASSWORD")
{
+ // server should send us salt of at least 16 characters
+
+ if(lst.size() < 2 || lst[1].size() < 16)
+ {
+ qWarning("Net: Bad ASKPASSWORD message");
+ return;
+ }
+
emit NickRegistered(mynick);
m_nick_registered = true;
+
+ // store server salt
+ // when this variable is set, it is assumed that server asked us for a password
+ m_serverSalt = lst[1];
+ m_clientSalt = QUuid::createUuid().toString();
+
+ maybeSendPassword();
+
return;
}
@@ -696,7 +748,8 @@
}
QStringList tmp = lst;
tmp.removeFirst();
- emit AddNetTeam(tmp);
+ HWTeam team(tmp);
+ emit AddNetTeam(team);
return;
}
@@ -820,7 +873,7 @@
{
if (isChief)
RawSendNet(QString("HH_NUM%1%2%1%3")
- .arg(delimeter)
+ .arg(delimiter)
.arg(team.name())
.arg(team.numHedgehogs()));
}
@@ -829,7 +882,7 @@
{
if (isChief)
RawSendNet(QString("TEAM_COLOR%1%2%1%3")
- .arg(delimeter)
+ .arg(delimiter)
.arg(team.name())
.arg(team.color()));
}
@@ -839,9 +892,9 @@
if (isChief)
RawSendNet(
QString("CFG%1%2%1%3")
- .arg(delimeter)
+ .arg(delimiter)
.arg(param)
- .arg(value.join(QString(delimeter)))
+ .arg(value.join(QString(delimiter)))
);
}
@@ -858,7 +911,7 @@
{
if(str != "")
{
- RawSendNet(QString("CHAT") + delimeter + str);
+ RawSendNet(QString("CHAT") + delimiter + str);
QString action = HWProto::chatStringToAction(str);
if (action != NULL)
emit(roomChatAction(mynick, action));
@@ -871,7 +924,7 @@
{
if(str != "")
{
- RawSendNet(QString("CHAT") + delimeter + str);
+ RawSendNet(QString("CHAT") + delimiter + str);
QString action = HWProto::chatStringToAction(str);
if (action != NULL)
emit(lobbyChatAction(mynick, action));
@@ -882,7 +935,7 @@
void HWNewNet::SendTeamMessage(const QString& str)
{
- RawSendNet(QString("TEAMCHAT") + delimeter + str);
+ RawSendNet(QString("TEAMCHAT") + delimiter + str);
}
void HWNewNet::askRoomsList()
@@ -925,23 +978,23 @@
if (netClientState == InGame)
{
netClientState = InRoom;
- RawSendNet(QString("ROUNDFINISHED%1%2").arg(delimeter).arg(correctly ? "1" : "0"));
+ RawSendNet(QString("ROUNDFINISHED%1%2").arg(delimiter).arg(correctly ? "1" : "0"));
}
}
void HWNewNet::banPlayer(const QString & nick)
{
- RawSendNet(QString("BAN%1%2").arg(delimeter).arg(nick));
+ RawSendNet(QString("BAN%1%2").arg(delimiter).arg(nick));
}
void HWNewNet::banIP(const QString & ip, const QString & reason, int seconds)
{
- RawSendNet(QString("BANIP%1%2%1%3%1%4").arg(delimeter).arg(ip).arg(reason).arg(seconds));
+ RawSendNet(QString("BANIP%1%2%1%3%1%4").arg(delimiter).arg(ip).arg(reason).arg(seconds));
}
void HWNewNet::banNick(const QString & nick, const QString & reason, int seconds)
{
- RawSendNet(QString("BANNICK%1%2%1%3%1%4").arg(delimeter).arg(nick).arg(reason).arg(seconds));
+ RawSendNet(QString("BANNICK%1%2%1%3%1%4").arg(delimiter).arg(nick).arg(reason).arg(seconds));
}
void HWNewNet::getBanList()
@@ -951,31 +1004,31 @@
void HWNewNet::removeBan(const QString & b)
{
- RawSendNet(QString("UNBAN%1%2").arg(delimeter).arg(b));
+ RawSendNet(QString("UNBAN%1%2").arg(delimiter).arg(b));
}
void HWNewNet::kickPlayer(const QString & nick)
{
- RawSendNet(QString("KICK%1%2").arg(delimeter).arg(nick));
+ RawSendNet(QString("KICK%1%2").arg(delimiter).arg(nick));
}
void HWNewNet::infoPlayer(const QString & nick)
{
- RawSendNet(QString("INFO%1%2").arg(delimeter).arg(nick));
+ RawSendNet(QString("INFO%1%2").arg(delimiter).arg(nick));
}
void HWNewNet::followPlayer(const QString & nick)
{
if (!isInRoom())
{
- RawSendNet(QString("FOLLOW%1%2").arg(delimeter).arg(nick));
+ RawSendNet(QString("FOLLOW%1%2").arg(delimiter).arg(nick));
isChief = false;
}
}
void HWNewNet::consoleCommand(const QString & cmd)
{
- RawSendNet(QString("CMD%1%2").arg(delimeter).arg(cmd));
+ RawSendNet(QString("CMD%1%2").arg(delimiter).arg(cmd));
}
bool HWNewNet::allPlayersReady()
@@ -994,7 +1047,7 @@
void HWNewNet::updateRoomName(const QString & name)
{
- RawSendNet(QString("ROOM_NAME%1%2").arg(delimeter).arg(name));
+ RawSendNet(QString("ROOM_NAME%1%2").arg(delimiter).arg(name));
}
@@ -1032,17 +1085,17 @@
void HWNewNet::setServerMessageNew(const QString & msg)
{
- RawSendNet(QString("SET_SERVER_VAR%1MOTD_NEW%1%2").arg(delimeter).arg(msg));
+ RawSendNet(QString("SET_SERVER_VAR%1MOTD_NEW%1%2").arg(delimiter).arg(msg));
}
void HWNewNet::setServerMessageOld(const QString & msg)
{
- RawSendNet(QString("SET_SERVER_VAR%1MOTD_OLD%1%2").arg(delimeter).arg(msg));
+ RawSendNet(QString("SET_SERVER_VAR%1MOTD_OLD%1%2").arg(delimiter).arg(msg));
}
void HWNewNet::setLatestProtocolVar(int proto)
{
- RawSendNet(QString("SET_SERVER_VAR%1LATEST_PROTO%1%2").arg(delimeter).arg(proto));
+ RawSendNet(QString("SET_SERVER_VAR%1LATEST_PROTO%1%2").arg(delimiter).arg(proto));
}
void HWNewNet::askServerVars()
@@ -1083,3 +1136,34 @@
if(!myroom.isEmpty())
JoinRoom(myroom, password);
}
+
+void HWNewNet::maybeSendPassword()
+{
+/* When we got password hash, and server asked us for a password, perform mutual authentication:
+ * at this point we have salt chosen by server
+ * client sends client salt and hash of secret (password hash) salted with client salt, server salt,
+ * and static salt (predefined string + protocol number)
+ * server should respond with hash of the same set in different order.
+ */
+
+ if(m_passwordHash.isEmpty() || m_serverSalt.isEmpty())
+ return;
+
+ QString hash = QCryptographicHash::hash(
+ m_clientSalt.toAscii()
+ .append(m_serverSalt.toAscii())
+ .append(m_passwordHash)
+ .append(cProtoVer->toAscii())
+ .append("!hedgewars")
+ , QCryptographicHash::Sha1).toHex();
+
+ m_serverHash = QCryptographicHash::hash(
+ m_serverSalt.toAscii()
+ .append(m_clientSalt.toAscii())
+ .append(m_passwordHash)
+ .append(cProtoVer->toAscii())
+ .append("!hedgewars")
+ , QCryptographicHash::Sha1).toHex();
+
+ RawSendNet(QString("PASSWORD%1%2%1%3").arg(delimiter).arg(hash).arg(m_clientSalt));
+}
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/newnetclient.h
--- a/QTfrontend/net/newnetclient.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/newnetclient.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2008 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _NEW_NETCLIENT_INCLUDED
@@ -36,7 +36,7 @@
class QSortFilterProxyModel;
class QAbstractItemModel;
-extern char delimeter;
+extern char delimiter;
class HWNewNet : public QObject
{
@@ -77,6 +77,10 @@
QSortFilterProxyModel * m_lobbyPlayersModel;
QSortFilterProxyModel * m_roomPlayersModel;
QString m_lastRoom;
+ QString m_passwordHash;
+ QString m_serverSalt;
+ QString m_clientSalt;
+ QString m_serverHash;
QStringList cmdbuf;
@@ -85,7 +89,8 @@
void ParseCmd(const QStringList & lst);
void handleNotice(int n);
- int loginStep;
+ void maybeSendPassword();
+
ClientState netClientState;
signals:
@@ -106,7 +111,7 @@
void roomNameUpdated(const QString & name);
void askForRoomPassword();
- void netSchemeConfig(QStringList &);
+ void netSchemeConfig(QStringList);
void paramChanged(const QString & param, const QStringList & value);
void configAsked();
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/proto.cpp
--- a/QTfrontend/net/proto.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/proto.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "proto.h"
@@ -58,5 +58,5 @@
if(string.left(4) == "/me ")
return string.mid(4);
else
- return NULL;
+ return QString();
}
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/proto.h
--- a/QTfrontend/net/proto.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/proto.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _PROTO_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/recorder.cpp
--- a/QTfrontend/net/recorder.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/recorder.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -37,6 +37,7 @@
{
this->config = config;
this->prefix = prefix;
+ item = 0;
finished = false;
name = prefix + "." + LibavInteraction::instance().getExtension(config->AVFormat());
}
@@ -143,3 +144,8 @@
return arguments;
}
+
+bool HWRecorder::simultaneousRun()
+{
+ return true;
+}
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/recorder.h
--- a/QTfrontend/net/recorder.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/recorder.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef RECORDER_H
@@ -35,6 +35,7 @@
virtual ~HWRecorder();
void EncodeVideo(const QByteArray & record);
+ bool simultaneousRun();
VideoItem * item; // used by pagevideos
QString name;
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/tcpBase.cpp
--- a/QTfrontend/net/tcpBase.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/tcpBase.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,51 +14,62 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "tcpBase.h"
-
#include
#include
#include
+#include
+#include "tcpBase.h"
#include "hwconsts.h"
#include "MessageDialog.h"
#ifdef HWLIBRARY
-extern "C" void Game(char**arguments);
-extern "C" void GenLandPreview(int port);
+extern "C" {
+ void RunEngine(int argc, char ** argv);
+
+ int operatingsystem_parameter_argc;
+ char ** operatingsystem_parameter_argv;
+}
EngineInstance::EngineInstance(QObject *parent)
: QObject(parent)
{
- port = 0;
+
}
EngineInstance::~EngineInstance()
{
+ qDebug() << "EngineInstance delete" << QThread::currentThreadId();
+}
+
+void EngineInstance::setArguments(const QStringList & arguments)
+{
+ m_arguments.clear();
+ m_arguments << qApp->arguments().at(0).toUtf8();
+
+ m_argv.resize(arguments.size() + 1);
+ m_argv[0] = m_arguments.last().data();
+
+ int i = 1;
+ foreach(const QString & s, arguments)
+ {
+ m_arguments << s.toUtf8();
+ m_argv[i] = m_arguments.last().data();
+ ++i;
+ }
}
void EngineInstance::start()
{
-#if 0
- char *args[11];
- args[0] = "65000"; //ipcPort
- args[1] = "1024"; //cScreenWidth
- args[2] = "768"; //cScreenHeight
- args[3] = "0"; //cReducedQuality
- args[4] = "en.txt"; //cLocaleFName
- args[5] = "koda"; //UserNick
- args[6] = "1"; //SetSound
- args[7] = "1"; //SetMusic
- args[8] = "0"; //cAltDamage
- args[9]= datadir->absolutePath().toAscii().data(); //cPathPrefix
- args[10]= NULL; //recordFileName
- Game(args);
-#endif
- GenLandPreview(port);
+ qDebug() << "EngineInstance start" << QThread::currentThreadId();
+
+ RunEngine(m_argv.size(), m_argv.data());
+
+ emit finished();
}
#endif
@@ -68,6 +79,23 @@
TCPBase::~TCPBase()
{
+ if(m_hasStarted)
+ {
+ if(IPCSocket)
+ IPCSocket->close();
+
+ if(m_connected)
+ {
+#ifdef HWLIBRARY
+ if(!thread)
+ qDebug("WTF");
+ thread->quit();
+ thread->wait();
+#else
+ process->waitForFinished(1000);
+#endif
+ }
+ }
// make sure this object is not in the server list anymore
srvsList.removeOne(this);
@@ -80,8 +108,11 @@
QObject(parent),
m_hasStarted(false),
m_isDemoMode(demoMode),
+ m_connected(false),
IPCSocket(0)
{
+ process = 0;
+
if(!IPCServer)
{
IPCServer = new QTcpServer(0);
@@ -103,12 +134,23 @@
// connection should be already finished
return;
}
+
disconnect(IPCServer, SIGNAL(newConnection()), this, SLOT(NewConnection()));
IPCSocket = IPCServer->nextPendingConnection();
+
if(!IPCSocket) return;
+
+ m_connected = true;
+
connect(IPCSocket, SIGNAL(disconnected()), this, SLOT(ClientDisconnect()));
connect(IPCSocket, SIGNAL(readyRead()), this, SLOT(ClientRead()));
SendToClientFirst();
+
+ if(simultaneousRun())
+ {
+ srvsList.removeOne(this);
+ emit isReadyNow();
+ }
}
void TCPBase::RealStart()
@@ -117,9 +159,9 @@
IPCSocket = 0;
#ifdef HWLIBRARY
- QThread *thread = new QThread;
- EngineInstance *instance = new EngineInstance;
- instance->port = IPCServer->serverPort();
+ thread = new QThread(this);
+ EngineInstance *instance = new EngineInstance();
+ instance->setArguments(getArguments());
instance->moveToThread(thread);
@@ -129,10 +171,12 @@
connect(instance, SIGNAL(finished()), thread, SLOT(deleteLater()));
thread->start();
#else
- QProcess * process;
- process = new QProcess();
- connect(process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(StartProcessError(QProcess::ProcessError)));
- QStringList arguments=getArguments();
+ process = new QProcess(this);
+ connect(process, SIGNAL(error(QProcess::ProcessError)),
+ this, SLOT(StartProcessError(QProcess::ProcessError)));
+ connect(process, SIGNAL(finished(int, QProcess::ExitStatus)),
+ this, SLOT(onEngineDeath(int, QProcess::ExitStatus)));
+ QStringList arguments = getArguments();
#ifdef QT_DEBUG
// redirect everything written on stdout/stderr
@@ -149,17 +193,26 @@
disconnect(IPCSocket, SIGNAL(readyRead()), this, SLOT(ClientRead()));
onClientDisconnect();
- emit isReadyNow();
+ if(!simultaneousRun())
+ {
+#ifdef HWLIBRARY
+ thread->quit();
+ thread->wait();
+#endif
+ emit isReadyNow();
+ }
+
IPCSocket->deleteLater();
+ IPCSocket = NULL;
deleteLater();
}
void TCPBase::ClientRead()
{
- QByteArray readed=IPCSocket->readAll();
- if(readed.isEmpty()) return;
- readbuffer.append(readed);
+ QByteArray read = IPCSocket->readAll();
+ if(read.isEmpty()) return;
+ readbuffer.append(read);
onClientRead();
}
@@ -169,6 +222,38 @@
ClientDisconnect();
}
+void TCPBase::onEngineDeath(int exitCode, QProcess::ExitStatus exitStatus)
+{
+ Q_UNUSED(exitStatus);
+
+ ClientDisconnect();
+
+ // show error message if there was an error that was not an engine's
+ // fatal error - because that one already sent a info via IPC
+ if ((exitCode != 0) && (exitCode != 2))
+ {
+ // inform user that something bad happened
+ MessageDialog::ShowFatalMessage(
+ tr("The game engine died unexpectedly!\n"
+ "(exit code %1)\n\n"
+ "We are very sorry for the inconvenience :(\n\n"
+ "If this keeps happening, please click the '%2' button in the main menu!")
+ .arg(exitCode)
+ .arg("Feedback"));
+
+ }
+
+ // cleanup up
+ if (IPCSocket)
+ {
+ IPCSocket->close();
+ IPCSocket->deleteLater();
+ }
+
+ // plot suicide
+ deleteLater();
+}
+
void TCPBase::tcpServerReady()
{
disconnect(srvsList.first(), SIGNAL(isReadyNow()), this, SLOT(tcpServerReady()));
@@ -188,14 +273,15 @@
TCPBase * last = srvsList.last();
if(couldCancelPreviousRequest
&& last->couldBeRemoved()
+ && (last->isConnected() || !last->hasStarted())
&& (last->parent() == parent()))
{
srvsList.removeLast();
- last->deleteLater();
+ delete last;
Start(couldCancelPreviousRequest);
} else
{
- connect(srvsList.last(), SIGNAL(isReadyNow()), this, SLOT(tcpServerReady()));
+ connect(last, SIGNAL(isReadyNow()), this, SLOT(tcpServerReady()));
srvsList.push_back(this);
}
}
@@ -246,3 +332,18 @@
{
return false;
}
+
+bool TCPBase::isConnected()
+{
+ return m_connected;
+}
+
+bool TCPBase::simultaneousRun()
+{
+ return false;
+}
+
+bool TCPBase::hasStarted()
+{
+ return m_hasStarted;
+}
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/net/tcpBase.h
--- a/QTfrontend/net/tcpBase.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/net/tcpBase.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _TCPBASE_INCLUDED
@@ -27,7 +27,10 @@
#include
#include
#include
+#include
#include
+#include
+#include
#include
@@ -42,6 +45,9 @@
virtual ~TCPBase();
virtual bool couldBeRemoved();
+ virtual bool simultaneousRun();
+ bool isConnected();
+ bool hasStarted();
signals:
void isReadyNow();
@@ -67,8 +73,13 @@
private:
static QPointer IPCServer;
-
+#ifdef HWLIBRARY
+ QThread * thread;
+#else
+ QProcess * process;
+#endif
bool m_isDemoMode;
+ bool m_connected;
void RealStart();
QPointer IPCSocket;
@@ -77,6 +88,7 @@
void ClientDisconnect();
void ClientRead();
void StartProcessError(QProcess::ProcessError error);
+ void onEngineDeath(int exitCode, QProcess::ExitStatus exitStatus);
void tcpServerReady();
};
@@ -89,12 +101,17 @@
EngineInstance(QObject *parent = 0);
~EngineInstance();
- int port;
+ void setArguments(const QStringList & arguments);
+
public slots:
- void start(void);
+ void start();
+
signals:
- void finished(void);
+ void finished();
+
private:
+ QList m_arguments;
+ QVector m_argv;
};
#endif
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/Background.png
Binary file QTfrontend/res/Background.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/BackgroundChristmas.png
Binary file QTfrontend/res/BackgroundChristmas.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/BackgroundEaster.png
Binary file QTfrontend/res/BackgroundEaster.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/Confetti.png
Binary file QTfrontend/res/Confetti.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/Egg.png
Binary file QTfrontend/res/Egg.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/Exit.png
Binary file QTfrontend/res/Exit.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/Flake.png
Binary file QTfrontend/res/Flake.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/LocalPlay.png
Binary file QTfrontend/res/LocalPlay.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/NetworkPlayDisabled.png
Binary file QTfrontend/res/NetworkPlayDisabled.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/PlaySound.png
Binary file QTfrontend/res/PlaySound.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/Save.png
Binary file QTfrontend/res/Save.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/Settings.png
Binary file QTfrontend/res/Settings.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/Star.png
Binary file QTfrontend/res/Star.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/Start.png
Binary file QTfrontend/res/Start.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsBestKiller.png
Binary file QTfrontend/res/StatsBestKiller.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsBestShot.png
Binary file QTfrontend/res/StatsBestShot.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsCustomAchievement.png
Binary file QTfrontend/res/StatsCustomAchievement.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsD.png
Binary file QTfrontend/res/StatsD.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsH.png
Binary file QTfrontend/res/StatsH.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsHedgehogsKilled.png
Binary file QTfrontend/res/StatsHedgehogsKilled.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsMedal1.png
Binary file QTfrontend/res/StatsMedal1.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsMedal2.png
Binary file QTfrontend/res/StatsMedal2.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsMedal3.png
Binary file QTfrontend/res/StatsMedal3.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsMedal4.png
Binary file QTfrontend/res/StatsMedal4.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsMostSelfDamage.png
Binary file QTfrontend/res/StatsMostSelfDamage.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsR.png
Binary file QTfrontend/res/StatsR.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsSelfKilled.png
Binary file QTfrontend/res/StatsSelfKilled.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/StatsSkipped.png
Binary file QTfrontend/res/StatsSkipped.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/Trainings.png
Binary file QTfrontend/res/Trainings.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/addfriend.png
Binary file QTfrontend/res/addfriend.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/ammopic.png
Binary file QTfrontend/res/ammopic.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/botlevels/net0.png
Binary file QTfrontend/res/botlevels/net0.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/botlevels/net1.png
Binary file QTfrontend/res/botlevels/net1.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/botlevels/net2.png
Binary file QTfrontend/res/botlevels/net2.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/botlevels/net3.png
Binary file QTfrontend/res/botlevels/net3.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/botlevels/net4.png
Binary file QTfrontend/res/botlevels/net4.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/botlevels/net5.png
Binary file QTfrontend/res/botlevels/net5.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnArtillery.png
Binary file QTfrontend/res/btnArtillery.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnBorder.png
Binary file QTfrontend/res/btnBorder.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnDisableLandObjects.png
Binary file QTfrontend/res/btnDisableLandObjects.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnForts.png
Binary file QTfrontend/res/btnForts.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnInvulnerable.png
Binary file QTfrontend/res/btnInvulnerable.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnKarma.png
Binary file QTfrontend/res/btnKarma.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnKing.png
Binary file QTfrontend/res/btnKing.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnLaserSight.png
Binary file QTfrontend/res/btnLaserSight.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnLowGravity.png
Binary file QTfrontend/res/btnLowGravity.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnMoreWind.png
Binary file QTfrontend/res/btnMoreWind.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnNoWind.png
Binary file QTfrontend/res/btnNoWind.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnOverlay.png
Binary file QTfrontend/res/btnOverlay.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnPlaceHog.png
Binary file QTfrontend/res/btnPlaceHog.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnRandomOrder.png
Binary file QTfrontend/res/btnRandomOrder.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnResetWeps.png
Binary file QTfrontend/res/btnResetWeps.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnSharedAmmo.png
Binary file QTfrontend/res/btnSharedAmmo.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnTeamsDivide.png
Binary file QTfrontend/res/btnTeamsDivide.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/btnVampiric.png
Binary file QTfrontend/res/btnVampiric.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/camera.png
Binary file QTfrontend/res/camera.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Classic_Fairytale/backstab.png
Binary file QTfrontend/res/campaign/A_Classic_Fairytale/backstab.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Classic_Fairytale/dragon.png
Binary file QTfrontend/res/campaign/A_Classic_Fairytale/dragon.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Classic_Fairytale/epil.png
Binary file QTfrontend/res/campaign/A_Classic_Fairytale/epil.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Classic_Fairytale/family.png
Binary file QTfrontend/res/campaign/A_Classic_Fairytale/family.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Classic_Fairytale/journey.png
Binary file QTfrontend/res/campaign/A_Classic_Fairytale/journey.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Classic_Fairytale/queen.png
Binary file QTfrontend/res/campaign/A_Classic_Fairytale/queen.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Classic_Fairytale/shadow.png
Binary file QTfrontend/res/campaign/A_Classic_Fairytale/shadow.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Classic_Fairytale/united.png
Binary file QTfrontend/res/campaign/A_Classic_Fairytale/united.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Space_Adventure/cosmos.png
Binary file QTfrontend/res/campaign/A_Space_Adventure/cosmos.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Space_Adventure/death01.png
Binary file QTfrontend/res/campaign/A_Space_Adventure/death01.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Space_Adventure/death02.png
Binary file QTfrontend/res/campaign/A_Space_Adventure/death02.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Space_Adventure/desert02.png
Binary file QTfrontend/res/campaign/A_Space_Adventure/desert02.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Space_Adventure/desert03.png
Binary file QTfrontend/res/campaign/A_Space_Adventure/desert03.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Space_Adventure/ice01.png
Binary file QTfrontend/res/campaign/A_Space_Adventure/ice01.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/campaign/A_Space_Adventure/moon01.png
Binary file QTfrontend/res/campaign/A_Space_Adventure/moon01.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/friend.png
Binary file QTfrontend/res/chat/friend.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/hedgehog.png
Binary file QTfrontend/res/chat/hedgehog.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/hedgehog_gray.png
Binary file QTfrontend/res/chat/hedgehog_gray.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/hedgehogcontributor.png
Binary file QTfrontend/res/chat/hedgehogcontributor.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/hedgehogcontributor_gray.png
Binary file QTfrontend/res/chat/hedgehogcontributor_gray.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/ignore.png
Binary file QTfrontend/res/chat/ignore.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/ingame.png
Binary file QTfrontend/res/chat/ingame.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/lamp.png
Binary file QTfrontend/res/chat/lamp.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/lamp_off.png
Binary file QTfrontend/res/chat/lamp_off.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/roomadmin.png
Binary file QTfrontend/res/chat/roomadmin.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/roomadmin_gray.png
Binary file QTfrontend/res/chat/roomadmin_gray.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/roomadmincontributor.png
Binary file QTfrontend/res/chat/roomadmincontributor.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/roomadmincontributor_gray.png
Binary file QTfrontend/res/chat/roomadmincontributor_gray.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/serveradmin.png
Binary file QTfrontend/res/chat/serveradmin.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/chat/serveradmin_gray.png
Binary file QTfrontend/res/chat/serveradmin_gray.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/checked.png
Binary file QTfrontend/res/checked.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/css/chat.css
--- a/QTfrontend/res/css/chat.css Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/res/css/chat.css Tue Nov 10 20:43:13 2015 +0100
@@ -9,7 +9,7 @@
*
* In the QTfrontend of hedgewars also display:none; will work for class names
* that start with msg_ and .timestamp - as long as they are referenced
- * directly and not within any class hierachy.
+ * directly and not within any class hierarchy.
* Note: Will only effect new lines!
*
******************************************************************************
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/css/qt.css
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/delete.png
Binary file QTfrontend/res/delete.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/dropdown.png
Binary file QTfrontend/res/dropdown.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/edit.png
Binary file QTfrontend/res/edit.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/file_demo.png
Binary file QTfrontend/res/file_demo.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/file_save.png
Binary file QTfrontend/res/file_save.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/follow.png
Binary file QTfrontend/res/follow.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/hh25x25.png
Binary file QTfrontend/res/hh25x25.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/hh25x25grey.png
Binary file QTfrontend/res/hh25x25grey.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/hh_small.png
Binary file QTfrontend/res/hh_small.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/html/about.html
--- a/QTfrontend/res/html/about.html Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/res/html/about.html Tue Nov 10 20:43:13 2015 +0100
@@ -35,6 +35,7 @@
Keybinds, feedback, maps and hats interfaces: Drew Gottlieb <gottlieb.drew@gmail.com>
Login dialogs, frontend improvements: Ondrej Skopek <skopekondrej@gmail.com>
Icegun weapon: Julia Struchenko <urbertar@gmail.com>
+ iPhone/iPad ports: Anton Malmygin <antonc27@mail.ru>
Art:
@@ -72,17 +73,17 @@
Czech: Petr Řezáček <rezacek@gmail.com>
Chinese: Jie Luo <lililjlj@gmail.com>
English: Andrey Korotaev <unC0Rr@gmail.com>
- Finnish: Nina Kuisma <ninnnu@gmail.com>
+ Finnish: Nina Kuisma <ninnnu@gmail.com>, Janne Uusitupa
French: Antoine Turmel <geekshadow@gmail.com>, Clement Woitrain <sphrixclement@gmail.com>, Matisumi
- German: Peter Hüwe <PeterHuewe@gmx.de>, Mario Liebisch <mario.liebisch@gmail.com>, Richard Karolyi <sheepluva@ercatec.net>
+ German: Peter Hüwe <PeterHuewe@gmx.de>, Mario Liebisch <mario.liebisch@gmail.com>, Richard Karolyi <sheepluva@ercatec.net>, Wuzzy <almikes@aol.com>
Greek: <talos_kriti@yahoo.gr>
- Italian: Luca Bonora <bonora.luca@gmail.com>, Marco Bresciani <m.bresciani@email.it>
+ Italian: Luca Bonora <bonora.luca@gmail.com>, Marco Bresciani <m.bresciani@email.it>, Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
Japanese: ADAM Etienne <etienne.adam@gmail.com>, Marco Bresciani <m.bresciani@email.it>
Korean: Anthony Bellew <anthonyreflected@gmail.com>
Lithuanian: Lukas Urbonas <lukasu08@gmail.com>
Polish: Maciej Mroziński <mynick2@o2.pl>, Wojciech Latkowski <magik17l@gmail.com>, Piotr Mitana, Maciej Górny
Portuguese: Fábio Canário <inufabie@gmail.com>
- Russian: Andrey Korotaev <unC0Rr@gmail.com>, Vitaly Novichkov <admin@wohlnet.ru>
+ Russian: Andrey Korotaev <unC0Rr@gmail.com>, Vitaly Novichkov <admin@wohlnet.ru>, Anton Malmygin <antonc27@mail.ru>
Slovak: Jose Riha
Spanish: Carlos Vives <mail@carlosvives.es>
Swedish: Niklas Grahn <raewolusjoon@yaoo.com>, Henrik Rostedt <henrik.rostedt@gmail.com>
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconBox.png
Binary file QTfrontend/res/iconBox.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconDamage.png
Binary file QTfrontend/res/iconDamage.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconDamageLockG.png
Binary file QTfrontend/res/iconDamageLockG.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconDamageLockR.png
Binary file QTfrontend/res/iconDamageLockR.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconDud.png
Binary file QTfrontend/res/iconDud.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconEarth.png
Binary file QTfrontend/res/iconEarth.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconHealth.png
Binary file QTfrontend/res/iconHealth.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconMine.png
Binary file QTfrontend/res/iconMine.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconRope.png
Binary file QTfrontend/res/iconRope.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconSuddenDeath.png
Binary file QTfrontend/res/iconSuddenDeath.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconTime.png
Binary file QTfrontend/res/iconTime.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconTimeLockG.png
Binary file QTfrontend/res/iconTimeLockG.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/iconTimeLockR.png
Binary file QTfrontend/res/iconTimeLockR.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/ignore.png
Binary file QTfrontend/res/ignore.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/infinity.png
Binary file QTfrontend/res/infinity.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/info.png
Binary file QTfrontend/res/info.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/inverse-corner-bl.png
Binary file QTfrontend/res/inverse-corner-bl.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/kick.png
Binary file QTfrontend/res/kick.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/lightbulb_off.png
Binary file QTfrontend/res/lightbulb_off.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/lightbulb_on.png
Binary file QTfrontend/res/lightbulb_on.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/lock.png
Binary file QTfrontend/res/lock.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/locks.svg
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/res/locks.svg Tue Nov 10 20:43:13 2015 +0100
@@ -0,0 +1,147 @@
+
+
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/mapCustom.png
Binary file QTfrontend/res/mapCustom.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/mapMaze.png
Binary file QTfrontend/res/mapMaze.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/mapMissing.png
Binary file QTfrontend/res/mapMissing.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/mapMission.png
Binary file QTfrontend/res/mapMission.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/mapRandom.png
Binary file QTfrontend/res/mapRandom.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/miscicon.png
Binary file QTfrontend/res/miscicon.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/net.png
Binary file QTfrontend/res/net.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/new.png
Binary file QTfrontend/res/new.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/remfriend.png
Binary file QTfrontend/res/remfriend.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/spin_down.png
Binary file QTfrontend/res/spin_down.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/spin_up.png
Binary file QTfrontend/res/spin_up.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/splash.png
Binary file QTfrontend/res/splash.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/unchecked.png
Binary file QTfrontend/res/unchecked.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/unignore.png
Binary file QTfrontend/res/unignore.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/unlock.png
Binary file QTfrontend/res/unlock.png has changed
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/res/xml/tips.xml
--- a/QTfrontend/res/xml/tips.xml Tue Nov 10 18:16:35 2015 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-# This is not xml actually, but it looks and behaves like it.
-# Including an xml library would need too much resources.
-# Tips between the platform specific tags are shown only on those platforms.
-# Do not escape characters or use the CDATA tag.
-
- Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.
- Some weapons might do only low damage but they can be a lot more devastating in the right situation. Try to use the Desert Eagle to knock multiple hedgehogs into the water.
- If you're unsure what to do and don't want to waste ammo, skip one round. But don't let too much time pass as there will be Sudden Death!
- Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground or miss a shot you'll reuse your rope without wasting ammo!
- If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.
- You're bored of default gameplay? Try one of the missions - they'll offer different gameplay depending on the one you picked.
- By default the game will always record the last game played as a demo. Select 'Local Game' and pick the 'Demos' button on the lower right corner to play or manage them.
- Hedgewars is free software (Open Source) we create in our spare time. If you've got problems, ask on our forums or visit our IRC room!
- Hedgewars is free software (Open Source) we create in our spare time. If you like it, help us with a small donation or contribute your own work!
- Hedgewars is free software (Open Source) we create in our spare time. Share it with your family and friends as you like!
- Hedgewars is free software (Open Source) we create in our spare time, just for fun! Meet the devs in #hedgewars!
- From time to time there will be official tournaments. Upcoming events will be announced at http://www.hedgewars.org/ some days in advance.
- Hedgewars is available in many languages. If the translation in your language seems to be missing or outdated, feel free to contact us!
- Hedgewars can be run on lots of different operating systems including Microsoft Windows, Mac OS X and GNU/Linux.
- Always remember you're able to set up your own games in local and network/online play. You're not restricted to the 'Simple Game' option.
- Connect one or more gamepads before starting the game to be able to assign their controls to your teams.
- Create an account on http://www.hedgewars.org/ to keep others from using your most favourite nickname while playing on the official server.
- While playing you should give yourself a short break at least once an hour.
- If your graphics card isn't able to provide hardware accelerated OpenGL, try to enable the low quality mode to improve performance.
- If your graphics card isn't able to provide hardware accelerated OpenGL, try to update the associated drivers.
- We're open to suggestions and constructive feedback. If you don't like something or got a great idea, let us know!
- Especially while playing online be polite and always remember there might be some minors playing with or against you as well!
- Special game modes such as 'Vampirism' or 'Karma' allow you to develop completely new tactics. Try them in a custom game!
- You should never install Hedgewars on computers you don't own (school, university, work, etc.). Please ask the responsible person instead!
- Hedgewars can be perfect for short games during breaks. Just ensure you don't add too many hedgehogs or use an huge map. Reducing time and health might help as well.
- No hedgehogs were harmed in making this game.
- There are three different jumps available. Tap [high jump] twice to do a very high/backwards jump.
- Afraid of falling off a cliff? Hold down [precise] to turn [left] or [right] without actually moving.
- Some weapons require special strategies or just lots of training, so don't give up on a particular tool if you miss an enemy once.
- Most weapons won't work once they touch the water. The Homing Bee as well as the Cake are exceptions to this.
- The Old Limbuger only causes a small explosion. However the wind affected smelly cloud can poison lots of hogs at once.
- The Piano Strike is the most damaging air strike. You'll lose the hedgehog performing it, so there's a huge downside as well.
- The Homing Bee can be tricky to use. Its turn radius depends on its velocity, so try to not use full power.
- Sticky Mines are a perfect tool to create small chain reactions knocking enemy hedgehogs into dire situations ... or water.
- The Hammer is most effective when used on bridges or girders. Hit hogs will just break through the ground.
- If you're stuck behind an enemy hedgehog, use the Hammer to free yourself without getting damaged by an explosion.
- The Cake's maximum walking distance depends on the ground it has to pass. Use [attack] to detonate it early.
- The Flame Thrower is a weapon but it can be used for tunnel digging as well.
- Use the Molotov or Flame Thrower to temporary keep hedgehogs from passing terrain such as tunnels or platforms.
- Want to know who's behind the game? Click on the Hedgewars logo in the main menu to see the credits.
- Like Hedgewars? Become a fan on Facebook or follow us on Twitter
- Feel free to draw your own graves, hats, flags or even maps and themes! But note that you'll have to share them somewhere to use them online.
- Keep your video card drivers up to date to avoid issues playing the game.
- Heads or tails? Type '/rnd' in lobby and you'll find out. Also '/rnd rock paper scissors' works!
- You're able to associate Hedgewars related files (savegames and demo recordings) with the game to launch them right from your favorite file or internet browser.
-
- The version of Hedgewars supports Xfire. Make sure to add Hedgewars to its game list so your friends can see you playing.
- You can find your Hedgewars configuration files under "My Documents\Hedgewars". Create backups or take the files with you, but don't edit them by hand.
-
-
- You can find your Hedgewars configuration files under "Library/Application Support/Hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.
-
-
- lintip
- You can find your Hedgewars configuration files under ".hedgewars" in your home directory. Create backups or take the files with you, but don't edit them by hand.
-
-
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/sdlkeys.h
--- a/QTfrontend/sdlkeys.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/sdlkeys.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
char sdlkeys[1024][2][128] =
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/team.cpp
--- a/QTfrontend/team.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/team.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -291,6 +291,12 @@
return sl;
}
+
+void HWTeam::setNetTeam(bool isNetTeam)
+{
+ m_isNetTeam = isNetTeam;
+}
+
bool HWTeam::isNetTeam() const
{
return m_isNetTeam;
@@ -444,3 +450,4 @@
{
m_wins++;
}
+
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/team.h
--- a/QTfrontend/team.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/team.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
* Copyright (c) 2007 Igor Ulyanov
*
* This program is free software; you can redistribute it and/or modify
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef TEAM_H
@@ -39,6 +39,8 @@
QString Name;
QString Hat;
int Rounds, Kills, Deaths, Suicides;
+
+ HWHog() : Rounds(0), Kills(0), Deaths(0), Suicides(0){}
};
// class representing a team
@@ -87,6 +89,7 @@
void setName(const QString & name);
void setNumHedgehogs(unsigned char num);
void setVoicepack(const QString & voicepack);
+ void setNetTeam(bool isNetTeam);
// increments for statistical info
void incRounds();
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/dialog/ask_quit.cpp
--- a/QTfrontend/ui/dialog/ask_quit.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/dialog/ask_quit.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/dialog/ask_quit.h
--- a/QTfrontend/ui/dialog/ask_quit.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/dialog/ask_quit.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ASK_QUIT_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/dialog/bandialog.cpp
--- a/QTfrontend/ui/dialog/bandialog.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/dialog/bandialog.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -22,16 +22,19 @@
leReason = new QLineEdit(this);
cbTime = new QComboBox(this);
- cbTime->addItem(HWApplication::tr("%1 minutes", 0, 10).arg("10"), 5 * 60);
- cbTime->addItem(HWApplication::tr("%1 minutes", 0, 30).arg("30"), 10 * 60);
- cbTime->addItem(HWApplication::tr("%1 hour", 0, 10).arg("10"), 60 * 60);
- cbTime->addItem(HWApplication::tr("%1 hours", 0, 3).arg("3"), 3 * 60 * 60);
- cbTime->addItem(HWApplication::tr("%1 hours", 0, 5).arg("5"), 5 * 60 * 60);
- cbTime->addItem(HWApplication::tr("%1 hours", 0, 12).arg("12"), 12 * 60 * 60);
- cbTime->addItem(HWApplication::tr("%1 day", 0, 1).arg("1"), 24 * 60 * 60);
- cbTime->addItem(HWApplication::tr("%1 days", 0, 3).arg("3"), 72 * 60 * 60);
- cbTime->addItem(HWApplication::tr("%1 days", 0, 7).arg("7"), 168 * 60 * 60);
- cbTime->addItem(HWApplication::tr("%1 days", 0, 14).arg("14"), 336 * 60 * 60);
+ const int min = 60;
+ const int hour = 60 * min;
+ const int day = 24 * hour;
+ cbTime->addItem(HWApplication::tr("%1 minutes", 0, 10).arg(10), 10 * min);
+ cbTime->addItem(HWApplication::tr("%1 minutes", 0, 30).arg(30), 30 * min);
+ cbTime->addItem(HWApplication::tr("%1 hour", 0, 1).arg(1), 1 * hour);
+ cbTime->addItem(HWApplication::tr("%1 hours", 0, 3).arg(3), 3 * hour);
+ cbTime->addItem(HWApplication::tr("%1 hours", 0, 5).arg(5), 5 * hour);
+ cbTime->addItem(HWApplication::tr("%1 hours", 0, 12).arg(12), 12 * hour);
+ cbTime->addItem(HWApplication::tr("%1 day", 0, 1).arg(1), 1 * day);
+ cbTime->addItem(HWApplication::tr("%1 days", 0, 3).arg(3), 3 * day);
+ cbTime->addItem(HWApplication::tr("%1 days", 0, 7).arg(7), 7 * day);
+ cbTime->addItem(HWApplication::tr("%1 days", 0, 14).arg(14), 14 * day);
cbTime->addItem(tr("permanent"), 3650 * 24 * 60 * 60);
cbTime->setCurrentIndex(0);
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/dialog/input_ip.cpp
--- a/QTfrontend/ui/dialog/input_ip.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/dialog/input_ip.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/dialog/input_ip.h
--- a/QTfrontend/ui/dialog/input_ip.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/dialog/input_ip.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/dialog/input_password.cpp
--- a/QTfrontend/ui/dialog/input_password.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/dialog/input_password.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -56,7 +56,7 @@
layout->addWidget(cbSave, 5, 0);
QDialogButtonBox* dbbButtons = new QDialogButtonBox(this);
- pbNewAccount = dbbButtons->addButton(QString("New Account"), QDialogButtonBox::ActionRole);
+ pbNewAccount = dbbButtons->addButton(tr("New Account"), QDialogButtonBox::ActionRole);
QPushButton * pbOK = dbbButtons->addButton(QDialogButtonBox::Ok);
QPushButton * pbCancel = dbbButtons->addButton(QDialogButtonBox::Cancel);
layout->addWidget(dbbButtons, 6, 0);
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/dialog/input_password.h
--- a/QTfrontend/ui/dialog/input_password.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/dialog/input_password.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef INPUT_PASSWORD_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/dialog/upload_video.cpp
--- a/QTfrontend/ui/dialog/upload_video.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/dialog/upload_video.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/dialog/upload_video.h
--- a/QTfrontend/ui/dialog/upload_video.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/dialog/upload_video.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef UPLOAD_VIDEO_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/mouseoverfilter.cpp
--- a/QTfrontend/ui/mouseoverfilter.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/mouseoverfilter.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -22,6 +22,8 @@
bool MouseOverFilter::eventFilter( QObject *dist, QEvent *event )
{
+ AbstractPage* abstractpage;
+
if (event->type() == QEvent::Enter)
{
QWidget * widget = dynamic_cast(dist);
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/mouseoverfilter.h
--- a/QTfrontend/ui/mouseoverfilter.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/mouseoverfilter.h Tue Nov 10 20:43:13 2015 +0100
@@ -20,7 +20,6 @@
private:
Ui_HWForm *ui;
- AbstractPage* abstractpage;
};
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/AbstractPage.cpp
--- a/QTfrontend/ui/page/AbstractPage.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/AbstractPage.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
@@ -67,7 +67,7 @@
descLabel->setAlignment(Qt::AlignCenter);
descLabel->setWordWrap(true);
descLabel->setOpenExternalLinks(true);
- descLabel->setFixedHeight(50);
+ descLabel->setFixedHeight(60);
descLabel->setStyleSheet("font-size: 16px");
bottomLeftLayout->addWidget(descLabel);
pageLayout->addWidget(descLabel, 1, 1);
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/AbstractPage.h
--- a/QTfrontend/ui/page/AbstractPage.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/AbstractPage.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageadmin.cpp
--- a/QTfrontend/ui/page/pageadmin.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageadmin.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageadmin.h
--- a/QTfrontend/ui/page/pageadmin.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageadmin.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_ADMIN_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagecampaign.cpp
--- a/QTfrontend/ui/page/pagecampaign.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagecampaign.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -45,7 +45,7 @@
btnPreview = formattedButton(":/res/campaign/A_Classic_Fairytale/first_blood.png", true);
infoLayout->setAlignment(btnPreview, Qt::AlignHCenter | Qt::AlignVCenter);
- lbldescription = new QLabel();
+ lbldescription = new QLabel(this);
lbldescription->setAlignment(Qt::AlignHCenter| Qt::AlignTop);
lbldescription->setWordWrap(true);
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagecampaign.h
--- a/QTfrontend/ui/page/pagecampaign.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagecampaign.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_CAMPAIGN_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageconnecting.cpp
--- a/QTfrontend/ui/page/pageconnecting.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageconnecting.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageconnecting.h
--- a/QTfrontend/ui/page/pageconnecting.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageconnecting.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_CONNECTING_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagedata.cpp
--- a/QTfrontend/ui/page/pagedata.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagedata.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -26,6 +26,7 @@
#include
#include
#include
+#include
#include "pagedata.h"
#include "databrowser.h"
@@ -48,10 +49,23 @@
return pageLayout;
}
+QLayout * PageDataDownload::footerLayoutDefinition()
+{
+ QHBoxLayout * bottomLayout = new QHBoxLayout();
+ bottomLayout->setStretch(0, 1);
+
+ pbOpenDir = addButton(tr("Open packages directory"), bottomLayout, 1, false);
+
+ bottomLayout->setStretch(2, 1);
+
+ return bottomLayout;
+}
+
void PageDataDownload::connectSignals()
{
connect(web, SIGNAL(anchorClicked(QUrl)), this, SLOT(request(const QUrl&)));
connect(this, SIGNAL(goBack()), this, SLOT(onPageLeave()));
+ connect(pbOpenDir, SIGNAL(clicked()), this, SLOT(openPackagesDir()));
}
PageDataDownload::PageDataDownload(QWidget* parent) : AbstractPage(parent)
@@ -193,3 +207,9 @@
//DataManager::instance().reload();
}
}
+
+void PageDataDownload::openPackagesDir()
+{
+ QString path = QDir::toNativeSeparators(cfgdir->absolutePath() + "/Data");
+ QDesktopServices::openUrl(QUrl("file:///" + path));
+}
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagedata.h
--- a/QTfrontend/ui/page/pagedata.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagedata.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_DATA_H
@@ -27,6 +27,7 @@
class QNetworkReply;
class QVBoxLayout;
+
class PageDataDownload : public AbstractPage
{
Q_OBJECT
@@ -39,12 +40,14 @@
protected:
QLayout * bodyLayoutDefinition();
+ QLayout * footerLayoutDefinition();
void connectSignals();
private:
DataBrowser *web;
QHash progressBars;
QVBoxLayout *progressBarsLayout;
+ QPushButtonWithSound * pbOpenDir;
bool m_contentDownloaded; ///< true if something was downloaded since last page leave
@@ -54,6 +57,7 @@
void pageDownloaded();
void fileDownloaded();
void downloadProgress(qint64, qint64);
+ void openPackagesDir();
void onPageLeave();
};
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagedrawmap.cpp
--- a/QTfrontend/ui/page/pagedrawmap.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagedrawmap.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -44,11 +44,13 @@
rbPolyline->setChecked(true);
pbClear = addButton(tr("Clear"), pageLayout, 5, 0);
- pbLoad = addButton(tr("Load"), pageLayout, 6, 0);
- pbSave = addButton(tr("Save"), pageLayout, 7, 0);
+ pbOptimize = addButton(tr("Optimize"), pageLayout, 6, 0);
+ pbOptimize->setVisible(false);
+ pbLoad = addButton(tr("Load"), pageLayout, 7, 0);
+ pbSave = addButton(tr("Save"), pageLayout, 8, 0);
drawMapWidget = new DrawMapWidget(this);
- pageLayout->addWidget(drawMapWidget, 0, 1, 9, 1);
+ pageLayout->addWidget(drawMapWidget, 0, 1, 10, 1);
return pageLayout;
}
@@ -58,6 +60,7 @@
connect(cbEraser, SIGNAL(toggled(bool)), drawMapWidget, SLOT(setErasing(bool)));
connect(pbUndo, SIGNAL(clicked()), drawMapWidget, SLOT(undo()));
connect(pbClear, SIGNAL(clicked()), drawMapWidget, SLOT(clear()));
+ connect(pbOptimize, SIGNAL(clicked()), drawMapWidget, SLOT(optimize()));
connect(pbLoad, SIGNAL(clicked()), this, SLOT(load()));
connect(pbSave, SIGNAL(clicked()), this, SLOT(save()));
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagedrawmap.h
--- a/QTfrontend/ui/page/pagedrawmap.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagedrawmap.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_DRAWMAP_H
@@ -42,6 +42,7 @@
QPushButton * pbClear;
QPushButton * pbLoad;
QPushButton * pbSave;
+ QPushButton * pbOptimize;
QCheckBox * cbEraser;
QRadioButton * rbPolyline;
QRadioButton * rbRectangle;
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageeditteam.cpp
--- a/QTfrontend/ui/page/pageeditteam.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageeditteam.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageeditteam.h
--- a/QTfrontend/ui/page/pageeditteam.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageeditteam.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_EDITTEAM_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagegamestats.cpp
--- a/QTfrontend/ui/page/pagegamestats.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagegamestats.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -40,13 +40,13 @@
QLayout * PageGameStats::bodyLayoutDefinition()
{
- kindOfPoints = QString("");
- defaultGraphTitle = true;
+ kindOfPoints = QString("");
+ defaultGraphTitle = true;
QGridLayout * pageLayout = new QGridLayout();
pageLayout->setSpacing(20);
pageLayout->setColumnStretch(0, 1);
pageLayout->setColumnStretch(1, 1);
- pageLayout->setRowStretch(0, 1);
+ pageLayout->setRowStretch(0, 1);
pageLayout->setRowStretch(1, 20);
//pageLayout->setRowStretch(1, -1); this should work but there is unnecessary empty space betwin lines if used
pageLayout->setContentsMargins(7, 7, 7, 0);
@@ -106,11 +106,11 @@
QLayout * PageGameStats::footerLayoutDefinition()
{
QHBoxLayout * bottomLayout = new QHBoxLayout();
-
+
mainNote = new QLabel(this);
mainNote->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
mainNote->setWordWrap(true);
-
+
bottomLayout->addWidget(mainNote, 0);
bottomLayout->setStretch(0,1);
@@ -159,41 +159,41 @@
void PageGameStats::renderStats()
{
- graphic->show();
- labelGraphTitle-> show();
- if(defaultGraphTitle) {
- labelGraphTitle->setText("
" + PageGameStats::tr("Health graph") + "
");
- } else {
- defaultGraphTitle = true;
- }
- // if not health data sent
- if(healthPoints.size() == 0) {
- labelGraphTitle->hide();
- graphic->hide();
- } else {
- QGraphicsScene * scene = new QGraphicsScene();
+ graphic->show();
+ labelGraphTitle-> show();
+ if(defaultGraphTitle) {
+ labelGraphTitle->setText("
" + PageGameStats::tr("Health graph") + "
");
+ } else {
+ defaultGraphTitle = true;
+ }
+ // if not health data sent
+ if(healthPoints.size() == 0) {
+ labelGraphTitle->hide();
+ graphic->hide();
+ } else {
+ QGraphicsScene * scene = new QGraphicsScene();
- QMap >::const_iterator i = healthPoints.constBegin();
- while (i != healthPoints.constEnd())
- {
- quint32 c = i.key();
- //QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255));
- QVector hps = i.value();
+ QMap >::const_iterator i = healthPoints.constBegin();
+ while (i != healthPoints.constEnd())
+ {
+ quint32 c = i.key();
+ //QColor clanColor = QColor(qRgb((c >> 16) & 255, (c >> 8) & 255, c & 255));
+ QVector hps = i.value();
- QPainterPath path;
- if (hps.size())
- path.moveTo(0, hps[0]);
+ QPainterPath path;
+ if (hps.size())
+ path.moveTo(0, hps[0]);
- for(int t = 1; t < hps.size(); ++t)
- path.lineTo(t, hps[t]);
+ for(int t = 1; t < hps.size(); ++t)
+ path.lineTo(t, hps[t]);
- scene->addPath(path, QPen(c));
- ++i;
- }
+ scene->addPath(path, QPen(c));
+ ++i;
+ }
- graphic->setScene(scene);
- graphic->fitInView(graphic->sceneRect());
- }
+ graphic->setScene(scene);
+ graphic->fitInView(graphic->sceneRect());
+ }
}
void PageGameStats::GameStats(char type, const QString & info)
@@ -208,7 +208,8 @@
case 'D' :
{
int i = info.indexOf(' ');
- QString message = "
" + PageGameStats::tr("The best shot award was won by %1 with %2 pts.").arg(info.mid(i + 1), info.left(i)) + "
";
+ int num = info.left(i).toInt();
+ QString message = "
" + PageGameStats::tr("The best shot award was won by %1 with %2 pts.", "", num).arg(info.mid(i + 1), info.left(i)) + "
";
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagegamestats.h
--- a/QTfrontend/ui/page/pagegamestats.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagegamestats.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef STATSPAGE_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageinfo.cpp
--- a/QTfrontend/ui/page/pageinfo.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageinfo.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageinfo.h
--- a/QTfrontend/ui/page/pageinfo.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageinfo.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_INFO_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageingame.cpp
--- a/QTfrontend/ui/page/pageingame.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageingame.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageingame.h
--- a/QTfrontend/ui/page/pageingame.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageingame.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_INGAME_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagemain.cpp
--- a/QTfrontend/ui/page/pagemain.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagemain.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -21,10 +21,12 @@
#include
#include
#include
+#include
#include "pagemain.h"
#include "hwconsts.h"
#include "hwform.h"
+#include "DataManager.h"
QLayout * PageMain::bodyLayoutDefinition()
{
@@ -119,6 +121,9 @@
void PageMain::connectSignals()
{
+#ifndef QT_DEBUG
+ connect(this, SIGNAL(pageEnter()), this, SLOT(updateTip()));
+#endif
connect(BtnNet, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
//connect(BtnNetLocal, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
//connect(BtnNetOfficial, SIGNAL(clicked()), this, SLOT(toggleNetworkChoice()));
@@ -132,16 +137,19 @@
if(frontendEffects)
setAttribute(Qt::WA_NoSystemBackground, true);
mainNote->setOpenExternalLinks(true);
-
#ifdef QT_DEBUG
setDefaultDescription(QLabel::tr("This development build is 'work in progress' and may not be compatible with other versions of the game, while some features might be broken or incomplete!"));
#else
setDefaultDescription(QLabel::tr("Tip: %1").arg(randomTip()));
#endif
-
}
-QString PageMain::randomTip() const
+void PageMain::updateTip()
+{
+ setDefaultDescription(QLabel::tr("Tip: %1").arg(randomTip()));
+}
+
+QString PageMain::randomTip()
{
#ifdef _WIN32
int platform = 1;
@@ -150,35 +158,62 @@
#else
int platform = 3;
#endif
- QStringList Tips;
- QFile file(":/res/xml/tips.xml");
- file.open(QIODevice::ReadOnly);
- QTextStream in(&file);
- QString line = in.readLine();
- int tip_platform = 0;
- while (!line.isNull()) {
- if(line.contains("", Qt::CaseSensitive))
- tip_platform = 1;
- if(line.contains("", Qt::CaseSensitive))
- tip_platform = 2;
- if(line.contains("", Qt::CaseSensitive))
- tip_platform = 3;
- if(line.contains("", Qt::CaseSensitive) ||
- line.contains("", Qt::CaseSensitive) ||
- line.contains("", Qt::CaseSensitive)) {
- tip_platform = 0;
+ if(!Tips.length())
+ {
+ DataManager & dataMgr = DataManager::instance();
+
+ // get locale
+ QSettings settings(dataMgr.settingsFileName(),
+ QSettings::IniFormat);
+
+ QString loc = settings.value("misc/locale", "").toString();
+ if (loc.isEmpty())
+ loc = QLocale::system().name();
+
+ QString tipFile = QString("physfs://Locale/tips_" + loc + ".xml");
+
+ // if file is non-existant try with language only
+ if (!QFile::exists(tipFile))
+ tipFile = QString("physfs://Locale/tips_" + loc.remove(QRegExp("_.*$")) + ".xml");
+
+ // fallback if file for current locale is non-existant
+ if (!QFile::exists(tipFile))
+ tipFile = QString("physfs://Locale/tips_en.xml");
+
+ QFile file(tipFile);
+ file.open(QIODevice::ReadOnly);
+ QTextStream in(&file);
+ in.setCodec("UTF-8");
+ QString line = in.readLine();
+ int tip_platform = 0;
+ while (!line.isNull()) {
+ if(line.contains("", Qt::CaseSensitive))
+ tip_platform = 1;
+ if(line.contains("", Qt::CaseSensitive))
+ tip_platform = 2;
+ if(line.contains("", Qt::CaseSensitive))
+ tip_platform = 3;
+ if(line.contains("", Qt::CaseSensitive) ||
+ line.contains("", Qt::CaseSensitive) ||
+ line.contains("", Qt::CaseSensitive)) {
+ tip_platform = 0;
+ }
+ QStringList split_string = line.split(QRegExp("?tip>"));
+ if((tip_platform == platform || tip_platform == 0) && split_string.size() != 1)
+ Tips << split_string[1];
+ line = in.readLine();
}
- QStringList split_string = line.split(QRegExp("?tip>"));
- if((tip_platform == platform || tip_platform == 0) && split_string.size() != 1)
- Tips << tr(split_string[1].toLatin1().data(), "Tips");
- line = in.readLine();
+ // The following tip will require links to app store entries first.
+ //Tips << tr("Want to play Hedgewars any time? Grab the Mobile version for %1 and %2.", "Tips").arg("").arg("");
+ // the ios version is located here: http://itunes.apple.com/us/app/hedgewars/id391234866
+
+ file.close();
}
- // The following tip will require links to app store entries first.
- //Tips << tr("Want to play Hedgewars any time? Grab the Mobile version for %1 and %2.", "Tips").arg("").arg("");
- // the ios version is located here: http://itunes.apple.com/us/app/hedgewars/id391234866
- file.close();
- return Tips[QTime(0, 0, 0).secsTo(QTime::currentTime()) % Tips.length()];
+ if(Tips.length())
+ return Tips[QTime(0, 0, 0).secsTo(QTime::currentTime()) % Tips.length()];
+ else
+ return QString();
}
void PageMain::toggleNetworkChoice()
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagemain.h
--- a/QTfrontend/ui/page/pagemain.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagemain.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_MAIN_H
@@ -48,10 +48,12 @@
void connectSignals();
QIcon originalNetworkIcon, disabledNetworkIcon;
- QString randomTip() const;
+ QString randomTip();
+ QStringList Tips;
private slots:
void toggleNetworkChoice();
+ void updateTip();
};
#endif
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagemultiplayer.cpp
--- a/QTfrontend/ui/page/pagemultiplayer.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagemultiplayer.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagemultiplayer.h
--- a/QTfrontend/ui/page/pagemultiplayer.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagemultiplayer.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_MULTIPLAYER_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagenet.cpp
--- a/QTfrontend/ui/page/pagenet.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagenet.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagenet.h
--- a/QTfrontend/ui/page/pagenet.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagenet.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_NET_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagenetgame.cpp
--- a/QTfrontend/ui/page/pagenetgame.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagenetgame.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagenetgame.h
--- a/QTfrontend/ui/page/pagenetgame.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagenetgame.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_NETGAME_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagenetserver.cpp
--- a/QTfrontend/ui/page/pagenetserver.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagenetserver.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -124,7 +124,7 @@
// This function assumes that the user wants to share his server while connected to
// the Internet and that he/she is using direct access (eg no NATs). To determine the
-// IP we briefly connect to Hedgewars website and fallback to user intervention
+// IP we briefly connect to Hedgewars website and fallback to user intervention
// after 4 seconds of timeout.
void PageNetServer::copyUrl()
{
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagenetserver.h
--- a/QTfrontend/ui/page/pagenetserver.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagenetserver.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_NETSERVER_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageoptions.cpp
--- a/QTfrontend/ui/page/pageoptions.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageoptions.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -397,7 +397,7 @@
tagsLayout->addWidget(CBHogTag, 0);
tagsLayout->addWidget(CBHealthTag, 0);
tagsLayout->addWidget(CBTagOpacity, 0);
- tagsLayout->addStretch(1);
+ tagsLayout->addStretch(1);
}
{ // group: frontend
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageoptions.h
--- a/QTfrontend/ui/page/pageoptions.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageoptions.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_OPTIONS_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageplayrecord.cpp
--- a/QTfrontend/ui/page/pageplayrecord.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageplayrecord.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "pageplayrecord.h"
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageplayrecord.h
--- a/QTfrontend/ui/page/pageplayrecord.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageplayrecord.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PLAYRECORDPAGE_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageroomslist.cpp
--- a/QTfrontend/ui/page/pageroomslist.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageroomslist.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -53,6 +53,8 @@
QLayout * PageRoomsList::bodyLayoutDefinition()
{
+ // TODO move stylesheet stuff into css/qt.css
+
QVBoxLayout * pageLayout = new QVBoxLayout();
pageLayout->setSpacing(0);
@@ -60,10 +62,37 @@
topLayout->setSpacing(0);
pageLayout->addLayout(topLayout, 0);
+ // State button
+
+ QPushButton * btnState = new QPushButton(tr("Room state"));
+ btnState->setStyleSheet("QPushButton { background-color: #F6CB1C; border-color: #F6CB1C; color: #130F2A; padding: 1px 3px 3px 3px; margin: 0px; border-bottom: none; border-radius: 0px; border-top-left-radius: 10px; } QPushButton:hover { background-color: #FFEB3C; border-color: #F6CB1C; color: #000000 } QPushButton:pressed { background-color: #FFEB3C; border-color: #F6CB1C; color: #000000; }");
+ btnState->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
+
+ // State menu
+
+ QMenu * stateMenu = new QMenu(btnState);
+ showGamesInLobby = new QAction(QAction::tr("Show games in lobby"), stateMenu);
+ showGamesInLobby->setCheckable(true);
+ showGamesInLobby->setChecked(true);
+ showGamesInProgress = new QAction(QAction::tr("Show games in-progress"), stateMenu);
+ showGamesInProgress->setCheckable(true);
+ showGamesInProgress->setChecked(true);
+ showPassword = new QAction(QAction::tr("Show password protected"), stateMenu);
+ showPassword->setCheckable(true);
+ showPassword->setChecked(true);
+ showJoinRestricted = new QAction(QAction::tr("Show join restricted"), stateMenu);
+ showJoinRestricted->setCheckable(true);
+ showJoinRestricted->setChecked(true);
+ stateMenu->addAction(showGamesInLobby);
+ stateMenu->addAction(showGamesInProgress);
+ stateMenu->addAction(showPassword);
+ stateMenu->addAction(showJoinRestricted);
+ btnState->setMenu(stateMenu);
+
// Help/prompt message at top
QLabel * lblDesc = new QLabel(tr("Search for a room:"));
lblDesc->setObjectName("lblDesc");
- lblDesc->setStyleSheet("#lblDesc { color: #130F2A; background: #F6CB1C; border: solid 4px #F6CB1C; border-top-left-radius: 10px; padding: 4px 10px;}");
+ lblDesc->setStyleSheet("#lblDesc { color: #130F2A; background: #F6CB1C; border: solid 4px #F6CB1C; padding: 5px 10px 3px 6px;}");
lblDesc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
lblDesc->setFixedHeight(24);
lblDesc->setMinimumWidth(0);
@@ -97,16 +126,17 @@
BtnJoin->setEnabled(false);
// Add widgets to top layout
- topLayout->addWidget(lblDesc, 1, 0);
- topLayout->addWidget(searchContainer, 1, 1);
- topLayout->addWidget(corner, 1, 2, Qt::AlignBottom);
- topLayout->addWidget(BtnCreate, 0, 4, 2, 1);
- topLayout->addWidget(BtnJoin, 0, 5, 2, 1);
+ topLayout->addWidget(btnState, 1, 0);
+ topLayout->addWidget(lblDesc, 1, 1);
+ topLayout->addWidget(searchContainer, 1, 2);
+ topLayout->addWidget(corner, 1, 3, Qt::AlignBottom);
+ topLayout->addWidget(BtnCreate, 0, 5, 2, 1);
+ topLayout->addWidget(BtnJoin, 0, 6, 2, 1);
// Top layout stretch
topLayout->setRowStretch(0, 1);
topLayout->setRowStretch(1, 0);
- topLayout->setColumnStretch(3, 1);
+ topLayout->setColumnStretch(4, 1);
// Rooms list and chat with splitter
m_splitter = new QSplitter();
@@ -132,43 +162,6 @@
roomsList->setFocusPolicy(Qt::NoFocus);
roomsLayout->addWidget(roomsList, 200);
- // Room filters container
-
- QWidget * filtersContainer = new QWidget();
- filtersContainer->setMaximumWidth(800);
- filtersContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
-
- roomsLayout->addSpacing(7);
- roomsLayout->addWidget(filtersContainer, 0, Qt::AlignHCenter);
- roomsLayout->addSpacing(7);
-
- QHBoxLayout * filterLayout = new QHBoxLayout(filtersContainer);
- filterLayout->setSpacing(0);
- filterLayout->setMargin(0);
-
- const int filterSpacing = 20;
-
- // State button
-
- QPushButton * btnState = new QPushButton(tr("Room state"));
- btnState->setStyleSheet("QPushButton { padding: 2px 4px; } QPushButton:pressed { background-color: #ffcc00; border-color: #ffcc00; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; color: #11084A; }");
- btnState->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
- filterLayout->addWidget(btnState);
- filterLayout->addSpacing(filterSpacing);
-
- // State menu
-
- QMenu * stateMenu = new QMenu(btnState);
- showGamesInLobby = new QAction(QAction::tr("Show games in lobby"), stateMenu);
- showGamesInLobby->setCheckable(true);
- showGamesInLobby->setChecked(true);
- showGamesInProgress = new QAction(QAction::tr("Show games in-progress"), stateMenu);
- showGamesInProgress->setCheckable(true);
- showGamesInProgress->setChecked(true);
- stateMenu->addAction(showGamesInLobby);
- stateMenu->addAction(showGamesInProgress);
- btnState->setMenu(stateMenu);
-
// Lobby chat
chatWidget = new HWChatWidget(this, false);
@@ -201,6 +194,8 @@
connect(roomsList, SIGNAL(clicked (const QModelIndex &)), searchText, SLOT(setFocus()));
connect(showGamesInLobby, SIGNAL(triggered()), this, SLOT(onFilterChanged()));
connect(showGamesInProgress, SIGNAL(triggered()), this, SLOT(onFilterChanged()));
+ connect(showPassword, SIGNAL(triggered()), this, SLOT(onFilterChanged()));
+ connect(showJoinRestricted, SIGNAL(triggered()), this, SLOT(onFilterChanged()));
connect(searchText, SIGNAL(textChanged (const QString &)), this, SLOT(onFilterChanged()));
connect(this, SIGNAL(askJoinConfirmation (const QString &)), this, SLOT(onJoinConfirmation(const QString &)), Qt::QueuedConnection);
@@ -645,13 +640,29 @@
bool stateLobby = showGamesInLobby->isChecked();
bool stateProgress = showGamesInProgress->isChecked();
+ bool statePassword = showPassword->isChecked();
+ bool stateJoinRestricted = showJoinRestricted->isChecked();
- if (stateLobby && stateProgress)
- stateFilteredModel->setFilterFixedString(QString()); // "any"
- else if (stateLobby != stateProgress)
- stateFilteredModel->setFilterFixedString(QString(stateProgress));
+ QString filter;
+ if (!stateLobby && !stateProgress)
+ filter = "O_o";
+ else if (stateLobby && stateProgress && statePassword && stateJoinRestricted)
+ filter = "";
else
- stateFilteredModel->setFilterFixedString(QString("none")); // Basically, none.
+ {
+ QString exclude = "[^";
+ if (!stateProgress) exclude += "g";
+ if (!statePassword) exclude += "p";
+ if (!stateJoinRestricted) exclude += "j";
+ exclude += "]*";
+ if (stateProgress && statePassword && stateJoinRestricted) exclude = ".*";
+ filter = "^" + exclude;
+ if (!stateLobby) filter += "g" + exclude;
+ filter += "$";
+ }
+ //qDebug() << filter;
+
+ stateFilteredModel->setFilterRegExp(filter);
}
void PageRoomsList::setSettings(QSettings *settings)
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageroomslist.h
--- a/QTfrontend/ui/page/pageroomslist.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageroomslist.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_ROOMLIST_H
@@ -96,6 +96,8 @@
QSortFilterProxyModel * stateFilteredModel;
QAction * showGamesInLobby;
QAction * showGamesInProgress;
+ QAction * showPassword;
+ QAction * showJoinRestricted;
QSplitter * m_splitter;
AmmoSchemeModel * ammoSchemeModel;
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagescheme.cpp
--- a/QTfrontend/ui/page/pagescheme.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagescheme.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -335,7 +335,7 @@
l->setPixmap(QPixmap(":/res/iconMine.png")); // TODO: icon
glBSLayout->addWidget(l,11,1,1,1);
SB_Mines = new QSpinBox(gbBasicSettings);
- SB_Mines->setRange(0, 80);
+ SB_Mines->setRange(0, 200);
SB_Mines->setValue(0);
SB_Mines->setSingleStep(5);
glBSLayout->addWidget(SB_Mines,11,2,1,1);
@@ -363,40 +363,69 @@
l->setPixmap(QPixmap(":/res/iconDamage.png"));
glBSLayout->addWidget(l,13,1,1,1);
SB_Explosives = new QSpinBox(gbBasicSettings);
- SB_Explosives->setRange(0, 40);
+ SB_Explosives->setRange(0, 200);
SB_Explosives->setValue(0);
- SB_Explosives->setSingleStep(1);
+ SB_Explosives->setSingleStep(3);
glBSLayout->addWidget(SB_Explosives,13,2,1,1);
l = new QLabel(gbBasicSettings);
- l->setText(QLabel::tr("% Get Away Time"));
+ l->setText(QLabel::tr("Air Mines"));
l->setWordWrap(true);
glBSLayout->addWidget(l,14,0,1,1);
l = new QLabel(gbBasicSettings);
l->setFixedSize(32,32);
+ l->setPixmap(QPixmap(":/res/iconMine.png")); // TODO: icon
+ glBSLayout->addWidget(l,14,1,1,1);
+ SB_AirMines = new QSpinBox(gbBasicSettings);
+ SB_AirMines->setRange(0, 200);
+ SB_AirMines->setValue(0);
+ SB_AirMines->setSingleStep(5);
+ glBSLayout->addWidget(SB_AirMines,14,2,1,1);
+
+ l = new QLabel(gbBasicSettings);
+ l->setText(QLabel::tr("% Get Away Time"));
+ l->setWordWrap(true);
+ glBSLayout->addWidget(l,15,0,1,1);
+ l = new QLabel(gbBasicSettings);
+ l->setFixedSize(32,32);
l->setPixmap(QPixmap(":/res/iconTime.png"));
- glBSLayout->addWidget(l,14,1,1,1);
+ glBSLayout->addWidget(l,15,1,1,1);
SB_GetAwayTime = new QSpinBox(gbBasicSettings);
SB_GetAwayTime->setRange(0, 999);
SB_GetAwayTime->setValue(100);
SB_GetAwayTime->setSingleStep(25);
- glBSLayout->addWidget(SB_GetAwayTime,14,2,1,1);
+ glBSLayout->addWidget(SB_GetAwayTime,15,2,1,1);
l = new QLabel(gbBasicSettings);
l->setText(QLabel::tr("World Edge"));
l->setWordWrap(true);
- glBSLayout->addWidget(l,15,0,1,1);
+ glBSLayout->addWidget(l,16,0,1,1);
l = new QLabel(gbBasicSettings);
l->setFixedSize(32,32);
l->setPixmap(QPixmap(":/res/iconEarth.png"));
- glBSLayout->addWidget(l,15,1,1,1);
+ glBSLayout->addWidget(l,16,1,1,1);
+
CB_WorldEdge = new QComboBox(gbBasicSettings);
CB_WorldEdge->insertItem(0, tr("None (Default)"));
CB_WorldEdge->insertItem(1, tr("Wrap (World wraps)"));
CB_WorldEdge->insertItem(2, tr("Bounce (Edges reflect)"));
CB_WorldEdge->insertItem(3, tr("Sea (Edges connect to sea)"));
/* CB_WorldEdge->insertItem(4, tr("Skybox")); */
- glBSLayout->addWidget(CB_WorldEdge,15,2,1,1);
+ glBSLayout->addWidget(CB_WorldEdge,16,2,1,1);
+
+
+ l = new QLabel(gbBasicSettings);
+ l->setText(QLabel::tr("Script parameter"));
+ l->setWordWrap(true);
+ glBSLayout->addWidget(l,17,0,1,1);
+ l = new QLabel(gbBasicSettings);
+ l->setFixedSize(32,32);
+ l->setPixmap(QPixmap(":/res/iconBox.png"));
+ glBSLayout->addWidget(l,17,1,1,1);
+
+ LE_ScriptParam = new QLineEdit(gbBasicSettings);
+ LE_ScriptParam->setMaxLength(240);
+ glBSLayout->addWidget(LE_ScriptParam,17,2,1,1);
l = new QLabel(gbBasicSettings);
@@ -482,13 +511,15 @@
mapper->addMapping(SB_Mines, 32);
mapper->addMapping(SB_MineDuds, 33);
mapper->addMapping(SB_Explosives, 34);
- mapper->addMapping(SB_HealthCrates, 35);
- mapper->addMapping(SB_CrateHealth, 36);
- mapper->addMapping(SB_WaterRise, 37);
- mapper->addMapping(SB_HealthDecrease, 38);
- mapper->addMapping(SB_RopeModifier, 39);
- mapper->addMapping(SB_GetAwayTime, 40);
- mapper->addMapping(CB_WorldEdge, 41, "currentIndex");
+ mapper->addMapping(SB_AirMines, 35);
+ mapper->addMapping(SB_HealthCrates, 36);
+ mapper->addMapping(SB_CrateHealth, 37);
+ mapper->addMapping(SB_WaterRise, 38);
+ mapper->addMapping(SB_HealthDecrease, 39);
+ mapper->addMapping(SB_RopeModifier, 40);
+ mapper->addMapping(SB_GetAwayTime, 41);
+ mapper->addMapping(CB_WorldEdge, 42, "currentIndex");
+ mapper->addMapping(LE_ScriptParam, 43);
mapper->toFirst();
}
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagescheme.h
--- a/QTfrontend/ui/page/pagescheme.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagescheme.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_SCHEME_H
@@ -87,12 +87,14 @@
QSpinBox * SB_CrateHealth;
QSpinBox * SB_MinesTime;
QSpinBox * SB_Mines;
+ QSpinBox * SB_AirMines;
QSpinBox * SB_MineDuds;
QSpinBox * SB_Explosives;
QSpinBox * SB_RopeModifier;
QSpinBox * SB_GetAwayTime;
QComboBox * CB_WorldEdge;
QLineEdit * LE_name;
+ QLineEdit * LE_ScriptParam;
QGroupBox * gbGameModes;
QGroupBox * gbBasicSettings;
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageselectweapon.cpp
--- a/QTfrontend/ui/page/pageselectweapon.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageselectweapon.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pageselectweapon.h
--- a/QTfrontend/ui/page/pageselectweapon.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pageselectweapon.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_SELECTWEAPON_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagesingleplayer.cpp
--- a/QTfrontend/ui/page/pagesingleplayer.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagesingleplayer.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagesingleplayer.h
--- a/QTfrontend/ui/page/pagesingleplayer.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagesingleplayer.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_SINGLE_PLAYER_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagetraining.cpp
--- a/QTfrontend/ui/page/pagetraining.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagetraining.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagetraining.h
--- a/QTfrontend/ui/page/pagetraining.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagetraining.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef PAGE_TRAINING_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagevideos.cpp
--- a/QTfrontend/ui/page/pagevideos.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagevideos.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -99,6 +99,7 @@
pUploading = NULL;
lastSizeUpdate = 0;
progress = 0;
+ seen = false;
}
VideoItem::~VideoItem()
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/page/pagevideos.h
--- a/QTfrontend/ui/page/pagevideos.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/page/pagevideos.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/FreqSpinBox.cpp
--- a/QTfrontend/ui/widget/FreqSpinBox.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/FreqSpinBox.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/FreqSpinBox.h
--- a/QTfrontend/ui/widget/FreqSpinBox.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/FreqSpinBox.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/HistoryLineEdit.cpp
--- a/QTfrontend/ui/widget/HistoryLineEdit.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/HistoryLineEdit.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/HistoryLineEdit.h
--- a/QTfrontend/ui/widget/HistoryLineEdit.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/HistoryLineEdit.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/SmartLineEdit.cpp
--- a/QTfrontend/ui/widget/SmartLineEdit.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/SmartLineEdit.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/SmartLineEdit.h
--- a/QTfrontend/ui/widget/SmartLineEdit.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/SmartLineEdit.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/SquareLabel.cpp
--- a/QTfrontend/ui/widget/SquareLabel.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/SquareLabel.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/SquareLabel.h
--- a/QTfrontend/ui/widget/SquareLabel.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/SquareLabel.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _SQUARELABEL_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/about.cpp
--- a/QTfrontend/ui/widget/about.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/about.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -35,7 +35,9 @@
#ifdef VIDEOREC
extern "C"
{
-#include "libavutil/avutil.h"
+ #include "libavcodec/version.h"
+ #include "libavformat/version.h"
+ #include "libavutil/avutil.h" // version.h only from 51.36.0
}
#endif
@@ -166,7 +168,15 @@
libinfo.append(QString("Qt version: %1 ").arg(QT_VERSION_STR));
#ifdef VIDEOREC
- libinfo.append(QString("Libav version: %1.%2.%3 ")
+ libinfo.append(QString("libavcodec version: %1.%2.%3 ")
+ .arg(LIBAVCODEC_VERSION_MAJOR)
+ .arg(LIBAVCODEC_VERSION_MINOR)
+ .arg(LIBAVCODEC_VERSION_MICRO));
+ libinfo.append(QString("libavformat version: %1.%2.%3 ")
+ .arg(LIBAVFORMAT_VERSION_MAJOR)
+ .arg(LIBAVFORMAT_VERSION_MINOR)
+ .arg(LIBAVFORMAT_VERSION_MICRO));
+ libinfo.append(QString("libavutil version: %1.%2.%3 ")
.arg(LIBAVUTIL_VERSION_MAJOR)
.arg(LIBAVUTIL_VERSION_MINOR)
.arg(LIBAVUTIL_VERSION_MICRO));
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/about.h
--- a/QTfrontend/ui/widget/about.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/about.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _ABOUT_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/bgwidget.cpp
--- a/QTfrontend/ui/widget/bgwidget.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/bgwidget.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2009 Kristian Lehmann
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "bgwidget.h"
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/bgwidget.h
--- a/QTfrontend/ui/widget/bgwidget.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/bgwidget.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2009 Kristian Lehmann
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef BGWIDGET_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/chatwidget.cpp
--- a/QTfrontend/ui/widget/chatwidget.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/chatwidget.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2007 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -179,9 +179,14 @@
this->gameSettings = NULL;
this->notify = notify;
+ m_usersModel = NULL;
+
m_isAdmin = false;
m_autoKickEnabled = false;
+ m_scrollToBottom = false;
+ m_scrollBarPos = 0;
+
QStringList vpList =
QStringList() << "Classic" << "Default" << "Mobster" << "Russian";
@@ -406,26 +411,27 @@
void HWChatWidget::printChatString(
const QString & nick, const QString & str, const QString & cssClassPart, bool highlight)
{
- QSortFilterProxyModel * playersSortFilterModel = qobject_cast(chatNicks->model());
- if(!playersSortFilterModel)
- return;
-
- PlayersListModel * players = qobject_cast(playersSortFilterModel->sourceModel());
-
- if(!players)
+ if(!m_usersModel)
return;
// don't show chat lines that are from ignored nicks
- if (players->isFlagSet(nick, PlayersListModel::Ignore))
+ if (m_usersModel->isFlagSet(nick, PlayersListModel::Ignore))
return;
- bool isFriend = (!nick.isEmpty()) && players->isFlagSet(nick, PlayersListModel::Friend);
+ bool isFriend = (!nick.isEmpty()) && m_usersModel->isFlagSet(nick, PlayersListModel::Friend);
QString cssClass = (isFriend ? "msg_Friend" : "msg_User") + cssClassPart;
addLine(cssClass, str, highlight);
}
+bool HWChatWidget::isInGame() {
+ if (!m_usersModel)
+ return false;
+
+ return m_usersModel->isFlagSet(m_userNick, PlayersListModel::InGame);
+}
+
void HWChatWidget::addLine(const QString & cssClass, QString line, bool isHighlight)
{
if (s_displayNone->contains(cssClass))
@@ -449,7 +455,8 @@
{
line = QString("%1").arg(line);
SDLInteraction::instance().playSoundFile(m_hilightSound);
- HWApplication::alert(this, 800);
+ if (!isInGame())
+ HWApplication::alert(this, 800);
}
chatStrings.append(line);
@@ -544,7 +551,8 @@
QString hlRegExp("^(.* )?%1[^-a-z0-9_]*( .*)?$");
QRegExp whitespace("\\s");
- m_highlights.append(QRegExp(hlRegExp.arg(m_userNick.toLower())));
+ if (!m_userNick.isEmpty())
+ m_highlights.append(QRegExp(hlRegExp.arg(QRegExp::escape(m_userNick.toLower()))));
QFile file(cfgdir->absolutePath() + "/" + m_userNick.toLower() + "_highlight.txt");
@@ -589,9 +597,10 @@
{
addLine("msg_PlayerInfo", QString(" >>> %1 - %2%3%4")
.arg(linkedNick(nick))
- .arg(ip)
- .arg(version)
- .arg(roomInfo));
+ .arg(Qt::escape(ip == "[]"?"":ip))
+ .arg(Qt::escape(version))
+ .arg(Qt::escape(roomInfo))
+ );
}
void HWChatWidget::onKick()
@@ -717,14 +726,14 @@
void HWChatWidget::adminAccess(bool b)
{
chatNicks->removeAction(acKick);
- chatNicks->removeAction(acBan);
+ //chatNicks->removeAction(acBan);
m_isAdmin = b;
if(b)
{
chatNicks->insertAction(0, acKick);
- chatNicks->insertAction(0, acBan);
+ //chatNicks->insertAction(0, acBan);
}
}
@@ -848,6 +857,12 @@
chatNicks->setModel(model);
chatNicks->setModelColumn(0);
+
+ QSortFilterProxyModel * sfpModel = qobject_cast(model);
+ if (sfpModel)
+ m_usersModel = qobject_cast(sfpModel->sourceModel());
+ else
+ m_usersModel = qobject_cast(model);
}
void HWChatWidget::nicksContextMenuRequested(const QPoint &pos)
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/chatwidget.h
--- a/QTfrontend/ui/widget/chatwidget.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/chatwidget.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2007 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _CHAT_WIDGET_INCLUDED
@@ -32,6 +32,7 @@
#include "SDLInteraction.h"
#include "SmartLineEdit.h"
+#include "playerslistmodel.h"
class QTextBrowser;
class QLineEdit;
@@ -87,6 +88,7 @@
QString linkedNick(const QString & nickname);
void beforeContentAdd();
void afterContentAdd();
+ bool isInGame();
/**
* @brief Checks whether the message contains a highlight.
@@ -132,6 +134,7 @@
void consoleCommand(const QString & command);
private:
+ PlayersListModel* m_usersModel;
bool m_isAdmin;
QHBoxLayout mainLayout;
QTextBrowser* chatText;
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/databrowser.cpp
--- a/QTfrontend/ui/widget/databrowser.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/databrowser.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/databrowser.h
--- a/QTfrontend/ui/widget/databrowser.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/databrowser.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/drawmapwidget.cpp
--- a/QTfrontend/ui/widget/drawmapwidget.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/drawmapwidget.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -118,6 +118,11 @@
if(m_scene) m_scene->clearMap();
}
+void DrawMapWidget::optimize()
+{
+ if(m_scene) m_scene->optimize();
+}
+
void DrawMapWidget::setErasing(bool erasing)
{
if(m_scene) m_scene->setErasing(erasing);
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/drawmapwidget.h
--- a/QTfrontend/ui/widget/drawmapwidget.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/drawmapwidget.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DRAWMAPWIDGET_H
@@ -97,6 +97,7 @@
public slots:
void undo();
void clear();
+ void optimize();
void setErasing(bool erasing);
void save(const QString & fileName);
void load(const QString & fileName);
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/feedbackdialog.cpp
--- a/QTfrontend/ui/widget/feedbackdialog.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/feedbackdialog.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -268,7 +268,7 @@
number_of_cores += QString::number(sysconf(_SC_NPROCESSORS_ONLN)) + "\n";
quint32 pages = sysconf(_SC_PHYS_PAGES);
quint32 page_size = sysconf(_SC_PAGE_SIZE);
- quint32 total = pages * page_size / 1024 / 1024;
+ quint64 total = (quint64)pages * page_size / 1024 / 1024;
total_ram += QString::number(total) + " MB\n";
os_version += "GNU/Linux or BSD\n";
#endif
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/feedbackdialog.h
--- a/QTfrontend/ui/widget/feedbackdialog.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/feedbackdialog.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef FEEDBACKDIALOG_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/fpsedit.cpp
--- a/QTfrontend/ui/widget/fpsedit.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/fpsedit.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "fpsedit.h"
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/fpsedit.h
--- a/QTfrontend/ui/widget/fpsedit.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/fpsedit.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _FPSEDIT_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/frameTeam.cpp
--- a/QTfrontend/ui/widget/frameTeam.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/frameTeam.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -28,7 +28,7 @@
#include "DataManager.h"
FrameTeams::FrameTeams(QWidget* parent) :
- QFrame(parent), maxHedgehogsPerGame(48), overallHedgehogs(0), mainLayout(this), nonInteractive(false)
+ QFrame(parent), mainLayout(this), nonInteractive(false)
{
QPalette newPalette = palette();
newPalette.setColor(QPalette::Window, QColor(0x00, 0x00, 0x00));
@@ -122,7 +122,7 @@
bool FrameTeams::isFullTeams() const
{
- return overallHedgehogs==maxHedgehogsPerGame;
+ return teamToWidget.size() >= 8;
}
void FrameTeams::emitTeamColorChanged(const HWTeam& team)
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/frameTeam.h
--- a/QTfrontend/ui/widget/frameTeam.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/frameTeam.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Igor Ulyanov
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _FRAME_TEAM_INCLUDED
@@ -53,8 +53,6 @@
void removeTeam(HWTeam team);
private:
- const int maxHedgehogsPerGame;
- int overallHedgehogs;
int currentColor;
void emitTeamColorChanged(const HWTeam& team);
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/gamecfgwidget.cpp
--- a/QTfrontend/ui/widget/gamecfgwidget.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/gamecfgwidget.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
@@ -163,6 +163,7 @@
connect(pMapContainer, SIGNAL(mapChanged(const QString &)), this, SLOT(mapChanged(const QString &)));
connect(pMapContainer, SIGNAL(mapgenChanged(MapGenerator)), this, SLOT(mapgenChanged(MapGenerator)));
connect(pMapContainer, SIGNAL(mazeSizeChanged(int)), this, SLOT(maze_sizeChanged(int)));
+ connect(pMapContainer, SIGNAL(mapFeatureSizeChanged(int)), this, SLOT(slMapFeatureSizeChanged(int)));
connect(pMapContainer, SIGNAL(themeChanged(const QString &)), this, SLOT(themeChanged(const QString &)));
connect(pMapContainer, SIGNAL(newTemplateFilter(int)), this, SLOT(templateFilterChanged(int)));
connect(pMapContainer, SIGNAL(drawMapRequested()), this, SIGNAL(goToDrawMap()));
@@ -315,21 +316,25 @@
bcfg << QString("e$minesnum %1").arg(schemeData(32).toInt()).toUtf8();
bcfg << QString("e$minedudpct %1").arg(schemeData(33).toInt()).toUtf8();
bcfg << QString("e$explosives %1").arg(schemeData(34).toInt()).toUtf8();
- bcfg << QString("e$healthprob %1").arg(schemeData(35).toInt()).toUtf8();
- bcfg << QString("e$hcaseamount %1").arg(schemeData(36).toInt()).toUtf8();
- bcfg << QString("e$waterrise %1").arg(schemeData(37).toInt()).toUtf8();
- bcfg << QString("e$healthdec %1").arg(schemeData(38).toInt()).toUtf8();
- bcfg << QString("e$ropepct %1").arg(schemeData(39).toInt()).toUtf8();
- bcfg << QString("e$getawaytime %1").arg(schemeData(40).toInt()).toUtf8();
- bcfg << QString("e$worldedge %1").arg(schemeData(41).toInt()).toUtf8();
+ bcfg << QString("e$airmines %1").arg(schemeData(35).toInt()).toUtf8();
+ bcfg << QString("e$healthprob %1").arg(schemeData(36).toInt()).toUtf8();
+ bcfg << QString("e$hcaseamount %1").arg(schemeData(37).toInt()).toUtf8();
+ bcfg << QString("e$waterrise %1").arg(schemeData(38).toInt()).toUtf8();
+ bcfg << QString("e$healthdec %1").arg(schemeData(39).toInt()).toUtf8();
+ bcfg << QString("e$ropepct %1").arg(schemeData(40).toInt()).toUtf8();
+ bcfg << QString("e$getawaytime %1").arg(schemeData(41).toInt()).toUtf8();
+ bcfg << QString("e$worldedge %1").arg(schemeData(42).toInt()).toUtf8();
bcfg << QString("e$template_filter %1").arg(pMapContainer->getTemplateFilter()).toUtf8();
+ bcfg << QString("e$feature_size %1").arg(pMapContainer->getFeatureSize()).toUtf8();
bcfg << QString("e$mapgen %1").arg(mapgen).toUtf8();
-
+ if(!schemeData(43).isNull())
+ bcfg << QString("e$scriptparam %1").arg(schemeData(43).toString()).toUtf8();
switch (mapgen)
{
case MAPGEN_MAZE:
+ case MAPGEN_PERLIN:
bcfg << QString("e$maze_size %1").arg(pMapContainer->getMazeSize()).toUtf8();
break;
@@ -400,6 +405,10 @@
mapgenChanged(pMapContainer->get_mapgen());
maze_sizeChanged(pMapContainer->getMazeSize());
+ slMapFeatureSizeChanged(pMapContainer->getFeatureSize());
+
+ if(pMapContainer->get_mapgen() == 2)
+ onDrawnMapChanged(pMapContainer->getDrawnMapData());
// map must be the last
QString map = pMapContainer->getCurrentMap();
@@ -437,6 +446,11 @@
pMapContainer->setMapgen((MapGenerator)value.toUInt());
return;
}
+ if (param == "FEATURE_SIZE")
+ {
+ pMapContainer->setFeatureSize(value.toUInt());
+ return;
+ }
if (param == "MAZE_SIZE")
{
pMapContainer->setMazeSize(value.toUInt());
@@ -445,6 +459,7 @@
if (param == "SCRIPT")
{
Scripts->setCurrentIndex(Scripts->findText(value));
+ pMapContainer->setScript(Scripts->itemData(Scripts->currentIndex(), GameStyleModel::ScriptRole).toString().toUtf8(), schemeData(43).toString());
return;
}
if (param == "DRAWNMAP")
@@ -463,18 +478,19 @@
}
}
- if (slValue.size() == 5)
+ if (slValue.size() == 6)
{
if (param == "FULLMAPCONFIG")
{
- QString seed = slValue[3];
+ QString seed = slValue[4];
pMapContainer->setAllMapParameters(
- slValue[0],
- (MapGenerator)slValue[1].toUInt(),
- slValue[2].toUInt(),
+ slValue[1],
+ (MapGenerator)slValue[2].toUInt(),
+ slValue[3].toUInt(),
seed,
- slValue[4].toUInt()
+ slValue[5].toUInt(),
+ slValue[0].toUInt()
);
return;
}
@@ -512,8 +528,8 @@
int num = GameSchemes->findText(pMapContainer->getCurrentScheme());
if (num != -1)
GameSchemes->setCurrentIndex(num);
- else
- GameSchemes->setCurrentIndex(GameSchemes->findText("Default"));
+ //else
+ // GameSchemes->setCurrentIndex(GameSchemes->findText("Default"));
}
if (pMapContainer->getCurrentWeapons() == "locked")
@@ -527,8 +543,8 @@
int num = WeaponsName->findText(pMapContainer->getCurrentWeapons());
if (num != -1)
WeaponsName->setCurrentIndex(num);
- else
- WeaponsName->setCurrentIndex(WeaponsName->findText("Default"));
+ //else
+ // WeaponsName->setCurrentIndex(WeaponsName->findText("Default"));
}
if (pMapContainer->getCurrentScheme() != "locked" && pMapContainer->getCurrentWeapons() != "locked")
@@ -569,7 +585,11 @@
for(int i = 0; i < size; ++i)
sl << schemeData(i).toString();
- if (sl.size()!=1) emit paramChanged("SCHEME", sl); // this is a stupid hack for the fact that SCHEME is being sent once, empty. Still need to find out why.
+ if (sl.size() >= 42)
+ {
+ sl[sl.size()-1].prepend('!');
+ emit paramChanged("SCHEME", sl); // this is a stupid hack for the fact that SCHEME is being sent once, empty. Still need to find out why.
+ }
if (isEnabled() && bindEntries->isEnabled() && bindEntries->isChecked())
{
@@ -586,6 +606,7 @@
}
}
}
+ pMapContainer->setScript(Scripts->itemData(Scripts->currentIndex(), GameStyleModel::ScriptRole).toString().toUtf8(), schemeData(43).toString());
}
void GameCFGWidget::scriptChanged(int index)
@@ -609,8 +630,8 @@
int num = GameSchemes->findText(scheme);
if (num != -1)
GameSchemes->setCurrentIndex(num);
- else
- GameSchemes->setCurrentIndex(GameSchemes->findText("Default"));
+ //else
+ // GameSchemes->setCurrentIndex(GameSchemes->findText("Default"));
}
if (weapons == "locked")
@@ -624,8 +645,8 @@
int num = WeaponsName->findText(weapons);
if (num != -1)
WeaponsName->setCurrentIndex(num);
- else
- WeaponsName->setCurrentIndex(WeaponsName->findText("Default"));
+ //else
+ // WeaponsName->setCurrentIndex(WeaponsName->findText("Default"));
}
if (scheme != "locked" && weapons != "locked")
@@ -639,6 +660,14 @@
WeaponsName->setEnabled(true);
bindEntries->setEnabled(true);
}
+ if (!index)
+ {
+ pMapContainer->setScript(QString(""), QString(""));
+ }
+ else
+ {
+ pMapContainer->setScript(Scripts->itemData(index, GameStyleModel::ScriptRole).toString().toUtf8(), schemeData(43).toString());
+ }
emit paramChanged("SCRIPT", QStringList(name));
}
@@ -652,6 +681,11 @@
emit paramChanged("MAZE_SIZE", QStringList(QString::number(s)));
}
+void GameCFGWidget::slMapFeatureSizeChanged(int s)
+{
+ emit paramChanged("FEATURE_SIZE", QStringList(QString::number(s)));
+}
+
void GameCFGWidget::resendSchemeData()
{
schemeChanged(GameSchemes->currentIndex());
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/gamecfgwidget.h
--- a/QTfrontend/ui/widget/gamecfgwidget.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/gamecfgwidget.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GAMECONFIGWIDGET_H
@@ -48,7 +48,6 @@
QComboBox * GameSchemes;
QComboBox * WeaponsName;
HWMapContainer* pMapContainer;
- QTableView * tv;
QVariant schemeData(int column) const;
bool isMaster();
@@ -77,6 +76,7 @@
void jumpToWeapons();
void mapgenChanged(MapGenerator m);
void maze_sizeChanged(int s);
+ void slMapFeatureSizeChanged(int s);
void onDrawnMapChanged(const QByteArray & data);
void updateModelViews();
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/hatbutton.cpp
--- a/QTfrontend/ui/widget/hatbutton.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/hatbutton.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/hatbutton.h
--- a/QTfrontend/ui/widget/hatbutton.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/hatbutton.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef HATBUTTON_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/hatprompt.cpp
--- a/QTfrontend/ui/widget/hatprompt.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/hatprompt.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/hatprompt.h
--- a/QTfrontend/ui/widget/hatprompt.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/hatprompt.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef HATPROMPT_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/hedgehogerWidget.cpp
--- a/QTfrontend/ui/widget/hedgehogerWidget.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/hedgehogerWidget.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2008 Ulyanov Igor
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "hedgehogerWidget.h"
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/hedgehogerWidget.h
--- a/QTfrontend/ui/widget/hedgehogerWidget.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/hedgehogerWidget.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,7 +1,7 @@
/*
* Hedgewars, a free turn based strategy game
* Copyright (c) 2006-2007 Ulyanov Igor
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _HEDGEHOGER_WIDGET
@@ -46,7 +46,6 @@
private:
CHedgehogerWidget();
- FrameTeams* pOurFrameTeams;
};
#endif // _HEDGEHOGER_WIDGET
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/igbox.cpp
--- a/QTfrontend/ui/widget/igbox.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/igbox.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/igbox.h
--- a/QTfrontend/ui/widget/igbox.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/igbox.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _IGBOX_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/itemNum.cpp
--- a/QTfrontend/ui/widget/itemNum.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/itemNum.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "itemNum.h"
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/itemNum.h
--- a/QTfrontend/ui/widget/itemNum.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/itemNum.h Tue Nov 10 20:43:13 2015 +0100
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/keybinder.cpp
--- a/QTfrontend/ui/widget/keybinder.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/keybinder.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "keybinder.h"
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/keybinder.h
--- a/QTfrontend/ui/widget/keybinder.h Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/keybinder.h Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _KEY_BINDER_H
diff -r 31570b766315 -r ed5a6478e710 QTfrontend/ui/widget/lineeditcursor.cpp
--- a/QTfrontend/ui/widget/lineeditcursor.cpp Tue Nov 10 18:16:35 2015 +0100
+++ b/QTfrontend/ui/widget/lineeditcursor.cpp Tue Nov 10 20:43:13 2015 +0100
@@ -1,6 +1,6 @@
/*
* Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2013 Andrey Korotaev
+ * Copyright (c) 2004-2015 Andrey Korotaev