forked from Mirrors/openclonk
Removed parts of the old HUD, minor fixes:
+ removed the Captain/GetCaptain/rendering + removed energy bars + added the possibility for the crew selector to display different ranks for different clonk types + fixed GetCrewSelectedstable-5.2
parent
2b2c2d7bff
commit
1537104306
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
|
||||
<!DOCTYPE funcs SYSTEM "../../../clonk.dtd">
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>GetCaptain</title>
|
||||
<category>Objekte</category><subcat>Mannschaft</subcat>
|
||||
<version>4.6.5.0 CP</version>
|
||||
<syntax>
|
||||
<rtype>object</rtype>
|
||||
<params>
|
||||
<param><type>int</type><name>iPlayer</name><desc>Spieler</desc></param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Liefert den Captain von iPlayer. Nur bei der Spielregel "Verlust Captain".</desc>
|
||||
<examples>
|
||||
<example>
|
||||
<code><funclink>Kill</funclink>(GetCaptain(2));</code>
|
||||
<text>Tötet den Captain des dritten Spielers. (Die Zählung beginnt mit 0)</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related>
|
||||
<funclink>GetHiRank</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>jwk</author><date>Juni 2002</date>
|
||||
</funcs>
|
Binary file not shown.
Before Width: | Height: | Size: 3.4 KiB |
|
@ -158,7 +158,11 @@ public func UpdateRank()
|
|||
var rankx = -1000 * GetDefWidth()/2 + 10000;
|
||||
var ranky = -15000;
|
||||
|
||||
SetGraphics(nil,RANK,10,GFXOV_MODE_Action,Format("Rank%d",nrank));
|
||||
// different rank symbols for different clonks possible
|
||||
var idRank = crew->~RankSymbolsID();
|
||||
if(!idRank) idRank = RANK;
|
||||
|
||||
SetGraphics(nil,idRank,10,GFXOV_MODE_Action,Format("Rank%d",nrank));
|
||||
SetObjDrawTransform(1000,0,rankx,0,1000,ranky, 10);
|
||||
|
||||
// extra rank (the star if the clonk is too experienced for normal ranks)
|
||||
|
|
|
@ -182,7 +182,7 @@
|
|||
#define C4FLS_Folder "Folder.txt|Title*.txt|Info.txt|Desc*.rtf|Title.png|Title.bmp|Icon.png|Icon.bmp|Author.txt|Version.txt|*.c4s|Loader*.bmp|Loader*.png|Loader*.jpeg|Loader*.jpg|FolderMap.txt|FolderMap.png"
|
||||
#define C4FLS_Material "TexMap.txt|*.bmp|*.png|*.c4m"
|
||||
#define C4FLS_Graphics "Loader*.bmp|Loader*.png|Loader*.jpeg|Loader*.jpg|FontEndeavour12.png|FontEndeavour24.png|FontEndeavour16.png|FontEndeavour10.png|Font*.png"\
|
||||
"|*.pal|Control.png|Fire.png|Background.png|Flag.png|Crew.png|Score.png|Wealth.png|Player.png|Rank.png|Entry.png|Captain.png|Cursor.png|CursorSmall.png|CursorMedium.png|CursorLarge.png|SelectMark.png|MenuSymbol.png|Menu.png|Logo.png|Construction.png|Energy.png|Magic.png|Options.png|UpperBoard.png|Arrow.png|Exit.png|Hand.png|Gamepad.png|Build.png|EnergyBars.png|Liquid.png"\
|
||||
"|*.pal|Control.png|Fire.png|Background.png|Flag.png|Crew.png|Score.png|Wealth.png|Player.png|Rank.png|Entry.png|Captain.png|Cursor.png|CursorSmall.png|CursorMedium.png|CursorLarge.png|SelectMark.png|MenuSymbol.png|Menu.png|Logo.png|Construction.png|Energy.png|Magic.png|Options.png|UpperBoard.png|Arrow.png|Exit.png|Hand.png|Gamepad.png|Build.png|Liquid.png"\
|
||||
"|GUICaption.png|GUIButton.png|GUIButtonDown.png|GUIButtonHighlight.png|GUIIcons.png|GUIIcons2.png|GUIScroll.png|GUIContext.png|GUISubmenu.png|GUICheckBox.png|GUIBigArrows.png|GUIProgress.png"\
|
||||
"|StartupScenSelBG.*|StartupPlrSelBG.*|StartupPlrPropBG.*|StartupNetworkBG.*|StartupAboutBG.*|StartupBigButton.png|StartupBigButtonDown.png|StartupBookScroll.png|StartupContext.png|StartupScenSelIcons.png|StartupScenSelTitleOv.png|StartupPlrCtrlType.png|StartupDlgPaper.png|StartupOptionIcons.png|StartupTabClip.png|StartupNetGetRef.png"
|
||||
#define C4FLS_Objects "Names*.txt|Desc*.txt|*.c4d"
|
||||
|
|
|
@ -2567,25 +2567,6 @@ void C4Object::DrawLine(C4TargetFacet &cgo)
|
|||
FinishedDrawing();
|
||||
}
|
||||
|
||||
void C4Object::DrawEnergy(C4Facet &cgo)
|
||||
{
|
||||
//cgo.DrawEnergyLevel(Energy,GetPhysical()->Energy);
|
||||
cgo.DrawEnergyLevelEx(Energy,GetPhysical()->Energy, ::GraphicsResource.fctEnergyBars, 0);
|
||||
}
|
||||
|
||||
void C4Object::DrawMagicEnergy(C4Facet &cgo)
|
||||
{
|
||||
// draw in units of MagicPhysicalFactor, so you can get a full magic energy bar by script even if partial magic energy training is not fulfilled
|
||||
//cgo.DrawEnergyLevel(MagicEnergy/MagicPhysicalFactor,GetPhysical()->Magic/MagicPhysicalFactor,39);
|
||||
cgo.DrawEnergyLevelEx(MagicEnergy/MagicPhysicalFactor,GetPhysical()->Magic/MagicPhysicalFactor, ::GraphicsResource.fctEnergyBars, 1);
|
||||
}
|
||||
|
||||
void C4Object::DrawBreath(C4Facet &cgo)
|
||||
{
|
||||
//cgo.DrawEnergyLevel(Breath,GetPhysical()->Breath,99);
|
||||
cgo.DrawEnergyLevelEx(Breath,GetPhysical()->Breath, ::GraphicsResource.fctEnergyBars, 2);
|
||||
}
|
||||
|
||||
void C4Object::CompileFunc(StdCompiler *pComp)
|
||||
{
|
||||
bool fCompiler = pComp->isCompiler();
|
||||
|
|
|
@ -236,9 +236,6 @@ class C4Object: public C4PropList
|
|||
int32_t nx, int32_t ny, int32_t nr,
|
||||
FIXED nxdir, FIXED nydir, FIXED nrdir, int32_t iController);
|
||||
void CompileFunc(StdCompiler *pComp);
|
||||
void DrawEnergy(C4Facet &cgo);
|
||||
void DrawMagicEnergy(C4Facet &cgo);
|
||||
void DrawBreath(C4Facet &cgo);
|
||||
void DrawLine(C4TargetFacet &cgo);
|
||||
void DrawCommands(C4Facet &cgo, C4Facet &cgo2, C4RegionList *pRegions);
|
||||
void DrawCommand(C4Facet &cgoBar, int32_t iAlign, const char *szFunctionFormat,
|
||||
|
|
|
@ -298,7 +298,7 @@ void C4ObjectInfo::Clear()
|
|||
pDef=NULL;
|
||||
}
|
||||
|
||||
void C4ObjectInfo::Draw(C4Facet &cgo, bool fShowPortrait, bool fCaptain, C4Object *pOfObj)
|
||||
void C4ObjectInfo::Draw(C4Facet &cgo, bool fShowPortrait, C4Object *pOfObj)
|
||||
{
|
||||
|
||||
int iX=0;
|
||||
|
@ -319,13 +319,6 @@ void C4ObjectInfo::Draw(C4Facet &cgo, bool fShowPortrait, bool fCaptain, C4Objec
|
|||
}
|
||||
}
|
||||
|
||||
// Captain symbol
|
||||
if (fCaptain)
|
||||
{
|
||||
::GraphicsResource.fctCaptain.Draw(cgo.Surface,cgo.X+iX,cgo.Y,0,0);
|
||||
iX+=::GraphicsResource.fctCaptain.Wdt;
|
||||
}
|
||||
|
||||
// Rank symbol
|
||||
C4RankSystem *pRankSys = &::DefaultRanks;
|
||||
C4Facet *pRankRes=&::GraphicsResource.fctRank;
|
||||
|
|
|
@ -51,7 +51,7 @@ class C4ObjectInfo: public C4ObjectInfoCore
|
|||
void Retire();
|
||||
void Recruit();
|
||||
void SetBirthday();
|
||||
void Draw(C4Facet &cgo, bool fShowPortrait, bool fShowCaptain, C4Object *pOfObj);
|
||||
void Draw(C4Facet &cgo, bool fShowPortrait, C4Object *pOfObj);
|
||||
bool Save(C4Group &hGroup, bool fStoreTiny, C4DefList *pDefs);
|
||||
bool Load(C4Group &hGroup, bool fLoadPortrait);
|
||||
bool Load(C4Group &hMother, const char *szEntryname, bool fLoadPortrait);
|
||||
|
|
|
@ -74,8 +74,6 @@ bool C4Player::ObjectInCrew(C4Object *tobj)
|
|||
|
||||
void C4Player::ClearPointers(C4Object *pObj, bool fDeath)
|
||||
{
|
||||
// Game
|
||||
if (Captain==pObj) Captain=NULL;
|
||||
// Crew
|
||||
while (Crew.Remove(pObj)) {}
|
||||
// Cursor
|
||||
|
@ -782,10 +780,6 @@ bool C4Player::FinalInit(bool fInitialValue)
|
|||
// Cursor
|
||||
if (!Cursor) AdjustCursorCommand();
|
||||
|
||||
// Assign Captain
|
||||
if (::Objects.Find(C4Id("KILC")))
|
||||
if (!Captain) Captain=GetHiRankActiveCrew(false);
|
||||
|
||||
// Update counts, pointers, views, value
|
||||
UpdateValue();
|
||||
Execute();
|
||||
|
@ -1387,7 +1381,6 @@ void C4Player::CompileFunc(StdCompiler *pComp, bool fExact)
|
|||
pComp->Value(mkNamingAdapt(CursorFlash, "CursorFlash", 0));
|
||||
pComp->Value(mkNamingAdapt((int32_t&)Cursor, "Cursor", 0));
|
||||
pComp->Value(mkNamingAdapt((int32_t&)ViewCursor,"ViewCursor", 0));
|
||||
pComp->Value(mkNamingAdapt((int32_t&)Captain, "Captain", 0));
|
||||
pComp->Value(mkNamingAdapt(CursorSelection, "CursorSelection", 0));
|
||||
pComp->Value(mkNamingAdapt(CursorToggled, "CursorToggled", 0));
|
||||
pComp->Value(mkNamingAdapt(MessageStatus, "MessageStatus", 0));
|
||||
|
@ -1514,7 +1507,6 @@ void C4Player::DefaultRuntimeData()
|
|||
Points=0;
|
||||
Value=InitialValue=ValueGain=0;
|
||||
ObjectsOwned=0;
|
||||
Captain=NULL;
|
||||
ProductionDelay=ProductionUnit=0;
|
||||
Cursor=ViewCursor=NULL;
|
||||
SelectCount=0;
|
||||
|
@ -1556,8 +1548,6 @@ void C4Player::EnumeratePointers()
|
|||
Cursor = ::Objects.Enumerated(Cursor);
|
||||
// ViewCursor
|
||||
ViewCursor = ::Objects.Enumerated(ViewCursor);
|
||||
// Captain
|
||||
Captain = ::Objects.Enumerated(Captain);
|
||||
// messageboard-queries
|
||||
for (C4MessageBoardQuery *pCheck = pMsgBoardQuery; pCheck; pCheck = pCheck->pNext)
|
||||
pCheck->nCallbackObj = pCheck->pCallbackObj ? ::Objects.ObjectNumber(pCheck->pCallbackObj) : 0;
|
||||
|
@ -1571,8 +1561,6 @@ void C4Player::DenumeratePointers()
|
|||
Cursor = ::Objects.Denumerated(Cursor);
|
||||
// ViewCursor
|
||||
ViewCursor = ::Objects.Denumerated(ViewCursor);
|
||||
// Captain
|
||||
Captain = ::Objects.Denumerated(Captain);
|
||||
// messageboard-queries
|
||||
for (C4MessageBoardQuery *pCheck = pMsgBoardQuery; pCheck; pCheck = pCheck->pNext)
|
||||
pCheck->pCallbackObj = pCheck->nCallbackObj ? ::Objects.ObjectPointer(pCheck->nCallbackObj) : NULL;
|
||||
|
|
|
@ -101,7 +101,6 @@ class C4Player: public C4PlayerInfoCore
|
|||
int32_t Wealth,Points;
|
||||
int32_t Value,InitialValue,ValueGain;
|
||||
int32_t ObjectsOwned;
|
||||
C4Object *Captain;
|
||||
C4IDList Hostility;
|
||||
// Home Base
|
||||
C4IDList HomeBaseMaterial;
|
||||
|
|
|
@ -2753,12 +2753,6 @@ static C4Object *FnGetViewCursor(C4AulContext *cthr, long iPlr)
|
|||
return pPlr ? pPlr->ViewCursor : NULL;
|
||||
}
|
||||
|
||||
static C4Object *FnGetCaptain(C4AulContext *cthr, long iPlr)
|
||||
{
|
||||
if (!ValidPlr(iPlr)) return false;
|
||||
return ::Players.Get(iPlr)->Captain;
|
||||
}
|
||||
|
||||
static bool FnSetCursor(C4AulContext *cthr, long iPlr, C4Object *pObj, bool fNoSelectMark, bool fNoSelectArrow, bool fNoSelectCrew)
|
||||
{
|
||||
C4Player *pPlr = ::Players.Get(iPlr);
|
||||
|
@ -2790,7 +2784,7 @@ static bool FnSelectCrew(C4AulContext *cthr, long iPlr, C4Object *pObj, bool fSe
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool FnGetCrewSelected(C4AulContext *cthr)
|
||||
static bool FnGetCrewSelected(C4AulObjectContext *cthr)
|
||||
{
|
||||
return !!cthr->Obj->Select;
|
||||
}
|
||||
|
@ -5767,7 +5761,6 @@ void InitFunctionMap(C4AulScriptEngine *pEngine)
|
|||
AddFunc(pEngine, "CreateScriptPlayer", FnCreateScriptPlayer);
|
||||
AddFunc(pEngine, "GetCursor", FnGetCursor);
|
||||
AddFunc(pEngine, "GetViewCursor", FnGetViewCursor);
|
||||
AddFunc(pEngine, "GetCaptain", FnGetCaptain);
|
||||
AddFunc(pEngine, "SetCursor", FnSetCursor);
|
||||
AddFunc(pEngine, "SetViewCursor", FnSetViewCursor);
|
||||
AddFunc(pEngine, "SelectCrew", FnSelectCrew);
|
||||
|
|
|
@ -935,7 +935,7 @@ void C4Viewport::DrawCursorInfo(C4TargetFacet &cgo)
|
|||
ccgo.Set(cgo.Surface,cgo.X+C4SymbolBorder,cgo.Y+C4SymbolBorder,3*C4SymbolSize,C4SymbolSize);
|
||||
cursor->Info->Draw( ccgo,
|
||||
Config.Graphics.ShowPortraits, // && ::Players.Get(Player)->CursorFlash,
|
||||
(cursor == ::Players.Get(Player)->Captain), cursor );
|
||||
cursor );
|
||||
C4ST_STOP(ObjInfStat)
|
||||
}
|
||||
|
||||
|
@ -957,27 +957,6 @@ void C4Viewport::DrawCursorInfo(C4TargetFacet &cgo)
|
|||
|
||||
C4ST_STOP(ContStat)
|
||||
|
||||
|
||||
// Draw energy levels
|
||||
if (cursor->ViewEnergy || Config.Graphics.ShowPlayerInfoAlways)
|
||||
if (cgo.Hgt>2*C4SymbolSize+2*C4SymbolBorder)
|
||||
{
|
||||
int32_t cx = C4SymbolBorder;
|
||||
C4ST_STARTNEW(EnStat, "C4Viewport::DrawCursorInfo: Energy")
|
||||
int32_t bar_wdt = ::GraphicsResource.fctEnergyBars.Wdt;
|
||||
int32_t iYOff = Config.Graphics.ShowPortraits ? 10 : 0;
|
||||
// Energy
|
||||
ccgo.Set(cgo.Surface,cgo.X+cx,cgo.Y+C4SymbolSize+2*C4SymbolBorder+iYOff,bar_wdt,cgo.Hgt-3*C4SymbolBorder-2*C4SymbolSize-iYOff);
|
||||
cursor->DrawEnergy(ccgo); ccgo.X+=bar_wdt+1;
|
||||
// Magic energy
|
||||
if (cursor->MagicEnergy)
|
||||
{ cursor->DrawMagicEnergy(ccgo); ccgo.X+=bar_wdt+1; }
|
||||
// Breath
|
||||
if (cursor->Breath && (cursor->Breath<cursor->GetPhysical()->Breath))
|
||||
{ cursor->DrawBreath(ccgo); ccgo.X+=bar_wdt+1; }
|
||||
C4ST_STOP(EnStat)
|
||||
}
|
||||
|
||||
// Draw commands
|
||||
if (Config.Graphics.ShowCommands /*|| ::MouseControl.IsViewport(this)*/ ) // Now, ShowCommands is respected even for mouse control
|
||||
if (realcursor)
|
||||
|
|
|
@ -75,7 +75,6 @@ void C4GraphicsResource::Default()
|
|||
fctHand.Default();
|
||||
fctGamepad.Default();
|
||||
fctBuild.Default();
|
||||
fctEnergyBars.Default();
|
||||
|
||||
ZeroMem(GamePalette,3*256);
|
||||
ZeroMem(AlphaPalette,256);
|
||||
|
@ -135,7 +134,6 @@ void C4GraphicsResource::Clear()
|
|||
fctHand.Clear();
|
||||
fctGamepad.Clear();
|
||||
fctBuild.Clear();
|
||||
fctEnergyBars.Clear();
|
||||
|
||||
// unhook deflist from font
|
||||
FontRegular.SetCustomImages(NULL);
|
||||
|
@ -233,15 +231,6 @@ bool C4GraphicsResource::Init(bool fInitGUI)
|
|||
if (!LoadFile(fctHand, "Hand", Files, C4FCT_Height)) return false;
|
||||
if (!LoadFile(fctGamepad, "Gamepad", Files, 80)) return false;
|
||||
if (!LoadFile(fctBuild, "Build", Files)) return false;
|
||||
if (!LoadFile(fctEnergyBars, "EnergyBars", Files)) return false;
|
||||
// life bar facets
|
||||
if (fctEnergyBars.Surface)
|
||||
{
|
||||
int32_t bar_wdt = fctEnergyBars.Surface->Wdt/6;
|
||||
int32_t bar_hgt = fctEnergyBars.Surface->Hgt/3;
|
||||
if (!bar_wdt || !bar_hgt) { LogFatal("EnergyBars.png invalid or too small!"); return false; }
|
||||
fctEnergyBars.Set(fctEnergyBars.Surface, 0,0, bar_wdt, bar_hgt);
|
||||
}
|
||||
|
||||
// create ColorByOwner overlay surfaces
|
||||
if (fctCrew.idSourceGroup != fctCrewClr.idSourceGroup)
|
||||
|
|
|
@ -73,7 +73,6 @@ class C4GraphicsResource
|
|||
C4FacetID fctHand;
|
||||
C4FacetID fctGamepad;
|
||||
C4FacetID fctBuild;
|
||||
C4FacetID fctEnergyBars;
|
||||
C4Facet fctCursor;
|
||||
C4Facet fctDropTarget;
|
||||
C4Facet fctInsideSymbol;
|
||||
|
|
Loading…
Reference in New Issue