diff --git a/.gitignore b/.gitignore
index 2e433858..3066e642 100755
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,8 @@
/DGEngine
/DIABDAT
/DIABDAT.*
+/FFMPEG*
+/FFmpeg*
/gamefiles.zip
/gamefilesd.zip
/gamefilesd/res/icon.png
diff --git a/BUILD.txt b/BUILD.txt
index a26c9b17..6ed71197 100755
--- a/BUILD.txt
+++ b/BUILD.txt
@@ -1,7 +1,7 @@
Windows
-To compile in Windows, you need Visual Studio 2015, since this project
-uses C++ features that are present only in VS2015.
+To compile in Windows, you need Visual Studio 2017, since this project
+uses C++ features that are present only in VS2017.
The provided project expects the following folders in the root of the
project to build properly.
@@ -11,8 +11,11 @@ project to build properly.
/SFML - http://www.sfml-dev.org/files/SFML-2.3.2-windows-vc14-32-bit.zip
-/sfeMovie - https://github.com/Yalir/sfeMovie/tree/feature/OpenFromStream
- Use this branch of sfeMovie that has OpenFromStream.
+/FFmpeg - http://ffmpeg.zeranoe.com/builds/
+ Get both 32 bit shared and dev packages (version 2.x or 3.x)
+
+DGEngine now bundles a modified version of sfeMovie (no subtitle support,
+FFmpeg 3.x API suport), so you only need FFmpeg >= 2.8 now.
If you want to skip movie playback support, use the preprocessor define
USE_SFML_MOVIE_STUB which uses a stub class that does nothing instead.
@@ -22,15 +25,13 @@ sfeMovie with OpenFromStream support installed. Use this to fix that.
To prevent missing DLL errors when running from Visual Studio,
place the following in the root of the project:
-avcodec-56.dll (sfeMovie)
-avdevice-56.dll (sfeMovie)
-avfilter-5.dll (sfeMovie)
-avformat-56.dll (sfeMovie)
-avutil-54.dll (sfeMovie)
+avcodec-56.dll (FFmpeg 2)
+avdevice-56.dll (FFmpeg 2)
+avfilter-5.dll (FFmpeg 2)
+avformat-56.dll (FFmpeg 2)
+avutil-54.dll (FFmpeg 2)
openal32.dll (SFML)
physfs.dll (PhysicsFS)
-sfeMovie-d.dll (sfeMovie)
-sfeMovie.dll (sfeMovie)
sfml-audio-2.dll (SFML)
sfml-audio-d-2.dll (SFML)
sfml-graphics-2.dll (SFML)
@@ -41,8 +42,8 @@ sfml-system-2.dll (SFML)
sfml-system-d-2.dll (SFML)
sfml-window-2.dll (SFML)
sfml-window-d-2.dll (SFML)
-swresample-1.dll (sfeMovie)
-swscale-3.dll (sfeMovie)
+swresample-1.dll (FFmpeg 2)
+swscale-3.dll (FFmpeg 2)
Linux
@@ -52,15 +53,20 @@ and to have both PhysicsFS and SFML installed.
sudo apt-get install libphysfs-dev
sudo apt-get install libsfml-dev
-You also need to use the preprocessor define USE_SFML_MOVIE_STUB to skip
-movie support. You can try to get it to use sfeMovie for Linux on your own.
-The provided CMake project does this by default.
+Optional (for movie support) FFmpeg:
+
+sudo apt-get install libavdevice-dev libavformat-dev libavfilter-dev libavcodec-dev libswscale-dev libavutil-dev
+
+Movie support is enabled by default (CMake), unless FFmpeg isn't found.
+In CMake, set DGENGINE_MOVIE_SUPPORT to FALSE to skip movie support.
CMake
-A CMake project file is provided. It doesn't add video playback support.
+A CMake project file is provided. Movie support is enabled by default.
It will generate a project to compile on the target platform.
cmake CMakeLists.txt
+cmake CMakeLists.txt -DDGENGINE_MOVIE_SUPPORT:BOOL=FALSE
Both PhysicsFS and SFML must be installed.
+FFmpeg is also required for movie support.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5aba6e5f..08e3f179 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,9 +2,27 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
project(DGEngine)
-include_directories(./src)
+if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+ message(FATAL_ERROR "GCC 5.0+ is required")
+ endif()
-add_definitions(-DUSE_SFML_MOVIE_STUB)
+ if(NOT BEOS)
+ add_definitions(-Wall)
+ endif()
+endif()
+
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")
+
+option(DGENGINE_MOVIE_SUPPORT "Enable Movie support" TRUE)
+
+if(DGENGINE_MOVIE_SUPPORT)
+ find_package(FFmpeg COMPONENTS avcodec avformat avutil swscale)
+endif()
+find_package(PhysFS REQUIRED)
+find_package(SFML 2.3 REQUIRED system window graphics network audio)
+
+include_directories(./src)
set(SOURCE_FILES
src/Main.cpp
@@ -84,11 +102,14 @@ set(SOURCE_FILES
src/StringText.h
src/Text2.cpp
src/Text2.h
+ src/TextUtils.cpp
+ src/TextUtils.h
src/TileSet.cpp
src/TileSet.h
src/UIObject.h
src/Utils.cpp
src/Utils.h
+ src/UIText.h
src/Variable.cpp
src/Variable.h
src/Variant.h
@@ -123,6 +144,7 @@ set(SOURCE_FILES
src/Actions/ActSound.h
src/Actions/ActText.h
src/Actions/ActTexture.h
+ src/Actions/ActUIText.h
src/Actions/ActVariable.h
src/Actions/ActVisibility.h
src/Game/CelLevelObject.cpp
@@ -261,6 +283,7 @@ set(SOURCE_FILES
src/Parser/Utils/ParseUtilsVal.h
src/Predicates/Predicate.h
src/Predicates/PredIO.h
+ src/Predicates/PredItem.h
src/Predicates/PredPlayer.h
src/rapidjson/allocators.h
src/rapidjson/document.h
@@ -304,28 +327,47 @@ set(SOURCE_FILES
src/variant/variant_visitor.hpp
)
-add_executable(${PROJECT_NAME} ${SOURCE_FILES})
+if(FFmpeg_FOUND)
+ SET(SOURCE_FILES ${SOURCE_FILES}
+ src/sfeMovie/AudioStream.cpp
+ src/sfeMovie/AudioStream.hpp
+ src/sfeMovie/Demuxer.cpp
+ src/sfeMovie/Demuxer.hpp
+ src/sfeMovie/Macros.cpp
+ src/sfeMovie/Macros.hpp
+ src/sfeMovie/Movie.cpp
+ src/sfeMovie/Movie.hpp
+ src/sfeMovie/MovieImpl.cpp
+ src/sfeMovie/MovieImpl.hpp
+ src/sfeMovie/Stream.cpp
+ src/sfeMovie/Stream.hpp
+ src/sfeMovie/StreamSelection.cpp
+ src/sfeMovie/StreamSelection.hpp
+ src/sfeMovie/Timer.cpp
+ src/sfeMovie/Timer.hpp
+ src/sfeMovie/TimerPriorities.cpp
+ src/sfeMovie/TimerPriorities.hpp
+ src/sfeMovie/Utilities.cpp
+ src/sfeMovie/Utilities.hpp
+ src/sfeMovie/VideoStream.cpp
+ src/sfeMovie/VideoStream.hpp
+ )
+else()
+ add_definitions(-DUSE_SFML_MOVIE_STUB)
+endif()
-if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
- if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
- message(FATAL_ERROR "GCC 5.0+ is required")
- endif()
+add_executable(${PROJECT_NAME} ${SOURCE_FILES})
- if(NOT BEOS)
- add_definitions(-Wall)
- endif()
+if(FFmpeg_FOUND)
+ include_directories(${FFmpeg_INCLUDES})
+ target_link_libraries(${PROJECT_NAME} ${FFmpeg_LIBRARIES})
endif()
-# Detect and add PhysFS
-find_package(PhysFS REQUIRED)
if(PHYSFS_FOUND)
- include_directories(${PHYSFS_INCLUDE_DIRS})
- target_link_libraries(${PROJECT_NAME} ${PHYSFS_LIBRARY})
+ include_directories(${PHYSFS_INCLUDE_DIRS})
+ target_link_libraries(${PROJECT_NAME} ${PHYSFS_LIBRARY})
endif()
-# Detect and add SFML
-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
-find_package(SFML 2.3 REQUIRED system window graphics network audio)
if(SFML_FOUND)
include_directories(${SFML_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${SFML_LIBRARIES})
diff --git a/DGEngine.vcxproj b/DGEngine.vcxproj
index b0c6daf7..9b8c39f2 100755
--- a/DGEngine.vcxproj
+++ b/DGEngine.vcxproj
@@ -116,11 +116,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -155,6 +167,7 @@
+
@@ -246,10 +259,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -277,8 +302,10 @@
+
+
@@ -358,30 +385,30 @@
- Level4
Disabled
true
- .\src;.\SFML\include;.\PhysicsFS\src;.\sfeMovie\debug\include;%(AdditionalIncludeDirectories)
+ .\src;.\SFML\include;.\PhysicsFS\src;.\FFmpeg\include;%(AdditionalIncludeDirectories)
+ Level3
true
- freetype.lib;jpeg.lib;openal32.lib;sfml-audio-d.lib;sfml-graphics-d.lib;sfml-main-d.lib;sfml-network-d.lib;sfml-system-d.lib;sfml-window-d.lib;physfs.lib;sfeMovie-d.lib;%(AdditionalDependencies)
- .\SFML\lib;.\PhysicsFS\MinSizeRel;.\sfeMovie\debug\lib;%(AdditionalLibraryDirectories)
+ freetype.lib;jpeg.lib;openal32.lib;sfml-audio-d.lib;sfml-graphics-d.lib;sfml-main-d.lib;sfml-network-d.lib;sfml-system-d.lib;sfml-window-d.lib;physfs.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies)
+ .\SFML\lib;.\PhysicsFS\MinSizeRel;.\FFmpeg\lib;%(AdditionalLibraryDirectories)
Windows
- Level4
+ Level3
Disabled
true
- .\src;.\SFML\include;.\PhysicsFS\src;.\sfeMovie\debug\include;%(AdditionalIncludeDirectories)
+ .\src;.\SFML\include;.\PhysicsFS\src;.\FFmpeg\include;%(AdditionalIncludeDirectories)
USE_SFML_MOVIE_STUB;%(PreprocessorDefinitions)
true
- freetype.lib;jpeg.lib;openal32.lib;sfml-audio-d.lib;sfml-graphics-d.lib;sfml-main-d.lib;sfml-network-d.lib;sfml-system-d.lib;sfml-window-d.lib;physfs.lib;%(AdditionalDependencies)
- .\SFML\lib;.\PhysicsFS\MinSizeRel;.\sfeMovie\debug\lib;%(AdditionalLibraryDirectories)
+ freetype.lib;jpeg.lib;openal32.lib;sfml-audio-d.lib;sfml-graphics-d.lib;sfml-main-d.lib;sfml-network-d.lib;sfml-system-d.lib;sfml-window-d.lib;physfs.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies)
+ .\SFML\lib;.\PhysicsFS\MinSizeRel;.\FFmpeg\lib;%(AdditionalLibraryDirectories)
Windows
@@ -390,72 +417,72 @@
EnableAllWarnings
Disabled
true
- .\src;.\SFML\include;.\PhysicsFS\src;.\sfeMovie\debug\include;%(AdditionalIncludeDirectories)
+ .\src;.\SFML\include;.\PhysicsFS\src;.\FFmpeg\include;%(AdditionalIncludeDirectories)
USE_SFML_MOVIE_STUB;%(PreprocessorDefinitions)
true
- freetype.lib;jpeg.lib;openal32.lib;sfml-audio-d.lib;sfml-graphics-d.lib;sfml-main-d.lib;sfml-network-d.lib;sfml-system-d.lib;sfml-window-d.lib;physfs.lib;%(AdditionalDependencies)
- .\SFML\lib;.\PhysicsFS\MinSizeRel;.\sfeMovie\debug\lib;%(AdditionalLibraryDirectories)
+ freetype.lib;jpeg.lib;openal32.lib;sfml-audio-d.lib;sfml-graphics-d.lib;sfml-main-d.lib;sfml-network-d.lib;sfml-system-d.lib;sfml-window-d.lib;physfs.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies)
+ .\SFML\lib;.\PhysicsFS\MinSizeRel;.\FFmpeg\lib;%(AdditionalLibraryDirectories)
Windows
- Level4
+ Level3
Full
true
true
true
- .\src;.\SFML\include;.\PhysicsFS\src;.\sfeMovie\release\include;%(AdditionalIncludeDirectories)
+ .\src;.\SFML\include;.\PhysicsFS\src;.\FFmpeg\include;%(AdditionalIncludeDirectories)
AnySuitable
true
true
- freetype.lib;jpeg.lib;openal32.lib;sfml-audio.lib;sfml-graphics.lib;sfml-main.lib;sfml-network.lib;sfml-system.lib;sfml-window.lib;physfs.lib;sfeMovie.lib;%(AdditionalDependencies)
- .\SFML\lib;.\PhysicsFS\MinSizeRel;.\sfeMovie\release\lib;%(AdditionalLibraryDirectories)
+ freetype.lib;jpeg.lib;openal32.lib;sfml-audio.lib;sfml-graphics.lib;sfml-main.lib;sfml-network.lib;sfml-system.lib;sfml-window.lib;physfs.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies)
+ .\SFML\lib;.\PhysicsFS\MinSizeRel;.\FFmpeg\lib;%(AdditionalLibraryDirectories)
Windows
No
- Level4
+ Level3
Full
true
true
true
- .\src;.\SFML\include;.\PhysicsFS\src;.\sfeMovie\release\include;%(AdditionalIncludeDirectories)
+ .\src;.\SFML\include;.\PhysicsFS\src;.\FFmpeg\include;%(AdditionalIncludeDirectories)
AnySuitable
USE_SFML_MOVIE_STUB;%(PreprocessorDefinitions)
true
true
- freetype.lib;jpeg.lib;openal32.lib;sfml-audio.lib;sfml-graphics.lib;sfml-main.lib;sfml-network.lib;sfml-system.lib;sfml-window.lib;physfs.lib;%(AdditionalDependencies)
- .\SFML\lib;.\PhysicsFS\MinSizeRel;.\sfeMovie\release\lib;%(AdditionalLibraryDirectories)
+ freetype.lib;jpeg.lib;openal32.lib;sfml-audio.lib;sfml-graphics.lib;sfml-main.lib;sfml-network.lib;sfml-system.lib;sfml-window.lib;physfs.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies)
+ .\SFML\lib;.\PhysicsFS\MinSizeRel;.\FFmpeg\lib;%(AdditionalLibraryDirectories)
Windows
No
- Level4
+ Level3
Full
true
true
true
- .\src;.\SFML\include;.\PhysicsFS\src;.\sfeMovie\release\include;%(AdditionalIncludeDirectories)
- SFML_STATIC;SFEMOVIE_STATIC;%(PreprocessorDefinitions)
+ .\src;.\SFML\include;.\PhysicsFS\src;.\FFmpeg\include;%(AdditionalIncludeDirectories)
+ SFML_STATIC;%(PreprocessorDefinitions)
AnySuitable
No
true
true
- flac.lib;freetype.lib;gdi32.lib;jpeg.lib;ogg.lib;openal32.lib;opengl32.lib;winmm.lib;ws2_32.lib;sfml-audio-s.lib;sfml-graphics-s.lib;sfml-main.lib;sfml-network-s.lib;sfml-system-s.lib;sfml-window-s.lib;vorbis.lib;vorbisenc.lib;vorbisfile.lib;physfs-s.lib;sfeMovie-s.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies)
- .\SFML\lib;.\PhysicsFS\MinSizeRel;.\sfeMovie\release\lib;%(AdditionalLibraryDirectories)
+ flac.lib;freetype.lib;gdi32.lib;jpeg.lib;ogg.lib;openal32.lib;opengl32.lib;winmm.lib;ws2_32.lib;sfml-audio-s.lib;sfml-graphics-s.lib;sfml-main.lib;sfml-network-s.lib;sfml-system-s.lib;sfml-window-s.lib;vorbis.lib;vorbisenc.lib;vorbisfile.lib;physfs-s.lib;avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies)
+ .\SFML\lib;.\PhysicsFS\MinSizeRel;.\FFmpeg\lib;%(AdditionalLibraryDirectories)
Windows
diff --git a/License Notes.txt b/License Notes.txt
index 5585d56d..e2ee9d79 100755
--- a/License Notes.txt
+++ b/License Notes.txt
@@ -54,6 +54,9 @@ Mapbox Variant uses the BSD license.
https://github.com/mapbox/variant/
+FindFFmpeg.cmake was taken from Dolphin that uses the GPL v2 license.
+https://github.com/dolphin-emu/dolphin
+
Small utility functions (string manipulation, etc) were taken from stackoverflow
which use the cc by-sa 3.0 license with attribution required. I will update
those functions in the future and point out the original authors in the next commits.
diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml
index fa0017b7..16cdf9da 100755
--- a/android/AndroidManifest.xml
+++ b/android/AndroidManifest.xml
@@ -5,7 +5,7 @@
android:versionName="1.0" >
-
: where to find .h
+# FFmpeg_LIBRARY_: where to find the library
+# FFmpeg_INCLUDES: aggregate all the include paths
+# FFmpeg_LIBRARIES: aggregate all the paths to the libraries
+# FFmpeg_FOUND: True if all components have been found
+#
+# This module defines the following targets, which are prefered over variables:
+#
+# FFmpeg::: Target to use directly, with include path,
+# library and dependencies set up. If you are using a static build, you are
+# responsible for adding any external dependencies (such as zlib, bzlib...).
+#
+# can be one of:
+# avcodec
+# avdevice
+# avfilter
+# avformat
+# postproc
+# swresample
+# swscale
+#
+
+set(_FFmpeg_ALL_COMPONENTS
+ avcodec
+ avdevice
+ avfilter
+ avformat
+ avutil
+ postproc
+ swresample
+ swscale
+)
+
+set(_FFmpeg_DEPS_avcodec avutil)
+set(_FFmpeg_DEPS_avdevice avcodec avformat avutil)
+set(_FFmpeg_DEPS_avfilter avutil)
+set(_FFmpeg_DEPS_avformat avcodec avutil)
+set(_FFmpeg_DEPS_postproc avutil)
+set(_FFmpeg_DEPS_swresample avutil)
+set(_FFmpeg_DEPS_swscale avutil)
+
+function(find_ffmpeg LIBNAME)
+ if(DEFINED ENV{FFMPEG_DIR})
+ set(FFMPEG_DIR $ENV{FFMPEG_DIR})
+ endif()
+
+ if(FFMPEG_DIR)
+ list(APPEND INCLUDE_PATHS
+ ${FFMPEG_DIR}
+ ${FFMPEG_DIR}/ffmpeg
+ ${FFMPEG_DIR}/lib${LIBNAME}
+ ${FFMPEG_DIR}/include/lib${LIBNAME}
+ ${FFMPEG_DIR}/include/ffmpeg
+ ${FFMPEG_DIR}/include
+ NO_DEFAULT_PATH
+ NO_CMAKE_FIND_ROOT_PATH
+ )
+ list(APPEND LIB_PATHS
+ ${FFMPEG_DIR}
+ ${FFMPEG_DIR}/lib
+ ${FFMPEG_DIR}/lib${LIBNAME}
+ NO_DEFAULT_PATH
+ NO_CMAKE_FIND_ROOT_PATH
+ )
+ else()
+ list(APPEND INCLUDE_PATHS
+ /usr/local/include/ffmpeg
+ /usr/local/include/lib${LIBNAME}
+ /usr/include/ffmpeg
+ /usr/include/lib${LIBNAME}
+ /usr/include/ffmpeg/lib${LIBNAME}
+ )
+
+ list(APPEND LIB_PATHS
+ /usr/local/lib
+ /usr/lib
+ )
+ endif()
+
+ find_path(FFmpeg_INCLUDE_${LIBNAME} lib${LIBNAME}/${LIBNAME}.h
+ HINTS ${INCLUDE_PATHS}
+ )
+
+ find_library(FFmpeg_LIBRARY_${LIBNAME} ${LIBNAME}
+ HINTS ${LIB_PATHS}
+ )
+
+ if(NOT FFMPEG_DIR AND (NOT FFmpeg_LIBRARY_${LIBNAME} OR NOT FFmpeg_INCLUDE_${LIBNAME}))
+ # Didn't find it in the usual paths, try pkg-config
+ find_package(PkgConfig QUIET)
+ pkg_check_modules(FFmpeg_PKGCONFIG_${LIBNAME} QUIET lib${LIBNAME})
+
+ find_path(FFmpeg_INCLUDE_${LIBNAME} lib${LIBNAME}/${LIBNAME}.h
+ ${FFmpeg_PKGCONFIG_${LIBNAME}_INCLUDE_DIRS}
+ )
+
+ find_library(FFmpeg_LIBRARY_${LIBNAME} ${LIBNAME}
+ ${FFmpeg_PKGCONFIG_${LIBNAME}_LIBRARY_DIRS}
+ )
+ endif()
+
+ if(FFmpeg_INCLUDE_${LIBNAME} AND FFmpeg_LIBRARY_${LIBNAME})
+ set(FFmpeg_INCLUDE_${LIBNAME} "${FFmpeg_INCLUDE_${LIBNAME}}" PARENT_SCOPE)
+ set(FFmpeg_LIBRARY_${LIBNAME} "${FFmpeg_LIBRARY_${LIBNAME}}" PARENT_SCOPE)
+ set(FFmpeg_${c}_FOUND TRUE PARENT_SCOPE)
+ if(NOT FFmpeg_FIND_QUIETLY)
+ message("-- Found ${LIBNAME}: ${FFmpeg_INCLUDE_${LIBNAME}} ${FFmpeg_LIBRARY_${LIBNAME}}")
+ endif()
+ endif()
+endfunction()
+
+foreach(c ${_FFmpeg_ALL_COMPONENTS})
+ find_ffmpeg(${c})
+endforeach()
+
+foreach(c ${_FFmpeg_ALL_COMPONENTS})
+ if(FFmpeg_${c}_FOUND)
+ list(APPEND FFmpeg_INCLUDES ${FFmpeg_INCLUDE_${c}})
+ list(APPEND FFmpeg_LIBRARIES ${FFmpeg_LIBRARY_${c}})
+
+ add_library(FFmpeg::${c} IMPORTED UNKNOWN)
+ set_target_properties(FFmpeg::${c} PROPERTIES
+ IMPORTED_LOCATION ${FFmpeg_LIBRARY_${c}}
+ INTERFACE_INCLUDE_DIRECTORIES ${FFmpeg_INCLUDE_${c}}
+ )
+ if(_FFmpeg_DEPS_${c})
+ set(deps)
+ foreach(dep ${_FFmpeg_DEPS_${c}})
+ list(APPEND deps FFmpeg::${dep})
+ endforeach()
+
+ set_target_properties(FFmpeg::${c} PROPERTIES
+ INTERFACE_LINK_LIBRARIES "${deps}"
+ )
+ unset(deps)
+ endif()
+ endif()
+endforeach()
+
+if(FFmpeg_INCLUDES)
+ list(REMOVE_DUPLICATES FFmpeg_INCLUDES)
+endif()
+
+foreach(c ${FFmpeg_FIND_COMPONENTS})
+ list(APPEND _FFmpeg_REQUIRED_VARS FFmpeg_INCLUDE_${c} FFmpeg_LIBRARY_${c})
+endforeach()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(FFmpeg
+ REQUIRED_VARS ${_FFmpeg_REQUIRED_VARS}
+ HANDLE_COMPONENTS
+)
+
+foreach(c ${_FFmpeg_ALL_COMPONENTS})
+ unset(_FFmpeg_DEPS_${c})
+endforeach()
+unset(_FFmpeg_ALL_COMPONENTS)
+unset(_FFmpeg_REQUIRED_VARS)
diff --git a/gamefilesd/level/afterLevelLoad.json b/gamefilesd/level/afterLevelLoad.json
index 27bb8bbf..e2d09152 100755
--- a/gamefilesd/level/afterLevelLoad.json
+++ b/gamefilesd/level/afterLevelLoad.json
@@ -2,11 +2,21 @@
"action": [
{
"name": "if.notEqual",
- "param1": "|currentLevel|name|",
- "param2": "Town Center",
+ "param1": "{1}",
+ "param2": "town",
"then": { "name": "player.setRestStatus", "status": 1 },
"else": { "name": "player.setRestStatus", "status": 0 }
},
- "updatePlayerTexture"
- ]
+ "updateLifeManaOrbs",
+ "updatePlayerTexture",
+ {
+ "name": "if.equal",
+ "param1": "{2}",
+ "param2": "positionPlayer",
+ "then": { "name": "load", "file": ["level/positionPlayer.json", "{3}"] }
+ }
+ ],
+ "load": "ui/level/char/updateVisiblePanels.json",
+ "load": "level/playOrStopMusic.json",
+ "load": ["level/setMapAction.json", "{1}"]
}
\ No newline at end of file
diff --git a/gamefilesd/level/item/amulets.json b/gamefilesd/level/item/amulets.json
index cc69a49e..2d13d850 100755
--- a/gamefilesd/level/item/amulets.json
+++ b/gamefilesd/level/item/amulets.json
@@ -19,10 +19,12 @@
"formulas": {
"sell": "price * 0.25"
},
- "description1": "indestructible",
- "description2": "magic1",
- "description3": "magic2",
- "description4": "noAttributes",
+ "descriptions": [
+ { "index": 0, "name": "indestructible" },
+ { "index": 1, "name": "magic" },
+ { "index": 2, "name": "magic", "skip": 1 },
+ { "index": 3, "name": "noAttributes" }
+ ],
"inventorySize": [1, 1],
"actions": {
"action": "pickItemInLevel",
diff --git a/gamefilesd/level/item/armors.json b/gamefilesd/level/item/armors.json
index 7694a229..6a7ffc81 100755
--- a/gamefilesd/level/item/armors.json
+++ b/gamefilesd/level/item/armors.json
@@ -290,9 +290,11 @@
"celIndexInventory": {3},
"name": "Arkaine's Valor",
"shortName": "Arkaine's Valor",
- "description2": "unique",
- "description3": null,
- "description5": "arkanesValor",
+ "descriptions": [
+ { "index": 1, "name": "unique" },
+ { "index": 2, "name": null },
+ { "index": 4, "name": "arkanesValor" }
+ ],
"defaults": {
"price": 42000,
"armor": 25,
diff --git a/gamefilesd/level/item/baseItems.json b/gamefilesd/level/item/baseItems.json
index 8c425bbc..3dc6594c 100755
--- a/gamefilesd/level/item/baseItems.json
+++ b/gamefilesd/level/item/baseItems.json
@@ -16,10 +16,12 @@
"formulas": {
"sell": "price * 0.25"
},
- "description1": "armor",
- "description2": "magic1",
- "description3": "magic2",
- "description4": "required",
+ "descriptions": [
+ { "index": 0, "name": "armor" },
+ { "index": 1, "name": "magic" },
+ { "index": 2, "name": "magic", "skip": 1 },
+ { "index": 3, "name": "required" }
+ ],
"inventorySize": [2, 3],
"actions": {
"action": "pickItemInLevel",
@@ -46,10 +48,12 @@
"formulas": {
"sell": "price * 0.25"
},
- "description1": "weapon",
- "description2": "magic1",
- "description3": "magic2",
- "description4": "required",
+ "descriptions": [
+ { "index": 0, "name": "weapon" },
+ { "index": 1, "name": "magic" },
+ { "index": 2, "name": "magic", "skip": 1 },
+ { "index": 3, "name": "required" }
+ ],
"inventorySize": [2, 3],
"actions": {
"action": "pickItemInLevel",
diff --git a/gamefilesd/level/item/books.json b/gamefilesd/level/item/books.json
index 7a4ff72c..24723890 100755
--- a/gamefilesd/level/item/books.json
+++ b/gamefilesd/level/item/books.json
@@ -16,7 +16,10 @@
"formulas": {
"sell": "price * 0.25"
},
- "description1": "rightClickToRead",
+ "descriptions": [
+ { "index": 0, "name": "rightClickToRead" },
+ { "index": 1, "name": "required" }
+ ],
"inventorySize": [2, 2],
"actions": {
"action": "pickItemInLevel",
diff --git a/gamefilesd/level/item/bows.json b/gamefilesd/level/item/bows.json
index 364f811e..8ef6a7e7 100755
--- a/gamefilesd/level/item/bows.json
+++ b/gamefilesd/level/item/bows.json
@@ -18,7 +18,7 @@
"durability": 30,
"durabilityMax": 30
},
- "description4": "requiredStrDex",
+ "descriptions": { "index": 3, "name": "requiredStrDex" },
"inventorySize": [2, 3],
"actions": {
"levelDrop": { "name": "sound.play", "id": "flipbow" },
diff --git a/gamefilesd/level/item/descriptions.json b/gamefilesd/level/item/descriptions.json
index 6773d8af..0d83be58 100755
--- a/gamefilesd/level/item/descriptions.json
+++ b/gamefilesd/level/item/descriptions.json
@@ -15,83 +15,157 @@
"names": "Indestructible"
},
{
- "id": "magic1",
+ "id": "magic",
"names": [
{
"property": "identified",
"value": { "min": false, "max": false, "text": "Not Identified" }
},
{
- "property": "strength",
- "value": { "text": "+%strength% to Strength" }
+ "property": "identified",
+ "value": { "min": false, "max": false, "text": "" }
},
{
- "property": "magic",
- "value": { "text": "+%magic% to Magic" }
+ "property": "magical",
+ "value": { "min": false, "max": false, "text": "" }
},
{
- "property": "dexterity",
- "value": { "text": "+%dexterity% to Dexterity" }
+ "property": "resistAll",
+ "value": [
+ { "min": "min", "max": -1, "text": "Resist All : -%resistAll%%" },
+ { "min": 1, "max": "max", "text": "Resist All : +%resistAll%%" }
+ ]
},
{
- "property": "vitality",
- "value": { "text": "+%vitality% to Vitality" }
- }
- ]
- },
- {
- "id": "magic2",
- "names": [
+ "property": "resistMagic",
+ "value": [
+ { "min": "min", "max": -1, "text": "Resist Magic : -%resistMagic%%" },
+ { "min": 1, "max": "max", "text": "Resist Magic : +%resistMagic%%" }
+ ]
+ },
{
- "property": "magical",
- "value": { "min": false, "max": false, "text": "" }
+ "property": "resistFire",
+ "value": [
+ { "min": "min", "max": -1, "text": "Resist Fire : -%resistFire%%" },
+ { "min": 1, "max": "max", "text": "Resist Fire : +%resistFire%%" }
+ ]
},
{
- "property": "identified",
- "value": { "min": false, "max": false, "text": "" }
+ "property": "resistLightning",
+ "value": [
+ { "min": "min", "max": -1, "text": "Resist Lightning : -%resistLightning%%" },
+ { "min": 1, "max": "max", "text": "Resist Lightning : +%resistLightning%%" }
+ ]
},
{
"property": "toDamage",
- "value": { "text": "+%toDamage% to Damage" }
- }
- ]
- },
- {
- "id": "noAttributes",
- "names": "No Required Attributes"
- },
- {
- "id": "potion",
- "names": [
+ "value": [
+ { "min": "min", "max": -1, "text": "-%toDamage%% to Damage" },
+ { "min": 1, "max": "max", "text": "+%toDamage%% to Damage" }
+ ]
+ },
+ {
+ "property": "toHit",
+ "value": [
+ { "min": "min", "max": -1, "text": "Chance to Hit : -%toHit%%" },
+ { "min": 1, "max": "max", "text": "Chance to Hit : +%toHit%%" }
+ ]
+ },
+ {
+ "property": "toArmor",
+ "value": [
+ { "min": "min", "max": -1, "text": "-%toArmor%% Armor" },
+ { "min": 1, "max": "max", "text": "+%toArmor%% Armor" }
+ ]
+ },
{
"property": "life",
"value": [
- { "min": "min", "max": -1000, "text": "Kill Player" },
- { "min": -1000, "max": -1, "text": "Steal Life" },
- { "min": 1, "max": 1000, "text": "Recover Life" },
- { "min": 1000, "max": "max", "text": "Fully Recover Life" }
+ { "min": "min", "max": -1, "text": "Hit Points : -%life%" },
+ { "min": 1, "max": "max", "text": "Hit Points : +%life%" }
]
},
{
"property": "mana",
"value": [
- { "min": "min", "max": -1000, "text": "Remove All Mana" },
- { "min": -1000, "max": -1, "text": "Steal Mana" },
- { "min": 1, "max": 1000, "text": "Recover Mana" },
- { "min": 1000, "max": "max", "text": "Fully Recover Mana" }
+ { "min": "min", "max": -1, "text": "Mana : -%mana%" },
+ { "min": 1, "max": "max", "text": "Mana : +%mana%" }
+ ]
+ },
+ {
+ "property": "damage",
+ "value": [
+ { "min": "min", "max": -2, "text": "Removes %damage% Points from Damage" },
+ { "min": -1, "max": -1, "text": "Removes %damage% Point from Damage" },
+ { "min": 1, "max": 1, "text": "Adds %damage% Point to Damage" },
+ { "min": 2, "max": "max", "text": "Adds %damage% Points to Damage" }
+ ]
+ },
+ {
+ "property": "allAttributes",
+ "value": [
+ { "min": "min", "max": -1, "text": "-%allAttributes%% to All Attributes" },
+ { "min": 1, "max": "max", "text": "+%allAttributes%% to All Attributes" }
]
},
{
- "property": "lifeAndMana",
+ "property": "strength",
+ "value": [
+ { "min": "min", "max": -1, "text": "-%strength% to Strength" },
+ { "min": 1, "max": "max", "text": "+%strength% to Strength" }
+ ]
+ },
+ {
+ "property": "magic",
+ "value": [
+ { "min": "min", "max": -1, "text": "-%magic% to Magic" },
+ { "min": 1, "max": "max", "text": "+%magic% to Magic" }
+ ]
+ },
+ {
+ "property": "dexterity",
"value": [
- { "min": "min", "max": -1000, "text": "Remove All Life And Mana" },
- { "min": -1000, "max": -1, "text": "Steal Life And Mana" },
- { "min": 1, "max": 1000, "text": "Recover Life And Mana" },
- { "min": 1000, "max": "max", "text": "Fully Recover Life And Mana" }
+ { "min": "min", "max": -1, "text": "-%dexterity% to Dexterity" },
+ { "min": 1, "max": "max", "text": "+%dexterity% to Dexterity" }
+ ]
+ },
+ {
+ "property": "vitality",
+ "value": [
+ { "min": "min", "max": -1, "text": "-%vitality% to Vitality" },
+ { "min": 1, "max": "max", "text": "+%vitality% to Vitality" }
]
}
]
},
+ {
+ "id": "noAttributes",
+ "names": "No Required Attributes"
+ },
+ {
+ "id": "potionOfHealing",
+ "names": "Recover Life"
+ },
+ {
+ "id": "potionOfMana",
+ "names": "Recover Mana"
+ },
+ {
+ "id": "potionOfFullHealing",
+ "names": "Fully Recover Life"
+ },
+ {
+ "id": "potionOfFullMana",
+ "names": "Fully Recover Mana"
+ },
+ {
+ "id": "potionOfRejuvenation",
+ "names": "Recover Life And Mana"
+ },
+ {
+ "id": "potionOfFullRejuvenation",
+ "names": "Fully Recover Life And Mana"
+ },
{
"id": "required",
"names": [
diff --git a/gamefilesd/level/item/potions.json b/gamefilesd/level/item/potions.json
index 9f4dfa7b..c275d95f 100755
--- a/gamefilesd/level/item/potions.json
+++ b/gamefilesd/level/item/potions.json
@@ -21,8 +21,10 @@
"value": "$bonusLife * $life * 0.125",
"valueMax": "$bonusLife * 3 * $life * 0.125"
},
- "description1": "potion",
- "description2": "rightClickToUse",
+ "descriptions": [
+ { "index": 0, "name": "potionOfHealing" },
+ { "index": 1, "name": "rightClickToUse" }
+ ],
"inventorySize": [1, 1],
"actions": {
"action": "pickItemInLevel",
@@ -49,7 +51,8 @@
"formulas": {
"value": "$bonusMana * $mana * 0.125",
"valueMax": "$bonusMana * 3 * $mana * 0.125"
- }
+ },
+ "descriptions": { "index": 0, "name": "potionOfMana" }
},
{
"id": "potionOfFullHealing",
@@ -68,7 +71,8 @@
"formulas": {
"value": 0,
"valueMax": null
- }
+ },
+ "descriptions": { "index": 0, "name": "potionOfFullHealing" }
},
{
"id": "potionOfFullMana",
@@ -83,7 +87,8 @@
"price": 150,
"useOn": "manaDamage",
"useOp": "="
- }
+ },
+ "descriptions": { "index": 0, "name": "potionOfFullMana" }
},
{
"id": "potionOfRejuvenation",
@@ -103,7 +108,8 @@
"valueMax": "$bonusLife * 3 * $life * 0.125",
"value2": "$bonusMana * $mana * 0.125",
"value2Max": "$bonusMana * 3 * $mana * 0.125"
- }
+ },
+ "descriptions": { "index": 0, "name": "potionOfRejuvenation" }
},
{
"id": "potionOfFullRejuvenation",
@@ -120,7 +126,8 @@
},
"formulas": {
"value2": 0
- }
+ },
+ "descriptions": { "index": 0, "name": "potionOfFullRejuvenation" }
},
{
"id": "spectralElixir",
@@ -139,8 +146,11 @@
"formulas": {
"value": 3
},
- "description1": "",
- "description2": ""
+ "descriptions": [
+ { "index": 0, "name": "" },
+ { "index": 1, "name": "" },
+ { "index": 3, "name": "" }
+ ]
}
]
}
\ No newline at end of file
diff --git a/gamefilesd/level/item/prefixes.json b/gamefilesd/level/item/prefixes.json
index f737c10c..9d3e9dbc 100755
--- a/gamefilesd/level/item/prefixes.json
+++ b/gamefilesd/level/item/prefixes.json
@@ -38,7 +38,7 @@
]
},
{
- "property": "armor",
+ "property": "toArmor",
"value": [
{ "min": "min", "max": -51, "text": "Vulnerable" },
{ "min": -50, "max": -25, "text": "Rusted" },
@@ -53,6 +53,46 @@
{ "min": 151, "max": 170, "text": "Holy" },
{ "min": 171, "max": "max", "text": "Godly" }
]
+ },
+ {
+ "property": "resistAll",
+ "value": [
+ { "min": 10, "max": 15, "text": "Topaz" },
+ { "min": 16, "max": 20, "text": "Amber" },
+ { "min": 21, "max": 30, "text": "Jade" },
+ { "min": 31, "max": 40, "text": "Obsidian" },
+ { "min": 41, "max": "max", "text": "Emerald" }
+ ]
+ },
+ {
+ "property": "resistMagic",
+ "value": [
+ { "min": 10, "max": 20, "text": "White" },
+ { "min": 21, "max": 30, "text": "Pearl" },
+ { "min": 31, "max": 40, "text": "Ivory" },
+ { "min": 41, "max": 50, "text": "Crystal" },
+ { "min": 51, "max": "max", "text": "Diamond" }
+ ]
+ },
+ {
+ "property": "resistFire",
+ "value": [
+ { "min": 10, "max": 20, "text": "Red" },
+ { "min": 21, "max": 30, "text": "Crimson" },
+ { "min": 31, "max": 40, "text": "Burgundy" },
+ { "min": 41, "max": 50, "text": "Garnet" },
+ { "min": 51, "max": "max", "text": "Ruby" }
+ ]
+ },
+ {
+ "property": "resistLightning",
+ "value": [
+ { "min": 10, "max": 20, "text": "Blue" },
+ { "min": 21, "max": 30, "text": "Azure" },
+ { "min": 31, "max": 40, "text": "Lapis" },
+ { "min": 41, "max": 50, "text": "Cobalt" },
+ { "min": 51, "max": "max", "text": "Sapphire" }
+ ]
}
]
},
@@ -82,22 +122,6 @@
},
{
"property": "toHit",
- "value": [
- { "min": "min", "max": -6, "text": "Clumsy" },
- { "min": -5, "max": -1, "text": "Dull" },
- { "min": 1, "max": 5, "text": "Sharp" },
- { "min": 6, "max": 10, "text": "Fine" },
- { "min": 11, "max": 15, "text": "Warrior's" },
- { "min": 16, "max": 20, "text": "Soldier's" },
- { "min": 21, "max": 30, "text": "Lord's" },
- { "min": 31, "max": 40, "text": "Knight's" },
- { "min": 41, "max": 50, "text": "Master's" },
- { "min": 51, "max": 75, "text": "Champion's" },
- { "min": 76, "max": "max", "text": "King's" }
- ]
- },
- {
- "property": "chanceToHit",
"value": [
{ "min": "min", "max": -6, "text": "Tin" },
{ "min": -5, "max": -1, "text": "Brass" },
@@ -113,6 +137,22 @@
{ "min": 101, "max": "max", "text": "Strange" }
]
},
+ {
+ "property": "toHit",
+ "value": [
+ { "min": "min", "max": -6, "text": "Clumsy" },
+ { "min": -5, "max": -1, "text": "Dull" },
+ { "min": 1, "max": 5, "text": "Sharp" },
+ { "min": 6, "max": 10, "text": "Fine" },
+ { "min": 11, "max": 15, "text": "Warrior's" },
+ { "min": 16, "max": 20, "text": "Soldier's" },
+ { "min": 21, "max": 30, "text": "Lord's" },
+ { "min": 31, "max": 40, "text": "Knight's" },
+ { "min": 41, "max": 50, "text": "Master's" },
+ { "min": 51, "max": 75, "text": "Champion's" },
+ { "min": 76, "max": "max", "text": "King's" }
+ ]
+ },
{
"property": "resistAll",
"value": [
@@ -189,7 +229,7 @@
"id": "jewelleryPrefixes",
"names": [
{
- "property": "chanceToHit",
+ "property": "toHit",
"value": [
{ "min": "min", "max": -6, "text": "Tin" },
{ "min": -5, "max": -1, "text": "Brass" },
diff --git a/gamefilesd/level/item/scrolls.json b/gamefilesd/level/item/scrolls.json
index b92b6188..c6c15ace 100755
--- a/gamefilesd/level/item/scrolls.json
+++ b/gamefilesd/level/item/scrolls.json
@@ -16,8 +16,10 @@
"formulas": {
"sell": "price * 0.25"
},
- "description1": "rightClickToRead2",
- "description2": "required",
+ "descriptions": [
+ { "index": 0, "name": "rightClickToRead2" },
+ { "index": 1, "name": "required" }
+ ],
"inventorySize": [1, 1],
"actions": {
"action": "pickItemInLevel",
diff --git a/gamefilesd/level/item/staffs.json b/gamefilesd/level/item/staffs.json
index 16e92699..19c8f8e1 100755
--- a/gamefilesd/level/item/staffs.json
+++ b/gamefilesd/level/item/staffs.json
@@ -19,7 +19,7 @@
"durability": 25,
"durabilityMax": 25
},
- "description4": "requiredStrMag",
+ "descriptions": { "index": 3, "name": "requiredStrMag" },
"inventorySize": [2, 3],
"actions": {
"levelDrop": { "name": "sound.play", "id": "flipstaf" },
diff --git a/gamefilesd/level/item/suffixes.json b/gamefilesd/level/item/suffixes.json
index 9aacfb2e..07b3035a 100755
--- a/gamefilesd/level/item/suffixes.json
+++ b/gamefilesd/level/item/suffixes.json
@@ -4,7 +4,67 @@
"id": "armorSuffixes",
"names": [
{
- "property": "hitPoints",
+ "property": "allAttributes",
+ "value": [
+ { "min": "min", "max": -6, "text": "Of Trouble" },
+ { "min": -5, "max": -1, "text": "Of The Pit" },
+ { "min": 1, "max": 3, "text": "Of The Sky" },
+ { "min": 4, "max": 7, "text": "Of The Moon" },
+ { "min": 8, "max": 11, "text": "Of The Stars" },
+ { "min": 12, "max": 15, "text": "Of The Heavens" },
+ { "min": 16, "max": "max", "text": "Of The Zodiac" }
+ ]
+ },
+ {
+ "property": "strength",
+ "value": [
+ { "min": "min", "max": -6, "text": "Of Frailty" },
+ { "min": -5, "max": -1, "text": "Of Weakness" },
+ { "min": 1, "max": 5, "text": "Of Strength" },
+ { "min": 6, "max": 10, "text": "Of Might" },
+ { "min": 11, "max": 15, "text": "Of Power" },
+ { "min": 16, "max": 20, "text": "Of Giants" },
+ { "min": 21, "max": "max", "text": "Of Titans" }
+ ]
+ },
+ {
+ "property": "magic",
+ "value": [
+ { "min": "min", "max": -6, "text": "Of The Fool" },
+ { "min": -5, "max": -1, "text": "Of Dyslexia" },
+ { "min": 1, "max": 5, "text": "Of Magic" },
+ { "min": 6, "max": 10, "text": "Of The Mind" },
+ { "min": 11, "max": 15, "text": "Of Brilliance" },
+ { "min": 16, "max": 20, "text": "Of Sorcery" },
+ { "min": 21, "max": "max", "text": "Of Wizardry" }
+ ]
+ },
+ {
+ "property": "dexterity",
+ "value": [
+ { "min": "min", "max": -6, "text": "Of Paralysis" },
+ { "min": -5, "max": -1, "text": "Of Atrophy" },
+ { "min": -1, "max": 5, "text": "Of Dexterity" },
+ { "min": 6, "max": 10, "text": "Of Skill" },
+ { "min": 11, "max": 15, "text": "Of Accuracy" },
+ { "min": 16, "max": 20, "text": "Of Precision" },
+ { "min": 21, "max": "max", "text": "Of Perfection" }
+ ]
+ },
+ {
+ "property": "vitality",
+ "value": [
+ { "min": "min", "max": -6, "text": "Of Illness" },
+ { "min": -5, "max": -1, "text": "Of Disease" },
+ { "min": -1, "max": 5, "text": "Of Vitality" },
+ { "min": 6, "max": 10, "text": "Of Zest" },
+ { "min": 11, "max": 15, "text": "Of Vim" },
+ { "min": 16, "max": 20, "text": "Of Vigor" },
+ { "min": 21, "max": "max", "text": "Of Life" }
+ ]
+ },
+ {
+ "property": "life",
"value": [
{ "min": "min", "max": -11, "text": "Of The Vulture" },
{ "min": -10, "max": -1, "text": "Of The Jackal" },
@@ -140,6 +200,17 @@
{ "min": 5, "max": 8, "text": "Of Puncturing" },
{ "min": 9, "max": "max", "text": "Of Bashing" }
]
+ },
+ {
+ "property": "damage",
+ "value": [
+ { "min": 1, "max": 2, "text": "Of Quality" },
+ { "min": 3, "max": 5, "text": "Of Maiming" },
+ { "min": 6, "max": 8, "text": "Of Slaying" },
+ { "min": 9, "max": 12, "text": "Of Gore" },
+ { "min": 13, "max": 16, "text": "Of Carnage" },
+ { "min": 17, "max": "max", "text": "Of Slaughter" }
+ ]
}
]
},
@@ -207,7 +278,7 @@
]
},
{
- "property": "hitPoints",
+ "property": "life",
"value": [
{ "min": "min", "max": -11, "text": "Of The Vulture" },
{ "min": -10, "max": -1, "text": "Of The Jackal" },
diff --git a/gamefilesd/level/item/swords.json b/gamefilesd/level/item/swords.json
index ad9078d7..fe92d76f 100755
--- a/gamefilesd/level/item/swords.json
+++ b/gamefilesd/level/item/swords.json
@@ -18,7 +18,7 @@
"durability": 16,
"durabilityMax": 16
},
- "description4": "requiredStrDex",
+ "descriptions": { "index": 3, "name": "requiredStrDex" },
"inventorySize": [1, 2]
},
{
diff --git a/gamefilesd/level/load.json b/gamefilesd/level/load.json
index bb2c14dd..a90ccf01 100755
--- a/gamefilesd/level/load.json
+++ b/gamefilesd/level/load.json
@@ -18,17 +18,9 @@
{ "name": "load", "file": "level/{2}/sounds.json" },
{ "name": "loadingScreen.setProgress", "progress": 80 },
{ "name": "load", "file": "level/{2}/players.json" },
- { "name": "loadingScreen.setProgress", "progress": 100 },
{ "name": "load", "file": "level/{2}/music.json" },
- { "name": "if.equal",
- "param1": "{3}",
- "param2": "positionPlayer",
- "then": { "name": "load", "file": ["level/positionPlayer.json", "{4}"] }
- },
- { "name": "load", "file": "level/afterLevelLoad.json" },
- { "name": "load", "file": "ui/level/char/updateVisiblePanels.json" },
- { "name": "load", "file": "level/playOrStopMusic.json" },
- { "name": "load", "file": ["level/setMapAction.json", "{2}"] }
+ { "name": "load", "file": ["level/afterLevelLoad.json", "{2}", "{3}", "{4}"] },
+ { "name": "loadingScreen.setProgress", "progress": 100 }
]
}
]
diff --git a/gamefilesd/level/loadBase.json b/gamefilesd/level/loadBase.json
index 760e4360..cd51b5bf 100755
--- a/gamefilesd/level/loadBase.json
+++ b/gamefilesd/level/loadBase.json
@@ -38,12 +38,9 @@
{ "name": "load", "file": "level/{2}/sounds.json" },
{ "name": "loadingScreen.setProgress", "progress": 95 },
{ "name": "load", "file": "level/{2}/players.json" },
- { "name": "loadingScreen.setProgress", "progress": 100 },
- { "name": "load", "file": "level/afterLevelLoad.json" },
- { "name": "load", "file": "ui/level/char/updateVisiblePanels.json" },
{ "name": "load", "file": "level/{2}/music.json" },
- { "name": "load", "file": "level/playOrStopMusic.json" },
- { "name": "load", "file": ["level/setMapAction.json", "{2}"] }
+ { "name": "load", "file": ["level/afterLevelLoad.json", "{2}"] },
+ { "name": "loadingScreen.setProgress", "progress": 100 }
]
}
]
diff --git a/gamefilesd/level/newGame.json b/gamefilesd/level/newGame.json
index 674e3caa..6d9c36c7 100755
--- a/gamefilesd/level/newGame.json
+++ b/gamefilesd/level/newGame.json
@@ -40,12 +40,9 @@
{ "name": "load", "file": "level/town/sounds.json" },
{ "name": "loadingScreen.setProgress", "progress": 95 },
{ "name": "load", "file": "level/town/players.json" },
- { "name": "loadingScreen.setProgress", "progress": 100 },
- { "name": "load", "file": "level/afterLevelLoad.json" },
- { "name": "load", "file": "ui/level/char/updateVisiblePanels.json" },
{ "name": "load", "file": "level/town/music.json" },
- { "name": "load", "file": "level/playOrStopMusic.json" },
- { "name": "load", "file": ["level/setMapAction.json", "town"] }
+ { "name": "load", "file": ["level/afterLevelLoad.json", "town"] },
+ { "name": "loadingScreen.setProgress", "progress": 100 }
]
}
]
diff --git a/gamefilesd/level/town/players2.json b/gamefilesd/level/town/players2.json
index c407a30f..814a17b4 100755
--- a/gamefilesd/level/town/players2.json
+++ b/gamefilesd/level/town/players2.json
@@ -253,7 +253,7 @@
"index": 4,
"class": "cape",
"properties": {
- "hitPoints": 12,
+ "life": 12,
"price": 850,
"magical": true
}
diff --git a/gamefilesd/level/town/sounds.json b/gamefilesd/level/town/sounds.json
index 10783cf2..a71b78be 100755
--- a/gamefilesd/level/town/sounds.json
+++ b/gamefilesd/level/town/sounds.json
@@ -7,6 +7,7 @@
{ "id": "pegboyWelcome", "file": "sfx/Towners/Pegboy32.wav" },
{ "id": "storytWelcome", "file": "sfx/Towners/storyt25.wav" },
{ "id": "tavownWelcome", "file": "sfx/Towners/tavown36.wav" },
+ { "id": "witchWelcome", "file": "sfx/Towners/Witch38.wav" },
{ "id": "cow1", "file": "sfx/Towners/Cow1.wav" },
{ "id": "cow2", "file": "sfx/Towners/Cow2.wav" }
],
diff --git a/gamefilesd/res/level/actions.json b/gamefilesd/res/level/actions.json
index 08ccf19d..2227eda8 100755
--- a/gamefilesd/res/level/actions.json
+++ b/gamefilesd/res/level/actions.json
@@ -1,5 +1,6 @@
{
"load": "res/level/actions/sounds.json",
+ "load": "res/level/actions/resizeLevel.json",
"load": "res/level/actions/itemPanel.json",
"load": "res/level/actions/basePanel.json",
"load": "res/level/actions/charPanel.json",
diff --git a/gamefilesd/res/level/actions/basePanel.json b/gamefilesd/res/level/actions/basePanel.json
index 2ffbc85a..dcc31894 100755
--- a/gamefilesd/res/level/actions/basePanel.json
+++ b/gamefilesd/res/level/actions/basePanel.json
@@ -23,6 +23,11 @@
"id": "setPanelTextColorWhite",
"action": { "name": "text.setColor", "id": "txtPanel" }
},
+ {
+ "name": "action.set",
+ "id": "rightClickLevel",
+ "action": { "name": "drawable.executeAction", "id": "level", "action": "rightClick" }
+ },
{
"name": "action.set",
"id": "clearPanelText",
diff --git a/gamefilesd/res/level/actions/beltUse.json b/gamefilesd/res/level/actions/beltUse.json
new file mode 100755
index 00000000..c9f25fb7
--- /dev/null
+++ b/gamefilesd/res/level/actions/beltUse.json
@@ -0,0 +1,16 @@
+{
+ "action": {
+ "name": "action.set",
+ "id": "use{1}Item",
+ "action": {
+ "name": "if.equal",
+ "param1": "|currentLevel|currentPlayer.item.belt.{2}.isUsable|",
+ "param2": true,
+ "then": [
+ { "name": "item.use", "inventory": "belt", "item": {2} },
+ "updateAllPlayerStats"
+ ],
+ "else": "rightClickLevel"
+ }
+ }
+}
\ No newline at end of file
diff --git a/gamefilesd/res/level/actions/inventoryText.json b/gamefilesd/res/level/actions/inventoryText.json
index e5ade7d1..12de4e45 100755
--- a/gamefilesd/res/level/actions/inventoryText.json
+++ b/gamefilesd/res/level/actions/inventoryText.json
@@ -16,14 +16,14 @@
"param": "|currentLevel|currentPlayer.item.{2}.{3}.itemType|",
"list": ["Amulet", "Ring"],
"then": {
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "txtPanel",
"query": "currentLevel.currentPlayer.item.{2}.{3}",
"text": "%name%\n%d.1%\n%d.2%",
"removeEmptyLines": true
},
"else": {
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "txtPanel",
"query": "currentLevel.currentPlayer.item.{2}.{3}",
"text": "%name%\n%d.0%\n%d.1%\n%d.2%\n%d.3%",
@@ -53,13 +53,13 @@
"then": [
"showItemInfo",
{
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "itemInfoTitle",
"query": "currentLevel.currentPlayer.item.{2}.{3}",
"text": "%name%"
},
{
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "itemInfoDescr",
"query": "currentLevel.currentPlayer.item.{2}.{3}",
"text": "%d.4%"
diff --git a/gamefilesd/res/level/actions/inventoryUse.json b/gamefilesd/res/level/actions/inventoryUse.json
deleted file mode 100755
index f6c6881b..00000000
--- a/gamefilesd/res/level/actions/inventoryUse.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "action": {
- "name": "action.set",
- "id": "use{1}Item",
- "action": [
- { "name": "item.use", "inventory": "{2}", "item": {3} },
- "updateAllPlayerStats"
- ]
- }
-}
\ No newline at end of file
diff --git a/gamefilesd/res/level/actions/playerBeltUse.json b/gamefilesd/res/level/actions/playerBeltUse.json
index 1d2ac1cb..e61f702e 100755
--- a/gamefilesd/res/level/actions/playerBeltUse.json
+++ b/gamefilesd/res/level/actions/playerBeltUse.json
@@ -1,10 +1,10 @@
{
- "load": ["res/level/actions/inventoryUse.json", "Belt1", "belt", 0],
- "load": ["res/level/actions/inventoryUse.json", "Belt2", "belt", 1],
- "load": ["res/level/actions/inventoryUse.json", "Belt3", "belt", 2],
- "load": ["res/level/actions/inventoryUse.json", "Belt4", "belt", 3],
- "load": ["res/level/actions/inventoryUse.json", "Belt5", "belt", 4],
- "load": ["res/level/actions/inventoryUse.json", "Belt6", "belt", 5],
- "load": ["res/level/actions/inventoryUse.json", "Belt7", "belt", 6],
- "load": ["res/level/actions/inventoryUse.json", "Belt8", "belt", 7]
+ "load": ["res/level/actions/beltUse.json", "Belt1", 0],
+ "load": ["res/level/actions/beltUse.json", "Belt2", 1],
+ "load": ["res/level/actions/beltUse.json", "Belt3", 2],
+ "load": ["res/level/actions/beltUse.json", "Belt4", 3],
+ "load": ["res/level/actions/beltUse.json", "Belt5", 4],
+ "load": ["res/level/actions/beltUse.json", "Belt6", 5],
+ "load": ["res/level/actions/beltUse.json", "Belt7", 6],
+ "load": ["res/level/actions/beltUse.json", "Belt8", 7]
}
\ No newline at end of file
diff --git a/gamefilesd/res/level/actions/playerBodyHands2.json b/gamefilesd/res/level/actions/playerBodyHands2.json
index 196108aa..38e65ad0 100755
--- a/gamefilesd/res/level/actions/playerBodyHands2.json
+++ b/gamefilesd/res/level/actions/playerBodyHands2.json
@@ -13,14 +13,14 @@
"param": "|currentLevel|currentPlayer.item.body.LeftHand.itemType|",
"list": ["Amulet", "Ring"],
"then": {
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "txtPanel",
"query": "currentLevel.currentPlayer.item.body.LeftHand",
"text": "%name%\n%d.1%\n%d.2%",
"removeEmptyLines": true
},
"else": {
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "txtPanel",
"query": "currentLevel.currentPlayer.item.body.LeftHand",
"text": "%name%\n%d.0%\n%d.1%\n%d.2%\n%d.3%",
@@ -50,13 +50,13 @@
"then": [
"showItemInfo",
{
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "itemInfoTitle",
"query": "currentLevel.currentPlayer.item.body.LeftHand",
"text": "%name%"
},
{
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "itemInfoDescr",
"query": "currentLevel.currentPlayer.item.body.LeftHand",
"text": "%d.4%"
@@ -84,14 +84,14 @@
"param": "|currentLevel|currentPlayer.item.body.RightHand.itemType|",
"list": ["Amulet", "Ring"],
"then": {
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "txtPanel",
"query": "currentLevel.currentPlayer.item.body.RightHand",
"text": "%name%\n%d.1%\n%d.2%",
"removeEmptyLines": true
},
"else": {
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "txtPanel",
"query": "currentLevel.currentPlayer.item.body.RightHand",
"text": "%name%\n%d.0%\n%d.1%\n%d.2%\n%d.3%",
@@ -121,13 +121,13 @@
"then": [
"showItemInfo",
{
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "itemInfoTitle",
"query": "currentLevel.currentPlayer.item.body.RightHand",
"text": "%name%"
},
{
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "itemInfoDescr",
"query": "currentLevel.currentPlayer.item.body.RightHand",
"text": "%d.4%"
diff --git a/gamefilesd/res/level/actions/playerStashUse.json b/gamefilesd/res/level/actions/playerStashUse.json
index dc9fa278..c1200184 100755
--- a/gamefilesd/res/level/actions/playerStashUse.json
+++ b/gamefilesd/res/level/actions/playerStashUse.json
@@ -1,42 +1,42 @@
{
- "load": ["res/level/actions/inventoryUse.json", "Stash11", "stash", "[0,0]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash12", "stash", "[0,1]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash13", "stash", "[0,2]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash14", "stash", "[0,3]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash21", "stash", "[1,0]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash22", "stash", "[1,1]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash23", "stash", "[1,2]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash24", "stash", "[1,3]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash31", "stash", "[2,0]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash32", "stash", "[2,1]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash33", "stash", "[2,2]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash34", "stash", "[2,3]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash41", "stash", "[3,0]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash42", "stash", "[3,1]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash43", "stash", "[3,2]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash44", "stash", "[3,3]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash51", "stash", "[4,0]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash52", "stash", "[4,1]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash53", "stash", "[4,2]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash54", "stash", "[4,3]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash61", "stash", "[5,0]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash62", "stash", "[5,1]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash63", "stash", "[5,2]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash64", "stash", "[5,3]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash71", "stash", "[6,0]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash72", "stash", "[6,1]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash73", "stash", "[6,2]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash74", "stash", "[6,3]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash81", "stash", "[7,0]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash82", "stash", "[7,1]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash83", "stash", "[7,2]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash84", "stash", "[7,3]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash91", "stash", "[8,0]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash92", "stash", "[8,1]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash93", "stash", "[8,2]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash94", "stash", "[8,3]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash101", "stash", "[9,0]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash102", "stash", "[9,1]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash103", "stash", "[9,2]"],
- "load": ["res/level/actions/inventoryUse.json", "Stash104", "stash", "[9,3]"]
+ "load": ["res/level/actions/stashUse.json", "Stash11", "0,0"],
+ "load": ["res/level/actions/stashUse.json", "Stash12", "0,1"],
+ "load": ["res/level/actions/stashUse.json", "Stash13", "0,2"],
+ "load": ["res/level/actions/stashUse.json", "Stash14", "0,3"],
+ "load": ["res/level/actions/stashUse.json", "Stash21", "1,0"],
+ "load": ["res/level/actions/stashUse.json", "Stash22", "1,1"],
+ "load": ["res/level/actions/stashUse.json", "Stash23", "1,2"],
+ "load": ["res/level/actions/stashUse.json", "Stash24", "1,3"],
+ "load": ["res/level/actions/stashUse.json", "Stash31", "2,0"],
+ "load": ["res/level/actions/stashUse.json", "Stash32", "2,1"],
+ "load": ["res/level/actions/stashUse.json", "Stash33", "2,2"],
+ "load": ["res/level/actions/stashUse.json", "Stash34", "2,3"],
+ "load": ["res/level/actions/stashUse.json", "Stash41", "3,0"],
+ "load": ["res/level/actions/stashUse.json", "Stash42", "3,1"],
+ "load": ["res/level/actions/stashUse.json", "Stash43", "3,2"],
+ "load": ["res/level/actions/stashUse.json", "Stash44", "3,3"],
+ "load": ["res/level/actions/stashUse.json", "Stash51", "4,0"],
+ "load": ["res/level/actions/stashUse.json", "Stash52", "4,1"],
+ "load": ["res/level/actions/stashUse.json", "Stash53", "4,2"],
+ "load": ["res/level/actions/stashUse.json", "Stash54", "4,3"],
+ "load": ["res/level/actions/stashUse.json", "Stash61", "5,0"],
+ "load": ["res/level/actions/stashUse.json", "Stash62", "5,1"],
+ "load": ["res/level/actions/stashUse.json", "Stash63", "5,2"],
+ "load": ["res/level/actions/stashUse.json", "Stash64", "5,3"],
+ "load": ["res/level/actions/stashUse.json", "Stash71", "6,0"],
+ "load": ["res/level/actions/stashUse.json", "Stash72", "6,1"],
+ "load": ["res/level/actions/stashUse.json", "Stash73", "6,2"],
+ "load": ["res/level/actions/stashUse.json", "Stash74", "6,3"],
+ "load": ["res/level/actions/stashUse.json", "Stash81", "7,0"],
+ "load": ["res/level/actions/stashUse.json", "Stash82", "7,1"],
+ "load": ["res/level/actions/stashUse.json", "Stash83", "7,2"],
+ "load": ["res/level/actions/stashUse.json", "Stash84", "7,3"],
+ "load": ["res/level/actions/stashUse.json", "Stash91", "8,0"],
+ "load": ["res/level/actions/stashUse.json", "Stash92", "8,1"],
+ "load": ["res/level/actions/stashUse.json", "Stash93", "8,2"],
+ "load": ["res/level/actions/stashUse.json", "Stash94", "8,3"],
+ "load": ["res/level/actions/stashUse.json", "Stash101", "9,0"],
+ "load": ["res/level/actions/stashUse.json", "Stash102", "9,1"],
+ "load": ["res/level/actions/stashUse.json", "Stash103", "9,2"],
+ "load": ["res/level/actions/stashUse.json", "Stash104", "9,3"]
}
\ No newline at end of file
diff --git a/gamefilesd/res/level/actions/playerUpdate.json b/gamefilesd/res/level/actions/playerUpdate.json
index 5164d0b8..6b1bc7dc 100755
--- a/gamefilesd/res/level/actions/playerUpdate.json
+++ b/gamefilesd/res/level/actions/playerUpdate.json
@@ -5,32 +5,78 @@
"id": "updateLifeManaOrbs",
"action": [
{
- "name": "drawable.resizeY",
- "id": "lifeOrbEmpty",
- "size": "|currentLevel|currentPlayer.lifeDamage|",
- "inputRangeMax": "|currentLevel|currentPlayer.life|",
- "range": [0, 88]
+ "name": "<=",
+ "param1": "|currentLevel|currentPlayer.life|",
+ "param2": 0,
+ "then": [
+ {
+ "name": "drawable.resizeY",
+ "id": "lifeOrbEmpty",
+ "size": 1,
+ "inputRangeMax": 1,
+ "range": [0, 88]
+ },
+ {
+ "name": "image.inverseResizeY",
+ "id": "lifeOrbFull",
+ "size": 1,
+ "inputRangeMax": 1,
+ "range": [0, 88]
+ }
+ ],
+ "else": [
+ {
+ "name": "drawable.resizeY",
+ "id": "lifeOrbEmpty",
+ "size": "|currentLevel|currentPlayer.lifeDamage|",
+ "inputRangeMax": "|currentLevel|currentPlayer.life|",
+ "range": [0, 88]
+ },
+ {
+ "name": "image.inverseResizeY",
+ "id": "lifeOrbFull",
+ "size": "|currentLevel|currentPlayer.lifeDamage|",
+ "inputRangeMax": "|currentLevel|currentPlayer.life|",
+ "range": [0, 88]
+ }
+ ]
},
{
- "name": "image.inverseResizeY",
- "id": "lifeOrbFull",
- "size": "|currentLevel|currentPlayer.lifeDamage|",
- "inputRangeMax": "|currentLevel|currentPlayer.life|",
- "range": [0, 88]
- },
- {
- "name": "drawable.resizeY",
- "id": "manaOrbEmpty",
- "size": "|currentLevel|currentPlayer.manaDamage|",
- "inputRangeMax": "|currentLevel|currentPlayer.mana|",
- "range": [0, 88]
- },
- {
- "name": "image.inverseResizeY",
- "id": "manaOrbFull",
- "size": "|currentLevel|currentPlayer.manaDamage|",
- "inputRangeMax": "|currentLevel|currentPlayer.mana|",
- "range": [0, 88]
+ "name": "<=",
+ "param1": "|currentLevel|currentPlayer.mana|",
+ "param2": 0,
+ "then": [
+ {
+ "name": "drawable.resizeY",
+ "id": "manaOrbEmpty",
+ "size": 1,
+ "inputRangeMax": 1,
+ "range": [0, 88]
+ },
+ {
+ "name": "image.inverseResizeY",
+ "id": "manaOrbFull",
+ "size": 1,
+ "inputRangeMax": 1,
+ "range": [0, 88]
+ }
+ ],
+ "else": [
+ {
+ "name": "drawable.resizeY",
+ "id": "manaOrbEmpty",
+ "size": "|currentLevel|currentPlayer.manaDamage|",
+ "inputRangeMax": "|currentLevel|currentPlayer.mana|",
+ "range": [0, 88]
+ },
+ {
+ "name": "image.inverseResizeY",
+ "id": "manaOrbFull",
+ "size": "|currentLevel|currentPlayer.manaDamage|",
+ "inputRangeMax": "|currentLevel|currentPlayer.mana|",
+ "range": [0, 88]
+ }
+ ]
}
]
},
diff --git a/gamefilesd/res/level/actions/resizeLevel.json b/gamefilesd/res/level/actions/resizeLevel.json
new file mode 100755
index 00000000..1212b788
--- /dev/null
+++ b/gamefilesd/res/level/actions/resizeLevel.json
@@ -0,0 +1,49 @@
+{
+ "action": {
+ "name": "action.set",
+ "id": "resizeLevel",
+ "action": {
+ "name": "if.equal",
+ "param1": "|game|stretchToFit|",
+ "param2": true,
+ "then": {
+ "name": "if.equal",
+ "param1": "|game|minSize.x|",
+ "param2": 640,
+ "then": {
+ "name": "if.equal",
+ "param1": "|game|minSize.y|",
+ "param2": 480,
+ "then": {
+ "name": "if.inList",
+ "param": true,
+ "list": ["|charPanel|visible|", "|questPanel|visible|"],
+ "then": {
+ "name": "if.inList",
+ "param": true,
+ "list": ["|invPanel|visible|", "|spellPanel|visible|"],
+ "then": { "name": "drawable.setSizeX", "id": "level", "size": 0 },
+ "else": [
+ { "name": "drawable.setPositionX", "id": "level", "position": 320 },
+ { "name": "drawable.setSizeX", "id": "level", "size": 320 }
+ ]
+ },
+ "else": {
+ "name": "if.inList",
+ "param": true,
+ "list": ["|invPanel|visible|", "|spellPanel|visible|"],
+ "then": [
+ { "name": "drawable.setPositionX", "id": "level", "position": 0 },
+ { "name": "drawable.setSizeX", "id": "level", "size": 320 }
+ ],
+ "else": [
+ { "name": "drawable.setPositionX", "id": "level", "position": 0 },
+ { "name": "drawable.setSizeX", "id": "level", "size": 640 }
+ ]
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/gamefilesd/res/level/actions/stashUse.json b/gamefilesd/res/level/actions/stashUse.json
new file mode 100755
index 00000000..afb118d3
--- /dev/null
+++ b/gamefilesd/res/level/actions/stashUse.json
@@ -0,0 +1,16 @@
+{
+ "action": {
+ "name": "action.set",
+ "id": "use{1}Item",
+ "action": {
+ "name": "if.equal",
+ "param1": "|currentLevel|currentPlayer.item.stash.{2}.isUsable|",
+ "param2": true,
+ "then": [
+ { "name": "item.use", "inventory": "stash", "item": [{2}] },
+ "updateAllPlayerStats"
+ ],
+ "else": "rightClickLevel"
+ }
+ }
+}
\ No newline at end of file
diff --git a/gamefilesd/res/level/fonts.json b/gamefilesd/res/level/fonts.json
index fb7f131c..c9e2f0ca 100755
--- a/gamefilesd/res/level/fonts.json
+++ b/gamefilesd/res/level/fonts.json
@@ -5,6 +5,7 @@
"textureId": "smaltext",
"palette": "town",
"file": "ctrlpan/smaltext.cel",
+ "celSize": [13, 11],
"charMapFile": "res/level/smaltextCharMap.bin",
"charSizeFile": "res/level/smaltextSize.bin"
},
diff --git a/gamefilesd/towners/adria/buy/confirm2.json b/gamefilesd/towners/adria/buy/confirm2.json
index d6a8ac8e..27dde062 100755
--- a/gamefilesd/towners/adria/buy/confirm2.json
+++ b/gamefilesd/towners/adria/buy/confirm2.json
@@ -110,56 +110,11 @@
]
}
],
+ "load": ["towners/common/setItemInfo.json", "adria", "{1}", "{2}"],
+ "load": ["towners/common/setPriceInfo.json", "adria", "{1}", "{2}",
+ "|currentLevel|player.adria.item.{1}.{2}.price|"],
"action": [
"anchorLeftPentagram",
- "anchorRightPentagram",
- {
- "name": "text.setTextFromQuery",
- "id": "itemInfo",
- "query": "currentLevel.player.adria.item.{1}.{2}",
- "text": "%name%\n %d.0%, %d.3%",
- "removeEmptyLines": true
- },
- {
- "name": "text.setTextFromQuery",
- "id": "itemPrice",
- "query": "currentLevel.player.adria.item.{1}.{2}",
- "text": "%price%"
- },
- {
- "replaceVars": true,
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "adria", "inventory": {1}, "item": {2} }
- },
- "param2": false,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textRed%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textRed%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.adria.item.{1}.{2}.unique|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textGold%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textGold%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.adria.item.{1}.{2}.magical|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textBlue%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textBlue%" }
- ],
- "else": [
- { "name": "text.setColor", "id": "itemInfo" },
- { "name": "text.setColor", "id": "itemPrice" }
- ]
- }
- }
- }
+ "anchorRightPentagram"
]
}
\ No newline at end of file
diff --git a/gamefilesd/towners/adria/buy/listItems.json b/gamefilesd/towners/adria/buy/listItems.json
index 3e2a465f..62007880 100755
--- a/gamefilesd/towners/adria/buy/listItems.json
+++ b/gamefilesd/towners/adria/buy/listItems.json
@@ -2,6 +2,7 @@
"load": "ui/level/panel/big/upperSeparator.json",
"load": "ui/level/panel/big/lowerSeparator.json",
"load": "ui/level/panel/big/scrollbar.json",
+ "load": "towners/common/loadMenuButtons.json",
"keyboard": [
{
"key": "tab",
@@ -13,43 +14,8 @@
"action": "focus.moveDown"
}
],
- "button": [
- {
- "id": "btnItem1",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 94],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 0 }
- },
- {
- "id": "btnItem2",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 142],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 1 }
- },
- {
- "id": "btnItem3",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 190],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 2 }
- },
- {
- "id": "btnItem4",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 238],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 3 }
- }
- ],
"menu": {
"id": "menuPrices",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [571, 94],
@@ -63,45 +29,8 @@
"load": "currentLevel|adria.inventory.0",
"text": "%price%",
"executeAction": {
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "adria", "inventory": 0, "item": "%idx%" }
- },
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.adria.item.0.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.adria.item.0.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuPriceText.json", "adria", 0, "%idx%", "%menuIdx%"]
}
}
},
diff --git a/gamefilesd/towners/adria/buy/panel.json b/gamefilesd/towners/adria/buy/panel.json
index 54302286..6ff492b7 100755
--- a/gamefilesd/towners/adria/buy/panel.json
+++ b/gamefilesd/towners/adria/buy/panel.json
@@ -56,7 +56,6 @@
],
"menu": {
"id": "mainMenu",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [52, 94],
@@ -68,12 +67,12 @@
"focusSound": "titlemov",
"visibleItems": 4,
"size": [518, 186],
- "verticalPad": 26,
+ "verticalPad": 14,
"onScrollDown": "focus.moveDown",
"onScrollUp": "focus.moveUp",
"items": {
"load": "currentLevel|adria.inventory.0",
- "text": "%name%\n %d.0%, %d.3%",
+ "text": "%name%\n",
"onClick": {
"name": "load",
"file": ["towners/adria/buy/confirm.json", 0, "%idx%"]
@@ -84,45 +83,8 @@
"mainMenu.moveScrollbar"
],
"executeAction": {
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "adria", "inventory": 0, "item": "%idx%" }
- },
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.adria.item.0.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.adria.item.0.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuItemText.json", "adria", 0, "%idx%", "%menuIdx%"]
}
}
},
diff --git a/gamefilesd/towners/adria/recharge/confirm2.json b/gamefilesd/towners/adria/recharge/confirm2.json
index 7bdec6c1..751d9002 100755
--- a/gamefilesd/towners/adria/recharge/confirm2.json
+++ b/gamefilesd/towners/adria/recharge/confirm2.json
@@ -114,14 +114,14 @@
"anchorLeftPentagram",
"anchorRightPentagram",
{
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "itemInfo",
"query": "currentLevel.currentPlayer.item.{1}.{2}",
"text": "%name%\n %d.0%, %d.3%",
"removeEmptyLines": true
},
{
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "itemPrice",
"query": "currentLevel.currentPlayer.item.{1}.{2}",
"text": "%price%"
diff --git a/gamefilesd/towners/adria/recharge/listItems.json b/gamefilesd/towners/adria/recharge/listItems.json
index 070b7a8e..f68b28b3 100755
--- a/gamefilesd/towners/adria/recharge/listItems.json
+++ b/gamefilesd/towners/adria/recharge/listItems.json
@@ -2,6 +2,7 @@
"load": "ui/level/panel/big/upperSeparator.json",
"load": "ui/level/panel/big/lowerSeparator.json",
"load": "ui/level/panel/big/scrollbar.json",
+ "load": "towners/common/loadMenuButtons.json",
"keyboard": [
{
"key": "tab",
@@ -13,40 +14,6 @@
"action": "focus.moveDown"
}
],
- "button": [
- {
- "id": "btnItem1",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 94],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 0 }
- },
- {
- "id": "btnItem2",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 142],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 1 }
- },
- {
- "id": "btnItem3",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 190],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 2 }
- },
- {
- "id": "btnItem4",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 238],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 3 }
- }
- ],
"menu": {
"id": "menuPrices",
"replaceVars": true,
diff --git a/gamefilesd/towners/adria/sell/confirm2.json b/gamefilesd/towners/adria/sell/confirm2.json
index b7b85cd8..75486878 100755
--- a/gamefilesd/towners/adria/sell/confirm2.json
+++ b/gamefilesd/towners/adria/sell/confirm2.json
@@ -74,7 +74,7 @@
"text": "Yes",
"onClick": [
{ "name": "player.addGold", "gold": "|currentLevel|currentPlayer.item.{1}.{2}.prices.sell|" },
- { "name": "item.delete", "inventory": "{1}", "item": {2} },
+ { "name": "item.delete", "inventory": {1}, "item": {2} },
"updateBeltItems",
{ "name": "resource.popAll", "id": "userPanelSell" },
{ "name": "load", "file": "towners/adria/sell/panel.json" }
@@ -102,53 +102,11 @@
]
}
],
+ "load": ["towners/common/setItemInfo.json", "hero", "{1}", "{2}"],
+ "load": ["towners/common/setPriceInfo.json", "hero", "{1}", "{2}",
+ "|currentLevel|currentPlayer.item.{1}.{2}.prices.sell|"],
"action": [
"anchorLeftPentagram",
- "anchorRightPentagram",
- {
- "name": "text.setTextFromQuery",
- "id": "itemInfo",
- "query": "currentLevel.currentPlayer.item.{1}.{2}",
- "text": "%name%\n %d.0%, %d.3%",
- "removeEmptyLines": true
- },
- {
- "name": "text.setTextFromQuery",
- "id": "itemPrice",
- "query": "currentLevel.currentPlayer.item.{1}.{2}",
- "text": "%prices.sell%"
- },
- {
- "replaceVars": true,
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.{1}.{2}|",
- "param2": false,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textRed%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textRed%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.{1}.{2}.unique|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textGold%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textGold%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.{1}.{2}.magical|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textBlue%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textBlue%" }
- ],
- "else": [
- { "name": "text.setColor", "id": "itemInfo" },
- { "name": "text.setColor", "id": "itemPrice" }
- ]
- }
- }
- }
+ "anchorRightPentagram"
]
}
\ No newline at end of file
diff --git a/gamefilesd/towners/adria/sell/listItems.json b/gamefilesd/towners/adria/sell/listItems.json
index 2fd84a7d..399bd608 100755
--- a/gamefilesd/towners/adria/sell/listItems.json
+++ b/gamefilesd/towners/adria/sell/listItems.json
@@ -2,6 +2,7 @@
"load": "ui/level/panel/big/upperSeparator.json",
"load": "ui/level/panel/big/lowerSeparator.json",
"load": "ui/level/panel/big/scrollbar.json",
+ "load": "towners/common/loadMenuButtons.json",
"keyboard": [
{
"key": "tab",
@@ -13,43 +14,8 @@
"action": "focus.moveDown"
}
],
- "button": [
- {
- "id": "btnItem1",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 94],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 0 }
- },
- {
- "id": "btnItem2",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 142],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 1 }
- },
- {
- "id": "btnItem3",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 190],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 2 }
- },
- {
- "id": "btnItem4",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 238],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 3 }
- }
- ],
"menu": {
"id": "menuPrices",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [571, 94],
@@ -68,42 +34,8 @@
},
"text": "%prices.sell%",
"executeAction": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.stash.%idx%|",
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.stash.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.stash.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuPriceText.json", "hero", 2, "%idx%", "%menuIdx%"]
}
},
{
@@ -114,42 +46,8 @@
},
"text": "%prices.sell%",
"executeAction": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.belt.%idx%|",
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.belt.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.belt.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuPriceText.json", "hero", 1, "%idx%", "%menuIdx%"]
}
}
]
diff --git a/gamefilesd/towners/adria/sell/panel.json b/gamefilesd/towners/adria/sell/panel.json
index 567a5575..30032bc6 100755
--- a/gamefilesd/towners/adria/sell/panel.json
+++ b/gamefilesd/towners/adria/sell/panel.json
@@ -56,7 +56,6 @@
],
"menu": {
"id": "mainMenu",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [52, 94],
@@ -68,7 +67,7 @@
"focusSound": "titlemov",
"visibleItems": 4,
"size": [518, 186],
- "verticalPad": 26,
+ "verticalPad": 14,
"onScrollDown": "focus.moveDown",
"onScrollUp": "focus.moveUp",
"items": [
@@ -78,10 +77,10 @@
"property": "itemType",
"value": ["Book", "Potion", "Scroll", "Staff"]
},
- "text": "%name%\n %d.0%, %d.3%",
+ "text": "%name%\n",
"onClick": {
"name": "load",
- "file": ["towners/adria/sell/confirm.json", "stash", "%idx%"]
+ "file": ["towners/adria/sell/confirm.json", 2, "%idx%"]
},
"onFocus": [
"anchorLeftPentagram",
@@ -89,42 +88,8 @@
"mainMenu.moveScrollbar"
],
"executeAction": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.stash.%idx%|",
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.stash.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.stash.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuItemText.json", "hero", 2, "%idx%", "%menuIdx%"]
}
},
{
@@ -133,10 +98,10 @@
"property": "itemType",
"value": ["Book", "Potion", "Scroll", "Staff"]
},
- "text": "%name%\n %d.0%, %d.3%",
+ "text": "%name%\n",
"onClick": {
"name": "load",
- "file": ["towners/adria/sell/confirm.json", "belt", "%idx%"]
+ "file": ["towners/adria/sell/confirm.json", 1, "%idx%"]
},
"onFocus": [
"anchorLeftPentagram",
@@ -144,42 +109,8 @@
"mainMenu.moveScrollbar"
],
"executeAction": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.belt.%idx%|",
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.belt.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.belt.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuItemText.json", "hero", 1, "%idx%", "%menuIdx%"]
}
}
]
diff --git a/gamefilesd/towners/cain/identify/confirm2.json b/gamefilesd/towners/cain/identify/confirm2.json
index 1535670c..5347451c 100755
--- a/gamefilesd/towners/cain/identify/confirm2.json
+++ b/gamefilesd/towners/cain/identify/confirm2.json
@@ -80,7 +80,7 @@
},
{
"name": "item.setProperty",
- "inventory": "{1}",
+ "inventory": {1},
"item": {2},
"property": "identified",
"value": true
@@ -111,47 +111,10 @@
]
}
],
+ "load": ["towners/common/setItemInfo.json", "hero", "{1}", "{2}"],
+ "load": ["towners/common/setPriceInfo.json", "hero", "{1}", "{2}", "%identifyPrice%"],
"action": [
"anchorLeftPentagram",
- "anchorRightPentagram",
- {
- "name": "text.setTextFromQuery",
- "id": "itemInfo",
- "query": "currentLevel.currentPlayer.item.{1}.{2}",
- "text": "%name%\n %d.0%, %d.3%",
- "removeEmptyLines": true
- },
- {
- "replaceVars": true,
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.{1}.{2}|",
- "param2": false,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textRed%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textRed%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.{1}.{2}.unique|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textGold%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textGold%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.{1}.{2}.magical|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textBlue%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textBlue%" }
- ],
- "else": [
- { "name": "text.setColor", "id": "itemInfo" },
- { "name": "text.setColor", "id": "itemPrice" }
- ]
- }
- }
- }
+ "anchorRightPentagram"
]
}
\ No newline at end of file
diff --git a/gamefilesd/towners/cain/identify/item.json b/gamefilesd/towners/cain/identify/item.json
index d786771c..e628b295 100755
--- a/gamefilesd/towners/cain/identify/item.json
+++ b/gamefilesd/towners/cain/identify/item.json
@@ -65,62 +65,15 @@
"horizontalAlign": "center",
"horizontalSpaceOffset": 1,
"text": "Done",
- "onClick": [
- {
- "name": "item.setProperty",
- "inventory": "{1}",
- "item": {2},
- "property": "identified",
- "value": true
- },
- { "name": "resource.popAll", "id": "userPanelItem" }
- ],
+ "onClick": { "name": "resource.popAll", "id": "userPanelItem" },
"onFocus": [
"anchorLeftPentagram",
"anchorRightPentagram"
]
},
+ "load": ["towners/common/setItemInfo.json", "hero", "{1}", "{2}"],
"action": [
"anchorLeftPentagram",
- "anchorRightPentagram",
- {
- "name": "text.setTextFromQuery",
- "id": "itemInfo",
- "query": "currentLevel.currentPlayer.item.{1}.{2}",
- "text": "%name%\n %d.1% %d.2%\n %d.0%, %d.3%",
- "removeEmptyLines": true
- },
- {
- "replaceVars": true,
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.{1}.{2}|",
- "param2": false,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textRed%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textRed%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.{1}.{2}.magical|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textBlue%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textBlue%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.{1}.{2}.unique|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textGold%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textGold%" }
- ],
- "else": [
- { "name": "text.setColor", "id": "itemInfo" },
- { "name": "text.setColor", "id": "itemPrice" }
- ]
- }
- }
- }
+ "anchorRightPentagram"
]
}
\ No newline at end of file
diff --git a/gamefilesd/towners/cain/identify/listItems.json b/gamefilesd/towners/cain/identify/listItems.json
index bc364330..2ac7358c 100755
--- a/gamefilesd/towners/cain/identify/listItems.json
+++ b/gamefilesd/towners/cain/identify/listItems.json
@@ -2,6 +2,7 @@
"load": "ui/level/panel/big/upperSeparator.json",
"load": "ui/level/panel/big/lowerSeparator.json",
"load": "ui/level/panel/big/scrollbar.json",
+ "load": "towners/common/loadMenuButtons.json",
"keyboard": [
{
"key": "tab",
@@ -13,40 +14,6 @@
"action": "focus.moveDown"
}
],
- "button": [
- {
- "id": "btnItem1",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 94],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 0 }
- },
- {
- "id": "btnItem2",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 142],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 1 }
- },
- {
- "id": "btnItem3",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 190],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 2 }
- },
- {
- "id": "btnItem4",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 238],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 3 }
- }
- ],
"menu": {
"id": "menuPrices",
"replaceVars": true,
diff --git a/gamefilesd/towners/cain/identify/panel.json b/gamefilesd/towners/cain/identify/panel.json
index 1cd6de54..1b62ba3d 100755
--- a/gamefilesd/towners/cain/identify/panel.json
+++ b/gamefilesd/towners/cain/identify/panel.json
@@ -56,7 +56,6 @@
],
"menu": {
"id": "mainMenu",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [52, 94],
@@ -68,7 +67,7 @@
"focusSound": "titlemov",
"visibleItems": 4,
"size": [518, 186],
- "verticalPad": 26,
+ "verticalPad": 14,
"onScrollDown": "focus.moveDown",
"onScrollUp": "focus.moveUp",
"items": [
@@ -78,14 +77,10 @@
"property": "identified",
"value": true
},
- "text": "%name%\n %d.0%, %d.3%",
+ "text": "%name%\n",
"onClick": {
"name": "load",
- "file": [
- "towners/cain/identify/confirm.json",
- "body",
- "%idx%"
- ]
+ "file": ["towners/cain/identify/confirm.json", 0, "%idx%"]
},
"onFocus": [
"anchorLeftPentagram",
@@ -93,42 +88,8 @@
"mainMenu.moveScrollbar"
],
"executeAction": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.body.%idx%|",
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.body.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.body.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuItemText.json", "hero", 0, "%idx%", "%menuIdx%"]
}
},
{
@@ -137,14 +98,10 @@
"property": "identified",
"value": true
},
- "text": "%name%\n %d.0%, %d.3%",
+ "text": "%name%\n",
"onClick": {
"name": "load",
- "file": [
- "towners/cain/identify/confirm.json",
- "belt",
- "%idx%"
- ]
+ "file": ["towners/cain/identify/confirm.json", 1, "%idx%"]
},
"onFocus": [
"anchorLeftPentagram",
@@ -152,42 +109,8 @@
"mainMenu.moveScrollbar"
],
"executeAction": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.belt.%idx%|",
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.belt.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.belt.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuItemText.json", "hero", 1, "%idx%", "%menuIdx%"]
}
},
{
@@ -196,14 +119,10 @@
"property": "identified",
"value": true
},
- "text": "%name%\n %d.0%, %d.3%",
+ "text": "%name%\n",
"onClick": {
"name": "load",
- "file": [
- "towners/cain/identify/confirm.json",
- "stash",
- "%idx%"
- ]
+ "file": ["towners/cain/identify/confirm.json", 2, "%idx%"]
},
"onFocus": [
"anchorLeftPentagram",
@@ -211,42 +130,8 @@
"mainMenu.moveScrollbar"
],
"executeAction": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.stash.%idx%|",
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.stash.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.stash.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuItemText.json", "hero", 2, "%idx%", "%menuIdx%"]
}
}
]
diff --git a/gamefilesd/towners/common/loadMenuButtons.json b/gamefilesd/towners/common/loadMenuButtons.json
new file mode 100755
index 00000000..62c58b60
--- /dev/null
+++ b/gamefilesd/towners/common/loadMenuButtons.json
@@ -0,0 +1,40 @@
+{
+ "button": [
+ {
+ "id": "btnItem1",
+ "texture": "empty",
+ "textureRect": [518, 44],
+ "position": [52, 94],
+ "anchor": "none",
+ "captureInputEvents": false,
+ "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 0 }
+ },
+ {
+ "id": "btnItem2",
+ "texture": "empty",
+ "textureRect": [518, 44],
+ "position": [52, 142],
+ "anchor": "none",
+ "captureInputEvents": false,
+ "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 1 }
+ },
+ {
+ "id": "btnItem3",
+ "texture": "empty",
+ "textureRect": [518, 44],
+ "position": [52, 190],
+ "anchor": "none",
+ "captureInputEvents": false,
+ "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 2 }
+ },
+ {
+ "id": "btnItem4",
+ "texture": "empty",
+ "textureRect": [518, 44],
+ "position": [52, 238],
+ "anchor": "none",
+ "captureInputEvents": false,
+ "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 3 }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/gamefilesd/towners/common/setItemInfo.json b/gamefilesd/towners/common/setItemInfo.json
new file mode 100755
index 00000000..43e421f0
--- /dev/null
+++ b/gamefilesd/towners/common/setItemInfo.json
@@ -0,0 +1,105 @@
+{
+ "action": [
+ {
+ "name": "text.setText",
+ "id": "itemInfo",
+ "query": "currentLevel.player.{1}.item.{2}.{3}",
+ "text": "%name%\n"
+ },
+ {
+ "name": "if.inList",
+ "param": "|currentLevel|player.{1}.item.{2}.{3}.itemType|",
+ "list": ["Book", "Potion", "Scroll"],
+ "else": [
+ {
+ "name": "if.equal",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.identified|",
+ "param2": true,
+ "then": {
+ "name": "if.notEqual",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.d.1|",
+ "param2": "",
+ "then": {
+ "name": "if.notEqual",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.d.2|",
+ "param2": "",
+ "then": {
+ "name": "text.appendText",
+ "id": "itemInfo",
+ "query": "currentLevel.player.{1}.item.{2}.{3}",
+ "text": " %d.1%, %d.2%\n"
+ },
+ "else": {
+ "name": "text.appendText",
+ "id": "itemInfo",
+ "query": "currentLevel.player.{1}.item.{2}.{3}",
+ "text": " %d.1%\n"
+ }
+ },
+ "else": {
+ "name": "if.notEqual",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.d.2|",
+ "param2": "",
+ "then": {
+ "name": "text.appendText",
+ "id": "itemInfo",
+ "query": "currentLevel.player.{1}.item.{2}.{3}",
+ "text": " %d.2%\n"
+ }
+ }
+ }
+ },
+ {
+ "name": "if.notEqual",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.d.0|",
+ "param2": "",
+ "then": {
+ "name": "text.appendText",
+ "id": "itemInfo",
+ "query": "currentLevel.player.{1}.item.{2}.{3}",
+ "text": " %d.0%,"
+ }
+ }
+ ]
+ },
+ {
+ "name": "if.notEqual",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.d.3|",
+ "param2": "",
+ "then": {
+ "name": "text.appendText",
+ "id": "itemInfo",
+ "query": "currentLevel.player.{1}.item.{2}.{3}",
+ "text": " %d.3%"
+ },
+ "else": {
+ "name": "text.appendText",
+ "id": "itemInfo",
+ "text": " No Required Attributes"
+ }
+ },
+ {
+ "replaceVars": true,
+ "name": "if.equal",
+ "param1": {
+ "name": "player.canEquipItem",
+ "item": { "player": "{1}", "inventory": {2}, "item": {3} }
+ },
+ "param2": false,
+ "then": { "name": "text.setColor", "id": "itemInfo", "color": "%textRed%" },
+ "else": {
+ "name": "if.equal",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.unique|",
+ "param2": 1,
+ "then": { "name": "text.setColor", "id": "itemInfo", "color": "%textGold%" },
+ "else": {
+ "name": "if.equal",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.magical|",
+ "param2": 1,
+ "then": { "name": "text.setColor", "id": "itemInfo", "color": "%textBlue%" },
+ "else": { "name": "text.setColor", "id": "itemInfo" }
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/gamefilesd/towners/common/setMenuItemText.json b/gamefilesd/towners/common/setMenuItemText.json
new file mode 100755
index 00000000..d7667b27
--- /dev/null
+++ b/gamefilesd/towners/common/setMenuItemText.json
@@ -0,0 +1,117 @@
+{
+ "action": [
+ {
+ "name": "if.inList",
+ "param": "|currentLevel|player.{1}.item.{2}.{3}.itemType|",
+ "list": ["Book", "Potion", "Scroll"],
+ "else": [
+ {
+ "name": "if.equal",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.identified|",
+ "param2": true,
+ "then": {
+ "name": "if.notEqual",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.d.1|",
+ "param2": "",
+ "then": {
+ "name": "if.notEqual",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.d.2|",
+ "param2": "",
+ "then": {
+ "name": "menu.appendText",
+ "id": "mainMenu",
+ "index": {4},
+ "query": "currentLevel.player.{1}.item.{2}.{3}",
+ "text": " %d.1%, %d.2%\n"
+ },
+ "else": {
+ "name": "menu.appendText",
+ "id": "mainMenu",
+ "index": {4},
+ "query": "currentLevel.player.{1}.item.{2}.{3}",
+ "text": " %d.1%\n"
+ }
+ },
+ "else": {
+ "name": "if.notEqual",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.d.2|",
+ "param2": "",
+ "then": {
+ "name": "menu.appendText",
+ "id": "mainMenu",
+ "index": {4},
+ "query": "currentLevel.player.{1}.item.{2}.{3}",
+ "text": " %d.2%\n"
+ }
+ }
+ }
+ },
+ {
+ "name": "if.notEqual",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.d.0|",
+ "param2": "",
+ "then": {
+ "name": "menu.appendText",
+ "id": "mainMenu",
+ "index": {4},
+ "query": "currentLevel.player.{1}.item.{2}.{3}",
+ "text": " %d.0%,"
+ }
+ }
+ ]
+ },
+ {
+ "name": "if.notEqual",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.d.3|",
+ "param2": "",
+ "then": {
+ "name": "menu.appendText",
+ "id": "mainMenu",
+ "index": {4},
+ "query": "currentLevel.player.{1}.item.{2}.{3}",
+ "text": " %d.3%"
+ },
+ "else": {
+ "name": "menu.appendText",
+ "id": "mainMenu",
+ "index": {4},
+ "text": " No Required Attributes"
+ }
+ },
+ {
+ "name": "if.lower",
+ "param1": "|mainMenu|item.{4}.lineCount|",
+ "param2": 3,
+ "then": {
+ "name": "menu.appendText",
+ "id": "mainMenu",
+ "index": {4},
+ "text": "\n"
+ }
+ },
+ {
+ "replaceVars": true,
+ "name": "if.equal",
+ "param1": {
+ "name": "player.canEquipItem",
+ "item": { "player": "{1}", "inventory": {2}, "item": {3} }
+ },
+ "param2": false,
+ "then": {
+ "name": "menu.setColor", "id": "mainMenu", "index": {4}, "color": "%textRed%" },
+ "else": {
+ "name": "if.equal",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.unique|",
+ "param2": 1,
+ "then": { "name": "menu.setColor", "id": "mainMenu", "index": {4}, "color": "%textGold%" },
+ "else": {
+ "name": "if.equal",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.magical|",
+ "param2": 1,
+ "then": { "name": "menu.setColor", "id": "mainMenu", "index": {4}, "color": "%textBlue%" },
+ "else": { "name": "menu.setColor", "id": "mainMenu", "index": {4} }
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/gamefilesd/towners/common/setMenuPriceText.json b/gamefilesd/towners/common/setMenuPriceText.json
new file mode 100755
index 00000000..a53586bf
--- /dev/null
+++ b/gamefilesd/towners/common/setMenuPriceText.json
@@ -0,0 +1,44 @@
+{
+ "action": {
+ "replaceVars": true,
+ "name": "if.equal",
+ "param1": {
+ "name": "player.canEquipItem",
+ "item": { "player": "{1}", "inventory": {2}, "item": {3} }
+ },
+ "param2": false,
+ "then": {
+ "name": "menu.setColor",
+ "id": "menuPrices",
+ "index": {4},
+ "color": "%textRed%"
+ },
+ "else": {
+ "name": "if.equal",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.unique|",
+ "param2": 1,
+ "then": {
+ "name": "menu.setColor",
+ "id": "menuPrices",
+ "index": {4},
+ "color": "%textGold%"
+ },
+ "else": {
+ "name": "if.equal",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.magical|",
+ "param2": 1,
+ "then": {
+ "name": "menu.setColor",
+ "id": "menuPrices",
+ "index": {4},
+ "color": "%textBlue%"
+ },
+ "else": {
+ "name": "menu.setColor",
+ "id": "menuPrices",
+ "index": {4}
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/gamefilesd/towners/common/setPriceInfo.json b/gamefilesd/towners/common/setPriceInfo.json
new file mode 100755
index 00000000..a41c9da8
--- /dev/null
+++ b/gamefilesd/towners/common/setPriceInfo.json
@@ -0,0 +1,28 @@
+{
+ "action": [
+ { "name": "text.setText", "id": "itemPrice", "text": "{4}" },
+ {
+ "replaceVars": true,
+ "name": "if.equal",
+ "param1": {
+ "name": "player.canEquipItem",
+ "item": { "player": "{1}", "inventory": {2}, "item": {3} }
+ },
+ "param2": false,
+ "then": { "name": "text.setColor", "id": "itemPrice", "color": "%textRed%" },
+ "else": {
+ "name": "if.equal",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.unique|",
+ "param2": 1,
+ "then": { "name": "text.setColor", "id": "itemPrice", "color": "%textGold%" },
+ "else": {
+ "name": "if.equal",
+ "param1": "|currentLevel|player.{1}.item.{2}.{3}.magical|",
+ "param2": 1,
+ "then": { "name": "text.setColor", "id": "itemPrice", "color": "%textBlue%" },
+ "else": { "name": "text.setColor", "id": "itemPrice" }
+ }
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/gamefilesd/towners/griswold/buy/confirm2.json b/gamefilesd/towners/griswold/buy/confirm2.json
index 881e5a84..89703fc1 100755
--- a/gamefilesd/towners/griswold/buy/confirm2.json
+++ b/gamefilesd/towners/griswold/buy/confirm2.json
@@ -110,56 +110,11 @@
]
}
],
+ "load": ["towners/common/setItemInfo.json", "griswold", "{1}", "{2}"],
+ "load": ["towners/common/setPriceInfo.json", "griswold", "{1}", "{2}",
+ "|currentLevel|player.griswold.item.{1}.{2}.price|"],
"action": [
"anchorLeftPentagram",
- "anchorRightPentagram",
- {
- "name": "text.setTextFromQuery",
- "id": "itemInfo",
- "query": "currentLevel.player.griswold.item.{1}.{2}",
- "text": "%name%\n %d.0%, %d.3%",
- "removeEmptyLines": true
- },
- {
- "name": "text.setTextFromQuery",
- "id": "itemPrice",
- "query": "currentLevel.player.griswold.item.{1}.{2}",
- "text": "%price%"
- },
- {
- "replaceVars": true,
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "griswold", "inventory": {1}, "item": {2} }
- },
- "param2": false,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textRed%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textRed%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.griswold.item.{1}.{2}.unique|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textGold%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textGold%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.griswold.item.{1}.{2}.magical|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textBlue%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textBlue%" }
- ],
- "else": [
- { "name": "text.setColor", "id": "itemInfo" },
- { "name": "text.setColor", "id": "itemPrice" }
- ]
- }
- }
- }
+ "anchorRightPentagram"
]
}
\ No newline at end of file
diff --git a/gamefilesd/towners/griswold/buy/listItems.json b/gamefilesd/towners/griswold/buy/listItems.json
index 04ffea45..09162bda 100755
--- a/gamefilesd/towners/griswold/buy/listItems.json
+++ b/gamefilesd/towners/griswold/buy/listItems.json
@@ -2,6 +2,7 @@
"load": "ui/level/panel/big/upperSeparator.json",
"load": "ui/level/panel/big/lowerSeparator.json",
"load": "ui/level/panel/big/scrollbar.json",
+ "load": "towners/common/loadMenuButtons.json",
"keyboard": [
{
"key": "tab",
@@ -13,43 +14,8 @@
"action": "focus.moveDown"
}
],
- "button": [
- {
- "id": "btnItem1",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 94],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 0 }
- },
- {
- "id": "btnItem2",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 142],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 1 }
- },
- {
- "id": "btnItem3",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 190],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 2 }
- },
- {
- "id": "btnItem4",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 238],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 3 }
- }
- ],
"menu": {
"id": "menuPrices",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [571, 94],
@@ -63,45 +29,8 @@
"load": "currentLevel|griswold.inventory.0",
"text": "%price%",
"executeAction": {
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "griswold", "inventory": 0, "item": "%idx%" }
- },
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.griswold.item.0.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.griswold.item.0.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuPriceText.json", "griswold", 0, "%idx%", "%menuIdx%"]
}
}
},
diff --git a/gamefilesd/towners/griswold/buy/panel.json b/gamefilesd/towners/griswold/buy/panel.json
index 9208183c..d6e8be71 100755
--- a/gamefilesd/towners/griswold/buy/panel.json
+++ b/gamefilesd/towners/griswold/buy/panel.json
@@ -56,7 +56,6 @@
],
"menu": {
"id": "mainMenu",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [52, 94],
@@ -68,12 +67,12 @@
"focusSound": "titlemov",
"visibleItems": 4,
"size": [518, 186],
- "verticalPad": 26,
+ "verticalPad": 14,
"onScrollDown": "focus.moveDown",
"onScrollUp": "focus.moveUp",
"items": {
"load": "currentLevel|griswold.inventory.0",
- "text": "%name%\n %d.0%, %d.3%",
+ "text": "%name%\n",
"onClick": {
"name": "load",
"file": ["towners/griswold/buy/confirm.json", 0, "%idx%"]
@@ -84,45 +83,8 @@
"mainMenu.moveScrollbar"
],
"executeAction": {
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "griswold", "inventory": 0, "item": "%idx%" }
- },
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.griswold.item.0.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.griswold.item.0.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuItemText.json", "griswold", 0, "%idx%", "%menuIdx%"]
}
}
},
diff --git a/gamefilesd/towners/griswold/buyPremium/confirm2.json b/gamefilesd/towners/griswold/buyPremium/confirm2.json
index cde05f1e..7a4ae6ca 100755
--- a/gamefilesd/towners/griswold/buyPremium/confirm2.json
+++ b/gamefilesd/towners/griswold/buyPremium/confirm2.json
@@ -110,56 +110,11 @@
]
}
],
+ "load": ["towners/common/setItemInfo.json", "griswold", "{1}", "{2}"],
+ "load": ["towners/common/setPriceInfo.json", "griswold", "{1}", "{2}",
+ "|currentLevel|player.griswold.item.{1}.{2}.price|"],
"action": [
"anchorLeftPentagram",
- "anchorRightPentagram",
- {
- "name": "text.setTextFromQuery",
- "id": "itemInfo",
- "query": "currentLevel.player.griswold.item.{1}.{2}",
- "text": "%name%\n %d.0%, %d.3%",
- "removeEmptyLines": true
- },
- {
- "name": "text.setTextFromQuery",
- "id": "itemPrice",
- "query": "currentLevel.player.griswold.item.{1}.{2}",
- "text": "%price%"
- },
- {
- "replaceVars": true,
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "griswold", "inventory": {1}, "item": {2} }
- },
- "param2": false,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textRed%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textRed%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.griswold.item.{1}.{2}.unique|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textGold%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textGold%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.griswold.item.{1}.{2}.magical|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textBlue%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textBlue%" }
- ],
- "else": [
- { "name": "text.setColor", "id": "itemInfo" },
- { "name": "text.setColor", "id": "itemPrice" }
- ]
- }
- }
- }
+ "anchorRightPentagram"
]
}
\ No newline at end of file
diff --git a/gamefilesd/towners/griswold/buyPremium/listItems.json b/gamefilesd/towners/griswold/buyPremium/listItems.json
index 1d06cd96..dec42987 100755
--- a/gamefilesd/towners/griswold/buyPremium/listItems.json
+++ b/gamefilesd/towners/griswold/buyPremium/listItems.json
@@ -2,6 +2,7 @@
"load": "ui/level/panel/big/upperSeparator.json",
"load": "ui/level/panel/big/lowerSeparator.json",
"load": "ui/level/panel/big/scrollbar.json",
+ "load": "towners/common/loadMenuButtons.json",
"keyboard": [
{
"key": "tab",
@@ -13,43 +14,8 @@
"action": "focus.moveDown"
}
],
- "button": [
- {
- "id": "btnItem1",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 94],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 0 }
- },
- {
- "id": "btnItem2",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 142],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 1 }
- },
- {
- "id": "btnItem3",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 190],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 2 }
- },
- {
- "id": "btnItem4",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 238],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 3 }
- }
- ],
"menu": {
"id": "menuPrices",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [571, 94],
@@ -63,45 +29,8 @@
"load": "currentLevel|griswold.inventory.1",
"text": "%price%",
"executeAction": {
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "griswold", "inventory": 1, "item": "%idx%" }
- },
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.griswold.item.1.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.griswold.item.1.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuPriceText.json", "griswold", 1, "%idx%", "%menuIdx%"]
}
}
},
diff --git a/gamefilesd/towners/griswold/buyPremium/panel.json b/gamefilesd/towners/griswold/buyPremium/panel.json
index 4eafedda..458936b6 100755
--- a/gamefilesd/towners/griswold/buyPremium/panel.json
+++ b/gamefilesd/towners/griswold/buyPremium/panel.json
@@ -56,7 +56,6 @@
],
"menu": {
"id": "mainMenu",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [52, 94],
@@ -68,12 +67,12 @@
"focusSound": "titlemov",
"visibleItems": 4,
"size": [518, 186],
- "verticalPad": 26,
+ "verticalPad": 14,
"onScrollDown": "focus.moveDown",
"onScrollUp": "focus.moveUp",
"items": {
"load": "currentLevel|griswold.inventory.1",
- "text": "%name%\n %d.0%, %d.3%",
+ "text": "%name%\n",
"onClick": {
"name": "load",
"file": ["towners/griswold/buyPremium/confirm.json", 1, "%idx%"]
@@ -84,45 +83,8 @@
"mainMenu.moveScrollbar"
],
"executeAction": {
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "griswold", "inventory": 1, "item": "%idx%" }
- },
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.griswold.item.1.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.griswold.item.1.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuItemText.json", "griswold", 1, "%idx%", "%menuIdx%"]
}
}
},
diff --git a/gamefilesd/towners/griswold/repair/confirm2.json b/gamefilesd/towners/griswold/repair/confirm2.json
index d71e6eb5..343aacfa 100755
--- a/gamefilesd/towners/griswold/repair/confirm2.json
+++ b/gamefilesd/towners/griswold/repair/confirm2.json
@@ -114,14 +114,14 @@
"anchorLeftPentagram",
"anchorRightPentagram",
{
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "itemInfo",
"query": "currentLevel.currentPlayer.item.{1}.{2}",
"text": "%name%\n %d.0%, %d.3%",
"removeEmptyLines": true
},
{
- "name": "text.setTextFromQuery",
+ "name": "text.setText",
"id": "itemPrice",
"query": "currentLevel.currentPlayer.item.{1}.{2}",
"text": "%price%"
diff --git a/gamefilesd/towners/griswold/repair/listItems.json b/gamefilesd/towners/griswold/repair/listItems.json
index 9d4acaf9..1ba764cd 100755
--- a/gamefilesd/towners/griswold/repair/listItems.json
+++ b/gamefilesd/towners/griswold/repair/listItems.json
@@ -2,6 +2,7 @@
"load": "ui/level/panel/big/upperSeparator.json",
"load": "ui/level/panel/big/lowerSeparator.json",
"load": "ui/level/panel/big/scrollbar.json",
+ "load": "towners/common/loadMenuButtons.json",
"keyboard": [
{
"key": "tab",
@@ -13,40 +14,6 @@
"action": "focus.moveDown"
}
],
- "button": [
- {
- "id": "btnItem1",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 94],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 0 }
- },
- {
- "id": "btnItem2",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 142],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 1 }
- },
- {
- "id": "btnItem3",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 190],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 2 }
- },
- {
- "id": "btnItem4",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 238],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 3 }
- }
- ],
"menu": {
"id": "menuPrices",
"replaceVars": true,
diff --git a/gamefilesd/towners/griswold/sell/confirm2.json b/gamefilesd/towners/griswold/sell/confirm2.json
index 7b86f681..04207b93 100755
--- a/gamefilesd/towners/griswold/sell/confirm2.json
+++ b/gamefilesd/towners/griswold/sell/confirm2.json
@@ -74,7 +74,7 @@
"text": "Yes",
"onClick": [
{ "name": "player.addGold", "gold": "|currentLevel|currentPlayer.item.{1}.{2}.prices.sell|" },
- { "name": "item.delete", "inventory": "{1}", "item": {2} },
+ { "name": "item.delete", "inventory": {1}, "item": {2} },
{ "name": "resource.popAll", "id": "userPanelSell" },
{ "name": "load", "file": "towners/griswold/sell/panel.json" }
],
@@ -101,53 +101,11 @@
]
}
],
+ "load": ["towners/common/setItemInfo.json", "hero", "{1}", "{2}"],
+ "load": ["towners/common/setPriceInfo.json", "hero", "{1}", "{2}",
+ "|currentLevel|currentPlayer.item.{1}.{2}.prices.sell|"],
"action": [
"anchorLeftPentagram",
- "anchorRightPentagram",
- {
- "name": "text.setTextFromQuery",
- "id": "itemInfo",
- "query": "currentLevel.currentPlayer.item.{1}.{2}",
- "text": "%name%\n %d.0%, %d.3%",
- "removeEmptyLines": true
- },
- {
- "name": "text.setTextFromQuery",
- "id": "itemPrice",
- "query": "currentLevel.currentPlayer.item.{1}.{2}",
- "text": "%prices.sell%"
- },
- {
- "replaceVars": true,
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.{1}.{2}|",
- "param2": false,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textRed%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textRed%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.{1}.{2}.unique|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textGold%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textGold%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.{1}.{2}.magical|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textBlue%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textBlue%" }
- ],
- "else": [
- { "name": "text.setColor", "id": "itemInfo" },
- { "name": "text.setColor", "id": "itemPrice" }
- ]
- }
- }
- }
+ "anchorRightPentagram"
]
}
\ No newline at end of file
diff --git a/gamefilesd/towners/griswold/sell/listItems.json b/gamefilesd/towners/griswold/sell/listItems.json
index 4bc18dc0..7d9fd3ec 100755
--- a/gamefilesd/towners/griswold/sell/listItems.json
+++ b/gamefilesd/towners/griswold/sell/listItems.json
@@ -2,6 +2,7 @@
"load": "ui/level/panel/big/upperSeparator.json",
"load": "ui/level/panel/big/lowerSeparator.json",
"load": "ui/level/panel/big/scrollbar.json",
+ "load": "towners/common/loadMenuButtons.json",
"keyboard": [
{
"key": "tab",
@@ -13,43 +14,8 @@
"action": "focus.moveDown"
}
],
- "button": [
- {
- "id": "btnItem1",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 94],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 0 }
- },
- {
- "id": "btnItem2",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 142],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 1 }
- },
- {
- "id": "btnItem3",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 190],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 2 }
- },
- {
- "id": "btnItem4",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 238],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 3 }
- }
- ],
"menu": {
"id": "menuPrices",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [571, 94],
@@ -67,42 +33,8 @@
},
"text": "%prices.sell%",
"executeAction": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.stash.%idx%|",
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.stash.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.stash.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuPriceText.json", "hero", 2, "%idx%", "%menuIdx%"]
}
}
},
diff --git a/gamefilesd/towners/griswold/sell/panel.json b/gamefilesd/towners/griswold/sell/panel.json
index 8d691cdd..d793391e 100755
--- a/gamefilesd/towners/griswold/sell/panel.json
+++ b/gamefilesd/towners/griswold/sell/panel.json
@@ -56,7 +56,6 @@
],
"menu": {
"id": "mainMenu",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [52, 94],
@@ -68,7 +67,7 @@
"focusSound": "titlemov",
"visibleItems": 4,
"size": [518, 186],
- "verticalPad": 26,
+ "verticalPad": 14,
"onScrollDown": "focus.moveDown",
"onScrollUp": "focus.moveUp",
"items": {
@@ -77,10 +76,10 @@
"property": "itemType",
"value": ["Amulet", "Armor", "Axe", "Bow", "Club", "Helmet", "Ring", "Shield", "Sword"]
},
- "text": "%name%\n %d.0%, %d.3%",
+ "text": "%name%\n",
"onClick": {
"name": "load",
- "file": ["towners/griswold/sell/confirm.json", "stash", "%idx%"]
+ "file": ["towners/griswold/sell/confirm.json", 2, "%idx%"]
},
"onFocus": [
"anchorLeftPentagram",
@@ -88,42 +87,8 @@
"mainMenu.moveScrollbar"
],
"executeAction": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.canEquipItem.stash.%idx%|",
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.stash.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|currentPlayer.item.stash.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuItemText.json", "hero", 2, "%idx%", "%menuIdx%"]
}
}
},
diff --git a/gamefilesd/towners/pepin/buy/confirm2.json b/gamefilesd/towners/pepin/buy/confirm2.json
index 63f81821..f7e9b639 100755
--- a/gamefilesd/towners/pepin/buy/confirm2.json
+++ b/gamefilesd/towners/pepin/buy/confirm2.json
@@ -110,56 +110,11 @@
]
}
],
+ "load": ["towners/common/setItemInfo.json", "pepin", "{1}", "{2}"],
+ "load": ["towners/common/setPriceInfo.json", "pepin", "{1}", "{2}",
+ "|currentLevel|player.pepin.item.{1}.{2}.price|"],
"action": [
"anchorLeftPentagram",
- "anchorRightPentagram",
- {
- "name": "text.setTextFromQuery",
- "id": "itemInfo",
- "query": "currentLevel.player.pepin.item.{1}.{2}",
- "text": "%name%\n %d.0%, %d.3%",
- "removeEmptyLines": true
- },
- {
- "name": "text.setTextFromQuery",
- "id": "itemPrice",
- "query": "currentLevel.player.pepin.item.{1}.{2}",
- "text": "%price%"
- },
- {
- "replaceVars": true,
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "pepin", "inventory": {1}, "item": {2} }
- },
- "param2": false,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textRed%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textRed%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.pepin.item.{1}.{2}.unique|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textGold%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textGold%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.pepin.item.{1}.{2}.magical|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textBlue%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textBlue%" }
- ],
- "else": [
- { "name": "text.setColor", "id": "itemInfo" },
- { "name": "text.setColor", "id": "itemPrice" }
- ]
- }
- }
- }
+ "anchorRightPentagram"
]
}
\ No newline at end of file
diff --git a/gamefilesd/towners/pepin/buy/listItems.json b/gamefilesd/towners/pepin/buy/listItems.json
index 8e48e7ef..428708c9 100755
--- a/gamefilesd/towners/pepin/buy/listItems.json
+++ b/gamefilesd/towners/pepin/buy/listItems.json
@@ -2,6 +2,7 @@
"load": "ui/level/panel/big/upperSeparator.json",
"load": "ui/level/panel/big/lowerSeparator.json",
"load": "ui/level/panel/big/scrollbar.json",
+ "load": "towners/common/loadMenuButtons.json",
"keyboard": [
{
"key": "tab",
@@ -13,43 +14,8 @@
"action": "focus.moveDown"
}
],
- "button": [
- {
- "id": "btnItem1",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 94],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 0 }
- },
- {
- "id": "btnItem2",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 142],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 1 }
- },
- {
- "id": "btnItem3",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 190],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 2 }
- },
- {
- "id": "btnItem4",
- "texture": "empty",
- "textureRect": [518, 44],
- "position": [52, 238],
- "anchor": "none",
- "onClick": { "name": "menu.clickVisible", "id": "mainMenu", "index": 3 }
- }
- ],
"menu": {
"id": "menuPrices",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [571, 94],
@@ -63,45 +29,8 @@
"load": "currentLevel|pepin.inventory.0",
"text": "%price%",
"executeAction": {
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "pepin", "inventory": 0, "item": "%idx%" }
- },
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.pepin.item.0.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.pepin.item.0.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuPriceText.json", "pepin", 0, "%idx%", "%menuIdx%"]
}
}
},
diff --git a/gamefilesd/towners/pepin/buy/panel.json b/gamefilesd/towners/pepin/buy/panel.json
index a220342f..3e83dd2f 100755
--- a/gamefilesd/towners/pepin/buy/panel.json
+++ b/gamefilesd/towners/pepin/buy/panel.json
@@ -56,7 +56,6 @@
],
"menu": {
"id": "mainMenu",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [52, 94],
@@ -68,12 +67,12 @@
"focusSound": "titlemov",
"visibleItems": 4,
"size": [518, 186],
- "verticalPad": 26,
+ "verticalPad": 14,
"onScrollDown": "focus.moveDown",
"onScrollUp": "focus.moveUp",
"items": {
"load": "currentLevel|pepin.inventory.0",
- "text": "%name%\n %d.0%, %d.3%",
+ "text": "%name%\n",
"onClick": {
"name": "load",
"file": ["towners/pepin/buy/confirm.json", 0, "%idx%"]
@@ -84,45 +83,8 @@
"mainMenu.moveScrollbar"
],
"executeAction": {
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "pepin", "inventory": 0, "item": "%idx%" }
- },
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.pepin.item.0.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.pepin.item.0.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuItemText.json", "pepin", 0, "%idx%", "%menuIdx%"]
}
}
},
diff --git a/gamefilesd/towners/wirt/buy/confirm2.json b/gamefilesd/towners/wirt/buy/confirm2.json
index 9a0ca57c..14667095 100755
--- a/gamefilesd/towners/wirt/buy/confirm2.json
+++ b/gamefilesd/towners/wirt/buy/confirm2.json
@@ -99,56 +99,11 @@
]
}
],
+ "load": ["towners/common/setItemInfo.json", "wirt", "{1}", "{2}"],
+ "load": ["towners/common/setPriceInfo.json", "wirt", "{1}", "{2}",
+ "|currentLevel|player.wirt.item.{1}.{2}.price|"],
"action": [
"anchorLeftPentagram",
- "anchorRightPentagram",
- {
- "name": "text.setTextFromQuery",
- "id": "itemInfo",
- "query": "currentLevel.player.wirt.item.{1}.{2}",
- "text": "%name%\n %d.0%, %d.3%",
- "removeEmptyLines": true
- },
- {
- "name": "text.setTextFromQuery",
- "id": "itemPrice",
- "query": "currentLevel.player.wirt.item.{1}.{2}",
- "text": "%price%"
- },
- {
- "replaceVars": true,
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "wirt", "inventory": {1}, "item": {2} }
- },
- "param2": false,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textRed%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textRed%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.wirt.item.{1}.{2}.unique|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textGold%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textGold%" }
- ],
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.wirt.item.{1}.{2}.magical|",
- "param2": 1,
- "then": [
- { "name": "text.setColor", "id": "itemInfo", "color": "%textBlue%" },
- { "name": "text.setColor", "id": "itemPrice", "color": "%textBlue%" }
- ],
- "else": [
- { "name": "text.setColor", "id": "itemInfo" },
- { "name": "text.setColor", "id": "itemPrice" }
- ]
- }
- }
- }
+ "anchorRightPentagram"
]
}
\ No newline at end of file
diff --git a/gamefilesd/towners/wirt/buy/listItems.json b/gamefilesd/towners/wirt/buy/listItems.json
index a9a7565b..b074f8e1 100755
--- a/gamefilesd/towners/wirt/buy/listItems.json
+++ b/gamefilesd/towners/wirt/buy/listItems.json
@@ -28,7 +28,6 @@
},
"menu": {
"id": "menuPrices",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [571, 154],
@@ -42,45 +41,8 @@
"load": "currentLevel|wirt.inventory.0",
"text": "%price%",
"executeAction": {
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "wirt", "inventory": 0, "item": "%idx%" }
- },
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.wirt.item.0.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.wirt.item.0.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "menuPrices",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuPriceText.json", "wirt", 0, "%idx%", "%menuIdx%"]
}
}
},
diff --git a/gamefilesd/towners/wirt/buy/panel.json b/gamefilesd/towners/wirt/buy/panel.json
index 4d59da00..c583ca83 100755
--- a/gamefilesd/towners/wirt/buy/panel.json
+++ b/gamefilesd/towners/wirt/buy/panel.json
@@ -20,7 +20,6 @@
],
"menu": {
"id": "mainMenu",
- "replaceVars": true,
"bitmapFont": "smaltext",
"sound": "titlslct",
"position": [52, 154],
@@ -29,54 +28,17 @@
"anchor": "none",
"visibleItems": 1,
"size": [518, 186],
- "verticalPad": 26,
+ "verticalPad": 14,
"items": {
"load": "currentLevel|wirt.inventory.0",
- "text": "%name%\n %d.0%, %d.3%",
+ "text": "%name%\n",
"onClick": {
"name": "load",
"file": ["towners/wirt/buy/confirm.json", 0, "%idx%"]
},
"executeAction": {
- "name": "if.equal",
- "param1": {
- "name": "player.canEquipItem",
- "item": { "player": "wirt", "inventory": 0, "item": "%idx%" }
- },
- "param2": false,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textRed%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.wirt.item.0.%idx%.unique|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textGold%"
- },
- "else": {
- "name": "if.equal",
- "param1": "|currentLevel|player.wirt.item.0.%idx%.magical|",
- "param2": 1,
- "then": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%",
- "color": "%textBlue%"
- },
- "else": {
- "name": "menu.setColor",
- "id": "mainMenu",
- "index": "%menuIdx%"
- }
- }
- }
+ "name": "load",
+ "file": ["towners/common/setMenuItemText.json", "wirt", 0, "%idx%", "%menuIdx%"]
}
}
},
diff --git a/gamefilesd/ui/level/char/closePanels.json b/gamefilesd/ui/level/char/closePanels.json
index 254fa675..f8933465 100755
--- a/gamefilesd/ui/level/char/closePanels.json
+++ b/gamefilesd/ui/level/char/closePanels.json
@@ -1,5 +1,6 @@
{
"action": [
+ { "name": "resource.popAll", "id": "userPanel" },
{ "name": "resource.pop", "id": "charPanelLabels" },
{ "name": "resource.pop", "id": "charPanelQuests" },
{ "name": "resource.pop", "id": "charPanelInventory" },
@@ -8,6 +9,7 @@
{ "name": "drawable.visible", "id": "questPanel", "visible": false },
{ "name": "drawable.visible", "id": "invPanel", "visible": false },
{ "name": "drawable.visible", "id": "spellPanel", "visible": false },
+ "resizeLevel",
"clearPanelText"
]
}
\ No newline at end of file
diff --git a/gamefilesd/ui/level/char/panel.json b/gamefilesd/ui/level/char/panel.json
index bd3da973..3904468a 100755
--- a/gamefilesd/ui/level/char/panel.json
+++ b/gamefilesd/ui/level/char/panel.json
@@ -40,49 +40,54 @@
"id": "charPanel",
"anchor": "left",
"texture": "char",
- "captureScrollEvent": true,
+ "captureInputEvents": true,
+ "visible": false,
"onHoverEnter": "clearLevelHoverActions",
"onHoverLeave": "setLevelHoverActions",
- "visible": false
+ "onRightClick": "rightClickLevel"
},
{
"id": "invPanel",
"anchor": "right",
"position": [320, 0],
"texture": "inv",
- "captureScrollEvent": true,
+ "captureInputEvents": true,
+ "visible": false,
"onHoverEnter": "clearLevelHoverActions",
"onHoverLeave": "setLevelHoverActions",
- "visible": false
+ "onRightClick": "rightClickLevel"
},
{
"id": "questPanel",
"anchor": "left",
"texture": "quest",
- "captureScrollEvent": true,
+ "captureInputEvents": true,
+ "visible": false,
"onHoverEnter": "clearLevelHoverActions",
"onHoverLeave": "setLevelHoverActions",
- "visible": false
+ "onRightClick": "rightClickLevel"
},
{
"id": "spellPanel",
"anchor": "right",
"position": [320, 0],
"texture": "spellbk",
- "captureScrollEvent": true,
+ "captureInputEvents": true,
+ "visible": false,
"onHoverEnter": "clearLevelHoverActions",
"onHoverLeave": "setLevelHoverActions",
- "visible": false
- }
- ],
- "image": [
+ "onRightClick": "rightClickLevel"
+ },
{
"id": "panel8",
"texture": "panel8",
"position": [0, 351],
"textureRect": [0, 15, 640, 129],
- "anchor": "bottom"
- },
+ "anchor": "bottom",
+ "onRightClick": "rightClickLevel"
+ }
+ ],
+ "image": [
{
"id": "lifeOrbFull",
"texture": "panel8",
@@ -138,13 +143,6 @@
"onHoverEnter": "hideItemInfo",
"onHoverLeave": "hideItemInfo"
},
- {
- "id": "panelBackground",
- "texture": "empty",
- "position": [0, 352],
- "anchor": "bottom",
- "textureRect": [640, 128]
- },
{
"id": "char",
"texture": "empty",
@@ -152,25 +150,28 @@
"position": [9, 361],
"textureRect": [71, 19],
"clickUp": true,
- "onClick": {
- "name": "if.equal",
- "param1": "|charPanel|visible|",
- "param2": false,
- "then": [
- { "name": "resource.pop", "id": "charPanelQuests" },
- { "name": "load", "file": "ui/level/char/panelLabels.json" },
- { "name": "drawable.visible", "id": "charPanel", "visible": true },
- { "name": "drawable.visible", "id": "questPanel", "visible": false },
- "hideItemInfo"
- ],
- "else": [
- { "name": "resource.pop", "id": "charPanelLabels" },
- { "name": "resource.pop", "id": "charPanelQuests" },
- { "name": "drawable.visible", "id": "charPanel", "visible": false },
- { "name": "drawable.visible", "id": "questPanel", "visible": false },
- "setLevelHoverActions"
- ]
- },
+ "onClick": [
+ {
+ "name": "if.equal",
+ "param1": "|charPanel|visible|",
+ "param2": false,
+ "then": [
+ { "name": "resource.pop", "id": "charPanelQuests" },
+ { "name": "load", "file": "ui/level/char/panelLabels.json" },
+ { "name": "drawable.visible", "id": "charPanel", "visible": true },
+ { "name": "drawable.visible", "id": "questPanel", "visible": false },
+ "hideItemInfo"
+ ],
+ "else": [
+ { "name": "resource.pop", "id": "charPanelLabels" },
+ { "name": "resource.pop", "id": "charPanelQuests" },
+ { "name": "drawable.visible", "id": "charPanel", "visible": false },
+ { "name": "drawable.visible", "id": "questPanel", "visible": false },
+ "setLevelHoverActions"
+ ]
+ },
+ "resizeLevel"
+ ],
"onClickIn": { "name": "button.setTexture", "id": "char", "texture": "panel8bu" },
"onClickOut": { "name": "button.setTexture", "id": "char", "texture": "empty" },
"onHoverEnter": {
@@ -192,24 +193,27 @@
"position": [9, 387],
"textureRect": [0, 19, 71, 19],
"clickUp": true,
- "onClick": {
- "name": "if.equal",
- "param1": "|questPanel|visible|",
- "param2": false,
- "then": [
- { "name": "resource.pop", "id": "charPanelLabels" },
- { "name": "load", "file": "ui/level/char/panelQuests.json" },
- { "name": "drawable.visible", "id": "charPanel", "visible": false },
- { "name": "drawable.visible", "id": "questPanel", "visible": true }
- ],
- "else": [
- { "name": "resource.pop", "id": "charPanelLabels" },
- { "name": "resource.pop", "id": "charPanelQuests" },
- { "name": "drawable.visible", "id": "charPanel", "visible": false },
- { "name": "drawable.visible", "id": "questPanel", "visible": false },
- "setLevelHoverActions"
- ]
- },
+ "onClick": [
+ {
+ "name": "if.equal",
+ "param1": "|questPanel|visible|",
+ "param2": false,
+ "then": [
+ { "name": "resource.pop", "id": "charPanelLabels" },
+ { "name": "load", "file": "ui/level/char/panelQuests.json" },
+ { "name": "drawable.visible", "id": "charPanel", "visible": false },
+ { "name": "drawable.visible", "id": "questPanel", "visible": true }
+ ],
+ "else": [
+ { "name": "resource.pop", "id": "charPanelLabels" },
+ { "name": "resource.pop", "id": "charPanelQuests" },
+ { "name": "drawable.visible", "id": "charPanel", "visible": false },
+ { "name": "drawable.visible", "id": "questPanel", "visible": false },
+ "setLevelHoverActions"
+ ]
+ },
+ "resizeLevel"
+ ],
"onClickIn": { "name": "button.setTexture", "id": "quest", "texture": "panel8bu" },
"onClickOut": { "name": "button.setTexture", "id": "quest", "texture": "empty" },
"onHoverEnter": {
@@ -231,24 +235,27 @@
"position": [560, 361],
"textureRect": [0, 76, 71, 19],
"clickUp": true,
- "onClick": {
- "name": "if.equal",
- "param1": "|invPanel|visible|",
- "param2": false,
- "then": [
- { "name": "resource.pop", "id": "charPanelSpells" },
- { "name": "load", "file": "ui/level/char/panelInventory.json" },
- { "name": "drawable.visible", "id": "invPanel", "visible": true },
- { "name": "drawable.visible", "id": "spellPanel", "visible": false }
- ],
- "else": [
- { "name": "resource.pop", "id": "charPanelInventory" },
- { "name": "resource.pop", "id": "charPanelSpells" },
- { "name": "drawable.visible", "id": "invPanel", "visible": false },
- { "name": "drawable.visible", "id": "spellPanel", "visible": false },
- "setLevelHoverActions"
- ]
- },
+ "onClick": [
+ {
+ "name": "if.equal",
+ "param1": "|invPanel|visible|",
+ "param2": false,
+ "then": [
+ { "name": "resource.pop", "id": "charPanelSpells" },
+ { "name": "load", "file": "ui/level/char/panelInventory.json" },
+ { "name": "drawable.visible", "id": "invPanel", "visible": true },
+ { "name": "drawable.visible", "id": "spellPanel", "visible": false }
+ ],
+ "else": [
+ { "name": "resource.pop", "id": "charPanelInventory" },
+ { "name": "resource.pop", "id": "charPanelSpells" },
+ { "name": "drawable.visible", "id": "invPanel", "visible": false },
+ { "name": "drawable.visible", "id": "spellPanel", "visible": false },
+ "setLevelHoverActions"
+ ]
+ },
+ "resizeLevel"
+ ],
"onClickIn": { "name": "button.setTexture", "id": "inv", "texture": "panel8bu" },
"onClickOut": { "name": "button.setTexture", "id": "inv", "texture": "empty" },
"onHoverEnter": {
@@ -270,24 +277,27 @@
"position": [560, 387],
"textureRect": [0, 95, 71, 19],
"clickUp": true,
- "onClick": {
- "name": "if.equal",
- "param1": "|spellPanel|visible|",
- "param2": false,
- "then": [
- { "name": "resource.pop", "id": "charPanelInventory" },
- { "name": "load", "file": "ui/level/char/panelSpells.json" },
- { "name": "drawable.visible", "id": "invPanel", "visible": false },
- { "name": "drawable.visible", "id": "spellPanel", "visible": true }
- ],
- "else": [
- { "name": "resource.pop", "id": "charPanelInventory" },
- { "name": "resource.pop", "id": "charPanelSpells" },
- { "name": "drawable.visible", "id": "invPanel", "visible": false },
- { "name": "drawable.visible", "id": "spellPanel", "visible": false },
- "setLevelHoverActions"
- ]
- },
+ "onClick": [
+ {
+ "name": "if.equal",
+ "param1": "|spellPanel|visible|",
+ "param2": false,
+ "then": [
+ { "name": "resource.pop", "id": "charPanelInventory" },
+ { "name": "load", "file": "ui/level/char/panelSpells.json" },
+ { "name": "drawable.visible", "id": "invPanel", "visible": false },
+ { "name": "drawable.visible", "id": "spellPanel", "visible": true }
+ ],
+ "else": [
+ { "name": "resource.pop", "id": "charPanelInventory" },
+ { "name": "resource.pop", "id": "charPanelSpells" },
+ { "name": "drawable.visible", "id": "invPanel", "visible": false },
+ { "name": "drawable.visible", "id": "spellPanel", "visible": false },
+ "setLevelHoverActions"
+ ]
+ },
+ "resizeLevel"
+ ],
"onClickIn": { "name": "button.setTexture", "id": "spell", "texture": "panel8bu" },
"onClickOut": { "name": "button.setTexture", "id": "spell", "texture": "empty" },
"onHoverEnter": {
diff --git a/gamefilesd/ui/level/menu/game2.json b/gamefilesd/ui/level/menu/game2.json
index 33980abf..f1801b9b 100755
--- a/gamefilesd/ui/level/menu/game2.json
+++ b/gamefilesd/ui/level/menu/game2.json
@@ -53,8 +53,8 @@
"name": "if.equal",
"param1": "%colorCycling%",
"param2": true,
- "then": { "name": "button.setText", "id": "colorCycling", "text": "Color Cycling On" },
- "else": { "name": "button.setText", "id": "colorCycling", "text": "Color Cycling Off" }
+ "then": { "name": "text.setText", "id": "colorCycling", "text": "Color Cycling On" },
+ "else": { "name": "text.setText", "id": "colorCycling", "text": "Color Cycling Off" }
}
},
{
diff --git a/gamefilesd/ui/level/panel/big.json b/gamefilesd/ui/level/panel/big.json
index f723a3a0..380e50fb 100755
--- a/gamefilesd/ui/level/panel/big.json
+++ b/gamefilesd/ui/level/panel/big.json
@@ -4,8 +4,8 @@
"texture": "empty",
"anchor": "all",
"textureRect": [640, 480],
- "resizable": true,
- "captureScrollEvent": true
+ "captureInputEvents": true,
+ "resizable": true
},
"image": [
{
diff --git a/gamefilesd/ui/level/panel/small.json b/gamefilesd/ui/level/panel/small.json
index fb785b51..8e7098f9 100755
--- a/gamefilesd/ui/level/panel/small.json
+++ b/gamefilesd/ui/level/panel/small.json
@@ -21,6 +21,14 @@
}
}
],
+ "button": {
+ "id": "background",
+ "texture": "empty",
+ "anchor": "all",
+ "textureRect": [640, 480],
+ "captureInputEvents": true,
+ "resizable": true
+ },
"image": [
{
"id": "textWallBackground",
@@ -42,13 +50,5 @@
"textureRect": [2, 0, 266, 3],
"texture": "textbox2"
}
- ],
- "button": {
- "id": "background",
- "texture": "empty",
- "anchor": "all",
- "textureRect": [640, 480],
- "resizable": true,
- "captureScrollEvent": true
- }
+ ]
}
\ No newline at end of file
diff --git a/gamefilesd/ui/level/showText.json b/gamefilesd/ui/level/showText.json
index 10c40d64..9c966d04 100755
--- a/gamefilesd/ui/level/showText.json
+++ b/gamefilesd/ui/level/showText.json
@@ -28,6 +28,7 @@
"anchor": "all",
"textureRect": [640, 480],
"texture": "empty",
+ "captureInputEvents": true,
"resizable": true,
"onClick": [
{ "name": "resource.pop" },
diff --git a/gamefilesd/ui/mainMenu.json b/gamefilesd/ui/mainMenu.json
index 65d97f89..6fbf71b2 100755
--- a/gamefilesd/ui/mainMenu.json
+++ b/gamefilesd/ui/mainMenu.json
@@ -169,9 +169,9 @@
"file": "ui/settings.json"
}
},
- "onHoverEnter": { "name": "button.setText", "id": "versionInfo", "text": "Change Settings" },
+ "onHoverEnter": { "name": "text.setText", "id": "versionInfo", "text": "Change Settings" },
"onHoverLeave": {
- "name": "button.setText",
+ "name": "text.setText",
"id": "versionInfo",
"binding": ["|game|title|", "|game|version|"],
"format": "[1] v[2]"
@@ -180,7 +180,7 @@
"action": [
{ "name": "menu.setFont", "id": "menu", "index": 1, "idFont": "font42y" },
{
- "name": "button.setText",
+ "name": "text.setText",
"id": "versionInfo",
"binding": ["|game|title|", "|game|version|"],
"format": "[1] v[2]"
diff --git a/gamefilesd/ui/settings.json b/gamefilesd/ui/settings.json
index d75d4e2c..1afd47af 100755
--- a/gamefilesd/ui/settings.json
+++ b/gamefilesd/ui/settings.json
@@ -107,11 +107,11 @@
"param2": false,
"then": [
{ "name": "loadJson", "json": { "stretchToFit": true } },
- { "name": "button.setText", "id": "stretchToFit", "text": "Stretch to Fit: On" }
+ { "name": "text.setText", "id": "stretchToFit", "text": "Stretch to Fit: On" }
],
"else": [
{ "name": "loadJson", "json": { "stretchToFit": false } },
- { "name": "button.setText", "id": "stretchToFit", "text": "Stretch to Fit: Off" }
+ { "name": "text.setText", "id": "stretchToFit", "text": "Stretch to Fit: Off" }
]
},
"onFocus": [
@@ -134,11 +134,11 @@
"param2": false,
"then": [
{ "name": "loadJson", "json": { "keepAR": true } },
- { "name": "button.setText", "id": "keepAR", "text": "Keep Ratio: On" }
+ { "name": "text.setText", "id": "keepAR", "text": "Keep Ratio: On" }
],
"else": [
{ "name": "loadJson", "json": { "keepAR": false } },
- { "name": "button.setText", "id": "keepAR", "text": "Keep Ratio: Off" }
+ { "name": "text.setText", "id": "keepAR", "text": "Keep Ratio: Off" }
]
},
"onFocus": [
@@ -161,11 +161,11 @@
"param2": false,
"then": [
{ "name": "loadJson", "json": { "smoothScreen": true } },
- { "name": "button.setText", "id": "smoothScreen", "text": "Smooth Screen: On" }
+ { "name": "text.setText", "id": "smoothScreen", "text": "Smooth Screen: On" }
],
"else": [
{ "name": "loadJson", "json": { "smoothScreen": false } },
- { "name": "button.setText", "id": "smoothScreen", "text": "Smooth Screen: Off" }
+ { "name": "text.setText", "id": "smoothScreen", "text": "Smooth Screen: Off" }
]
},
"onFocus": [
@@ -191,7 +191,7 @@
"action": [
{ "name": "loadJson", "json": { "framerate": 50 } },
{
- "name": "button.setText",
+ "name": "text.setText",
"id": "framerate",
"binding": "|game|framerate|",
"format": "Framerate Limit: [1]"
@@ -203,7 +203,7 @@
"action": [
{ "name": "loadJson", "json": { "framerate": 60 } },
{
- "name": "button.setText",
+ "name": "text.setText",
"id": "framerate",
"binding": "|game|framerate|",
"format": "Framerate Limit: [1]"
@@ -215,7 +215,7 @@
"action": [
{ "name": "loadJson", "json": { "framerate": 0 } },
{
- "name": "button.setText",
+ "name": "text.setText",
"id": "framerate",
"text": "Framerate Limit: Off"
}
@@ -258,29 +258,29 @@
"name": "if.equal",
"param1": "|game|stretchToFit|",
"param2": true,
- "then": { "name": "button.setText", "id": "stretchToFit", "text": "Stretch to Fit: On" },
- "else": { "name": "button.setText", "id": "stretchToFit", "text": "Stretch to Fit: Off" }
+ "then": { "name": "text.setText", "id": "stretchToFit", "text": "Stretch to Fit: On" },
+ "else": { "name": "text.setText", "id": "stretchToFit", "text": "Stretch to Fit: Off" }
},
{
"name": "if.equal",
"param1": "|game|keepAR|",
"param2": true,
- "then": { "name": "button.setText", "id": "keepAR", "text": "Keep Ratio: On" },
- "else": { "name": "button.setText", "id": "keepAR", "text": "Keep Ratio: Off" }
+ "then": { "name": "text.setText", "id": "keepAR", "text": "Keep Ratio: On" },
+ "else": { "name": "text.setText", "id": "keepAR", "text": "Keep Ratio: Off" }
},
{
"name": "if.equal",
"param1": "|game|smoothScreen|",
"param2": true,
- "then": { "name": "button.setText", "id": "smoothScreen", "text": "Smooth Screen: On" },
- "else": { "name": "button.setText", "id": "smoothScreen", "text": "Smooth Screen: Off" }
+ "then": { "name": "text.setText", "id": "smoothScreen", "text": "Smooth Screen: On" },
+ "else": { "name": "text.setText", "id": "smoothScreen", "text": "Smooth Screen: Off" }
},
{
"name": "if.equal",
"param1": "|game|framerate|",
"param2": 0,
- "then": { "name": "button.setText", "id": "framerate", "text": "Framerate Limit: Off" },
- "else": { "name": "button.setText", "id": "framerate", "binding": "|game|framerate|", "format": "Framerate Limit: [1]" }
+ "then": { "name": "text.setText", "id": "framerate", "text": "Framerate Limit: Off" },
+ "else": { "name": "text.setText", "id": "framerate", "binding": "|game|framerate|", "format": "Framerate Limit: [1]" }
},
"anchorLeftPentagram",
"anchorRightPentagram"
diff --git a/gamefileshf/level/afterLevelLoad.json b/gamefileshf/level/afterLevelLoad.json
index 9c93da6d..b23c88da 100755
--- a/gamefileshf/level/afterLevelLoad.json
+++ b/gamefileshf/level/afterLevelLoad.json
@@ -2,12 +2,22 @@
"action": [
{
"name": "if.notEqual",
- "param1": "|currentLevel|name|",
- "param2": "Town Center",
+ "param1": "{1}",
+ "param2": "town",
"then": { "name": "player.setRestStatus", "status": 1 },
"else": { "name": "player.setRestStatus", "status": 0 }
},
- "updatePlayerTexture"
+ "updateLifeManaOrbs",
+ "updatePlayerTexture",
+ {
+ "name": "if.equal",
+ "param1": "{2}",
+ "param2": "positionPlayer",
+ "then": { "name": "load", "file": ["level/positionPlayer.json", "{3}"] }
+ }
],
+ "load": "ui/level/char/updateVisiblePanels.json",
+ "load": "level/playOrStopMusic.json",
+ "load": ["level/setMapAction.json", "{1}"],
"load": "level/player/updateSpeed.json"
}
\ No newline at end of file
diff --git a/gamefileshf/ui/level/menu/game2.json b/gamefileshf/ui/level/menu/game2.json
index 6c2efa8d..37ed16c8 100755
--- a/gamefileshf/ui/level/menu/game2.json
+++ b/gamefileshf/ui/level/menu/game2.json
@@ -33,21 +33,24 @@
{
"name": "action.set",
"id": "updateJog",
- "action": {
- "name": "if.equal",
- "param1": "%jog%",
- "param2": true,
- "then": [
- { "name": "button.setText", "id": "jog", "text": "Jog" },
- { "name": "drawable.setSizeX", "id": "progressBar4", "size": 270 },
- { "name": "drawable.anchor", "id": "option4", "idAnchor": "optbar4", "anchor": "right", "offset": [-29, 0] }
- ],
- "else": [
- { "name": "button.setText", "id": "jog", "text": "Walk" },
- { "name": "drawable.setSizeX", "id": "progressBar4", "size": 14 },
- { "name": "drawable.anchor", "id": "option4", "idAnchor": "optbar4", "anchor": "left", "offset": [29, 0] }
- ]
- }
+ "action": [
+ {
+ "name": "if.equal",
+ "param1": "%jog%",
+ "param2": true,
+ "then": [
+ { "name": "text.setText", "id": "jog", "text": "Jog" },
+ { "name": "drawable.setSizeX", "id": "progressBar4", "size": 270 },
+ { "name": "drawable.anchor", "id": "option4", "idAnchor": "optbar4", "anchor": "right", "offset": [-29, 0] }
+ ],
+ "else": [
+ { "name": "text.setText", "id": "jog", "text": "Walk" },
+ { "name": "drawable.setSizeX", "id": "progressBar4", "size": 14 },
+ { "name": "drawable.anchor", "id": "option4", "idAnchor": "optbar4", "anchor": "left", "offset": [29, 0] }
+ ]
+ },
+ { "name": "load", "file": "level/player/updateSpeed.json" }
+ ]
},
{
"name": "action.set",
@@ -275,7 +278,6 @@
"then": { "name": "variable.set", "key": "jog", "val": true },
"else": { "name": "variable.set", "key": "jog", "val": false }
},
- { "name": "load", "file": "level/player/updateSpeed.json" },
"updateJog"
]
},
diff --git a/gamefileshf/ui/mainMenu.json b/gamefileshf/ui/mainMenu.json
index fd70062e..342c191f 100755
--- a/gamefileshf/ui/mainMenu.json
+++ b/gamefileshf/ui/mainMenu.json
@@ -184,9 +184,9 @@
"file": "ui/settings.json"
}
},
- "onHoverEnter": { "name": "button.setText", "id": "versionInfo", "text": "Change Settings" },
+ "onHoverEnter": { "name": "text.setText", "id": "versionInfo", "text": "Change Settings" },
"onHoverLeave": {
- "name": "button.setText",
+ "name": "text.setText",
"id": "versionInfo",
"binding": ["|game|title|", "|game|version|"],
"format": "[1] v[2]"
@@ -195,7 +195,7 @@
"action": [
{ "name": "menu.setFont", "id": "menu", "index": 1, "idFont": "font42y" },
{
- "name": "button.setText",
+ "name": "text.setText",
"id": "versionInfo",
"binding": ["|game|title|", "|game|version|"],
"format": "[1] v[2]"
diff --git a/src/Actions/ActButton.h b/src/Actions/ActButton.h
index 6fcd0813..c77e4293 100755
--- a/src/Actions/ActButton.h
+++ b/src/Actions/ActButton.h
@@ -111,36 +111,3 @@ class ActButtonSetFont : public Action
return true;
}
};
-
-class ActButtonSetText : public Action
-{
-private:
- std::string id;
- std::string textFormat;
- std::vector bindings;
-
-public:
- ActButtonSetText(const std::string& id_, const std::string& text_)
- : id(id_), textFormat(text_) {}
-
- ActButtonSetText(const std::string& id_, const std::string& format_,
- const std::vector& bindings_) : id(id_),
- textFormat(format_), bindings(bindings_) {}
-
- virtual bool execute(Game& game)
- {
- auto button = game.Resources().getResource(id);
- if (button != nullptr)
- {
- if (bindings.empty() == true)
- {
- button->setText(game.getVarOrPropString(textFormat));
- }
- else
- {
- button->setText(Text2::getFormatString(game, bindings, textFormat));
- }
- }
- return true;
- }
-};
diff --git a/src/Actions/ActDrawable.h b/src/Actions/ActDrawable.h
index c796066a..ee91c153 100755
--- a/src/Actions/ActDrawable.h
+++ b/src/Actions/ActDrawable.h
@@ -7,14 +7,14 @@
#include
#include "Utils.h"
-class ActDrawableAddPositionOffset : public Action
+class ActDrawableAddToPosition : public Action
{
private:
std::string id;
sf::Vector2f offset;
public:
- ActDrawableAddPositionOffset(const std::string& id_, const sf::Vector2f& offset_)
+ ActDrawableAddToPosition(const std::string& id_, const sf::Vector2f& offset_)
: id(id_), offset(offset_) {}
virtual bool execute(Game& game)
@@ -28,14 +28,14 @@ class ActDrawableAddPositionOffset : public Action
}
};
-class ActDrawableAddSizeOffset : public Action
+class ActDrawableAddToSize : public Action
{
private:
std::string id;
sf::Vector2f offset;
public:
- ActDrawableAddSizeOffset(const std::string& id_, const sf::Vector2f& offset_)
+ ActDrawableAddToSize(const std::string& id_, const sf::Vector2f& offset_)
: id(id_), offset(offset_) {}
virtual bool execute(Game& game)
@@ -56,12 +56,11 @@ class ActDrawableAnchor : public Action
std::string idAnchor;
Anchor anchor;
sf::Vector2f offset;
- bool addSize;
public:
- ActDrawableAnchor(const std::string& id_, const std::string& idAnchor_, Anchor anchor_,
- const sf::Vector2f& offset_, bool addSize_)
- : id(id_), idAnchor(idAnchor_), anchor(anchor_), offset(offset_), addSize(addSize_) {}
+ ActDrawableAnchor(const std::string& id_, const std::string& idAnchor_,
+ Anchor anchor_, const sf::Vector2f& offset_)
+ : id(id_), idAnchor(idAnchor_), anchor(anchor_), offset(offset_) {}
virtual bool execute(Game& game)
{
@@ -137,11 +136,10 @@ class ActDrawableAnchorToFocused : public Action
std::string id;
Anchor anchor;
sf::Vector2f offset;
- bool addSize;
public:
- ActDrawableAnchorToFocused(const std::string& id_, Anchor anchor_, const sf::Vector2f& offset_,
- bool addSize_) : id(id_), anchor(anchor_), offset(offset_), addSize(addSize_) {}
+ ActDrawableAnchorToFocused(const std::string& id_, Anchor anchor_,
+ const sf::Vector2f& offset_) : id(id_), anchor(anchor_), offset(offset_) {}
virtual bool execute(Game& game)
{
@@ -182,7 +180,7 @@ class ActDrawableCenterOnMouseX : public Action
{
auto itemPos = itemAnchor->Position();
auto itemSize = item->Size().x;
- auto newRange = std::max(0u, std::min(range - (unsigned)itemSize, range));
+ auto newRange = std::min(range - (unsigned)itemSize, range);
auto offset = std::max(0.f, std::min(game.MousePositionf().x - itemPos.x, (float)range));
auto numSteps = game.getVarOrProp(steps, -1);
float newPos = itemPos.x;
@@ -236,7 +234,7 @@ class ActDrawableCenterOnMouseY : public Action
{
auto itemPos = itemAnchor->Position();
auto itemSize = item->Size().y;
- auto newRange = std::max(0u, std::min(range - (unsigned)itemSize, range));
+ auto newRange = std::min(range - (unsigned)itemSize, range);
auto offset = std::max(0.f, std::min(game.MousePositionf().y - itemPos.y, (float)range));
auto numSteps = game.getVarOrProp(steps, -1);
float newPos = itemPos.y;
@@ -284,6 +282,31 @@ class ActDrawableDelete : public Action
}
};
+class ActDrawableExecuteAction : public Action
+{
+private:
+ std::string id;
+ uint16_t actionHash16;
+
+public:
+ ActDrawableExecuteAction(const std::string& id_, uint16_t actionHash16_)
+ : id(id_), actionHash16(actionHash16_) {}
+
+ virtual bool execute(Game& game)
+ {
+ auto item = game.Resources().getResource(id);
+ if (item != nullptr)
+ {
+ auto action = item->getAction(actionHash16).get();
+ if (action != nullptr)
+ {
+ return action->execute(game);
+ }
+ }
+ return true;
+ }
+};
+
class ActDrawableHorizontalAnchorToFocused : public Action
{
private:
diff --git a/src/Actions/ActGame.h b/src/Actions/ActGame.h
index 15a6c8ff..1c4f2568 100755
--- a/src/Actions/ActGame.h
+++ b/src/Actions/ActGame.h
@@ -33,7 +33,7 @@ class ActGameEnableInput : public Action
virtual bool execute(Game& game)
{
- game.enableInput(enable);
+ game.EnableInput(enable);
return true;
}
};
diff --git a/src/Actions/ActMenu.h b/src/Actions/ActMenu.h
index 8eaa805b..d153fe24 100755
--- a/src/Actions/ActMenu.h
+++ b/src/Actions/ActMenu.h
@@ -5,8 +5,56 @@
#include "Game.h"
#include "Menu.h"
#include
+#include "TextUtils.h"
#include "Variable.h"
+class ActMenuAppendText : public Action
+{
+private:
+ std::string id;
+ size_t idx;
+ std::string textFormat;
+ std::vector bindings;
+ TextUtils::TextOp textOp;
+
+public:
+ ActMenuAppendText(const std::string& id_, size_t idx_,
+ const std::string& text_, TextUtils::TextOp textOp_)
+ : id(id_), idx(idx_), textFormat(text_), textOp(textOp_) {}
+
+ ActMenuAppendText(const std::string& id_, size_t idx_,
+ const std::string& text_, const std::string& query_)
+ : id(id_), idx(idx_), textFormat(text_),
+ textOp(TextUtils::TextOp::Query)
+ {
+ bindings.push_back(query_);
+ }
+
+ ActMenuAppendText(const std::string& id_,
+ size_t idx_, const std::string& format_,
+ const std::vector& bindings_)
+ : id(id_), idx(idx_), textFormat(format_),
+ bindings(bindings_), textOp(TextUtils::TextOp::FormatString) {}
+
+ void RemoveEmptyLines() { textOp |= TextUtils::TextOp::RemoveEmptyLines; }
+ void Trim() { textOp |= TextUtils::TextOp::Trim; }
+
+ virtual bool execute(Game& game)
+ {
+ auto menu = game.Resources().getResource