Ich hab mir aus vielen Stücken eine Hud zusammen gebaut die rechts am aussenrand ist.
es wird auch alles angezeigt so wie es soll.
aber... Die Aktualiesiert sich sich und wen mann stirbt ist die Verschwunden.....
Weiss einer woran sowas liegen kann?
in den Log`s habe ich keine Fehler, und Die macht das was sie soll. die Info`s anzeigen wie Geld, Bank Guthaben, Hunger, Durst, Heilung, Cop auf Server , Civ auf Server, Medic auf Server
Ich hab die eine Datei fn_hudUpdate in - core\funktion drin:
Code
#include "..\..\script_macros.hpp"
/*
File: fn_hudUpdate.sqf
Author: Monty McBristle
Description:
Updates the HUD when it needs to.
*/
private["_ui","_food","_water","_health","_weight","_money","_cash","_cop","_bank","_guthaben","_medic","_civ"];
disableSerialization;
_ui = uiNameSpace getVariable ["playerHUD",displayNull];
if(isNull _ui) then {[] call life_fnc_hudSetup;};
_food = _ui displayCtrl 23500;
_water = _ui displayCtrl 23510;
_health = _ui displayCtrl 23515;
_weight = _ui displayCtrl 23520;
_money = _ui displayCtrl 23525;
_cash = life_cash;
_cop = _ui displayCtrl 23530;
_guthaben = life_atmbank;
_bank = _ui displayCtrl 23535;
_medic = _ui displayCtrl 23540;
_civ = _ui displayCtrl 23545;
//Update food
_food ctrlSetPosition [safeZoneX+safeZoneW-0.090,safeZoneY+safeZoneH-0.581];
_food ctrlSetText format["%1", life_hunger];
_food ctrlCommit 0;
//Update Water
_water ctrlSetPosition [safeZoneX+safeZoneW-0.090,safeZoneY+safeZoneH-0.531];
_water ctrlSetText format["%1", life_thirst];
_water ctrlCommit 0;
//Update Health
_health ctrlSetPosition [safeZoneX+safeZoneW-0.090,safeZoneY+safeZoneH-0.481];
_health ctrlSetText format["%1", round((1 - (damage player)) * 100)];
_health ctrlCommit 0;
//Update weight
_weight ctrlSetPosition [safeZoneX+safeZoneW-0.090,safeZoneY+safeZoneH-0.430];
_weight ctrlSetText format["%1 kg", life_carryWeight];
_weight ctrlCommit 0;
//Update Money
_money ctrlSetPosition [safeZoneX+safeZoneW-0.090,safeZoneY+safeZoneH-0.379];
life_fnc_numberText]];
if(_cash >= 1000000) then {
_cash = round(_cash / 1000000);
_money ctrlSetText format["%1", format["%1 M",[_cash] call life_fnc_numberText]];
} else {
if(_cash >= 100000) then {
_cash = round(_cash / 1000);
_money ctrlSetText format["%1", format["%1 K",[_cash] call life_fnc_numberText]];
} else {
_cash = round _cash;
_money ctrlSetText format["%1", format["%1",[_cash] call life_fnc_numberText]];
};
};
_money ctrlCommit 0;
//Update bank
_bank ctrlSetPosition [safeZoneX+safeZoneW-0.090,safeZoneY+safeZoneH-0.329];
if(_guthaben >= 1000000) then {
_guthaben = round(_guthaben / 1000000);
_bank ctrlSetText format["%1", format["%1 M",[_guthaben] call life_fnc_numberText]];
} else {
if(_guthaben >= 100000) then {
_guthaben = round(_guthaben / 1000);
_bank ctrlSetText format["%1", format["%1 K",[_guthaben] call life_fnc_numberText]];
} else {
_guthaben = round _guthaben;
_bank ctrlSetText format["%1", format["%1",[_guthaben] call life_fnc_numberText]];
};
};
_bank ctrlCommit 0;
//Update cop
_cop ctrlSetPosition [safeZoneX+safeZoneW-0.090,safeZoneY+safeZoneH-0.277];
_cop ctrlSetText format["%1", west countSide playableUnits];
_cop ctrlCommit 0;
//Update medic
_medic ctrlSetPosition [safeZoneX+safeZoneW-0.090,safeZoneY+safeZoneH-0.226];
_medic ctrlSetText format["%1", independent countSide playableUnits];
_medic ctrlCommit 0;
//Update civ
_civ ctrlSetPosition [safeZoneX+safeZoneW-0.090,safeZoneY+safeZoneH-0.175];
_civ ctrlSetText format["%1", civilian countSide playableUnits];
_civ ctrlCommit 0;
Alles anzeigen
und im Verzeichnis dialog habe ich die hud_stats.hpp drin:
Code
/*
File: hud_stats.sqf
Author: Monty McBristle
Description:
Updates the HUD when it needs to.
*/
class playerHUD
{
idd=-1;
movingEnable=0;
fadein=0;
duration = 10e10;
fadeout=0;
name="playerHUD";
onLoad="uiNamespace setVariable ['playerHUD',_this select 0]";
objects[]={};
class controlsBackground
{
class fondIcon : life_RscPicture
{
idc = -1;
text = "textures\hud.paa";
x = safeZoneX+safeZoneW-0.2;
y = safeZoneY+safeZoneH-0.58;
w = 0.21; h = 0.61;
};
};
class controls
{
class foodtext
{
type=0;
idc=23500;
style=0;
x=-1;
y=-1;
w=0.3;
h=0.05;
sizeEx=0.03;
size=1;
font="PuristaSemibold";
colorBackground[]={0,0,0,0};
colorText[] = { 1 , 1 , 1 , 1 };
shadow=1;
text="";
};
class watertext
{
type=0;
idc=23510;
style=0;
x=-1;
y=-1;
w=0.3;
h=0.05;
sizeEx=0.03;
size=1;
font="PuristaSemibold";
colorBackground[]={0,0,0,0};
colorText[] = { 1 , 1 , 1 , 1 };
shadow=1;
text="";
};
class healthtext
{
type=0;
idc=23515;
style=0;
x=-1;
y=-1;
w=0.3;
h=0.05;
sizeEx=0.03;
size=1;
font="PuristaSemibold";
colorBackground[]={0,0,0,0};
colorText[] = { 1 , 1 , 1 , 1 };
shadow=1;
text="";
};
class weighttext
{
type=0;
idc=23520;
style=0;
x=-1;
y=-1;
w=0.3;
h=0.05;
sizeEx=0.03;
size=1;
font="PuristaSemibold";
colorBackground[]={0,0,0,0};
colorText[] = { 1 , 1 , 1 , 1 };
shadow=1;
text="";
};
class moneytext
{
type=0;
idc=23525;
style=0;
x=-1;
y=-1;
w=0.3;
h=0.05;
sizeEx=0.03;
size=1;
font="PuristaSemibold";
colorBackground[]={0,0,0,0};
colorText[] = { 1 , 1 , 1 , 1 };
shadow=1;
text="";
};
class coptext
{
type=0;
idc=23530;
style=0;
x=-1;
y=-1;
w=0.3;
h=0.05;
sizeEx=0.03;
size=1;
font="PuristaSemibold";
colorBackground[]={0,0,0,0};
colorText[] = { 1 , 1 , 1 , 1 };
shadow=1;
text="";
};
class banktext
{
type=0;
idc=23535;
style=0;
x=-1;
y=-1;
w=0.3;
h=0.05;
sizeEx=0.03;
size=1;
font="PuristaSemibold";
colorBackground[]={0,0,0,0};
colorText[] = { 1 , 1 , 1 , 1 };
shadow=1;
text="";
};
class medictext
{
type=0;
idc=23540;
style=0;
x=-1;
y=-1;
w=0.3;
h=0.05;
sizeEx=0.03;
size=1;
font="PuristaSemibold";
colorBackground[]={0,0,0,0};
colorText[] = { 1 , 1 , 1 , 1 };
shadow=1;
text="";
};
class civtext
{
type=0;
idc=23545;
style=0;
x=-1;
y=-1;
w=0.3;
h=0.05;
sizeEx=0.03;
size=1;
font="PuristaSemibold";
colorBackground[]={0,0,0,0};
colorText[] = { 1 , 1 , 1 , 1 };
shadow=1;
text="";
};
};
};
Alles anzeigen
Was ist da falsch, das die sich nicht Aktualisiert und nach sterben Verschwindet und nicht mehr zu sehen ist?