How to define this function
I have a problem with my code idk why is not defined...
networkModule.SetSelectCharacterPhase - :name 'iMinHP' is not defined
if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
def SetHP(self, hpPercentage, iMinHP, iMaxHP):
if not self.hpGauge.IsShow():
self.SetSize(200 + 7*self.nameLength, self.GetHeight())
if localeInfo.IsARABIC():
self.name.SetPosition( self.GetWidth()-23, 13)
else:
self.name.SetPosition(23, 13)
self.name.SetWindowHorizontalAlignLeft()
self.name.SetHorizontalAlignLeft()
self.hpGauge.Show()
self.UpdatePosition()
self.hpPercenttxt.SetPosition(200 + 7*self.nameLength-150, 22)
self.hpPercenttxt.Show()
self.hpPercenttxt.SetText("|cFF00FFFF|hProcent HP: |r |cffff0000 %d%% |r" % (hpPercentage))
self.hpGauge.SetPercentage(hpPercentage, 100)
self.hpPercenttxt.SetText("|cFF00FFFF|hProcent HP: |r |cffff0000 %d%% |r" % (hpPercentage))
if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
(textWidth, textHeight)=self.hpDecimal.GetTextSize()
if localeInfo.IsARABIC():
self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
else:
self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
self.hpDecimal.Show()
how can i define it , help please :D
python
add a comment |
I have a problem with my code idk why is not defined...
networkModule.SetSelectCharacterPhase - :name 'iMinHP' is not defined
if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
def SetHP(self, hpPercentage, iMinHP, iMaxHP):
if not self.hpGauge.IsShow():
self.SetSize(200 + 7*self.nameLength, self.GetHeight())
if localeInfo.IsARABIC():
self.name.SetPosition( self.GetWidth()-23, 13)
else:
self.name.SetPosition(23, 13)
self.name.SetWindowHorizontalAlignLeft()
self.name.SetHorizontalAlignLeft()
self.hpGauge.Show()
self.UpdatePosition()
self.hpPercenttxt.SetPosition(200 + 7*self.nameLength-150, 22)
self.hpPercenttxt.Show()
self.hpPercenttxt.SetText("|cFF00FFFF|hProcent HP: |r |cffff0000 %d%% |r" % (hpPercentage))
self.hpGauge.SetPercentage(hpPercentage, 100)
self.hpPercenttxt.SetText("|cFF00FFFF|hProcent HP: |r |cffff0000 %d%% |r" % (hpPercentage))
if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
(textWidth, textHeight)=self.hpDecimal.GetTextSize()
if localeInfo.IsARABIC():
self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
else:
self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
self.hpDecimal.Show()
how can i define it , help please :D
python
The code that starts with the secondif app.ENABLE_VIEW_TARGET_DECIMAL_HP:
is not part of the function above it. So you cannot reference its parameter names. It is not clear what you want. Maybe just remove that line, so that the lines below it become part of the function? The condition is anyway always true, because you already checked for it in the first line of your code.
– trincot
Dec 29 '18 at 10:46
@CodeIt, I am not sure what you are trying to tell me. Are you connected to the Asker? Anyway the code is not exactly the same there. For one, the indentation is different which in Python makes all the difference.
– trincot
Dec 29 '18 at 10:50
@trincot I'm not connected with the Asker. I was trying to tell you that the OP has taken the code from the source which i mentioned. The OP has posted only part of the code.
– CodeIt
Dec 29 '18 at 11:17
the one of if app.ENABLE_VIEW_TARGET_DECIMAL_HP: was for player hp and 1 if app.ENABLE_VIEW_TARGET_DECIMAL_HP: is for monster hp , i removed from C++ this player hp , idk how to explain
– Dutzų Dutzų
Dec 29 '18 at 11:17
add a comment |
I have a problem with my code idk why is not defined...
networkModule.SetSelectCharacterPhase - :name 'iMinHP' is not defined
if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
def SetHP(self, hpPercentage, iMinHP, iMaxHP):
if not self.hpGauge.IsShow():
self.SetSize(200 + 7*self.nameLength, self.GetHeight())
if localeInfo.IsARABIC():
self.name.SetPosition( self.GetWidth()-23, 13)
else:
self.name.SetPosition(23, 13)
self.name.SetWindowHorizontalAlignLeft()
self.name.SetHorizontalAlignLeft()
self.hpGauge.Show()
self.UpdatePosition()
self.hpPercenttxt.SetPosition(200 + 7*self.nameLength-150, 22)
self.hpPercenttxt.Show()
self.hpPercenttxt.SetText("|cFF00FFFF|hProcent HP: |r |cffff0000 %d%% |r" % (hpPercentage))
self.hpGauge.SetPercentage(hpPercentage, 100)
self.hpPercenttxt.SetText("|cFF00FFFF|hProcent HP: |r |cffff0000 %d%% |r" % (hpPercentage))
if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
(textWidth, textHeight)=self.hpDecimal.GetTextSize()
if localeInfo.IsARABIC():
self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
else:
self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
self.hpDecimal.Show()
how can i define it , help please :D
python
I have a problem with my code idk why is not defined...
networkModule.SetSelectCharacterPhase - :name 'iMinHP' is not defined
if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
def SetHP(self, hpPercentage, iMinHP, iMaxHP):
if not self.hpGauge.IsShow():
self.SetSize(200 + 7*self.nameLength, self.GetHeight())
if localeInfo.IsARABIC():
self.name.SetPosition( self.GetWidth()-23, 13)
else:
self.name.SetPosition(23, 13)
self.name.SetWindowHorizontalAlignLeft()
self.name.SetHorizontalAlignLeft()
self.hpGauge.Show()
self.UpdatePosition()
self.hpPercenttxt.SetPosition(200 + 7*self.nameLength-150, 22)
self.hpPercenttxt.Show()
self.hpPercenttxt.SetText("|cFF00FFFF|hProcent HP: |r |cffff0000 %d%% |r" % (hpPercentage))
self.hpGauge.SetPercentage(hpPercentage, 100)
self.hpPercenttxt.SetText("|cFF00FFFF|hProcent HP: |r |cffff0000 %d%% |r" % (hpPercentage))
if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
iMinHPText = '.'.join([i - 3 < 0 and str(iMinHP)[:i] or str(iMinHP)[i-3:i] for i in range(len(str(iMinHP)) % 3, len(str(iMinHP))+1, 3) if i])
iMaxHPText = '.'.join([i - 3 < 0 and str(iMaxHP)[:i] or str(iMaxHP)[i-3:i] for i in range(len(str(iMaxHP)) % 3, len(str(iMaxHP))+1, 3) if i])
self.hpDecimal.SetText(str(iMinHPText) + "/" + str(iMaxHPText))
(textWidth, textHeight)=self.hpDecimal.GetTextSize()
if localeInfo.IsARABIC():
self.hpDecimal.SetPosition(120 / 2 + textWidth / 2, -13)
else:
self.hpDecimal.SetPosition(130 / 2 - textWidth / 2, -13)
self.hpDecimal.Show()
how can i define it , help please :D
python
python
asked Dec 29 '18 at 10:42
Dutzų DutzųDutzų Dutzų
96
96
The code that starts with the secondif app.ENABLE_VIEW_TARGET_DECIMAL_HP:
is not part of the function above it. So you cannot reference its parameter names. It is not clear what you want. Maybe just remove that line, so that the lines below it become part of the function? The condition is anyway always true, because you already checked for it in the first line of your code.
– trincot
Dec 29 '18 at 10:46
@CodeIt, I am not sure what you are trying to tell me. Are you connected to the Asker? Anyway the code is not exactly the same there. For one, the indentation is different which in Python makes all the difference.
– trincot
Dec 29 '18 at 10:50
@trincot I'm not connected with the Asker. I was trying to tell you that the OP has taken the code from the source which i mentioned. The OP has posted only part of the code.
– CodeIt
Dec 29 '18 at 11:17
the one of if app.ENABLE_VIEW_TARGET_DECIMAL_HP: was for player hp and 1 if app.ENABLE_VIEW_TARGET_DECIMAL_HP: is for monster hp , i removed from C++ this player hp , idk how to explain
– Dutzų Dutzų
Dec 29 '18 at 11:17
add a comment |
The code that starts with the secondif app.ENABLE_VIEW_TARGET_DECIMAL_HP:
is not part of the function above it. So you cannot reference its parameter names. It is not clear what you want. Maybe just remove that line, so that the lines below it become part of the function? The condition is anyway always true, because you already checked for it in the first line of your code.
– trincot
Dec 29 '18 at 10:46
@CodeIt, I am not sure what you are trying to tell me. Are you connected to the Asker? Anyway the code is not exactly the same there. For one, the indentation is different which in Python makes all the difference.
– trincot
Dec 29 '18 at 10:50
@trincot I'm not connected with the Asker. I was trying to tell you that the OP has taken the code from the source which i mentioned. The OP has posted only part of the code.
– CodeIt
Dec 29 '18 at 11:17
the one of if app.ENABLE_VIEW_TARGET_DECIMAL_HP: was for player hp and 1 if app.ENABLE_VIEW_TARGET_DECIMAL_HP: is for monster hp , i removed from C++ this player hp , idk how to explain
– Dutzų Dutzų
Dec 29 '18 at 11:17
The code that starts with the second
if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
is not part of the function above it. So you cannot reference its parameter names. It is not clear what you want. Maybe just remove that line, so that the lines below it become part of the function? The condition is anyway always true, because you already checked for it in the first line of your code.– trincot
Dec 29 '18 at 10:46
The code that starts with the second
if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
is not part of the function above it. So you cannot reference its parameter names. It is not clear what you want. Maybe just remove that line, so that the lines below it become part of the function? The condition is anyway always true, because you already checked for it in the first line of your code.– trincot
Dec 29 '18 at 10:46
@CodeIt, I am not sure what you are trying to tell me. Are you connected to the Asker? Anyway the code is not exactly the same there. For one, the indentation is different which in Python makes all the difference.
– trincot
Dec 29 '18 at 10:50
@CodeIt, I am not sure what you are trying to tell me. Are you connected to the Asker? Anyway the code is not exactly the same there. For one, the indentation is different which in Python makes all the difference.
– trincot
Dec 29 '18 at 10:50
@trincot I'm not connected with the Asker. I was trying to tell you that the OP has taken the code from the source which i mentioned. The OP has posted only part of the code.
– CodeIt
Dec 29 '18 at 11:17
@trincot I'm not connected with the Asker. I was trying to tell you that the OP has taken the code from the source which i mentioned. The OP has posted only part of the code.
– CodeIt
Dec 29 '18 at 11:17
the one of if app.ENABLE_VIEW_TARGET_DECIMAL_HP: was for player hp and 1 if app.ENABLE_VIEW_TARGET_DECIMAL_HP: is for monster hp , i removed from C++ this player hp , idk how to explain
– Dutzų Dutzų
Dec 29 '18 at 11:17
the one of if app.ENABLE_VIEW_TARGET_DECIMAL_HP: was for player hp and 1 if app.ENABLE_VIEW_TARGET_DECIMAL_HP: is for monster hp , i removed from C++ this player hp , idk how to explain
– Dutzų Dutzų
Dec 29 '18 at 11:17
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53968796%2fhow-to-define-this-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53968796%2fhow-to-define-this-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The code that starts with the second
if app.ENABLE_VIEW_TARGET_DECIMAL_HP:
is not part of the function above it. So you cannot reference its parameter names. It is not clear what you want. Maybe just remove that line, so that the lines below it become part of the function? The condition is anyway always true, because you already checked for it in the first line of your code.– trincot
Dec 29 '18 at 10:46
@CodeIt, I am not sure what you are trying to tell me. Are you connected to the Asker? Anyway the code is not exactly the same there. For one, the indentation is different which in Python makes all the difference.
– trincot
Dec 29 '18 at 10:50
@trincot I'm not connected with the Asker. I was trying to tell you that the OP has taken the code from the source which i mentioned. The OP has posted only part of the code.
– CodeIt
Dec 29 '18 at 11:17
the one of if app.ENABLE_VIEW_TARGET_DECIMAL_HP: was for player hp and 1 if app.ENABLE_VIEW_TARGET_DECIMAL_HP: is for monster hp , i removed from C++ this player hp , idk how to explain
– Dutzų Dutzų
Dec 29 '18 at 11:17