forked from Mirrors/openclonk
Improved .hgignore
commit
3148d551fa
27
.hgignore
27
.hgignore
|
@ -11,12 +11,15 @@ c4group
|
|||
.dirstamp
|
||||
*.a
|
||||
*.c4p
|
||||
planet/Records.c4f
|
||||
*.lib
|
||||
*.vcproj
|
||||
*.dll
|
||||
stamp-h1
|
||||
config.h
|
||||
config.log
|
||||
config.status
|
||||
hgrevision.h
|
||||
hgrevision
|
||||
Makefile
|
||||
C4Include.h.gch
|
||||
Makefile.in
|
||||
|
@ -35,6 +38,7 @@ deps/
|
|||
planet/Release
|
||||
planet/RelWithDebInfo
|
||||
planet/Debug
|
||||
planet/MinSizeRel
|
||||
planet/CMakeFiles
|
||||
planet/clonk.dir
|
||||
planet/c4group.dir
|
||||
|
@ -45,6 +49,21 @@ planet/cmake_install.cmake
|
|||
planet/clonk.sln
|
||||
planet/clonk.ilk
|
||||
planet/CMakeCache.txt
|
||||
Release
|
||||
RelWithDebInfo
|
||||
MinSizeRel
|
||||
Debug
|
||||
CMakeFiles
|
||||
clonk.dir
|
||||
c4group.dir
|
||||
ZERO_CHECK.dir
|
||||
libeay32.dll
|
||||
fmod.dll
|
||||
cmake_install.cmake
|
||||
clonk.sln
|
||||
clonk.ilk
|
||||
CMakeCache.txt
|
||||
*.vcproj
|
||||
|
||||
# Temporary files created by Microsoft Visual Studio
|
||||
*.ncb
|
||||
|
@ -56,6 +75,9 @@ planet/CMakeCache.txt
|
|||
BuildLog.htm
|
||||
*.user
|
||||
*.positions
|
||||
*.idb
|
||||
*.pdb
|
||||
*.ilk
|
||||
|
||||
# TortoiseHg loves to generate those
|
||||
*.orig
|
||||
|
@ -65,7 +87,8 @@ BuildLog.htm
|
|||
xcode/build
|
||||
*.xcodeproj
|
||||
|
||||
|
||||
# Binaries
|
||||
planet/Clonk.app
|
||||
planet/clonk.exe
|
||||
*.exe
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ local inventory;
|
|||
|
||||
/* Item limit */
|
||||
|
||||
private func HandObjects() { return 2; }
|
||||
public func MaxContentsCount() { return 5; }
|
||||
|
||||
/* Item select access*/
|
||||
|
@ -173,14 +174,14 @@ public func Switch2Items(int one, int two)
|
|||
else if (two == selected2) if (inventory[two]) inventory[two]->~Selection(this,true);
|
||||
|
||||
// callbacks: to self, for HUD
|
||||
if (one < 2)
|
||||
if (one < HandObjects())
|
||||
{
|
||||
if (inventory[one])
|
||||
this->~OnSlotFull(one);
|
||||
else
|
||||
this->~OnSlotEmpty(one);
|
||||
}
|
||||
if (two < 2)
|
||||
if (two < HandObjects())
|
||||
{
|
||||
if (inventory[two])
|
||||
this->~OnSlotFull(two);
|
||||
|
@ -211,7 +212,8 @@ public func Collect(object item, bool ignoreOCF, int pos)
|
|||
if (success)
|
||||
{
|
||||
inventory[pos] = item;
|
||||
this->~OnSlotFull(pos);
|
||||
if (pos < HandObjects())
|
||||
this->~OnSlotFull(pos);
|
||||
}
|
||||
|
||||
return success;
|
||||
|
@ -279,7 +281,8 @@ protected func Collection2(object obj)
|
|||
}
|
||||
// callbacks
|
||||
if (success)
|
||||
this->~OnSlotFull(sel);
|
||||
if (sel < HandObjects())
|
||||
this->~OnSlotFull(sel);
|
||||
|
||||
if (sel == selected || sel == selected2)
|
||||
obj->~Selection(this,sel == selected2);
|
||||
|
@ -308,7 +311,9 @@ protected func Ejection(object obj)
|
|||
if (using == obj) CancelUse();
|
||||
|
||||
// callbacks
|
||||
if (success) this->~OnSlotEmpty(i);
|
||||
if (success)
|
||||
if (i < HandObjects())
|
||||
this->~OnSlotEmpty(i);
|
||||
|
||||
if (i == selected || i == selected2)
|
||||
obj->~Deselection(this,i == selected2);
|
||||
|
@ -326,7 +331,8 @@ protected func Ejection(object obj)
|
|||
inventory[i] = Contents(c);
|
||||
indexed_inventory++;
|
||||
|
||||
this->~OnSlotFull(i);
|
||||
if (i < HandObjects())
|
||||
this->~OnSlotFull(i);
|
||||
|
||||
if (i == selected || i == selected2)
|
||||
Contents(c)->~Selection(this,i == selected2);
|
||||
|
|
|
@ -644,6 +644,17 @@ bool C4PlayerControl::CSync::SetControlDisabled(int32_t iControl, int32_t iVal)
|
|||
return true;
|
||||
}
|
||||
|
||||
void C4PlayerControl::CSync::InitDefaults(const C4PlayerControlDefs &ControlDefs)
|
||||
{
|
||||
const C4PlayerControlDef *def;
|
||||
int32_t i=0;
|
||||
while (def = ControlDefs.GetControlByIndex(i))
|
||||
{
|
||||
if (def->IsDefaultDisabled()) SetControlDisabled(i, true);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
void C4PlayerControl::CSync::Clear()
|
||||
{
|
||||
ControlDownStates.clear();
|
||||
|
@ -662,10 +673,18 @@ bool C4PlayerControl::CSync::operator ==(const CSync &cmp) const
|
|||
&& ControlDisableStates == cmp.ControlDisableStates;
|
||||
}
|
||||
|
||||
void C4PlayerControl::Init()
|
||||
{
|
||||
// defaultdisabled controls
|
||||
Sync.InitDefaults(ControlDefs);
|
||||
}
|
||||
|
||||
void C4PlayerControl::CompileFunc(StdCompiler *pComp)
|
||||
{
|
||||
// compile sync values only
|
||||
pComp->Value(mkNamingAdapt(Sync, "PlayerControl", CSync()));
|
||||
CSync DefaultSync;
|
||||
DefaultSync.InitDefaults(ControlDefs);
|
||||
pComp->Value(mkNamingAdapt(Sync, "PlayerControl", DefaultSync));
|
||||
}
|
||||
|
||||
bool C4PlayerControl::ProcessKeyEvent(const C4KeyCodeEx &pressed_key, const C4KeyCodeEx &matched_key, bool fUp, const C4KeyEventData &rKeyExtraData)
|
||||
|
|
|
@ -66,6 +66,7 @@ class C4PlayerControlDef
|
|||
bool IsGlobal() const { return fGlobal; }
|
||||
int32_t GetRepeatDelay() const { return iRepeatDelay; }
|
||||
int32_t GetInitialRepeatDelay() const { return iInitialRepeatDelay; }
|
||||
bool IsDefaultDisabled() const { return fDefaultDisabled; }
|
||||
|
||||
//C4PlayerControlDef &operator =(const C4PlayerControlDef &src);
|
||||
bool operator ==(const C4PlayerControlDef &cmp) const;
|
||||
|
@ -314,6 +315,7 @@ class C4PlayerControl
|
|||
void SetControlDownState(int32_t iControl, const C4KeyEventData &rDownState, int32_t iDownFrame, bool fDownByUser);
|
||||
bool SetControlDisabled(int32_t iControl, int32_t iVal);
|
||||
|
||||
void InitDefaults(const C4PlayerControlDefs &ControlDefs);
|
||||
void Clear();
|
||||
void CompileFunc(StdCompiler *pComp);
|
||||
bool operator ==(const CSync &cmp) const;
|
||||
|
@ -340,6 +342,11 @@ class C4PlayerControl
|
|||
~C4PlayerControl() { Clear(); }
|
||||
void Clear();
|
||||
|
||||
// first-time init call after player join
|
||||
// not called again after control set change/savegame resume
|
||||
// does DefaultDisabled controls
|
||||
void Init();
|
||||
|
||||
void CompileFunc(StdCompiler *pComp);
|
||||
|
||||
void RegisterKeyset(int32_t iPlr, C4PlayerControlAssignmentSet *pKeyset); // register all keys into Game.KeyboardInput creating KeyBindings
|
||||
|
@ -361,6 +368,7 @@ class C4PlayerControl
|
|||
bool SetControlDisabled(int ctrl, bool is_disabled) { return Sync.SetControlDisabled(ctrl, is_disabled); }
|
||||
bool IsControlDisabled(int ctrl) const { return Sync.IsControlDisabled(ctrl); }
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -339,6 +339,9 @@ bool C4Player::Init(int32_t iNumber, int32_t iAtClient, const char *szAtClientNa
|
|||
// Init control method before scenario init, because script callbacks may need to know it!
|
||||
InitControl();
|
||||
|
||||
// defaultdisabled controls
|
||||
Control.Init();
|
||||
|
||||
// Special: Script players may skip scenario initialization altogether, and just desire a single callback to all objects
|
||||
// of a given ID
|
||||
if (!pInfo->IsScenarioInitDesired())
|
||||
|
|
Loading…
Reference in New Issue