Цвет команд

Реклама:

Mirazex

Пользователь
8 Сен 2018
26
0
1
21
Реакции
0 0 5
#1
Как сделать что бы при выборе команды они были цветными?

 

GWS

Новичок
12 Сен 2018
2
0
1
42
Реакции
0 0 0
#2
function COverthrowGameMode:InitGameMode()
print( "Overthrow is loaded." )

-- CustomNetTables:SetTableValue( "test", "value 1", {} );
-- CustomNetTables:SetTableValue( "test", "value 2", { a = 1, b = 2 } );

self.m_TeamColors = {}
self.m_TeamColors[DOTA_TEAM_GOODGUYS] = { 61, 210, 150 } -- Teal
self.m_TeamColors[DOTA_TEAM_BADGUYS] = { 243, 201, 9 } -- Yellow
self.m_TeamColors[DOTA_TEAM_CUSTOM_1] = { 197, 77, 168 } -- Pink
self.m_TeamColors[DOTA_TEAM_CUSTOM_2] = { 255, 108, 0 } -- Orange
self.m_TeamColors[DOTA_TEAM_CUSTOM_3] = { 52, 85, 255 } -- Blue
self.m_TeamColors[DOTA_TEAM_CUSTOM_4] = { 101, 212, 19 } -- Green
self.m_TeamColors[DOTA_TEAM_CUSTOM_5] = { 129, 83, 54 } -- Brown
self.m_TeamColors[DOTA_TEAM_CUSTOM_6] = { 27, 192, 216 } -- Cyan
self.m_TeamColors[DOTA_TEAM_CUSTOM_7] = { 199, 228, 13 } -- Olive
self.m_TeamColors[DOTA_TEAM_CUSTOM_8] = { 140, 42, 244 } -- Purple
 

Mirazex

Пользователь
8 Сен 2018
26
0
1
21
Реакции
0 0 5
#3
function COverthrowGameMode:InitGameMode()
print( "Overthrow is loaded." )

-- CustomNetTables:SetTableValue( "test", "value 1", {} );
-- CustomNetTables:SetTableValue( "test", "value 2", { a = 1, b = 2 } );

self.m_TeamColors = {}
self.m_TeamColors[DOTA_TEAM_GOODGUYS] = { 61, 210, 150 } -- Teal
self.m_TeamColors[DOTA_TEAM_BADGUYS] = { 243, 201, 9 } -- Yellow
self.m_TeamColors[DOTA_TEAM_CUSTOM_1] = { 197, 77, 168 } -- Pink
self.m_TeamColors[DOTA_TEAM_CUSTOM_2] = { 255, 108, 0 } -- Orange
self.m_TeamColors[DOTA_TEAM_CUSTOM_3] = { 52, 85, 255 } -- Blue
self.m_TeamColors[DOTA_TEAM_CUSTOM_4] = { 101, 212, 19 } -- Green
self.m_TeamColors[DOTA_TEAM_CUSTOM_5] = { 129, 83, 54 } -- Brown
self.m_TeamColors[DOTA_TEAM_CUSTOM_6] = { 27, 192, 216 } -- Cyan
self.m_TeamColors[DOTA_TEAM_CUSTOM_7] = { 199, 228, 13 } -- Olive
self.m_TeamColors[DOTA_TEAM_CUSTOM_8] = { 140, 42, 244 } -- Purple
function FC:InitGameMode()
print( "addon is loaded." )

FC = self

self.vUserIds = {}
self.tPlayers = {}
self.nPlayers = 0

GameRules:SetHeroRespawnEnabled(Hero_Respawn_Enabled)
GameRules:SetUseUniversalShopMode(Universal_Shop_Mode)
GameRules:SetSameHeroSelectionEnabled(Same_Hero_Selection_Enabled)
GameRules:SetHeroSelectionTime(Hero_Selection_Time)
GameRules:SetPreGameTime(Pre_Game_Time)
GameRules:SetPostGameTime(Post_Game_Time)
GameRules:SetShowcaseTime(Show_Case_Time)
GameRules:SetStrategyTime(Strategy_Time)
GameRules:SetGoldPerTick(Gold_Per_Tick)
GameRules:SetRuneSpawnTime(Rune_Spawn_Time)
GameRules:SetFirstBloodActive(First_Blood_Active)
GameRules:SetHideKillMessageHeaders(Hide_Kill_Headers)
GameRules:SetStartingGold(Starting_Gold)
GameRules:SetHeroMinimapIconScale(MINIMAP_ICON_SIZE)
GameRules:SetCreepMinimapIconScale(MINIMAP_CREEP_ICON_SIZE)
GameRules:SetRuneMinimapIconScale(MINIMAP_RUNE_ICON_SIZE)


GameRules:SetCustomGameTeamMaxPlayers(DOTA_TEAM_GOODGUYS, 3)
GameRules:SetCustomGameTeamMaxPlayers(DOTA_TEAM_BADGUYS, 3)

if USE_CUSTOM_TEAM_COLORS then
for team,color in pairs(TEAM_COLORS) do
SetTeamCustomHealthbarColor(team, color[1], color[2], color[3])
end
end

for rune, spawn in pairs(ENABLED_RUNES) do
GameRules:GetGameModeEntity():SetRuneEnabled(rune, spawn)
end

GameRules:GetGameModeEntity():SetFountainConstantManaRegen(FOUNTAIN_CONSTANT_MANA_REGEN)
GameRules:GetGameModeEntity():SetFountainPercentageHealthRegen(FOUNTAIN_PERCENTAGE_HEALTH_REGEN)
GameRules:GetGameModeEntity():SetFountainPercentageManaRegen(FOUNTAIN_PERCENTAGE_MANA_REGEN)
GameRules:GetGameModeEntity():SetMaximumAttackSpeed(Max_AttackSpeed)
GameRules:GetGameModeEntity():SetMinimumAttackSpeed(Min_AttackSpeed)
GameRules:GetGameModeEntity():SetRecommendedItemsDisabled(Recommended_Items_Disabled)
GameRules:GetGameModeEntity():SetUseCustomHeroLevels(Use_Custom_Hero_LEVELS)
GameRules:GetGameModeEntity():SetCustomHeroMaxLevel(Hero_Max_Level)
GameRules:GetGameModeEntity():SetCustomXPRequiredToReachNextLevel(xpTable)
GameRules:GetGameModeEntity():SetThink("OnThink", self, "GlobalThink", 2)
end

---------------------------------------------------------
function FC:OnThink()
if GameRules:State_Get() == DOTA_GAMERULES_STATE_GAME_IN_PROGRESS then
--print( "FC addon script is running." )
elseif GameRules:State_Get() >= DOTA_GAMERULES_STATE_POST_GAME then
return nil
end
return 1
end
В чем трабл?
 
Последнее редактирование:

shesmu

Активный
22 Фев 2018
105
9
18
22
Реакции
16 0 0
#4
Если консоль ничего не пишет, значит
условие не выполняется, бтв
SetTeamCustomHealthbarColor(team, color[1], color[2], color[3])
бтв смею предположить что team, color и USE_CUSTOM_TEAM_COLORS это nil
а еще вопрос, зачем так делать? self же и так FC, видел в других кастомках, но так и не понял зачем
 

Mirazex

Пользователь
8 Сен 2018
26
0
1
21
Реакции
0 0 5
#5
Если консоль ничего не пишет, значит

условие не выполняется, бтв

бтв смею предположить что team, color и USE_CUSTOM_TEAM_COLORS это nil
а еще вопрос, зачем так делать? self же и так FC, видел в других кастомках, но так и не понял зачем
но ведь они прописаны....
USE_CUSTOM_TEAM_COLORS = true
TEAM_COLORS = {}
TEAM_COLORS[DOTA_TEAM_GOODGUYS] = { 61, 210, 150 }
TEAM_COLORS[DOTA_TEAM_BADGUYS] = { 243, 201, 9 }
 

shesmu

Активный
22 Фев 2018
105
9
18
22
Реакции
16 0 0
#6
как я и думал, SetTeamCustomHealthbarColor(team, color[1], color[2], color[3]) меняет цвет хпбара, пиликаний и ника

пустой addon_game_mode, только панорама и addon_english(названия команд)
 

Mirazex

Пользователь
8 Сен 2018
26
0
1
21
Реакции
0 0 5
#7

Pupok

Друзья CG
14 Авг 2017
334
12
18
Реакции
14 0 0
#8
function FC:InitGameMode()
print( "addon is loaded." )

FC = self

self.vUserIds = {}
self.tPlayers = {}
self.nPlayers = 0

GameRules:SetHeroRespawnEnabled(Hero_Respawn_Enabled)
GameRules:SetUseUniversalShopMode(Universal_Shop_Mode)
GameRules:SetSameHeroSelectionEnabled(Same_Hero_Selection_Enabled)
GameRules:SetHeroSelectionTime(Hero_Selection_Time)
GameRules:SetPreGameTime(Pre_Game_Time)
GameRules:SetPostGameTime(Post_Game_Time)
GameRules:SetShowcaseTime(Show_Case_Time)
GameRules:SetStrategyTime(Strategy_Time)
GameRules:SetGoldPerTick(Gold_Per_Tick)
GameRules:SetRuneSpawnTime(Rune_Spawn_Time)
GameRules:SetFirstBloodActive(First_Blood_Active)
GameRules:SetHideKillMessageHeaders(Hide_Kill_Headers)
GameRules:SetStartingGold(Starting_Gold)
GameRules:SetHeroMinimapIconScale(MINIMAP_ICON_SIZE)
GameRules:SetCreepMinimapIconScale(MINIMAP_CREEP_ICON_SIZE)
GameRules:SetRuneMinimapIconScale(MINIMAP_RUNE_ICON_SIZE)


GameRules:SetCustomGameTeamMaxPlayers(DOTA_TEAM_GOODGUYS, 3)
GameRules:SetCustomGameTeamMaxPlayers(DOTA_TEAM_BADGUYS, 3)

if USE_CUSTOM_TEAM_COLORS then
for team,color in pairs(TEAM_COLORS) do
SetTeamCustomHealthbarColor(team, color[1], color[2], color[3])
end
end

for rune, spawn in pairs(ENABLED_RUNES) do
GameRules:GetGameModeEntity():SetRuneEnabled(rune, spawn)
end

GameRules:GetGameModeEntity():SetFountainConstantManaRegen(FOUNTAIN_CONSTANT_MANA_REGEN)
GameRules:GetGameModeEntity():SetFountainPercentageHealthRegen(FOUNTAIN_PERCENTAGE_HEALTH_REGEN)
GameRules:GetGameModeEntity():SetFountainPercentageManaRegen(FOUNTAIN_PERCENTAGE_MANA_REGEN)
GameRules:GetGameModeEntity():SetMaximumAttackSpeed(Max_AttackSpeed)
GameRules:GetGameModeEntity():SetMinimumAttackSpeed(Min_AttackSpeed)
GameRules:GetGameModeEntity():SetRecommendedItemsDisabled(Recommended_Items_Disabled)
GameRules:GetGameModeEntity():SetUseCustomHeroLevels(Use_Custom_Hero_LEVELS)
GameRules:GetGameModeEntity():SetCustomHeroMaxLevel(Hero_Max_Level)
GameRules:GetGameModeEntity():SetCustomXPRequiredToReachNextLevel(xpTable)
GameRules:GetGameModeEntity():SetThink("OnThink", self, "GlobalThink", 2)
end

---------------------------------------------------------
function FC:OnThink()
if GameRules:State_Get() == DOTA_GAMERULES_STATE_GAME_IN_PROGRESS then
--print( "FC addon script is running." )
elseif GameRules:State_Get() >= DOTA_GAMERULES_STATE_POST_GAME then
return nil
end
return 1
end
В чем трабл?
Это в xml custom_ui_manifest.xml прописано,это у тебя панорама на скрине.
 

shesmu

Активный
22 Фев 2018
105
9
18
22
Реакции
16 0 0
#9

Mirazex

Пользователь
8 Сен 2018
26
0
1
21
Реакции
0 0 5
#10
Мда, теперь вижу.
 
Реклама: