If I have this code I can generate a link menu. and say that I only want to include Uid 4 and 8.
lib.leftNavi = HMENU
lib.leftNavi.entryLevel=0
lib.leftNavi.special = list
lib.leftNavi.special.value = 4,8
lib.leftNavi.1 = TMENU
lib.leftNavi.1 {
wrap = <div id="leftMenu"><ul class="L1">|</ul></div>
expAll = 0
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.wrap = <span>|</span>
RO < .NO
RO = 1
CUR < .NO
CUR = 1
CUR.allWrap = <li class="current">|</li>
CUR.stdWrap.wrap = <span>|</span>
CUR.ATagParams =
ACT < .CUR
}
My question is now..
How can I say that I want to generate a link menu, from/of the sub pages under Uid 4, so it don't show the link to Uid 4, but the 3-5 sub-pages under this Uid ?
..UPDATE..
Okay I have this code now, and its almost OK.
lib.prodNavi = HMENU
lib.prodNavi.entryLevel=0
lib.prodNavi.special = list
lib.prodNavi.special.value = 5
lib.prodNavi.1 = TMENU
lib.prodNavi.1 {
wrap = <div id="categorylist-box"><div id="categorylist-box-top"><h2><em>Produkter</em></h2></div><div id="categorylist-box-content"><ul>|</ul></div><div id="categorylist-box-bottom"></div></div><div class="pagecontent-box" id="pagecontent-box-59">
expAll = 1
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.wrap = <span>|</span>
NO.doNotShowLink = 0
NO.doNotShowLink.stdWrap.override = 1
NO.doNotShowLink.stdWrap.if {
equals.field = uid
value = 5
}
RO < .NO
RO = 1
CUR < .NO
CUR = 1
CUR.allWrap = <li class="current">|</li>
CUR.stdWrap.wrap = <span>|</span>
CUR.ATagParams =
ACT < .CUR
}
lib.prodNavi.2 < lib.prodNavi.1
But it show me to oranges boxes, almost as it using the Wrap 2 times.
How do I only show it like this, with one wrap.
You can use doNotShowLink = 1 for hiding menu items. And you can use stdWrap.override for hiding single items.
Here you would show uid 8 and subpages and subpages of uid 4. uid 4 itself would not be shown
lib.leftNavi = HMENU
lib.leftNavi.entryLevel=0
lib.leftNavi.special = list
lib.leftNavi.special.value = 4,8
lib.leftNavi.1 = TMENU
lib.leftNavi.1 {
wrap = <div id="leftMenu"><ul class="L1">|</ul></div>
expAll = 1
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.wrap = <span>|</span>
NO.doNotShowLink = 0
NO.doNotShowLink.stdWrap.override = 1
NO.doNotShowLink.stdWrap.if {
equals.field = uid
value = 4
}
RO < .NO
RO = 1
CUR < .NO
CUR = 1
CUR.allWrap = <li class="current">|</li>
CUR.stdWrap.wrap = <span>|</span>
CUR.ATagParams =
ACT < .CUR
}
lib.leftNavi.2 < lib.leftNavi.1
UPDATE:
For Using the wrap only once just use it for the HMENU, not for the TMENU:
lib.prodNavi = HMENU
lib.prodNavi.entryLevel=0
lib.prodNavi.special = list
lib.prodNavi.special.value = 252
lib.prodNavi.wrap = <div id="categorylist-box"><div id="categorylist-box-top"><h2><em>Produkter</em></h2></div><div id="categorylist-box-content"><ul>|</ul></div><div id="categorylist-box-bottom"></div></div><div class="pagecontent-box" id="pagecontent-box-59">
lib.prodNavi.1 = TMENU
lib.prodNavi.1 {
expAll = 1
NO = 1
NO.allWrap = <li>|</li>
NO.stdWrap.wrap = <span>|</span>
NO.doNotShowLink = 0
...
}
lib.prodNavi.2 < lib.prodNavi.1
Related
Making a game in GameMaker and I'm having a problem where the variable is not set and I'm not sure why. When pressing down on either W,A,S, or D and clicking LMB it works but crashes if I pressing down on W,A,S, or D then let go and afterwards click LMB.
Code:
var look
var bullet
if (keyboard_check(ord("A"))){
x = x - 5;
sprite_index = spr_west_hiro
image_xscale = 3
image_yscale = 3
look = 180
} else if (keyboard_check(ord("D"))){
x = x + 5;
sprite_index = spr_east_hiro
image_xscale = 3
image_yscale = 3
look = 0
} else if (keyboard_check(ord("S"))){
y = y + 5;
sprite_index = spr_south_hiro
image_xscale = 3
image_yscale = 3
look = 270
} else if (keyboard_check(ord("W"))){
y = y - 5;
sprite_index = spr_north_hiro
image_xscale = 3
image_yscale = 3
look = 90
}
//------------------------------------------------------------------------------
if (keyboard_check_released(ord("A"))){
sprite_index = spr_idlewest_hiro
image_xscale = 3
image_yscale = 3
look = 180
} else if (keyboard_check_released(ord("D"))){
sprite_index = spr_idleast_hiro
image_xscale = 3
image_yscale = 3
look = 0
} else if (keyboard_check_released(ord("S"))){
sprite_index = spr_idlesouth_hiro
image_xscale = 3
image_yscale = 3
look = 270
} else if (keyboard_check_released(ord("W"))){
sprite_index = spr_idlenorth_hiro
image_xscale = 3
image_yscale = 3
look = 90
}
//--------------------------------------------------------------------------------
if (mouse_check_button_pressed(mb_left)){
var bullet = instance_create_layer(x,y, "Instances", obj_bullet)
bullet.direction = look
}
Error:
ERROR!!! :: ############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_hiro:
local variable look(100001, -2147483648) not set before reading it.
at gml_Object_obj_hiro_Step_0 (line 61) - bullet.direction = look
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_hiro_Step_0 (line 61)
I have reviewed the code multiple times and I am still stumped. Particularly because of the fact that it seems as though the variable doesn't save the coefficient set to it despite the fact that it should when W,A,S or D is pressed down then released.
Firstly, you would want to assign a value to your look variable, as otherwise it will remain not set to anything if no buttons had been pressed.
Secondly, you may want to do so in Create event, as you probably want your character to shoot in last pressed direction, not just "somewhere"
I am trying to make groupings using a CListCtrl trough the following code:
LVGROUP lg = { 0 };
lg.cbSize = sizeof(lg);
lg.state = LVGS_NORMAL | LVGS_COLLAPSIBLE;
lg.mask = LVGF_GROUPID | LVGF_HEADER | LVGF_STATE | LVGF_ALIGN | LVGF_STATE | LVGF_DESCRIPTIONTOP | LVGF_DESCRIPTIONBOTTOM | LVGF_FOOTER | LVGF_TASK | LVGF_SUBTITLE | LVGF_SUBSET;
lg.uAlign = LVGA_HEADER_LEFT | LVGA_FOOTER_RIGHT;
LVITEM item = { 0 };
item.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_GROUPID;
item.iSubItem = 0;
item.state = 0;
item.stateMask = LVIS_SELECTED;
CString s;
lg.iGroupId = 0;
s = L"Office";
lg.pszHeader = s.GetBuffer();
lg.cchHeader = s.GetLength();
pListCtrl->InsertGroup(lg.iGroupId, &lg);
item.iGroupId = 0;
s = "Pen";
item.pszText = s.GetBuffer();
item.cchTextMax = s.GetLength();
pListCtrl->InsertItem(&item);
s = "Pencil";
item.pszText = s.GetBuffer();
item.cchTextMax = s.GetLength();
pListCtrl->InsertItem(&item);
lg.iGroupId = 1;
s = L"Workshop";
lg.pszHeader = s.GetBuffer();
lg.cchHeader = s.GetLength();
pListCtrl->InsertGroup(lg.iGroupId, &lg);
item.iGroupId = 1;
s = "Hammer";
item.pszText = s.GetBuffer();
item.cchTextMax = s.GetLength();
pListCtrl->InsertItem(&item);
s = "Drill";
item.pszText = s.GetBuffer();
item.cchTextMax = s.GetLength();
pListCtrl->InsertItem(&item);
s = "Saw";
item.pszText = s.GetBuffer();
item.cchTextMax = s.GetLength();
pListCtrl->InsertItem(&item);
but everything is shown ungrouped
How can I make the groups work as they should?
It turns out there is the need of a manifest, which I added to stdafx.h
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
I have followed all available instructions, but the following TypoScript does not do what it is supposed to:
lib.menu.mainMenu = HMENU
lib.menu.mainMenu {
entryLevel = 0
1 = TMENU
1 {
NO = 1
NO {
stdWrap.htmlSpecialChars = 1
allWrap = <li>|</li> |*| <li>|</li> |*| <li>|</li>
}
CUR = 1
CUR {
allWrap = <li>|</li> |*| <li>|</li> |*| <li>|</li>
}
ACT = 1
ACT {
allWrap = <li>|</li> |*| <li>|</li> |*| <li>|</li>
}
}
}
Instead of displaying (always!) the first level of the page structure, the second level is shown, and so on. Particularly leaf nodes lead to an empty menu bar. I don't understand this, the diverse manuals clearly state that only the first level will always appear if no other level is defined! So how could it be that, e.g. the second level is displayed in the same way if it is not defined?
Typo3 version: 6.1.5
One of the possible reasons for this behavior is that somewhere in the rootline (probably on the first level) you have a template record that has "Rootlevel" set. Therefore this is then considered (at least in HMENUs) the root page and entryLevel = 0 thus produces subpages of this page.
How do I create a cube map in D3D11 from 6 images? All the examples I've found use only one .dds. Specifically, how do I upload individual faces of the cube texture?
It works like this:
D3D11_TEXTURE2D_DESC texDesc;
texDesc.Width = description.width;
texDesc.Height = description.height;
texDesc.MipLevels = 1;
texDesc.ArraySize = 6;
texDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
texDesc.CPUAccessFlags = 0;
texDesc.SampleDesc.Count = 1;
texDesc.SampleDesc.Quality = 0;
texDesc.Usage = D3D11_USAGE_DEFAULT;
texDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
texDesc.CPUAccessFlags = 0;
texDesc.MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE;
D3D11_SHADER_RESOURCE_VIEW_DESC SMViewDesc;
SMViewDesc.Format = texDesc.Format;
SMViewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
SMViewDesc.TextureCube.MipLevels = texDesc.MipLevels;
SMViewDesc.TextureCube.MostDetailedMip = 0;
D3D11_SUBRESOURCE_DATA pData[6];
std::vector<vector4b> d[6]; // 6 images of type vector4b = 4 * unsigned char
for (int cubeMapFaceIndex = 0; cubeMapFaceIndex < 6; cubeMapFaceIndex++)
{
d[cubeMapFaceIndex].resize(description.width * description.height);
// fill with red color
std::fill(
d[cubeMapFaceIndex].begin(),
d[cubeMapFaceIndex].end(),
vector4b(255,0,0,255));
pData[cubeMapFaceIndex].pSysMem = &d[cubeMapFaceIndex][0];// description.data;
pData[cubeMapFaceIndex].SysMemPitch = description.width * 4;
pData[cubeMapFaceIndex].SysMemSlicePitch = 0;
}
HRESULT hr = renderer->getDevice()->CreateTexture2D(&texDesc,
description.data[0] ? &pData[0] : nullptr, &m_pCubeTexture);
assert(hr == S_OK);
hr = renderer->getDevice()->CreateShaderResourceView(
m_pCubeTexture, &SMViewDesc, &m_pShaderResourceView);
assert(hr == S_OK);
This creates six "red" images, for the CubeMap.
I know this question is old, and there is already a solution.
Here is a code example that loads 6 textures from disk and puts them together as a cubemap:
Precondition:
ID3D11ShaderResourceView* srv = 0;
ID3D11Resource* srcTex[6];
Pointer to a ShaderResourceView and an array filled with the six textures from disc. I use the order right, left, top, bottom, front, back.
// Each element in the texture array has the same format/dimensions.
D3D11_TEXTURE2D_DESC texElementDesc;
((ID3D11Texture2D*)srcTex[0])->GetDesc(&texElementDesc);
D3D11_TEXTURE2D_DESC texArrayDesc;
texArrayDesc.Width = texElementDesc.Width;
texArrayDesc.Height = texElementDesc.Height;
texArrayDesc.MipLevels = texElementDesc.MipLevels;
texArrayDesc.ArraySize = 6;
texArrayDesc.Format = texElementDesc.Format;
texArrayDesc.SampleDesc.Count = 1;
texArrayDesc.SampleDesc.Quality = 0;
texArrayDesc.Usage = D3D11_USAGE_DEFAULT;
texArrayDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
texArrayDesc.CPUAccessFlags = 0;
texArrayDesc.MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE;
ID3D11Texture2D* texArray = 0;
if (FAILED(pd3dDevice->CreateTexture2D(&texArrayDesc, 0, &texArray)))
return false;
// Copy individual texture elements into texture array.
ID3D11DeviceContext* pd3dContext;
pd3dDevice->GetImmediateContext(&pd3dContext);
D3D11_BOX sourceRegion;
//Here i copy the mip map levels of the textures
for (UINT x = 0; x < 6; x++)
{
for (UINT mipLevel = 0; mipLevel < texArrayDesc.MipLevels; mipLevel++)
{
sourceRegion.left = 0;
sourceRegion.right = (texArrayDesc.Width >> mipLevel);
sourceRegion.top = 0;
sourceRegion.bottom = (texArrayDesc.Height >> mipLevel);
sourceRegion.front = 0;
sourceRegion.back = 1;
//test for overflow
if (sourceRegion.bottom == 0 || sourceRegion.right == 0)
break;
pd3dContext->CopySubresourceRegion(texArray, D3D11CalcSubresource(mipLevel, x, texArrayDesc.MipLevels), 0, 0, 0, srcTex[x], mipLevel, &sourceRegion);
}
}
// Create a resource view to the texture array.
D3D11_SHADER_RESOURCE_VIEW_DESC viewDesc;
viewDesc.Format = texArrayDesc.Format;
viewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
viewDesc.TextureCube.MostDetailedMip = 0;
viewDesc.TextureCube.MipLevels = texArrayDesc.MipLevels;
if (FAILED(pd3dDevice->CreateShaderResourceView(texArray, &viewDesc, &srv)))
return false;
If anyone reads this question again, maybe try this one. Warning: this function is not threadsafe, because i have to use the deviceContext.
I want to click on the text "English" to get the english version of the website. Before I had a graphical menu:
lib.tslangmenu = HMENU
lib.tslangmenu {
special = language
special.value = 0,1,2
addQueryString = 1
1 = GMENU
1.NO {
XY = 24,16
5 = IMAGE
5.file = fileadmin/templates/images/deutsch.jpg || fileadmin/templates/images/englisch.jpg || fileadmin/templates/images/kroatisch.jpg
}
1.ACT < 1.NO
1.ACT = 1
1.ACT.wrap = <span class="langhide"> | </span>
1.CUR < 1.ACT
1.CUR = 1
}
This worked so far. Now I should change the menu to a text-based menu.
lib.tslangmenu {
special = language
special.value = 0,1,2
special.normalWhenNoLanguage = 0
addQueryString = 1
1 = TMENU
1.NO = 1
1.NO.stdWrap.override = Deutsch || English || Hrvatski
1.ACT < 1.NO
1.ACT = 1
1.ACT.stdWrap = <span class="langhide"> | </span>
1.CUR < 1.ACT
1.CUR = 1
}
Now the wrap with the span is completely ignored. Also the menu is now displayed as follows:
MyCurrentPageName English Hrvatski
If I'm on german the word deutsch is overwritten with the current page title. The same is valid for all other languages. I also tried the TS given in this blog article. But currently it does the same. How do I get this working?
The first error is in your wrap: NO is not wrapped, so no span is generated (for NO-items). The problem that the page title is shown comes from wrong copying. The line
1.ACT < 1.NO
should really be
1.ACT < .1.NO
Just in case, here is a TS-config I have in active use:
lib.languageMenu = HMENU
lib.languageMenu {
special = language
special.value = 0,1
1 = TMENU
1 {
wrap = <ul class="langMenu">|</ul>
noBlur = 1
NO = 1
NO {
linkWrap = <li class="menu-item normal">|</li>
stdWrap.override = English || Deutsch
stdWrap.htmlSpecialChars = 1
}
ACT < .NO
ACT {
doNotLinkIt = 1
linkWrap = <li class="menu-item active">|</li>
}
# NO + Translation doesn't exist
USERDEF1 < .NO
USERDEF1.doNotLinkIt = 1
# ACT + Translation doesn't exist
USERDEF2 < .ACT
USERDEF2.doNotLinkIt = 1
}
}
Regards,
Jost
Check Here with flag icon
lib.languageMenu = HMENU
lib.languageMenu{
special = language
special.value = 0,1
protectLvar = 1
special.normalWhenNoLanguage = 0
# wrap = <div class="language"><ul>|</ul></div>
1 = TMENU
1 {
NO = 1
NO {
# linkWrap = <li class="in-active">|</li> || <li class="in-active">|</li>
stdWrap.override = {$germanLabel}<img alt="" src="typo3conf/ext/website_lctech/Resources/Public/images/german.png">|| {$englishLabel}<img alt="" src="typo3conf/ext/website_lctech/Resources/Public/images/english.png">
doNotLinkIt = 1
stdWrap.typolink.parameter.data = page:uid
stdWrap.typolink.additionalParams = &L=0 || &L=1
stdWrap.typolink.addQueryString = 1
stdWrap.typolink.ATagParams =class="InActive"
stdWrap.typolink.addQueryString.exclude = id,cHash,no_cache
stdWrap.typolink.addQueryString.method = GET
stdWrap.typolink.useCacheHash = 0
stdWrap.typolink.no_cache = 0
stdWrap.htmlSpecialChars = 0
# normalWhenNoLanguage = 0
}
ACT = 1
ACT < .NO
ACT.stdWrap.typolink.ATagParams =class="Active"
ACT.stdWrap.htmlSpecialChars = 0
# USERDEF1 < .NO
# USERDEF1.doNotLinkIt = 0
}
}