Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
thelink2012 committed Feb 2, 2015
2 parents 6eb5434 + 60b6e3b commit 343d540
Show file tree
Hide file tree
Showing 146 changed files with 4,141 additions and 1,373 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If you are building from the source code, it is very simple to compile. You'll n
+ [Premake](http://industriousone.com/premake/download) 5 *(pre-built executable available in this repository root)*
+ An C++11 compiler, tested under:
- [Visual Studio](http://www.visualstudio.com/downloads) 2013 or greater
- [MinGW](http://mingw-w64.sourceforge.net/download.php) 4.8.2 or greater
- [MinGW](http://mingw-w64.sourceforge.net/download.php) 4.9.0 or greater _(currently have build errors with gta3.std.data)_


Then, in a command-line shell go into the repository root directory and run the commands:
Expand Down
23 changes: 0 additions & 23 deletions deps/datalib/LICENSE

This file was deleted.

7 changes: 0 additions & 7 deletions deps/datalib/WHERE_IS_CXX14

This file was deleted.

39 changes: 0 additions & 39 deletions deps/datalib/include/datalib/data_info/dyncontainer.hpp

This file was deleted.

1 change: 0 additions & 1 deletion deps/dummy.cpp

This file was deleted.

19 changes: 10 additions & 9 deletions deps/injector/include/injector/hooking.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ namespace injector

protected: // Forwarders to the function hooker manager

void make_call(typename functor_type functor, memory_pointer_raw ptr)
void make_call(functor_type functor, memory_pointer_raw ptr)
{
this->has_call = true;
manager->make_call(*this, std::move(functor), ptr);
Expand Down Expand Up @@ -656,27 +656,28 @@ namespace injector
}

/*
* Makes a hook which is alive for the entire lifetime of this program
* Makes a hook which is alive until it gets out of scope
* 'T' must be any function_hooker object
*/
template<class T, class F> inline
T& make_static_hook(F functor)
T make_function_hook(F functor)
{
return add_static_hook(make_function_hook<T>(std::move(functor)));
T a;
a.make_call(std::move(functor));
return a;
}

/*
* Makes a hook which is alive until it gets out of scope
* Makes a hook which is alive for the entire lifetime of this program
* 'T' must be any function_hooker object
*/
template<class T, class F> inline
T make_function_hook(F functor)
T& make_static_hook(F functor)
{
T a;
a.make_call(std::move(functor));
return a;
return add_static_hook(make_function_hook<T>(std::move(functor)));
}


// TODO when we have access to C++14 add a make_function_hook, make_stdcall_function_hook, and so on
// the problem behind implement it with C++11 is that lambdas cannot be generic and the first param of a hook is a functor pointing
// to the previous call pointer
Expand Down
23 changes: 0 additions & 23 deletions deps/type_wrapper/LICENSE

This file was deleted.

12 changes: 12 additions & 0 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
v0.2.3 (Feb 02 2015)
------------------------
* The In-Game menu is ready to be used _(go into Options > Mod Loader Setup)_. _(make sure it's enabled from *modloader/.data/config.ini*, EnableMenu=true)_
* Automatic refreshing implemented, meaning changes on *modloader/* directory are detected automatically while you play.
* The refresh key _(by default F4)_ has been removed in consequence of the addition of the menu and automatic refreshing.
* Implemented *weapon.dat* merger and readme reader.
* Implemented *ar_stats.dat, animgrp.dat, ped.dat, pedstats.dat, pedgrp.dat, cargrp.dat, melee.dat, statdisp.dat, shopping.dat, surface.dat, surfinfo.dat, surfaud.dat, object.dat, procobj.dat and decision makers* merger.
* Implemented *clothes.dat, furnitur.dat, fonts.dat, roadblox.dat, tracks.dat, tracks2.dat, tracks3.dat and tracks4.dat* overrider.
* Removed the *-mod* command-line, something better than that will come up later (*-nomods* is still available!).
* Fixed no date-time in the load game menu screen.
* Other minor fixes

v0.2.2 (Jan 13 2015)
------------------------
* The game version *GTA San Andreas 1.0 EU* is now supported.
Expand Down
9 changes: 0 additions & 9 deletions doc/Command Line Arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@ Mod Loader Command Line

Mod Loader allows certain command line arguments to get passed to the game executable

* -mod _modname_

This command line option makes Mod Loader load only _modname_ from the *modloader* directory.
That's essentially the same as going into *modloader.ini*, enabling *ExcludeAllMods*, and adding _modname_ into *[IncludeMods]* section

__Usage__: `gta_sa.exe -mod grandcarma`

This will make Mod Loader load *modloader/grandcarma* with priority 20 and other mods at *[IncludeMods]* section of *modloader.ini*, but no other mod gets loaded.

* -nomods

No modification from *modloader* directory gets loaded when this argument is used.
Expand Down
8 changes: 4 additions & 4 deletions doc/Creating Your Own Plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ Now it's time to implement the events, they are virtual methods from the `modloa
An example is, *a.model* has the same behaviour as another *a.model* but not the same as *b.model*.
Two files with the same behaviour will never be installed at the same time.

_Special Note_: Since the object is non-const, it's important to note that you shall not write to any field of `file` other than `behaviour` during this event.

_Special Note 1_: The highest bit of the `behaviour` is reserved and shouldn't be touched.
_Special Note 2_: Since the object is non-const, it's important to note that you shall not write to any field of `file` other than `behaviour` during this event.

#### InstallFile -- `bool InstallFile(const modloader::file& file)`

Expand All @@ -96,15 +96,15 @@ Now it's time to implement the events, they are virtual methods from the `modloa
This event is called to reinstall a file previosly installed meaning the file has changed in some way. The file behaviour is guaranted to not have changed during the file change.

The method should return **true** if the reinstall was successful and **false** otherwise.
If the install wasn't successful, the file will get uninstalled, essentially by calling `UninstallFile`.
Please note if both `ReinstallFile` and `UninstallFile` fails, an fatal error will happen!
If the reinstall wasn't successful, the file will get uninstalled, essentially by calling `UninstallFile`.
The return value is ignored for *CALLME* handlers.

#### UninstallFile -- `bool UninstallFile(const modloader::file& file)`

This event is called to uninstall a file that was previosly installed.

The method should return **true** if the uninstall was successful and **false** otherwise.
If the uninstall wasn't successful the file will still be in 'installed' state.
The return value is ignored for *CALLME* handlers.

#### Update -- [optional] `void Update()`
Expand Down
4 changes: 2 additions & 2 deletions doc/config/config.ini.0
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
; Mod Loader Basic Config File
;
[Config]
EnableMenu = false ; (INCOMPLETE FEATURE) Enables/disables the menu system (Menu > Options > Mod Loader)
EnableMenu = true ; Enables/disables the menu system (Menu > Options > Mod Loader)
EnablePlugins = true ; Enables/disables plugins from "modloader/.data/plugins", you probably want to have them enabled since they are responssible for loading stuff...
EnableLog = true ; Enables/disables logging. Logging is useful to find bugs or know what's going on, but it slow downs the game, so disable it if you don't care about logs
ImmediateFlushLog = true ; Enables/disables immediate flushing to the disk from the log file. Disabling this increases performance when logging is enabled but decreases logging usefulness
MaxLogSize = 5242880 ; Maximum size of the modloader.log file in bytes, if this size is reached the file is truncated.
RefreshKey = 0x73 ; Key used to refresh mods (virtual key code, see http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731%28v=vs.85%29.aspx)
AutoRefresh = true ; Mod Loader detects changes in modloader/ directory automatically and refreshes the mods
36 changes: 29 additions & 7 deletions doc/plugins/gta3/std.data.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,51 @@ The following data files are currently supported:

| Data File Name | Override | Merge | Readme |
|----------------|--------- |-------|--------|
| ar_stats.dat | X | X | |
| animgrp.dat | X | X | |
| gta.dat | X | X | X |
| .ide files | X | X | ¹ |
| .ipl files | X | X | |
| carmods.dat | X | X | X |
| *.ide | X | X | ¹ |
| *.ipl/*.zon | X | | |
| *.ped/*.grp | X | X | |
| clothes.dat | X | | |
| carcols.dat | X | X | X |
| carmods.dat | X | X | X |
| handling.cfg | X | X | X |
| plants.dat | X | X | |
| melee.dat | X | X | |
| water.dat | X | X | |
| timecyc.dat | X | | |
| popcycle.dat | X | | |
| cargrp.dat | X | X | |
| pedgrp.dat | X | X | |
| ped.dat | X | X | |
| pedstats.dat | X | X | |
| statdisp.dat | X | X | |
| shopping.dat | X | X | |
| object.dat | X | X | |
| surface.dat | X | X | |
| surfinfo.dat | X | X | |
| surfaud.dat | X | X | |
| furnitur.dat | X | | |
| fonts.dat | X | | |
| roadblox.dat | X | | |
| tracks.dat | X | | |
| tracks2.dat | X | | |
| tracks3.dat | X | | |
| tracks4.dat | X | | |
| weapon.dat | X | X | X |
| procobj.dat | X | X | |

+ ¹ reading ide lines from readmes is supported for *cars*, *peds* and tunning parts in *objs* section _(i.e. vehicles.ide, peds.ide, veh_mods.ide)_


__Additional Notes__:
* Decision files (.ped/.grp) mustbe in a *decision/allowed* directory to work
* IDE and IPL that doesn't have a matching gta.dat entry are loaded anyway
* IDE and IPL files usually needs to be structured the same way as it's gta.dat demands
(i.e. IPL DATA/MAPS/TEST.IPL should be structured like modloader/My Map/data/maps/test.ipl)
although this is **NOT** necessary anymore since Mod Loader 0.2.x
* Matching for data lines in readme files are supported for some data files
* This makes the loading screen dynamic, removing the flickering when there are too few gta.dat entries (usually on TCs)
* Matching for data lines in readme files are supported for some data files
* This performs caching of the data files and readmes in the modloader directory, giving a better performance in
not needing to merge data every time you load the game.



6 changes: 0 additions & 6 deletions doc/readme/Leia-me.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ Se você só quiser desabilitar o mod por um instante, vá para o menu in-game p
\* No momento você precisa apertar F4 para recarregar os mods, alguns arquivos não são recarregáveis, porém a maioria é.



## Em Progresso

Mod Loader ainda está em progresso, portanto nem tudo é carregável ainda.
Isto é, alguns arquivos *.dat* não são carregáveis por enquanto, mas estamos trabalhando nisso.

### Encontrou uma falha?

É essencial que você reporte bugs, para que o Mod Loader seja melhorado. Para reportar um bug, vá para um dos canais a seguir:
Expand Down
10 changes: 2 additions & 8 deletions doc/readme/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,15 @@ If you just want to disable the mod for a while, go to the in-game menu and disa
\* Currently you need to press F4 to refresh the mods, also not all kinds of files can be refreshed but most of them can.



## Under Progress

Mod Loader is still under progress, thus not everything is loadable yet.
That is, some *.dat* files are not loadable for now, but we're working on it.

### You have found a bug?
### Have you found a bug?

It's essential to report bugs, so the loader gets improved, to report a bug go to any of the following channels:

* On GitHub, using [our issue tracker](https://github.com/thelink2012/sa-modloader/issues)
* English support on [GTA Forums](http://gtaforums.com/topic/669520-sarel-mod-loader/)
* Portuguese support on [Brazilian Modding Studio Forums](http://brmodstudio.forumeiros.com/t3591-mod-loader-topico-oficial)

When reporting a bug **PLEASE, FOR GOD'S SAKE** provide the *modloader/modloader.log* file created just after the crash and give some detailed information on how to reproduce the bug.
When reporting a bug **PLEASE** provide the *modloader/modloader.log* file created just after the crash and give some detailed information on how to reproduce the bug.

### Supported Executables

Expand Down
23 changes: 8 additions & 15 deletions doc/text/1033/menu.fxt
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
#

# Common
ML_FEO Mod Loader Setup
ML_FEO Mod Configuration
ML_ONN ON
ML_OFF OFF
ML_FTN Next
ML_FTP Prev
ML_FTB Back

# Main Page
ML_F0HH Mod Loader
ML_F0HH Mod Configuration
ML_F0E0 Enable Menu
ML_F0EP Enable Plugins
ML_F0EL Enable Logging
ML_F0LF Log Immediate Flush
ML_F0LS Log Maximum Size
ML_F0MM Modifications
ML_F0RR Rescan Modifications
ML_F0RR Refresh Modifications
ML_F0RA Automatic Refresh

# Modifications Page (Dynamic)
ML_FMHH Modifications
Expand All @@ -38,12 +39,7 @@ ML_FMYC DYNAMIC
# Selected Modification (Dynamic)
ML_FYHH DYNAMIC
ML_FYE0 Enabled
ML_FYIC Include
ML_FYPR Priority
ML_FYIX DYNAMIC INSTALL UNINSTALL
ML_FYI0 Install
ML_FYI1 Uninstall
ML_FYSS Rescan Files

# Helper texts
ML_H0NM No mods installed
Expand All @@ -52,11 +48,8 @@ ML_H0EP ON/OFF the loader plugins.~n~Needs restart.
ML_H0EL ON/OFF the log file.~n~OFF Increases performance.
ML_H0LF ON/OFF flushing log to disk.~n~OFF Increases performance.
ML_H0LS Maximum size of the log file on disk.
ML_H0RR Rescan and reinstall mods
ML_H0RR Rescan and reinstall mods (be careful)
ML_H0RA ON/OFF the automatic detection of changes.
ML_HMHH Type some keywords to find a mod.~n~Use ~<~~>~ to switch pages.


# Internals (DO NOT CHANGE)
ML__SM > Mods Page Search Text
ML__FR > Used by freeze

ML_HYE0 ON/OFF the mod from the game.~n~Be careful. May need restart for some files.
ML_HYPR Changes the priority of this mod over others.
6 changes: 6 additions & 0 deletions include/modloader/gta3/gta3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace modloader
using OpenFile = base<1>;
using RwStreamOpen = base<3>;
using CreateVideoPlayer = base<2>;
using ReadAndInterpretTrackFile = base<1>;
};

template<uintptr_t addr, class Traits = dtraits::LoadTxd>
Expand All @@ -58,6 +59,11 @@ namespace modloader
using CreateVideoPlayerDetour = modloader::basic_file_detour<Traits,
injector::function_hooker<addr, void*(int, const char*)>,
void*, int, const char*>;

template<uintptr_t addr, class Traits = dtraits::ReadAndInterpretTrackFile>
using ReadAndInterpretTrackFileDetour = modloader::basic_file_detour<Traits,
injector::function_hooker<addr, int(const char*, void**, int*, float*, int)>,
int, const char*, void**, int*, float*, int>;
}


Expand Down
Loading

0 comments on commit 343d540

Please sign in to comment.